feat: update Makelore modules and conversations
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
import { create } from 'zustand';
|
||||
import { createJSONStorage, persist, type StateStorage } from 'zustand/middleware';
|
||||
import type { BuiltInRoleSubagentId } from '@/lib/role-subagents';
|
||||
import { toUserSyncPartner, type UserSyncPartner } from '../../shared/user-sync';
|
||||
|
||||
export const partnerAvatarToneOptions = [
|
||||
'bg-[#b47745]',
|
||||
'bg-[#FDE8E1]',
|
||||
'bg-[#F26A3D]',
|
||||
'bg-[#DCE6EF]',
|
||||
'bg-[#EEF3F7]',
|
||||
'bg-[#b8a7ff]',
|
||||
'bg-accent-soft',
|
||||
'bg-brand-soft',
|
||||
'bg-accent',
|
||||
'bg-surface-tertiary',
|
||||
'bg-surface-subtle',
|
||||
'bg-brand/20',
|
||||
] as const;
|
||||
|
||||
export type PartnerProfile = {
|
||||
@@ -27,7 +26,9 @@ export type PartnerProfileInput = {
|
||||
avatarDataUrl?: string;
|
||||
};
|
||||
|
||||
export type PartnerTemplateRoleId = BuiltInRoleSubagentId | 'custom';
|
||||
// Kept as a serialized compatibility field for synced partner records. New
|
||||
// partners are always manually configured and use the single custom value.
|
||||
export type PartnerTemplateRoleId = 'custom';
|
||||
|
||||
export type CreatedPartnerSubagent = {
|
||||
id: string;
|
||||
@@ -52,7 +53,7 @@ export type ProjectSubagentRuntimeConfig = {
|
||||
type PartnerProfilesState = {
|
||||
subagents: CreatedPartnerSubagent[];
|
||||
projectRuntimeConfigsByProjectId: Record<string, Record<string, ProjectSubagentRuntimeConfig>>;
|
||||
profilesById: Partial<Record<BuiltInRoleSubagentId, PartnerProfile>>;
|
||||
profilesById: Record<string, PartnerProfile>;
|
||||
addSubagent: (subagent: CreatedPartnerSubagent) => void;
|
||||
updatePartnerProfile: (agentId: string, profile: PartnerProfileInput) => void;
|
||||
updateSubagentRuntimeConfig: (agentId: string, config: Pick<CreatedPartnerSubagent, 'skillIds' | 'filePath' | 'updatedAt'>) => void;
|
||||
@@ -188,12 +189,11 @@ export const usePartnerProfilesStore = create<PartnerProfilesState>()(
|
||||
}
|
||||
|
||||
const nextProfiles = { ...state.profilesById };
|
||||
const legacyAgentId = agentId as BuiltInRoleSubagentId;
|
||||
if (!hasProfileData(cleaned)) {
|
||||
delete nextProfiles[legacyAgentId];
|
||||
delete nextProfiles[agentId];
|
||||
return { profilesById: nextProfiles };
|
||||
}
|
||||
nextProfiles[legacyAgentId] = { ...cleaned, updatedAt: now };
|
||||
nextProfiles[agentId] = { ...cleaned, updatedAt: now };
|
||||
return { profilesById: nextProfiles };
|
||||
});
|
||||
if (updatedSubagent) {
|
||||
@@ -256,7 +256,7 @@ export const usePartnerProfilesStore = create<PartnerProfilesState>()(
|
||||
};
|
||||
}
|
||||
const nextProfiles = { ...state.profilesById };
|
||||
delete nextProfiles[agentId as BuiltInRoleSubagentId];
|
||||
delete nextProfiles[agentId];
|
||||
return { profilesById: nextProfiles };
|
||||
});
|
||||
if (updatedSubagent) {
|
||||
@@ -269,7 +269,7 @@ export const usePartnerProfilesStore = create<PartnerProfilesState>()(
|
||||
subagents: partners.map((partner) => ({
|
||||
id: partner.id,
|
||||
displayName: partner.displayName,
|
||||
templateRoleId: partner.templateRoleId as PartnerTemplateRoleId,
|
||||
templateRoleId: 'custom',
|
||||
description: partner.description,
|
||||
avatarTone: partner.avatarTone,
|
||||
avatarDataUrl: partner.avatarDataUrl,
|
||||
|
||||
Reference in New Issue
Block a user