suemo 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts CHANGED
@@ -32,12 +32,14 @@ export const MemoryNodeSchema = z.object({
32
32
  summary: z.string().nullable(),
33
33
  tags: z.array(z.string()),
34
34
  scope: z.string().nullable(),
35
+ topic_key: z.string().nullable(),
35
36
  embedding: z.array(z.number()),
36
37
  confidence: z.number().min(0).max(1),
37
38
  salience: z.number().min(0).max(1),
38
39
  valid_from: z.iso.datetime(),
39
40
  valid_until: z.iso.datetime().nullable(),
40
41
  source: z.string().nullable(),
42
+ prompt_source: z.union([z.string(), z.object({ tb: z.string(), id: z.string() })]).nullable(),
41
43
  created_at: z.iso.datetime(),
42
44
  updated_at: z.iso.datetime(),
43
45
  consolidated: z.boolean(),
@@ -58,6 +60,7 @@ export const RelationSchema = z.object({
58
60
  valid_from: z.iso.datetime(),
59
61
  valid_until: z.iso.datetime().nullable(),
60
62
  created_at: z.iso.datetime(),
63
+ updated_at: z.iso.datetime(),
61
64
  })
62
65
  export type Relation = z.infer<typeof RelationSchema>
63
66
 
@@ -68,7 +71,8 @@ export const EpisodeSchema = z.object({
68
71
  started_at: z.iso.datetime(),
69
72
  ended_at: z.iso.datetime().nullable(),
70
73
  summary: z.string().nullable(),
71
- memory_ids: z.array(z.string()),
74
+ context: z.record(z.string(), z.unknown()).nullable(),
75
+ memory_ids: z.array(z.union([z.string(), z.object({ tb: z.string(), id: z.string() })])),
72
76
  })
73
77
  export type Episode = z.infer<typeof EpisodeSchema>
74
78
 
@@ -91,13 +95,27 @@ export type ConsolidationRun = z.infer<typeof ConsolidationRunSchema>
91
95
  // from input — this is the intended behavior for all optional fields here.
92
96
  export const ObserveInputSchema = z.object({
93
97
  content: z.string().min(1),
94
- kind: MemoryKindSchema.default('observation').optional(),
95
- tags: z.array(z.string()).default([]).optional(),
98
+ kind: MemoryKindSchema.default('observation'),
99
+ tags: z.array(z.string()).default([]),
96
100
  scope: z.string().optional(),
97
101
  source: z.string().optional(),
98
- confidence: z.number().min(0).max(1).default(1.0).optional(),
102
+ confidence: z.number().min(0).max(1).default(1.0),
103
+ sessionId: z.string().optional(),
104
+ })
105
+ export type ObserveInput = z.input<typeof ObserveInputSchema>
106
+
107
+ export const SuemoStatsSchema = z.object({
108
+ totalNodes: z.number(),
109
+ activeNodes: z.number(),
110
+ nodesByKind: z.record(z.string(), z.number()),
111
+ relations: z.number(),
112
+ consolidationRuns: z.number(),
113
+ lastWrite: z.iso.datetime().nullable(),
114
+ lastQuery: z.iso.datetime().nullable(),
115
+ totalWrites: z.number(),
116
+ totalQueries: z.number(),
99
117
  })
100
- export type ObserveInput = z.infer<typeof ObserveInputSchema>
118
+ export type SuemoStats = z.infer<typeof SuemoStatsSchema>
101
119
 
102
120
  // ── query() input ─────────────────────────────────────────────────────────────
103
121
  export const QueryInputSchema = z.object({
@@ -140,5 +158,12 @@ export const SyncResultSchema = z.object({
140
158
  skipped: z.number(),
141
159
  errors: z.number(),
142
160
  cursor: z.iso.datetime(),
161
+ push_cursor: z.iso.datetime().optional(),
162
+ pull_cursor: z.iso.datetime().optional(),
163
+ integrity: z.object({
164
+ sourceCount: z.number(),
165
+ destCount: z.number(),
166
+ match: z.boolean(),
167
+ }).optional(),
143
168
  })
144
169
  export type SyncResult = z.infer<typeof SyncResultSchema>