pi-harness-runtime 1.1.335 → 1.1.337

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 (180) hide show
  1. package/index.ts +21 -12
  2. package/package.json +1 -1
  3. package/packages/a2a-adapter/package.json +1 -1
  4. package/packages/agent-policy/package.json +1 -1
  5. package/packages/architecture-generator/package.json +1 -1
  6. package/packages/auth/package.json +1 -1
  7. package/packages/autonomous-refactor/package.json +1 -1
  8. package/packages/autonomous-runtime/package.json +1 -1
  9. package/packages/cache-strategy/package.json +1 -1
  10. package/packages/capability-registry/package.json +1 -1
  11. package/packages/checkpoint/package.json +1 -1
  12. package/packages/cli-plugin-sdk/package.json +1 -1
  13. package/packages/clipboard/package.json +1 -1
  14. package/packages/clipboard-plugin/package.json +1 -1
  15. package/packages/code-generation/package.json +1 -1
  16. package/packages/code-review/package.json +1 -1
  17. package/packages/codex-adapter/package.json +1 -1
  18. package/packages/codex-watcher/package.json +1 -1
  19. package/packages/config-capture/package.json +1 -1
  20. package/packages/connection-runtime/dist/index.d.ts +11 -0
  21. package/packages/connection-runtime/dist/index.js +11 -0
  22. package/packages/connection-runtime/dist/registry.d.ts +69 -0
  23. package/packages/connection-runtime/dist/registry.js +117 -0
  24. package/packages/connection-runtime/dist/supervisor.d.ts +89 -0
  25. package/packages/connection-runtime/dist/supervisor.js +169 -0
  26. package/packages/connection-runtime/dist/types.d.ts +70 -0
  27. package/packages/connection-runtime/dist/types.js +16 -0
  28. package/packages/connection-runtime/package.json +24 -0
  29. package/packages/connection-runtime/src/index.ts +12 -0
  30. package/packages/connection-runtime/src/registry.ts +142 -0
  31. package/packages/connection-runtime/src/supervisor.ts +224 -0
  32. package/packages/connection-runtime/src/types.ts +88 -0
  33. package/packages/context-compiler/package.json +1 -1
  34. package/packages/context-discovery/package.json +1 -1
  35. package/packages/context-manager/package.json +1 -1
  36. package/packages/contracts/dist/approvals.d.ts +273 -0
  37. package/packages/contracts/dist/approvals.js +93 -0
  38. package/packages/contracts/dist/base.d.ts +78 -0
  39. package/packages/contracts/dist/base.js +82 -0
  40. package/packages/contracts/dist/events.d.ts +99 -0
  41. package/packages/contracts/dist/events.js +65 -0
  42. package/packages/contracts/dist/index.d.ts +20 -0
  43. package/packages/contracts/dist/index.js +20 -0
  44. package/packages/contracts/dist/jobs.d.ts +234 -0
  45. package/packages/contracts/dist/jobs.js +79 -0
  46. package/packages/contracts/dist/notifications.d.ts +317 -0
  47. package/packages/contracts/dist/notifications.js +85 -0
  48. package/packages/contracts/dist/projects.d.ts +171 -0
  49. package/packages/contracts/dist/projects.js +62 -0
  50. package/packages/contracts/dist/sessions.d.ts +226 -0
  51. package/packages/contracts/dist/sessions.js +82 -0
  52. package/packages/contracts/package.json +24 -0
  53. package/packages/contracts/src/approvals.ts +115 -0
  54. package/packages/contracts/src/base.ts +126 -0
  55. package/packages/contracts/src/events.ts +78 -0
  56. package/packages/contracts/src/index.ts +21 -0
  57. package/packages/contracts/src/jobs.ts +101 -0
  58. package/packages/contracts/src/notifications.ts +104 -0
  59. package/packages/contracts/src/projects.ts +81 -0
  60. package/packages/contracts/src/sessions.ts +104 -0
  61. package/packages/cookie-sanitizer/package.json +1 -1
  62. package/packages/cost-optimizer/package.json +1 -1
  63. package/packages/dependency-analyzer/package.json +1 -1
  64. package/packages/django-plugin/package.json +1 -1
  65. package/packages/doc-generator/package.json +1 -1
  66. package/packages/durable-review/package.json +1 -1
  67. package/packages/e2e-tester/package.json +1 -1
  68. package/packages/evaluation-engine/package.json +1 -1
  69. package/packages/evaluation-runner/package.json +1 -1
  70. package/packages/event-bus/package.json +1 -1
  71. package/packages/event-sink/dist/index.d.ts +12 -0
  72. package/packages/event-sink/dist/index.js +12 -0
  73. package/packages/event-sink/dist/outbox.d.ts +51 -0
  74. package/packages/event-sink/dist/outbox.js +88 -0
  75. package/packages/event-sink/dist/projection.d.ts +41 -0
  76. package/packages/event-sink/dist/projection.js +62 -0
  77. package/packages/event-sink/dist/sink.d.ts +81 -0
  78. package/packages/event-sink/dist/sink.js +106 -0
  79. package/packages/event-sink/package.json +28 -0
  80. package/packages/event-sink/src/index.ts +15 -0
  81. package/packages/event-sink/src/outbox.ts +119 -0
  82. package/packages/event-sink/src/projection.ts +84 -0
  83. package/packages/event-sink/src/sink.ts +167 -0
  84. package/packages/event-store/package.json +1 -1
  85. package/packages/experience-replay/package.json +1 -1
  86. package/packages/feedback-collector/package.json +1 -1
  87. package/packages/file-copy-helper/package.json +1 -1
  88. package/packages/framework-detector/package.json +1 -1
  89. package/packages/framework-plugin-sdk/package.json +1 -1
  90. package/packages/frappe-plugin/package.json +1 -1
  91. package/packages/generic-web-plugin/package.json +1 -1
  92. package/packages/health-monitor/package.json +1 -1
  93. package/packages/intent-analyzer/package.json +1 -1
  94. package/packages/jev-judge/package.json +1 -1
  95. package/packages/knowledge-graph/package.json +1 -1
  96. package/packages/knowledge-retrieval/package.json +1 -1
  97. package/packages/laravel-plugin/package.json +1 -1
  98. package/packages/learning-engine/package.json +1 -1
  99. package/packages/mcp-adapter/package.json +1 -1
  100. package/packages/memory-engine/package.json +1 -1
  101. package/packages/milestone-manager/package.json +1 -1
  102. package/packages/model-registry/package.json +1 -1
  103. package/packages/nextjs-plugin/package.json +1 -1
  104. package/packages/notification/package.json +1 -1
  105. package/packages/observability/package.json +1 -1
  106. package/packages/okf-indexer/package.json +1 -1
  107. package/packages/paperclip-integration/package.json +1 -1
  108. package/packages/performance-optimizer/package.json +1 -1
  109. package/packages/permission-mode/dist/checker.d.ts +66 -0
  110. package/packages/permission-mode/dist/checker.js +64 -0
  111. package/packages/permission-mode/dist/index.d.ts +12 -0
  112. package/packages/permission-mode/dist/index.js +11 -0
  113. package/packages/permission-mode/dist/manager.d.ts +65 -0
  114. package/packages/permission-mode/dist/manager.js +91 -0
  115. package/packages/permission-mode/dist/mode.d.ts +31 -0
  116. package/packages/permission-mode/dist/mode.js +47 -0
  117. package/packages/permission-mode/package.json +24 -0
  118. package/packages/permission-mode/src/checker.ts +103 -0
  119. package/packages/permission-mode/src/index.ts +13 -0
  120. package/packages/permission-mode/src/manager.ts +154 -0
  121. package/packages/permission-mode/src/mode.ts +73 -0
  122. package/packages/privilege-broker/package.json +1 -1
  123. package/packages/project-analyzer/package.json +1 -1
  124. package/packages/project-bootstrap/package.json +1 -1
  125. package/packages/projection-engine/package.json +1 -1
  126. package/packages/prompt-compiler/package.json +1 -1
  127. package/packages/prompt-versioning/package.json +1 -1
  128. package/packages/provider-adapter-sdk/package.json +1 -1
  129. package/packages/provider-router/package.json +1 -1
  130. package/packages/provider-selector/package.json +1 -1
  131. package/packages/providers/package.json +1 -1
  132. package/packages/qdrant-skills/package.json +1 -1
  133. package/packages/quota-manager/package.json +1 -1
  134. package/packages/rate-limiter/package.json +1 -1
  135. package/packages/react-vite-plugin/package.json +1 -1
  136. package/packages/relay/dist/client.d.ts +53 -0
  137. package/packages/relay/dist/client.js +95 -0
  138. package/packages/relay/dist/index.d.ts +9 -0
  139. package/packages/relay/dist/index.js +8 -0
  140. package/packages/relay/dist/server.d.ts +58 -0
  141. package/packages/relay/dist/server.js +93 -0
  142. package/packages/relay/dist/types.d.ts +35 -0
  143. package/packages/relay/dist/types.js +4 -0
  144. package/packages/relay/package.json +24 -0
  145. package/packages/relay/src/client.ts +119 -0
  146. package/packages/relay/src/index.ts +10 -0
  147. package/packages/relay/src/server.ts +120 -0
  148. package/packages/relay/src/types.ts +38 -0
  149. package/packages/release-manager/package.json +1 -1
  150. package/packages/requirement-compiler/package.json +1 -1
  151. package/packages/runtime/package.json +1 -1
  152. package/packages/scheduler/package.json +1 -1
  153. package/packages/scheduler-adapter/package.json +1 -1
  154. package/packages/session/package.json +1 -1
  155. package/packages/session-api/package.json +1 -1
  156. package/packages/session-export/package.json +1 -1
  157. package/packages/shared-context/package.json +1 -1
  158. package/packages/skill-mcp-client/package.json +1 -1
  159. package/packages/skill-registry/package.json +1 -1
  160. package/packages/skills/package.json +1 -1
  161. package/packages/sprint-planner/package.json +1 -1
  162. package/packages/subscription-engine/package.json +1 -1
  163. package/packages/task-compiler/package.json +1 -1
  164. package/packages/telegram/package.json +1 -1
  165. package/packages/tencentdb-memory/package.json +1 -1
  166. package/packages/tencentdb-sync/package.json +1 -1
  167. package/packages/test-data-generator/package.json +1 -1
  168. package/packages/test-generator/package.json +1 -1
  169. package/packages/todo-bd-sync/package.json +1 -1
  170. package/packages/token-estimation/package.json +1 -1
  171. package/packages/token-optimizer/package.json +1 -1
  172. package/packages/trajectory/package.json +1 -1
  173. package/packages/tui/package.json +1 -1
  174. package/packages/types/package.json +1 -1
  175. package/packages/webmcp-tester/package.json +1 -1
  176. package/packages/wiki/package.json +1 -1
  177. package/packages/workflow-events/package.json +1 -1
  178. package/packages/workspace-scanner/package.json +1 -1
  179. package/packages/worktree/package.json +1 -1
  180. package/packages/write-review/package.json +1 -1
@@ -0,0 +1,317 @@
1
+ /**
2
+ * Notification schemas for pi-harness
3
+ */
4
+ import { z } from 'zod';
5
+ /**
6
+ * Notification channel
7
+ */
8
+ export declare const NotificationChannel: z.ZodEnum<["telegram", "email", "webhook", "desktop"]>;
9
+ export type NotificationChannel = z.infer<typeof NotificationChannel>;
10
+ /**
11
+ * Notification priority
12
+ */
13
+ export declare const NotificationPriority: z.ZodEnum<["low", "normal", "high", "urgent"]>;
14
+ export type NotificationPriority = z.infer<typeof NotificationPriority>;
15
+ /**
16
+ * Notification definition
17
+ */
18
+ export declare const Notification: z.ZodObject<{
19
+ id: z.ZodString;
20
+ event: z.ZodString;
21
+ channel: z.ZodEnum<["telegram", "email", "webhook", "desktop"]>;
22
+ priority: z.ZodDefault<z.ZodEnum<["low", "normal", "high", "urgent"]>>;
23
+ workspaceId: z.ZodOptional<z.ZodString>;
24
+ sessionId: z.ZodOptional<z.ZodString>;
25
+ jobId: z.ZodOptional<z.ZodString>;
26
+ title: z.ZodString;
27
+ message: z.ZodString;
28
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
29
+ buttons: z.ZodOptional<z.ZodArray<z.ZodObject<{
30
+ text: z.ZodString;
31
+ action: z.ZodString;
32
+ targetId: z.ZodOptional<z.ZodString>;
33
+ url: z.ZodOptional<z.ZodString>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ text: string;
36
+ action: string;
37
+ targetId?: string | undefined;
38
+ url?: string | undefined;
39
+ }, {
40
+ text: string;
41
+ action: string;
42
+ targetId?: string | undefined;
43
+ url?: string | undefined;
44
+ }>, "many">>;
45
+ sentAt: z.ZodOptional<z.ZodString>;
46
+ readAt: z.ZodOptional<z.ZodString>;
47
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ id: string;
50
+ event: string;
51
+ channel: "desktop" | "email" | "telegram" | "webhook";
52
+ priority: "high" | "low" | "normal" | "urgent";
53
+ workspaceId?: string | undefined;
54
+ sessionId?: string | undefined;
55
+ jobId?: string | undefined;
56
+ title: string;
57
+ message: string;
58
+ data?: Record<string, unknown> | undefined;
59
+ buttons?: {
60
+ text: string;
61
+ action: string;
62
+ targetId?: string | undefined;
63
+ url?: string | undefined;
64
+ }[] | undefined;
65
+ sentAt?: string | undefined;
66
+ readAt?: string | undefined;
67
+ metadata?: Record<string, unknown> | undefined;
68
+ }, {
69
+ id: string;
70
+ event: string;
71
+ channel: "desktop" | "email" | "telegram" | "webhook";
72
+ priority?: "high" | "low" | "normal" | "urgent" | undefined;
73
+ workspaceId?: string | undefined;
74
+ sessionId?: string | undefined;
75
+ jobId?: string | undefined;
76
+ title: string;
77
+ message: string;
78
+ data?: Record<string, unknown> | undefined;
79
+ buttons?: {
80
+ text: string;
81
+ action: string;
82
+ targetId?: string | undefined;
83
+ url?: string | undefined;
84
+ }[] | undefined;
85
+ sentAt?: string | undefined;
86
+ readAt?: string | undefined;
87
+ metadata?: Record<string, unknown> | undefined;
88
+ }>;
89
+ export type Notification = z.infer<typeof Notification>;
90
+ /**
91
+ * Notification creation input
92
+ */
93
+ export declare const NotificationCreate: z.ZodObject<{
94
+ event: z.ZodString;
95
+ channel: z.ZodDefault<z.ZodEnum<["telegram", "email", "webhook", "desktop"]>>;
96
+ priority: z.ZodDefault<z.ZodEnum<["low", "normal", "high", "urgent"]>>;
97
+ workspaceId: z.ZodOptional<z.ZodString>;
98
+ sessionId: z.ZodOptional<z.ZodString>;
99
+ jobId: z.ZodOptional<z.ZodString>;
100
+ title: z.ZodString;
101
+ message: z.ZodString;
102
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
103
+ buttons: z.ZodOptional<z.ZodArray<z.ZodObject<{
104
+ text: z.ZodString;
105
+ action: z.ZodString;
106
+ targetId: z.ZodOptional<z.ZodString>;
107
+ url: z.ZodOptional<z.ZodString>;
108
+ }, "strip", z.ZodTypeAny, {
109
+ text: string;
110
+ action: string;
111
+ targetId?: string | undefined;
112
+ url?: string | undefined;
113
+ }, {
114
+ text: string;
115
+ action: string;
116
+ targetId?: string | undefined;
117
+ url?: string | undefined;
118
+ }>, "many">>;
119
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ event: string;
122
+ channel: "desktop" | "email" | "telegram" | "webhook";
123
+ priority: "high" | "low" | "normal" | "urgent";
124
+ workspaceId?: string | undefined;
125
+ sessionId?: string | undefined;
126
+ jobId?: string | undefined;
127
+ title: string;
128
+ message: string;
129
+ data?: Record<string, unknown> | undefined;
130
+ buttons?: {
131
+ text: string;
132
+ action: string;
133
+ targetId?: string | undefined;
134
+ url?: string | undefined;
135
+ }[] | undefined;
136
+ metadata?: Record<string, unknown> | undefined;
137
+ }, {
138
+ event: string;
139
+ channel?: "desktop" | "email" | "telegram" | "webhook" | undefined;
140
+ priority?: "high" | "low" | "normal" | "urgent" | undefined;
141
+ workspaceId?: string | undefined;
142
+ sessionId?: string | undefined;
143
+ jobId?: string | undefined;
144
+ title: string;
145
+ message: string;
146
+ data?: Record<string, unknown> | undefined;
147
+ buttons?: {
148
+ text: string;
149
+ action: string;
150
+ targetId?: string | undefined;
151
+ url?: string | undefined;
152
+ }[] | undefined;
153
+ metadata?: Record<string, unknown> | undefined;
154
+ }>;
155
+ export type NotificationCreate = z.infer<typeof NotificationCreate>;
156
+ /**
157
+ * Notification filter
158
+ */
159
+ export declare const NotificationFilter: z.ZodObject<{
160
+ workspaceId: z.ZodOptional<z.ZodString>;
161
+ sessionId: z.ZodOptional<z.ZodString>;
162
+ jobId: z.ZodOptional<z.ZodString>;
163
+ channel: z.ZodOptional<z.ZodEnum<["telegram", "email", "webhook", "desktop"]>>;
164
+ priority: z.ZodOptional<z.ZodEnum<["low", "normal", "high", "urgent"]>>;
165
+ since: z.ZodOptional<z.ZodString>;
166
+ until: z.ZodOptional<z.ZodString>;
167
+ limit: z.ZodDefault<z.ZodNumber>;
168
+ cursor: z.ZodOptional<z.ZodString>;
169
+ }, "strip", z.ZodTypeAny, {
170
+ workspaceId?: string | undefined;
171
+ sessionId?: string | undefined;
172
+ jobId?: string | undefined;
173
+ channel?: "desktop" | "email" | "telegram" | "webhook" | undefined;
174
+ priority?: "high" | "low" | "normal" | "urgent" | undefined;
175
+ since?: string | undefined;
176
+ until?: string | undefined;
177
+ limit: number;
178
+ cursor?: string | undefined;
179
+ }, {
180
+ workspaceId?: string | undefined;
181
+ sessionId?: string | undefined;
182
+ jobId?: string | undefined;
183
+ channel?: "desktop" | "email" | "telegram" | "webhook" | undefined;
184
+ priority?: "high" | "low" | "normal" | "urgent" | undefined;
185
+ since?: string | undefined;
186
+ until?: string | undefined;
187
+ limit?: number | undefined;
188
+ cursor?: string | undefined;
189
+ }>;
190
+ export type NotificationFilter = z.infer<typeof NotificationFilter>;
191
+ /**
192
+ * Notification list response
193
+ */
194
+ export declare const NotificationList: z.ZodObject<{
195
+ items: z.ZodArray<z.ZodObject<{
196
+ id: z.ZodString;
197
+ event: z.ZodString;
198
+ channel: z.ZodEnum<["telegram", "email", "webhook", "desktop"]>;
199
+ priority: z.ZodDefault<z.ZodEnum<["low", "normal", "high", "urgent"]>>;
200
+ workspaceId: z.ZodOptional<z.ZodString>;
201
+ sessionId: z.ZodOptional<z.ZodString>;
202
+ jobId: z.ZodOptional<z.ZodString>;
203
+ title: z.ZodString;
204
+ message: z.ZodString;
205
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
206
+ buttons: z.ZodOptional<z.ZodArray<z.ZodObject<{
207
+ text: z.ZodString;
208
+ action: z.ZodString;
209
+ targetId: z.ZodOptional<z.ZodString>;
210
+ url: z.ZodOptional<z.ZodString>;
211
+ }, "strip", z.ZodTypeAny, {
212
+ text: string;
213
+ action: string;
214
+ targetId?: string | undefined;
215
+ url?: string | undefined;
216
+ }, {
217
+ text: string;
218
+ action: string;
219
+ targetId?: string | undefined;
220
+ url?: string | undefined;
221
+ }>, "many">>;
222
+ sentAt: z.ZodOptional<z.ZodString>;
223
+ readAt: z.ZodOptional<z.ZodString>;
224
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
225
+ }, "strip", z.ZodTypeAny, {
226
+ id: string;
227
+ event: string;
228
+ channel: "desktop" | "email" | "telegram" | "webhook";
229
+ priority: "high" | "low" | "normal" | "urgent";
230
+ workspaceId?: string | undefined;
231
+ sessionId?: string | undefined;
232
+ jobId?: string | undefined;
233
+ title: string;
234
+ message: string;
235
+ data?: Record<string, unknown> | undefined;
236
+ buttons?: {
237
+ text: string;
238
+ action: string;
239
+ targetId?: string | undefined;
240
+ url?: string | undefined;
241
+ }[] | undefined;
242
+ sentAt?: string | undefined;
243
+ readAt?: string | undefined;
244
+ metadata?: Record<string, unknown> | undefined;
245
+ }, {
246
+ id: string;
247
+ event: string;
248
+ channel: "desktop" | "email" | "telegram" | "webhook";
249
+ priority?: "high" | "low" | "normal" | "urgent" | undefined;
250
+ workspaceId?: string | undefined;
251
+ sessionId?: string | undefined;
252
+ jobId?: string | undefined;
253
+ title: string;
254
+ message: string;
255
+ data?: Record<string, unknown> | undefined;
256
+ buttons?: {
257
+ text: string;
258
+ action: string;
259
+ targetId?: string | undefined;
260
+ url?: string | undefined;
261
+ }[] | undefined;
262
+ sentAt?: string | undefined;
263
+ readAt?: string | undefined;
264
+ metadata?: Record<string, unknown> | undefined;
265
+ }>, "many">;
266
+ nextCursor: z.ZodOptional<z.ZodString>;
267
+ total: z.ZodOptional<z.ZodNumber>;
268
+ }, "strip", z.ZodTypeAny, {
269
+ items: {
270
+ id: string;
271
+ event: string;
272
+ channel: "desktop" | "email" | "telegram" | "webhook";
273
+ priority: "high" | "low" | "normal" | "urgent";
274
+ workspaceId?: string | undefined;
275
+ sessionId?: string | undefined;
276
+ jobId?: string | undefined;
277
+ title: string;
278
+ message: string;
279
+ data?: Record<string, unknown> | undefined;
280
+ buttons?: {
281
+ text: string;
282
+ action: string;
283
+ targetId?: string | undefined;
284
+ url?: string | undefined;
285
+ }[] | undefined;
286
+ sentAt?: string | undefined;
287
+ readAt?: string | undefined;
288
+ metadata?: Record<string, unknown> | undefined;
289
+ }[];
290
+ nextCursor?: string | undefined;
291
+ total?: number | undefined;
292
+ }, {
293
+ items: {
294
+ id: string;
295
+ event: string;
296
+ channel: "desktop" | "email" | "telegram" | "webhook";
297
+ priority?: "high" | "low" | "normal" | "urgent" | undefined;
298
+ workspaceId?: string | undefined;
299
+ sessionId?: string | undefined;
300
+ jobId?: string | undefined;
301
+ title: string;
302
+ message: string;
303
+ data?: Record<string, unknown> | undefined;
304
+ buttons?: {
305
+ text: string;
306
+ action: string;
307
+ targetId?: string | undefined;
308
+ url?: string | undefined;
309
+ }[] | undefined;
310
+ sentAt?: string | undefined;
311
+ readAt?: string | undefined;
312
+ metadata?: Record<string, unknown> | undefined;
313
+ }[];
314
+ nextCursor?: string | undefined;
315
+ total?: number | undefined;
316
+ }>;
317
+ export type NotificationList = z.infer<typeof NotificationList>;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Notification schemas for pi-harness
3
+ */
4
+ import { z } from 'zod';
5
+ import { Timestamp, UUID, NonEmptyString } from './base.js';
6
+ /**
7
+ * Notification channel
8
+ */
9
+ export const NotificationChannel = z.enum([
10
+ 'telegram',
11
+ 'email',
12
+ 'webhook',
13
+ 'desktop',
14
+ ]);
15
+ /**
16
+ * Notification priority
17
+ */
18
+ export const NotificationPriority = z.enum(['low', 'normal', 'high', 'urgent']);
19
+ /**
20
+ * Notification definition
21
+ */
22
+ export const Notification = z.object({
23
+ id: UUID,
24
+ event: NonEmptyString,
25
+ channel: NotificationChannel,
26
+ priority: NotificationPriority.default('normal'),
27
+ workspaceId: z.string().optional(),
28
+ sessionId: z.string().optional(),
29
+ jobId: z.string().optional(),
30
+ title: NonEmptyString,
31
+ message: NonEmptyString,
32
+ data: z.record(z.string(), z.unknown()).optional(),
33
+ buttons: z.array(z.object({
34
+ text: NonEmptyString,
35
+ action: NonEmptyString,
36
+ targetId: z.string().optional(),
37
+ url: z.string().url().optional(),
38
+ })).optional(),
39
+ sentAt: Timestamp.optional(),
40
+ readAt: Timestamp.optional(),
41
+ metadata: z.record(z.string(), z.unknown()).optional(),
42
+ });
43
+ /**
44
+ * Notification creation input
45
+ */
46
+ export const NotificationCreate = z.object({
47
+ event: NonEmptyString,
48
+ channel: NotificationChannel.default('telegram'),
49
+ priority: NotificationPriority.default('normal'),
50
+ workspaceId: z.string().optional(),
51
+ sessionId: z.string().optional(),
52
+ jobId: z.string().optional(),
53
+ title: NonEmptyString,
54
+ message: NonEmptyString,
55
+ data: z.record(z.string(), z.unknown()).optional(),
56
+ buttons: z.array(z.object({
57
+ text: NonEmptyString,
58
+ action: NonEmptyString,
59
+ targetId: z.string().optional(),
60
+ url: z.string().url().optional(),
61
+ })).optional(),
62
+ metadata: z.record(z.string(), z.unknown()).optional(),
63
+ });
64
+ /**
65
+ * Notification filter
66
+ */
67
+ export const NotificationFilter = z.object({
68
+ workspaceId: z.string().optional(),
69
+ sessionId: z.string().optional(),
70
+ jobId: z.string().optional(),
71
+ channel: NotificationChannel.optional(),
72
+ priority: NotificationPriority.optional(),
73
+ since: Timestamp.optional(),
74
+ until: Timestamp.optional(),
75
+ limit: z.number().int().positive().max(100).default(50),
76
+ cursor: z.string().optional(),
77
+ });
78
+ /**
79
+ * Notification list response
80
+ */
81
+ export const NotificationList = z.object({
82
+ items: z.array(Notification),
83
+ nextCursor: z.string().optional(),
84
+ total: z.number().optional(),
85
+ });
@@ -0,0 +1,171 @@
1
+ /**
2
+ * Project schemas for pi-harness
3
+ */
4
+ import { z } from 'zod';
5
+ /**
6
+ * Project status
7
+ */
8
+ export declare const ProjectStatus: z.ZodEnum<["active", "archived", "deleted"]>;
9
+ export type ProjectStatus = z.infer<typeof ProjectStatus>;
10
+ /**
11
+ * Project definition
12
+ */
13
+ export declare const Project: z.ZodObject<{
14
+ id: z.ZodString;
15
+ name: z.ZodString;
16
+ path: z.ZodString;
17
+ status: z.ZodDefault<z.ZodEnum<["active", "archived", "deleted"]>>;
18
+ workspaceId: z.ZodString;
19
+ createdAt: z.ZodString;
20
+ updatedAt: z.ZodString;
21
+ lastAccessedAt: z.ZodOptional<z.ZodString>;
22
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ id: string;
25
+ name: string;
26
+ path: string;
27
+ status: "active" | "archived" | "deleted";
28
+ workspaceId: string;
29
+ createdAt: string;
30
+ updatedAt: string;
31
+ lastAccessedAt?: string | undefined;
32
+ metadata?: Record<string, unknown> | undefined;
33
+ }, {
34
+ id: string;
35
+ name: string;
36
+ path: string;
37
+ status?: "active" | "archived" | "deleted" | undefined;
38
+ workspaceId: string;
39
+ createdAt: string;
40
+ updatedAt: string;
41
+ lastAccessedAt?: string | undefined;
42
+ metadata?: Record<string, unknown> | undefined;
43
+ }>;
44
+ export type Project = z.infer<typeof Project>;
45
+ /**
46
+ * Project creation input
47
+ */
48
+ export declare const ProjectCreate: z.ZodObject<{
49
+ name: z.ZodString;
50
+ path: z.ZodString;
51
+ workspaceId: z.ZodString;
52
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ name: string;
55
+ path: string;
56
+ workspaceId: string;
57
+ metadata?: Record<string, unknown> | undefined;
58
+ }, {
59
+ name: string;
60
+ path: string;
61
+ workspaceId: string;
62
+ metadata?: Record<string, unknown> | undefined;
63
+ }>;
64
+ export type ProjectCreate = z.infer<typeof ProjectCreate>;
65
+ /**
66
+ * Project update input
67
+ */
68
+ export declare const ProjectUpdate: z.ZodObject<{
69
+ name: z.ZodOptional<z.ZodString>;
70
+ status: z.ZodOptional<z.ZodEnum<["active", "archived", "deleted"]>>;
71
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ name?: string | undefined;
74
+ status?: "active" | "archived" | "deleted" | undefined;
75
+ metadata?: Record<string, unknown> | undefined;
76
+ }, {
77
+ name?: string | undefined;
78
+ status?: "active" | "archived" | "deleted" | undefined;
79
+ metadata?: Record<string, unknown> | undefined;
80
+ }>;
81
+ export type ProjectUpdate = z.infer<typeof ProjectUpdate>;
82
+ /**
83
+ * Project filter
84
+ */
85
+ export declare const ProjectFilter: z.ZodObject<{
86
+ workspaceId: z.ZodOptional<z.ZodString>;
87
+ status: z.ZodOptional<z.ZodEnum<["active", "archived", "deleted"]>>;
88
+ search: z.ZodOptional<z.ZodString>;
89
+ limit: z.ZodDefault<z.ZodNumber>;
90
+ cursor: z.ZodOptional<z.ZodString>;
91
+ }, "strip", z.ZodTypeAny, {
92
+ workspaceId?: string | undefined;
93
+ status?: "active" | "archived" | "deleted" | undefined;
94
+ search?: string | undefined;
95
+ limit: number;
96
+ cursor?: string | undefined;
97
+ }, {
98
+ workspaceId?: string | undefined;
99
+ status?: "active" | "archived" | "deleted" | undefined;
100
+ search?: string | undefined;
101
+ limit?: number | undefined;
102
+ cursor?: string | undefined;
103
+ }>;
104
+ export type ProjectFilter = z.infer<typeof ProjectFilter>;
105
+ /**
106
+ * Project list response
107
+ */
108
+ export declare const ProjectList: z.ZodObject<{
109
+ items: z.ZodArray<z.ZodObject<{
110
+ id: z.ZodString;
111
+ name: z.ZodString;
112
+ path: z.ZodString;
113
+ status: z.ZodDefault<z.ZodEnum<["active", "archived", "deleted"]>>;
114
+ workspaceId: z.ZodString;
115
+ createdAt: z.ZodString;
116
+ updatedAt: z.ZodString;
117
+ lastAccessedAt: z.ZodOptional<z.ZodString>;
118
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ id: string;
121
+ name: string;
122
+ path: string;
123
+ status: "active" | "archived" | "deleted";
124
+ workspaceId: string;
125
+ createdAt: string;
126
+ updatedAt: string;
127
+ lastAccessedAt?: string | undefined;
128
+ metadata?: Record<string, unknown> | undefined;
129
+ }, {
130
+ id: string;
131
+ name: string;
132
+ path: string;
133
+ status?: "active" | "archived" | "deleted" | undefined;
134
+ workspaceId: string;
135
+ createdAt: string;
136
+ updatedAt: string;
137
+ lastAccessedAt?: string | undefined;
138
+ metadata?: Record<string, unknown> | undefined;
139
+ }>, "many">;
140
+ nextCursor: z.ZodOptional<z.ZodString>;
141
+ total: z.ZodOptional<z.ZodNumber>;
142
+ }, "strip", z.ZodTypeAny, {
143
+ items: {
144
+ id: string;
145
+ name: string;
146
+ path: string;
147
+ status: "active" | "archived" | "deleted";
148
+ workspaceId: string;
149
+ createdAt: string;
150
+ updatedAt: string;
151
+ lastAccessedAt?: string | undefined;
152
+ metadata?: Record<string, unknown> | undefined;
153
+ }[];
154
+ nextCursor?: string | undefined;
155
+ total?: number | undefined;
156
+ }, {
157
+ items: {
158
+ id: string;
159
+ name: string;
160
+ path: string;
161
+ status?: "active" | "archived" | "deleted" | undefined;
162
+ workspaceId: string;
163
+ createdAt: string;
164
+ updatedAt: string;
165
+ lastAccessedAt?: string | undefined;
166
+ metadata?: Record<string, unknown> | undefined;
167
+ }[];
168
+ nextCursor?: string | undefined;
169
+ total?: number | undefined;
170
+ }>;
171
+ export type ProjectList = z.infer<typeof ProjectList>;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Project schemas for pi-harness
3
+ */
4
+ import { z } from 'zod';
5
+ import { Timestamp, UUID, NonEmptyString } from './base.js';
6
+ /**
7
+ * Project status
8
+ */
9
+ export const ProjectStatus = z.enum([
10
+ 'active',
11
+ 'archived',
12
+ 'deleted',
13
+ ]);
14
+ /**
15
+ * Project definition
16
+ */
17
+ export const Project = z.object({
18
+ id: UUID,
19
+ name: NonEmptyString,
20
+ path: NonEmptyString,
21
+ status: ProjectStatus.default('active'),
22
+ workspaceId: z.string(),
23
+ createdAt: Timestamp,
24
+ updatedAt: Timestamp,
25
+ lastAccessedAt: Timestamp.optional(),
26
+ metadata: z.record(z.string(), z.unknown()).optional(),
27
+ });
28
+ /**
29
+ * Project creation input
30
+ */
31
+ export const ProjectCreate = z.object({
32
+ name: NonEmptyString,
33
+ path: NonEmptyString,
34
+ workspaceId: z.string(),
35
+ metadata: z.record(z.string(), z.unknown()).optional(),
36
+ });
37
+ /**
38
+ * Project update input
39
+ */
40
+ export const ProjectUpdate = z.object({
41
+ name: NonEmptyString.optional(),
42
+ status: ProjectStatus.optional(),
43
+ metadata: z.record(z.string(), z.unknown()).optional(),
44
+ });
45
+ /**
46
+ * Project filter
47
+ */
48
+ export const ProjectFilter = z.object({
49
+ workspaceId: z.string().optional(),
50
+ status: ProjectStatus.optional(),
51
+ search: z.string().optional(),
52
+ limit: z.number().int().positive().max(100).default(50),
53
+ cursor: z.string().optional(),
54
+ });
55
+ /**
56
+ * Project list response
57
+ */
58
+ export const ProjectList = z.object({
59
+ items: z.array(Project),
60
+ nextCursor: z.string().optional(),
61
+ total: z.number().optional(),
62
+ });