@aionis/manifest 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/LICENSE +178 -0
- package/README.md +170 -0
- package/dist/ast/types.d.ts +34 -0
- package/dist/ast/types.js +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +122 -0
- package/dist/compile.d.ts +14 -0
- package/dist/compile.js +219 -0
- package/dist/contracts.d.ts +12610 -0
- package/dist/contracts.js +401 -0
- package/dist/diagnostics/types.d.ts +17 -0
- package/dist/diagnostics/types.js +1 -0
- package/dist/execute/localRuntime.d.ts +5 -0
- package/dist/execute/localRuntime.js +165 -0
- package/dist/execute/moduleRuntime.d.ts +25 -0
- package/dist/execute/moduleRuntime.js +352 -0
- package/dist/execute/types.d.ts +113 -0
- package/dist/execute/types.js +1 -0
- package/dist/execute-cli.d.ts +2 -0
- package/dist/execute-cli.js +112 -0
- package/dist/execute.d.ts +6 -0
- package/dist/execute.js +46 -0
- package/dist/graph/buildExecutionGraph.d.ts +8 -0
- package/dist/graph/buildExecutionGraph.js +69 -0
- package/dist/graph/types.d.ts +24 -0
- package/dist/graph/types.js +1 -0
- package/dist/handoff-store-cli.d.ts +2 -0
- package/dist/handoff-store-cli.js +139 -0
- package/dist/handoff-store.d.ts +103 -0
- package/dist/handoff-store.js +78 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +21 -0
- package/dist/ir/types.d.ts +92 -0
- package/dist/ir/types.js +1 -0
- package/dist/parser/parseAst.d.ts +3 -0
- package/dist/parser/parseAst.js +207 -0
- package/dist/parser/payload.d.ts +6 -0
- package/dist/parser/payload.js +211 -0
- package/dist/plan/buildExecutionPlan.d.ts +9 -0
- package/dist/plan/buildExecutionPlan.js +98 -0
- package/dist/plan/types.d.ts +44 -0
- package/dist/plan/types.js +1 -0
- package/dist/publish-cli.d.ts +2 -0
- package/dist/publish-cli.js +249 -0
- package/dist/publish.d.ts +148 -0
- package/dist/publish.js +190 -0
- package/dist/recover-cli.d.ts +2 -0
- package/dist/recover-cli.js +258 -0
- package/dist/recover.d.ts +489 -0
- package/dist/recover.js +290 -0
- package/dist/refs/resolveRefs.d.ts +13 -0
- package/dist/refs/resolveRefs.js +104 -0
- package/dist/registry/loadModuleRegistry.d.ts +28 -0
- package/dist/registry/loadModuleRegistry.js +97 -0
- package/dist/registry/types.d.ts +20 -0
- package/dist/registry/types.js +2 -0
- package/dist/resume-cli.d.ts +2 -0
- package/dist/resume-cli.js +379 -0
- package/dist/resume.d.ts +2076 -0
- package/dist/resume.js +452 -0
- package/dist/run-cli.d.ts +2 -0
- package/dist/run-cli.js +119 -0
- package/dist/run.d.ts +9 -0
- package/dist/run.js +43 -0
- package/dist/runtime-handoff-cli.d.ts +2 -0
- package/dist/runtime-handoff-cli.js +179 -0
- package/dist/runtime-handoff.d.ts +914 -0
- package/dist/runtime-handoff.js +383 -0
- package/dist/scanner/scanSource.d.ts +9 -0
- package/dist/scanner/scanSource.js +43 -0
- package/dist/schema/validateIrSchemas.d.ts +3 -0
- package/dist/schema/validateIrSchemas.js +64 -0
- package/dist/validate-module-cli.d.ts +2 -0
- package/dist/validate-module-cli.js +93 -0
- package/dist/validate-registry-cli.d.ts +2 -0
- package/dist/validate-registry-cli.js +82 -0
- package/dist/validate.d.ts +52 -0
- package/dist/validate.js +91 -0
- package/fixtures/duplicate-doc.aionis.md +19 -0
- package/fixtures/fenced-example.aionis.md +27 -0
- package/fixtures/malformed-payload.aionis.md +9 -0
- package/fixtures/npm-installed-module-registry.json +17 -0
- package/fixtures/standalone-module-registry.json +13 -0
- package/fixtures/standalone-runner-plan.json +51 -0
- package/fixtures/standalone-runner.aionis.md +29 -0
- package/fixtures/unresolved-ref.aionis.md +14 -0
- package/fixtures/valid-minimal.aionis.md +24 -0
- package/fixtures/valid-workflow.aionis.md +29 -0
- package/official-modules/copy-summary/CHANGELOG.md +6 -0
- package/official-modules/copy-summary/README.md +43 -0
- package/official-modules/copy-summary/index.mjs +41 -0
- package/official-modules/copy-summary/package.json +31 -0
- package/official-modules/json-transform/CHANGELOG.md +6 -0
- package/official-modules/json-transform/README.md +51 -0
- package/official-modules/json-transform/index.mjs +53 -0
- package/official-modules/json-transform/package.json +31 -0
- package/official-modules/research-claims/CHANGELOG.md +6 -0
- package/official-modules/research-claims/README.md +47 -0
- package/official-modules/research-claims/index.mjs +44 -0
- package/official-modules/research-claims/package.json +31 -0
- package/package.json +74 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import process from "node:process";
|
|
5
|
+
import { resumeAionisManifestSource, resumeHandoffStoreRequest, resumePublishedAionisManifest, resumeRecoveredAionisManifest, resumeRuntimeHandoff, } from "./resume.js";
|
|
6
|
+
class CliUsageError extends Error {
|
|
7
|
+
}
|
|
8
|
+
function printHelp() {
|
|
9
|
+
process.stdout.write([
|
|
10
|
+
"resume-aionis-manifest-runtime",
|
|
11
|
+
"",
|
|
12
|
+
"Usage:",
|
|
13
|
+
" resume-aionis-manifest-runtime <input-file> [--input-kind source|runtime-handoff|handoff-store-request|publish-result|recover-result]",
|
|
14
|
+
" [--base-url http://127.0.0.1:3001] [--scope <scope>] [--tenant-id <tenant>]",
|
|
15
|
+
" [--candidate <tool>]... [--query-text <text>] [--run-id <id>]",
|
|
16
|
+
" [--strict|--no-strict] [--include-shadow] [--rules-limit <n>]",
|
|
17
|
+
" [--feedback-outcome positive|negative|neutral] [--feedback-target tool|all]",
|
|
18
|
+
" [--feedback-note <text>] [--feedback-input-text <text>]",
|
|
19
|
+
" [--feedback-selected-tool <tool>] [--feedback-actor <actor>]",
|
|
20
|
+
" [--actor <actor>] [--memory-lane private|shared] [--title <title>] [--tag <tag>]",
|
|
21
|
+
" [--repo-root <path>] [--file-path <path>] [--symbol <name>]",
|
|
22
|
+
" [--current-stage triage|patch|review|resume] [--active-role orchestrator|triage|patch|review|resume]",
|
|
23
|
+
" [--handoff-kind patch_handoff|review_handoff|task_handoff] [--limit <n>]",
|
|
24
|
+
" [--allow-compile-errors] [--timeout-ms <ms>] [--api-key <key>] [--auth-bearer <token>]",
|
|
25
|
+
" [--admin-token <token>] [--request-id <id>] [--out <path>] [--compact]",
|
|
26
|
+
"",
|
|
27
|
+
"Notes:",
|
|
28
|
+
" recover-result mode resumes directly from an existing recover-aionis-manifest-handoff JSON result.",
|
|
29
|
+
" source/runtime-handoff/handoff-store-request/publish-result modes recover first, then call",
|
|
30
|
+
" the public /v1/guide product API with recovered continuity and tool candidates.",
|
|
31
|
+
" If --feedback-outcome is set, the command writes attributed tool feedback through /v1/feedback.",
|
|
32
|
+
" At least one --candidate is required.",
|
|
33
|
+
"",
|
|
34
|
+
].join("\n"));
|
|
35
|
+
}
|
|
36
|
+
function parseArgs(argv) {
|
|
37
|
+
let inputPath = null;
|
|
38
|
+
const flags = {
|
|
39
|
+
inputKind: "recover-result",
|
|
40
|
+
baseUrl: process.env.AIONIS_BASE_URL?.trim() || "http://127.0.0.1:3001",
|
|
41
|
+
scope: process.env.AIONIS_SCOPE?.trim() || null,
|
|
42
|
+
tenantId: null,
|
|
43
|
+
actor: null,
|
|
44
|
+
memoryLane: null,
|
|
45
|
+
title: null,
|
|
46
|
+
tags: [],
|
|
47
|
+
repoRoot: null,
|
|
48
|
+
filePath: null,
|
|
49
|
+
symbol: null,
|
|
50
|
+
currentStage: null,
|
|
51
|
+
activeRole: null,
|
|
52
|
+
handoffKind: null,
|
|
53
|
+
limit: null,
|
|
54
|
+
allowCompileErrors: false,
|
|
55
|
+
timeoutMs: Number(process.env.AIONIS_TIMEOUT_MS || 10_000),
|
|
56
|
+
apiKey: process.env.API_KEY?.trim() || process.env.PERF_API_KEY?.trim() || null,
|
|
57
|
+
authBearer: process.env.AUTH_BEARER?.trim() || process.env.PERF_AUTH_BEARER?.trim() || null,
|
|
58
|
+
adminToken: process.env.ADMIN_TOKEN?.trim() || null,
|
|
59
|
+
requestId: null,
|
|
60
|
+
compact: false,
|
|
61
|
+
help: false,
|
|
62
|
+
outPath: null,
|
|
63
|
+
queryText: null,
|
|
64
|
+
runId: null,
|
|
65
|
+
candidates: [],
|
|
66
|
+
strict: true,
|
|
67
|
+
includeShadow: false,
|
|
68
|
+
rulesLimit: null,
|
|
69
|
+
feedbackOutcome: null,
|
|
70
|
+
feedbackTarget: "tool",
|
|
71
|
+
feedbackNote: null,
|
|
72
|
+
feedbackInputText: null,
|
|
73
|
+
feedbackSelectedTool: null,
|
|
74
|
+
feedbackActor: null,
|
|
75
|
+
};
|
|
76
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
77
|
+
const token = argv[i];
|
|
78
|
+
if (token === "--help" || token === "-h") {
|
|
79
|
+
flags.help = true;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (token === "--compact") {
|
|
83
|
+
flags.compact = true;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (token === "--allow-compile-errors") {
|
|
87
|
+
flags.allowCompileErrors = true;
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (token === "--include-shadow") {
|
|
91
|
+
flags.includeShadow = true;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
if (token === "--no-strict") {
|
|
95
|
+
flags.strict = false;
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
if (token === "--strict") {
|
|
99
|
+
flags.strict = true;
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
if (token === "--tag") {
|
|
103
|
+
const value = argv[i + 1];
|
|
104
|
+
if (!value)
|
|
105
|
+
throw new CliUsageError("Missing value for --tag.");
|
|
106
|
+
flags.tags.push(value);
|
|
107
|
+
i += 1;
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (token === "--candidate") {
|
|
111
|
+
const value = argv[i + 1];
|
|
112
|
+
if (!value)
|
|
113
|
+
throw new CliUsageError("Missing value for --candidate.");
|
|
114
|
+
flags.candidates.push(value);
|
|
115
|
+
i += 1;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
if (token === "--input-kind" ||
|
|
119
|
+
token === "--base-url" ||
|
|
120
|
+
token === "--scope" ||
|
|
121
|
+
token === "--tenant-id" ||
|
|
122
|
+
token === "--actor" ||
|
|
123
|
+
token === "--memory-lane" ||
|
|
124
|
+
token === "--title" ||
|
|
125
|
+
token === "--repo-root" ||
|
|
126
|
+
token === "--file-path" ||
|
|
127
|
+
token === "--symbol" ||
|
|
128
|
+
token === "--current-stage" ||
|
|
129
|
+
token === "--active-role" ||
|
|
130
|
+
token === "--handoff-kind" ||
|
|
131
|
+
token === "--limit" ||
|
|
132
|
+
token === "--timeout-ms" ||
|
|
133
|
+
token === "--api-key" ||
|
|
134
|
+
token === "--auth-bearer" ||
|
|
135
|
+
token === "--admin-token" ||
|
|
136
|
+
token === "--request-id" ||
|
|
137
|
+
token === "--out" ||
|
|
138
|
+
token === "--query-text" ||
|
|
139
|
+
token === "--run-id" ||
|
|
140
|
+
token === "--rules-limit" ||
|
|
141
|
+
token === "--feedback-outcome" ||
|
|
142
|
+
token === "--feedback-target" ||
|
|
143
|
+
token === "--feedback-note" ||
|
|
144
|
+
token === "--feedback-input-text" ||
|
|
145
|
+
token === "--feedback-selected-tool" ||
|
|
146
|
+
token === "--feedback-actor") {
|
|
147
|
+
const value = argv[i + 1];
|
|
148
|
+
if (!value)
|
|
149
|
+
throw new CliUsageError(`Missing value for ${token}.`);
|
|
150
|
+
switch (token) {
|
|
151
|
+
case "--input-kind":
|
|
152
|
+
if (!["source", "runtime-handoff", "handoff-store-request", "publish-result", "recover-result"].includes(value)) {
|
|
153
|
+
throw new CliUsageError(`Unsupported input kind '${value}'.`);
|
|
154
|
+
}
|
|
155
|
+
flags.inputKind = value;
|
|
156
|
+
break;
|
|
157
|
+
case "--base-url":
|
|
158
|
+
flags.baseUrl = value;
|
|
159
|
+
break;
|
|
160
|
+
case "--scope":
|
|
161
|
+
flags.scope = value;
|
|
162
|
+
break;
|
|
163
|
+
case "--tenant-id":
|
|
164
|
+
flags.tenantId = value;
|
|
165
|
+
break;
|
|
166
|
+
case "--actor":
|
|
167
|
+
flags.actor = value;
|
|
168
|
+
break;
|
|
169
|
+
case "--memory-lane":
|
|
170
|
+
if (value !== "private" && value !== "shared")
|
|
171
|
+
throw new CliUsageError(`Unsupported memory lane '${value}'.`);
|
|
172
|
+
flags.memoryLane = value;
|
|
173
|
+
break;
|
|
174
|
+
case "--title":
|
|
175
|
+
flags.title = value;
|
|
176
|
+
break;
|
|
177
|
+
case "--repo-root":
|
|
178
|
+
flags.repoRoot = value;
|
|
179
|
+
break;
|
|
180
|
+
case "--file-path":
|
|
181
|
+
flags.filePath = value;
|
|
182
|
+
break;
|
|
183
|
+
case "--symbol":
|
|
184
|
+
flags.symbol = value;
|
|
185
|
+
break;
|
|
186
|
+
case "--current-stage":
|
|
187
|
+
if (!["triage", "patch", "review", "resume"].includes(value)) {
|
|
188
|
+
throw new CliUsageError(`Unsupported current stage '${value}'.`);
|
|
189
|
+
}
|
|
190
|
+
flags.currentStage = value;
|
|
191
|
+
break;
|
|
192
|
+
case "--active-role":
|
|
193
|
+
if (!["orchestrator", "triage", "patch", "review", "resume"].includes(value)) {
|
|
194
|
+
throw new CliUsageError(`Unsupported active role '${value}'.`);
|
|
195
|
+
}
|
|
196
|
+
flags.activeRole = value;
|
|
197
|
+
break;
|
|
198
|
+
case "--handoff-kind":
|
|
199
|
+
if (!["patch_handoff", "review_handoff", "task_handoff"].includes(value)) {
|
|
200
|
+
throw new CliUsageError(`Unsupported handoff kind '${value}'.`);
|
|
201
|
+
}
|
|
202
|
+
flags.handoffKind = value;
|
|
203
|
+
break;
|
|
204
|
+
case "--limit":
|
|
205
|
+
flags.limit = Number(value);
|
|
206
|
+
break;
|
|
207
|
+
case "--timeout-ms":
|
|
208
|
+
flags.timeoutMs = Number(value);
|
|
209
|
+
break;
|
|
210
|
+
case "--api-key":
|
|
211
|
+
flags.apiKey = value;
|
|
212
|
+
break;
|
|
213
|
+
case "--auth-bearer":
|
|
214
|
+
flags.authBearer = value;
|
|
215
|
+
break;
|
|
216
|
+
case "--admin-token":
|
|
217
|
+
flags.adminToken = value;
|
|
218
|
+
break;
|
|
219
|
+
case "--request-id":
|
|
220
|
+
flags.requestId = value;
|
|
221
|
+
break;
|
|
222
|
+
case "--out":
|
|
223
|
+
flags.outPath = value;
|
|
224
|
+
break;
|
|
225
|
+
case "--query-text":
|
|
226
|
+
flags.queryText = value;
|
|
227
|
+
break;
|
|
228
|
+
case "--run-id":
|
|
229
|
+
flags.runId = value;
|
|
230
|
+
break;
|
|
231
|
+
case "--rules-limit":
|
|
232
|
+
flags.rulesLimit = Number(value);
|
|
233
|
+
break;
|
|
234
|
+
case "--feedback-outcome":
|
|
235
|
+
if (!["positive", "negative", "neutral"].includes(value)) {
|
|
236
|
+
throw new CliUsageError(`Unsupported feedback outcome '${value}'.`);
|
|
237
|
+
}
|
|
238
|
+
flags.feedbackOutcome = value;
|
|
239
|
+
break;
|
|
240
|
+
case "--feedback-target":
|
|
241
|
+
if (value !== "tool" && value !== "all")
|
|
242
|
+
throw new CliUsageError(`Unsupported feedback target '${value}'.`);
|
|
243
|
+
flags.feedbackTarget = value;
|
|
244
|
+
break;
|
|
245
|
+
case "--feedback-note":
|
|
246
|
+
flags.feedbackNote = value;
|
|
247
|
+
break;
|
|
248
|
+
case "--feedback-input-text":
|
|
249
|
+
flags.feedbackInputText = value;
|
|
250
|
+
break;
|
|
251
|
+
case "--feedback-selected-tool":
|
|
252
|
+
flags.feedbackSelectedTool = value;
|
|
253
|
+
break;
|
|
254
|
+
case "--feedback-actor":
|
|
255
|
+
flags.feedbackActor = value;
|
|
256
|
+
break;
|
|
257
|
+
default:
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
i += 1;
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
if (token.startsWith("--"))
|
|
264
|
+
throw new CliUsageError(`Unknown flag '${token}'.`);
|
|
265
|
+
if (inputPath)
|
|
266
|
+
throw new CliUsageError("Only one input file may be provided.");
|
|
267
|
+
inputPath = token;
|
|
268
|
+
}
|
|
269
|
+
return { inputPath, flags };
|
|
270
|
+
}
|
|
271
|
+
async function main() {
|
|
272
|
+
const { inputPath, flags } = parseArgs(process.argv.slice(2));
|
|
273
|
+
if (flags.help) {
|
|
274
|
+
printHelp();
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
if (!inputPath)
|
|
278
|
+
throw new CliUsageError("An input file path is required.");
|
|
279
|
+
if (flags.candidates.length === 0)
|
|
280
|
+
throw new CliUsageError("At least one --candidate is required.");
|
|
281
|
+
const resolvedInput = resolve(process.cwd(), inputPath);
|
|
282
|
+
const inputText = await readFile(resolvedInput, "utf8");
|
|
283
|
+
const baseArgs = {
|
|
284
|
+
baseUrl: flags.baseUrl,
|
|
285
|
+
scope: flags.scope ?? undefined,
|
|
286
|
+
tenantId: flags.tenantId ?? undefined,
|
|
287
|
+
queryText: flags.queryText ?? undefined,
|
|
288
|
+
runId: flags.runId ?? undefined,
|
|
289
|
+
candidates: flags.candidates,
|
|
290
|
+
strict: flags.strict,
|
|
291
|
+
includeShadow: flags.includeShadow,
|
|
292
|
+
rulesLimit: flags.rulesLimit ?? undefined,
|
|
293
|
+
feedbackOutcome: flags.feedbackOutcome ?? undefined,
|
|
294
|
+
feedbackTarget: flags.feedbackTarget,
|
|
295
|
+
feedbackNote: flags.feedbackNote ?? undefined,
|
|
296
|
+
feedbackInputText: flags.feedbackInputText ?? undefined,
|
|
297
|
+
feedbackSelectedTool: flags.feedbackSelectedTool ?? undefined,
|
|
298
|
+
feedbackActor: flags.feedbackActor ?? undefined,
|
|
299
|
+
timeoutMs: flags.timeoutMs,
|
|
300
|
+
apiKey: flags.apiKey ?? undefined,
|
|
301
|
+
authBearer: flags.authBearer ?? undefined,
|
|
302
|
+
adminToken: flags.adminToken ?? undefined,
|
|
303
|
+
requestId: flags.requestId ?? undefined,
|
|
304
|
+
};
|
|
305
|
+
let result;
|
|
306
|
+
switch (flags.inputKind) {
|
|
307
|
+
case "source":
|
|
308
|
+
result = await resumeAionisManifestSource({
|
|
309
|
+
...baseArgs,
|
|
310
|
+
source: inputText,
|
|
311
|
+
inputPath: resolvedInput,
|
|
312
|
+
actor: flags.actor ?? undefined,
|
|
313
|
+
memoryLane: flags.memoryLane ?? undefined,
|
|
314
|
+
title: flags.title ?? undefined,
|
|
315
|
+
tags: flags.tags,
|
|
316
|
+
repoRoot: flags.repoRoot,
|
|
317
|
+
filePath: flags.filePath,
|
|
318
|
+
symbol: flags.symbol,
|
|
319
|
+
currentStage: flags.currentStage ?? undefined,
|
|
320
|
+
activeRole: flags.activeRole ?? undefined,
|
|
321
|
+
handoffKind: flags.handoffKind ?? undefined,
|
|
322
|
+
limit: flags.limit ?? undefined,
|
|
323
|
+
allowCompileErrors: flags.allowCompileErrors,
|
|
324
|
+
});
|
|
325
|
+
break;
|
|
326
|
+
case "runtime-handoff":
|
|
327
|
+
result = await resumeRuntimeHandoff({
|
|
328
|
+
...baseArgs,
|
|
329
|
+
runtimeHandoff: JSON.parse(inputText),
|
|
330
|
+
actor: flags.actor ?? undefined,
|
|
331
|
+
memoryLane: flags.memoryLane ?? undefined,
|
|
332
|
+
title: flags.title ?? undefined,
|
|
333
|
+
tags: flags.tags,
|
|
334
|
+
repoRoot: flags.repoRoot,
|
|
335
|
+
filePath: flags.filePath,
|
|
336
|
+
symbol: flags.symbol,
|
|
337
|
+
handoffKind: flags.handoffKind ?? undefined,
|
|
338
|
+
limit: flags.limit ?? undefined,
|
|
339
|
+
});
|
|
340
|
+
break;
|
|
341
|
+
case "handoff-store-request":
|
|
342
|
+
result = await resumeHandoffStoreRequest({
|
|
343
|
+
...baseArgs,
|
|
344
|
+
handoffStoreRequest: JSON.parse(inputText),
|
|
345
|
+
repoRoot: flags.repoRoot,
|
|
346
|
+
filePath: flags.filePath,
|
|
347
|
+
symbol: flags.symbol,
|
|
348
|
+
handoffKind: flags.handoffKind ?? undefined,
|
|
349
|
+
limit: flags.limit ?? undefined,
|
|
350
|
+
});
|
|
351
|
+
break;
|
|
352
|
+
case "publish-result":
|
|
353
|
+
result = await resumePublishedAionisManifest({
|
|
354
|
+
...baseArgs,
|
|
355
|
+
publishResult: JSON.parse(inputText),
|
|
356
|
+
});
|
|
357
|
+
break;
|
|
358
|
+
case "recover-result":
|
|
359
|
+
default:
|
|
360
|
+
result = await resumeRecoveredAionisManifest({
|
|
361
|
+
...baseArgs,
|
|
362
|
+
recoverResult: JSON.parse(inputText),
|
|
363
|
+
});
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
const output = JSON.stringify(result, null, flags.compact ? 0 : 2);
|
|
367
|
+
if (flags.outPath) {
|
|
368
|
+
const resolvedOut = resolve(process.cwd(), flags.outPath);
|
|
369
|
+
await writeFile(resolvedOut, `${output}\n`, "utf8");
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
process.stdout.write(`${output}\n`);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
main().catch((error) => {
|
|
376
|
+
const message = error instanceof CliUsageError ? error.message : error instanceof Error ? error.message : String(error);
|
|
377
|
+
process.stderr.write(`${message}\n`);
|
|
378
|
+
process.exit(error instanceof CliUsageError ? 2 : 1);
|
|
379
|
+
});
|