@vercel/factory 0.0.3 → 0.0.4

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 (70) hide show
  1. package/dist/approval-h5aj8HYN.d.mts +510 -0
  2. package/dist/blob/index.d.mts +32 -0
  3. package/dist/blob/index.mjs +141 -0
  4. package/dist/blob/index.mjs.map +1 -0
  5. package/dist/connectors/index.d.mts +2 -0
  6. package/dist/connectors/index.mjs +49 -0
  7. package/dist/connectors/index.mjs.map +1 -0
  8. package/dist/driver-Bbd25rNM.mjs +23 -0
  9. package/dist/driver-Bbd25rNM.mjs.map +1 -0
  10. package/dist/driver-CrZsy7sm.d.mts +34 -0
  11. package/dist/eve/index.d.mts +1057 -0
  12. package/dist/eve/index.mjs +777 -0
  13. package/dist/eve/index.mjs.map +1 -0
  14. package/dist/github-5qQPCaXj.d.mts +123 -0
  15. package/dist/github.d.mts +2 -0
  16. package/dist/github.mjs +286 -0
  17. package/dist/github.mjs.map +1 -0
  18. package/dist/id-DwCihQr4.mjs +31 -0
  19. package/dist/id-DwCihQr4.mjs.map +1 -0
  20. package/dist/index-WNGZJRRH.d.mts +67 -0
  21. package/dist/index.d.mts +175 -0
  22. package/dist/index.mjs +882 -0
  23. package/dist/index.mjs.map +1 -0
  24. package/dist/next-page.d.mts +5 -0
  25. package/dist/next-page.mjs +71 -0
  26. package/dist/next-page.mjs.map +1 -0
  27. package/dist/next.d.mts +12 -0
  28. package/dist/{next.js → next.mjs} +13 -14
  29. package/dist/next.mjs.map +1 -0
  30. package/dist/postgres/index.d.mts +137 -0
  31. package/dist/postgres/index.mjs +96 -0
  32. package/dist/postgres/index.mjs.map +1 -0
  33. package/dist/signal-CHVEmzvI.d.mts +59 -0
  34. package/dist/task-Cj7Ei9Nh.mjs +336 -0
  35. package/dist/task-Cj7Ei9Nh.mjs.map +1 -0
  36. package/package.json +25 -22
  37. package/dist/approval-Z7iaWibT.d.ts +0 -541
  38. package/dist/blob/index.d.ts +0 -26
  39. package/dist/blob/index.js +0 -127
  40. package/dist/blob/index.js.map +0 -1
  41. package/dist/chunk-2JFES6BA.js +0 -41
  42. package/dist/chunk-2JFES6BA.js.map +0 -1
  43. package/dist/chunk-CEF6VJZC.js +0 -28
  44. package/dist/chunk-CEF6VJZC.js.map +0 -1
  45. package/dist/chunk-D2XMABG4.js +0 -311
  46. package/dist/chunk-D2XMABG4.js.map +0 -1
  47. package/dist/chunk-EFL4PDDE.js +0 -325
  48. package/dist/chunk-EFL4PDDE.js.map +0 -1
  49. package/dist/common-CaHaEOAS.d.ts +0 -18
  50. package/dist/connectors/index.d.ts +0 -53
  51. package/dist/connectors/index.js +0 -64
  52. package/dist/connectors/index.js.map +0 -1
  53. package/dist/driver-tRNggCCJ.d.ts +0 -32
  54. package/dist/eve/index.d.ts +0 -1053
  55. package/dist/eve/index.js +0 -752
  56. package/dist/eve/index.js.map +0 -1
  57. package/dist/github.d.ts +0 -139
  58. package/dist/github.js +0 -27
  59. package/dist/github.js.map +0 -1
  60. package/dist/index.d.ts +0 -164
  61. package/dist/index.js +0 -940
  62. package/dist/index.js.map +0 -1
  63. package/dist/next-page.d.ts +0 -5
  64. package/dist/next-page.js +0 -75
  65. package/dist/next-page.js.map +0 -1
  66. package/dist/next.d.ts +0 -12
  67. package/dist/next.js.map +0 -1
  68. package/dist/postgres/index.d.ts +0 -137
  69. package/dist/postgres/index.js +0 -118
  70. package/dist/postgres/index.js.map +0 -1
@@ -1,1053 +0,0 @@
1
- import * as eve_hooks from 'eve/hooks';
2
- import * as eve_tools from 'eve/tools';
3
- import { z } from 'zod';
4
- import { F as FactoryStores, A as ApprovalPolicy, a as Finding } from '../approval-Z7iaWibT.js';
5
- import { GitHubReviewComment } from '../github.js';
6
- import '../common-CaHaEOAS.js';
7
- import '../driver-tRNggCCJ.js';
8
-
9
- /** The subset of the eve sandbox handle a credentialed git operation needs. */
10
- interface CommandSandbox {
11
- run(options: {
12
- command: string;
13
- }): PromiseLike<{
14
- stdout: string;
15
- stderr?: string;
16
- exitCode?: number;
17
- }>;
18
- }
19
- interface FetchPullRequestOptions<S extends CommandSandbox = CommandSandbox> {
20
- /**
21
- * Runs one git command against `slug` with a credential the sandbox does not
22
- * otherwise have, and removes it again before resolving. Supplied by the
23
- * app, which owns how credentials are minted and where they are injected;
24
- * the library only decides what is fetched.
25
- */
26
- withCredential: (sandbox: S, slug: string, command: string) => Promise<{
27
- stdout: string;
28
- stderr?: string;
29
- exitCode?: number;
30
- }>;
31
- /** Path of the checkout inside the sandbox. Defaults to `repo`. */
32
- repoPath?: string;
33
- /** Fetch depth for the pull request head. Defaults to 50. */
34
- depth?: number;
35
- }
36
- type FetchPullRequestResult = {
37
- fetched: false;
38
- reason: string;
39
- } | {
40
- fetched: true;
41
- prNumber: number;
42
- prUrl: string;
43
- branch: string;
44
- headSha: string;
45
- };
46
- /**
47
- * The verifier's way in to the change under review. The sandbox has no
48
- * GitHub credential while the agent runs, so trusted code does the one fetch
49
- * the agent cannot: the pull request number and repository come from the
50
- * change record, never from the agent, and the credential is gone again
51
- * before control returns. Mirrors how publication reads commits out of the
52
- * sandbox instead of letting the agent push.
53
- */
54
- declare function fetchPullRequestTool<S extends CommandSandbox>(stores: FactoryStores, options: FetchPullRequestOptions<S>): eve_tools.ToolDefinition<{
55
- changeId: string;
56
- }, FetchPullRequestResult> & {
57
- execute(input: {
58
- changeId: string;
59
- }, ctx: eve_tools.ToolContext): Promise<FetchPullRequestResult>;
60
- };
61
-
62
- declare const mergeConflictPayloadSchema: z.ZodObject<{
63
- repository: z.ZodString;
64
- prNumber: z.ZodNumber;
65
- prUrl: z.ZodURL;
66
- headBranch: z.ZodString;
67
- headSha: z.ZodString;
68
- baseBranch: z.ZodString;
69
- baseSha: z.ZodString;
70
- }, z.core.$strict>;
71
- type MergeConflictPayload = z.infer<typeof mergeConflictPayloadSchema>;
72
- interface MergeConflictToolOptions<S extends CommandSandbox = CommandSandbox> {
73
- withCredential: (sandbox: S, repository: string, command: string) => Promise<{
74
- stdout: string;
75
- stderr?: string;
76
- exitCode?: number;
77
- }>;
78
- repoPath?: string;
79
- }
80
- declare function mergeConflictTools<S extends CommandSandbox>(stores: FactoryStores, options: MergeConflictToolOptions<S>): {
81
- fetch_merge_conflict: eve_tools.ToolDefinition<{
82
- taskId: string;
83
- }, {
84
- conflictedFiles: string[];
85
- repository: string;
86
- prNumber: number;
87
- prUrl: string;
88
- headBranch: string;
89
- headSha: string;
90
- baseBranch: string;
91
- baseSha: string;
92
- }> & {
93
- execute(input: {
94
- taskId: string;
95
- }, ctx: eve_tools.ToolContext): Promise<{
96
- conflictedFiles: string[];
97
- repository: string;
98
- prNumber: number;
99
- prUrl: string;
100
- headBranch: string;
101
- headSha: string;
102
- baseBranch: string;
103
- baseSha: string;
104
- }>;
105
- };
106
- publish_merge_resolution: eve_tools.ToolDefinition<{
107
- taskId: string;
108
- summary: string;
109
- }, {
110
- updated: true;
111
- prNumber: number;
112
- prUrl: string;
113
- }> & {
114
- execute(input: {
115
- taskId: string;
116
- summary: string;
117
- }, ctx: eve_tools.ToolContext): Promise<{
118
- updated: true;
119
- prNumber: number;
120
- prUrl: string;
121
- }>;
122
- };
123
- };
124
-
125
- interface RecordFindingOptions {
126
- /** Signal source the findings are recorded under. Defaults to security_scan. */
127
- source?: string;
128
- /** Which resulting tasks wait for a human. Defaults to the standard policy. */
129
- approval?: ApprovalPolicy;
130
- }
131
- type RecordFindingResult = {
132
- recorded: false;
133
- reason: string;
134
- duplicate?: true;
135
- signalId?: string;
136
- } | {
137
- recorded: true;
138
- signalId: string;
139
- taskId: string;
140
- approval: "required" | "not_required";
141
- };
142
- /**
143
- * Turn one finding into a signal and a fix task. The fingerprint is the
144
- * signal's delivery id, so the same problem reported twice is a no-op. The
145
- * signal is accepted on the reporter's own verification (a human gate follows
146
- * when the approval policy says so), and the task carries the approval
147
- * decision from the moment it exists. Shared by record_finding and scanner
148
- * tools that record on the agent's behalf.
149
- */
150
- declare function recordFinding(stores: FactoryStores, repositoryId: string, finding: Finding, options?: RecordFindingOptions): Promise<RecordFindingResult>;
151
- /**
152
- * The scanner's outcome tool: turns one finding into a signal and a fix task
153
- * in a single deterministic step. The finding's fingerprint is the signal's
154
- * delivery id, so reporting the same problem twice is a no-op. The signal is
155
- * accepted on the reporter's own verification (a human gate follows when the
156
- * approval policy says so), and the task carries the approval decision from
157
- * the moment it exists.
158
- */
159
- declare function recordFindingTool(stores: FactoryStores, options?: RecordFindingOptions): eve_tools.ToolDefinition<{
160
- repositoryId: string;
161
- finding: {
162
- title: string;
163
- body: string;
164
- priority: "P0" | "P1" | "P2" | "P3";
165
- category: "security" | "correctness" | "reliability" | "performance" | "compatibility" | "accessibility" | "documentation" | "maintainability" | "testing" | "usability";
166
- verification: {
167
- level: "unverified" | "supported" | "confirmed";
168
- method: "documentation" | "code_inspection" | "static_analysis" | "manual_reproduction" | "unit_test" | "integration_test" | "e2e_test" | "runtime_observation";
169
- summary: string;
170
- limitations?: string | undefined;
171
- };
172
- path?: string | undefined;
173
- line?: number | undefined;
174
- endLine?: number | undefined;
175
- tool?: string | undefined;
176
- ruleId?: string | undefined;
177
- };
178
- }, RecordFindingResult> & {
179
- execute(input: {
180
- repositoryId: string;
181
- finding: {
182
- title: string;
183
- body: string;
184
- priority: "P0" | "P1" | "P2" | "P3";
185
- category: "security" | "correctness" | "reliability" | "performance" | "compatibility" | "accessibility" | "documentation" | "maintainability" | "testing" | "usability";
186
- verification: {
187
- level: "unverified" | "supported" | "confirmed";
188
- method: "documentation" | "code_inspection" | "static_analysis" | "manual_reproduction" | "unit_test" | "integration_test" | "e2e_test" | "runtime_observation";
189
- summary: string;
190
- limitations?: string | undefined;
191
- };
192
- path?: string | undefined;
193
- line?: number | undefined;
194
- endLine?: number | undefined;
195
- tool?: string | undefined;
196
- ruleId?: string | undefined;
197
- };
198
- }, ctx: eve_tools.ToolContext): Promise<RecordFindingResult>;
199
- };
200
-
201
- interface DeepsecScanOptions<S extends CommandSandbox = CommandSandbox> extends RecordFindingOptions {
202
- /**
203
- * Runs one shell command with the model credential deepsec's gateway route
204
- * expects, and removes it again before resolving. Supplied by the app, which
205
- * owns where the credential comes from: on Vercel it is the deployment's own
206
- * OIDC identity (VERCEL_OIDC_TOKEN), so nothing has to be configured.
207
- */
208
- withModelCredential: (sandbox: S, command: string) => Promise<{
209
- stdout: string;
210
- stderr?: string;
211
- exitCode?: number;
212
- }>;
213
- /** deepsec agent backend: claude, codex, or pi. */
214
- agent?: "claude" | "codex" | "pi";
215
- /** Model deepsec's investigation agent uses, through the AI Gateway (e.g. claude-sonnet-4-6). */
216
- model?: string;
217
- /** Reasoning effort for the investigation: minimal, low, medium, high, or xhigh. */
218
- thinkingLevel?: "minimal" | "low" | "medium" | "high" | "xhigh";
219
- /** Parallel investigation batches. */
220
- concurrency?: number;
221
- /** deepsec version to install. */
222
- version?: string;
223
- /** Repository checkout inside the sandbox. Defaults to `repo`. */
224
- repoPath?: string;
225
- /** deepsec workspace inside the sandbox. Defaults to `deepsec`. */
226
- workspacePath?: string;
227
- /** Shell run before every deepsec command, e.g. to put a Node 24 on PATH. */
228
- commandPrefix?: string;
229
- /**
230
- * Candidate files investigated per run. deepsec keeps state, so successive
231
- * scans continue where the last one stopped; the cap keeps one run inside
232
- * the deployment's time limit on large repositories. Defaults to 40.
233
- */
234
- filesPerRun?: number;
235
- }
236
- /** deepsec's exported finding shape, as far as we depend on it. */
237
- declare const deepsecFindingSchema: z.ZodObject<{
238
- title: z.ZodString;
239
- description: z.ZodString;
240
- severity: z.ZodString;
241
- metadata: z.ZodOptional<z.ZodObject<{
242
- filePath: z.ZodOptional<z.ZodString>;
243
- lineNumbers: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
244
- vulnSlug: z.ZodOptional<z.ZodString>;
245
- confidence: z.ZodOptional<z.ZodString>;
246
- runId: z.ZodOptional<z.ZodString>;
247
- }, z.core.$loose>>;
248
- }, z.core.$loose>;
249
- /** Convert one deepsec finding into the factory's Finding. Pure; exported for tests. */
250
- declare function findingFromDeepsec(raw: z.infer<typeof deepsecFindingSchema>): Finding;
251
- /**
252
- * Runs deepsec (vercel-labs/deepsec) against the sandbox checkout and records
253
- * what it finds through the same path as record_finding, so every deepsec
254
- * finding becomes a fix task subject to the approval policy. Trusted code
255
- * owns the command sequence and the credential; the agent chooses when to
256
- * scan and reports the outcome.
257
- */
258
- declare function deepsecScanTool<S extends CommandSandbox>(stores: FactoryStores, options: DeepsecScanOptions<S>): eve_tools.ToolDefinition<{
259
- repositoryId: string;
260
- limit?: number | undefined;
261
- }, {
262
- scanned: false;
263
- reason: string;
264
- tool?: undefined;
265
- found?: undefined;
266
- recorded?: undefined;
267
- duplicates?: undefined;
268
- awaitingApproval?: undefined;
269
- findings?: undefined;
270
- } | {
271
- scanned: true;
272
- tool: string;
273
- found: number;
274
- recorded: number;
275
- duplicates: number;
276
- awaitingApproval: number;
277
- findings: ({
278
- taskId: string;
279
- approval: "required" | "not_required";
280
- title: string;
281
- priority: "P0" | "P1" | "P2" | "P3";
282
- path: string | undefined;
283
- line: number | undefined;
284
- } | {
285
- duplicate: boolean;
286
- title: string;
287
- priority: "P0" | "P1" | "P2" | "P3";
288
- path: string | undefined;
289
- line: number | undefined;
290
- })[];
291
- reason?: undefined;
292
- }> & {
293
- execute(input: {
294
- repositoryId: string;
295
- limit?: number | undefined;
296
- }, ctx: eve_tools.ToolContext): Promise<{
297
- scanned: false;
298
- reason: string;
299
- tool?: undefined;
300
- found?: undefined;
301
- recorded?: undefined;
302
- duplicates?: undefined;
303
- awaitingApproval?: undefined;
304
- findings?: undefined;
305
- } | {
306
- scanned: true;
307
- tool: string;
308
- found: number;
309
- recorded: number;
310
- duplicates: number;
311
- awaitingApproval: number;
312
- findings: ({
313
- taskId: string;
314
- approval: "required" | "not_required";
315
- title: string;
316
- priority: "P0" | "P1" | "P2" | "P3";
317
- path: string | undefined;
318
- line: number | undefined;
319
- } | {
320
- duplicate: boolean;
321
- title: string;
322
- priority: "P0" | "P1" | "P2" | "P3";
323
- path: string | undefined;
324
- line: number | undefined;
325
- })[];
326
- reason?: undefined;
327
- }>;
328
- };
329
-
330
- interface InvokeAgentOptions {
331
- /** The factory task kind the handoff creates, e.g. "verification". */
332
- kind: string;
333
- /** Model-facing description of what the target agent does and when to invoke it. */
334
- description: string;
335
- /**
336
- * Base URL of the target agent's eve transport, e.g.
337
- * `https://factory.example.com/eve/agents/verifier`. Resolved at call time so
338
- * a deployment can derive it from its own origin.
339
- */
340
- targetUrl: () => string;
341
- /** Bearer token for the target agent's eve channel, when it requires auth. */
342
- token?: () => Promise<string | undefined>;
343
- /** Extra headers for the session request, e.g. a deployment protection bypass. */
344
- headers?: () => Record<string, string> | Promise<Record<string, string>>;
345
- fetch?: typeof fetch;
346
- }
347
- /**
348
- * A tool that lets one agent hand work to another, NMA-style: the caller
349
- * decides to invoke; trusted code owns the how. The handoff is recorded as a
350
- * factory task (single-winner dispatch, receipts), then a fresh session is
351
- * started on the target agent carrying only the task id — never the caller's
352
- * context. The session start is create-once on the task id, so a retried
353
- * tool call cannot start a second session.
354
- */
355
- declare function invokeAgentTool(stores: FactoryStores, options: InvokeAgentOptions): eve_tools.ToolDefinition<{
356
- repositoryIds: string[];
357
- channel: string;
358
- address: string;
359
- brief: string;
360
- parentTaskId?: string | undefined;
361
- changeId?: string | undefined;
362
- }, {
363
- taskId: string;
364
- kind: string;
365
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
366
- }> & {
367
- execute(input: {
368
- repositoryIds: string[];
369
- channel: string;
370
- address: string;
371
- brief: string;
372
- parentTaskId?: string | undefined;
373
- changeId?: string | undefined;
374
- }, ctx: eve_tools.ToolContext): Promise<{
375
- taskId: string;
376
- kind: string;
377
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
378
- }>;
379
- };
380
-
381
- interface ReviewCommentToolOptions {
382
- tokenForRepository: (repository: string) => Promise<string>;
383
- fetch?: typeof globalThis.fetch;
384
- }
385
- declare function reviewCommentTools(stores: FactoryStores, options: ReviewCommentToolOptions): {
386
- read_review_comment: eve_tools.ToolDefinition<{
387
- changeId: string;
388
- commentId: number;
389
- }, GitHubReviewComment> & {
390
- execute(input: {
391
- changeId: string;
392
- commentId: number;
393
- }, ctx: eve_tools.ToolContext): Promise<GitHubReviewComment>;
394
- };
395
- answer_review_comment: eve_tools.ToolDefinition<{
396
- changeId: string;
397
- commentId: number;
398
- body: string;
399
- }, GitHubReviewComment> & {
400
- execute(input: {
401
- changeId: string;
402
- commentId: number;
403
- body: string;
404
- }, ctx: eve_tools.ToolContext): Promise<GitHubReviewComment>;
405
- };
406
- };
407
-
408
- /**
409
- * The verifier's outcome tool. Writes evidence onto the change and moves it
410
- * to ready only when the verdict is pass; a failed verdict leaves the change
411
- * verifying with the evidence recorded, and the verification task itself
412
- * ends with a receipt either way. The change's own code_change task follows
413
- * the verdict too: succeeded on pass, failed on fail with the verifier's
414
- * summary as the reason, so the ledger never shows a verified-and-rejected fix
415
- * as still in progress. Fail closed: the agent cannot mark a change ready
416
- * without supplying every evidence field.
417
- */
418
- declare function recordVerificationTool(stores: FactoryStores): eve_tools.ToolDefinition<{
419
- taskId: string;
420
- changeId: string;
421
- verdict: "pass" | "fail";
422
- evidence: {
423
- reproVerified: boolean;
424
- testsAdded: number;
425
- checksGreen: boolean;
426
- attackPassed: boolean;
427
- scopeMatches: boolean;
428
- previewUrl?: string | undefined;
429
- };
430
- confidence: "low" | "medium" | "high";
431
- summary: string;
432
- }, {
433
- recorded: false;
434
- reason: string;
435
- verdict?: undefined;
436
- changeState?: undefined;
437
- taskState?: undefined;
438
- } | {
439
- recorded: true;
440
- verdict: "pass" | "fail";
441
- changeState: "verifying" | "ready" | "merged" | "deployed" | "rolled_out" | "rolled_back" | "closed";
442
- taskState: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
443
- reason?: undefined;
444
- }> & {
445
- execute(input: {
446
- taskId: string;
447
- changeId: string;
448
- verdict: "pass" | "fail";
449
- evidence: {
450
- reproVerified: boolean;
451
- testsAdded: number;
452
- checksGreen: boolean;
453
- attackPassed: boolean;
454
- scopeMatches: boolean;
455
- previewUrl?: string | undefined;
456
- };
457
- confidence: "low" | "medium" | "high";
458
- summary: string;
459
- }, ctx: eve_tools.ToolContext): Promise<{
460
- recorded: false;
461
- reason: string;
462
- verdict?: undefined;
463
- changeState?: undefined;
464
- taskState?: undefined;
465
- } | {
466
- recorded: true;
467
- verdict: "pass" | "fail";
468
- changeState: "verifying" | "ready" | "merged" | "deployed" | "rolled_out" | "rolled_back" | "closed";
469
- taskState: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
470
- reason?: undefined;
471
- }>;
472
- };
473
-
474
- declare const recordChangeInputSchema: z.ZodObject<{
475
- taskId: z.ZodString;
476
- repositoryId: z.ZodString;
477
- prNumber: z.ZodNumber;
478
- prUrl: z.ZodURL;
479
- risk: z.ZodEnum<{
480
- low: "low";
481
- medium: "medium";
482
- high: "high";
483
- }>;
484
- confidence: z.ZodEnum<{
485
- low: "low";
486
- medium: "medium";
487
- high: "high";
488
- }>;
489
- summary: z.ZodString;
490
- }, z.core.$strip>;
491
- type RecordChangeInput = z.infer<typeof recordChangeInputSchema>;
492
- type GateVerdict = {
493
- ok: true;
494
- } | {
495
- ok: false;
496
- reason: string;
497
- };
498
- interface FactoryToolsOptions {
499
- /**
500
- * Pre-action gate for record_change, run as an eve approval policy before
501
- * the tool executes. Refusals reach the model as a denial with the reason.
502
- * Gates must fail closed: when they cannot verify, they refuse.
503
- */
504
- recordChangeGate?: (input: RecordChangeInput) => Promise<GateVerdict>;
505
- }
506
- /**
507
- * The factory's store operations wrapped as eve tools. Expose a tool to an
508
- * agent by re-exporting it from a file under agent/tools/, e.g.
509
- * `export default factoryTools(stores).get_task;`. Every write goes through
510
- * the engine, so agents inherit transition legality and receipts.
511
- */
512
- declare function factoryTools(stores: FactoryStores, options?: FactoryToolsOptions): {
513
- get_task: eve_tools.ToolDefinition<{
514
- taskId: string;
515
- }, {
516
- schemaVersion: 1;
517
- id: string;
518
- kind: string;
519
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
520
- origin: {
521
- signalId?: string | undefined;
522
- parentTaskId?: string | undefined;
523
- operator?: string | undefined;
524
- };
525
- replyTo: {
526
- channel: string;
527
- address: string;
528
- };
529
- attempt: number;
530
- createdAt: string;
531
- updatedAt: string;
532
- repositoryIds?: string[] | undefined;
533
- area?: string | undefined;
534
- approval?: "required" | "granted" | "denied" | undefined;
535
- dependsOn?: string[] | undefined;
536
- devbox?: {
537
- devboxId: string;
538
- remoteId: string;
539
- harness: string;
540
- } | undefined;
541
- reservedUsd?: number | undefined;
542
- settledUsd?: number | undefined;
543
- question?: {
544
- text: string;
545
- options: string[];
546
- answer?: string | undefined;
547
- answeredBy?: string | undefined;
548
- } | undefined;
549
- changeId?: string | undefined;
550
- reportRef?: string | undefined;
551
- } | {
552
- found: false;
553
- taskId: string;
554
- }> & {
555
- execute(input: {
556
- taskId: string;
557
- }, ctx: eve_tools.ToolContext): Promise<{
558
- schemaVersion: 1;
559
- id: string;
560
- kind: string;
561
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
562
- origin: {
563
- signalId?: string | undefined;
564
- parentTaskId?: string | undefined;
565
- operator?: string | undefined;
566
- };
567
- replyTo: {
568
- channel: string;
569
- address: string;
570
- };
571
- attempt: number;
572
- createdAt: string;
573
- updatedAt: string;
574
- repositoryIds?: string[] | undefined;
575
- area?: string | undefined;
576
- approval?: "required" | "granted" | "denied" | undefined;
577
- dependsOn?: string[] | undefined;
578
- devbox?: {
579
- devboxId: string;
580
- remoteId: string;
581
- harness: string;
582
- } | undefined;
583
- reservedUsd?: number | undefined;
584
- settledUsd?: number | undefined;
585
- question?: {
586
- text: string;
587
- options: string[];
588
- answer?: string | undefined;
589
- answeredBy?: string | undefined;
590
- } | undefined;
591
- changeId?: string | undefined;
592
- reportRef?: string | undefined;
593
- } | {
594
- found: false;
595
- taskId: string;
596
- }>;
597
- };
598
- decide_signal: eve_tools.ToolDefinition<{
599
- signalId: string;
600
- outcome: "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored";
601
- reason: string;
602
- detail?: string | undefined;
603
- }, {
604
- schemaVersion: 1;
605
- id: string;
606
- repositoryId: string;
607
- source: string;
608
- deliveryId: string;
609
- replyTo: {
610
- channel: string;
611
- address: string;
612
- };
613
- payload: unknown;
614
- receivedAt: string;
615
- outcome: "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored" | "pending";
616
- detail?: string | undefined;
617
- reason?: string | undefined;
618
- decidedAt?: string | undefined;
619
- }> & {
620
- execute(input: {
621
- signalId: string;
622
- outcome: "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored";
623
- reason: string;
624
- detail?: string | undefined;
625
- }, ctx: eve_tools.ToolContext): Promise<{
626
- schemaVersion: 1;
627
- id: string;
628
- repositoryId: string;
629
- source: string;
630
- deliveryId: string;
631
- replyTo: {
632
- channel: string;
633
- address: string;
634
- };
635
- payload: unknown;
636
- receivedAt: string;
637
- outcome: "accepted" | "duplicate" | "unactionable" | "low_confidence" | "ignored" | "pending";
638
- detail?: string | undefined;
639
- reason?: string | undefined;
640
- decidedAt?: string | undefined;
641
- }>;
642
- };
643
- record_change: eve_tools.ToolDefinition<{
644
- taskId: string;
645
- repositoryId: string;
646
- prNumber: number;
647
- prUrl: string;
648
- risk: "low" | "medium" | "high";
649
- confidence: "low" | "medium" | "high";
650
- summary: string;
651
- }, {
652
- change: {
653
- schemaVersion: 1;
654
- id: string;
655
- repositoryId: string;
656
- prNumber: number;
657
- prUrl: string;
658
- author: string;
659
- risk: "low" | "medium" | "high";
660
- confidence: "low" | "medium" | "high";
661
- evidence: {
662
- reproVerified: boolean;
663
- testsAdded: number;
664
- checksGreen: boolean;
665
- attackPassed: boolean;
666
- scopeMatches: boolean;
667
- previewUrl?: string | undefined;
668
- };
669
- state: "verifying" | "ready" | "merged" | "deployed" | "rolled_out" | "rolled_back" | "closed";
670
- createdAt: string;
671
- updatedAt: string;
672
- taskId?: string | undefined;
673
- groupId?: string | undefined;
674
- decidedBy?: string | undefined;
675
- };
676
- task: {
677
- schemaVersion: 1;
678
- id: string;
679
- kind: string;
680
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
681
- origin: {
682
- signalId?: string | undefined;
683
- parentTaskId?: string | undefined;
684
- operator?: string | undefined;
685
- };
686
- replyTo: {
687
- channel: string;
688
- address: string;
689
- };
690
- attempt: number;
691
- createdAt: string;
692
- updatedAt: string;
693
- repositoryIds?: string[] | undefined;
694
- area?: string | undefined;
695
- approval?: "required" | "granted" | "denied" | undefined;
696
- dependsOn?: string[] | undefined;
697
- devbox?: {
698
- devboxId: string;
699
- remoteId: string;
700
- harness: string;
701
- } | undefined;
702
- reservedUsd?: number | undefined;
703
- settledUsd?: number | undefined;
704
- question?: {
705
- text: string;
706
- options: string[];
707
- answer?: string | undefined;
708
- answeredBy?: string | undefined;
709
- } | undefined;
710
- changeId?: string | undefined;
711
- reportRef?: string | undefined;
712
- };
713
- }> & {
714
- execute(input: {
715
- taskId: string;
716
- repositoryId: string;
717
- prNumber: number;
718
- prUrl: string;
719
- risk: "low" | "medium" | "high";
720
- confidence: "low" | "medium" | "high";
721
- summary: string;
722
- }, ctx: eve_tools.ToolContext): Promise<{
723
- change: {
724
- schemaVersion: 1;
725
- id: string;
726
- repositoryId: string;
727
- prNumber: number;
728
- prUrl: string;
729
- author: string;
730
- risk: "low" | "medium" | "high";
731
- confidence: "low" | "medium" | "high";
732
- evidence: {
733
- reproVerified: boolean;
734
- testsAdded: number;
735
- checksGreen: boolean;
736
- attackPassed: boolean;
737
- scopeMatches: boolean;
738
- previewUrl?: string | undefined;
739
- };
740
- state: "verifying" | "ready" | "merged" | "deployed" | "rolled_out" | "rolled_back" | "closed";
741
- createdAt: string;
742
- updatedAt: string;
743
- taskId?: string | undefined;
744
- groupId?: string | undefined;
745
- decidedBy?: string | undefined;
746
- };
747
- task: {
748
- schemaVersion: 1;
749
- id: string;
750
- kind: string;
751
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
752
- origin: {
753
- signalId?: string | undefined;
754
- parentTaskId?: string | undefined;
755
- operator?: string | undefined;
756
- };
757
- replyTo: {
758
- channel: string;
759
- address: string;
760
- };
761
- attempt: number;
762
- createdAt: string;
763
- updatedAt: string;
764
- repositoryIds?: string[] | undefined;
765
- area?: string | undefined;
766
- approval?: "required" | "granted" | "denied" | undefined;
767
- dependsOn?: string[] | undefined;
768
- devbox?: {
769
- devboxId: string;
770
- remoteId: string;
771
- harness: string;
772
- } | undefined;
773
- reservedUsd?: number | undefined;
774
- settledUsd?: number | undefined;
775
- question?: {
776
- text: string;
777
- options: string[];
778
- answer?: string | undefined;
779
- answeredBy?: string | undefined;
780
- } | undefined;
781
- changeId?: string | undefined;
782
- reportRef?: string | undefined;
783
- };
784
- }>;
785
- };
786
- finish_task: eve_tools.ToolDefinition<{
787
- taskId: string;
788
- summary: string;
789
- }, {
790
- finished: false;
791
- reason: string;
792
- taskState?: undefined;
793
- } | {
794
- finished: true;
795
- taskState: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
796
- reason?: undefined;
797
- }> & {
798
- execute(input: {
799
- taskId: string;
800
- summary: string;
801
- }, ctx: eve_tools.ToolContext): Promise<{
802
- finished: false;
803
- reason: string;
804
- taskState?: undefined;
805
- } | {
806
- finished: true;
807
- taskState: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
808
- reason?: undefined;
809
- }>;
810
- };
811
- report_blocked: eve_tools.ToolDefinition<{
812
- taskId: string;
813
- reason: string;
814
- }, {
815
- schemaVersion: 1;
816
- id: string;
817
- kind: string;
818
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
819
- origin: {
820
- signalId?: string | undefined;
821
- parentTaskId?: string | undefined;
822
- operator?: string | undefined;
823
- };
824
- replyTo: {
825
- channel: string;
826
- address: string;
827
- };
828
- attempt: number;
829
- createdAt: string;
830
- updatedAt: string;
831
- repositoryIds?: string[] | undefined;
832
- area?: string | undefined;
833
- approval?: "required" | "granted" | "denied" | undefined;
834
- dependsOn?: string[] | undefined;
835
- devbox?: {
836
- devboxId: string;
837
- remoteId: string;
838
- harness: string;
839
- } | undefined;
840
- reservedUsd?: number | undefined;
841
- settledUsd?: number | undefined;
842
- question?: {
843
- text: string;
844
- options: string[];
845
- answer?: string | undefined;
846
- answeredBy?: string | undefined;
847
- } | undefined;
848
- changeId?: string | undefined;
849
- reportRef?: string | undefined;
850
- }> & {
851
- execute(input: {
852
- taskId: string;
853
- reason: string;
854
- }, ctx: eve_tools.ToolContext): Promise<{
855
- schemaVersion: 1;
856
- id: string;
857
- kind: string;
858
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
859
- origin: {
860
- signalId?: string | undefined;
861
- parentTaskId?: string | undefined;
862
- operator?: string | undefined;
863
- };
864
- replyTo: {
865
- channel: string;
866
- address: string;
867
- };
868
- attempt: number;
869
- createdAt: string;
870
- updatedAt: string;
871
- repositoryIds?: string[] | undefined;
872
- area?: string | undefined;
873
- approval?: "required" | "granted" | "denied" | undefined;
874
- dependsOn?: string[] | undefined;
875
- devbox?: {
876
- devboxId: string;
877
- remoteId: string;
878
- harness: string;
879
- } | undefined;
880
- reservedUsd?: number | undefined;
881
- settledUsd?: number | undefined;
882
- question?: {
883
- text: string;
884
- options: string[];
885
- answer?: string | undefined;
886
- answeredBy?: string | undefined;
887
- } | undefined;
888
- changeId?: string | undefined;
889
- reportRef?: string | undefined;
890
- }>;
891
- };
892
- ask_question: eve_tools.ToolDefinition<{
893
- repositoryIds: string[];
894
- channel: string;
895
- address: string;
896
- question: {
897
- text: string;
898
- options: string[];
899
- };
900
- parentTaskId?: string | undefined;
901
- }, {
902
- schemaVersion: 1;
903
- id: string;
904
- kind: string;
905
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
906
- origin: {
907
- signalId?: string | undefined;
908
- parentTaskId?: string | undefined;
909
- operator?: string | undefined;
910
- };
911
- replyTo: {
912
- channel: string;
913
- address: string;
914
- };
915
- attempt: number;
916
- createdAt: string;
917
- updatedAt: string;
918
- repositoryIds?: string[] | undefined;
919
- area?: string | undefined;
920
- approval?: "required" | "granted" | "denied" | undefined;
921
- dependsOn?: string[] | undefined;
922
- devbox?: {
923
- devboxId: string;
924
- remoteId: string;
925
- harness: string;
926
- } | undefined;
927
- reservedUsd?: number | undefined;
928
- settledUsd?: number | undefined;
929
- question?: {
930
- text: string;
931
- options: string[];
932
- answer?: string | undefined;
933
- answeredBy?: string | undefined;
934
- } | undefined;
935
- changeId?: string | undefined;
936
- reportRef?: string | undefined;
937
- }> & {
938
- execute(input: {
939
- repositoryIds: string[];
940
- channel: string;
941
- address: string;
942
- question: {
943
- text: string;
944
- options: string[];
945
- };
946
- parentTaskId?: string | undefined;
947
- }, ctx: eve_tools.ToolContext): Promise<{
948
- schemaVersion: 1;
949
- id: string;
950
- kind: string;
951
- state: "queued" | "running" | "verifying" | "succeeded" | "failed" | "needs_human" | "cancelled";
952
- origin: {
953
- signalId?: string | undefined;
954
- parentTaskId?: string | undefined;
955
- operator?: string | undefined;
956
- };
957
- replyTo: {
958
- channel: string;
959
- address: string;
960
- };
961
- attempt: number;
962
- createdAt: string;
963
- updatedAt: string;
964
- repositoryIds?: string[] | undefined;
965
- area?: string | undefined;
966
- approval?: "required" | "granted" | "denied" | undefined;
967
- dependsOn?: string[] | undefined;
968
- devbox?: {
969
- devboxId: string;
970
- remoteId: string;
971
- harness: string;
972
- } | undefined;
973
- reservedUsd?: number | undefined;
974
- settledUsd?: number | undefined;
975
- question?: {
976
- text: string;
977
- options: string[];
978
- answer?: string | undefined;
979
- answeredBy?: string | undefined;
980
- } | undefined;
981
- changeId?: string | undefined;
982
- reportRef?: string | undefined;
983
- }>;
984
- };
985
- append_receipt: eve_tools.ToolDefinition<{
986
- repositoryIds: string[];
987
- kind: string;
988
- state: string;
989
- taskId?: string | undefined;
990
- changeId?: string | undefined;
991
- reason?: string | undefined;
992
- dedupeKey?: string | undefined;
993
- }, {
994
- schemaVersion: 1;
995
- receiptId: string;
996
- repositoryIds: string[];
997
- kind: string;
998
- state: string;
999
- attempt: number;
1000
- recordedAt: string;
1001
- taskId?: string | undefined;
1002
- changeId?: string | undefined;
1003
- phase?: string | undefined;
1004
- reason?: string | undefined;
1005
- cost?: {
1006
- totalUsd: number;
1007
- } | undefined;
1008
- decidedBy?: string | undefined;
1009
- }> & {
1010
- execute(input: {
1011
- repositoryIds: string[];
1012
- kind: string;
1013
- state: string;
1014
- taskId?: string | undefined;
1015
- changeId?: string | undefined;
1016
- reason?: string | undefined;
1017
- dedupeKey?: string | undefined;
1018
- }, ctx: eve_tools.ToolContext): Promise<{
1019
- schemaVersion: 1;
1020
- receiptId: string;
1021
- repositoryIds: string[];
1022
- kind: string;
1023
- state: string;
1024
- attempt: number;
1025
- recordedAt: string;
1026
- taskId?: string | undefined;
1027
- changeId?: string | undefined;
1028
- phase?: string | undefined;
1029
- reason?: string | undefined;
1030
- cost?: {
1031
- totalUsd: number;
1032
- } | undefined;
1033
- decidedBy?: string | undefined;
1034
- }>;
1035
- };
1036
- };
1037
- type FactoryTools = ReturnType<typeof factoryTools>;
1038
- /**
1039
- * Observe-only eve hooks that keep the ledger honest about session outcomes.
1040
- * Mount by re-exporting from agent/hooks/, e.g.
1041
- * `export default factoryHooks(stores).factory;`.
1042
- *
1043
- * turn.completed: a turn that ends while its task is still running means the
1044
- * agent finished talking without recording an outcome; the task moves to
1045
- * needs_human instead of rotting. The task is found by the session's
1046
- * channel address, which dispatch set from the task's replyTo.
1047
- */
1048
- declare function factoryHooks(stores: FactoryStores): {
1049
- factory: eve_hooks.HookDefinition<"turn.completed">;
1050
- };
1051
- type FactoryHooks = ReturnType<typeof factoryHooks>;
1052
-
1053
- export { type CommandSandbox, type DeepsecScanOptions, type FactoryHooks, type FactoryTools, type FactoryToolsOptions, type FetchPullRequestOptions, type FetchPullRequestResult, type GateVerdict, type InvokeAgentOptions, type MergeConflictPayload, type MergeConflictToolOptions, type RecordChangeInput, type RecordFindingOptions, type RecordFindingResult, type ReviewCommentToolOptions, deepsecScanTool, factoryHooks, factoryTools, fetchPullRequestTool, findingFromDeepsec, invokeAgentTool, mergeConflictPayloadSchema, mergeConflictTools, recordFinding, recordFindingTool, recordVerificationTool, reviewCommentTools };