@heynixie/contract 0.54.0 → 0.56.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.
@@ -60,6 +60,11 @@ export declare function buildQueryUtils(client: ContractClient): {
60
60
  }[];
61
61
  } | undefined;
62
62
  recordedAt: Date;
63
+ route?: {
64
+ isMove: boolean;
65
+ messages: number[];
66
+ taskID: string;
67
+ } | undefined;
63
68
  sequence: number;
64
69
  summary?: {
65
70
  contextSize?: number | undefined;
@@ -136,6 +141,11 @@ export declare function buildQueryUtils(client: ContractClient): {
136
141
  }[];
137
142
  } | undefined;
138
143
  recordedAt: Date;
144
+ route?: {
145
+ isMove: boolean;
146
+ messages: number[];
147
+ taskID: string;
148
+ } | undefined;
139
149
  sequence: number;
140
150
  summary?: {
141
151
  contextSize?: number | undefined;
@@ -275,6 +285,78 @@ export declare function buildQueryUtils(client: ContractClient): {
275
285
  sequence: number;
276
286
  thread: string;
277
287
  }>;
288
+ move: import("@orpc/tanstack-query").ProcedureUtils<Record<never, never>, {
289
+ clientActionID: string;
290
+ sequence: number;
291
+ thread: string;
292
+ to: {
293
+ kind: "new";
294
+ name: string;
295
+ brief: string;
296
+ } | {
297
+ kind: "task";
298
+ taskID: string;
299
+ };
300
+ }, {
301
+ movedAt: Date;
302
+ taskID: string;
303
+ }, import("@orpc/contract").ErrorFromErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
304
+ UNAUTHORIZED: {
305
+ message: string;
306
+ status: number;
307
+ };
308
+ }>, {
309
+ CLIENT_ACTION_ID_REUSED: {
310
+ message: string;
311
+ status: number;
312
+ };
313
+ }>, {
314
+ RECORD_NOT_FOUND: {
315
+ message: string;
316
+ status: number;
317
+ };
318
+ TASK_NOT_FOUND: {
319
+ message: string;
320
+ status: number;
321
+ };
322
+ TASK_TAKES_NO_MESSAGES: {
323
+ message: string;
324
+ status: number;
325
+ };
326
+ ALREADY_THERE: {
327
+ message: string;
328
+ status: number;
329
+ };
330
+ }>>> & import("@orpc/tanstack-query").GeneralUtils<{
331
+ clientActionID: string;
332
+ sequence: number;
333
+ thread: string;
334
+ to: {
335
+ kind: "new";
336
+ name: string;
337
+ brief: string;
338
+ } | {
339
+ kind: "task";
340
+ taskID: string;
341
+ };
342
+ }>;
343
+ } & import("@orpc/tanstack-query").GeneralUtils<unknown>;
344
+ tasks: {
345
+ list: import("@orpc/tanstack-query").ProcedureUtils<Record<never, never>, unknown, {
346
+ tasks: {
347
+ brief: string;
348
+ isTakingMessages: boolean;
349
+ lastActivityAt: Date;
350
+ name: string;
351
+ state: "done" | "failed" | "ready" | "running" | "waiting";
352
+ taskID: string;
353
+ }[];
354
+ }, import("@orpc/contract").ErrorFromErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
355
+ UNAUTHORIZED: {
356
+ message: string;
357
+ status: number;
358
+ };
359
+ }>>> & import("@orpc/tanstack-query").GeneralUtils<unknown>;
278
360
  } & import("@orpc/tanstack-query").GeneralUtils<unknown>;
279
361
  memory: {
280
362
  export: import("@orpc/tanstack-query").ProcedureUtils<Record<never, never>, {
@@ -1379,11 +1461,12 @@ export declare function buildQueryUtils(client: ContractClient): {
1379
1461
  itemID: string;
1380
1462
  kind: "fact" | "self";
1381
1463
  lapseAt: Date;
1464
+ newSubject: "owner" | "self" | "shared" | null;
1382
1465
  operation: "pin" | "remember" | "retire";
1383
1466
  origin: "conversation" | "memory_writer" | "owner" | "task";
1384
1467
  proposalID: string;
1385
1468
  quote: string | null;
1386
- reason: "ambiguous_target" | "checker_not_asserted" | "checker_unreachable" | "checker_unsure" | "forgotten_evidence" | "from_photo" | "invisible_character" | "no_quote" | "other" | "pinned" | "quote_in_quoted_block" | "quote_not_typed" | "self_note" | "sensitive" | "token_missing";
1469
+ reason: "ambiguous_target" | "checker_not_asserted" | "checker_unreachable" | "checker_unsure" | "forgotten_evidence" | "from_photo" | "invisible_character" | "no_quote" | "other" | "pinned" | "quote_in_quoted_block" | "quote_not_typed" | "self_note" | "sensitive" | "subject_change" | "token_missing";
1387
1470
  source: "owner" | "owner_data" | "untrusted";
1388
1471
  sources: {
1389
1472
  origin: "conversation" | "memory_writer" | "owner" | "task";
@@ -1645,6 +1728,11 @@ export declare function buildQueryUtils(client: ContractClient): {
1645
1728
  }[];
1646
1729
  } | undefined;
1647
1730
  recordedAt: Date;
1731
+ route?: {
1732
+ isMove: boolean;
1733
+ messages: number[];
1734
+ taskID: string;
1735
+ } | undefined;
1648
1736
  sequence: number;
1649
1737
  summary?: {
1650
1738
  contextSize?: number | undefined;
@@ -1736,6 +1824,11 @@ export declare function buildQueryUtils(client: ContractClient): {
1736
1824
  }[];
1737
1825
  } | undefined;
1738
1826
  recordedAt: Date;
1827
+ route?: {
1828
+ isMove: boolean;
1829
+ messages: number[];
1830
+ taskID: string;
1831
+ } | undefined;
1739
1832
  sequence: number;
1740
1833
  summary?: {
1741
1834
  contextSize?: number | undefined;
@@ -77,6 +77,11 @@ export declare const contract: {
77
77
  }, z.core.$strip>>;
78
78
  }, z.core.$strip>>;
79
79
  recordedAt: z.ZodDate;
80
+ route: z.ZodOptional<z.ZodObject<{
81
+ isMove: z.ZodBoolean;
82
+ messages: z.ZodArray<z.ZodInt>;
83
+ taskID: z.ZodString;
84
+ }, z.core.$strip>>;
80
85
  sequence: z.ZodInt;
81
86
  summary: z.ZodOptional<z.ZodObject<{
82
87
  contextSize: z.ZodOptional<z.ZodInt>;
@@ -173,6 +178,11 @@ export declare const contract: {
173
178
  }, z.core.$strip>>;
174
179
  }, z.core.$strip>>;
175
180
  recordedAt: z.ZodDate;
181
+ route: z.ZodOptional<z.ZodObject<{
182
+ isMove: z.ZodBoolean;
183
+ messages: z.ZodArray<z.ZodInt>;
184
+ taskID: z.ZodString;
185
+ }, z.core.$strip>>;
176
186
  sequence: z.ZodInt;
177
187
  summary: z.ZodOptional<z.ZodObject<{
178
188
  contextSize: z.ZodOptional<z.ZodInt>;
@@ -296,6 +306,72 @@ export declare const contract: {
296
306
  status: number;
297
307
  };
298
308
  }>, Record<never, never>>;
309
+ move: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
310
+ clientActionID: z.ZodUUID;
311
+ sequence: z.ZodInt;
312
+ thread: z.ZodString;
313
+ to: z.ZodDiscriminatedUnion<[z.ZodObject<{
314
+ kind: z.ZodLiteral<"task">;
315
+ taskID: z.ZodString;
316
+ }, z.core.$strip>, z.ZodObject<{
317
+ kind: z.ZodLiteral<"new">;
318
+ name: z.ZodString;
319
+ brief: z.ZodString;
320
+ }, z.core.$strip>], "kind">;
321
+ }, z.core.$strip>, z.ZodObject<{
322
+ movedAt: z.ZodDate;
323
+ taskID: z.ZodString;
324
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
325
+ UNAUTHORIZED: {
326
+ message: string;
327
+ status: number;
328
+ };
329
+ }>, {
330
+ CLIENT_ACTION_ID_REUSED: {
331
+ message: string;
332
+ status: number;
333
+ };
334
+ }>, {
335
+ RECORD_NOT_FOUND: {
336
+ message: string;
337
+ status: number;
338
+ };
339
+ TASK_NOT_FOUND: {
340
+ message: string;
341
+ status: number;
342
+ };
343
+ TASK_TAKES_NO_MESSAGES: {
344
+ message: string;
345
+ status: number;
346
+ };
347
+ ALREADY_THERE: {
348
+ message: string;
349
+ status: number;
350
+ };
351
+ }>, Record<never, never>>;
352
+ };
353
+ tasks: {
354
+ list: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
355
+ tasks: z.ZodArray<z.ZodObject<{
356
+ brief: z.ZodString;
357
+ isTakingMessages: z.ZodBoolean;
358
+ lastActivityAt: z.ZodDate;
359
+ name: z.ZodString;
360
+ state: z.ZodEnum<{
361
+ done: "done";
362
+ failed: "failed";
363
+ ready: "ready";
364
+ running: "running";
365
+ waiting: "waiting";
366
+ }>;
367
+ taskID: z.ZodString;
368
+ }, z.core.$strip>>;
369
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
370
+ UNAUTHORIZED: {
371
+ message: string;
372
+ status: number;
373
+ };
374
+ }>, Record<never, never>>;
299
375
  };
300
376
  memory: {
301
377
  export: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
@@ -1601,6 +1677,11 @@ export declare const contract: {
1601
1677
  self: "self";
1602
1678
  }>;
1603
1679
  lapseAt: z.ZodDate;
1680
+ newSubject: z.ZodNullable<z.ZodEnum<{
1681
+ owner: "owner";
1682
+ self: "self";
1683
+ shared: "shared";
1684
+ }>>;
1604
1685
  operation: z.ZodEnum<{
1605
1686
  pin: "pin";
1606
1687
  remember: "remember";
@@ -1629,6 +1710,7 @@ export declare const contract: {
1629
1710
  quote_not_typed: "quote_not_typed";
1630
1711
  self_note: "self_note";
1631
1712
  sensitive: "sensitive";
1713
+ subject_change: "subject_change";
1632
1714
  token_missing: "token_missing";
1633
1715
  }>;
1634
1716
  source: z.ZodEnum<{
@@ -1912,6 +1994,11 @@ export declare const contract: {
1912
1994
  }[];
1913
1995
  } | undefined;
1914
1996
  recordedAt: Date;
1997
+ route?: {
1998
+ isMove: boolean;
1999
+ messages: number[];
2000
+ taskID: string;
2001
+ } | undefined;
1915
2002
  sequence: number;
1916
2003
  summary?: {
1917
2004
  contextSize?: number | undefined;
@@ -1989,6 +2076,11 @@ export declare const contract: {
1989
2076
  }[];
1990
2077
  } | undefined;
1991
2078
  recordedAt: Date;
2079
+ route?: {
2080
+ isMove: boolean;
2081
+ messages: number[];
2082
+ taskID: string;
2083
+ } | undefined;
1992
2084
  sequence: number;
1993
2085
  summary?: {
1994
2086
  contextSize?: number | undefined;
@@ -2077,6 +2169,11 @@ export declare const contract: {
2077
2169
  }[];
2078
2170
  } | undefined;
2079
2171
  recordedAt: Date;
2172
+ route?: {
2173
+ isMove: boolean;
2174
+ messages: number[];
2175
+ taskID: string;
2176
+ } | undefined;
2080
2177
  sequence: number;
2081
2178
  summary?: {
2082
2179
  contextSize?: number | undefined;
@@ -2154,6 +2251,11 @@ export declare const contract: {
2154
2251
  }[];
2155
2252
  } | undefined;
2156
2253
  recordedAt: Date;
2254
+ route?: {
2255
+ isMove: boolean;
2256
+ messages: number[];
2257
+ taskID: string;
2258
+ } | undefined;
2157
2259
  sequence: number;
2158
2260
  summary?: {
2159
2261
  contextSize?: number | undefined;
@@ -55,6 +55,11 @@ export declare const hostContract: {
55
55
  self: "self";
56
56
  shared: "shared";
57
57
  }>;
58
+ newSubject: z.ZodNullable<z.ZodEnum<{
59
+ owner: "owner";
60
+ self: "self";
61
+ shared: "shared";
62
+ }>>;
58
63
  isSensitive: z.ZodBoolean;
59
64
  kind: z.ZodEnum<{
60
65
  fact: "fact";
@@ -75,6 +80,7 @@ export declare const hostContract: {
75
80
  quote_not_typed: "quote_not_typed";
76
81
  self_note: "self_note";
77
82
  sensitive: "sensitive";
83
+ subject_change: "subject_change";
78
84
  token_missing: "token_missing";
79
85
  }>;
80
86
  actionHash: z.ZodString;
package/dist/index.js CHANGED
@@ -451,7 +451,8 @@ var reviewReasonSchema = z5.enum([
451
451
  "other",
452
452
  "self_note",
453
453
  "from_photo",
454
- "sensitive"
454
+ "sensitive",
455
+ "subject_change"
455
456
  ]);
456
457
  var proposalSourceSchema = z5.object({
457
458
  origin: proposalOriginSchema,
@@ -468,6 +469,7 @@ var memoryProposalSchema = z5.object({
468
469
  itemID: z5.string(),
469
470
  kind: kindSchema,
470
471
  lapseAt: z5.date(),
472
+ newSubject: subjectSchema.nullable(),
471
473
  operation: z5.enum(["remember", "retire", "pin"]),
472
474
  origin: proposalOriginSchema,
473
475
  proposalID: z5.string(),
@@ -670,6 +672,11 @@ var versionTextSchema = versionRefSchema.extend({
670
672
  status: z9.enum(["readable", "shredded", "unreadable", "missing"]),
671
673
  text: z9.string().optional()
672
674
  });
675
+ var routeSchema = z9.object({
676
+ isMove: z9.boolean(),
677
+ messages: z9.array(sequenceSchema),
678
+ taskID: threadSchema
679
+ });
673
680
  var recordSchema = z9.object({
674
681
  compaction: compactionSchema.optional(),
675
682
  compactionFailure: compactionFailureSchema.optional(),
@@ -686,6 +693,7 @@ var recordSchema = z9.object({
686
693
  rating: ratingSchema.optional(),
687
694
  recall: recallSchema.optional(),
688
695
  recordedAt: z9.date(),
696
+ route: routeSchema.optional(),
689
697
  sequence: sequenceSchema,
690
698
  summary: summarySchema.optional(),
691
699
  thread: threadSchema,
@@ -701,6 +709,25 @@ var sessionSchema = z9.object({
701
709
  sessionID: z9.uuid()
702
710
  });
703
711
  var checkedAction = signedIn.errors(reusedIDErrors);
712
+ var taskNameSchema = z9.string().trim().min(1).max(80);
713
+ var taskBriefSchema = z9.string().trim().min(1).max(8000);
714
+ var newTaskTargetSchema = z9.object({
715
+ kind: z9.literal("new"),
716
+ name: taskNameSchema,
717
+ brief: taskBriefSchema
718
+ });
719
+ var moveTargetSchema = z9.discriminatedUnion("kind", [
720
+ z9.object({ kind: z9.literal("task"), taskID: threadSchema }),
721
+ newTaskTargetSchema
722
+ ]);
723
+ var listedTaskSchema = z9.object({
724
+ brief: z9.string(),
725
+ isTakingMessages: z9.boolean(),
726
+ lastActivityAt: z9.date(),
727
+ name: z9.string(),
728
+ state: z9.enum(["ready", "running", "waiting", "done", "failed"]),
729
+ taskID: threadSchema
730
+ });
704
731
  var followRecords = signedIn.input(z9.object({ afterSequence: sequenceSchema, thread: threadSchema.optional() })).output(eventIterator2(z9.object({ record: recordSchema })));
705
732
  var contract = {
706
733
  conversation: {
@@ -736,7 +763,27 @@ var contract = {
736
763
  clientActionID: clientActionIDSchema,
737
764
  sequence: sequenceSchema,
738
765
  thread: threadSchema
739
- })).output(z9.object({ forgottenAt: z9.date() }))
766
+ })).output(z9.object({ forgottenAt: z9.date() })),
767
+ move: checkedAction.errors({
768
+ RECORD_NOT_FOUND: {
769
+ message: "No message of yours on this thread has this sequence",
770
+ status: 404
771
+ },
772
+ TASK_NOT_FOUND: { message: "No open task has this ID", status: 404 },
773
+ TASK_TAKES_NO_MESSAGES: {
774
+ message: "This task runs on its own schedule and takes no message of yours",
775
+ status: 409
776
+ },
777
+ ALREADY_THERE: { message: "The message already went to this task", status: 409 }
778
+ }).input(z9.object({
779
+ clientActionID: clientActionIDSchema,
780
+ sequence: sequenceSchema,
781
+ thread: threadSchema,
782
+ to: moveTargetSchema
783
+ })).output(z9.object({ movedAt: z9.date(), taskID: threadSchema }))
784
+ },
785
+ tasks: {
786
+ list: signedIn.output(z9.object({ tasks: z9.array(listedTaskSchema) }))
740
787
  },
741
788
  memory: {
742
789
  readVersions: signedIn.input(z9.object({ versions: z9.array(versionRefSchema).min(1).max(100) })).output(z9.object({ versions: z9.array(versionTextSchema) })),
@@ -804,7 +851,8 @@ var reviewReasonSchema2 = z10.enum([
804
851
  "other",
805
852
  "self_note",
806
853
  "from_photo",
807
- "sensitive"
854
+ "sensitive",
855
+ "subject_change"
808
856
  ]);
809
857
  var proposalSourceSchema2 = z10.object({
810
858
  origin: proposalOriginSchema2,
@@ -818,6 +866,7 @@ var pendingProposalSchema = z10.object({
818
866
  targetVersion: z10.int().nullable(),
819
867
  isPinned: z10.boolean(),
820
868
  subject: z10.enum(["owner", "self", "shared"]),
869
+ newSubject: z10.enum(["owner", "self", "shared"]).nullable(),
821
870
  isSensitive: z10.boolean(),
822
871
  kind: z10.enum(["fact", "self"]),
823
872
  reason: reviewReasonSchema2,
@@ -1303,6 +1303,11 @@ export declare const memoryViewContract: {
1303
1303
  self: "self";
1304
1304
  }>;
1305
1305
  lapseAt: z.ZodDate;
1306
+ newSubject: z.ZodNullable<z.ZodEnum<{
1307
+ owner: "owner";
1308
+ self: "self";
1309
+ shared: "shared";
1310
+ }>>;
1306
1311
  operation: z.ZodEnum<{
1307
1312
  pin: "pin";
1308
1313
  remember: "remember";
@@ -1331,6 +1336,7 @@ export declare const memoryViewContract: {
1331
1336
  quote_not_typed: "quote_not_typed";
1332
1337
  self_note: "self_note";
1333
1338
  sensitive: "sensitive";
1339
+ subject_change: "subject_change";
1334
1340
  token_missing: "token_missing";
1335
1341
  }>;
1336
1342
  source: z.ZodEnum<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heynixie/contract",
3
- "version": "0.54.0",
3
+ "version": "0.56.0",
4
4
  "description": "The oRPC contract of the nixie API, with the types a client needs",
5
5
  "license": "MIT",
6
6
  "repository": {