@agentdock/wire 0.0.1

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 (82) hide show
  1. package/README.md +152 -0
  2. package/dist/agentCapabilities.d.ts +30 -0
  3. package/dist/agentCapabilities.d.ts.map +1 -0
  4. package/dist/agentCapabilities.js +103 -0
  5. package/dist/agentCapabilities.js.map +1 -0
  6. package/dist/agentInstallGuide.d.ts +15 -0
  7. package/dist/agentInstallGuide.d.ts.map +1 -0
  8. package/dist/agentInstallGuide.js +63 -0
  9. package/dist/agentInstallGuide.js.map +1 -0
  10. package/dist/agentModels.d.ts +23 -0
  11. package/dist/agentModels.d.ts.map +1 -0
  12. package/dist/agentModels.js +77 -0
  13. package/dist/agentModels.js.map +1 -0
  14. package/dist/controlLevel.d.ts +12 -0
  15. package/dist/controlLevel.d.ts.map +1 -0
  16. package/dist/controlLevel.js +11 -0
  17. package/dist/controlLevel.js.map +1 -0
  18. package/dist/envelope.d.ts +582 -0
  19. package/dist/envelope.d.ts.map +1 -0
  20. package/dist/envelope.js +64 -0
  21. package/dist/envelope.js.map +1 -0
  22. package/dist/events.d.ts +441 -0
  23. package/dist/events.d.ts.map +1 -0
  24. package/dist/events.js +88 -0
  25. package/dist/events.js.map +1 -0
  26. package/dist/index.d.ts +38 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +42 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/interactionEvents.d.ts +182 -0
  31. package/dist/interactionEvents.d.ts.map +1 -0
  32. package/dist/interactionEvents.js +92 -0
  33. package/dist/interactionEvents.js.map +1 -0
  34. package/dist/legacyProtocol.d.ts +385 -0
  35. package/dist/legacyProtocol.d.ts.map +1 -0
  36. package/dist/legacyProtocol.js +30 -0
  37. package/dist/legacyProtocol.js.map +1 -0
  38. package/dist/machine.d.ts +45 -0
  39. package/dist/machine.d.ts.map +1 -0
  40. package/dist/machine.js +28 -0
  41. package/dist/machine.js.map +1 -0
  42. package/dist/messageMeta.d.ts +49 -0
  43. package/dist/messageMeta.d.ts.map +1 -0
  44. package/dist/messageMeta.js +33 -0
  45. package/dist/messageMeta.js.map +1 -0
  46. package/dist/messages.d.ts +1843 -0
  47. package/dist/messages.d.ts.map +1 -0
  48. package/dist/messages.js +35 -0
  49. package/dist/messages.js.map +1 -0
  50. package/dist/pairing.d.ts +133 -0
  51. package/dist/pairing.d.ts.map +1 -0
  52. package/dist/pairing.js +115 -0
  53. package/dist/pairing.js.map +1 -0
  54. package/dist/rpc.d.ts +340 -0
  55. package/dist/rpc.d.ts.map +1 -0
  56. package/dist/rpc.js +115 -0
  57. package/dist/rpc.js.map +1 -0
  58. package/dist/sessionResult.d.ts +40 -0
  59. package/dist/sessionResult.d.ts.map +1 -0
  60. package/dist/sessionResult.js +23 -0
  61. package/dist/sessionResult.js.map +1 -0
  62. package/dist/spawnError.d.ts +40 -0
  63. package/dist/spawnError.d.ts.map +1 -0
  64. package/dist/spawnError.js +31 -0
  65. package/dist/spawnError.js.map +1 -0
  66. package/dist/stats.d.ts +1213 -0
  67. package/dist/stats.d.ts.map +1 -0
  68. package/dist/stats.js +79 -0
  69. package/dist/stats.js.map +1 -0
  70. package/dist/sync.d.ts +721 -0
  71. package/dist/sync.d.ts.map +1 -0
  72. package/dist/sync.js +62 -0
  73. package/dist/sync.js.map +1 -0
  74. package/dist/team.d.ts +1557 -0
  75. package/dist/team.d.ts.map +1 -0
  76. package/dist/team.js +93 -0
  77. package/dist/team.js.map +1 -0
  78. package/dist/utils.d.ts +2 -0
  79. package/dist/utils.d.ts.map +1 -0
  80. package/dist/utils.js +2 -0
  81. package/dist/utils.js.map +1 -0
  82. package/package.json +40 -0
@@ -0,0 +1,385 @@
1
+ /**
2
+ * Legacy protocol — aligned with Happy legacyProtocol.ts.
3
+ *
4
+ * Defines UserMessage and AgentMessage for backward compatibility.
5
+ */
6
+ import { z } from 'zod';
7
+ export declare const UserMessageSchema: z.ZodObject<{
8
+ role: z.ZodLiteral<"user">;
9
+ content: z.ZodObject<{
10
+ type: z.ZodLiteral<"text">;
11
+ text: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ type: "text";
14
+ text: string;
15
+ }, {
16
+ type: "text";
17
+ text: string;
18
+ }>;
19
+ localKey: z.ZodOptional<z.ZodString>;
20
+ meta: z.ZodOptional<z.ZodObject<{
21
+ sentFrom: z.ZodOptional<z.ZodString>;
22
+ permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo"]>>;
23
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
24
+ fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
+ customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
26
+ appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
27
+ allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
28
+ disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
29
+ displayText: z.ZodOptional<z.ZodString>;
30
+ agentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["claude", "copilot", "codex", "gemini", "opencode", "custom"]>>>;
31
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
32
+ sessionStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<["running", "idle", "completed", "failed", "cancelled"]>>>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ sentFrom?: string | undefined;
35
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
36
+ model?: string | null | undefined;
37
+ fallbackModel?: string | null | undefined;
38
+ customSystemPrompt?: string | null | undefined;
39
+ appendSystemPrompt?: string | null | undefined;
40
+ allowedTools?: string[] | null | undefined;
41
+ disallowedTools?: string[] | null | undefined;
42
+ displayText?: string | undefined;
43
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
44
+ startedAt?: number | null | undefined;
45
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
46
+ }, {
47
+ sentFrom?: string | undefined;
48
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
49
+ model?: string | null | undefined;
50
+ fallbackModel?: string | null | undefined;
51
+ customSystemPrompt?: string | null | undefined;
52
+ appendSystemPrompt?: string | null | undefined;
53
+ allowedTools?: string[] | null | undefined;
54
+ disallowedTools?: string[] | null | undefined;
55
+ displayText?: string | undefined;
56
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
57
+ startedAt?: number | null | undefined;
58
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
59
+ }>>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ role: "user";
62
+ content: {
63
+ type: "text";
64
+ text: string;
65
+ };
66
+ localKey?: string | undefined;
67
+ meta?: {
68
+ sentFrom?: string | undefined;
69
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
70
+ model?: string | null | undefined;
71
+ fallbackModel?: string | null | undefined;
72
+ customSystemPrompt?: string | null | undefined;
73
+ appendSystemPrompt?: string | null | undefined;
74
+ allowedTools?: string[] | null | undefined;
75
+ disallowedTools?: string[] | null | undefined;
76
+ displayText?: string | undefined;
77
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
78
+ startedAt?: number | null | undefined;
79
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
80
+ } | undefined;
81
+ }, {
82
+ role: "user";
83
+ content: {
84
+ type: "text";
85
+ text: string;
86
+ };
87
+ localKey?: string | undefined;
88
+ meta?: {
89
+ sentFrom?: string | undefined;
90
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
91
+ model?: string | null | undefined;
92
+ fallbackModel?: string | null | undefined;
93
+ customSystemPrompt?: string | null | undefined;
94
+ appendSystemPrompt?: string | null | undefined;
95
+ allowedTools?: string[] | null | undefined;
96
+ disallowedTools?: string[] | null | undefined;
97
+ displayText?: string | undefined;
98
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
99
+ startedAt?: number | null | undefined;
100
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
101
+ } | undefined;
102
+ }>;
103
+ export type UserMessage = z.infer<typeof UserMessageSchema>;
104
+ export declare const AgentMessageSchema: z.ZodObject<{
105
+ role: z.ZodLiteral<"agent">;
106
+ content: z.ZodObject<{
107
+ type: z.ZodString;
108
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
109
+ type: z.ZodString;
110
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
111
+ type: z.ZodString;
112
+ }, z.ZodTypeAny, "passthrough">>;
113
+ meta: z.ZodOptional<z.ZodObject<{
114
+ sentFrom: z.ZodOptional<z.ZodString>;
115
+ permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo"]>>;
116
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
117
+ fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
118
+ customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
119
+ appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
120
+ allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
121
+ disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
122
+ displayText: z.ZodOptional<z.ZodString>;
123
+ agentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["claude", "copilot", "codex", "gemini", "opencode", "custom"]>>>;
124
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
125
+ sessionStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<["running", "idle", "completed", "failed", "cancelled"]>>>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ sentFrom?: string | undefined;
128
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
129
+ model?: string | null | undefined;
130
+ fallbackModel?: string | null | undefined;
131
+ customSystemPrompt?: string | null | undefined;
132
+ appendSystemPrompt?: string | null | undefined;
133
+ allowedTools?: string[] | null | undefined;
134
+ disallowedTools?: string[] | null | undefined;
135
+ displayText?: string | undefined;
136
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
137
+ startedAt?: number | null | undefined;
138
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
139
+ }, {
140
+ sentFrom?: string | undefined;
141
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
142
+ model?: string | null | undefined;
143
+ fallbackModel?: string | null | undefined;
144
+ customSystemPrompt?: string | null | undefined;
145
+ appendSystemPrompt?: string | null | undefined;
146
+ allowedTools?: string[] | null | undefined;
147
+ disallowedTools?: string[] | null | undefined;
148
+ displayText?: string | undefined;
149
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
150
+ startedAt?: number | null | undefined;
151
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
152
+ }>>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ role: "agent";
155
+ content: {
156
+ type: string;
157
+ } & {
158
+ [k: string]: unknown;
159
+ };
160
+ meta?: {
161
+ sentFrom?: string | undefined;
162
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
163
+ model?: string | null | undefined;
164
+ fallbackModel?: string | null | undefined;
165
+ customSystemPrompt?: string | null | undefined;
166
+ appendSystemPrompt?: string | null | undefined;
167
+ allowedTools?: string[] | null | undefined;
168
+ disallowedTools?: string[] | null | undefined;
169
+ displayText?: string | undefined;
170
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
171
+ startedAt?: number | null | undefined;
172
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
173
+ } | undefined;
174
+ }, {
175
+ role: "agent";
176
+ content: {
177
+ type: string;
178
+ } & {
179
+ [k: string]: unknown;
180
+ };
181
+ meta?: {
182
+ sentFrom?: string | undefined;
183
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
184
+ model?: string | null | undefined;
185
+ fallbackModel?: string | null | undefined;
186
+ customSystemPrompt?: string | null | undefined;
187
+ appendSystemPrompt?: string | null | undefined;
188
+ allowedTools?: string[] | null | undefined;
189
+ disallowedTools?: string[] | null | undefined;
190
+ displayText?: string | undefined;
191
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
192
+ startedAt?: number | null | undefined;
193
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
194
+ } | undefined;
195
+ }>;
196
+ export type AgentMessage = z.infer<typeof AgentMessageSchema>;
197
+ export declare const LegacyMessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.ZodObject<{
198
+ role: z.ZodLiteral<"user">;
199
+ content: z.ZodObject<{
200
+ type: z.ZodLiteral<"text">;
201
+ text: z.ZodString;
202
+ }, "strip", z.ZodTypeAny, {
203
+ type: "text";
204
+ text: string;
205
+ }, {
206
+ type: "text";
207
+ text: string;
208
+ }>;
209
+ localKey: z.ZodOptional<z.ZodString>;
210
+ meta: z.ZodOptional<z.ZodObject<{
211
+ sentFrom: z.ZodOptional<z.ZodString>;
212
+ permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo"]>>;
213
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
+ fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
215
+ customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
216
+ appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
217
+ allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
218
+ disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
219
+ displayText: z.ZodOptional<z.ZodString>;
220
+ agentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["claude", "copilot", "codex", "gemini", "opencode", "custom"]>>>;
221
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
222
+ sessionStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<["running", "idle", "completed", "failed", "cancelled"]>>>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ sentFrom?: string | undefined;
225
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
226
+ model?: string | null | undefined;
227
+ fallbackModel?: string | null | undefined;
228
+ customSystemPrompt?: string | null | undefined;
229
+ appendSystemPrompt?: string | null | undefined;
230
+ allowedTools?: string[] | null | undefined;
231
+ disallowedTools?: string[] | null | undefined;
232
+ displayText?: string | undefined;
233
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
234
+ startedAt?: number | null | undefined;
235
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
236
+ }, {
237
+ sentFrom?: string | undefined;
238
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
239
+ model?: string | null | undefined;
240
+ fallbackModel?: string | null | undefined;
241
+ customSystemPrompt?: string | null | undefined;
242
+ appendSystemPrompt?: string | null | undefined;
243
+ allowedTools?: string[] | null | undefined;
244
+ disallowedTools?: string[] | null | undefined;
245
+ displayText?: string | undefined;
246
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
247
+ startedAt?: number | null | undefined;
248
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
249
+ }>>;
250
+ }, "strip", z.ZodTypeAny, {
251
+ role: "user";
252
+ content: {
253
+ type: "text";
254
+ text: string;
255
+ };
256
+ localKey?: string | undefined;
257
+ meta?: {
258
+ sentFrom?: string | undefined;
259
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
260
+ model?: string | null | undefined;
261
+ fallbackModel?: string | null | undefined;
262
+ customSystemPrompt?: string | null | undefined;
263
+ appendSystemPrompt?: string | null | undefined;
264
+ allowedTools?: string[] | null | undefined;
265
+ disallowedTools?: string[] | null | undefined;
266
+ displayText?: string | undefined;
267
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
268
+ startedAt?: number | null | undefined;
269
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
270
+ } | undefined;
271
+ }, {
272
+ role: "user";
273
+ content: {
274
+ type: "text";
275
+ text: string;
276
+ };
277
+ localKey?: string | undefined;
278
+ meta?: {
279
+ sentFrom?: string | undefined;
280
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
281
+ model?: string | null | undefined;
282
+ fallbackModel?: string | null | undefined;
283
+ customSystemPrompt?: string | null | undefined;
284
+ appendSystemPrompt?: string | null | undefined;
285
+ allowedTools?: string[] | null | undefined;
286
+ disallowedTools?: string[] | null | undefined;
287
+ displayText?: string | undefined;
288
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
289
+ startedAt?: number | null | undefined;
290
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
291
+ } | undefined;
292
+ }>, z.ZodObject<{
293
+ role: z.ZodLiteral<"agent">;
294
+ content: z.ZodObject<{
295
+ type: z.ZodString;
296
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
297
+ type: z.ZodString;
298
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
299
+ type: z.ZodString;
300
+ }, z.ZodTypeAny, "passthrough">>;
301
+ meta: z.ZodOptional<z.ZodObject<{
302
+ sentFrom: z.ZodOptional<z.ZodString>;
303
+ permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo"]>>;
304
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
305
+ fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
306
+ customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
307
+ appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
308
+ allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
309
+ disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
310
+ displayText: z.ZodOptional<z.ZodString>;
311
+ agentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["claude", "copilot", "codex", "gemini", "opencode", "custom"]>>>;
312
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
313
+ sessionStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<["running", "idle", "completed", "failed", "cancelled"]>>>;
314
+ }, "strip", z.ZodTypeAny, {
315
+ sentFrom?: string | undefined;
316
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
317
+ model?: string | null | undefined;
318
+ fallbackModel?: string | null | undefined;
319
+ customSystemPrompt?: string | null | undefined;
320
+ appendSystemPrompt?: string | null | undefined;
321
+ allowedTools?: string[] | null | undefined;
322
+ disallowedTools?: string[] | null | undefined;
323
+ displayText?: string | undefined;
324
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
325
+ startedAt?: number | null | undefined;
326
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
327
+ }, {
328
+ sentFrom?: string | undefined;
329
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
330
+ model?: string | null | undefined;
331
+ fallbackModel?: string | null | undefined;
332
+ customSystemPrompt?: string | null | undefined;
333
+ appendSystemPrompt?: string | null | undefined;
334
+ allowedTools?: string[] | null | undefined;
335
+ disallowedTools?: string[] | null | undefined;
336
+ displayText?: string | undefined;
337
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
338
+ startedAt?: number | null | undefined;
339
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
340
+ }>>;
341
+ }, "strip", z.ZodTypeAny, {
342
+ role: "agent";
343
+ content: {
344
+ type: string;
345
+ } & {
346
+ [k: string]: unknown;
347
+ };
348
+ meta?: {
349
+ sentFrom?: string | undefined;
350
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
351
+ model?: string | null | undefined;
352
+ fallbackModel?: string | null | undefined;
353
+ customSystemPrompt?: string | null | undefined;
354
+ appendSystemPrompt?: string | null | undefined;
355
+ allowedTools?: string[] | null | undefined;
356
+ disallowedTools?: string[] | null | undefined;
357
+ displayText?: string | undefined;
358
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
359
+ startedAt?: number | null | undefined;
360
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
361
+ } | undefined;
362
+ }, {
363
+ role: "agent";
364
+ content: {
365
+ type: string;
366
+ } & {
367
+ [k: string]: unknown;
368
+ };
369
+ meta?: {
370
+ sentFrom?: string | undefined;
371
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
372
+ model?: string | null | undefined;
373
+ fallbackModel?: string | null | undefined;
374
+ customSystemPrompt?: string | null | undefined;
375
+ appendSystemPrompt?: string | null | undefined;
376
+ allowedTools?: string[] | null | undefined;
377
+ disallowedTools?: string[] | null | undefined;
378
+ displayText?: string | undefined;
379
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
380
+ startedAt?: number | null | undefined;
381
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
382
+ } | undefined;
383
+ }>]>;
384
+ export type LegacyMessageContent = z.infer<typeof LegacyMessageContentSchema>;
385
+ //# sourceMappingURL=legacyProtocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacyProtocol.d.ts","sourceRoot":"","sources":["../src/legacyProtocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAGrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Legacy protocol — aligned with Happy legacyProtocol.ts.
3
+ *
4
+ * Defines UserMessage and AgentMessage for backward compatibility.
5
+ */
6
+ import { z } from 'zod';
7
+ import { MessageMetaSchema } from './messageMeta.js';
8
+ export const UserMessageSchema = z.object({
9
+ role: z.literal('user'),
10
+ content: z.object({
11
+ type: z.literal('text'),
12
+ text: z.string(),
13
+ }),
14
+ localKey: z.string().optional(),
15
+ meta: MessageMetaSchema.optional(),
16
+ });
17
+ export const AgentMessageSchema = z.object({
18
+ role: z.literal('agent'),
19
+ content: z
20
+ .object({
21
+ type: z.string(),
22
+ })
23
+ .passthrough(),
24
+ meta: MessageMetaSchema.optional(),
25
+ });
26
+ export const LegacyMessageContentSchema = z.discriminatedUnion('role', [
27
+ UserMessageSchema,
28
+ AgentMessageSchema,
29
+ ]);
30
+ //# sourceMappingURL=legacyProtocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacyProtocol.js","sourceRoot":"","sources":["../src/legacyProtocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC;IACF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,IAAI,EAAE,iBAAiB,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,OAAO,EAAE,CAAC;SACP,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC;SACD,WAAW,EAAE;IAChB,IAAI,EAAE,iBAAiB,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACrE,iBAAiB;IACjB,kBAAkB;CACnB,CAAC,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Machine and session status schemas for Dashboard & Machine Management.
3
+ *
4
+ * MachineSummary — device info returned by GET /v1/machines.
5
+ * SessionStatus — real-time session state indicator.
6
+ * Platform — OS platform enum matching Node's process.platform.
7
+ */
8
+ import { z } from 'zod';
9
+ export declare const PlatformSchema: z.ZodEnum<["darwin", "linux", "win32"]>;
10
+ export type Platform = z.infer<typeof PlatformSchema>;
11
+ export declare const SessionStatusSchema: z.ZodEnum<["idle", "thinking", "tool_running", "permission_required", "disconnected"]>;
12
+ export type SessionStatus = z.infer<typeof SessionStatusSchema>;
13
+ export declare const MachineSummarySchema: z.ZodObject<{
14
+ id: z.ZodString;
15
+ hostname: z.ZodString;
16
+ platform: z.ZodEnum<["darwin", "linux", "win32"]>;
17
+ arch: z.ZodOptional<z.ZodString>;
18
+ displayName: z.ZodOptional<z.ZodString>;
19
+ daemonVersion: z.ZodOptional<z.ZodString>;
20
+ active: z.ZodBoolean;
21
+ activeAt: z.ZodNumber;
22
+ createdAt: z.ZodNumber;
23
+ }, "strip", z.ZodTypeAny, {
24
+ id: string;
25
+ hostname: string;
26
+ platform: "darwin" | "linux" | "win32";
27
+ active: boolean;
28
+ activeAt: number;
29
+ createdAt: number;
30
+ arch?: string | undefined;
31
+ displayName?: string | undefined;
32
+ daemonVersion?: string | undefined;
33
+ }, {
34
+ id: string;
35
+ hostname: string;
36
+ platform: "darwin" | "linux" | "win32";
37
+ active: boolean;
38
+ activeAt: number;
39
+ createdAt: number;
40
+ arch?: string | undefined;
41
+ displayName?: string | undefined;
42
+ daemonVersion?: string | undefined;
43
+ }>;
44
+ export type MachineSummary = z.infer<typeof MachineSummarySchema>;
45
+ //# sourceMappingURL=machine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../src/machine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,cAAc,yCAAuC,CAAC;AACnE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,mBAAmB,wFAM9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Machine and session status schemas for Dashboard & Machine Management.
3
+ *
4
+ * MachineSummary — device info returned by GET /v1/machines.
5
+ * SessionStatus — real-time session state indicator.
6
+ * Platform — OS platform enum matching Node's process.platform.
7
+ */
8
+ import { z } from 'zod';
9
+ export const PlatformSchema = z.enum(['darwin', 'linux', 'win32']);
10
+ export const SessionStatusSchema = z.enum([
11
+ 'idle',
12
+ 'thinking',
13
+ 'tool_running',
14
+ 'permission_required',
15
+ 'disconnected',
16
+ ]);
17
+ export const MachineSummarySchema = z.object({
18
+ id: z.string(),
19
+ hostname: z.string(),
20
+ platform: PlatformSchema,
21
+ arch: z.string().optional(),
22
+ displayName: z.string().optional(),
23
+ daemonVersion: z.string().optional(),
24
+ active: z.boolean(),
25
+ activeAt: z.number(),
26
+ createdAt: z.number(),
27
+ });
28
+ //# sourceMappingURL=machine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"machine.js","sourceRoot":"","sources":["../src/machine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAGnE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC;IACxC,MAAM;IACN,UAAU;IACV,cAAc;IACd,qBAAqB;IACrB,cAAc;CACf,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,cAAc;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC"}
@@ -0,0 +1,49 @@
1
+ import { z } from 'zod';
2
+ /** Supported agent types for avatar and UI differentiation. */
3
+ export declare const AgentTypeSchema: z.ZodEnum<["claude", "copilot", "codex", "gemini", "opencode", "custom"]>;
4
+ export type AgentType = z.infer<typeof AgentTypeSchema>;
5
+ export declare const MessageMetaSchema: z.ZodObject<{
6
+ sentFrom: z.ZodOptional<z.ZodString>;
7
+ permissionMode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo"]>>;
8
+ model: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
+ fallbackModel: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
+ customSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ appendSystemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
+ allowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
13
+ disallowedTools: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
14
+ displayText: z.ZodOptional<z.ZodString>;
15
+ /** Agent type for UI differentiation (avatar, colors). */
16
+ agentType: z.ZodOptional<z.ZodNullable<z.ZodEnum<["claude", "copilot", "codex", "gemini", "opencode", "custom"]>>>;
17
+ /** Session start timestamp (Unix ms). */
18
+ startedAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
19
+ /** Session status for info display. */
20
+ sessionStatus: z.ZodOptional<z.ZodNullable<z.ZodEnum<["running", "idle", "completed", "failed", "cancelled"]>>>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ sentFrom?: string | undefined;
23
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
24
+ model?: string | null | undefined;
25
+ fallbackModel?: string | null | undefined;
26
+ customSystemPrompt?: string | null | undefined;
27
+ appendSystemPrompt?: string | null | undefined;
28
+ allowedTools?: string[] | null | undefined;
29
+ disallowedTools?: string[] | null | undefined;
30
+ displayText?: string | undefined;
31
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
32
+ startedAt?: number | null | undefined;
33
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
34
+ }, {
35
+ sentFrom?: string | undefined;
36
+ permissionMode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "read-only" | "safe-yolo" | "yolo" | undefined;
37
+ model?: string | null | undefined;
38
+ fallbackModel?: string | null | undefined;
39
+ customSystemPrompt?: string | null | undefined;
40
+ appendSystemPrompt?: string | null | undefined;
41
+ allowedTools?: string[] | null | undefined;
42
+ disallowedTools?: string[] | null | undefined;
43
+ displayText?: string | undefined;
44
+ agentType?: "custom" | "claude" | "copilot" | "opencode" | "codex" | "gemini" | null | undefined;
45
+ startedAt?: number | null | undefined;
46
+ sessionStatus?: "running" | "idle" | "completed" | "failed" | "cancelled" | null | undefined;
47
+ }>;
48
+ export type MessageMeta = z.infer<typeof MessageMetaSchema>;
49
+ //# sourceMappingURL=messageMeta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageMeta.d.ts","sourceRoot":"","sources":["../src/messageMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+DAA+D;AAC/D,eAAO,MAAM,eAAe,2EAO1B,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,iBAAiB;;;;;;;;;;IAY5B,0DAA0D;;IAE1D,yCAAyC;;IAEzC,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKvC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ /** Supported agent types for avatar and UI differentiation. */
3
+ export const AgentTypeSchema = z.enum([
4
+ 'claude',
5
+ 'copilot',
6
+ 'codex',
7
+ 'gemini',
8
+ 'opencode',
9
+ 'custom',
10
+ ]);
11
+ export const MessageMetaSchema = z.object({
12
+ sentFrom: z.string().optional(),
13
+ permissionMode: z
14
+ .enum(['default', 'acceptEdits', 'bypassPermissions', 'plan', 'read-only', 'safe-yolo', 'yolo'])
15
+ .optional(),
16
+ model: z.string().nullable().optional(),
17
+ fallbackModel: z.string().nullable().optional(),
18
+ customSystemPrompt: z.string().nullable().optional(),
19
+ appendSystemPrompt: z.string().nullable().optional(),
20
+ allowedTools: z.array(z.string()).nullable().optional(),
21
+ disallowedTools: z.array(z.string()).nullable().optional(),
22
+ displayText: z.string().optional(),
23
+ /** Agent type for UI differentiation (avatar, colors). */
24
+ agentType: AgentTypeSchema.nullable().optional(),
25
+ /** Session start timestamp (Unix ms). */
26
+ startedAt: z.number().nullable().optional(),
27
+ /** Session status for info display. */
28
+ sessionStatus: z
29
+ .enum(['running', 'idle', 'completed', 'failed', 'cancelled'])
30
+ .nullable()
31
+ .optional(),
32
+ });
33
+ //# sourceMappingURL=messageMeta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageMeta.js","sourceRoot":"","sources":["../src/messageMeta.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,+DAA+D;AAC/D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC;IACpC,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,UAAU;IACV,QAAQ;CACT,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,cAAc,EAAE,CAAC;SACd,IAAI,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;SAC/F,QAAQ,EAAE;IACb,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACvC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC/C,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACpD,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACpD,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACvD,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC1D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,0DAA0D;IAC1D,SAAS,EAAE,eAAe,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAChD,yCAAyC;IACzC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC3C,uCAAuC;IACvC,aAAa,EAAE,CAAC;SACb,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;SAC7D,QAAQ,EAAE;SACV,QAAQ,EAAE;CACd,CAAC,CAAC"}