@undefineds.co/models 0.2.25 → 0.2.27

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.
Files changed (42) hide show
  1. package/dist/approval.schema.d.ts +4 -0
  2. package/dist/approval.schema.js +6 -1
  3. package/dist/audit.presentation.d.ts +1 -1
  4. package/dist/audit.presentation.js +19 -12
  5. package/dist/audit.schema.d.ts +4 -0
  6. package/dist/audit.schema.js +6 -1
  7. package/dist/bin/udfs.d.ts +2 -0
  8. package/dist/bin/udfs.js +430 -0
  9. package/dist/chat.repository.d.ts +8 -0
  10. package/dist/chat.schema.d.ts +10 -0
  11. package/dist/chat.schema.js +9 -2
  12. package/dist/chat.utils.js +24 -9
  13. package/dist/index.d.ts +9 -3
  14. package/dist/index.js +10 -3
  15. package/dist/issue.repository.d.ts +69 -0
  16. package/dist/issue.repository.js +8 -0
  17. package/dist/issue.schema.d.ts +48 -0
  18. package/dist/issue.schema.js +37 -0
  19. package/dist/message.repository.d.ts +29 -9
  20. package/dist/message.schema.d.ts +29 -6
  21. package/dist/message.schema.js +26 -10
  22. package/dist/namespaces.js +29 -0
  23. package/dist/pod-storage-descriptor.d.ts +189 -0
  24. package/dist/pod-storage-descriptor.js +283 -0
  25. package/dist/repository.d.ts +2 -0
  26. package/dist/repository.js +3 -0
  27. package/dist/resource-id-defaults.d.ts +18 -0
  28. package/dist/resource-id-defaults.js +84 -0
  29. package/dist/run.schema.d.ts +112 -0
  30. package/dist/run.schema.js +89 -0
  31. package/dist/schema.d.ts +176 -8
  32. package/dist/schema.js +11 -0
  33. package/dist/session/session.schema.js +2 -1
  34. package/dist/sidecar/persistence-mapping.d.ts +3 -3
  35. package/dist/sidecar/sidecar-events.d.ts +45 -45
  36. package/dist/sidecar/sidecar-events.js +1 -1
  37. package/dist/task.schema.d.ts +62 -0
  38. package/dist/task.schema.js +49 -0
  39. package/dist/thread.repository.d.ts +15 -3
  40. package/dist/thread.schema.d.ts +14 -2
  41. package/dist/thread.schema.js +13 -5
  42. package/package.json +11 -3
@@ -45,7 +45,7 @@ export declare const ToolCallEventV1Schema: z.ZodObject<{
45
45
  policyVersion: z.ZodOptional<z.ZodString>;
46
46
  timestamp: z.ZodString;
47
47
  }, "strict", z.ZodTypeAny, {
48
- status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
48
+ status: "error" | "running" | "approved" | "rejected" | "done" | "calling" | "waiting_approval";
49
49
  toolCallId: string;
50
50
  toolName: string;
51
51
  type: "tool.call";
@@ -62,17 +62,17 @@ export declare const ToolCallEventV1Schema: z.ZodObject<{
62
62
  }[] | undefined;
63
63
  expiresAt?: string | undefined;
64
64
  policyVersion?: string | undefined;
65
+ error?: string | undefined;
65
66
  decisionBy?: string | undefined;
66
- decisionRole?: "human" | "secretary" | "system" | undefined;
67
+ decisionRole?: "system" | "human" | "secretary" | undefined;
67
68
  onBehalfOf?: string | undefined;
68
69
  inboxItemId?: string | undefined;
69
- error?: string | undefined;
70
70
  arguments?: Record<string, unknown> | undefined;
71
71
  result?: unknown;
72
72
  duration?: number | undefined;
73
73
  version?: 1 | undefined;
74
74
  }, {
75
- status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
75
+ status: "error" | "running" | "approved" | "rejected" | "done" | "calling" | "waiting_approval";
76
76
  toolCallId: string;
77
77
  toolName: string;
78
78
  type: "tool.call";
@@ -89,11 +89,11 @@ export declare const ToolCallEventV1Schema: z.ZodObject<{
89
89
  }[] | undefined;
90
90
  expiresAt?: string | undefined;
91
91
  policyVersion?: string | undefined;
92
+ error?: string | undefined;
92
93
  decisionBy?: string | undefined;
93
- decisionRole?: "human" | "secretary" | "system" | undefined;
94
+ decisionRole?: "system" | "human" | "secretary" | undefined;
94
95
  onBehalfOf?: string | undefined;
95
96
  inboxItemId?: string | undefined;
96
- error?: string | undefined;
97
97
  arguments?: Record<string, unknown> | undefined;
98
98
  result?: unknown;
99
99
  duration?: number | undefined;
@@ -137,7 +137,7 @@ export declare const ToolCallEventSchema: z.ZodObject<{
137
137
  policyVersion: z.ZodOptional<z.ZodString>;
138
138
  timestamp: z.ZodString;
139
139
  }, "strict", z.ZodTypeAny, {
140
- status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
140
+ status: "error" | "running" | "approved" | "rejected" | "done" | "calling" | "waiting_approval";
141
141
  toolCallId: string;
142
142
  toolName: string;
143
143
  type: "tool.call";
@@ -154,17 +154,17 @@ export declare const ToolCallEventSchema: z.ZodObject<{
154
154
  }[] | undefined;
155
155
  expiresAt?: string | undefined;
156
156
  policyVersion?: string | undefined;
157
+ error?: string | undefined;
157
158
  decisionBy?: string | undefined;
158
- decisionRole?: "human" | "secretary" | "system" | undefined;
159
+ decisionRole?: "system" | "human" | "secretary" | undefined;
159
160
  onBehalfOf?: string | undefined;
160
161
  inboxItemId?: string | undefined;
161
- error?: string | undefined;
162
162
  arguments?: Record<string, unknown> | undefined;
163
163
  result?: unknown;
164
164
  duration?: number | undefined;
165
165
  version?: 1 | undefined;
166
166
  }, {
167
- status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
167
+ status: "error" | "running" | "approved" | "rejected" | "done" | "calling" | "waiting_approval";
168
168
  toolCallId: string;
169
169
  toolName: string;
170
170
  type: "tool.call";
@@ -181,11 +181,11 @@ export declare const ToolCallEventSchema: z.ZodObject<{
181
181
  }[] | undefined;
182
182
  expiresAt?: string | undefined;
183
183
  policyVersion?: string | undefined;
184
+ error?: string | undefined;
184
185
  decisionBy?: string | undefined;
185
- decisionRole?: "human" | "secretary" | "system" | undefined;
186
+ decisionRole?: "system" | "human" | "secretary" | undefined;
186
187
  onBehalfOf?: string | undefined;
187
188
  inboxItemId?: string | undefined;
188
- error?: string | undefined;
189
189
  arguments?: Record<string, unknown> | undefined;
190
190
  result?: unknown;
191
191
  duration?: number | undefined;
@@ -200,7 +200,7 @@ export declare const SessionStateEventV1Schema: z.ZodObject<{
200
200
  type: z.ZodLiteral<"session.state">;
201
201
  version: z.ZodOptional<z.ZodLiteral<1>>;
202
202
  sessionId: z.ZodString;
203
- chatId: z.ZodString;
203
+ chat: z.ZodString;
204
204
  policy: z.ZodOptional<z.ZodString>;
205
205
  policyVersion: z.ZodOptional<z.ZodString>;
206
206
  status: z.ZodEnum<["active", "paused", "completed", "error"]>;
@@ -209,11 +209,11 @@ export declare const SessionStateEventV1Schema: z.ZodObject<{
209
209
  tokenUsage: z.ZodNumber;
210
210
  timestamp: z.ZodString;
211
211
  }, "strict", z.ZodTypeAny, {
212
- status: "error" | "paused" | "active" | "completed";
212
+ status: "error" | "active" | "completed" | "paused";
213
213
  tokenUsage: number;
214
214
  type: "session.state";
215
+ chat: string;
215
216
  tool: "claude-code" | "cursor" | "windsurf";
216
- chatId: string;
217
217
  sessionId: string;
218
218
  timestamp: string;
219
219
  previousStatus: string;
@@ -221,11 +221,11 @@ export declare const SessionStateEventV1Schema: z.ZodObject<{
221
221
  policyVersion?: string | undefined;
222
222
  version?: 1 | undefined;
223
223
  }, {
224
- status: "error" | "paused" | "active" | "completed";
224
+ status: "error" | "active" | "completed" | "paused";
225
225
  tokenUsage: number;
226
226
  type: "session.state";
227
+ chat: string;
227
228
  tool: "claude-code" | "cursor" | "windsurf";
228
- chatId: string;
229
229
  sessionId: string;
230
230
  timestamp: string;
231
231
  previousStatus: string;
@@ -237,7 +237,7 @@ export declare const SessionStateEventSchema: z.ZodObject<{
237
237
  type: z.ZodLiteral<"session.state">;
238
238
  version: z.ZodOptional<z.ZodLiteral<1>>;
239
239
  sessionId: z.ZodString;
240
- chatId: z.ZodString;
240
+ chat: z.ZodString;
241
241
  policy: z.ZodOptional<z.ZodString>;
242
242
  policyVersion: z.ZodOptional<z.ZodString>;
243
243
  status: z.ZodEnum<["active", "paused", "completed", "error"]>;
@@ -246,11 +246,11 @@ export declare const SessionStateEventSchema: z.ZodObject<{
246
246
  tokenUsage: z.ZodNumber;
247
247
  timestamp: z.ZodString;
248
248
  }, "strict", z.ZodTypeAny, {
249
- status: "error" | "paused" | "active" | "completed";
249
+ status: "error" | "active" | "completed" | "paused";
250
250
  tokenUsage: number;
251
251
  type: "session.state";
252
+ chat: string;
252
253
  tool: "claude-code" | "cursor" | "windsurf";
253
- chatId: string;
254
254
  sessionId: string;
255
255
  timestamp: string;
256
256
  previousStatus: string;
@@ -258,11 +258,11 @@ export declare const SessionStateEventSchema: z.ZodObject<{
258
258
  policyVersion?: string | undefined;
259
259
  version?: 1 | undefined;
260
260
  }, {
261
- status: "error" | "paused" | "active" | "completed";
261
+ status: "error" | "active" | "completed" | "paused";
262
262
  tokenUsage: number;
263
263
  type: "session.state";
264
+ chat: string;
264
265
  tool: "claude-code" | "cursor" | "windsurf";
265
- chatId: string;
266
266
  sessionId: string;
267
267
  timestamp: string;
268
268
  previousStatus: string;
@@ -288,11 +288,11 @@ export declare const ToolControlCommandV1Schema: z.ZodObject<{
288
288
  actorRole: z.ZodEnum<["human", "secretary", "system"]>;
289
289
  onBehalfOf: z.ZodOptional<z.ZodString>;
290
290
  }, "strip", z.ZodTypeAny, {
291
- actorRole: "human" | "secretary" | "system";
291
+ actorRole: "system" | "human" | "secretary";
292
292
  actorWebId: string;
293
293
  onBehalfOf?: string | undefined;
294
294
  }, {
295
- actorRole: "human" | "secretary" | "system";
295
+ actorRole: "system" | "human" | "secretary";
296
296
  actorWebId: string;
297
297
  onBehalfOf?: string | undefined;
298
298
  }>>;
@@ -305,7 +305,7 @@ export declare const ToolControlCommandV1Schema: z.ZodObject<{
305
305
  command: "approve" | "reject" | "pause" | "resume" | "stop" | "inject_message" | "approve_pattern";
306
306
  message?: string | undefined;
307
307
  actor?: {
308
- actorRole: "human" | "secretary" | "system";
308
+ actorRole: "system" | "human" | "secretary";
309
309
  actorWebId: string;
310
310
  onBehalfOf?: string | undefined;
311
311
  } | undefined;
@@ -322,7 +322,7 @@ export declare const ToolControlCommandV1Schema: z.ZodObject<{
322
322
  command: "approve" | "reject" | "pause" | "resume" | "stop" | "inject_message" | "approve_pattern";
323
323
  message?: string | undefined;
324
324
  actor?: {
325
- actorRole: "human" | "secretary" | "system";
325
+ actorRole: "system" | "human" | "secretary";
326
326
  actorWebId: string;
327
327
  onBehalfOf?: string | undefined;
328
328
  } | undefined;
@@ -348,11 +348,11 @@ export declare const ToolControlCommandSchema: z.ZodObject<{
348
348
  actorRole: z.ZodEnum<["human", "secretary", "system"]>;
349
349
  onBehalfOf: z.ZodOptional<z.ZodString>;
350
350
  }, "strip", z.ZodTypeAny, {
351
- actorRole: "human" | "secretary" | "system";
351
+ actorRole: "system" | "human" | "secretary";
352
352
  actorWebId: string;
353
353
  onBehalfOf?: string | undefined;
354
354
  }, {
355
- actorRole: "human" | "secretary" | "system";
355
+ actorRole: "system" | "human" | "secretary";
356
356
  actorWebId: string;
357
357
  onBehalfOf?: string | undefined;
358
358
  }>>;
@@ -365,7 +365,7 @@ export declare const ToolControlCommandSchema: z.ZodObject<{
365
365
  command: "approve" | "reject" | "pause" | "resume" | "stop" | "inject_message" | "approve_pattern";
366
366
  message?: string | undefined;
367
367
  actor?: {
368
- actorRole: "human" | "secretary" | "system";
368
+ actorRole: "system" | "human" | "secretary";
369
369
  actorWebId: string;
370
370
  onBehalfOf?: string | undefined;
371
371
  } | undefined;
@@ -382,7 +382,7 @@ export declare const ToolControlCommandSchema: z.ZodObject<{
382
382
  command: "approve" | "reject" | "pause" | "resume" | "stop" | "inject_message" | "approve_pattern";
383
383
  message?: string | undefined;
384
384
  actor?: {
385
- actorRole: "human" | "secretary" | "system";
385
+ actorRole: "system" | "human" | "secretary";
386
386
  actorWebId: string;
387
387
  onBehalfOf?: string | undefined;
388
388
  } | undefined;
@@ -589,7 +589,7 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
589
589
  policyVersion: z.ZodOptional<z.ZodString>;
590
590
  timestamp: z.ZodString;
591
591
  }, "strict", z.ZodTypeAny, {
592
- status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
592
+ status: "error" | "running" | "approved" | "rejected" | "done" | "calling" | "waiting_approval";
593
593
  toolCallId: string;
594
594
  toolName: string;
595
595
  type: "tool.call";
@@ -606,17 +606,17 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
606
606
  }[] | undefined;
607
607
  expiresAt?: string | undefined;
608
608
  policyVersion?: string | undefined;
609
+ error?: string | undefined;
609
610
  decisionBy?: string | undefined;
610
- decisionRole?: "human" | "secretary" | "system" | undefined;
611
+ decisionRole?: "system" | "human" | "secretary" | undefined;
611
612
  onBehalfOf?: string | undefined;
612
613
  inboxItemId?: string | undefined;
613
- error?: string | undefined;
614
614
  arguments?: Record<string, unknown> | undefined;
615
615
  result?: unknown;
616
616
  duration?: number | undefined;
617
617
  version?: 1 | undefined;
618
618
  }, {
619
- status: "approved" | "rejected" | "running" | "done" | "error" | "calling" | "waiting_approval";
619
+ status: "error" | "running" | "approved" | "rejected" | "done" | "calling" | "waiting_approval";
620
620
  toolCallId: string;
621
621
  toolName: string;
622
622
  type: "tool.call";
@@ -633,11 +633,11 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
633
633
  }[] | undefined;
634
634
  expiresAt?: string | undefined;
635
635
  policyVersion?: string | undefined;
636
+ error?: string | undefined;
636
637
  decisionBy?: string | undefined;
637
- decisionRole?: "human" | "secretary" | "system" | undefined;
638
+ decisionRole?: "system" | "human" | "secretary" | undefined;
638
639
  onBehalfOf?: string | undefined;
639
640
  inboxItemId?: string | undefined;
640
- error?: string | undefined;
641
641
  arguments?: Record<string, unknown> | undefined;
642
642
  result?: unknown;
643
643
  duration?: number | undefined;
@@ -646,7 +646,7 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
646
646
  type: z.ZodLiteral<"session.state">;
647
647
  version: z.ZodOptional<z.ZodLiteral<1>>;
648
648
  sessionId: z.ZodString;
649
- chatId: z.ZodString;
649
+ chat: z.ZodString;
650
650
  policy: z.ZodOptional<z.ZodString>;
651
651
  policyVersion: z.ZodOptional<z.ZodString>;
652
652
  status: z.ZodEnum<["active", "paused", "completed", "error"]>;
@@ -655,11 +655,11 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
655
655
  tokenUsage: z.ZodNumber;
656
656
  timestamp: z.ZodString;
657
657
  }, "strict", z.ZodTypeAny, {
658
- status: "error" | "paused" | "active" | "completed";
658
+ status: "error" | "active" | "completed" | "paused";
659
659
  tokenUsage: number;
660
660
  type: "session.state";
661
+ chat: string;
661
662
  tool: "claude-code" | "cursor" | "windsurf";
662
- chatId: string;
663
663
  sessionId: string;
664
664
  timestamp: string;
665
665
  previousStatus: string;
@@ -667,11 +667,11 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
667
667
  policyVersion?: string | undefined;
668
668
  version?: 1 | undefined;
669
669
  }, {
670
- status: "error" | "paused" | "active" | "completed";
670
+ status: "error" | "active" | "completed" | "paused";
671
671
  tokenUsage: number;
672
672
  type: "session.state";
673
+ chat: string;
673
674
  tool: "claude-code" | "cursor" | "windsurf";
674
- chatId: string;
675
675
  sessionId: string;
676
676
  timestamp: string;
677
677
  previousStatus: string;
@@ -693,11 +693,11 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
693
693
  actorRole: z.ZodEnum<["human", "secretary", "system"]>;
694
694
  onBehalfOf: z.ZodOptional<z.ZodString>;
695
695
  }, "strip", z.ZodTypeAny, {
696
- actorRole: "human" | "secretary" | "system";
696
+ actorRole: "system" | "human" | "secretary";
697
697
  actorWebId: string;
698
698
  onBehalfOf?: string | undefined;
699
699
  }, {
700
- actorRole: "human" | "secretary" | "system";
700
+ actorRole: "system" | "human" | "secretary";
701
701
  actorWebId: string;
702
702
  onBehalfOf?: string | undefined;
703
703
  }>>;
@@ -710,7 +710,7 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
710
710
  command: "approve" | "reject" | "pause" | "resume" | "stop" | "inject_message" | "approve_pattern";
711
711
  message?: string | undefined;
712
712
  actor?: {
713
- actorRole: "human" | "secretary" | "system";
713
+ actorRole: "system" | "human" | "secretary";
714
714
  actorWebId: string;
715
715
  onBehalfOf?: string | undefined;
716
716
  } | undefined;
@@ -727,7 +727,7 @@ export declare const SidecarEventSchema: z.ZodUnion<[z.ZodObject<{
727
727
  command: "approve" | "reject" | "pause" | "resume" | "stop" | "inject_message" | "approve_pattern";
728
728
  message?: string | undefined;
729
729
  actor?: {
730
- actorRole: "human" | "secretary" | "system";
730
+ actorRole: "system" | "human" | "secretary";
731
731
  actorWebId: string;
732
732
  onBehalfOf?: string | undefined;
733
733
  } | undefined;
@@ -57,7 +57,7 @@ export const SessionStateEventV1Schema = z
57
57
  type: z.literal('session.state'),
58
58
  version: z.literal(1).optional(),
59
59
  sessionId: z.string(),
60
- chatId: z.string(),
60
+ chat: z.string(),
61
61
  policy: z.string().optional(),
62
62
  policyVersion: z.string().optional(),
63
63
  status: SessionStatusSchema,
@@ -0,0 +1,62 @@
1
+ export type TaskStatusType = 'active' | 'paused' | 'completed' | 'failed';
2
+ export type TaskTriggerKindType = 'once' | 'interval' | 'cron' | 'event';
3
+ export declare const TaskStatus: {
4
+ readonly ACTIVE: "active";
5
+ readonly PAUSED: "paused";
6
+ readonly COMPLETED: "completed";
7
+ readonly FAILED: "failed";
8
+ };
9
+ export declare const TaskTriggerKind: {
10
+ readonly ONCE: "once";
11
+ readonly INTERVAL: "interval";
12
+ readonly CRON: "cron";
13
+ readonly EVENT: "event";
14
+ };
15
+ /**
16
+ * Task resource.
17
+ *
18
+ * Task is a durable task-style command, parallel to Chat as a command surface.
19
+ * It is intentionally generic: protocol-specific request, response, and event
20
+ * shapes stay in adapter code.
21
+ */
22
+ export declare const taskResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
23
+ id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
24
+ surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
25
+ title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
26
+ prompt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
27
+ thread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
28
+ workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
29
+ runner: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
30
+ status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
31
+ triggerKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
32
+ cron: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
33
+ intervalSeconds: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, false>;
34
+ eventName: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
35
+ nextRunAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
36
+ lastRunAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
37
+ metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
38
+ createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
39
+ updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
40
+ }>>;
41
+ export declare const taskTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
42
+ id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
43
+ surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
44
+ title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
45
+ prompt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
46
+ thread: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
47
+ workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
48
+ runner: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
49
+ status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
50
+ triggerKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
51
+ cron: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
52
+ intervalSeconds: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, false>;
53
+ eventName: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
54
+ nextRunAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
55
+ lastRunAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
56
+ metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
57
+ createdAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
58
+ updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
59
+ }>>;
60
+ export type TaskRow = typeof taskResource.$inferSelect;
61
+ export type TaskInsert = typeof taskResource.$inferInsert;
62
+ export type TaskUpdate = typeof taskResource.$inferUpdate;
@@ -0,0 +1,49 @@
1
+ import { id, integer, object, podTable, string, timestamp, uri } from '@undefineds.co/drizzle-solid';
2
+ import { DCTerms, UDFS } from './namespaces.js';
3
+ import { threadResource } from './thread.schema.js';
4
+ import { taskResourceId } from './resource-id-defaults.js';
5
+ export const TaskStatus = {
6
+ ACTIVE: 'active',
7
+ PAUSED: 'paused',
8
+ COMPLETED: 'completed',
9
+ FAILED: 'failed',
10
+ };
11
+ export const TaskTriggerKind = {
12
+ ONCE: 'once',
13
+ INTERVAL: 'interval',
14
+ CRON: 'cron',
15
+ EVENT: 'event',
16
+ };
17
+ /**
18
+ * Task resource.
19
+ *
20
+ * Task is a durable task-style command, parallel to Chat as a command surface.
21
+ * It is intentionally generic: protocol-specific request, response, and event
22
+ * shapes stay in adapter code.
23
+ */
24
+ export const taskResource = podTable('task', {
25
+ id: id('id').default(taskResourceId),
26
+ surfaceId: string('surfaceId').predicate(UDFS.surfaceId).notNull().default('default'),
27
+ title: string('title').predicate(DCTerms.title),
28
+ prompt: string('prompt').predicate(UDFS.prompt).notNull(),
29
+ thread: uri('thread').predicate(UDFS.inThread).link(threadResource),
30
+ workspace: uri('workspace').predicate(UDFS.workspace).notNull(),
31
+ runner: string('runner').predicate(UDFS.runner).notNull(),
32
+ status: string('status').predicate(UDFS.status).notNull().default(TaskStatus.ACTIVE),
33
+ triggerKind: string('triggerKind').predicate(UDFS.triggerKind).notNull().default(TaskTriggerKind.ONCE),
34
+ cron: string('cron').predicate(UDFS.cron),
35
+ intervalSeconds: integer('intervalSeconds').predicate(UDFS.intervalSeconds),
36
+ eventName: string('eventName').predicate(UDFS.eventName),
37
+ nextRunAt: timestamp('nextRunAt').predicate(UDFS.nextRunAt),
38
+ lastRunAt: timestamp('lastRunAt').predicate(UDFS.lastRunAt),
39
+ metadata: object('metadata').predicate(UDFS.metadata),
40
+ createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
41
+ updatedAt: timestamp('updatedAt').predicate(DCTerms.modified).notNull().defaultNow(),
42
+ }, {
43
+ base: '/.data/task/',
44
+ sparqlEndpoint: '/.data/task/-/sparql',
45
+ type: UDFS.Task,
46
+ namespace: UDFS,
47
+ });
48
+ // Compatibility alias. New model code should prefer `taskResource`.
49
+ export const taskTable = taskResource;
@@ -1,7 +1,10 @@
1
1
  export declare const threadRepository: import("@undefineds.co/drizzle-solid/dist/core/repository").PodRepositoryDescriptor<import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
2
2
  id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
3
- chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
3
+ commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
4
+ surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
5
+ chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
4
6
  title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
7
+ status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
5
8
  starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
6
9
  workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
7
10
  metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
@@ -9,17 +12,23 @@ export declare const threadRepository: import("@undefineds.co/drizzle-solid/dist
9
12
  updatedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, true, true>;
10
13
  }>>, {
11
14
  id: string;
15
+ commandKind: string;
16
+ surfaceId: string;
12
17
  chat: string;
13
18
  title: string;
19
+ status: string;
14
20
  starred: boolean;
15
21
  workspace: string;
16
22
  metadata: Record<string, unknown>;
17
23
  createdAt: Date;
18
24
  updatedAt: Date;
19
25
  }, {
20
- chat: string;
21
26
  id?: string | undefined;
27
+ commandKind?: string | undefined;
28
+ surfaceId?: string | undefined;
29
+ chat?: string | undefined;
22
30
  title?: string | undefined;
31
+ status?: string | undefined;
23
32
  starred?: boolean | undefined;
24
33
  workspace?: string | undefined;
25
34
  metadata?: Record<string, unknown> | undefined;
@@ -27,8 +36,11 @@ export declare const threadRepository: import("@undefineds.co/drizzle-solid/dist
27
36
  updatedAt?: Date | undefined;
28
37
  }, {
29
38
  id?: string | null | undefined;
30
- chat?: string | undefined;
39
+ commandKind?: string | undefined;
40
+ surfaceId?: string | undefined;
41
+ chat?: string | null | undefined;
31
42
  title?: string | null | undefined;
43
+ status?: string | undefined;
32
44
  starred?: boolean | null | undefined;
33
45
  workspace?: string | null | undefined;
34
46
  metadata?: Record<string, unknown> | null | undefined;
@@ -1,3 +1,9 @@
1
+ export type ThreadStatusType = 'active' | 'locked' | 'closed';
2
+ export declare const ThreadStatus: {
3
+ readonly ACTIVE: "active";
4
+ readonly LOCKED: "locked";
5
+ readonly CLOSED: "closed";
6
+ };
1
7
  /**
2
8
  * Thread resource.
3
9
  *
@@ -22,8 +28,11 @@
22
28
  */
23
29
  export declare const threadResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
24
30
  id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
25
- chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
31
+ commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
32
+ surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
33
+ chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
26
34
  title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
35
+ status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
27
36
  starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
28
37
  workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
29
38
  metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
@@ -32,8 +41,11 @@ export declare const threadResource: import("@undefineds.co/drizzle-solid/dist/c
32
41
  }>>;
33
42
  export declare const threadTable: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
34
43
  id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
35
- chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, true, false>;
44
+ commandKind: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
45
+ surfaceId: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
46
+ chat: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
36
47
  title: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
48
+ status: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, true>;
37
49
  starred: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
38
50
  workspace: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"uri", null, false, false>;
39
51
  metadata: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"object", null, false, false>;
@@ -1,6 +1,12 @@
1
1
  import { uri, boolean, object, podTable, string, timestamp, id } from '@undefineds.co/drizzle-solid';
2
2
  import { UDFS, DCTerms, SIOC } from './namespaces.js';
3
3
  import { chatResource } from './chat.schema.js';
4
+ import { threadResourceId } from './resource-id-defaults.js';
5
+ export const ThreadStatus = {
6
+ ACTIVE: 'active',
7
+ LOCKED: 'locked',
8
+ CLOSED: 'closed',
9
+ };
4
10
  /**
5
11
  * Thread resource.
6
12
  *
@@ -24,11 +30,14 @@ import { chatResource } from './chat.schema.js';
24
30
  * container URI here and store portable metadata with that container/resource.
25
31
  */
26
32
  export const threadResource = podTable('thread', {
27
- id: id('id'),
33
+ id: id('id').default(threadResourceId),
34
+ commandKind: string('commandKind').predicate(UDFS.commandKind).notNull().default('chat'),
35
+ surfaceId: string('surfaceId').predicate(UDFS.surfaceId).notNull().default('default'),
28
36
  // Belongs to chat/counterpart. Stored as an RDF URI; short ids are resolved via chatResource's URI template by the ORM.
29
- chat: uri('chat').predicate(SIOC.has_parent).notNull().link(chatResource),
37
+ chat: uri('chat').predicate(SIOC.has_parent).link(chatResource),
30
38
  // Display / state
31
39
  title: string('title').predicate(DCTerms.title),
40
+ status: string('status').predicate(UDFS.status).notNull().default(ThreadStatus.ACTIVE),
32
41
  starred: boolean('starred').predicate(UDFS.favorite).default(false),
33
42
  // Storage-layer execution context reference: container/resource URI
34
43
  workspace: uri('workspace').predicate(UDFS.workspace),
@@ -37,11 +46,10 @@ export const threadResource = podTable('thread', {
37
46
  createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
38
47
  updatedAt: timestamp('updatedAt').predicate(DCTerms.modified).notNull().defaultNow(),
39
48
  }, {
40
- base: '/.data/chat/',
41
- sparqlEndpoint: '/.data/chat/-/sparql',
49
+ base: '/.data/',
50
+ sparqlEndpoint: '/.data/-/sparql',
42
51
  type: SIOC.Thread,
43
52
  namespace: UDFS,
44
- subjectTemplate: '{chat|id}/index.ttl#{id}',
45
53
  });
46
54
  // Compatibility alias. New model code should prefer `threadResource`.
47
55
  export const threadTable = threadResource;
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@undefineds.co/models",
3
- "version": "0.2.25",
3
+ "version": "0.2.27",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "udfs": "./dist/bin/udfs.js"
10
+ },
8
11
  "repository": {
9
12
  "type": "git",
10
13
  "url": "git+https://github.com/undefinedsco/models.git"
@@ -60,15 +63,17 @@
60
63
  "build": "tsc -p tsconfig.json && node scripts/fix-dist-esm.mjs",
61
64
  "lint": "echo \"lint not configured\"",
62
65
  "pack:release": "node scripts/pack-release.mjs",
66
+ "skills:check": "node scripts/check-skills.mjs",
67
+ "skills:pack": "yarn skills:check && node scripts/pack-skills.mjs",
63
68
  "sync:discovery:vercel": "node --experimental-strip-types scripts/sync-discovery-vercel.ts",
64
69
  "test": "vitest run",
65
- "test:ci": "vitest run tests/ai-config.test.ts tests/ai-runtime-schema.test.ts tests/client.test.ts tests/contracts-chat-contact.contract.test.ts tests/discovery-vercel.test.ts tests/discovery.test.ts tests/profile.test.ts tests/repository.test.ts tests/resource-utils.test.ts tests/session-schema.test.ts tests/sidecar-events.contract.test.ts tests/resource-schema.test.ts",
70
+ "test:ci": "vitest run tests/ai-config.test.ts tests/ai-runtime-schema.test.ts tests/client.test.ts tests/contracts-chat-contact.contract.test.ts tests/discovery-vercel.test.ts tests/discovery.test.ts tests/issue-schema.test.ts tests/profile.test.ts tests/repository.test.ts tests/resource-utils.test.ts tests/session-schema.test.ts tests/sidecar-events.contract.test.ts tests/resource-schema.test.ts tests/resource-id-defaults.test.ts tests/pod-storage-descriptor.test.ts tests/udfs-cli.test.ts",
66
71
  "test:pod": "dotenv -e ../linx-models/.env -- vitest run tests/pod.integration.test.ts"
67
72
  },
68
73
  "dependencies": {
69
74
  "@comunica/query-sparql-solid": "^4.0.2",
70
75
  "@inrupt/vocab-common-rdf": "^1.0.5",
71
- "@undefineds.co/drizzle-solid": "^0.3.12",
76
+ "@undefineds.co/drizzle-solid": "^0.3.13",
72
77
  "n3": "^1.26.0",
73
78
  "zod": "^3.22.4"
74
79
  },
@@ -77,6 +82,9 @@
77
82
  "typescript": "^5.4.0",
78
83
  "vitest": "^1.6.0"
79
84
  },
85
+ "peerDependencies": {
86
+ "@undefineds.co/drizzle-solid": "^0.3.13"
87
+ },
80
88
  "packageManager": "yarn@1.22.22",
81
89
  "files": [
82
90
  "dist",