@heynixie/contract 0.67.0 → 0.69.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/build-query-utils.d.ts +119 -0
- package/dist/contract.d.ts +117 -0
- package/dist/forget-backup-schema.d.ts +13 -0
- package/dist/host-contract.d.ts +169 -0
- package/dist/index.js +690 -588
- package/dist/memory-view-contract.d.ts +36 -0
- package/dist/rule-contract.d.ts +65 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -150,7 +150,7 @@ function mergeSpans(spans) {
|
|
|
150
150
|
var clientHeaderName = "x-nixie-client";
|
|
151
151
|
// src/contract.ts
|
|
152
152
|
import { eventIterator as eventIterator2, oc as oc2 } from "@orpc/contract";
|
|
153
|
-
import { z as
|
|
153
|
+
import { z as z11 } from "zod";
|
|
154
154
|
|
|
155
155
|
// src/image-limits.ts
|
|
156
156
|
var imageLimits = {
|
|
@@ -179,11 +179,21 @@ var imageRefusedError = {
|
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
// src/memory-view-contract.ts
|
|
182
|
-
import { z as
|
|
182
|
+
import { z as z6 } from "zod";
|
|
183
|
+
|
|
184
|
+
// src/forget-backup-schema.ts
|
|
185
|
+
import { z as z2 } from "zod";
|
|
186
|
+
var forgetBackupSchema = z2.discriminatedUnion("state", [
|
|
187
|
+
z2.object({ state: z2.literal("off") }),
|
|
188
|
+
z2.object({ state: z2.literal("pending") }),
|
|
189
|
+
z2.object({ state: z2.literal("failed"), failure: z2.string() }),
|
|
190
|
+
z2.object({ state: z2.literal("complete") }),
|
|
191
|
+
z2.object({ state: z2.literal("unknown") })
|
|
192
|
+
]);
|
|
183
193
|
|
|
184
194
|
// src/memory-export-contract.ts
|
|
185
195
|
import { eventIterator } from "@orpc/contract";
|
|
186
|
-
import { z as
|
|
196
|
+
import { z as z3 } from "zod";
|
|
187
197
|
|
|
188
198
|
// src/reused-id-errors.ts
|
|
189
199
|
var reusedIDErrors = {
|
|
@@ -203,42 +213,42 @@ var signedIn = oc.errors({
|
|
|
203
213
|
var checkedExport = signedIn.errors(reusedIDErrors).errors({
|
|
204
214
|
MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 }
|
|
205
215
|
});
|
|
206
|
-
var exportEvent =
|
|
207
|
-
|
|
208
|
-
|
|
216
|
+
var exportEvent = z3.union([
|
|
217
|
+
z3.object({ chunk: z3.string() }),
|
|
218
|
+
z3.object({ isComplete: z3.literal(true) })
|
|
209
219
|
]);
|
|
210
220
|
var exportEvents = eventIterator(exportEvent);
|
|
211
221
|
var memoryExportContract = {
|
|
212
|
-
export: checkedExport.input(
|
|
222
|
+
export: checkedExport.input(z3.object({ clientActionID: z3.uuid() })).output(exportEvents)
|
|
213
223
|
};
|
|
214
224
|
|
|
215
225
|
// src/moment-contract.ts
|
|
216
|
-
import { z as
|
|
226
|
+
import { z as z4 } from "zod";
|
|
217
227
|
var momentView = signedIn.errors({
|
|
218
228
|
MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 },
|
|
219
229
|
MOMENT_NOT_FOUND: { message: "No moment has this ID", status: 404 },
|
|
220
230
|
STALE_VERSION: { message: "The moment has moved past that version", status: 409 }
|
|
221
231
|
});
|
|
222
|
-
var momentIDSchema =
|
|
223
|
-
var momentTargetSchema =
|
|
224
|
-
var reflectionSchema =
|
|
225
|
-
model:
|
|
226
|
-
text:
|
|
227
|
-
writtenAt:
|
|
228
|
-
});
|
|
229
|
-
var destroyPreviewSchema =
|
|
230
|
-
keptAt:
|
|
231
|
-
keptBy:
|
|
232
|
-
kept:
|
|
233
|
-
lost:
|
|
234
|
-
momentID:
|
|
235
|
-
note:
|
|
236
|
-
reflections:
|
|
237
|
-
shortID:
|
|
238
|
-
state:
|
|
239
|
-
thread:
|
|
240
|
-
title:
|
|
241
|
-
version:
|
|
232
|
+
var momentIDSchema = z4.string().min(1).max(200);
|
|
233
|
+
var momentTargetSchema = z4.object({ momentID: momentIDSchema, version: z4.int().positive() });
|
|
234
|
+
var reflectionSchema = z4.object({
|
|
235
|
+
model: z4.string(),
|
|
236
|
+
text: z4.string().nullable(),
|
|
237
|
+
writtenAt: z4.date()
|
|
238
|
+
});
|
|
239
|
+
var destroyPreviewSchema = z4.object({
|
|
240
|
+
keptAt: z4.date(),
|
|
241
|
+
keptBy: z4.enum(["owner", "model"]),
|
|
242
|
+
kept: z4.object({ records: z4.int().nonnegative() }),
|
|
243
|
+
lost: z4.object({ links: z4.int().nonnegative(), texts: z4.int().nonnegative() }),
|
|
244
|
+
momentID: z4.string(),
|
|
245
|
+
note: z4.string().nullable(),
|
|
246
|
+
reflections: z4.array(reflectionSchema),
|
|
247
|
+
shortID: z4.string(),
|
|
248
|
+
state: z4.enum(["active", "retired"]),
|
|
249
|
+
thread: z4.string(),
|
|
250
|
+
title: z4.string().nullable(),
|
|
251
|
+
version: z4.int().positive()
|
|
242
252
|
});
|
|
243
253
|
var momentKeep = signedIn.errors(reusedIDErrors).errors({
|
|
244
254
|
MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 },
|
|
@@ -247,113 +257,113 @@ var momentKeep = signedIn.errors(reusedIDErrors).errors({
|
|
|
247
257
|
status: 422
|
|
248
258
|
}
|
|
249
259
|
});
|
|
250
|
-
var titleSchema =
|
|
251
|
-
var keepSchema =
|
|
252
|
-
clientActionID:
|
|
253
|
-
firstSequence:
|
|
254
|
-
lastSequence:
|
|
255
|
-
thread:
|
|
260
|
+
var titleSchema = z4.string().min(1).max(120).regex(/\S/u);
|
|
261
|
+
var keepSchema = z4.object({
|
|
262
|
+
clientActionID: z4.uuid(),
|
|
263
|
+
firstSequence: z4.int().nonnegative(),
|
|
264
|
+
lastSequence: z4.int().nonnegative(),
|
|
265
|
+
thread: z4.string().min(1).max(200),
|
|
256
266
|
title: titleSchema
|
|
257
267
|
});
|
|
258
|
-
var momentSummarySchema =
|
|
259
|
-
editedAt:
|
|
260
|
-
keptAt:
|
|
261
|
-
keptBy:
|
|
262
|
-
momentID:
|
|
263
|
-
shortID:
|
|
264
|
-
state:
|
|
265
|
-
title:
|
|
266
|
-
});
|
|
267
|
-
var momentListSchema =
|
|
268
|
-
before:
|
|
269
|
-
includeRetired:
|
|
270
|
-
query:
|
|
271
|
-
});
|
|
272
|
-
var linkSchema =
|
|
273
|
-
itemID:
|
|
274
|
-
shortID:
|
|
275
|
-
text:
|
|
276
|
-
});
|
|
277
|
-
var noteSchema =
|
|
278
|
-
var shownReflectionSchema = reflectionSchema.extend({ reflectionID:
|
|
268
|
+
var momentSummarySchema = z4.object({
|
|
269
|
+
editedAt: z4.date().nullable(),
|
|
270
|
+
keptAt: z4.date(),
|
|
271
|
+
keptBy: z4.enum(["owner", "model"]),
|
|
272
|
+
momentID: z4.string(),
|
|
273
|
+
shortID: z4.string(),
|
|
274
|
+
state: z4.enum(["active", "retired"]),
|
|
275
|
+
title: z4.string().nullable()
|
|
276
|
+
});
|
|
277
|
+
var momentListSchema = z4.object({
|
|
278
|
+
before: z4.int().nonnegative().optional(),
|
|
279
|
+
includeRetired: z4.boolean(),
|
|
280
|
+
query: z4.string().max(500).optional()
|
|
281
|
+
});
|
|
282
|
+
var linkSchema = z4.object({
|
|
283
|
+
itemID: z4.string(),
|
|
284
|
+
shortID: z4.string(),
|
|
285
|
+
text: z4.string().nullable()
|
|
286
|
+
});
|
|
287
|
+
var noteSchema = z4.object({ text: z4.string(), writtenAt: z4.date() });
|
|
288
|
+
var shownReflectionSchema = reflectionSchema.extend({ reflectionID: z4.string() });
|
|
279
289
|
var momentDetailSchema = momentSummarySchema.extend({
|
|
280
|
-
firstSequence:
|
|
281
|
-
lastSequence:
|
|
282
|
-
links:
|
|
290
|
+
firstSequence: z4.int().nonnegative(),
|
|
291
|
+
lastSequence: z4.int().nonnegative(),
|
|
292
|
+
links: z4.array(linkSchema),
|
|
283
293
|
note: noteSchema.nullable(),
|
|
284
|
-
reflections:
|
|
285
|
-
thread:
|
|
286
|
-
titleBy:
|
|
287
|
-
version:
|
|
288
|
-
});
|
|
289
|
-
var spanRecordSchema =
|
|
290
|
-
isGap:
|
|
291
|
-
kind:
|
|
292
|
-
recordedAt:
|
|
293
|
-
sequence:
|
|
294
|
-
text:
|
|
295
|
-
tool:
|
|
296
|
-
});
|
|
297
|
-
var momentChangeSchema =
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
kind:
|
|
301
|
-
firstSequence:
|
|
302
|
-
lastSequence:
|
|
294
|
+
reflections: z4.array(shownReflectionSchema),
|
|
295
|
+
thread: z4.string(),
|
|
296
|
+
titleBy: z4.enum(["owner", "model"]),
|
|
297
|
+
version: z4.int().positive()
|
|
298
|
+
});
|
|
299
|
+
var spanRecordSchema = z4.object({
|
|
300
|
+
isGap: z4.boolean(),
|
|
301
|
+
kind: z4.string(),
|
|
302
|
+
recordedAt: z4.date(),
|
|
303
|
+
sequence: z4.int().nonnegative(),
|
|
304
|
+
text: z4.string().nullable(),
|
|
305
|
+
tool: z4.string().nullable()
|
|
306
|
+
});
|
|
307
|
+
var momentChangeSchema = z4.discriminatedUnion("kind", [
|
|
308
|
+
z4.object({ kind: z4.literal("title"), title: titleSchema }),
|
|
309
|
+
z4.object({
|
|
310
|
+
kind: z4.literal("edges"),
|
|
311
|
+
firstSequence: z4.int().nonnegative(),
|
|
312
|
+
lastSequence: z4.int().nonnegative()
|
|
303
313
|
}),
|
|
304
|
-
|
|
305
|
-
|
|
314
|
+
z4.object({ kind: z4.literal("note"), note: z4.string().min(1).max(4000).regex(/\S/u) }),
|
|
315
|
+
z4.object({ kind: z4.literal("reflection_removed"), reflectionID: z4.string().min(1).max(200) })
|
|
306
316
|
]);
|
|
307
317
|
var momentChange = momentView.errors(reusedIDErrors);
|
|
308
318
|
var momentContract = {
|
|
309
|
-
keepMoment: momentKeep.input(keepSchema).output(
|
|
319
|
+
keepMoment: momentKeep.input(keepSchema).output(z4.object({ momentID: z4.string(), shortID: z4.string() })),
|
|
310
320
|
listMoments: signedIn.errors({
|
|
311
321
|
MEMORY_NOT_STARTED: { message: "The memory store has not started yet", status: 503 }
|
|
312
|
-
}).input(momentListSchema).output(
|
|
313
|
-
readMoment: momentView.input(
|
|
314
|
-
readMomentSpan: momentView.input(
|
|
322
|
+
}).input(momentListSchema).output(z4.object({ moments: z4.array(momentSummarySchema), next: z4.int().nonnegative().nullable() })),
|
|
323
|
+
readMoment: momentView.input(z4.object({ momentID: momentIDSchema })).output(momentDetailSchema),
|
|
324
|
+
readMomentSpan: momentView.input(z4.object({ momentID: momentIDSchema, after: z4.int().nonnegative().optional() })).output(z4.object({ records: z4.array(spanRecordSchema), next: z4.int().nonnegative().nullable() })),
|
|
315
325
|
editMoment: momentChange.errors({
|
|
316
326
|
BAD_SPAN: {
|
|
317
327
|
message: "The span needs a first and a last record on the thread, in order",
|
|
318
328
|
status: 422
|
|
319
329
|
},
|
|
320
330
|
REFLECTION_NOT_FOUND: { message: "The moment has no reflection with this ID", status: 404 }
|
|
321
|
-
}).input(momentTargetSchema.extend({ clientActionID:
|
|
331
|
+
}).input(momentTargetSchema.extend({ clientActionID: z4.uuid(), change: momentChangeSchema })).output(z4.object({ momentID: z4.string(), version: z4.int().positive() })),
|
|
322
332
|
linkMoment: momentChange.errors({
|
|
323
333
|
MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 },
|
|
324
334
|
ALREADY_LINKED: { message: "The item is already linked to the moment", status: 409 },
|
|
325
335
|
NOT_LINKED: { message: "The item is not linked to the moment", status: 409 }
|
|
326
336
|
}).input(momentTargetSchema.extend({
|
|
327
|
-
clientActionID:
|
|
328
|
-
isLinked:
|
|
329
|
-
itemID:
|
|
330
|
-
})).output(
|
|
337
|
+
clientActionID: z4.uuid(),
|
|
338
|
+
isLinked: z4.boolean(),
|
|
339
|
+
itemID: z4.string().min(1).max(200)
|
|
340
|
+
})).output(z4.object({ momentID: z4.string(), version: z4.int().positive() })),
|
|
331
341
|
previewMomentDestroy: momentView.input(momentTargetSchema).output(destroyPreviewSchema),
|
|
332
|
-
destroyMoment: momentView.errors(reusedIDErrors).input(momentTargetSchema.extend({ clientActionID:
|
|
342
|
+
destroyMoment: momentView.errors(reusedIDErrors).input(momentTargetSchema.extend({ clientActionID: z4.uuid() })).output(z4.object({ momentID: z4.string() }))
|
|
333
343
|
};
|
|
334
344
|
|
|
335
345
|
// src/proposal-outcome-schema.ts
|
|
336
|
-
import { z as
|
|
337
|
-
var closeMatchSchema =
|
|
338
|
-
itemID:
|
|
339
|
-
text:
|
|
340
|
-
version:
|
|
346
|
+
import { z as z5 } from "zod";
|
|
347
|
+
var closeMatchSchema = z5.object({
|
|
348
|
+
itemID: z5.string(),
|
|
349
|
+
text: z5.string(),
|
|
350
|
+
version: z5.int().positive()
|
|
341
351
|
});
|
|
342
|
-
var proposalOutcomeSchema =
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
352
|
+
var proposalOutcomeSchema = z5.discriminatedUnion("status", [
|
|
353
|
+
z5.object({ proposalID: z5.string(), status: z5.literal("applied") }),
|
|
354
|
+
z5.object({ proposalID: z5.string(), status: z5.literal("rejected") }),
|
|
355
|
+
z5.object({
|
|
346
356
|
item: closeMatchSchema,
|
|
347
|
-
proposalID:
|
|
348
|
-
status:
|
|
357
|
+
proposalID: z5.string(),
|
|
358
|
+
status: z5.literal("close_match")
|
|
349
359
|
}),
|
|
350
|
-
|
|
351
|
-
cause:
|
|
352
|
-
proposalID:
|
|
353
|
-
status:
|
|
360
|
+
z5.object({
|
|
361
|
+
cause: z5.enum(["lapsed", "answered", "moved", "changed", "gone"]),
|
|
362
|
+
proposalID: z5.string(),
|
|
363
|
+
status: z5.literal("stale")
|
|
354
364
|
}),
|
|
355
|
-
|
|
356
|
-
code:
|
|
365
|
+
z5.object({
|
|
366
|
+
code: z5.enum([
|
|
357
367
|
"CLIENT_ACTION_ID_REUSED",
|
|
358
368
|
"PIN_EDIT",
|
|
359
369
|
"PINNED_CORE_FULL",
|
|
@@ -361,8 +371,8 @@ var proposalOutcomeSchema = z4.discriminatedUnion("status", [
|
|
|
361
371
|
"REVISION_TARGET",
|
|
362
372
|
"WRONG_STATE"
|
|
363
373
|
]),
|
|
364
|
-
proposalID:
|
|
365
|
-
status:
|
|
374
|
+
proposalID: z5.string(),
|
|
375
|
+
status: z5.literal("refused")
|
|
366
376
|
})
|
|
367
377
|
]);
|
|
368
378
|
|
|
@@ -375,68 +385,68 @@ var memoryChange = memoryView.errors(reusedIDErrors).errors({
|
|
|
375
385
|
STALE_VERSION: { message: "The memory item has moved past that version", status: 409 },
|
|
376
386
|
WRONG_STATE: { message: "The memory item is not in a state that change takes", status: 409 }
|
|
377
387
|
});
|
|
378
|
-
var itemIDSchema =
|
|
379
|
-
var itemTextSchema =
|
|
380
|
-
var proposalOriginSchema =
|
|
381
|
-
var originSchema =
|
|
382
|
-
var sourceSchema =
|
|
383
|
-
var subjectSchema =
|
|
384
|
-
var kindSchema =
|
|
385
|
-
var memoryItemSchema =
|
|
386
|
-
changedAt:
|
|
387
|
-
createdAt:
|
|
388
|
-
forgottenAt:
|
|
389
|
-
isPinned:
|
|
390
|
-
isSensitive:
|
|
391
|
-
itemID:
|
|
388
|
+
var itemIDSchema = z6.string().min(1).max(200);
|
|
389
|
+
var itemTextSchema = z6.string().max(2000).regex(/\S/u);
|
|
390
|
+
var proposalOriginSchema = z6.enum(["owner", "conversation", "task", "memory_writer"]);
|
|
391
|
+
var originSchema = z6.enum([...proposalOriginSchema.options, "lapse"]);
|
|
392
|
+
var sourceSchema = z6.enum(["owner", "owner_data", "untrusted"]);
|
|
393
|
+
var subjectSchema = z6.enum(["owner", "self", "shared"]);
|
|
394
|
+
var kindSchema = z6.enum(["fact", "self"]);
|
|
395
|
+
var memoryItemSchema = z6.object({
|
|
396
|
+
changedAt: z6.date(),
|
|
397
|
+
createdAt: z6.date(),
|
|
398
|
+
forgottenAt: z6.date().nullable(),
|
|
399
|
+
isPinned: z6.boolean(),
|
|
400
|
+
isSensitive: z6.boolean(),
|
|
401
|
+
itemID: z6.string(),
|
|
392
402
|
kind: kindSchema,
|
|
393
403
|
origin: originSchema,
|
|
394
|
-
shortID:
|
|
404
|
+
shortID: z6.string(),
|
|
395
405
|
source: sourceSchema,
|
|
396
|
-
state:
|
|
397
|
-
status:
|
|
406
|
+
state: z6.enum(["active", "retired", "forgetting", "forgotten"]),
|
|
407
|
+
status: z6.enum(["readable", "shredded", "unreadable"]),
|
|
398
408
|
subject: subjectSchema,
|
|
399
|
-
text:
|
|
400
|
-
until:
|
|
401
|
-
version:
|
|
409
|
+
text: z6.string().optional(),
|
|
410
|
+
until: z6.date().nullable(),
|
|
411
|
+
version: z6.int().positive()
|
|
402
412
|
});
|
|
403
413
|
var memoryMatchSchema = memoryItemSchema.extend({
|
|
404
|
-
score:
|
|
405
|
-
similarity:
|
|
406
|
-
});
|
|
407
|
-
var evidenceSchema =
|
|
408
|
-
end:
|
|
409
|
-
message:
|
|
410
|
-
status:
|
|
411
|
-
text:
|
|
414
|
+
score: z6.number().optional(),
|
|
415
|
+
similarity: z6.number().optional()
|
|
416
|
+
});
|
|
417
|
+
var evidenceSchema = z6.object({
|
|
418
|
+
end: z6.int().nonnegative(),
|
|
419
|
+
message: z6.object({
|
|
420
|
+
status: z6.enum(["readable", "shredded", "unreadable", "missing"]),
|
|
421
|
+
text: z6.string().optional()
|
|
412
422
|
}).nullable(),
|
|
413
|
-
sequence:
|
|
414
|
-
start:
|
|
415
|
-
});
|
|
416
|
-
var ownerImageSchema =
|
|
417
|
-
position:
|
|
418
|
-
sequence:
|
|
419
|
-
thread:
|
|
420
|
-
});
|
|
421
|
-
var memoryVersionSchema =
|
|
422
|
-
change:
|
|
423
|
-
checkerModel:
|
|
424
|
-
checks:
|
|
423
|
+
sequence: z6.int().nonnegative(),
|
|
424
|
+
start: z6.int().nonnegative()
|
|
425
|
+
});
|
|
426
|
+
var ownerImageSchema = z6.object({
|
|
427
|
+
position: z6.int().nonnegative(),
|
|
428
|
+
sequence: z6.int().positive(),
|
|
429
|
+
thread: z6.string()
|
|
430
|
+
});
|
|
431
|
+
var memoryVersionSchema = z6.object({
|
|
432
|
+
change: z6.enum(["created", "edited", "retired", "restored", "undone"]),
|
|
433
|
+
checkerModel: z6.string().nullable(),
|
|
434
|
+
checks: z6.record(z6.string(), z6.unknown()).nullable(),
|
|
425
435
|
evidence: evidenceSchema.nullable(),
|
|
426
|
-
evidenceQuote:
|
|
436
|
+
evidenceQuote: z6.string().nullable(),
|
|
427
437
|
image: ownerImageSchema.nullable(),
|
|
428
438
|
origin: originSchema,
|
|
429
|
-
proposalID:
|
|
430
|
-
recordedAt:
|
|
439
|
+
proposalID: z6.string().nullable(),
|
|
440
|
+
recordedAt: z6.date(),
|
|
431
441
|
source: sourceSchema,
|
|
432
|
-
state:
|
|
433
|
-
status:
|
|
434
|
-
taskID:
|
|
435
|
-
text:
|
|
436
|
-
version:
|
|
437
|
-
writerModel:
|
|
438
|
-
});
|
|
439
|
-
var reviewReasonSchema =
|
|
442
|
+
state: z6.enum(["active", "retired"]),
|
|
443
|
+
status: z6.enum(["readable", "shredded", "unreadable"]),
|
|
444
|
+
taskID: z6.string().nullable(),
|
|
445
|
+
text: z6.string().optional(),
|
|
446
|
+
version: z6.int().positive(),
|
|
447
|
+
writerModel: z6.string().nullable()
|
|
448
|
+
});
|
|
449
|
+
var reviewReasonSchema = z6.enum([
|
|
440
450
|
"no_quote",
|
|
441
451
|
"quote_not_typed",
|
|
442
452
|
"quote_in_quoted_block",
|
|
@@ -454,115 +464,116 @@ var reviewReasonSchema = z5.enum([
|
|
|
454
464
|
"sensitive",
|
|
455
465
|
"subject_change"
|
|
456
466
|
]);
|
|
457
|
-
var proposalSourceSchema =
|
|
467
|
+
var proposalSourceSchema = z6.object({
|
|
458
468
|
origin: proposalOriginSchema,
|
|
459
|
-
proposedAt:
|
|
460
|
-
thread:
|
|
469
|
+
proposedAt: z6.date(),
|
|
470
|
+
thread: z6.string().nullable()
|
|
461
471
|
});
|
|
462
|
-
var memoryProposalSchema =
|
|
463
|
-
actionHash:
|
|
464
|
-
createdAt:
|
|
472
|
+
var memoryProposalSchema = z6.object({
|
|
473
|
+
actionHash: z6.string(),
|
|
474
|
+
createdAt: z6.date(),
|
|
465
475
|
evidence: evidenceSchema.nullable(),
|
|
466
476
|
image: ownerImageSchema.nullable(),
|
|
467
|
-
isPinned:
|
|
468
|
-
isSensitive:
|
|
469
|
-
itemID:
|
|
477
|
+
isPinned: z6.boolean(),
|
|
478
|
+
isSensitive: z6.boolean(),
|
|
479
|
+
itemID: z6.string(),
|
|
470
480
|
kind: kindSchema,
|
|
471
|
-
lapseAt:
|
|
481
|
+
lapseAt: z6.date(),
|
|
472
482
|
newSubject: subjectSchema.nullable(),
|
|
473
|
-
operation:
|
|
483
|
+
operation: z6.enum(["remember", "retire", "pin"]),
|
|
474
484
|
origin: proposalOriginSchema,
|
|
475
|
-
proposalID:
|
|
476
|
-
quote:
|
|
485
|
+
proposalID: z6.string(),
|
|
486
|
+
quote: z6.string().nullable(),
|
|
477
487
|
reason: reviewReasonSchema,
|
|
478
488
|
source: sourceSchema,
|
|
479
|
-
sources:
|
|
489
|
+
sources: z6.array(proposalSourceSchema),
|
|
480
490
|
subject: subjectSchema,
|
|
481
|
-
targetVersion:
|
|
482
|
-
text:
|
|
483
|
-
until:
|
|
491
|
+
targetVersion: z6.int().positive().nullable(),
|
|
492
|
+
text: z6.string(),
|
|
493
|
+
until: z6.date().nullable()
|
|
484
494
|
});
|
|
485
|
-
var proposalAnswerSchema =
|
|
486
|
-
actionHash:
|
|
487
|
-
clientActionID:
|
|
488
|
-
proposalID:
|
|
495
|
+
var proposalAnswerSchema = z6.object({
|
|
496
|
+
actionHash: z6.string().min(1).max(200),
|
|
497
|
+
clientActionID: z6.uuid(),
|
|
498
|
+
proposalID: z6.string().min(1).max(200)
|
|
489
499
|
});
|
|
490
|
-
var revisionTargetSchema =
|
|
500
|
+
var revisionTargetSchema = z6.object({ itemID: itemIDSchema, version: z6.int().positive() });
|
|
491
501
|
var approvalAnswerSchema = proposalAnswerSchema.extend({
|
|
492
502
|
editedText: itemTextSchema.optional(),
|
|
493
|
-
ignoreCloseMatch:
|
|
503
|
+
ignoreCloseMatch: z6.boolean().optional(),
|
|
494
504
|
revisionOf: revisionTargetSchema.optional()
|
|
495
505
|
});
|
|
496
|
-
var rejectionReasonSchema =
|
|
506
|
+
var rejectionReasonSchema = z6.string().max(500).regex(/\S/u);
|
|
497
507
|
var rejectionAnswerSchema = proposalAnswerSchema.extend({
|
|
498
508
|
reason: rejectionReasonSchema.optional()
|
|
499
509
|
});
|
|
500
|
-
var proposalOutcomesSchema =
|
|
501
|
-
var memoryItemDetailSchema = memoryItemSchema.extend({ versions:
|
|
502
|
-
var forgetLossSchema =
|
|
503
|
-
evidenceMessages:
|
|
504
|
-
proposals:
|
|
510
|
+
var proposalOutcomesSchema = z6.object({ outcomes: z6.array(proposalOutcomeSchema) });
|
|
511
|
+
var memoryItemDetailSchema = memoryItemSchema.extend({ versions: z6.array(memoryVersionSchema) });
|
|
512
|
+
var forgetLossSchema = z6.object({
|
|
513
|
+
evidenceMessages: z6.int().nonnegative(),
|
|
514
|
+
proposals: z6.int().nonnegative()
|
|
505
515
|
});
|
|
506
516
|
var forgetPreviewSchema = memoryItemDetailSchema.extend({ lost: forgetLossSchema });
|
|
507
|
-
var retiredForgetPreviewSchema =
|
|
508
|
-
hasMore:
|
|
509
|
-
items:
|
|
517
|
+
var retiredForgetPreviewSchema = z6.object({
|
|
518
|
+
hasMore: z6.boolean(),
|
|
519
|
+
items: z6.array(memoryItemSchema.extend({ lost: forgetLossSchema }))
|
|
510
520
|
});
|
|
511
|
-
var retiredForgetSchema =
|
|
512
|
-
clientActionID:
|
|
513
|
-
targets:
|
|
521
|
+
var retiredForgetSchema = z6.object({
|
|
522
|
+
clientActionID: z6.uuid(),
|
|
523
|
+
targets: z6.array(revisionTargetSchema).min(1).max(100).refine((targets) => new Set(targets.map((target) => target.itemID)).size === targets.length, {
|
|
514
524
|
message: "Each item appears once"
|
|
515
525
|
})
|
|
516
526
|
});
|
|
517
|
-
var forgetStatusSchema =
|
|
518
|
-
deleted:
|
|
519
|
-
pending:
|
|
527
|
+
var forgetStatusSchema = z6.object({
|
|
528
|
+
deleted: z6.array(z6.string()),
|
|
529
|
+
pending: z6.array(z6.string()),
|
|
530
|
+
backup: forgetBackupSchema
|
|
520
531
|
});
|
|
521
|
-
var versionTargetSchema =
|
|
522
|
-
clientActionID:
|
|
532
|
+
var versionTargetSchema = z6.object({
|
|
533
|
+
clientActionID: z6.uuid(),
|
|
523
534
|
itemID: itemIDSchema,
|
|
524
|
-
version:
|
|
525
|
-
});
|
|
526
|
-
var versionResultSchema =
|
|
527
|
-
var noticeEntrySchema =
|
|
528
|
-
change:
|
|
529
|
-
isKept:
|
|
530
|
-
item: memoryItemSchema.extend({ change:
|
|
531
|
-
itemID:
|
|
532
|
-
proposalID:
|
|
533
|
-
sequence:
|
|
534
|
-
version:
|
|
535
|
-
});
|
|
536
|
-
var memoryNoticeSchema =
|
|
537
|
-
entries:
|
|
538
|
-
kind:
|
|
539
|
-
messageSequence:
|
|
540
|
-
noticeKey:
|
|
541
|
-
proposed:
|
|
542
|
-
remembered:
|
|
543
|
-
retired:
|
|
544
|
-
sequence:
|
|
535
|
+
version: z6.int().positive()
|
|
536
|
+
});
|
|
537
|
+
var versionResultSchema = z6.object({ itemID: z6.string(), version: z6.int().positive() });
|
|
538
|
+
var noticeEntrySchema = z6.object({
|
|
539
|
+
change: z6.enum(["created", "edited", "retired", "restored", "undone", "proposed"]),
|
|
540
|
+
isKept: z6.boolean(),
|
|
541
|
+
item: memoryItemSchema.extend({ change: z6.enum(["created", "edited", "retired", "restored", "undone"]) }).nullable(),
|
|
542
|
+
itemID: z6.string(),
|
|
543
|
+
proposalID: z6.string().nullable(),
|
|
544
|
+
sequence: z6.int().nonnegative(),
|
|
545
|
+
version: z6.int().positive().nullable()
|
|
546
|
+
});
|
|
547
|
+
var memoryNoticeSchema = z6.object({
|
|
548
|
+
entries: z6.array(noticeEntrySchema),
|
|
549
|
+
kind: z6.enum(["turn", "batch", "catch_up", "run"]),
|
|
550
|
+
messageSequence: z6.int().nonnegative().nullable(),
|
|
551
|
+
noticeKey: z6.string(),
|
|
552
|
+
proposed: z6.int().nonnegative(),
|
|
553
|
+
remembered: z6.int().nonnegative(),
|
|
554
|
+
retired: z6.int().nonnegative(),
|
|
555
|
+
sequence: z6.int().nonnegative()
|
|
545
556
|
});
|
|
546
557
|
var memoryViewContract = {
|
|
547
|
-
listItems: memoryView.errors({ INVALID_CURSOR: { message: "No page returned this cursor", status: 400 } }).input(
|
|
548
|
-
after:
|
|
558
|
+
listItems: memoryView.errors({ INVALID_CURSOR: { message: "No page returned this cursor", status: 400 } }).input(z6.object({
|
|
559
|
+
after: z6.string().max(20).optional(),
|
|
549
560
|
kind: kindSchema.optional(),
|
|
550
|
-
limit:
|
|
551
|
-
state:
|
|
552
|
-
})).output(
|
|
553
|
-
findItems: memoryView.input(
|
|
554
|
-
items:
|
|
555
|
-
searchMode:
|
|
561
|
+
limit: z6.int().min(1).max(100).optional(),
|
|
562
|
+
state: z6.enum(["active", "retired", "forgotten"])
|
|
563
|
+
})).output(z6.object({ items: z6.array(memoryItemSchema), next: z6.string().nullable() })),
|
|
564
|
+
findItems: memoryView.input(z6.object({ query: z6.string().min(1).max(500) })).output(z6.object({
|
|
565
|
+
items: z6.array(memoryMatchSchema),
|
|
566
|
+
searchMode: z6.enum(["hybrid", "keyword", "keyword-fallback"])
|
|
556
567
|
})),
|
|
557
|
-
readPinnedCore: memoryView.output(
|
|
558
|
-
budget:
|
|
559
|
-
items:
|
|
560
|
-
tokens:
|
|
568
|
+
readPinnedCore: memoryView.output(z6.object({
|
|
569
|
+
budget: z6.int().nonnegative(),
|
|
570
|
+
items: z6.array(memoryItemSchema),
|
|
571
|
+
tokens: z6.int().nonnegative()
|
|
561
572
|
})),
|
|
562
|
-
readItem: memoryView.errors({ MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 } }).input(
|
|
573
|
+
readItem: memoryView.errors({ MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 } }).input(z6.object({ itemID: itemIDSchema })).output(memoryItemDetailSchema),
|
|
563
574
|
retire: memoryChange.input(versionTargetSchema).output(versionResultSchema),
|
|
564
575
|
restore: memoryChange.input(versionTargetSchema).output(versionResultSchema),
|
|
565
|
-
listNotices: memoryView.input(
|
|
576
|
+
listNotices: memoryView.input(z6.object({ thread: z6.string().min(1).max(200) })).output(z6.object({ notices: z6.array(memoryNoticeSchema) })),
|
|
566
577
|
undo: memoryChange.errors({
|
|
567
578
|
PINNED_CORE_FULL: { message: "The undo takes the pinned core past its budget", status: 409 }
|
|
568
579
|
}).input(versionTargetSchema).output(versionResultSchema),
|
|
@@ -570,163 +581,191 @@ var memoryViewContract = {
|
|
|
570
581
|
previewForget: memoryView.errors({
|
|
571
582
|
MEMORY_ITEM_NOT_FOUND: { message: "No memory item has this ID", status: 404 },
|
|
572
583
|
STALE_VERSION: { message: "The memory item has moved past that version", status: 409 }
|
|
573
|
-
}).input(
|
|
574
|
-
forget: memoryChange.input(versionTargetSchema).output(
|
|
584
|
+
}).input(z6.object({ itemID: itemIDSchema, version: z6.int().positive() })).output(forgetPreviewSchema),
|
|
585
|
+
forget: memoryChange.input(versionTargetSchema).output(z6.object({ itemID: z6.string(), backup: forgetBackupSchema })),
|
|
575
586
|
previewForgetRetired: memoryView.output(retiredForgetPreviewSchema),
|
|
576
587
|
forgetRetired: memoryChange.input(retiredForgetSchema).output(forgetStatusSchema),
|
|
577
|
-
readForgetStatus: memoryView.input(
|
|
588
|
+
readForgetStatus: memoryView.input(z6.object({ itemIDs: z6.array(itemIDSchema).min(1).max(100) })).output(forgetStatusSchema),
|
|
578
589
|
pin: memoryChange.errors({
|
|
579
590
|
PINNED_CORE_FULL: { message: "The pin takes the pinned core past its budget", status: 409 }
|
|
580
|
-
}).input(versionTargetSchema.extend({ isPinned:
|
|
581
|
-
markSensitive: memoryChange.input(
|
|
582
|
-
listProposals: memoryView.output(
|
|
583
|
-
approveProposals: memoryView.input(
|
|
584
|
-
answers:
|
|
591
|
+
}).input(versionTargetSchema.extend({ isPinned: z6.boolean() })).output(z6.object({ isPinned: z6.boolean(), itemID: z6.string() })),
|
|
592
|
+
markSensitive: memoryChange.input(z6.object({ clientActionID: z6.uuid(), isSensitive: z6.boolean(), itemID: itemIDSchema })).output(z6.object({ isSensitive: z6.boolean(), itemID: z6.string() })),
|
|
593
|
+
listProposals: memoryView.output(z6.object({ proposals: z6.array(memoryProposalSchema) })),
|
|
594
|
+
approveProposals: memoryView.input(z6.object({
|
|
595
|
+
answers: z6.array(approvalAnswerSchema).min(1).max(50)
|
|
585
596
|
})).output(proposalOutcomesSchema),
|
|
586
|
-
rejectProposals: memoryView.input(
|
|
587
|
-
answers:
|
|
597
|
+
rejectProposals: memoryView.input(z6.object({
|
|
598
|
+
answers: z6.array(rejectionAnswerSchema).min(1).max(50)
|
|
588
599
|
})).output(proposalOutcomesSchema),
|
|
589
600
|
...memoryExportContract,
|
|
590
601
|
...momentContract
|
|
591
602
|
};
|
|
592
603
|
|
|
604
|
+
// src/rule-contract.ts
|
|
605
|
+
import { z as z7 } from "zod";
|
|
606
|
+
var ruleVersionSchema = z7.object({ ruleHash: z7.string(), sentence: z7.string() }).nullable();
|
|
607
|
+
var ruleChangeSchema = z7.object({
|
|
608
|
+
ruleID: z7.string(),
|
|
609
|
+
before: ruleVersionSchema,
|
|
610
|
+
after: ruleVersionSchema
|
|
611
|
+
});
|
|
612
|
+
var ruleProposalSchema = z7.object({
|
|
613
|
+
proposalID: z7.string(),
|
|
614
|
+
changes: z7.array(ruleChangeSchema),
|
|
615
|
+
createdAt: z7.date(),
|
|
616
|
+
lapseAt: z7.date()
|
|
617
|
+
});
|
|
618
|
+
var ruleAnswer = signedIn.errors({
|
|
619
|
+
NOT_FOUND: { message: "No rule change proposal has this ID", status: 404 },
|
|
620
|
+
PROPOSAL_CLOSED: {
|
|
621
|
+
message: "The rule change proposal is answered, withdrawn or lapsed",
|
|
622
|
+
status: 409
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
var proposalIDSchema = z7.string().min(1).max(200);
|
|
626
|
+
var ruleContract = {
|
|
627
|
+
listProposals: signedIn.output(z7.object({ proposals: z7.array(ruleProposalSchema) })),
|
|
628
|
+
approveProposal: ruleAnswer.input(z7.object({ proposalID: proposalIDSchema })).output(z7.object({ proposalID: z7.string() })),
|
|
629
|
+
rejectProposal: ruleAnswer.input(z7.object({ proposalID: proposalIDSchema, reason: z7.string().max(500).regex(/\S/u) })).output(z7.object({ proposalID: z7.string() }))
|
|
630
|
+
};
|
|
631
|
+
|
|
593
632
|
// src/span-schema.ts
|
|
594
|
-
import { z as
|
|
595
|
-
var spanSchema =
|
|
596
|
-
end:
|
|
597
|
-
source:
|
|
598
|
-
start:
|
|
633
|
+
import { z as z8 } from "zod";
|
|
634
|
+
var spanSchema = z8.object({
|
|
635
|
+
end: z8.int().nonnegative(),
|
|
636
|
+
source: z8.enum(["typed", "pasted", "dropped", "unknown"]),
|
|
637
|
+
start: z8.int().nonnegative()
|
|
599
638
|
});
|
|
600
639
|
|
|
601
640
|
// src/task-schema.ts
|
|
602
|
-
import { z as
|
|
603
|
-
var taskSchema =
|
|
604
|
-
error:
|
|
605
|
-
errorLimit:
|
|
606
|
-
errors:
|
|
607
|
-
isWaitingForRetry:
|
|
608
|
-
readCursor:
|
|
609
|
-
reason:
|
|
610
|
-
retryAt:
|
|
611
|
-
stepKey:
|
|
612
|
-
taskID:
|
|
641
|
+
import { z as z9 } from "zod";
|
|
642
|
+
var taskSchema = z9.object({
|
|
643
|
+
error: z9.string().optional(),
|
|
644
|
+
errorLimit: z9.int().positive().optional(),
|
|
645
|
+
errors: z9.int().positive().optional(),
|
|
646
|
+
isWaitingForRetry: z9.boolean().optional(),
|
|
647
|
+
readCursor: z9.int().nonnegative().optional(),
|
|
648
|
+
reason: z9.string().optional(),
|
|
649
|
+
retryAt: z9.date().optional(),
|
|
650
|
+
stepKey: z9.string().optional(),
|
|
651
|
+
taskID: z9.string()
|
|
613
652
|
});
|
|
614
653
|
|
|
615
654
|
// src/tool-call-schema.ts
|
|
616
|
-
import { z as
|
|
617
|
-
var jsonObjectSchema =
|
|
618
|
-
var toolCallSchema =
|
|
619
|
-
callID:
|
|
655
|
+
import { z as z10 } from "zod";
|
|
656
|
+
var jsonObjectSchema = z10.record(z10.string(), z10.unknown());
|
|
657
|
+
var toolCallSchema = z10.object({
|
|
658
|
+
callID: z10.string(),
|
|
620
659
|
content: jsonObjectSchema.optional(),
|
|
621
660
|
input: jsonObjectSchema.optional(),
|
|
622
|
-
outcome:
|
|
623
|
-
tool:
|
|
661
|
+
outcome: z10.string().optional(),
|
|
662
|
+
tool: z10.string().optional()
|
|
624
663
|
});
|
|
625
664
|
|
|
626
665
|
// src/contract.ts
|
|
627
|
-
var clientActionIDSchema =
|
|
628
|
-
var sequenceSchema =
|
|
629
|
-
var threadSchema =
|
|
630
|
-
var imageSchema =
|
|
631
|
-
var imageFilesSchema =
|
|
632
|
-
var imageRefSchema =
|
|
633
|
-
position:
|
|
666
|
+
var clientActionIDSchema = z11.uuid();
|
|
667
|
+
var sequenceSchema = z11.int().nonnegative();
|
|
668
|
+
var threadSchema = z11.string().min(1).max(200);
|
|
669
|
+
var imageSchema = z11.object({ mediaType: z11.enum(imageLimits.mediaTypes) });
|
|
670
|
+
var imageFilesSchema = z11.array(z11.file());
|
|
671
|
+
var imageRefSchema = z11.object({
|
|
672
|
+
position: z11.int().nonnegative(),
|
|
634
673
|
sequence: sequenceSchema,
|
|
635
674
|
thread: threadSchema
|
|
636
675
|
});
|
|
637
|
-
var versionRefSchema =
|
|
638
|
-
itemID:
|
|
639
|
-
version:
|
|
676
|
+
var versionRefSchema = z11.object({
|
|
677
|
+
itemID: z11.string().min(1).max(200),
|
|
678
|
+
version: z11.int().nonnegative()
|
|
640
679
|
});
|
|
641
|
-
var recallItemSchema = versionRefSchema.extend({ score:
|
|
642
|
-
var recallSchema =
|
|
680
|
+
var recallItemSchema = versionRefSchema.extend({ score: z11.number().optional() });
|
|
681
|
+
var recallSchema = z11.object({ items: z11.array(recallItemSchema) });
|
|
643
682
|
var ratingItemSchema = versionRefSchema.extend({
|
|
644
|
-
hasNote:
|
|
645
|
-
verdict:
|
|
683
|
+
hasNote: z11.boolean(),
|
|
684
|
+
verdict: z11.enum(["helpful", "noise", "misleading"])
|
|
646
685
|
});
|
|
647
|
-
var ratingSchema =
|
|
648
|
-
items:
|
|
649
|
-
ratedBy:
|
|
686
|
+
var ratingSchema = z11.object({
|
|
687
|
+
items: z11.array(ratingItemSchema),
|
|
688
|
+
ratedBy: z11.string().optional(),
|
|
650
689
|
recalledSequence: sequenceSchema
|
|
651
690
|
});
|
|
652
|
-
var tokenCountSchema =
|
|
653
|
-
var contextSchema =
|
|
654
|
-
var compactionSchema =
|
|
691
|
+
var tokenCountSchema = z11.int().nonnegative();
|
|
692
|
+
var contextSchema = z11.object({ size: tokenCountSchema, window: z11.int().positive() });
|
|
693
|
+
var compactionSchema = z11.object({
|
|
655
694
|
postTokens: tokenCountSchema.optional(),
|
|
656
695
|
preTokens: tokenCountSchema,
|
|
657
|
-
trigger:
|
|
696
|
+
trigger: z11.enum(["manual", "auto"])
|
|
658
697
|
});
|
|
659
|
-
var summarySchema =
|
|
698
|
+
var summarySchema = z11.object({
|
|
660
699
|
contextSize: tokenCountSchema.optional(),
|
|
661
700
|
summaryTokens: tokenCountSchema,
|
|
662
|
-
text:
|
|
663
|
-
trigger:
|
|
701
|
+
text: z11.string().optional(),
|
|
702
|
+
trigger: z11.enum(["threshold", "overflow"])
|
|
664
703
|
});
|
|
665
|
-
var compactionFailureSchema =
|
|
666
|
-
var ratingNoteRefSchema =
|
|
667
|
-
itemID:
|
|
704
|
+
var compactionFailureSchema = z11.object({ failures: z11.int().positive() });
|
|
705
|
+
var ratingNoteRefSchema = z11.object({
|
|
706
|
+
itemID: z11.string().min(1).max(200),
|
|
668
707
|
sequence: sequenceSchema
|
|
669
708
|
});
|
|
670
709
|
var ratingNoteSchema = ratingNoteRefSchema.extend({
|
|
671
|
-
status:
|
|
672
|
-
text:
|
|
710
|
+
status: z11.enum(["readable", "shredded", "unreadable", "missing"]),
|
|
711
|
+
text: z11.string().optional()
|
|
673
712
|
});
|
|
674
713
|
var versionTextSchema = versionRefSchema.extend({
|
|
675
|
-
status:
|
|
676
|
-
text:
|
|
714
|
+
status: z11.enum(["readable", "shredded", "unreadable", "missing"]),
|
|
715
|
+
text: z11.string().optional()
|
|
677
716
|
});
|
|
678
|
-
var listedActionSchema =
|
|
679
|
-
var taskMessageSchema =
|
|
717
|
+
var listedActionSchema = z11.object({ actionID: z11.string(), tool: z11.string() });
|
|
718
|
+
var taskMessageSchema = z11.object({
|
|
680
719
|
from: threadSchema,
|
|
681
|
-
fromName:
|
|
682
|
-
hop:
|
|
683
|
-
kind:
|
|
684
|
-
messageID:
|
|
685
|
-
replyTo:
|
|
686
|
-
text:
|
|
720
|
+
fromName: z11.string(),
|
|
721
|
+
hop: z11.int().nonnegative(),
|
|
722
|
+
kind: z11.string(),
|
|
723
|
+
messageID: z11.string(),
|
|
724
|
+
replyTo: z11.string().optional(),
|
|
725
|
+
text: z11.string().optional(),
|
|
687
726
|
to: threadSchema,
|
|
688
|
-
woke:
|
|
727
|
+
woke: z11.boolean()
|
|
689
728
|
});
|
|
690
|
-
var exchangeNoticeSchema =
|
|
691
|
-
link:
|
|
692
|
-
text:
|
|
729
|
+
var exchangeNoticeSchema = z11.object({
|
|
730
|
+
link: z11.object({ label: z11.string(), messageID: z11.string(), taskID: threadSchema }),
|
|
731
|
+
text: z11.string()
|
|
693
732
|
});
|
|
694
|
-
var recordSchema =
|
|
733
|
+
var recordSchema = z11.object({
|
|
695
734
|
compaction: compactionSchema.optional(),
|
|
696
735
|
exchangeNotice: exchangeNoticeSchema.optional(),
|
|
697
736
|
compactionFailure: compactionFailureSchema.optional(),
|
|
698
|
-
forget:
|
|
737
|
+
forget: z11.object({ sequence: sequenceSchema }).optional(),
|
|
699
738
|
context: contextSchema.optional(),
|
|
700
|
-
isSilentTurn:
|
|
701
|
-
kind:
|
|
702
|
-
message:
|
|
703
|
-
clientMessageId:
|
|
704
|
-
images:
|
|
705
|
-
spans:
|
|
706
|
-
text:
|
|
739
|
+
isSilentTurn: z11.literal(true).optional(),
|
|
740
|
+
kind: z11.string(),
|
|
741
|
+
message: z11.object({
|
|
742
|
+
clientMessageId: z11.uuid().optional(),
|
|
743
|
+
images: z11.array(imageSchema).optional(),
|
|
744
|
+
spans: z11.array(spanSchema).optional(),
|
|
745
|
+
text: z11.string()
|
|
707
746
|
}).optional(),
|
|
708
|
-
moment:
|
|
747
|
+
moment: z11.object({ momentID: z11.string(), shortID: z11.string(), title: z11.string().optional() }).optional(),
|
|
709
748
|
rating: ratingSchema.optional(),
|
|
710
749
|
recall: recallSchema.optional(),
|
|
711
|
-
recordedAt:
|
|
750
|
+
recordedAt: z11.date(),
|
|
712
751
|
sequence: sequenceSchema,
|
|
713
|
-
stop:
|
|
752
|
+
stop: z11.object({ cancelledActions: z11.array(listedActionSchema) }).optional(),
|
|
714
753
|
summary: summarySchema.optional(),
|
|
715
754
|
thread: threadSchema,
|
|
716
755
|
task: taskSchema.optional(),
|
|
717
756
|
taskMessage: taskMessageSchema.optional(),
|
|
718
757
|
toolCall: toolCallSchema.optional()
|
|
719
758
|
});
|
|
720
|
-
var writerErrorSchema =
|
|
721
|
-
var sessionSchema =
|
|
722
|
-
createdAt:
|
|
723
|
-
current:
|
|
724
|
-
deviceName:
|
|
725
|
-
lastUsedAt:
|
|
726
|
-
sessionID:
|
|
759
|
+
var writerErrorSchema = z11.object({ at: z11.date(), code: z11.string(), message: z11.string().nullable() }).nullable();
|
|
760
|
+
var sessionSchema = z11.object({
|
|
761
|
+
createdAt: z11.date(),
|
|
762
|
+
current: z11.boolean(),
|
|
763
|
+
deviceName: z11.string(),
|
|
764
|
+
lastUsedAt: z11.date(),
|
|
765
|
+
sessionID: z11.uuid()
|
|
727
766
|
});
|
|
728
767
|
var checkedAction = signedIn.errors(reusedIDErrors);
|
|
729
|
-
var taskStateSchema =
|
|
768
|
+
var taskStateSchema = z11.enum([
|
|
730
769
|
"ready",
|
|
731
770
|
"running",
|
|
732
771
|
"waiting",
|
|
@@ -736,27 +775,27 @@ var taskStateSchema = z9.enum([
|
|
|
736
775
|
"failed",
|
|
737
776
|
"closed"
|
|
738
777
|
]);
|
|
739
|
-
var taskControlSchema =
|
|
740
|
-
var actionCountSchema =
|
|
741
|
-
var listedTaskSchema =
|
|
742
|
-
actions:
|
|
778
|
+
var taskControlSchema = z11.enum(["pause", "resume", "stop", "restart", "close", "interrupt"]);
|
|
779
|
+
var actionCountSchema = z11.int().nonnegative();
|
|
780
|
+
var listedTaskSchema = z11.object({
|
|
781
|
+
actions: z11.object({
|
|
743
782
|
cancelled: actionCountSchema,
|
|
744
783
|
queued: actionCountSchema,
|
|
745
784
|
started: actionCountSchema
|
|
746
785
|
}),
|
|
747
|
-
brief:
|
|
748
|
-
controls:
|
|
749
|
-
isPauseRequested:
|
|
750
|
-
isTakingMessages:
|
|
751
|
-
lastActivityAt:
|
|
752
|
-
name:
|
|
786
|
+
brief: z11.string(),
|
|
787
|
+
controls: z11.array(taskControlSchema),
|
|
788
|
+
isPauseRequested: z11.boolean(),
|
|
789
|
+
isTakingMessages: z11.boolean(),
|
|
790
|
+
lastActivityAt: z11.date(),
|
|
791
|
+
name: z11.string(),
|
|
753
792
|
state: taskStateSchema,
|
|
754
793
|
taskID: threadSchema,
|
|
755
794
|
waitingOn: threadSchema.optional()
|
|
756
795
|
});
|
|
757
|
-
var controlledTaskSchema =
|
|
758
|
-
controlledAt:
|
|
759
|
-
isPauseRequested:
|
|
796
|
+
var controlledTaskSchema = z11.object({
|
|
797
|
+
controlledAt: z11.date(),
|
|
798
|
+
isPauseRequested: z11.boolean(),
|
|
760
799
|
state: taskStateSchema,
|
|
761
800
|
taskID: threadSchema
|
|
762
801
|
});
|
|
@@ -765,58 +804,63 @@ var taskControl = checkedAction.errors({
|
|
|
765
804
|
TASK_STATE_REFUSED: {
|
|
766
805
|
message: "The task is in a state that does not take this control",
|
|
767
806
|
status: 409,
|
|
768
|
-
data:
|
|
807
|
+
data: z11.object({ isPauseRequested: z11.boolean(), state: taskStateSchema })
|
|
769
808
|
}
|
|
770
|
-
}).input(
|
|
771
|
-
var
|
|
809
|
+
}).input(z11.object({ clientActionID: clientActionIDSchema, taskID: threadSchema })).output(controlledTaskSchema);
|
|
810
|
+
var backupNoticeSchema = z11.object({
|
|
811
|
+
cause: z11.enum(["failed", "missing"]),
|
|
812
|
+
sequence: z11.int().positive(),
|
|
813
|
+
raisedAt: z11.date()
|
|
814
|
+
});
|
|
815
|
+
var followRecords = signedIn.input(z11.object({ afterSequence: sequenceSchema, thread: threadSchema.optional() })).output(eventIterator2(z11.object({ record: recordSchema })));
|
|
772
816
|
var contract = {
|
|
773
817
|
conversation: {
|
|
774
|
-
read: signedIn.errors({ THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 } }).input(
|
|
818
|
+
read: signedIn.errors({ THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 } }).input(z11.object({
|
|
775
819
|
beforeSequence: sequenceSchema.optional(),
|
|
776
|
-
limit:
|
|
820
|
+
limit: z11.int().min(1).max(200).optional(),
|
|
777
821
|
thread: threadSchema
|
|
778
|
-
})).output(
|
|
779
|
-
hasEarlier:
|
|
822
|
+
})).output(z11.object({
|
|
823
|
+
hasEarlier: z11.boolean(),
|
|
780
824
|
readAtSequence: sequenceSchema,
|
|
781
|
-
records:
|
|
825
|
+
records: z11.array(recordSchema),
|
|
782
826
|
lastStepEnd: recordSchema.nullable().optional()
|
|
783
827
|
})),
|
|
784
828
|
send: checkedAction.errors({
|
|
785
829
|
IMAGE_REFUSED: imageRefusedError,
|
|
786
830
|
THREAD_NOT_FOUND: { message: "No thread has this ID", status: 404 }
|
|
787
|
-
}).input(
|
|
831
|
+
}).input(z11.object({
|
|
788
832
|
clientMessageId: clientActionIDSchema,
|
|
789
833
|
images: imageFilesSchema.optional(),
|
|
790
|
-
spans:
|
|
791
|
-
text:
|
|
834
|
+
spans: z11.array(spanSchema).max(1e5),
|
|
835
|
+
text: z11.string().min(1).max(1e5),
|
|
792
836
|
thread: threadSchema,
|
|
793
|
-
timeZone:
|
|
794
|
-
writtenAt:
|
|
795
|
-
})).output(
|
|
837
|
+
timeZone: z11.string().min(1).max(100).optional(),
|
|
838
|
+
writtenAt: z11.iso.datetime().optional()
|
|
839
|
+
})).output(z11.object({ duplicate: z11.boolean(), sequence: sequenceSchema })),
|
|
796
840
|
retry: checkedAction.errors({
|
|
797
841
|
NOTHING_TO_RETRY: {
|
|
798
842
|
message: "The last turn of the conversation did not fail, or it runs again already",
|
|
799
843
|
status: 409
|
|
800
844
|
}
|
|
801
|
-
}).input(
|
|
802
|
-
readImage: signedIn.errors({ IMAGE_NOT_FOUND: imageNotFoundError }).input(imageRefSchema).output(
|
|
845
|
+
}).input(z11.object({ clientActionID: clientActionIDSchema })).output(z11.object({ retriedAt: z11.date() })),
|
|
846
|
+
readImage: signedIn.errors({ IMAGE_NOT_FOUND: imageNotFoundError }).input(imageRefSchema).output(z11.file()),
|
|
803
847
|
forget: checkedAction.errors({
|
|
804
848
|
RECORD_NOT_FOUND: {
|
|
805
849
|
message: "No message or reply on this thread has this sequence",
|
|
806
850
|
status: 404
|
|
807
851
|
}
|
|
808
|
-
}).input(
|
|
852
|
+
}).input(z11.object({
|
|
809
853
|
clientActionID: clientActionIDSchema,
|
|
810
854
|
sequence: sequenceSchema,
|
|
811
855
|
thread: threadSchema
|
|
812
|
-
})).output(
|
|
856
|
+
})).output(z11.object({ forgottenAt: z11.date() }))
|
|
813
857
|
},
|
|
814
858
|
tasks: {
|
|
815
|
-
list: signedIn.output(
|
|
816
|
-
read: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(
|
|
817
|
-
readActions: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(
|
|
818
|
-
queued:
|
|
819
|
-
started:
|
|
859
|
+
list: signedIn.output(z11.object({ readAtSequence: sequenceSchema, tasks: z11.array(listedTaskSchema) })),
|
|
860
|
+
read: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z11.object({ taskID: threadSchema })).output(listedTaskSchema),
|
|
861
|
+
readActions: signedIn.errors({ TASK_NOT_FOUND: { message: "No task has this ID", status: 404 } }).input(z11.object({ taskID: threadSchema })).output(z11.object({
|
|
862
|
+
queued: z11.array(listedActionSchema),
|
|
863
|
+
started: z11.array(listedActionSchema)
|
|
820
864
|
})),
|
|
821
865
|
pause: taskControl,
|
|
822
866
|
resume: taskControl,
|
|
@@ -828,21 +872,25 @@ var contract = {
|
|
|
828
872
|
interrupt: taskControl
|
|
829
873
|
},
|
|
830
874
|
memory: {
|
|
831
|
-
readVersions: signedIn.input(
|
|
832
|
-
readRatingNotes: signedIn.input(
|
|
833
|
-
writerStatus: signedIn.output(
|
|
834
|
-
isEnabled:
|
|
835
|
-
backlog:
|
|
836
|
-
batches:
|
|
875
|
+
readVersions: signedIn.input(z11.object({ versions: z11.array(versionRefSchema).min(1).max(100) })).output(z11.object({ versions: z11.array(versionTextSchema) })),
|
|
876
|
+
readRatingNotes: signedIn.input(z11.object({ notes: z11.array(ratingNoteRefSchema).min(1).max(100) })).output(z11.object({ notes: z11.array(ratingNoteSchema) })),
|
|
877
|
+
writerStatus: signedIn.output(z11.object({
|
|
878
|
+
isEnabled: z11.boolean(),
|
|
879
|
+
backlog: z11.int().nonnegative(),
|
|
880
|
+
batches: z11.int().nonnegative(),
|
|
837
881
|
cursor: sequenceSchema,
|
|
838
|
-
failures:
|
|
839
|
-
isCatchingUp:
|
|
882
|
+
failures: z11.int().nonnegative(),
|
|
883
|
+
isCatchingUp: z11.boolean(),
|
|
840
884
|
lastError: writerErrorSchema,
|
|
841
|
-
retryAt:
|
|
885
|
+
retryAt: z11.date().nullable()
|
|
842
886
|
})),
|
|
843
|
-
consolidatorStatus: signedIn.output(
|
|
887
|
+
consolidatorStatus: signedIn.output(z11.object({ isEnabled: z11.boolean() })),
|
|
844
888
|
...memoryViewContract
|
|
845
889
|
},
|
|
890
|
+
backups: {
|
|
891
|
+
readNotice: signedIn.output(z11.object({ notice: backupNoticeSchema.nullable() }))
|
|
892
|
+
},
|
|
893
|
+
rules: ruleContract,
|
|
846
894
|
log: {
|
|
847
895
|
follow: followRecords.route({ deprecated: true })
|
|
848
896
|
},
|
|
@@ -855,30 +903,30 @@ var contract = {
|
|
|
855
903
|
message: "The enrolment code is unknown, used or lapsed",
|
|
856
904
|
status: 400
|
|
857
905
|
}
|
|
858
|
-
}).input(
|
|
906
|
+
}).input(z11.object({
|
|
859
907
|
clientActionID: clientActionIDSchema,
|
|
860
|
-
code:
|
|
861
|
-
deviceName:
|
|
862
|
-
tokenDelivery:
|
|
863
|
-
})).output(
|
|
864
|
-
issueCode: checkedAction.input(
|
|
865
|
-
list: signedIn.output(
|
|
866
|
-
revoke: checkedAction.errors({ SESSION_NOT_FOUND: { message: "No session has this ID", status: 404 } }).input(
|
|
908
|
+
code: z11.string().min(1).max(100),
|
|
909
|
+
deviceName: z11.string().min(1).max(100),
|
|
910
|
+
tokenDelivery: z11.enum(["cookie", "bearer"])
|
|
911
|
+
})).output(z11.object({ sessionID: z11.uuid(), token: z11.string().optional() })),
|
|
912
|
+
issueCode: checkedAction.input(z11.object({ clientActionID: clientActionIDSchema })).output(z11.object({ code: z11.string(), expiresAt: z11.date() })),
|
|
913
|
+
list: signedIn.output(z11.object({ sessions: z11.array(sessionSchema) })),
|
|
914
|
+
revoke: checkedAction.errors({ SESSION_NOT_FOUND: { message: "No session has this ID", status: 404 } }).input(z11.object({ clientActionID: clientActionIDSchema, sessionID: z11.uuid() })).output(z11.object({ revokedAt: z11.date() }))
|
|
867
915
|
}
|
|
868
916
|
};
|
|
869
917
|
// src/host-contract.ts
|
|
870
918
|
import { oc as oc3 } from "@orpc/contract";
|
|
871
|
-
import { z as
|
|
872
|
-
var versionRefSchema2 =
|
|
873
|
-
var versionTargetSchema2 =
|
|
874
|
-
itemID:
|
|
875
|
-
version:
|
|
876
|
-
});
|
|
877
|
-
var itemTextSchema2 =
|
|
878
|
-
var proposalOriginSchema2 =
|
|
879
|
-
var memoryOriginSchema =
|
|
880
|
-
var contentSourceSchema =
|
|
881
|
-
var reviewReasonSchema2 =
|
|
919
|
+
import { z as z12 } from "zod";
|
|
920
|
+
var versionRefSchema2 = z12.object({ itemID: z12.string(), version: z12.int().positive() });
|
|
921
|
+
var versionTargetSchema2 = z12.strictObject({
|
|
922
|
+
itemID: z12.string().min(1),
|
|
923
|
+
version: z12.int().positive()
|
|
924
|
+
});
|
|
925
|
+
var itemTextSchema2 = z12.string().max(2000).regex(/\S/u);
|
|
926
|
+
var proposalOriginSchema2 = z12.enum(["owner", "conversation", "task", "memory_writer"]);
|
|
927
|
+
var memoryOriginSchema = z12.enum([...proposalOriginSchema2.options, "lapse"]);
|
|
928
|
+
var contentSourceSchema = z12.enum(["owner", "owner_data", "untrusted"]);
|
|
929
|
+
var reviewReasonSchema2 = z12.enum([
|
|
882
930
|
"no_quote",
|
|
883
931
|
"quote_not_typed",
|
|
884
932
|
"quote_in_quoted_block",
|
|
@@ -896,105 +944,105 @@ var reviewReasonSchema2 = z10.enum([
|
|
|
896
944
|
"sensitive",
|
|
897
945
|
"subject_change"
|
|
898
946
|
]);
|
|
899
|
-
var proposalSourceSchema2 =
|
|
947
|
+
var proposalSourceSchema2 = z12.object({
|
|
900
948
|
origin: proposalOriginSchema2,
|
|
901
|
-
thread:
|
|
902
|
-
proposedAt:
|
|
903
|
-
});
|
|
904
|
-
var pendingProposalSchema =
|
|
905
|
-
proposalID:
|
|
906
|
-
operation:
|
|
907
|
-
itemID:
|
|
908
|
-
targetVersion:
|
|
909
|
-
isPinned:
|
|
910
|
-
subject:
|
|
911
|
-
newSubject:
|
|
912
|
-
isSensitive:
|
|
913
|
-
kind:
|
|
949
|
+
thread: z12.string().nullable(),
|
|
950
|
+
proposedAt: z12.date()
|
|
951
|
+
});
|
|
952
|
+
var pendingProposalSchema = z12.object({
|
|
953
|
+
proposalID: z12.string(),
|
|
954
|
+
operation: z12.enum(["remember", "retire", "pin"]),
|
|
955
|
+
itemID: z12.string(),
|
|
956
|
+
targetVersion: z12.int().nullable(),
|
|
957
|
+
isPinned: z12.boolean(),
|
|
958
|
+
subject: z12.enum(["owner", "self", "shared"]),
|
|
959
|
+
newSubject: z12.enum(["owner", "self", "shared"]).nullable(),
|
|
960
|
+
isSensitive: z12.boolean(),
|
|
961
|
+
kind: z12.enum(["fact", "self"]),
|
|
914
962
|
reason: reviewReasonSchema2,
|
|
915
|
-
actionHash:
|
|
963
|
+
actionHash: z12.string(),
|
|
916
964
|
origin: proposalOriginSchema2,
|
|
917
965
|
source: contentSourceSchema,
|
|
918
|
-
createdAt:
|
|
919
|
-
lapseAt:
|
|
920
|
-
sources:
|
|
921
|
-
text:
|
|
922
|
-
quote:
|
|
923
|
-
});
|
|
924
|
-
var closeMatchSchema2 =
|
|
925
|
-
var approvalResultSchema =
|
|
926
|
-
|
|
927
|
-
|
|
966
|
+
createdAt: z12.date(),
|
|
967
|
+
lapseAt: z12.date(),
|
|
968
|
+
sources: z12.array(proposalSourceSchema2),
|
|
969
|
+
text: z12.string(),
|
|
970
|
+
quote: z12.string().nullable()
|
|
971
|
+
});
|
|
972
|
+
var closeMatchSchema2 = z12.object({ itemID: z12.string(), version: z12.int(), text: z12.string() });
|
|
973
|
+
var approvalResultSchema = z12.discriminatedUnion("status", [
|
|
974
|
+
z12.object({ status: z12.literal("applied"), itemID: z12.string(), version: z12.int() }),
|
|
975
|
+
z12.object({ status: z12.literal("close_match"), item: closeMatchSchema2 })
|
|
928
976
|
]);
|
|
929
|
-
var historyVersionSchema =
|
|
930
|
-
version:
|
|
931
|
-
change:
|
|
932
|
-
state:
|
|
977
|
+
var historyVersionSchema = z12.object({
|
|
978
|
+
version: z12.int(),
|
|
979
|
+
change: z12.enum(["created", "edited", "retired", "restored", "undone"]),
|
|
980
|
+
state: z12.enum(["active", "retired"]),
|
|
933
981
|
origin: memoryOriginSchema,
|
|
934
982
|
source: contentSourceSchema,
|
|
935
|
-
recordedAt:
|
|
936
|
-
status:
|
|
937
|
-
text:
|
|
938
|
-
});
|
|
939
|
-
var itemHistorySchema =
|
|
940
|
-
itemID:
|
|
941
|
-
subject:
|
|
942
|
-
kind:
|
|
943
|
-
state:
|
|
944
|
-
versions:
|
|
945
|
-
});
|
|
946
|
-
var changeInputSchema =
|
|
947
|
-
itemID:
|
|
948
|
-
version:
|
|
949
|
-
text:
|
|
950
|
-
isCurrent:
|
|
951
|
-
});
|
|
952
|
-
var changeCommentSchema =
|
|
953
|
-
var consolidationChangeSchema =
|
|
954
|
-
changeID:
|
|
955
|
-
shortID:
|
|
956
|
-
kind:
|
|
957
|
-
inputs:
|
|
958
|
-
text:
|
|
959
|
-
reason:
|
|
983
|
+
recordedAt: z12.date(),
|
|
984
|
+
status: z12.enum(["readable", "shredded", "unreadable"]),
|
|
985
|
+
text: z12.string().nullable()
|
|
986
|
+
});
|
|
987
|
+
var itemHistorySchema = z12.object({
|
|
988
|
+
itemID: z12.string(),
|
|
989
|
+
subject: z12.enum(["owner", "self", "shared"]),
|
|
990
|
+
kind: z12.enum(["fact", "self"]),
|
|
991
|
+
state: z12.enum(["active", "retired", "forgetting", "forgotten"]),
|
|
992
|
+
versions: z12.array(historyVersionSchema)
|
|
993
|
+
});
|
|
994
|
+
var changeInputSchema = z12.object({
|
|
995
|
+
itemID: z12.string(),
|
|
996
|
+
version: z12.int(),
|
|
997
|
+
text: z12.string().nullable(),
|
|
998
|
+
isCurrent: z12.boolean()
|
|
999
|
+
});
|
|
1000
|
+
var changeCommentSchema = z12.object({ text: z12.string(), at: z12.date() });
|
|
1001
|
+
var consolidationChangeSchema = z12.object({
|
|
1002
|
+
changeID: z12.string(),
|
|
1003
|
+
shortID: z12.string(),
|
|
1004
|
+
kind: z12.enum(["merge", "rewrite", "retire"]),
|
|
1005
|
+
inputs: z12.array(changeInputSchema),
|
|
1006
|
+
text: z12.string().nullable(),
|
|
1007
|
+
reason: z12.string(),
|
|
960
1008
|
source: contentSourceSchema,
|
|
961
|
-
actionHash:
|
|
962
|
-
lapseAt:
|
|
1009
|
+
actionHash: z12.string(),
|
|
1010
|
+
lapseAt: z12.date(),
|
|
963
1011
|
comment: changeCommentSchema.nullable()
|
|
964
1012
|
});
|
|
965
|
-
var consolidationDiffSchema =
|
|
966
|
-
diffID:
|
|
967
|
-
model:
|
|
968
|
-
createdAt:
|
|
969
|
-
changes:
|
|
970
|
-
summary:
|
|
971
|
-
});
|
|
972
|
-
var changeOutcomeSchema =
|
|
973
|
-
|
|
974
|
-
changeID:
|
|
975
|
-
status:
|
|
976
|
-
versions:
|
|
1013
|
+
var consolidationDiffSchema = z12.object({
|
|
1014
|
+
diffID: z12.string(),
|
|
1015
|
+
model: z12.string().nullable(),
|
|
1016
|
+
createdAt: z12.date(),
|
|
1017
|
+
changes: z12.array(consolidationChangeSchema),
|
|
1018
|
+
summary: z12.string().nullable()
|
|
1019
|
+
});
|
|
1020
|
+
var changeOutcomeSchema = z12.discriminatedUnion("status", [
|
|
1021
|
+
z12.object({
|
|
1022
|
+
changeID: z12.string(),
|
|
1023
|
+
status: z12.literal("applied"),
|
|
1024
|
+
versions: z12.array(versionRefSchema2)
|
|
977
1025
|
}),
|
|
978
|
-
|
|
1026
|
+
z12.object({ changeID: z12.string(), status: z12.literal("refused"), code: z12.string() })
|
|
979
1027
|
]);
|
|
980
|
-
var changeAnswerSchema =
|
|
981
|
-
changeID:
|
|
982
|
-
actionHash:
|
|
1028
|
+
var changeAnswerSchema = z12.strictObject({
|
|
1029
|
+
changeID: z12.string().min(1),
|
|
1030
|
+
actionHash: z12.string().min(1)
|
|
983
1031
|
});
|
|
984
|
-
var proposalAnswerSchema2 =
|
|
985
|
-
proposalID:
|
|
986
|
-
actionHash:
|
|
1032
|
+
var proposalAnswerSchema2 = z12.strictObject({
|
|
1033
|
+
proposalID: z12.string().min(1),
|
|
1034
|
+
actionHash: z12.string().min(1)
|
|
987
1035
|
});
|
|
988
|
-
var hostSessionSchema =
|
|
989
|
-
sessionID:
|
|
990
|
-
deviceName:
|
|
991
|
-
createdAt:
|
|
992
|
-
lastUsedAt:
|
|
1036
|
+
var hostSessionSchema = z12.object({
|
|
1037
|
+
sessionID: z12.string(),
|
|
1038
|
+
deviceName: z12.string(),
|
|
1039
|
+
createdAt: z12.date(),
|
|
1040
|
+
lastUsedAt: z12.date()
|
|
993
1041
|
});
|
|
994
|
-
var subjectCountSchema =
|
|
995
|
-
owner:
|
|
996
|
-
shared:
|
|
997
|
-
self:
|
|
1042
|
+
var subjectCountSchema = z12.object({
|
|
1043
|
+
owner: z12.int().nonnegative(),
|
|
1044
|
+
shared: z12.int().nonnegative(),
|
|
1045
|
+
self: z12.int().nonnegative()
|
|
998
1046
|
});
|
|
999
1047
|
var memory = oc3.errors({
|
|
1000
1048
|
MEMORY_NOT_STARTED: { message: "the memory store has not started yet", status: 503 },
|
|
@@ -1009,28 +1057,28 @@ var memory = oc3.errors({
|
|
|
1009
1057
|
PIN_EDIT: { message: "a pin takes no edited text", status: 400 },
|
|
1010
1058
|
SELF_NOTE_REFUSED: { message: "a self-note never takes that change", status: 409 }
|
|
1011
1059
|
});
|
|
1012
|
-
var skillFileSchema =
|
|
1013
|
-
var pendingSkillProposalSchema =
|
|
1014
|
-
proposalID:
|
|
1015
|
-
name:
|
|
1016
|
-
skillHash:
|
|
1017
|
-
baseHash:
|
|
1018
|
-
files:
|
|
1019
|
-
inForce:
|
|
1020
|
-
skillHash:
|
|
1021
|
-
origin:
|
|
1022
|
-
files:
|
|
1060
|
+
var skillFileSchema = z12.object({ path: z12.string(), text: z12.string() });
|
|
1061
|
+
var pendingSkillProposalSchema = z12.object({
|
|
1062
|
+
proposalID: z12.string(),
|
|
1063
|
+
name: z12.string(),
|
|
1064
|
+
skillHash: z12.string(),
|
|
1065
|
+
baseHash: z12.string().nullable(),
|
|
1066
|
+
files: z12.array(skillFileSchema),
|
|
1067
|
+
inForce: z12.object({
|
|
1068
|
+
skillHash: z12.string(),
|
|
1069
|
+
origin: z12.enum(["definitions", "vendored", "nixie"]),
|
|
1070
|
+
files: z12.array(skillFileSchema)
|
|
1023
1071
|
}).nullable(),
|
|
1024
|
-
untypedToken:
|
|
1025
|
-
thread:
|
|
1026
|
-
provenance:
|
|
1027
|
-
createdAt:
|
|
1028
|
-
lapseAt:
|
|
1029
|
-
isStale:
|
|
1072
|
+
untypedToken: z12.object({ kind: z12.string(), raw: z12.string() }).nullable(),
|
|
1073
|
+
thread: z12.string().nullable(),
|
|
1074
|
+
provenance: z12.object({ runID: z12.string(), callID: z12.string(), profile: z12.string() }),
|
|
1075
|
+
createdAt: z12.date(),
|
|
1076
|
+
lapseAt: z12.date(),
|
|
1077
|
+
isStale: z12.boolean()
|
|
1030
1078
|
});
|
|
1031
|
-
var skillAnswerSchema =
|
|
1032
|
-
proposalID:
|
|
1033
|
-
skillHash:
|
|
1079
|
+
var skillAnswerSchema = z12.strictObject({
|
|
1080
|
+
proposalID: z12.string().min(1),
|
|
1081
|
+
skillHash: z12.string().min(1)
|
|
1034
1082
|
});
|
|
1035
1083
|
var skills = oc3.errors({
|
|
1036
1084
|
NOT_FOUND: { message: "nothing has that ID", status: 404 },
|
|
@@ -1040,38 +1088,38 @@ var skills = oc3.errors({
|
|
|
1040
1088
|
SKILL_CHECK: { message: "the files fail the seed checks", status: 400 },
|
|
1041
1089
|
WRONG_STATE: { message: "the skill nixie wrote is no longer in force", status: 409 }
|
|
1042
1090
|
});
|
|
1043
|
-
var definitionsSkillSchema =
|
|
1044
|
-
var writtenSkillSchema =
|
|
1045
|
-
approvalID:
|
|
1046
|
-
proposalID:
|
|
1047
|
-
name:
|
|
1048
|
-
skillHash:
|
|
1091
|
+
var definitionsSkillSchema = z12.object({ skillHash: z12.string(), origin: z12.enum(["definitions", "vendored"]) }).nullable();
|
|
1092
|
+
var writtenSkillSchema = z12.object({
|
|
1093
|
+
approvalID: z12.string(),
|
|
1094
|
+
proposalID: z12.string(),
|
|
1095
|
+
name: z12.string(),
|
|
1096
|
+
skillHash: z12.string(),
|
|
1049
1097
|
base: definitionsSkillSchema,
|
|
1050
1098
|
definitions: definitionsSkillSchema,
|
|
1051
|
-
isConflict:
|
|
1052
|
-
pullRequestURL:
|
|
1053
|
-
approvedAt:
|
|
1054
|
-
});
|
|
1055
|
-
var promptPartFileSchema =
|
|
1056
|
-
var promptEntrySchema =
|
|
1057
|
-
var pendingPromptProposalSchema =
|
|
1058
|
-
proposalID:
|
|
1059
|
-
promptID:
|
|
1060
|
-
proposalHash:
|
|
1061
|
-
baseHash:
|
|
1099
|
+
isConflict: z12.boolean(),
|
|
1100
|
+
pullRequestURL: z12.url().nullable(),
|
|
1101
|
+
approvedAt: z12.date()
|
|
1102
|
+
});
|
|
1103
|
+
var promptPartFileSchema = z12.object({ path: z12.string(), text: z12.string() });
|
|
1104
|
+
var promptEntrySchema = z12.record(z12.string(), z12.string());
|
|
1105
|
+
var pendingPromptProposalSchema = z12.object({
|
|
1106
|
+
proposalID: z12.string(),
|
|
1107
|
+
promptID: z12.string(),
|
|
1108
|
+
proposalHash: z12.string(),
|
|
1109
|
+
baseHash: z12.string().nullable(),
|
|
1062
1110
|
entry: promptEntrySchema,
|
|
1063
|
-
files:
|
|
1064
|
-
reason:
|
|
1065
|
-
inForce:
|
|
1066
|
-
thread:
|
|
1067
|
-
provenance:
|
|
1068
|
-
createdAt:
|
|
1069
|
-
lapseAt:
|
|
1070
|
-
isStale:
|
|
1071
|
-
});
|
|
1072
|
-
var promptAnswerSchema =
|
|
1073
|
-
proposalID:
|
|
1074
|
-
proposalHash:
|
|
1111
|
+
files: z12.array(promptPartFileSchema),
|
|
1112
|
+
reason: z12.string(),
|
|
1113
|
+
inForce: z12.object({ parts: promptEntrySchema, template: z12.string().nullable() }).nullable(),
|
|
1114
|
+
thread: z12.string().nullable(),
|
|
1115
|
+
provenance: z12.object({ runID: z12.string(), callID: z12.string(), profile: z12.string() }),
|
|
1116
|
+
createdAt: z12.date(),
|
|
1117
|
+
lapseAt: z12.date(),
|
|
1118
|
+
isStale: z12.boolean()
|
|
1119
|
+
});
|
|
1120
|
+
var promptAnswerSchema = z12.strictObject({
|
|
1121
|
+
proposalID: z12.string().min(1),
|
|
1122
|
+
proposalHash: z12.string().min(1)
|
|
1075
1123
|
});
|
|
1076
1124
|
var prompts = oc3.errors({
|
|
1077
1125
|
NOT_FOUND: { message: "nothing has that ID", status: 404 },
|
|
@@ -1080,8 +1128,51 @@ var prompts = oc3.errors({
|
|
|
1080
1128
|
STALE_BASE: { message: "the override in force moved past the proposal", status: 409 },
|
|
1081
1129
|
PROMPT_CHECK: { message: "the override fails the definitions checks", status: 400 }
|
|
1082
1130
|
});
|
|
1083
|
-
var
|
|
1084
|
-
var
|
|
1131
|
+
var ruleVersionSchema2 = z12.object({ ruleHash: z12.string(), sentence: z12.string() }).nullable();
|
|
1132
|
+
var ruleInForceSchema = z12.object({
|
|
1133
|
+
ruleID: z12.string(),
|
|
1134
|
+
revision: z12.int().positive(),
|
|
1135
|
+
ruleHash: z12.string(),
|
|
1136
|
+
sentence: z12.string(),
|
|
1137
|
+
origin: z12.enum(["definitions", "nixie"]),
|
|
1138
|
+
changeID: z12.string().nullable(),
|
|
1139
|
+
lastFiredAt: z12.date().nullable()
|
|
1140
|
+
});
|
|
1141
|
+
var ruleConflictSchema = z12.object({
|
|
1142
|
+
ruleID: z12.string(),
|
|
1143
|
+
changeID: z12.string(),
|
|
1144
|
+
nixie: ruleVersionSchema2,
|
|
1145
|
+
repo: ruleVersionSchema2,
|
|
1146
|
+
base: ruleVersionSchema2,
|
|
1147
|
+
changedBy: z12.enum(["owner", "nixie"]),
|
|
1148
|
+
reason: z12.string(),
|
|
1149
|
+
changedAt: z12.date()
|
|
1150
|
+
});
|
|
1151
|
+
var ruleProposalChangeSchema = z12.object({
|
|
1152
|
+
ruleID: z12.string(),
|
|
1153
|
+
before: ruleVersionSchema2,
|
|
1154
|
+
after: ruleVersionSchema2
|
|
1155
|
+
});
|
|
1156
|
+
var pendingRuleProposalSchema = z12.object({
|
|
1157
|
+
proposalID: z12.string(),
|
|
1158
|
+
changes: z12.array(ruleProposalChangeSchema),
|
|
1159
|
+
createdAt: z12.date(),
|
|
1160
|
+
lapseAt: z12.date()
|
|
1161
|
+
});
|
|
1162
|
+
var ruleProposalAnswerSchema = z12.strictObject({ proposalID: z12.string().min(1) });
|
|
1163
|
+
var ruleProposalRejectionSchema = ruleProposalAnswerSchema.extend({
|
|
1164
|
+
reason: z12.string().max(500).regex(/\S/u)
|
|
1165
|
+
});
|
|
1166
|
+
var ruleProposalErrors = {
|
|
1167
|
+
NOT_FOUND: { message: "nothing has that ID", status: 404 },
|
|
1168
|
+
PROPOSAL_CLOSED: { message: "the proposal is answered, withdrawn or lapsed", status: 409 }
|
|
1169
|
+
};
|
|
1170
|
+
var rules = oc3.errors(ruleProposalErrors);
|
|
1171
|
+
var forgottenItemsSchema = z12.object({
|
|
1172
|
+
itemIDs: z12.array(z12.string()),
|
|
1173
|
+
backup: forgetBackupSchema
|
|
1174
|
+
});
|
|
1175
|
+
var hostTaskStateSchema = z12.enum([
|
|
1085
1176
|
"ready",
|
|
1086
1177
|
"running",
|
|
1087
1178
|
"waiting",
|
|
@@ -1097,21 +1188,22 @@ var taskControl2 = oc3.errors({
|
|
|
1097
1188
|
message: "the task is in a state that does not take this control",
|
|
1098
1189
|
status: 409
|
|
1099
1190
|
}
|
|
1100
|
-
}).input(
|
|
1101
|
-
taskID:
|
|
1191
|
+
}).input(z12.strictObject({ taskID: z12.string().min(1) })).output(z12.object({
|
|
1192
|
+
taskID: z12.string(),
|
|
1102
1193
|
state: hostTaskStateSchema,
|
|
1103
|
-
isPauseRequested:
|
|
1194
|
+
isPauseRequested: z12.boolean()
|
|
1104
1195
|
}));
|
|
1105
1196
|
var hostContract = {
|
|
1106
|
-
reset: oc3.output(
|
|
1107
|
-
resetAt:
|
|
1108
|
-
lastSequence:
|
|
1109
|
-
keptSessions:
|
|
1197
|
+
reset: oc3.output(z12.object({
|
|
1198
|
+
resetAt: z12.date(),
|
|
1199
|
+
lastSequence: z12.int().nonnegative(),
|
|
1200
|
+
keptSessions: z12.int().nonnegative()
|
|
1110
1201
|
})),
|
|
1111
|
-
resetConversations: oc3.output(
|
|
1112
|
-
resetAt:
|
|
1113
|
-
lastSequence:
|
|
1114
|
-
shreddedRecords:
|
|
1202
|
+
resetConversations: oc3.output(z12.object({
|
|
1203
|
+
resetAt: z12.date(),
|
|
1204
|
+
lastSequence: z12.int().nonnegative(),
|
|
1205
|
+
shreddedRecords: z12.int().nonnegative(),
|
|
1206
|
+
backup: forgetBackupSchema
|
|
1115
1207
|
})),
|
|
1116
1208
|
tasks: {
|
|
1117
1209
|
pause: taskControl2,
|
|
@@ -1126,79 +1218,89 @@ var hostContract = {
|
|
|
1126
1218
|
TASK_NOT_FOUND: { message: "no task has that ID", status: 404 },
|
|
1127
1219
|
TASK_NOT_AT_LIMIT: { message: "the task is not paused at its limit", status: 409 },
|
|
1128
1220
|
LIMIT_NOT_RAISED: { message: "the new limits are not above the old ones", status: 409 }
|
|
1129
|
-
}).input(
|
|
1130
|
-
taskID:
|
|
1131
|
-
turns:
|
|
1132
|
-
dollars:
|
|
1221
|
+
}).input(z12.strictObject({
|
|
1222
|
+
taskID: z12.string().min(1),
|
|
1223
|
+
turns: z12.int().positive().optional(),
|
|
1224
|
+
dollars: z12.number().positive().optional()
|
|
1133
1225
|
}).refine((input) => input.turns !== undefined || input.dollars !== undefined, {
|
|
1134
1226
|
message: "a raise sets turns, dollars or both"
|
|
1135
|
-
})).output(
|
|
1136
|
-
taskID:
|
|
1227
|
+
})).output(z12.object({
|
|
1228
|
+
taskID: z12.string(),
|
|
1137
1229
|
state: hostTaskStateSchema,
|
|
1138
|
-
isPauseRequested:
|
|
1139
|
-
turns:
|
|
1140
|
-
dollars:
|
|
1230
|
+
isPauseRequested: z12.boolean(),
|
|
1231
|
+
turns: z12.int().positive(),
|
|
1232
|
+
dollars: z12.number().positive()
|
|
1141
1233
|
}))
|
|
1142
1234
|
},
|
|
1143
1235
|
sessions: {
|
|
1144
|
-
issueCode: oc3.output(
|
|
1145
|
-
list: oc3.output(
|
|
1236
|
+
issueCode: oc3.output(z12.object({ code: z12.string(), expiresAt: z12.date() })),
|
|
1237
|
+
list: oc3.output(z12.array(hostSessionSchema)),
|
|
1146
1238
|
label: oc3.errors({
|
|
1147
1239
|
SESSION_NOT_FOUND: {
|
|
1148
1240
|
message: "no device session that is still signed in has that ID",
|
|
1149
1241
|
status: 404
|
|
1150
1242
|
},
|
|
1151
1243
|
LABEL_INVALID: { message: "a label holds 1 to 100 characters besides spaces", status: 400 }
|
|
1152
|
-
}).input(
|
|
1244
|
+
}).input(z12.strictObject({ sessionID: z12.string().min(1), label: z12.string() })).output(z12.object({ sessionID: z12.string(), label: z12.string() }))
|
|
1153
1245
|
},
|
|
1154
1246
|
memory: {
|
|
1155
1247
|
proposals: {
|
|
1156
|
-
list: memory.output(
|
|
1248
|
+
list: memory.output(z12.array(pendingProposalSchema)),
|
|
1157
1249
|
approve: memory.input(proposalAnswerSchema2.extend({
|
|
1158
1250
|
revisionOf: versionTargetSchema2.optional(),
|
|
1159
|
-
ignoreCloseMatch:
|
|
1251
|
+
ignoreCloseMatch: z12.boolean().optional(),
|
|
1160
1252
|
editedText: itemTextSchema2.optional()
|
|
1161
1253
|
})).output(approvalResultSchema),
|
|
1162
|
-
reject: memory.input(proposalAnswerSchema2.extend({ reason:
|
|
1254
|
+
reject: memory.input(proposalAnswerSchema2.extend({ reason: z12.string().max(500).regex(/\S/u).optional() })).output(z12.object({ proposalID: z12.string() }))
|
|
1163
1255
|
},
|
|
1164
|
-
subjects: memory.output(
|
|
1256
|
+
subjects: memory.output(z12.object({ items: subjectCountSchema, proposals: subjectCountSchema })),
|
|
1165
1257
|
items: {
|
|
1166
|
-
read: memory.input(
|
|
1258
|
+
read: memory.input(z12.strictObject({ itemID: z12.string().min(1) })).output(itemHistorySchema),
|
|
1167
1259
|
edit: memory.input(versionTargetSchema2.extend({ text: itemTextSchema2 })).output(versionRefSchema2),
|
|
1168
1260
|
retire: memory.input(versionTargetSchema2).output(versionRefSchema2),
|
|
1169
1261
|
restore: memory.input(versionTargetSchema2).output(versionRefSchema2),
|
|
1170
|
-
forget: memory.input(versionTargetSchema2).output(
|
|
1262
|
+
forget: memory.input(versionTargetSchema2).output(z12.object({ itemID: z12.string(), backup: forgetBackupSchema })),
|
|
1171
1263
|
forgetAll: memory.output(forgottenItemsSchema),
|
|
1172
|
-
pin: memory.input(
|
|
1264
|
+
pin: memory.input(z12.strictObject({ itemID: z12.string().min(1), isPinned: z12.boolean() })).output(z12.object({ itemID: z12.string(), isPinned: z12.boolean() }))
|
|
1173
1265
|
},
|
|
1174
1266
|
consolidation: {
|
|
1175
1267
|
read: memory.output(consolidationDiffSchema.nullable()),
|
|
1176
|
-
approve: memory.input(
|
|
1177
|
-
reject: memory.input(changeAnswerSchema).output(
|
|
1268
|
+
approve: memory.input(z12.strictObject({ answers: z12.array(changeAnswerSchema).min(1).max(30) })).output(z12.object({ outcomes: z12.array(changeOutcomeSchema) })),
|
|
1269
|
+
reject: memory.input(changeAnswerSchema).output(z12.object({ changeID: z12.string() }))
|
|
1178
1270
|
}
|
|
1179
1271
|
},
|
|
1180
1272
|
skills: {
|
|
1181
1273
|
proposals: {
|
|
1182
|
-
list: skills.output(
|
|
1183
|
-
approve: skills.input(skillAnswerSchema.extend({ files:
|
|
1184
|
-
reject: skills.input(skillAnswerSchema.extend({ reason:
|
|
1274
|
+
list: skills.output(z12.array(pendingSkillProposalSchema)),
|
|
1275
|
+
approve: skills.input(skillAnswerSchema.extend({ files: z12.array(skillFileSchema).min(1).optional() })).output(z12.object({ proposalID: z12.string(), approvalID: z12.string(), skillHash: z12.string() })),
|
|
1276
|
+
reject: skills.input(skillAnswerSchema.extend({ reason: z12.string().max(500).regex(/\S/u) })).output(z12.object({ proposalID: z12.string() }))
|
|
1185
1277
|
},
|
|
1186
1278
|
written: {
|
|
1187
|
-
list: skills.output(
|
|
1188
|
-
resolve: skills.input(
|
|
1189
|
-
approvalID:
|
|
1190
|
-
keep:
|
|
1191
|
-
})).output(
|
|
1279
|
+
list: skills.output(z12.array(writtenSkillSchema)),
|
|
1280
|
+
resolve: skills.input(z12.strictObject({
|
|
1281
|
+
approvalID: z12.string().min(1),
|
|
1282
|
+
keep: z12.enum(["nixie", "definitions"])
|
|
1283
|
+
})).output(z12.object({ approvalID: z12.string(), keep: z12.enum(["nixie", "definitions"]) }))
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
rules: {
|
|
1287
|
+
list: rules.output(z12.array(ruleInForceSchema)),
|
|
1288
|
+
conflicts: rules.output(z12.array(ruleConflictSchema)),
|
|
1289
|
+
resolve: rules.input(z12.strictObject({ ruleID: z12.string().min(1), keep: z12.enum(["nixie", "repo"]) })).output(z12.object({ ruleID: z12.string(), changeID: z12.string(), keep: z12.enum(["nixie", "repo"]) })),
|
|
1290
|
+
proposals: {
|
|
1291
|
+
list: rules.output(z12.array(pendingRuleProposalSchema)),
|
|
1292
|
+
approve: rules.input(ruleProposalAnswerSchema).output(z12.object({ proposalID: z12.string() })),
|
|
1293
|
+
reject: rules.input(ruleProposalRejectionSchema).output(z12.object({ proposalID: z12.string() }))
|
|
1192
1294
|
}
|
|
1193
1295
|
},
|
|
1194
1296
|
prompts: {
|
|
1195
1297
|
proposals: {
|
|
1196
|
-
list: prompts.output(
|
|
1298
|
+
list: prompts.output(z12.array(pendingPromptProposalSchema)),
|
|
1197
1299
|
approve: prompts.input(promptAnswerSchema.extend({
|
|
1198
1300
|
entry: promptEntrySchema.optional(),
|
|
1199
|
-
files:
|
|
1200
|
-
})).output(
|
|
1201
|
-
reject: prompts.input(promptAnswerSchema.extend({ reason:
|
|
1301
|
+
files: z12.array(promptPartFileSchema).optional()
|
|
1302
|
+
})).output(z12.object({ proposalID: z12.string(), approvalID: z12.string(), proposalHash: z12.string() })),
|
|
1303
|
+
reject: prompts.input(promptAnswerSchema.extend({ reason: z12.string().max(500).regex(/\S/u) })).output(z12.object({ proposalID: z12.string() }))
|
|
1202
1304
|
}
|
|
1203
1305
|
}
|
|
1204
1306
|
};
|
|
@@ -1220,11 +1322,11 @@ function renderSessionCookie(token) {
|
|
|
1220
1322
|
return `${sessionCookieName}=${token ?? ""}; Path=/; HttpOnly; Secure; SameSite=Lax; Max-Age=${maxAgeS}`;
|
|
1221
1323
|
}
|
|
1222
1324
|
// src/task-message-input-schema.ts
|
|
1223
|
-
import { z as
|
|
1325
|
+
import { z as z14 } from "zod";
|
|
1224
1326
|
|
|
1225
1327
|
// src/task-message-kind-schema.ts
|
|
1226
|
-
import { z as
|
|
1227
|
-
var taskMessageKindSchema =
|
|
1328
|
+
import { z as z13 } from "zod";
|
|
1329
|
+
var taskMessageKindSchema = z13.enum([
|
|
1228
1330
|
"progress",
|
|
1229
1331
|
"question",
|
|
1230
1332
|
"request",
|
|
@@ -1234,21 +1336,21 @@ var taskMessageKindSchema = z11.enum([
|
|
|
1234
1336
|
]);
|
|
1235
1337
|
|
|
1236
1338
|
// src/task-message-input-schema.ts
|
|
1237
|
-
var taskMessageInputSchema =
|
|
1238
|
-
to:
|
|
1339
|
+
var taskMessageInputSchema = z14.object({
|
|
1340
|
+
to: z14.string(),
|
|
1239
1341
|
kind: taskMessageKindSchema,
|
|
1240
|
-
body:
|
|
1241
|
-
replyTo:
|
|
1242
|
-
onBehalfOf:
|
|
1243
|
-
wake:
|
|
1342
|
+
body: z14.string(),
|
|
1343
|
+
replyTo: z14.string().optional(),
|
|
1344
|
+
onBehalfOf: z14.string().array().optional(),
|
|
1345
|
+
wake: z14.boolean().optional()
|
|
1244
1346
|
});
|
|
1245
1347
|
// src/task-message-result-schema.ts
|
|
1246
|
-
import { z as
|
|
1247
|
-
var taskMessageResultSchema =
|
|
1248
|
-
messageID:
|
|
1249
|
-
woke:
|
|
1250
|
-
hop:
|
|
1251
|
-
note:
|
|
1348
|
+
import { z as z15 } from "zod";
|
|
1349
|
+
var taskMessageResultSchema = z15.object({
|
|
1350
|
+
messageID: z15.string(),
|
|
1351
|
+
woke: z15.boolean(),
|
|
1352
|
+
hop: z15.int().nonnegative(),
|
|
1353
|
+
note: z15.string().optional()
|
|
1252
1354
|
});
|
|
1253
1355
|
export {
|
|
1254
1356
|
buildPendingInput,
|