@itsthelore/proofkeeper 2026.6.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.
Files changed (156) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +10 -0
  3. package/README.md +207 -0
  4. package/dist/agent/adapters/claude.d.ts +93 -0
  5. package/dist/agent/adapters/claude.d.ts.map +1 -0
  6. package/dist/agent/adapters/claude.js +96 -0
  7. package/dist/agent/adapters/claude.js.map +1 -0
  8. package/dist/agent/drive.d.ts +53 -0
  9. package/dist/agent/drive.d.ts.map +1 -0
  10. package/dist/agent/drive.js +194 -0
  11. package/dist/agent/drive.js.map +1 -0
  12. package/dist/agent/loop.d.ts +40 -0
  13. package/dist/agent/loop.d.ts.map +1 -0
  14. package/dist/agent/loop.js +29 -0
  15. package/dist/agent/loop.js.map +1 -0
  16. package/dist/agent/model.d.ts +43 -0
  17. package/dist/agent/model.d.ts.map +1 -0
  18. package/dist/agent/model.js +10 -0
  19. package/dist/agent/model.js.map +1 -0
  20. package/dist/agent/observe.d.ts +48 -0
  21. package/dist/agent/observe.d.ts.map +1 -0
  22. package/dist/agent/observe.js +65 -0
  23. package/dist/agent/observe.js.map +1 -0
  24. package/dist/agent/tools.d.ts +74 -0
  25. package/dist/agent/tools.d.ts.map +1 -0
  26. package/dist/agent/tools.js +257 -0
  27. package/dist/agent/tools.js.map +1 -0
  28. package/dist/cli.d.ts +61 -0
  29. package/dist/cli.d.ts.map +1 -0
  30. package/dist/cli.js +648 -0
  31. package/dist/cli.js.map +1 -0
  32. package/dist/compiler/actions.d.ts +101 -0
  33. package/dist/compiler/actions.d.ts.map +1 -0
  34. package/dist/compiler/actions.js +13 -0
  35. package/dist/compiler/actions.js.map +1 -0
  36. package/dist/compiler/compiler.d.ts +25 -0
  37. package/dist/compiler/compiler.d.ts.map +1 -0
  38. package/dist/compiler/compiler.js +42 -0
  39. package/dist/compiler/compiler.js.map +1 -0
  40. package/dist/compiler/emit.d.ts +21 -0
  41. package/dist/compiler/emit.d.ts.map +1 -0
  42. package/dist/compiler/emit.js +164 -0
  43. package/dist/compiler/emit.js.map +1 -0
  44. package/dist/compiler/http.d.ts +30 -0
  45. package/dist/compiler/http.d.ts.map +1 -0
  46. package/dist/compiler/http.js +30 -0
  47. package/dist/compiler/http.js.map +1 -0
  48. package/dist/compiler/recorder.d.ts +62 -0
  49. package/dist/compiler/recorder.d.ts.map +1 -0
  50. package/dist/compiler/recorder.js +148 -0
  51. package/dist/compiler/recorder.js.map +1 -0
  52. package/dist/compiler/summary.d.ts +11 -0
  53. package/dist/compiler/summary.d.ts.map +1 -0
  54. package/dist/compiler/summary.js +56 -0
  55. package/dist/compiler/summary.js.map +1 -0
  56. package/dist/compiler/terminal.d.ts +42 -0
  57. package/dist/compiler/terminal.d.ts.map +1 -0
  58. package/dist/compiler/terminal.js +47 -0
  59. package/dist/compiler/terminal.js.map +1 -0
  60. package/dist/compiler/types.d.ts +25 -0
  61. package/dist/compiler/types.d.ts.map +1 -0
  62. package/dist/compiler/types.js +10 -0
  63. package/dist/compiler/types.js.map +1 -0
  64. package/dist/coverage/graph.d.ts +55 -0
  65. package/dist/coverage/graph.d.ts.map +1 -0
  66. package/dist/coverage/graph.js +87 -0
  67. package/dist/coverage/graph.js.map +1 -0
  68. package/dist/coverage/model.d.ts +36 -0
  69. package/dist/coverage/model.d.ts.map +1 -0
  70. package/dist/coverage/model.js +57 -0
  71. package/dist/coverage/model.js.map +1 -0
  72. package/dist/coverage/report.d.ts +27 -0
  73. package/dist/coverage/report.d.ts.map +1 -0
  74. package/dist/coverage/report.js +45 -0
  75. package/dist/coverage/report.js.map +1 -0
  76. package/dist/coverage/source.d.ts +23 -0
  77. package/dist/coverage/source.d.ts.map +1 -0
  78. package/dist/coverage/source.js +48 -0
  79. package/dist/coverage/source.js.map +1 -0
  80. package/dist/fidelity/gate.d.ts +34 -0
  81. package/dist/fidelity/gate.d.ts.map +1 -0
  82. package/dist/fidelity/gate.js +38 -0
  83. package/dist/fidelity/gate.js.map +1 -0
  84. package/dist/index.d.ts +69 -0
  85. package/dist/index.d.ts.map +1 -0
  86. package/dist/index.js +49 -0
  87. package/dist/index.js.map +1 -0
  88. package/dist/learning/store.d.ts +44 -0
  89. package/dist/learning/store.d.ts.map +1 -0
  90. package/dist/learning/store.js +64 -0
  91. package/dist/learning/store.js.map +1 -0
  92. package/dist/qa/concurrency.d.ts +7 -0
  93. package/dist/qa/concurrency.d.ts.map +1 -0
  94. package/dist/qa/concurrency.js +21 -0
  95. package/dist/qa/concurrency.js.map +1 -0
  96. package/dist/qa/run-qa.d.ts +87 -0
  97. package/dist/qa/run-qa.d.ts.map +1 -0
  98. package/dist/qa/run-qa.js +106 -0
  99. package/dist/qa/run-qa.js.map +1 -0
  100. package/dist/qa/run-scoped.d.ts +82 -0
  101. package/dist/qa/run-scoped.d.ts.map +1 -0
  102. package/dist/qa/run-scoped.js +96 -0
  103. package/dist/qa/run-scoped.js.map +1 -0
  104. package/dist/runner/playwright-report.d.ts +52 -0
  105. package/dist/runner/playwright-report.d.ts.map +1 -0
  106. package/dist/runner/playwright-report.js +90 -0
  107. package/dist/runner/playwright-report.js.map +1 -0
  108. package/dist/runner/playwright-runner.d.ts +38 -0
  109. package/dist/runner/playwright-runner.d.ts.map +1 -0
  110. package/dist/runner/playwright-runner.js +73 -0
  111. package/dist/runner/playwright-runner.js.map +1 -0
  112. package/dist/runner/types.d.ts +45 -0
  113. package/dist/runner/types.d.ts.map +1 -0
  114. package/dist/runner/types.js +10 -0
  115. package/dist/runner/types.js.map +1 -0
  116. package/dist/scaffold/scaffold.d.ts +22 -0
  117. package/dist/scaffold/scaffold.d.ts.map +1 -0
  118. package/dist/scaffold/scaffold.js +34 -0
  119. package/dist/scaffold/scaffold.js.map +1 -0
  120. package/dist/scope/config.d.ts +89 -0
  121. package/dist/scope/config.d.ts.map +1 -0
  122. package/dist/scope/config.js +172 -0
  123. package/dist/scope/config.js.map +1 -0
  124. package/dist/scope/diff-scope.d.ts +31 -0
  125. package/dist/scope/diff-scope.d.ts.map +1 -0
  126. package/dist/scope/diff-scope.js +42 -0
  127. package/dist/scope/diff-scope.js.map +1 -0
  128. package/dist/scope/glob.d.ts +17 -0
  129. package/dist/scope/glob.d.ts.map +1 -0
  130. package/dist/scope/glob.js +50 -0
  131. package/dist/scope/glob.js.map +1 -0
  132. package/dist/writeback/comment.d.ts +103 -0
  133. package/dist/writeback/comment.d.ts.map +1 -0
  134. package/dist/writeback/comment.js +150 -0
  135. package/dist/writeback/comment.js.map +1 -0
  136. package/dist/writeback/gateways/github-rest.d.ts +66 -0
  137. package/dist/writeback/gateways/github-rest.d.ts.map +1 -0
  138. package/dist/writeback/gateways/github-rest.js +107 -0
  139. package/dist/writeback/gateways/github-rest.js.map +1 -0
  140. package/dist/writeback/merge.d.ts +27 -0
  141. package/dist/writeback/merge.d.ts.map +1 -0
  142. package/dist/writeback/merge.js +89 -0
  143. package/dist/writeback/merge.js.map +1 -0
  144. package/dist/writeback/proposal.d.ts +52 -0
  145. package/dist/writeback/proposal.d.ts.map +1 -0
  146. package/dist/writeback/proposal.js +79 -0
  147. package/dist/writeback/proposal.js.map +1 -0
  148. package/dist/writeback/proposer.d.ts +94 -0
  149. package/dist/writeback/proposer.d.ts.map +1 -0
  150. package/dist/writeback/proposer.js +79 -0
  151. package/dist/writeback/proposer.js.map +1 -0
  152. package/dist/writeback/verified-by.d.ts +56 -0
  153. package/dist/writeback/verified-by.d.ts.map +1 -0
  154. package/dist/writeback/verified-by.js +60 -0
  155. package/dist/writeback/verified-by.js.map +1 -0
  156. package/package.json +62 -0
@@ -0,0 +1,257 @@
1
+ /**
2
+ * The tool surface the autonomous drive exposes to the BYO model, and the
3
+ * parsing of a model's tool-call arguments back into the typed IR.
4
+ *
5
+ * Each tool maps one-to-one onto a {@link Recorder} action, so the model drives
6
+ * the product through exactly the vocabulary the compiler can emit — nothing
7
+ * the recorder cannot capture, and nothing the emitter cannot render.
8
+ */
9
+ /** JSON Schema for a {@link Locator} argument, shared across tools. */
10
+ const LOCATOR_SCHEMA = {
11
+ type: "object",
12
+ description: "How to find the element. Prefer role, testId, or text over css.",
13
+ properties: {
14
+ strategy: { type: "string", enum: ["role", "testId", "text", "label", "css"] },
15
+ role: { type: "string", description: "ARIA role, e.g. 'button' (strategy=role)" },
16
+ name: { type: "string", description: "Accessible name (strategy=role)" },
17
+ testId: { type: "string", description: "data-testid value (strategy=testId)" },
18
+ text: { type: "string", description: "Visible text (strategy=text)" },
19
+ label: { type: "string", description: "Form label (strategy=label)" },
20
+ selector: { type: "string", description: "CSS selector (strategy=css)" },
21
+ },
22
+ required: ["strategy"],
23
+ };
24
+ function withLocator(extra = {}, required = []) {
25
+ return {
26
+ type: "object",
27
+ properties: { locator: LOCATOR_SCHEMA, ...extra },
28
+ required: ["locator", ...required],
29
+ };
30
+ }
31
+ /** The tools advertised to the model each turn. Names map to Recorder methods. */
32
+ export const DRIVE_TOOLS = [
33
+ {
34
+ name: "navigate",
35
+ description: "Go to a URL.",
36
+ inputSchema: {
37
+ type: "object",
38
+ properties: { url: { type: "string", description: "Absolute URL to navigate to" } },
39
+ required: ["url"],
40
+ },
41
+ },
42
+ { name: "click", description: "Click an element.", inputSchema: withLocator() },
43
+ {
44
+ name: "fill",
45
+ description: "Fill a text input.",
46
+ inputSchema: withLocator({ value: { type: "string", description: "Text to type" } }, ["value"]),
47
+ },
48
+ { name: "check", description: "Check a checkbox or radio.", inputSchema: withLocator() },
49
+ {
50
+ name: "press",
51
+ description: "Press a key on an element.",
52
+ inputSchema: withLocator({ key: { type: "string", description: "Key name, e.g. 'Enter'" } }, ["key"]),
53
+ },
54
+ {
55
+ name: "expect_text",
56
+ description: "Assert an element has exactly this text — record an observable outcome.",
57
+ inputSchema: withLocator({ text: { type: "string", description: "Expected exact text" } }, ["text"]),
58
+ },
59
+ { name: "expect_visible", description: "Assert an element is visible.", inputSchema: withLocator() },
60
+ {
61
+ name: "run_command",
62
+ description: "Run a shell command in the product's terminal. Its result is recorded for assertions.",
63
+ inputSchema: {
64
+ type: "object",
65
+ properties: {
66
+ command: { type: "string", description: "The shell command to run" },
67
+ cwd: { type: "string", description: "Working directory (optional)" },
68
+ },
69
+ required: ["command"],
70
+ },
71
+ },
72
+ {
73
+ name: "expect_output",
74
+ description: "Assert the last command's stdout/stderr — record an observable outcome.",
75
+ inputSchema: {
76
+ type: "object",
77
+ properties: {
78
+ match: { type: "string", enum: ["exact", "contains", "regex"] },
79
+ stream: { type: "string", enum: ["stdout", "stderr"] },
80
+ value: { type: "string", description: "Expected value (exact text, substring, or regex source)" },
81
+ },
82
+ required: ["match", "stream", "value"],
83
+ },
84
+ },
85
+ {
86
+ name: "expect_exit",
87
+ description: "Assert the last command's exit code.",
88
+ inputSchema: {
89
+ type: "object",
90
+ properties: { code: { type: "number", description: "Expected exit code, e.g. 0" } },
91
+ required: ["code"],
92
+ },
93
+ },
94
+ {
95
+ name: "request",
96
+ description: "Issue an HTTP request to an absolute URL. Its response is recorded for assertions.",
97
+ inputSchema: {
98
+ type: "object",
99
+ properties: {
100
+ method: { type: "string", description: "HTTP method, e.g. GET or POST" },
101
+ url: { type: "string", description: "Absolute URL to request" },
102
+ headers: { type: "object", description: "Optional request headers" },
103
+ body: { type: "string", description: "Optional request body" },
104
+ },
105
+ required: ["method", "url"],
106
+ },
107
+ },
108
+ {
109
+ name: "expect_status",
110
+ description: "Assert the last response's HTTP status code.",
111
+ inputSchema: {
112
+ type: "object",
113
+ properties: { status: { type: "number", description: "Expected status, e.g. 200" } },
114
+ required: ["status"],
115
+ },
116
+ },
117
+ {
118
+ name: "expect_json",
119
+ description: "Assert a field of the last response's JSON body equals a value.",
120
+ inputSchema: {
121
+ type: "object",
122
+ properties: {
123
+ path: { type: "string", description: "Dot-path into the JSON body, e.g. data.order.id" },
124
+ equals: { type: ["string", "number", "boolean"], description: "Expected scalar value" },
125
+ },
126
+ required: ["path", "equals"],
127
+ },
128
+ },
129
+ {
130
+ name: "finish",
131
+ description: "End the session: the capability has been driven and asserted.",
132
+ inputSchema: { type: "object", properties: {} },
133
+ },
134
+ ];
135
+ /**
136
+ * A locator is `{ strategy, ... }`. Prefer resilient strategies (role with a
137
+ * name, testId, or text) over css. This text is folded into the system prompt.
138
+ */
139
+ export const LOCATOR_GUIDANCE = "A locator is an object { strategy: 'role'|'testId'|'text'|'label'|'css', ... }: " +
140
+ "role needs { role, name? }, testId needs { testId }, text needs { text }, " +
141
+ "label needs { label }, css needs { selector }. Prefer role, testId, or text over css. " +
142
+ "A locator may be passed as the `locator` field or inline on the arguments.";
143
+ /** Guidance for the terminal tools, folded into the system prompt. */
144
+ export const TERMINAL_GUIDANCE = "You also have a terminal. run_command runs a shell command and records its result; " +
145
+ "expect_output asserts the last command's stdout or stderr (match: exact|contains|regex), " +
146
+ "and expect_exit asserts its exit code. Run a command, read its result, then assert the " +
147
+ "outcomes you observe — those assertions become the committed test.";
148
+ /** Guidance for the HTTP tools, folded into the system prompt. */
149
+ export const HTTP_GUIDANCE = "You also have HTTP tools for API capabilities. request issues an HTTP request to an " +
150
+ "absolute URL and records the response; expect_status asserts the response status code, " +
151
+ "and expect_json asserts a dot-path field of a JSON response body equals a value. Issue a " +
152
+ "request, read the response, then assert the outcomes — those become the committed test.";
153
+ /** Raised when a model's locator arguments are not a recognizable strategy. */
154
+ export class ToolArgumentError extends Error {
155
+ constructor(message) {
156
+ super(message);
157
+ this.name = "ToolArgumentError";
158
+ }
159
+ }
160
+ function str(value, field) {
161
+ if (typeof value !== "string") {
162
+ throw new ToolArgumentError(`expected string for '${field}', got ${typeof value}`);
163
+ }
164
+ return value;
165
+ }
166
+ /**
167
+ * Parse a model tool-call's arguments into a {@link Locator}.
168
+ *
169
+ * Accepts the locator nested under `locator` or inline on the arguments object.
170
+ *
171
+ * @throws {ToolArgumentError} on a missing or unrecognized strategy.
172
+ */
173
+ export function parseLocator(args) {
174
+ const raw = (args["locator"] ?? args);
175
+ const strategy = raw["strategy"];
176
+ switch (strategy) {
177
+ case "role": {
178
+ const name = raw["name"];
179
+ return name === undefined || name === null
180
+ ? { kind: "role", role: str(raw["role"], "role") }
181
+ : { kind: "role", role: str(raw["role"], "role"), name: str(name, "name") };
182
+ }
183
+ case "testId":
184
+ return { kind: "testId", testId: str(raw["testId"], "testId") };
185
+ case "text":
186
+ return { kind: "text", text: str(raw["text"], "text") };
187
+ case "label":
188
+ return { kind: "label", label: str(raw["label"], "label") };
189
+ case "css":
190
+ return { kind: "css", selector: str(raw["selector"], "selector") };
191
+ default:
192
+ throw new ToolArgumentError(`unknown locator strategy: ${JSON.stringify(strategy)}`);
193
+ }
194
+ }
195
+ /** Parse a `run_command` tool call's arguments. */
196
+ export function parseRunCommand(args) {
197
+ const command = str(args["command"], "command");
198
+ const cwd = args["cwd"];
199
+ return cwd === undefined || cwd === null ? { command } : { command, cwd: str(cwd, "cwd") };
200
+ }
201
+ /** Parse an `expect_output` tool call's arguments. */
202
+ export function parseExpectOutput(args) {
203
+ const match = str(args["match"], "match");
204
+ if (match !== "exact" && match !== "contains" && match !== "regex") {
205
+ throw new ToolArgumentError(`unknown match mode: ${JSON.stringify(match)}`);
206
+ }
207
+ const stream = str(args["stream"], "stream");
208
+ if (stream !== "stdout" && stream !== "stderr") {
209
+ throw new ToolArgumentError(`unknown stream: ${JSON.stringify(stream)}`);
210
+ }
211
+ return { match, stream, value: str(args["value"], "value") };
212
+ }
213
+ /** Parse an `expect_exit` tool call's arguments. */
214
+ export function parseExpectExit(args) {
215
+ const code = args["code"];
216
+ if (typeof code !== "number" || !Number.isInteger(code)) {
217
+ throw new ToolArgumentError(`expected an integer exit code, got ${JSON.stringify(code)}`);
218
+ }
219
+ return code;
220
+ }
221
+ /** Parse a `request` tool call's arguments. */
222
+ export function parseRequest(args) {
223
+ const out = { method: str(args["method"], "method"), url: str(args["url"], "url") };
224
+ const headers = args["headers"];
225
+ if (headers !== undefined && headers !== null) {
226
+ if (typeof headers !== "object" || Array.isArray(headers)) {
227
+ throw new ToolArgumentError("headers must be an object of strings");
228
+ }
229
+ const record = {};
230
+ for (const [key, value] of Object.entries(headers)) {
231
+ record[key] = str(value, `headers.${key}`);
232
+ }
233
+ out.headers = record;
234
+ }
235
+ const body = args["body"];
236
+ if (body !== undefined && body !== null)
237
+ out.body = str(body, "body");
238
+ return out;
239
+ }
240
+ /** Parse an `expect_status` tool call's arguments. */
241
+ export function parseExpectStatus(args) {
242
+ const status = args["status"];
243
+ if (typeof status !== "number" || !Number.isInteger(status)) {
244
+ throw new ToolArgumentError(`expected an integer status, got ${JSON.stringify(status)}`);
245
+ }
246
+ return status;
247
+ }
248
+ /** Parse an `expect_json` tool call's arguments. */
249
+ export function parseExpectJson(args) {
250
+ const path = str(args["path"], "path");
251
+ const equals = args["equals"];
252
+ if (typeof equals !== "string" && typeof equals !== "number" && typeof equals !== "boolean") {
253
+ throw new ToolArgumentError("expect_json equals must be a string, number, or boolean");
254
+ }
255
+ return { path, equals };
256
+ }
257
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/agent/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,uEAAuE;AACvE,MAAM,cAAc,GAA4B;IAC9C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,iEAAiE;IAC9E,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE;QAC9E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;QACjF,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;QACxE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;QAC9E,IAAI,EAAE,EAAE,IAAI,EAAE,QAA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IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,iBAAiB,CAAC,mCAAmC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC3F,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAQD,oDAAoD;AACpD,MAAM,UAAU,eAAe,CAAC,IAA6B;IAC3D,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,MAAM,KAAK,SAAS,EAAE,CAAC;QAC5F,MAAM,IAAI,iBAAiB,CAAC,yDAAyD,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * The `proofkeeper` CLI.
4
+ *
5
+ * - `coverage` exposes the coverage read-model (Initiative 1).
6
+ * - `qa` (alias `verify`) runs the full QA loop for one capability: select →
7
+ * drive → compile → fidelity → run → (optional) propose the write-back.
8
+ *
9
+ * Exit codes are a stable contract: 0 = success (every capability verified, or
10
+ * the driven capability passed the fidelity gate), 1 = not verified (unverified
11
+ * capabilities, or an unstable test), 2 = usage/parse error.
12
+ */
13
+ export interface InitArgs {
14
+ graphFile?: string;
15
+ corpus?: string;
16
+ url?: string;
17
+ out: string;
18
+ }
19
+ /** Parse `init` arguments. Pure and exported so it is unit-testable. */
20
+ export declare function parseInitArgs(argv: string[]): InitArgs;
21
+ export interface QaArgs {
22
+ graphFile?: string;
23
+ corpus?: string;
24
+ capability?: string;
25
+ url: string;
26
+ goal?: string;
27
+ targetName: string;
28
+ baseUrl: string;
29
+ n: number;
30
+ maxSteps?: number;
31
+ outDir: string;
32
+ plan: boolean;
33
+ propose: boolean;
34
+ targetPath?: string;
35
+ base?: string;
36
+ repo?: string;
37
+ }
38
+ /** Parse `qa`/`verify` arguments. Pure and exported so it is unit-testable. */
39
+ export declare function parseQaArgs(argv: string[]): QaArgs;
40
+ export interface ScopedArgs {
41
+ graphFile?: string;
42
+ corpus?: string;
43
+ config: string;
44
+ changed?: string[];
45
+ baseRef?: string;
46
+ url?: string;
47
+ targetName: string;
48
+ n: number;
49
+ maxSteps?: number;
50
+ outDir: string;
51
+ plan: boolean;
52
+ concurrency?: number;
53
+ propose: boolean;
54
+ base?: string;
55
+ repo?: string;
56
+ pr?: number;
57
+ }
58
+ /** Parse `qa --config …` (scoped) arguments. Pure and exported for testing. */
59
+ export declare function parseScopedArgs(argv: string[]): ScopedArgs;
60
+ export declare function main(argv: string[]): Promise<number>;
61
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAgKH,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAID,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,CAmCtD;AAyCD,MAAM,WAAW,MAAM;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd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