@agent-relay/spawner 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +552 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +193 -0
- package/dist/types.js.map +1 -0
- package/package.json +47 -0
- package/src/index.ts +8 -0
- package/src/types.test.ts +385 -0
- package/src/types.ts +228 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spawner Types
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for agent spawning and lifecycle management types.
|
|
5
|
+
* These types are used across the spawner, daemon, and dashboard.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* When shadow agents should activate
|
|
10
|
+
*/
|
|
11
|
+
export declare const SpeakOnTriggerSchema: z.ZodEnum<["SESSION_END", "CODE_WRITTEN", "REVIEW_REQUEST", "EXPLICIT_ASK", "ALL_MESSAGES"]>;
|
|
12
|
+
export type SpeakOnTrigger = z.infer<typeof SpeakOnTriggerSchema>;
|
|
13
|
+
/**
|
|
14
|
+
* Shadow role preset names
|
|
15
|
+
*/
|
|
16
|
+
export declare const ShadowRolePresetSchema: z.ZodEnum<["reviewer", "auditor", "active"]>;
|
|
17
|
+
export type ShadowRolePreset = z.infer<typeof ShadowRolePresetSchema>;
|
|
18
|
+
/**
|
|
19
|
+
* Shadow execution mode
|
|
20
|
+
*/
|
|
21
|
+
export declare const ShadowModeSchema: z.ZodEnum<["subagent", "process"]>;
|
|
22
|
+
export type ShadowMode = z.infer<typeof ShadowModeSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Policy source types
|
|
25
|
+
*/
|
|
26
|
+
export declare const PolicySourceSchema: z.ZodEnum<["repo", "local", "workspace", "default"]>;
|
|
27
|
+
export type PolicySource = z.infer<typeof PolicySourceSchema>;
|
|
28
|
+
/**
|
|
29
|
+
* Policy decision result
|
|
30
|
+
*/
|
|
31
|
+
export declare const PolicyDecisionSchema: z.ZodObject<{
|
|
32
|
+
allowed: z.ZodBoolean;
|
|
33
|
+
reason: z.ZodString;
|
|
34
|
+
policySource: z.ZodEnum<["repo", "local", "workspace", "default"]>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
allowed: boolean;
|
|
37
|
+
reason: string;
|
|
38
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
39
|
+
}, {
|
|
40
|
+
allowed: boolean;
|
|
41
|
+
reason: string;
|
|
42
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
43
|
+
}>;
|
|
44
|
+
export type PolicyDecision = z.infer<typeof PolicyDecisionSchema>;
|
|
45
|
+
/**
|
|
46
|
+
* Request to spawn a new agent
|
|
47
|
+
*/
|
|
48
|
+
export declare const SpawnRequestSchema: z.ZodObject<{
|
|
49
|
+
/** Worker agent name (must be unique) */
|
|
50
|
+
name: z.ZodString;
|
|
51
|
+
/** CLI tool (e.g., 'claude', 'claude:opus', 'codex', 'gemini') */
|
|
52
|
+
cli: z.ZodString;
|
|
53
|
+
/** Initial task to inject after spawn */
|
|
54
|
+
task: z.ZodString;
|
|
55
|
+
/** Optional team name for organization */
|
|
56
|
+
team: z.ZodOptional<z.ZodString>;
|
|
57
|
+
/** Working directory (defaults to project root) */
|
|
58
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
59
|
+
/** Name of requesting agent (for policy enforcement) */
|
|
60
|
+
spawnerName: z.ZodOptional<z.ZodString>;
|
|
61
|
+
/** Interactive mode - disables auto-accept of permission prompts */
|
|
62
|
+
interactive: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
/** Shadow execution mode (subagent = no extra process) */
|
|
64
|
+
shadowMode: z.ZodOptional<z.ZodEnum<["subagent", "process"]>>;
|
|
65
|
+
/** Primary agent to shadow (if this agent is a shadow) */
|
|
66
|
+
shadowOf: z.ZodOptional<z.ZodString>;
|
|
67
|
+
/** Shadow agent profile to use (for subagent mode) */
|
|
68
|
+
shadowAgent: z.ZodOptional<z.ZodString>;
|
|
69
|
+
/** When to trigger the shadow (for subagent mode) */
|
|
70
|
+
shadowTriggers: z.ZodOptional<z.ZodArray<z.ZodEnum<["SESSION_END", "CODE_WRITTEN", "REVIEW_REQUEST", "EXPLICIT_ASK", "ALL_MESSAGES"]>, "many">>;
|
|
71
|
+
/** When the shadow should speak (default: ['EXPLICIT_ASK']) */
|
|
72
|
+
shadowSpeakOn: z.ZodOptional<z.ZodArray<z.ZodEnum<["SESSION_END", "CODE_WRITTEN", "REVIEW_REQUEST", "EXPLICIT_ASK", "ALL_MESSAGES"]>, "many">>;
|
|
73
|
+
/** User ID for per-user credential storage in shared workspaces */
|
|
74
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
name: string;
|
|
77
|
+
cli: string;
|
|
78
|
+
task: string;
|
|
79
|
+
team?: string | undefined;
|
|
80
|
+
cwd?: string | undefined;
|
|
81
|
+
spawnerName?: string | undefined;
|
|
82
|
+
interactive?: boolean | undefined;
|
|
83
|
+
shadowMode?: "subagent" | "process" | undefined;
|
|
84
|
+
shadowOf?: string | undefined;
|
|
85
|
+
shadowAgent?: string | undefined;
|
|
86
|
+
shadowTriggers?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
87
|
+
shadowSpeakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
88
|
+
userId?: string | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
name: string;
|
|
91
|
+
cli: string;
|
|
92
|
+
task: string;
|
|
93
|
+
team?: string | undefined;
|
|
94
|
+
cwd?: string | undefined;
|
|
95
|
+
spawnerName?: string | undefined;
|
|
96
|
+
interactive?: boolean | undefined;
|
|
97
|
+
shadowMode?: "subagent" | "process" | undefined;
|
|
98
|
+
shadowOf?: string | undefined;
|
|
99
|
+
shadowAgent?: string | undefined;
|
|
100
|
+
shadowTriggers?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
101
|
+
shadowSpeakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
102
|
+
userId?: string | undefined;
|
|
103
|
+
}>;
|
|
104
|
+
export type SpawnRequest = z.infer<typeof SpawnRequestSchema>;
|
|
105
|
+
/**
|
|
106
|
+
* Result of a spawn operation
|
|
107
|
+
*/
|
|
108
|
+
export declare const SpawnResultSchema: z.ZodObject<{
|
|
109
|
+
success: z.ZodBoolean;
|
|
110
|
+
name: z.ZodString;
|
|
111
|
+
/** PID of the spawned process (for pty-based workers) */
|
|
112
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
error: z.ZodOptional<z.ZodString>;
|
|
114
|
+
/** Policy decision details if spawn was blocked by policy */
|
|
115
|
+
policyDecision: z.ZodOptional<z.ZodObject<{
|
|
116
|
+
allowed: z.ZodBoolean;
|
|
117
|
+
reason: z.ZodString;
|
|
118
|
+
policySource: z.ZodEnum<["repo", "local", "workspace", "default"]>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
allowed: boolean;
|
|
121
|
+
reason: string;
|
|
122
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
123
|
+
}, {
|
|
124
|
+
allowed: boolean;
|
|
125
|
+
reason: string;
|
|
126
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
127
|
+
}>>;
|
|
128
|
+
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
name: string;
|
|
130
|
+
success: boolean;
|
|
131
|
+
pid?: number | undefined;
|
|
132
|
+
error?: string | undefined;
|
|
133
|
+
policyDecision?: {
|
|
134
|
+
allowed: boolean;
|
|
135
|
+
reason: string;
|
|
136
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
137
|
+
} | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
name: string;
|
|
140
|
+
success: boolean;
|
|
141
|
+
pid?: number | undefined;
|
|
142
|
+
error?: string | undefined;
|
|
143
|
+
policyDecision?: {
|
|
144
|
+
allowed: boolean;
|
|
145
|
+
reason: string;
|
|
146
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
147
|
+
} | undefined;
|
|
148
|
+
}>;
|
|
149
|
+
export type SpawnResult = z.infer<typeof SpawnResultSchema>;
|
|
150
|
+
/**
|
|
151
|
+
* Information about an active worker
|
|
152
|
+
*/
|
|
153
|
+
export declare const WorkerInfoSchema: z.ZodObject<{
|
|
154
|
+
name: z.ZodString;
|
|
155
|
+
cli: z.ZodString;
|
|
156
|
+
task: z.ZodString;
|
|
157
|
+
/** Optional team name this agent belongs to */
|
|
158
|
+
team: z.ZodOptional<z.ZodString>;
|
|
159
|
+
spawnedAt: z.ZodNumber;
|
|
160
|
+
/** PID of the pty process */
|
|
161
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
name: string;
|
|
164
|
+
cli: string;
|
|
165
|
+
task: string;
|
|
166
|
+
spawnedAt: number;
|
|
167
|
+
team?: string | undefined;
|
|
168
|
+
pid?: number | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
name: string;
|
|
171
|
+
cli: string;
|
|
172
|
+
task: string;
|
|
173
|
+
spawnedAt: number;
|
|
174
|
+
team?: string | undefined;
|
|
175
|
+
pid?: number | undefined;
|
|
176
|
+
}>;
|
|
177
|
+
export type WorkerInfo = z.infer<typeof WorkerInfoSchema>;
|
|
178
|
+
/**
|
|
179
|
+
* Primary agent configuration for spawnWithShadow
|
|
180
|
+
*/
|
|
181
|
+
export declare const PrimaryAgentConfigSchema: z.ZodObject<{
|
|
182
|
+
/** Agent name */
|
|
183
|
+
name: z.ZodString;
|
|
184
|
+
/** CLI command (default: 'claude') */
|
|
185
|
+
command: z.ZodOptional<z.ZodString>;
|
|
186
|
+
/** Initial task to send to the agent */
|
|
187
|
+
task: z.ZodOptional<z.ZodString>;
|
|
188
|
+
/** Team name to organize under */
|
|
189
|
+
team: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, "strip", z.ZodTypeAny, {
|
|
191
|
+
name: string;
|
|
192
|
+
task?: string | undefined;
|
|
193
|
+
team?: string | undefined;
|
|
194
|
+
command?: string | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
name: string;
|
|
197
|
+
task?: string | undefined;
|
|
198
|
+
team?: string | undefined;
|
|
199
|
+
command?: string | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
export type PrimaryAgentConfig = z.infer<typeof PrimaryAgentConfigSchema>;
|
|
202
|
+
/**
|
|
203
|
+
* Shadow agent configuration for spawnWithShadow
|
|
204
|
+
*/
|
|
205
|
+
export declare const ShadowAgentConfigSchema: z.ZodObject<{
|
|
206
|
+
/** Shadow agent name */
|
|
207
|
+
name: z.ZodString;
|
|
208
|
+
/** CLI command (default: same as primary) */
|
|
209
|
+
command: z.ZodOptional<z.ZodString>;
|
|
210
|
+
/** Role preset (reviewer, auditor, active) or custom prompt */
|
|
211
|
+
role: z.ZodOptional<z.ZodString>;
|
|
212
|
+
/** Custom speakOn triggers (overrides role preset) */
|
|
213
|
+
speakOn: z.ZodOptional<z.ZodArray<z.ZodEnum<["SESSION_END", "CODE_WRITTEN", "REVIEW_REQUEST", "EXPLICIT_ASK", "ALL_MESSAGES"]>, "many">>;
|
|
214
|
+
/** Custom prompt for the shadow agent */
|
|
215
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
216
|
+
}, "strip", z.ZodTypeAny, {
|
|
217
|
+
name: string;
|
|
218
|
+
command?: string | undefined;
|
|
219
|
+
role?: string | undefined;
|
|
220
|
+
speakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
221
|
+
prompt?: string | undefined;
|
|
222
|
+
}, {
|
|
223
|
+
name: string;
|
|
224
|
+
command?: string | undefined;
|
|
225
|
+
role?: string | undefined;
|
|
226
|
+
speakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
227
|
+
prompt?: string | undefined;
|
|
228
|
+
}>;
|
|
229
|
+
export type ShadowAgentConfig = z.infer<typeof ShadowAgentConfigSchema>;
|
|
230
|
+
/**
|
|
231
|
+
* Request for spawning a primary agent with its shadow
|
|
232
|
+
*/
|
|
233
|
+
export declare const SpawnWithShadowRequestSchema: z.ZodObject<{
|
|
234
|
+
/** Primary agent configuration */
|
|
235
|
+
primary: z.ZodObject<{
|
|
236
|
+
/** Agent name */
|
|
237
|
+
name: z.ZodString;
|
|
238
|
+
/** CLI command (default: 'claude') */
|
|
239
|
+
command: z.ZodOptional<z.ZodString>;
|
|
240
|
+
/** Initial task to send to the agent */
|
|
241
|
+
task: z.ZodOptional<z.ZodString>;
|
|
242
|
+
/** Team name to organize under */
|
|
243
|
+
team: z.ZodOptional<z.ZodString>;
|
|
244
|
+
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
name: string;
|
|
246
|
+
task?: string | undefined;
|
|
247
|
+
team?: string | undefined;
|
|
248
|
+
command?: string | undefined;
|
|
249
|
+
}, {
|
|
250
|
+
name: string;
|
|
251
|
+
task?: string | undefined;
|
|
252
|
+
team?: string | undefined;
|
|
253
|
+
command?: string | undefined;
|
|
254
|
+
}>;
|
|
255
|
+
/** Shadow agent configuration */
|
|
256
|
+
shadow: z.ZodObject<{
|
|
257
|
+
/** Shadow agent name */
|
|
258
|
+
name: z.ZodString;
|
|
259
|
+
/** CLI command (default: same as primary) */
|
|
260
|
+
command: z.ZodOptional<z.ZodString>;
|
|
261
|
+
/** Role preset (reviewer, auditor, active) or custom prompt */
|
|
262
|
+
role: z.ZodOptional<z.ZodString>;
|
|
263
|
+
/** Custom speakOn triggers (overrides role preset) */
|
|
264
|
+
speakOn: z.ZodOptional<z.ZodArray<z.ZodEnum<["SESSION_END", "CODE_WRITTEN", "REVIEW_REQUEST", "EXPLICIT_ASK", "ALL_MESSAGES"]>, "many">>;
|
|
265
|
+
/** Custom prompt for the shadow agent */
|
|
266
|
+
prompt: z.ZodOptional<z.ZodString>;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
name: string;
|
|
269
|
+
command?: string | undefined;
|
|
270
|
+
role?: string | undefined;
|
|
271
|
+
speakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
272
|
+
prompt?: string | undefined;
|
|
273
|
+
}, {
|
|
274
|
+
name: string;
|
|
275
|
+
command?: string | undefined;
|
|
276
|
+
role?: string | undefined;
|
|
277
|
+
speakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
278
|
+
prompt?: string | undefined;
|
|
279
|
+
}>;
|
|
280
|
+
}, "strip", z.ZodTypeAny, {
|
|
281
|
+
primary: {
|
|
282
|
+
name: string;
|
|
283
|
+
task?: string | undefined;
|
|
284
|
+
team?: string | undefined;
|
|
285
|
+
command?: string | undefined;
|
|
286
|
+
};
|
|
287
|
+
shadow: {
|
|
288
|
+
name: string;
|
|
289
|
+
command?: string | undefined;
|
|
290
|
+
role?: string | undefined;
|
|
291
|
+
speakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
292
|
+
prompt?: string | undefined;
|
|
293
|
+
};
|
|
294
|
+
}, {
|
|
295
|
+
primary: {
|
|
296
|
+
name: string;
|
|
297
|
+
task?: string | undefined;
|
|
298
|
+
team?: string | undefined;
|
|
299
|
+
command?: string | undefined;
|
|
300
|
+
};
|
|
301
|
+
shadow: {
|
|
302
|
+
name: string;
|
|
303
|
+
command?: string | undefined;
|
|
304
|
+
role?: string | undefined;
|
|
305
|
+
speakOn?: ("SESSION_END" | "CODE_WRITTEN" | "REVIEW_REQUEST" | "EXPLICIT_ASK" | "ALL_MESSAGES")[] | undefined;
|
|
306
|
+
prompt?: string | undefined;
|
|
307
|
+
};
|
|
308
|
+
}>;
|
|
309
|
+
export type SpawnWithShadowRequest = z.infer<typeof SpawnWithShadowRequestSchema>;
|
|
310
|
+
/**
|
|
311
|
+
* Result from spawnWithShadow
|
|
312
|
+
*/
|
|
313
|
+
export declare const SpawnWithShadowResultSchema: z.ZodObject<{
|
|
314
|
+
success: z.ZodBoolean;
|
|
315
|
+
/** Primary agent spawn result */
|
|
316
|
+
primary: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
success: z.ZodBoolean;
|
|
318
|
+
name: z.ZodString;
|
|
319
|
+
/** PID of the spawned process (for pty-based workers) */
|
|
320
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
321
|
+
error: z.ZodOptional<z.ZodString>;
|
|
322
|
+
/** Policy decision details if spawn was blocked by policy */
|
|
323
|
+
policyDecision: z.ZodOptional<z.ZodObject<{
|
|
324
|
+
allowed: z.ZodBoolean;
|
|
325
|
+
reason: z.ZodString;
|
|
326
|
+
policySource: z.ZodEnum<["repo", "local", "workspace", "default"]>;
|
|
327
|
+
}, "strip", z.ZodTypeAny, {
|
|
328
|
+
allowed: boolean;
|
|
329
|
+
reason: string;
|
|
330
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
331
|
+
}, {
|
|
332
|
+
allowed: boolean;
|
|
333
|
+
reason: string;
|
|
334
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
335
|
+
}>>;
|
|
336
|
+
}, "strip", z.ZodTypeAny, {
|
|
337
|
+
name: string;
|
|
338
|
+
success: boolean;
|
|
339
|
+
pid?: number | undefined;
|
|
340
|
+
error?: string | undefined;
|
|
341
|
+
policyDecision?: {
|
|
342
|
+
allowed: boolean;
|
|
343
|
+
reason: string;
|
|
344
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
345
|
+
} | undefined;
|
|
346
|
+
}, {
|
|
347
|
+
name: string;
|
|
348
|
+
success: boolean;
|
|
349
|
+
pid?: number | undefined;
|
|
350
|
+
error?: string | undefined;
|
|
351
|
+
policyDecision?: {
|
|
352
|
+
allowed: boolean;
|
|
353
|
+
reason: string;
|
|
354
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
355
|
+
} | undefined;
|
|
356
|
+
}>>;
|
|
357
|
+
/** Shadow agent spawn result */
|
|
358
|
+
shadow: z.ZodOptional<z.ZodObject<{
|
|
359
|
+
success: z.ZodBoolean;
|
|
360
|
+
name: z.ZodString;
|
|
361
|
+
/** PID of the spawned process (for pty-based workers) */
|
|
362
|
+
pid: z.ZodOptional<z.ZodNumber>;
|
|
363
|
+
error: z.ZodOptional<z.ZodString>;
|
|
364
|
+
/** Policy decision details if spawn was blocked by policy */
|
|
365
|
+
policyDecision: z.ZodOptional<z.ZodObject<{
|
|
366
|
+
allowed: z.ZodBoolean;
|
|
367
|
+
reason: z.ZodString;
|
|
368
|
+
policySource: z.ZodEnum<["repo", "local", "workspace", "default"]>;
|
|
369
|
+
}, "strip", z.ZodTypeAny, {
|
|
370
|
+
allowed: boolean;
|
|
371
|
+
reason: string;
|
|
372
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
373
|
+
}, {
|
|
374
|
+
allowed: boolean;
|
|
375
|
+
reason: string;
|
|
376
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
377
|
+
}>>;
|
|
378
|
+
}, "strip", z.ZodTypeAny, {
|
|
379
|
+
name: string;
|
|
380
|
+
success: boolean;
|
|
381
|
+
pid?: number | undefined;
|
|
382
|
+
error?: string | undefined;
|
|
383
|
+
policyDecision?: {
|
|
384
|
+
allowed: boolean;
|
|
385
|
+
reason: string;
|
|
386
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
387
|
+
} | undefined;
|
|
388
|
+
}, {
|
|
389
|
+
name: string;
|
|
390
|
+
success: boolean;
|
|
391
|
+
pid?: number | undefined;
|
|
392
|
+
error?: string | undefined;
|
|
393
|
+
policyDecision?: {
|
|
394
|
+
allowed: boolean;
|
|
395
|
+
reason: string;
|
|
396
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
397
|
+
} | undefined;
|
|
398
|
+
}>>;
|
|
399
|
+
/** Error message if overall operation failed */
|
|
400
|
+
error: z.ZodOptional<z.ZodString>;
|
|
401
|
+
}, "strip", z.ZodTypeAny, {
|
|
402
|
+
success: boolean;
|
|
403
|
+
error?: string | undefined;
|
|
404
|
+
primary?: {
|
|
405
|
+
name: string;
|
|
406
|
+
success: boolean;
|
|
407
|
+
pid?: number | undefined;
|
|
408
|
+
error?: string | undefined;
|
|
409
|
+
policyDecision?: {
|
|
410
|
+
allowed: boolean;
|
|
411
|
+
reason: string;
|
|
412
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
413
|
+
} | undefined;
|
|
414
|
+
} | undefined;
|
|
415
|
+
shadow?: {
|
|
416
|
+
name: string;
|
|
417
|
+
success: boolean;
|
|
418
|
+
pid?: number | undefined;
|
|
419
|
+
error?: string | undefined;
|
|
420
|
+
policyDecision?: {
|
|
421
|
+
allowed: boolean;
|
|
422
|
+
reason: string;
|
|
423
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
424
|
+
} | undefined;
|
|
425
|
+
} | undefined;
|
|
426
|
+
}, {
|
|
427
|
+
success: boolean;
|
|
428
|
+
error?: string | undefined;
|
|
429
|
+
primary?: {
|
|
430
|
+
name: string;
|
|
431
|
+
success: boolean;
|
|
432
|
+
pid?: number | undefined;
|
|
433
|
+
error?: string | undefined;
|
|
434
|
+
policyDecision?: {
|
|
435
|
+
allowed: boolean;
|
|
436
|
+
reason: string;
|
|
437
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
438
|
+
} | undefined;
|
|
439
|
+
} | undefined;
|
|
440
|
+
shadow?: {
|
|
441
|
+
name: string;
|
|
442
|
+
success: boolean;
|
|
443
|
+
pid?: number | undefined;
|
|
444
|
+
error?: string | undefined;
|
|
445
|
+
policyDecision?: {
|
|
446
|
+
allowed: boolean;
|
|
447
|
+
reason: string;
|
|
448
|
+
policySource: "repo" | "local" | "workspace" | "default";
|
|
449
|
+
} | undefined;
|
|
450
|
+
} | undefined;
|
|
451
|
+
}>;
|
|
452
|
+
export type SpawnWithShadowResult = z.infer<typeof SpawnWithShadowResultSchema>;
|
|
453
|
+
/**
|
|
454
|
+
* Project configuration for multi-project orchestration
|
|
455
|
+
*/
|
|
456
|
+
export declare const ProjectConfigSchema: z.ZodObject<{
|
|
457
|
+
/** Absolute path to project root */
|
|
458
|
+
path: z.ZodString;
|
|
459
|
+
/** Project identifier (derived from path hash) */
|
|
460
|
+
id: z.ZodString;
|
|
461
|
+
/** Socket path for this project's daemon */
|
|
462
|
+
socketPath: z.ZodString;
|
|
463
|
+
/** Lead agent name (auto-generated from dirname if not specified) */
|
|
464
|
+
leadName: z.ZodString;
|
|
465
|
+
/** CLI tool to use (default: claude) */
|
|
466
|
+
cli: z.ZodString;
|
|
467
|
+
}, "strip", z.ZodTypeAny, {
|
|
468
|
+
path: string;
|
|
469
|
+
cli: string;
|
|
470
|
+
id: string;
|
|
471
|
+
socketPath: string;
|
|
472
|
+
leadName: string;
|
|
473
|
+
}, {
|
|
474
|
+
path: string;
|
|
475
|
+
cli: string;
|
|
476
|
+
id: string;
|
|
477
|
+
socketPath: string;
|
|
478
|
+
leadName: string;
|
|
479
|
+
}>;
|
|
480
|
+
export type ProjectConfig = z.infer<typeof ProjectConfigSchema>;
|
|
481
|
+
/**
|
|
482
|
+
* Bridge configuration for multi-project coordination
|
|
483
|
+
*/
|
|
484
|
+
export declare const BridgeConfigSchema: z.ZodObject<{
|
|
485
|
+
/** Projects to bridge */
|
|
486
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
487
|
+
/** Absolute path to project root */
|
|
488
|
+
path: z.ZodString;
|
|
489
|
+
/** Project identifier (derived from path hash) */
|
|
490
|
+
id: z.ZodString;
|
|
491
|
+
/** Socket path for this project's daemon */
|
|
492
|
+
socketPath: z.ZodString;
|
|
493
|
+
/** Lead agent name (auto-generated from dirname if not specified) */
|
|
494
|
+
leadName: z.ZodString;
|
|
495
|
+
/** CLI tool to use (default: claude) */
|
|
496
|
+
cli: z.ZodString;
|
|
497
|
+
}, "strip", z.ZodTypeAny, {
|
|
498
|
+
path: string;
|
|
499
|
+
cli: string;
|
|
500
|
+
id: string;
|
|
501
|
+
socketPath: string;
|
|
502
|
+
leadName: string;
|
|
503
|
+
}, {
|
|
504
|
+
path: string;
|
|
505
|
+
cli: string;
|
|
506
|
+
id: string;
|
|
507
|
+
socketPath: string;
|
|
508
|
+
leadName: string;
|
|
509
|
+
}>, "many">;
|
|
510
|
+
/** CLI override for all projects */
|
|
511
|
+
cliOverride: z.ZodOptional<z.ZodString>;
|
|
512
|
+
}, "strip", z.ZodTypeAny, {
|
|
513
|
+
projects: {
|
|
514
|
+
path: string;
|
|
515
|
+
cli: string;
|
|
516
|
+
id: string;
|
|
517
|
+
socketPath: string;
|
|
518
|
+
leadName: string;
|
|
519
|
+
}[];
|
|
520
|
+
cliOverride?: string | undefined;
|
|
521
|
+
}, {
|
|
522
|
+
projects: {
|
|
523
|
+
path: string;
|
|
524
|
+
cli: string;
|
|
525
|
+
id: string;
|
|
526
|
+
socketPath: string;
|
|
527
|
+
leadName: string;
|
|
528
|
+
}[];
|
|
529
|
+
cliOverride?: string | undefined;
|
|
530
|
+
}>;
|
|
531
|
+
export type BridgeConfig = z.infer<typeof BridgeConfigSchema>;
|
|
532
|
+
/**
|
|
533
|
+
* Lead agent information
|
|
534
|
+
*/
|
|
535
|
+
export declare const LeadInfoSchema: z.ZodObject<{
|
|
536
|
+
/** Lead agent name */
|
|
537
|
+
name: z.ZodString;
|
|
538
|
+
/** Project this lead manages */
|
|
539
|
+
projectId: z.ZodString;
|
|
540
|
+
/** Whether lead is currently connected */
|
|
541
|
+
connected: z.ZodBoolean;
|
|
542
|
+
}, "strip", z.ZodTypeAny, {
|
|
543
|
+
name: string;
|
|
544
|
+
projectId: string;
|
|
545
|
+
connected: boolean;
|
|
546
|
+
}, {
|
|
547
|
+
name: string;
|
|
548
|
+
projectId: string;
|
|
549
|
+
connected: boolean;
|
|
550
|
+
}>;
|
|
551
|
+
export type LeadInfo = z.infer<typeof LeadInfoSchema>;
|
|
552
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,oBAAoB,8FAM/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,sBAAsB,8CAA4C,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,gBAAg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