@xiaolei.shawn/mcp-server 0.2.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/LICENSE +21 -0
- package/README.md +159 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.js +63 -0
- package/dist/dashboard.d.ts +4 -0
- package/dist/dashboard.js +401 -0
- package/dist/event-envelope.d.ts +33 -0
- package/dist/event-envelope.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +147 -0
- package/dist/store.d.ts +70 -0
- package/dist/store.js +254 -0
- package/dist/tools.d.ts +661 -0
- package/dist/tools.js +783 -0
- package/package.json +59 -0
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,661 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
type ToolResponse = {
|
|
3
|
+
content: Array<{
|
|
4
|
+
type: "text";
|
|
5
|
+
text: string;
|
|
6
|
+
}>;
|
|
7
|
+
isError?: true;
|
|
8
|
+
};
|
|
9
|
+
declare const sessionStartSchema: z.ZodObject<{
|
|
10
|
+
goal: z.ZodString;
|
|
11
|
+
user_prompt: z.ZodOptional<z.ZodString>;
|
|
12
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
13
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, "strict", z.ZodTypeAny, {
|
|
15
|
+
goal: string;
|
|
16
|
+
user_prompt?: string | undefined;
|
|
17
|
+
repo?: string | undefined;
|
|
18
|
+
branch?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
goal: string;
|
|
21
|
+
user_prompt?: string | undefined;
|
|
22
|
+
repo?: string | undefined;
|
|
23
|
+
branch?: string | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
declare const intentSchema: z.ZodObject<{
|
|
26
|
+
title: z.ZodString;
|
|
27
|
+
description: z.ZodOptional<z.ZodString>;
|
|
28
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
}, "strict", z.ZodTypeAny, {
|
|
30
|
+
title: string;
|
|
31
|
+
priority?: number | undefined;
|
|
32
|
+
description?: string | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
title: string;
|
|
35
|
+
priority?: number | undefined;
|
|
36
|
+
description?: string | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
declare const activitySchema: z.ZodObject<{
|
|
39
|
+
category: z.ZodEnum<["file", "tool", "search", "execution"]>;
|
|
40
|
+
action: z.ZodString;
|
|
41
|
+
target: z.ZodOptional<z.ZodString>;
|
|
42
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
43
|
+
}, "strict", z.ZodTypeAny, {
|
|
44
|
+
action: string;
|
|
45
|
+
category: "search" | "file" | "tool" | "execution";
|
|
46
|
+
details?: Record<string, unknown> | undefined;
|
|
47
|
+
target?: string | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
action: string;
|
|
50
|
+
category: "search" | "file" | "tool" | "execution";
|
|
51
|
+
details?: Record<string, unknown> | undefined;
|
|
52
|
+
target?: string | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
declare const decisionSchema: z.ZodObject<{
|
|
55
|
+
summary: z.ZodString;
|
|
56
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
57
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
58
|
+
chosen_option: z.ZodOptional<z.ZodString>;
|
|
59
|
+
reversibility: z.ZodOptional<z.ZodEnum<["easy", "medium", "hard"]>>;
|
|
60
|
+
}, "strict", z.ZodTypeAny, {
|
|
61
|
+
summary: string;
|
|
62
|
+
options?: string[] | undefined;
|
|
63
|
+
rationale?: string | undefined;
|
|
64
|
+
chosen_option?: string | undefined;
|
|
65
|
+
reversibility?: "medium" | "easy" | "hard" | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
summary: string;
|
|
68
|
+
options?: string[] | undefined;
|
|
69
|
+
rationale?: string | undefined;
|
|
70
|
+
chosen_option?: string | undefined;
|
|
71
|
+
reversibility?: "medium" | "easy" | "hard" | undefined;
|
|
72
|
+
}>;
|
|
73
|
+
declare const assumptionSchema: z.ZodObject<{
|
|
74
|
+
statement: z.ZodString;
|
|
75
|
+
validated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"unknown">]>>;
|
|
76
|
+
risk: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
77
|
+
}, "strict", z.ZodTypeAny, {
|
|
78
|
+
statement: string;
|
|
79
|
+
validated?: boolean | "unknown" | undefined;
|
|
80
|
+
risk?: "high" | "low" | "medium" | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
statement: string;
|
|
83
|
+
validated?: boolean | "unknown" | undefined;
|
|
84
|
+
risk?: "high" | "low" | "medium" | undefined;
|
|
85
|
+
}>;
|
|
86
|
+
declare const verificationSchema: z.ZodObject<{
|
|
87
|
+
type: z.ZodEnum<["test", "lint", "typecheck", "manual"]>;
|
|
88
|
+
result: z.ZodEnum<["pass", "fail", "unknown"]>;
|
|
89
|
+
details: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, "strict", z.ZodTypeAny, {
|
|
91
|
+
type: "manual" | "test" | "lint" | "typecheck";
|
|
92
|
+
result: "unknown" | "fail" | "pass";
|
|
93
|
+
details?: string | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
type: "manual" | "test" | "lint" | "typecheck";
|
|
96
|
+
result: "unknown" | "fail" | "pass";
|
|
97
|
+
details?: string | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
declare const sessionEndSchema: z.ZodObject<{
|
|
100
|
+
outcome: z.ZodEnum<["completed", "partial", "failed", "aborted"]>;
|
|
101
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, "strict", z.ZodTypeAny, {
|
|
103
|
+
outcome: "failed" | "completed" | "partial" | "aborted";
|
|
104
|
+
summary?: string | undefined;
|
|
105
|
+
}, {
|
|
106
|
+
outcome: "failed" | "completed" | "partial" | "aborted";
|
|
107
|
+
summary?: string | undefined;
|
|
108
|
+
}>;
|
|
109
|
+
declare const gatewayBeginSchema: z.ZodObject<{
|
|
110
|
+
goal: z.ZodString;
|
|
111
|
+
user_prompt: z.ZodOptional<z.ZodString>;
|
|
112
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
113
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
114
|
+
intent_title: z.ZodOptional<z.ZodString>;
|
|
115
|
+
intent_description: z.ZodOptional<z.ZodString>;
|
|
116
|
+
intent_priority: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
}, "strict", z.ZodTypeAny, {
|
|
118
|
+
goal: string;
|
|
119
|
+
user_prompt?: string | undefined;
|
|
120
|
+
repo?: string | undefined;
|
|
121
|
+
branch?: string | undefined;
|
|
122
|
+
intent_title?: string | undefined;
|
|
123
|
+
intent_description?: string | undefined;
|
|
124
|
+
intent_priority?: number | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
goal: string;
|
|
127
|
+
user_prompt?: string | undefined;
|
|
128
|
+
repo?: string | undefined;
|
|
129
|
+
branch?: string | undefined;
|
|
130
|
+
intent_title?: string | undefined;
|
|
131
|
+
intent_description?: string | undefined;
|
|
132
|
+
intent_priority?: number | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
declare const gatewayActSchema: z.ZodObject<{
|
|
135
|
+
op: z.ZodEnum<["file", "tool", "search", "execution", "intent", "decision", "assumption", "verification"]>;
|
|
136
|
+
action: z.ZodOptional<z.ZodString>;
|
|
137
|
+
target: z.ZodOptional<z.ZodString>;
|
|
138
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
139
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
140
|
+
model: z.ZodOptional<z.ZodString>;
|
|
141
|
+
prompt_tokens: z.ZodOptional<z.ZodNumber>;
|
|
142
|
+
completion_tokens: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
estimated_cost_usd: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
}, "strict", z.ZodTypeAny, {
|
|
146
|
+
model?: string | undefined;
|
|
147
|
+
prompt_tokens?: number | undefined;
|
|
148
|
+
completion_tokens?: number | undefined;
|
|
149
|
+
total_tokens?: number | undefined;
|
|
150
|
+
estimated_cost_usd?: number | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
model?: string | undefined;
|
|
153
|
+
prompt_tokens?: number | undefined;
|
|
154
|
+
completion_tokens?: number | undefined;
|
|
155
|
+
total_tokens?: number | undefined;
|
|
156
|
+
estimated_cost_usd?: number | undefined;
|
|
157
|
+
}>>;
|
|
158
|
+
intent: z.ZodOptional<z.ZodObject<{
|
|
159
|
+
title: z.ZodString;
|
|
160
|
+
description: z.ZodOptional<z.ZodString>;
|
|
161
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
}, "strict", z.ZodTypeAny, {
|
|
163
|
+
title: string;
|
|
164
|
+
priority?: number | undefined;
|
|
165
|
+
description?: string | undefined;
|
|
166
|
+
}, {
|
|
167
|
+
title: string;
|
|
168
|
+
priority?: number | undefined;
|
|
169
|
+
description?: string | undefined;
|
|
170
|
+
}>>;
|
|
171
|
+
decision: z.ZodOptional<z.ZodObject<{
|
|
172
|
+
summary: z.ZodString;
|
|
173
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
174
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
175
|
+
chosen_option: z.ZodOptional<z.ZodString>;
|
|
176
|
+
reversibility: z.ZodOptional<z.ZodEnum<["easy", "medium", "hard"]>>;
|
|
177
|
+
}, "strict", z.ZodTypeAny, {
|
|
178
|
+
summary: string;
|
|
179
|
+
options?: string[] | undefined;
|
|
180
|
+
rationale?: string | undefined;
|
|
181
|
+
chosen_option?: string | undefined;
|
|
182
|
+
reversibility?: "medium" | "easy" | "hard" | undefined;
|
|
183
|
+
}, {
|
|
184
|
+
summary: string;
|
|
185
|
+
options?: string[] | undefined;
|
|
186
|
+
rationale?: string | undefined;
|
|
187
|
+
chosen_option?: string | undefined;
|
|
188
|
+
reversibility?: "medium" | "easy" | "hard" | undefined;
|
|
189
|
+
}>>;
|
|
190
|
+
assumption: z.ZodOptional<z.ZodObject<{
|
|
191
|
+
statement: z.ZodString;
|
|
192
|
+
validated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"unknown">]>>;
|
|
193
|
+
risk: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
194
|
+
}, "strict", z.ZodTypeAny, {
|
|
195
|
+
statement: string;
|
|
196
|
+
validated?: boolean | "unknown" | undefined;
|
|
197
|
+
risk?: "high" | "low" | "medium" | undefined;
|
|
198
|
+
}, {
|
|
199
|
+
statement: string;
|
|
200
|
+
validated?: boolean | "unknown" | undefined;
|
|
201
|
+
risk?: "high" | "low" | "medium" | undefined;
|
|
202
|
+
}>>;
|
|
203
|
+
verification: z.ZodOptional<z.ZodObject<{
|
|
204
|
+
type: z.ZodEnum<["test", "lint", "typecheck", "manual"]>;
|
|
205
|
+
result: z.ZodEnum<["pass", "fail", "unknown"]>;
|
|
206
|
+
details: z.ZodOptional<z.ZodString>;
|
|
207
|
+
}, "strict", z.ZodTypeAny, {
|
|
208
|
+
type: "manual" | "test" | "lint" | "typecheck";
|
|
209
|
+
result: "unknown" | "fail" | "pass";
|
|
210
|
+
details?: string | undefined;
|
|
211
|
+
}, {
|
|
212
|
+
type: "manual" | "test" | "lint" | "typecheck";
|
|
213
|
+
result: "unknown" | "fail" | "pass";
|
|
214
|
+
details?: string | undefined;
|
|
215
|
+
}>>;
|
|
216
|
+
visibility: z.ZodOptional<z.ZodEnum<["raw", "review", "debug"]>>;
|
|
217
|
+
}, "strict", z.ZodTypeAny, {
|
|
218
|
+
op: "search" | "file" | "tool" | "intent" | "verification" | "execution" | "decision" | "assumption";
|
|
219
|
+
visibility?: "raw" | "review" | "debug" | undefined;
|
|
220
|
+
details?: Record<string, unknown> | undefined;
|
|
221
|
+
action?: string | undefined;
|
|
222
|
+
target?: string | undefined;
|
|
223
|
+
intent?: {
|
|
224
|
+
title: string;
|
|
225
|
+
priority?: number | undefined;
|
|
226
|
+
description?: string | undefined;
|
|
227
|
+
} | undefined;
|
|
228
|
+
verification?: {
|
|
229
|
+
type: "manual" | "test" | "lint" | "typecheck";
|
|
230
|
+
result: "unknown" | "fail" | "pass";
|
|
231
|
+
details?: string | undefined;
|
|
232
|
+
} | undefined;
|
|
233
|
+
decision?: {
|
|
234
|
+
summary: string;
|
|
235
|
+
options?: string[] | undefined;
|
|
236
|
+
rationale?: string | undefined;
|
|
237
|
+
chosen_option?: string | undefined;
|
|
238
|
+
reversibility?: "medium" | "easy" | "hard" | undefined;
|
|
239
|
+
} | undefined;
|
|
240
|
+
assumption?: {
|
|
241
|
+
statement: string;
|
|
242
|
+
validated?: boolean | "unknown" | undefined;
|
|
243
|
+
risk?: "high" | "low" | "medium" | undefined;
|
|
244
|
+
} | undefined;
|
|
245
|
+
usage?: {
|
|
246
|
+
model?: string | undefined;
|
|
247
|
+
prompt_tokens?: number | undefined;
|
|
248
|
+
completion_tokens?: number | undefined;
|
|
249
|
+
total_tokens?: number | undefined;
|
|
250
|
+
estimated_cost_usd?: number | undefined;
|
|
251
|
+
} | undefined;
|
|
252
|
+
}, {
|
|
253
|
+
op: "search" | "file" | "tool" | "intent" | "verification" | "execution" | "decision" | "assumption";
|
|
254
|
+
visibility?: "raw" | "review" | "debug" | undefined;
|
|
255
|
+
details?: Record<string, unknown> | undefined;
|
|
256
|
+
action?: string | undefined;
|
|
257
|
+
target?: string | undefined;
|
|
258
|
+
intent?: {
|
|
259
|
+
title: string;
|
|
260
|
+
priority?: number | undefined;
|
|
261
|
+
description?: string | undefined;
|
|
262
|
+
} | undefined;
|
|
263
|
+
verification?: {
|
|
264
|
+
type: "manual" | "test" | "lint" | "typecheck";
|
|
265
|
+
result: "unknown" | "fail" | "pass";
|
|
266
|
+
details?: string | undefined;
|
|
267
|
+
} | undefined;
|
|
268
|
+
decision?: {
|
|
269
|
+
summary: string;
|
|
270
|
+
options?: string[] | undefined;
|
|
271
|
+
rationale?: string | undefined;
|
|
272
|
+
chosen_option?: string | undefined;
|
|
273
|
+
reversibility?: "medium" | "easy" | "hard" | undefined;
|
|
274
|
+
} | undefined;
|
|
275
|
+
assumption?: {
|
|
276
|
+
statement: string;
|
|
277
|
+
validated?: boolean | "unknown" | undefined;
|
|
278
|
+
risk?: "high" | "low" | "medium" | undefined;
|
|
279
|
+
} | undefined;
|
|
280
|
+
usage?: {
|
|
281
|
+
model?: string | undefined;
|
|
282
|
+
prompt_tokens?: number | undefined;
|
|
283
|
+
completion_tokens?: number | undefined;
|
|
284
|
+
total_tokens?: number | undefined;
|
|
285
|
+
estimated_cost_usd?: number | undefined;
|
|
286
|
+
} | undefined;
|
|
287
|
+
}>;
|
|
288
|
+
declare const gatewayEndSchema: z.ZodObject<{
|
|
289
|
+
outcome: z.ZodEnum<["completed", "partial", "failed", "aborted"]>;
|
|
290
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
291
|
+
}, "strict", z.ZodTypeAny, {
|
|
292
|
+
outcome: "failed" | "completed" | "partial" | "aborted";
|
|
293
|
+
summary?: string | undefined;
|
|
294
|
+
}, {
|
|
295
|
+
outcome: "failed" | "completed" | "partial" | "aborted";
|
|
296
|
+
summary?: string | undefined;
|
|
297
|
+
}>;
|
|
298
|
+
export declare const GATEWAY_RULES: {
|
|
299
|
+
readonly file: {
|
|
300
|
+
readonly maps_to_tool: "record_activity";
|
|
301
|
+
readonly emits_kind: "file_op";
|
|
302
|
+
readonly required_fields: readonly ["action"];
|
|
303
|
+
readonly default_visibility: "raw";
|
|
304
|
+
};
|
|
305
|
+
readonly tool: {
|
|
306
|
+
readonly maps_to_tool: "record_activity";
|
|
307
|
+
readonly emits_kind: "tool_call";
|
|
308
|
+
readonly required_fields: readonly ["action"];
|
|
309
|
+
readonly default_visibility: "raw";
|
|
310
|
+
};
|
|
311
|
+
readonly search: {
|
|
312
|
+
readonly maps_to_tool: "record_activity";
|
|
313
|
+
readonly emits_kind: "tool_call";
|
|
314
|
+
readonly required_fields: readonly ["action"];
|
|
315
|
+
readonly default_visibility: "raw";
|
|
316
|
+
};
|
|
317
|
+
readonly execution: {
|
|
318
|
+
readonly maps_to_tool: "record_activity";
|
|
319
|
+
readonly emits_kind: "tool_call";
|
|
320
|
+
readonly required_fields: readonly ["action"];
|
|
321
|
+
readonly default_visibility: "raw";
|
|
322
|
+
};
|
|
323
|
+
readonly intent: {
|
|
324
|
+
readonly maps_to_tool: "record_intent";
|
|
325
|
+
readonly emits_kind: "intent";
|
|
326
|
+
readonly required_fields: readonly ["intent.title"];
|
|
327
|
+
readonly default_visibility: "review";
|
|
328
|
+
};
|
|
329
|
+
readonly decision: {
|
|
330
|
+
readonly maps_to_tool: "record_decision";
|
|
331
|
+
readonly emits_kind: "decision";
|
|
332
|
+
readonly required_fields: readonly ["decision.summary"];
|
|
333
|
+
readonly default_visibility: "review";
|
|
334
|
+
};
|
|
335
|
+
readonly assumption: {
|
|
336
|
+
readonly maps_to_tool: "record_assumption";
|
|
337
|
+
readonly emits_kind: "assumption";
|
|
338
|
+
readonly required_fields: readonly ["assumption.statement"];
|
|
339
|
+
readonly default_visibility: "review";
|
|
340
|
+
};
|
|
341
|
+
readonly verification: {
|
|
342
|
+
readonly maps_to_tool: "record_verification";
|
|
343
|
+
readonly emits_kind: "verification";
|
|
344
|
+
readonly required_fields: readonly ["verification.type", "verification.result"];
|
|
345
|
+
readonly default_visibility: "review";
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
export declare function handleRecordSessionStart(raw: z.infer<typeof sessionStartSchema>): Promise<ToolResponse>;
|
|
349
|
+
export declare function handleRecordIntent(raw: z.infer<typeof intentSchema>): Promise<ToolResponse>;
|
|
350
|
+
export declare function handleRecordActivity(raw: z.infer<typeof activitySchema>): Promise<ToolResponse>;
|
|
351
|
+
export declare function handleRecordDecision(raw: z.infer<typeof decisionSchema>): Promise<ToolResponse>;
|
|
352
|
+
export declare function handleRecordAssumption(raw: z.infer<typeof assumptionSchema>): Promise<ToolResponse>;
|
|
353
|
+
export declare function handleRecordVerification(raw: z.infer<typeof verificationSchema>): Promise<ToolResponse>;
|
|
354
|
+
export declare function handleRecordSessionEnd(raw: z.infer<typeof sessionEndSchema>): Promise<ToolResponse>;
|
|
355
|
+
export declare function handleGatewayBeginRun(raw: z.infer<typeof gatewayBeginSchema>): Promise<ToolResponse>;
|
|
356
|
+
export declare function handleGatewayAct(raw: z.infer<typeof gatewayActSchema>): Promise<ToolResponse>;
|
|
357
|
+
export declare function handleGatewayEndRun(raw: z.infer<typeof gatewayEndSchema>): Promise<ToolResponse>;
|
|
358
|
+
export declare const toolSchemas: {
|
|
359
|
+
readonly record_session_start: {
|
|
360
|
+
readonly inputSchema: {
|
|
361
|
+
goal: z.ZodString;
|
|
362
|
+
user_prompt: z.ZodOptional<z.ZodString>;
|
|
363
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
364
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
readonly record_intent: {
|
|
368
|
+
readonly inputSchema: {
|
|
369
|
+
title: z.ZodString;
|
|
370
|
+
description: z.ZodOptional<z.ZodString>;
|
|
371
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
readonly record_activity: {
|
|
375
|
+
readonly inputSchema: {
|
|
376
|
+
category: z.ZodEnum<["file", "tool", "search", "execution"]>;
|
|
377
|
+
action: z.ZodString;
|
|
378
|
+
target: z.ZodOptional<z.ZodString>;
|
|
379
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
readonly record_decision: {
|
|
383
|
+
readonly inputSchema: {
|
|
384
|
+
summary: z.ZodString;
|
|
385
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
386
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
387
|
+
chosen_option: z.ZodOptional<z.ZodString>;
|
|
388
|
+
reversibility: z.ZodOptional<z.ZodEnum<["easy", "medium", "hard"]>>;
|
|
389
|
+
};
|
|
390
|
+
};
|
|
391
|
+
readonly record_assumption: {
|
|
392
|
+
readonly inputSchema: {
|
|
393
|
+
statement: z.ZodString;
|
|
394
|
+
validated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"unknown">]>>;
|
|
395
|
+
risk: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
readonly record_verification: {
|
|
399
|
+
readonly inputSchema: {
|
|
400
|
+
type: z.ZodEnum<["test", "lint", "typecheck", "manual"]>;
|
|
401
|
+
result: z.ZodEnum<["pass", "fail", "unknown"]>;
|
|
402
|
+
details: z.ZodOptional<z.ZodString>;
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
readonly record_session_end: {
|
|
406
|
+
readonly inputSchema: {
|
|
407
|
+
outcome: z.ZodEnum<["completed", "partial", "failed", "aborted"]>;
|
|
408
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
409
|
+
};
|
|
410
|
+
};
|
|
411
|
+
readonly gateway_begin_run: {
|
|
412
|
+
readonly inputSchema: {
|
|
413
|
+
goal: z.ZodString;
|
|
414
|
+
user_prompt: z.ZodOptional<z.ZodString>;
|
|
415
|
+
repo: z.ZodOptional<z.ZodString>;
|
|
416
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
417
|
+
intent_title: z.ZodOptional<z.ZodString>;
|
|
418
|
+
intent_description: z.ZodOptional<z.ZodString>;
|
|
419
|
+
intent_priority: z.ZodOptional<z.ZodNumber>;
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
readonly gateway_act: {
|
|
423
|
+
readonly inputSchema: {
|
|
424
|
+
op: z.ZodEnum<["file", "tool", "search", "execution", "intent", "decision", "assumption", "verification"]>;
|
|
425
|
+
action: z.ZodOptional<z.ZodString>;
|
|
426
|
+
target: z.ZodOptional<z.ZodString>;
|
|
427
|
+
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
428
|
+
usage: z.ZodOptional<z.ZodObject<{
|
|
429
|
+
model: z.ZodOptional<z.ZodString>;
|
|
430
|
+
prompt_tokens: z.ZodOptional<z.ZodNumber>;
|
|
431
|
+
completion_tokens: z.ZodOptional<z.ZodNumber>;
|
|
432
|
+
total_tokens: z.ZodOptional<z.ZodNumber>;
|
|
433
|
+
estimated_cost_usd: z.ZodOptional<z.ZodNumber>;
|
|
434
|
+
}, "strict", z.ZodTypeAny, {
|
|
435
|
+
model?: string | undefined;
|
|
436
|
+
prompt_tokens?: number | undefined;
|
|
437
|
+
completion_tokens?: number | undefined;
|
|
438
|
+
total_tokens?: number | undefined;
|
|
439
|
+
estimated_cost_usd?: number | undefined;
|
|
440
|
+
}, {
|
|
441
|
+
model?: string | undefined;
|
|
442
|
+
prompt_tokens?: number | undefined;
|
|
443
|
+
completion_tokens?: number | undefined;
|
|
444
|
+
total_tokens?: number | undefined;
|
|
445
|
+
estimated_cost_usd?: number | undefined;
|
|
446
|
+
}>>;
|
|
447
|
+
intent: z.ZodOptional<z.ZodObject<{
|
|
448
|
+
title: z.ZodString;
|
|
449
|
+
description: z.ZodOptional<z.ZodString>;
|
|
450
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
451
|
+
}, "strict", z.ZodTypeAny, {
|
|
452
|
+
title: string;
|
|
453
|
+
priority?: number | undefined;
|
|
454
|
+
description?: string | undefined;
|
|
455
|
+
}, {
|
|
456
|
+
title: string;
|
|
457
|
+
priority?: number | undefined;
|
|
458
|
+
description?: string | undefined;
|
|
459
|
+
}>>;
|
|
460
|
+
decision: z.ZodOptional<z.ZodObject<{
|
|
461
|
+
summary: z.ZodString;
|
|
462
|
+
rationale: z.ZodOptional<z.ZodString>;
|
|
463
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
464
|
+
chosen_option: z.ZodOptional<z.ZodString>;
|
|
465
|
+
reversibility: z.ZodOptional<z.ZodEnum<["easy", "medium", "hard"]>>;
|
|
466
|
+
}, "strict", z.ZodTypeAny, {
|
|
467
|
+
summary: string;
|
|
468
|
+
options?: string[] | undefined;
|
|
469
|
+
rationale?: string | undefined;
|
|
470
|
+
chosen_option?: string | undefined;
|
|
471
|
+
reversibility?: "medium" | "easy" | "hard" | undefined;
|
|
472
|
+
}, {
|
|
473
|
+
summary: string;
|
|
474
|
+
options?: string[] | undefined;
|
|
475
|
+
rationale?: string | undefined;
|
|
476
|
+
chosen_option?: string | undefined;
|
|
477
|
+
reversibility?: "medium" | "easy" | "hard" | undefined;
|
|
478
|
+
}>>;
|
|
479
|
+
assumption: z.ZodOptional<z.ZodObject<{
|
|
480
|
+
statement: z.ZodString;
|
|
481
|
+
validated: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"unknown">]>>;
|
|
482
|
+
risk: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
|
|
483
|
+
}, "strict", z.ZodTypeAny, {
|
|
484
|
+
statement: string;
|
|
485
|
+
validated?: boolean | "unknown" | undefined;
|
|
486
|
+
risk?: "high" | "low" | "medium" | undefined;
|
|
487
|
+
}, {
|
|
488
|
+
statement: string;
|
|
489
|
+
validated?: boolean | "unknown" | undefined;
|
|
490
|
+
risk?: "high" | "low" | "medium" | undefined;
|
|
491
|
+
}>>;
|
|
492
|
+
verification: z.ZodOptional<z.ZodObject<{
|
|
493
|
+
type: z.ZodEnum<["test", "lint", "typecheck", "manual"]>;
|
|
494
|
+
result: z.ZodEnum<["pass", "fail", "unknown"]>;
|
|
495
|
+
details: z.ZodOptional<z.ZodString>;
|
|
496
|
+
}, "strict", z.ZodTypeAny, {
|
|
497
|
+
type: "manual" | "test" | "lint" | "typecheck";
|
|
498
|
+
result: "unknown" | "fail" | "pass";
|
|
499
|
+
details?: string | undefined;
|
|
500
|
+
}, {
|
|
501
|
+
type: "manual" | "test" | "lint" | "typecheck";
|
|
502
|
+
result: "unknown" | "fail" | "pass";
|
|
503
|
+
details?: string | undefined;
|
|
504
|
+
}>>;
|
|
505
|
+
visibility: z.ZodOptional<z.ZodEnum<["raw", "review", "debug"]>>;
|
|
506
|
+
};
|
|
507
|
+
};
|
|
508
|
+
readonly gateway_end_run: {
|
|
509
|
+
readonly inputSchema: {
|
|
510
|
+
outcome: z.ZodEnum<["completed", "partial", "failed", "aborted"]>;
|
|
511
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
export declare const EVENT_EXAMPLES: {
|
|
516
|
+
readonly record_session_start: {
|
|
517
|
+
id: string;
|
|
518
|
+
session_id: string;
|
|
519
|
+
seq: number;
|
|
520
|
+
ts: string;
|
|
521
|
+
kind: string;
|
|
522
|
+
actor: {
|
|
523
|
+
type: "agent";
|
|
524
|
+
};
|
|
525
|
+
payload: {
|
|
526
|
+
goal: string;
|
|
527
|
+
user_prompt: string;
|
|
528
|
+
repo: string;
|
|
529
|
+
branch: string;
|
|
530
|
+
};
|
|
531
|
+
visibility: "review";
|
|
532
|
+
schema_version: number;
|
|
533
|
+
};
|
|
534
|
+
readonly record_intent: {
|
|
535
|
+
id: string;
|
|
536
|
+
session_id: string;
|
|
537
|
+
seq: number;
|
|
538
|
+
ts: string;
|
|
539
|
+
kind: string;
|
|
540
|
+
actor: {
|
|
541
|
+
type: "agent";
|
|
542
|
+
};
|
|
543
|
+
scope: {
|
|
544
|
+
intent_id: string;
|
|
545
|
+
};
|
|
546
|
+
payload: {
|
|
547
|
+
intent_id: string;
|
|
548
|
+
title: string;
|
|
549
|
+
description: string;
|
|
550
|
+
priority: number;
|
|
551
|
+
};
|
|
552
|
+
visibility: "review";
|
|
553
|
+
schema_version: number;
|
|
554
|
+
};
|
|
555
|
+
readonly record_activity: {
|
|
556
|
+
id: string;
|
|
557
|
+
session_id: string;
|
|
558
|
+
seq: number;
|
|
559
|
+
ts: string;
|
|
560
|
+
kind: string;
|
|
561
|
+
actor: {
|
|
562
|
+
type: "agent";
|
|
563
|
+
};
|
|
564
|
+
scope: {
|
|
565
|
+
intent_id: string;
|
|
566
|
+
file: string;
|
|
567
|
+
module: string;
|
|
568
|
+
};
|
|
569
|
+
payload: {
|
|
570
|
+
category: string;
|
|
571
|
+
action: string;
|
|
572
|
+
target: string;
|
|
573
|
+
details: {
|
|
574
|
+
lines_changed: number;
|
|
575
|
+
module: string;
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
visibility: "raw";
|
|
579
|
+
schema_version: number;
|
|
580
|
+
};
|
|
581
|
+
readonly record_decision: {
|
|
582
|
+
id: string;
|
|
583
|
+
session_id: string;
|
|
584
|
+
seq: number;
|
|
585
|
+
ts: string;
|
|
586
|
+
kind: string;
|
|
587
|
+
actor: {
|
|
588
|
+
type: "agent";
|
|
589
|
+
};
|
|
590
|
+
scope: {
|
|
591
|
+
intent_id: string;
|
|
592
|
+
};
|
|
593
|
+
payload: {
|
|
594
|
+
summary: string;
|
|
595
|
+
rationale: string;
|
|
596
|
+
options: string[];
|
|
597
|
+
chosen_option: string;
|
|
598
|
+
reversibility: string;
|
|
599
|
+
};
|
|
600
|
+
visibility: "review";
|
|
601
|
+
schema_version: number;
|
|
602
|
+
};
|
|
603
|
+
readonly record_assumption: {
|
|
604
|
+
id: string;
|
|
605
|
+
session_id: string;
|
|
606
|
+
seq: number;
|
|
607
|
+
ts: string;
|
|
608
|
+
kind: string;
|
|
609
|
+
actor: {
|
|
610
|
+
type: "agent";
|
|
611
|
+
};
|
|
612
|
+
scope: {
|
|
613
|
+
intent_id: string;
|
|
614
|
+
};
|
|
615
|
+
payload: {
|
|
616
|
+
statement: string;
|
|
617
|
+
validated: string;
|
|
618
|
+
risk: string;
|
|
619
|
+
};
|
|
620
|
+
visibility: "review";
|
|
621
|
+
schema_version: number;
|
|
622
|
+
};
|
|
623
|
+
readonly record_verification: {
|
|
624
|
+
id: string;
|
|
625
|
+
session_id: string;
|
|
626
|
+
seq: number;
|
|
627
|
+
ts: string;
|
|
628
|
+
kind: string;
|
|
629
|
+
actor: {
|
|
630
|
+
type: "agent";
|
|
631
|
+
};
|
|
632
|
+
scope: {
|
|
633
|
+
intent_id: string;
|
|
634
|
+
};
|
|
635
|
+
payload: {
|
|
636
|
+
type: string;
|
|
637
|
+
result: string;
|
|
638
|
+
details: string;
|
|
639
|
+
};
|
|
640
|
+
visibility: "review";
|
|
641
|
+
schema_version: number;
|
|
642
|
+
};
|
|
643
|
+
readonly record_session_end: {
|
|
644
|
+
id: string;
|
|
645
|
+
session_id: string;
|
|
646
|
+
seq: number;
|
|
647
|
+
ts: string;
|
|
648
|
+
kind: string;
|
|
649
|
+
actor: {
|
|
650
|
+
type: "agent";
|
|
651
|
+
};
|
|
652
|
+
payload: {
|
|
653
|
+
outcome: string;
|
|
654
|
+
summary: string;
|
|
655
|
+
};
|
|
656
|
+
visibility: "review";
|
|
657
|
+
schema_version: number;
|
|
658
|
+
};
|
|
659
|
+
};
|
|
660
|
+
export declare const AGENT_INSTRUCTIONS: readonly ["Preferred low-friction path: call gateway_begin_run once, gateway_act for every operation, then gateway_end_run once.", "Call record_session_start once before any other tool.", "Call record_intent whenever objective shifts; use one intent per cohesive chunk.", "Use record_activity for every meaningful file/tool/search/execution step.", "Use record_decision for irreversible or high-impact choices.", "Use record_assumption for uncertain premises that affect implementation.", "Use record_verification for tests/lint/typecheck/manual checks with explicit result.", "Call record_session_end exactly once to close the session."];
|
|
661
|
+
export {};
|