@hexis-ai/engram-server 0.6.0 → 0.7.0

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/dist/schemas.d.ts CHANGED
@@ -36,6 +36,20 @@ export declare const sessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
36
36
  type: z.ZodLiteral<"end">;
37
37
  seq: z.ZodNumber;
38
38
  at: z.ZodString;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ type: z.ZodLiteral<"message">;
41
+ seq: z.ZodNumber;
42
+ at: z.ZodString;
43
+ message_id: z.ZodOptional<z.ZodString>;
44
+ role: z.ZodString;
45
+ content: z.ZodArray<z.ZodObject<{
46
+ type: z.ZodString;
47
+ }, z.core.$loose>>;
48
+ model: z.ZodOptional<z.ZodString>;
49
+ tokens: z.ZodOptional<z.ZodObject<{
50
+ input: z.ZodNumber;
51
+ output: z.ZodNumber;
52
+ }, z.core.$strip>>;
39
53
  }, z.core.$strip>], "type">;
40
54
  export declare const eventBatchSchema: z.ZodObject<{
41
55
  events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -58,6 +72,20 @@ export declare const eventBatchSchema: z.ZodObject<{
58
72
  type: z.ZodLiteral<"end">;
59
73
  seq: z.ZodNumber;
60
74
  at: z.ZodString;
75
+ }, z.core.$strip>, z.ZodObject<{
76
+ type: z.ZodLiteral<"message">;
77
+ seq: z.ZodNumber;
78
+ at: z.ZodString;
79
+ message_id: z.ZodOptional<z.ZodString>;
80
+ role: z.ZodString;
81
+ content: z.ZodArray<z.ZodObject<{
82
+ type: z.ZodString;
83
+ }, z.core.$loose>>;
84
+ model: z.ZodOptional<z.ZodString>;
85
+ tokens: z.ZodOptional<z.ZodObject<{
86
+ input: z.ZodNumber;
87
+ output: z.ZodNumber;
88
+ }, z.core.$strip>>;
61
89
  }, z.core.$strip>], "type">>;
62
90
  }, z.core.$strip>;
63
91
  export declare const personCreateSchema: z.ZodObject<{
package/dist/schemas.js CHANGED
@@ -40,11 +40,35 @@ const endEventSchema = z.object({
40
40
  seq: z.number().int().nonnegative(),
41
41
  at: z.string(),
42
42
  });
43
+ // Content block validation is permissive on purpose: engram doesn't
44
+ // interpret the payload, just stores it. Each block must declare a
45
+ // `type: string` so consumers can dispatch on it; everything else
46
+ // passes through untouched, which makes the wire forward-compatible
47
+ // with future Anthropic / vendor block types without an SDK upgrade.
48
+ const messageContentBlockSchema = z
49
+ .object({ type: z.string().min(1) })
50
+ .passthrough();
51
+ const messageEventSchema = z.object({
52
+ type: z.literal("message"),
53
+ seq: z.number().int().nonnegative(),
54
+ at: z.string(),
55
+ message_id: z.string().optional(),
56
+ role: z.string().min(1),
57
+ content: z.array(messageContentBlockSchema),
58
+ model: z.string().optional(),
59
+ tokens: z
60
+ .object({
61
+ input: z.number().int().nonnegative(),
62
+ output: z.number().int().nonnegative(),
63
+ })
64
+ .optional(),
65
+ });
43
66
  export const sessionEventSchema = z.discriminatedUnion("type", [
44
67
  stepEventSchema,
45
68
  participantEventSchema,
46
69
  titleEventSchema,
47
70
  endEventSchema,
71
+ messageEventSchema,
48
72
  ]);
49
73
  export const eventBatchSchema = z.object({
50
74
  events: z.array(sessionEventSchema),
package/openapi.json CHANGED
@@ -206,6 +206,77 @@
206
206
  "at"
207
207
  ],
208
208
  "additionalProperties": false
209
+ },
210
+ {
211
+ "type": "object",
212
+ "properties": {
213
+ "type": {
214
+ "type": "string",
215
+ "const": "message"
216
+ },
217
+ "seq": {
218
+ "type": "integer",
219
+ "minimum": 0,
220
+ "maximum": 9007199254740991
221
+ },
222
+ "at": {
223
+ "type": "string"
224
+ },
225
+ "message_id": {
226
+ "type": "string"
227
+ },
228
+ "role": {
229
+ "type": "string",
230
+ "minLength": 1
231
+ },
232
+ "content": {
233
+ "type": "array",
234
+ "items": {
235
+ "type": "object",
236
+ "properties": {
237
+ "type": {
238
+ "type": "string",
239
+ "minLength": 1
240
+ }
241
+ },
242
+ "required": [
243
+ "type"
244
+ ],
245
+ "additionalProperties": {}
246
+ }
247
+ },
248
+ "model": {
249
+ "type": "string"
250
+ },
251
+ "tokens": {
252
+ "type": "object",
253
+ "properties": {
254
+ "input": {
255
+ "type": "integer",
256
+ "minimum": 0,
257
+ "maximum": 9007199254740991
258
+ },
259
+ "output": {
260
+ "type": "integer",
261
+ "minimum": 0,
262
+ "maximum": 9007199254740991
263
+ }
264
+ },
265
+ "required": [
266
+ "input",
267
+ "output"
268
+ ],
269
+ "additionalProperties": false
270
+ }
271
+ },
272
+ "required": [
273
+ "type",
274
+ "seq",
275
+ "at",
276
+ "role",
277
+ "content"
278
+ ],
279
+ "additionalProperties": false
209
280
  }
210
281
  ]
211
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexis-ai/engram-server",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Engram server: ingest agent session events, persist via a pluggable adapter, expose search.",
5
5
  "keywords": [
6
6
  "engram",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@hexis-ai/engram-core": "^0.1.5",
53
- "@hexis-ai/engram-sdk": "^0.5.0",
53
+ "@hexis-ai/engram-sdk": "^0.6.0",
54
54
  "hono": "^4.6.0",
55
55
  "zod": "^4.0.0"
56
56
  },