feat(memory): implement stability stage
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -167,6 +167,32 @@ export const PlayerIntentSchema = z.object({
|
||||
})
|
||||
export type PlayerIntent = z.infer<typeof PlayerIntentSchema>
|
||||
|
||||
export const ContextEntitySchema = WorldEntitySchema.pick({
|
||||
id: true,
|
||||
kind: true,
|
||||
name: true,
|
||||
summary: true,
|
||||
tags: true,
|
||||
})
|
||||
export type ContextEntity = z.infer<typeof ContextEntitySchema>
|
||||
|
||||
export const RelationshipStateSchema = z.object({
|
||||
sourceEntityId: z.string().min(1),
|
||||
targetEntityId: z.string().min(1),
|
||||
score: z.number().int().min(-100).max(100),
|
||||
notes: z.string().max(1200),
|
||||
})
|
||||
export type RelationshipState = z.infer<typeof RelationshipStateSchema>
|
||||
|
||||
export const QuestStateSchema = z.object({
|
||||
questEntityId: z.string().min(1),
|
||||
name: z.string().min(1).max(120),
|
||||
status: z.enum(['hidden', 'active', 'completed', 'failed']),
|
||||
summary: z.string().min(1).max(1200),
|
||||
tags: z.array(z.string().max(40)).max(12).default([]),
|
||||
})
|
||||
export type QuestState = z.infer<typeof QuestStateSchema>
|
||||
|
||||
export const RoundContextSchema = z.object({
|
||||
scene: z.string().max(6000),
|
||||
storySummary: z.string().max(6000).nullable(),
|
||||
@@ -178,6 +204,9 @@ export const RoundContextSchema = z.object({
|
||||
humanIntents: z.array(PlayerIntentSchema).max(8),
|
||||
aiCharacters: z.array(CharacterSchema).max(8),
|
||||
activeCharacters: z.array(CharacterSchema).max(16),
|
||||
entities: z.array(ContextEntitySchema).max(12).default([]),
|
||||
relationships: z.array(RelationshipStateSchema).max(20).default([]),
|
||||
activeGoals: z.array(QuestStateSchema).max(8).default([]),
|
||||
memories: z.array(z.object({
|
||||
summary: z.string().min(1).max(1200),
|
||||
importance: z.number().int().min(1).max(5).optional(),
|
||||
|
||||
Reference in New Issue
Block a user