@cassiomc1/forgeloop 1.3.0 → 1.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.
- package/.github/copilot-instructions.md +1 -0
- package/AGENTS.md +1 -0
- package/CLAUDE.md +1 -0
- package/DOCS_INDEX.md +20 -8
- package/EXECUTION_STATE.md +60 -0
- package/LOOP_ENGINEERING.md +135 -5
- package/LOOP_SYSTEM_DESIGN.md +54 -1
- package/PROTOCOL_INTEGRATION.md +87 -0
- package/QUALITY_SCORECARD.md +2 -0
- package/README.md +69 -9
- package/TERMINOLOGY.md +15 -0
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/THREAT_MODEL.md +59 -1
- package/docs/ARTIFACT_REFERENCE.md +183 -0
- package/docs/CLI_REFERENCE.md +391 -6
- package/docs/CROSS_HARNESS_CONTINUITY.md +23 -0
- package/docs/DIAGNOSTIC_MODEL.md +181 -0
- package/docs/DOCUMENTATION_GUIDE.md +36 -13
- package/docs/EXECUTION_TRACE.md +76 -0
- package/docs/GETTING_STARTED.md +1 -0
- package/docs/MCP.md +159 -0
- package/docs/RECIPES.md +149 -0
- package/docs/RELEASE_CHECKLIST_1_4.md +38 -0
- package/docs/RELEASE_CHECKLIST_1_5_MCP.md +78 -0
- package/docs/TROUBLESHOOTING.md +217 -3
- package/docs/UNIVERSAL_INTEGRATION.md +48 -0
- package/docs/assets/diagrams/forgeloop-engineering-flow.html +13797 -0
- package/docs/assets/diagrams/forgeloop-engineering-flow.receipt.json +37 -0
- package/docs/assets/diagrams/forgeloop-engineering-flow.svg +5002 -0
- package/docs/diagrams/README.md +55 -0
- package/docs/diagrams/forgeloop-engineering-flow.workflow.json +122 -0
- package/docs/diagrams/manifest.json +42 -0
- package/docs/diagrams/reviews/forgeloop-engineering-flow.review.json +20 -0
- package/package.json +21 -8
- package/schemas/action.schema.json +100 -0
- package/schemas/approval.schema.json +51 -0
- package/schemas/capability-policy.schema.json +41 -0
- package/schemas/diagnostic-case.schema.json +85 -0
- package/schemas/execution-receipt.schema.json +16 -0
- package/schemas/hypothesis-disposition.schema.json +16 -0
- package/schemas/intervention.schema.json +27 -0
- package/schemas/policy-lock.schema.json +1 -0
- package/schemas/policy-snapshot.schema.json +2 -0
- package/schemas/task-recovery.schema.json +61 -0
- package/schemas/trajectory-evaluation.schema.json +64 -0
- package/schemas/trajectory-scenario.schema.json +42 -0
- package/src/cli.js +267 -347
- package/src/commands/action-authorize.js +41 -0
- package/src/commands/action-propose.js +10 -0
- package/src/commands/action-reconcile.js +10 -0
- package/src/commands/action-record.js +47 -0
- package/src/commands/action-show.js +10 -0
- package/src/commands/action-verify.js +10 -0
- package/src/commands/advance.js +7 -2
- package/src/commands/approval-request.js +64 -0
- package/src/commands/approval-resolve.js +10 -0
- package/src/commands/audit.js +5 -0
- package/src/commands/baseline.js +3 -3
- package/src/commands/eval.js +6 -0
- package/src/commands/history.js +18 -0
- package/src/commands/init.js +2 -2
- package/src/commands/inspect.js +55 -0
- package/src/commands/metrics.js +7 -0
- package/src/commands/next.js +8 -2
- package/src/commands/policy-discover.js +2 -2
- package/src/commands/progress.js +6 -2
- package/src/commands/record-diagnosis.js +37 -1
- package/src/commands/record-hypothesis-disposition.js +45 -0
- package/src/commands/record-intervention.js +35 -0
- package/src/commands/reflect.js +38 -0
- package/src/commands/report.js +9 -1
- package/src/commands/run-action.js +18 -0
- package/src/commands/status.js +17 -0
- package/src/commands/task-create.js +39 -1
- package/src/commands/task-list.js +14 -1
- package/src/commands/task-lock-status.js +2 -2
- package/src/commands/task-recover.js +202 -0
- package/src/commands/task-repair-legacy-recovery.js +417 -0
- package/src/commands/task-resume.js +172 -0
- package/src/commands/task-scope.js +23 -4
- package/src/commands/task-show.js +18 -4
- package/src/commands/trace.js +34 -0
- package/src/commands/validate-protocol.js +40 -15
- package/src/core/action-authorization.js +106 -0
- package/src/core/action-constants.js +86 -0
- package/src/core/action-execution.js +105 -0
- package/src/core/action-ledger-projection.js +302 -0
- package/src/core/action-model.js +581 -0
- package/src/core/action-readiness.js +141 -0
- package/src/core/action-reconciliation-policy.js +49 -0
- package/src/core/action-reconciliation.js +66 -0
- package/src/core/action-verification.js +111 -0
- package/src/core/actions.js +462 -0
- package/src/core/approvals.js +405 -0
- package/src/core/artifact-registry.js +60 -0
- package/src/core/audit.js +45 -4
- package/src/core/bundles.js +30 -0
- package/src/core/capability-policy.js +226 -0
- package/src/core/cli-command-definitions.js +260 -5
- package/src/core/command-executors.js +543 -0
- package/src/core/command-input.js +107 -0
- package/src/core/command-runtime.js +117 -0
- package/src/core/completion-artifacts.js +39 -15
- package/src/core/completion-ownership.js +88 -0
- package/src/core/completion-recovery-rebind.js +194 -0
- package/src/core/completion.js +70 -0
- package/src/core/continuity-reconciliation.js +24 -5
- package/src/core/diagnostic-model.js +396 -0
- package/src/core/diagnostic-projection.js +51 -0
- package/src/core/diagnostic-record.js +360 -0
- package/src/core/error-codes.js +461 -1
- package/src/core/events.js +171 -2
- package/src/core/execution-prerequisites.js +4 -1
- package/src/core/execution.js +26 -188
- package/src/core/failure-signature.js +70 -0
- package/src/core/failure-surface.js +57 -0
- package/src/core/filesystem.js +55 -6
- package/src/core/history.js +110 -0
- package/src/core/hypothesis-projection.js +85 -0
- package/src/core/information-gain-projection.js +283 -0
- package/src/core/information-gain.js +138 -0
- package/src/core/inspect.js +132 -7
- package/src/core/integration-invocation-policy.js +217 -0
- package/src/core/integration-limits.js +20 -0
- package/src/core/integration-resources.js +178 -0
- package/src/core/next-action-model.js +94 -0
- package/src/core/next-action.js +490 -3
- package/src/core/phase.js +42 -22
- package/src/core/policy-engine.js +113 -6
- package/src/core/preflight-consistency.js +31 -5
- package/src/core/preflight.js +19 -2
- package/src/core/prepared-execution.js +227 -0
- package/src/core/progress.js +41 -4
- package/src/core/project-root.js +21 -0
- package/src/core/protocol-info.js +61 -0
- package/src/core/protocol.js +14 -0
- package/src/core/receipt.js +1 -0
- package/src/core/reconcile-closure.js +35 -10
- package/src/core/recovery-history.js +116 -0
- package/src/core/reflection.js +305 -0
- package/src/core/resumability.js +57 -3
- package/src/core/schema-validation.js +9 -0
- package/src/core/strategy-analysis.js +97 -0
- package/src/core/task-claim-state.js +272 -0
- package/src/core/task-command.js +5 -1
- package/src/core/task-conflict-inspection.js +321 -0
- package/src/core/task-context.js +32 -29
- package/src/core/task-discovery.js +14 -1
- package/src/core/task-lock.js +216 -22
- package/src/core/task-paths.js +31 -2
- package/src/core/task-recovery-migration.js +192 -0
- package/src/core/task-recovery.js +205 -0
- package/src/core/task-scope.js +33 -1
- package/src/core/task-snapshot.js +53 -0
- package/src/core/templates.js +9 -0
- package/src/core/trace.js +548 -0
- package/src/core/trajectory-evaluation.js +71 -0
- package/src/core/trajectory-metrics.js +80 -0
- package/src/core/transaction.js +36 -2
- package/src/core/work-state.js +10 -5
- package/src/integration.js +47 -0
- package/docs/assets/forgeloop-flow.svg +0 -1
- package/docs/forgeloop-flow.mmd +0 -51
package/src/cli.js
CHANGED
|
@@ -4,53 +4,71 @@ import { readFile } from "node:fs/promises";
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
7
|
+
import { formatStatusResult } from "./commands/status.js";
|
|
8
|
+
import { formatValidateStateResult } from "./commands/validate-state.js";
|
|
9
|
+
import { formatClearStateResult } from "./commands/clear-state.js";
|
|
10
|
+
import { formatInspectResult } from "./commands/inspect.js";
|
|
11
|
+
import { formatRouteResult } from "./commands/route.js";
|
|
12
|
+
import { formatValidateProtocolResult } from "./commands/validate-protocol.js";
|
|
13
|
+
import { formatActivateResult } from "./commands/activate.js";
|
|
14
|
+
import { formatAdvanceResult } from "./commands/advance.js";
|
|
15
|
+
import { formatPreflightResult } from "./commands/preflight.js";
|
|
16
|
+
import { formatCompleteResult } from "./commands/complete.js";
|
|
17
|
+
import { formatAuditResult } from "./commands/audit.js";
|
|
18
|
+
import { formatReportResult } from "./commands/report.js";
|
|
19
|
+
import { formatPolicyResult } from "./commands/policy.js";
|
|
20
|
+
import { formatPolicyDiscoverResult } from "./commands/policy-discover.js";
|
|
21
|
+
import { formatPolicyStatusResult } from "./commands/policy-status.js";
|
|
22
|
+
import { formatPolicyDiffResult } from "./commands/policy-diff.js";
|
|
23
|
+
import { formatRuleVerifyResult } from "./commands/rule-verify.js";
|
|
24
|
+
import { formatBaselineResult } from "./commands/baseline.js";
|
|
25
|
+
import { formatProfileInterviewResult } from "./commands/profile-interview.js";
|
|
26
|
+
import { formatBundleResult } from "./commands/bundle.js";
|
|
27
|
+
import { formatPrepareCompletionResult } from "./commands/prepare-completion.js";
|
|
28
|
+
import { formatRecordCheckResult } from "./commands/record-check.js";
|
|
29
|
+
import { formatRunCheckResult } from "./commands/run-check.js";
|
|
30
|
+
import { formatRunActionResult } from "./commands/run-action.js";
|
|
31
|
+
import { formatActionProposeResult } from "./commands/action-propose.js";
|
|
32
|
+
import { formatActionRecordResult } from "./commands/action-record.js";
|
|
33
|
+
import { formatActionAuthorizeResult } from "./commands/action-authorize.js";
|
|
34
|
+
import { formatActionVerifyResult } from "./commands/action-verify.js";
|
|
35
|
+
import { formatActionShowResult } from "./commands/action-show.js";
|
|
36
|
+
import { formatActionReconcileResult } from "./commands/action-reconcile.js";
|
|
37
|
+
import { formatMetricsResult } from "./commands/metrics.js";
|
|
38
|
+
import { formatEvalResult } from "./commands/eval.js";
|
|
39
|
+
import { formatApprovalRequestResult } from "./commands/approval-request.js";
|
|
40
|
+
import { formatApprovalResolveResult } from "./commands/approval-resolve.js";
|
|
41
|
+
import { formatReconcileClosureResult } from "./commands/reconcile-closure.js";
|
|
42
|
+
import { formatRecordTerminalResult } from "./commands/record-terminal-result.js";
|
|
43
|
+
import { formatRecordDiagnosisResult } from "./commands/record-diagnosis.js";
|
|
44
|
+
import { formatRecordInterventionResult } from "./commands/record-intervention.js";
|
|
45
|
+
import { formatRecordHypothesisDispositionResult } from "./commands/record-hypothesis-disposition.js";
|
|
46
|
+
import { formatHistoryResult } from "./commands/history.js";
|
|
47
|
+
import { formatTraceResult } from "./commands/trace.js";
|
|
48
|
+
import { formatReflectResult } from "./commands/reflect.js";
|
|
49
|
+
import { formatProgressResult } from "./commands/progress.js";
|
|
50
|
+
import { formatRecordDecisionCriterionResult } from "./commands/record-decision-criterion.js";
|
|
51
|
+
import { formatNextActionResult } from "./commands/next.js";
|
|
52
|
+
import { formatContinuityResult } from "./commands/continuity.js";
|
|
53
|
+
import { formatRecordContinuityResult } from "./commands/record-continuity.js";
|
|
54
|
+
import { formatReconcileContinuityResult } from "./commands/reconcile-continuity.js";
|
|
55
|
+
import { formatClearContinuityResult } from "./commands/clear-continuity.js";
|
|
56
|
+
import { formatTaskCreateResult } from "./commands/task-create.js";
|
|
57
|
+
import { formatTaskListResult } from "./commands/task-list.js";
|
|
58
|
+
import { formatTaskShowResult } from "./commands/task-show.js";
|
|
59
|
+
import { formatTaskScopeResult } from "./commands/task-scope.js";
|
|
60
|
+
import { formatTaskMigrateResult } from "./commands/task-migrate.js";
|
|
61
|
+
import { formatMigrateProtocolResult } from "./commands/migrate-protocol.js";
|
|
62
|
+
import { formatTaskUnlockResult } from "./commands/task-unlock.js";
|
|
63
|
+
import { formatTaskRecoverResult } from "./commands/task-recover.js";
|
|
64
|
+
import { formatTaskResumeResult } from "./commands/task-resume.js";
|
|
65
|
+
import {
|
|
66
|
+
formatTaskRepairLegacyRecoveryResult,
|
|
67
|
+
} from "./commands/task-repair-legacy-recovery.js";
|
|
68
|
+
import { formatTaskLockStatusResult } from "./commands/task-lock-status.js";
|
|
69
|
+
import { formatProtocolInfoResult } from "./commands/protocol-info.js";
|
|
70
|
+
import { defaultCommandInputValues, validateForgeLoopCommandInput } from "./core/command-input.js";
|
|
71
|
+
import { COMMAND_EXECUTORS } from "./core/command-executors.js";
|
|
54
72
|
import { resolveTarget } from "./core/filesystem.js";
|
|
55
73
|
import { getPackageRoot } from "./core/templates.js";
|
|
56
74
|
import { CLI_COMMAND_DEFINITIONS, buildOptionLookup, getPositionalDefinitions } from "./core/cli-command-definitions.js";
|
|
@@ -196,48 +214,7 @@ export function discoverCommand(argv) {
|
|
|
196
214
|
}
|
|
197
215
|
|
|
198
216
|
export function parseCliSyntax(argv) {
|
|
199
|
-
const options =
|
|
200
|
-
path: ".",
|
|
201
|
-
dryRun: false,
|
|
202
|
-
json: false,
|
|
203
|
-
strict: false,
|
|
204
|
-
fix: false,
|
|
205
|
-
adopt: [],
|
|
206
|
-
work: null,
|
|
207
|
-
surfaces: [],
|
|
208
|
-
risks: [],
|
|
209
|
-
platforms: [],
|
|
210
|
-
behaviorChange: false,
|
|
211
|
-
executableChange: false,
|
|
212
|
-
to: null,
|
|
213
|
-
file: null,
|
|
214
|
-
contractFile: null,
|
|
215
|
-
routeFile: null,
|
|
216
|
-
stateFile: null,
|
|
217
|
-
receiptFile: null,
|
|
218
|
-
continuityFile: null,
|
|
219
|
-
...continuityOptionDefaults(),
|
|
220
|
-
taskBriefFiles: [],
|
|
221
|
-
delegatedResultFiles: [],
|
|
222
|
-
checkId: null,
|
|
223
|
-
checkKind: null,
|
|
224
|
-
checkRequirement: null,
|
|
225
|
-
checkStatus: null,
|
|
226
|
-
checkEvidenceKind: null,
|
|
227
|
-
checkCommand: null,
|
|
228
|
-
checkResult: null,
|
|
229
|
-
checkExitCode: null,
|
|
230
|
-
checkDetails: null,
|
|
231
|
-
checkExecutionRef: null,
|
|
232
|
-
checkProvenance: null,
|
|
233
|
-
commandArgv: [],
|
|
234
|
-
checkType: null,
|
|
235
|
-
checkSource: null,
|
|
236
|
-
policy: null,
|
|
237
|
-
task: null,
|
|
238
|
-
help: false,
|
|
239
|
-
version: false,
|
|
240
|
-
};
|
|
217
|
+
const options = defaultCommandInputValues();
|
|
241
218
|
|
|
242
219
|
const command = discoverCommand(argv);
|
|
243
220
|
const bootstrapLookup = buildOptionLookup(null);
|
|
@@ -314,53 +291,7 @@ export function parseCliSyntax(argv) {
|
|
|
314
291
|
}
|
|
315
292
|
|
|
316
293
|
export function validateCliSemantics({ command, options } = {}) {
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
if (command === "policy" && !options.policy) {
|
|
320
|
-
throw new Error("policy requires a name");
|
|
321
|
-
}
|
|
322
|
-
if (command !== "policy" && options.policy) {
|
|
323
|
-
throw new Error(`Policy name is not valid for ${command}`);
|
|
324
|
-
}
|
|
325
|
-
if (command === "bundle" && !options.task) {
|
|
326
|
-
throw new Error("bundle requires --task");
|
|
327
|
-
}
|
|
328
|
-
if (command === "task-create" && !options.task) {
|
|
329
|
-
throw new Error("task-create requires --task");
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
validateContinuityOptions(command, options);
|
|
333
|
-
|
|
334
|
-
if (command === "record-check" && !options.help) {
|
|
335
|
-
if (!options.checkId) throw new Error("record-check requires --id");
|
|
336
|
-
if (!options.checkRequirement) throw new Error("record-check requires --requirement");
|
|
337
|
-
if (!options.checkStatus) throw new Error("record-check requires --status");
|
|
338
|
-
if (!options.checkEvidenceKind) throw new Error("record-check requires --evidence-kind");
|
|
339
|
-
if (!options.checkCommand && !options.checkResult) throw new Error("record-check requires --command or --result");
|
|
340
|
-
}
|
|
341
|
-
if (command === "run-check" && !options.help) {
|
|
342
|
-
if (!options.checkId) throw new Error("run-check requires --id");
|
|
343
|
-
if (!options.checkRequirement) throw new Error("run-check requires --requirement");
|
|
344
|
-
if (options.checkKind || options.checkStatus || options.checkEvidenceKind || options.checkCommand
|
|
345
|
-
|| options.checkResult || options.checkExitCode !== null || options.checkExecutionRef || options.checkProvenance) {
|
|
346
|
-
throw new Error("run-check accepts only --id, --requirement, --details, --timeout-ms, and -- <argv>");
|
|
347
|
-
}
|
|
348
|
-
if (!Array.isArray(options.commandArgv) || options.commandArgv.length === 0) {
|
|
349
|
-
throw new Error("run-check requires -- followed by an exact command argv");
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
if (command === "reconcile-closure" && !options.help) {
|
|
353
|
-
if (!options.task) throw new Error("reconcile-closure requires --task");
|
|
354
|
-
if (!options.checkId) throw new Error("reconcile-closure requires --id");
|
|
355
|
-
if (!options.checkRequirement) throw new Error("reconcile-closure requires --requirement");
|
|
356
|
-
if (options.checkKind || options.checkStatus || options.checkEvidenceKind || options.checkCommand
|
|
357
|
-
|| options.checkResult || options.checkExitCode !== null || options.checkExecutionRef || options.checkProvenance) {
|
|
358
|
-
throw new Error("reconcile-closure accepts only --id, --requirement, --details, and -- <argv>");
|
|
359
|
-
}
|
|
360
|
-
if (!Array.isArray(options.commandArgv) || options.commandArgv.length === 0) {
|
|
361
|
-
throw new Error("reconcile-closure requires -- followed by an exact command argv");
|
|
362
|
-
}
|
|
363
|
-
}
|
|
294
|
+
validateForgeLoopCommandInput({ command, input: options, help: options?.help ?? false });
|
|
364
295
|
}
|
|
365
296
|
|
|
366
297
|
export function parseArgs(argv) {
|
|
@@ -383,25 +314,23 @@ function printActions(actions) {
|
|
|
383
314
|
}
|
|
384
315
|
}
|
|
385
316
|
|
|
317
|
+
function renderJsonOr(options, result, formatter) {
|
|
318
|
+
console.log(options.json ? JSON.stringify(result, null, 2) : formatter(result));
|
|
319
|
+
}
|
|
320
|
+
|
|
386
321
|
export const COMMAND_HANDLERS = Object.freeze({
|
|
387
322
|
"protocol-info": async ({ packageVersion, options }) => {
|
|
388
|
-
const result = await
|
|
389
|
-
|
|
323
|
+
const { result } = await COMMAND_EXECUTORS["protocol-info"]({ packageVersion, options });
|
|
324
|
+
renderJsonOr(options, result, formatProtocolInfoResult);
|
|
390
325
|
return 0;
|
|
391
326
|
},
|
|
392
327
|
init: async ({ target, packageRoot, packageVersion, options }) => {
|
|
393
|
-
const result = await
|
|
328
|
+
const { result } = await COMMAND_EXECUTORS.init({ target, packageRoot, packageVersion, options });
|
|
394
329
|
printActions(result.actions);
|
|
395
330
|
return 0;
|
|
396
331
|
},
|
|
397
332
|
doctor: async ({ target, packageRoot, options }) => {
|
|
398
|
-
const result = await
|
|
399
|
-
target,
|
|
400
|
-
packageRoot,
|
|
401
|
-
adoptPaths: options.adopt,
|
|
402
|
-
strict: options.strict,
|
|
403
|
-
fix: options.fix,
|
|
404
|
-
});
|
|
333
|
+
const { result } = await COMMAND_EXECUTORS.doctor({ target, packageRoot, options });
|
|
405
334
|
if (options.json) {
|
|
406
335
|
console.log(JSON.stringify(result, null, 2));
|
|
407
336
|
} else {
|
|
@@ -413,328 +342,319 @@ export const COMMAND_HANDLERS = Object.freeze({
|
|
|
413
342
|
return result.ok ? 0 : 1;
|
|
414
343
|
},
|
|
415
344
|
route: async ({ target, packageRoot, options }) => {
|
|
416
|
-
const result = await
|
|
417
|
-
|
|
418
|
-
packageRoot,
|
|
419
|
-
workType: options.work,
|
|
420
|
-
surfaces: options.surfaces,
|
|
421
|
-
risks: options.risks,
|
|
422
|
-
platforms: options.platforms,
|
|
423
|
-
behaviorChange: options.behaviorChange,
|
|
424
|
-
executableChange: options.executableChange,
|
|
425
|
-
taskId: options.task,
|
|
426
|
-
});
|
|
427
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatRouteResult(result));
|
|
345
|
+
const { result } = await COMMAND_EXECUTORS.route({ target, packageRoot, options });
|
|
346
|
+
renderJsonOr(options, result, formatRouteResult);
|
|
428
347
|
return 0;
|
|
429
348
|
},
|
|
430
349
|
activate: async ({ target, packageRoot, options }) => {
|
|
431
|
-
const result = await
|
|
432
|
-
|
|
350
|
+
const { result } = await COMMAND_EXECUTORS.activate({ target, packageRoot, options });
|
|
351
|
+
renderJsonOr(options, result, formatActivateResult);
|
|
433
352
|
return 0;
|
|
434
353
|
},
|
|
435
354
|
preflight: async ({ target, packageRoot, options }) => {
|
|
436
|
-
const result = await
|
|
437
|
-
|
|
438
|
-
return
|
|
355
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.preflight({ target, packageRoot, options });
|
|
356
|
+
renderJsonOr(options, result, formatPreflightResult);
|
|
357
|
+
return exitCode;
|
|
439
358
|
},
|
|
440
359
|
advance: async ({ target, packageRoot, options }) => {
|
|
441
|
-
const result = await
|
|
442
|
-
|
|
360
|
+
const { result } = await COMMAND_EXECUTORS.advance({ target, packageRoot, options });
|
|
361
|
+
renderJsonOr(options, result, formatAdvanceResult);
|
|
443
362
|
return 0;
|
|
444
363
|
},
|
|
445
364
|
next: async ({ target, packageRoot, options }) => {
|
|
446
|
-
const result = await
|
|
447
|
-
|
|
365
|
+
const { result } = await COMMAND_EXECUTORS.next({ target, packageRoot, options });
|
|
366
|
+
renderJsonOr(options, result, formatNextActionResult);
|
|
448
367
|
return 0;
|
|
449
368
|
},
|
|
450
369
|
continuity: async ({ target, packageRoot, options }) => {
|
|
451
|
-
const result = await
|
|
452
|
-
|
|
370
|
+
const { result } = await COMMAND_EXECUTORS.continuity({ target, packageRoot, options });
|
|
371
|
+
renderJsonOr(options, result, formatContinuityResult);
|
|
453
372
|
return 0;
|
|
454
373
|
},
|
|
455
374
|
"record-continuity": async ({ target, packageRoot, options }) => {
|
|
456
|
-
const result = await
|
|
457
|
-
|
|
458
|
-
focusId: options.continuityFocusId,
|
|
459
|
-
focusSummary: options.continuityFocusSummary,
|
|
460
|
-
remaining: options.continuityRemaining,
|
|
461
|
-
knownIssues: options.continuityKnownIssues,
|
|
462
|
-
changedAreas: options.continuityChangedAreas,
|
|
463
|
-
inspectFirst: options.continuityInspectFirst,
|
|
464
|
-
resumeNote: options.continuityResumeNote,
|
|
465
|
-
taskId: options.task,
|
|
466
|
-
});
|
|
467
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatRecordContinuityResult(result));
|
|
375
|
+
const { result } = await COMMAND_EXECUTORS["record-continuity"]({ target, packageRoot, options });
|
|
376
|
+
renderJsonOr(options, result, formatRecordContinuityResult);
|
|
468
377
|
return 0;
|
|
469
378
|
},
|
|
470
379
|
"reconcile-continuity": async ({ target, packageRoot, options }) => {
|
|
471
|
-
const result = await
|
|
472
|
-
|
|
380
|
+
const { result } = await COMMAND_EXECUTORS["reconcile-continuity"]({ target, packageRoot, options });
|
|
381
|
+
renderJsonOr(options, result, formatReconcileContinuityResult);
|
|
473
382
|
return 0;
|
|
474
383
|
},
|
|
475
384
|
"clear-continuity": async ({ target, options }) => {
|
|
476
|
-
const result = await
|
|
477
|
-
|
|
385
|
+
const { result } = await COMMAND_EXECUTORS["clear-continuity"]({ target, options });
|
|
386
|
+
renderJsonOr(options, result, formatClearContinuityResult);
|
|
478
387
|
return 0;
|
|
479
388
|
},
|
|
480
389
|
"prepare-completion": async ({ target, packageRoot, options }) => {
|
|
481
|
-
const result = await
|
|
482
|
-
|
|
390
|
+
const { result } = await COMMAND_EXECUTORS["prepare-completion"]({ target, packageRoot, options });
|
|
391
|
+
renderJsonOr(options, result, formatPrepareCompletionResult);
|
|
483
392
|
return 0;
|
|
484
393
|
},
|
|
485
394
|
"run-check": async ({ target, packageRoot, options }) => {
|
|
486
|
-
const result = await
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
395
|
+
const { result, exitCode } = await COMMAND_EXECUTORS["run-check"]({ target, packageRoot, options });
|
|
396
|
+
renderJsonOr(options, result, formatRunCheckResult);
|
|
397
|
+
return exitCode;
|
|
398
|
+
},
|
|
399
|
+
"run-action": async ({ target, packageRoot, options }) => {
|
|
400
|
+
const { result, exitCode } = await COMMAND_EXECUTORS["run-action"]({ target, packageRoot, options });
|
|
401
|
+
renderJsonOr(options, result, formatRunActionResult);
|
|
402
|
+
return exitCode;
|
|
403
|
+
},
|
|
404
|
+
"action-propose": async ({ target, packageRoot, options }) => {
|
|
405
|
+
const { result } = await COMMAND_EXECUTORS["action-propose"]({ target, packageRoot, options });
|
|
406
|
+
renderJsonOr(options, result, formatActionProposeResult); return 0;
|
|
407
|
+
},
|
|
408
|
+
"action-authorize": async ({ target, packageRoot, options }) => {
|
|
409
|
+
const { result } = await COMMAND_EXECUTORS["action-authorize"]({ target, packageRoot, options });
|
|
410
|
+
renderJsonOr(options, result, formatActionAuthorizeResult); return 0;
|
|
411
|
+
},
|
|
412
|
+
"action-record": async ({ target, packageRoot, options }) => {
|
|
413
|
+
const { result } = await COMMAND_EXECUTORS["action-record"]({ target, packageRoot, options });
|
|
414
|
+
renderJsonOr(options, result, formatActionRecordResult); return 0;
|
|
415
|
+
},
|
|
416
|
+
"action-verify": async ({ target, packageRoot, options }) => {
|
|
417
|
+
const { result } = await COMMAND_EXECUTORS["action-verify"]({ target, packageRoot, options });
|
|
418
|
+
renderJsonOr(options, result, formatActionVerifyResult); return 0;
|
|
419
|
+
},
|
|
420
|
+
"action-show": async ({ target, packageRoot, options }) => {
|
|
421
|
+
const { result } = await COMMAND_EXECUTORS["action-show"]({ target, packageRoot, options });
|
|
422
|
+
renderJsonOr(options, result, formatActionShowResult); return 0;
|
|
498
423
|
},
|
|
424
|
+
"action-reconcile": async ({ target, packageRoot, options }) => {
|
|
425
|
+
const { result } = await COMMAND_EXECUTORS["action-reconcile"]({ target, packageRoot, options });
|
|
426
|
+
renderJsonOr(options, result, formatActionReconcileResult); return 0;
|
|
427
|
+
},
|
|
428
|
+
metrics: async ({ target, packageRoot, options }) => {
|
|
429
|
+
const { result } = await COMMAND_EXECUTORS.metrics({ target, packageRoot, options });
|
|
430
|
+
renderJsonOr(options, result, formatMetricsResult); return 0;
|
|
431
|
+
},
|
|
432
|
+
eval: async ({ target, packageRoot, options }) => {
|
|
433
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.eval({ target, packageRoot, options });
|
|
434
|
+
renderJsonOr(options, result, formatEvalResult); return exitCode;
|
|
435
|
+
},
|
|
436
|
+
"approval-request": async ({ target, packageRoot, options }) => { const { result } = await COMMAND_EXECUTORS["approval-request"]({ target, packageRoot, options }); renderJsonOr(options, result, formatApprovalRequestResult); return 0; },
|
|
437
|
+
"approval-resolve": async ({ target, packageRoot, options }) => { const { result } = await COMMAND_EXECUTORS["approval-resolve"]({ target, packageRoot, options }); renderJsonOr(options, result, formatApprovalResolveResult); return 0; },
|
|
499
438
|
"record-check": async ({ target, packageRoot, options }) => {
|
|
500
|
-
const result = await
|
|
501
|
-
|
|
502
|
-
packageRoot,
|
|
503
|
-
id: options.checkId,
|
|
504
|
-
kind: options.checkKind ?? "command",
|
|
505
|
-
requirement: options.checkRequirement,
|
|
506
|
-
status: options.checkStatus,
|
|
507
|
-
evidenceKind: options.checkEvidenceKind,
|
|
508
|
-
command: options.checkCommand ?? undefined,
|
|
509
|
-
result: options.checkResult ?? undefined,
|
|
510
|
-
...(options.checkExitCode === null ? {} : { exitCode: options.checkExitCode }),
|
|
511
|
-
details: options.checkDetails ?? undefined,
|
|
512
|
-
executionRef: options.checkExecutionRef ?? undefined,
|
|
513
|
-
provenance: options.checkProvenance ?? undefined,
|
|
514
|
-
taskId: options.task,
|
|
515
|
-
});
|
|
516
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatRecordCheckResult(result));
|
|
439
|
+
const { result } = await COMMAND_EXECUTORS["record-check"]({ target, packageRoot, options });
|
|
440
|
+
renderJsonOr(options, result, formatRecordCheckResult);
|
|
517
441
|
return 0;
|
|
518
442
|
},
|
|
519
443
|
"record-terminal-result": async ({ target, packageRoot, options }) => {
|
|
520
|
-
const result = await
|
|
521
|
-
|
|
522
|
-
packageRoot,
|
|
523
|
-
requirement: options.checkRequirement,
|
|
524
|
-
type: options.checkType,
|
|
525
|
-
status: options.checkStatus,
|
|
526
|
-
source: options.checkSource ?? options.checkCommand,
|
|
527
|
-
result: options.checkResult,
|
|
528
|
-
details: options.checkDetails ?? undefined,
|
|
529
|
-
taskId: options.task,
|
|
530
|
-
});
|
|
531
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatRecordTerminalResult(result));
|
|
444
|
+
const { result } = await COMMAND_EXECUTORS["record-terminal-result"]({ target, packageRoot, options });
|
|
445
|
+
renderJsonOr(options, result, formatRecordTerminalResult);
|
|
532
446
|
return 0;
|
|
533
447
|
},
|
|
534
448
|
"record-diagnosis": async ({ target, packageRoot, options }) => {
|
|
535
|
-
const result = await
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
449
|
+
const { result } = await COMMAND_EXECUTORS["record-diagnosis"]({ target, packageRoot, options });
|
|
450
|
+
renderJsonOr(options, result, formatRecordDiagnosisResult);
|
|
451
|
+
return 0;
|
|
452
|
+
},
|
|
453
|
+
"record-intervention": async ({ target, packageRoot, options }) => {
|
|
454
|
+
const { result } = await COMMAND_EXECUTORS["record-intervention"]({ target, packageRoot, options });
|
|
455
|
+
renderJsonOr(options, result, formatRecordInterventionResult);
|
|
456
|
+
return 0;
|
|
457
|
+
},
|
|
458
|
+
"record-hypothesis-disposition": async ({ target, packageRoot, options }) => {
|
|
459
|
+
const { result } = await COMMAND_EXECUTORS["record-hypothesis-disposition"]({ target, packageRoot, options });
|
|
460
|
+
renderJsonOr(options, result, formatRecordHypothesisDispositionResult);
|
|
546
461
|
return 0;
|
|
547
462
|
},
|
|
463
|
+
history: async ({ target, packageRoot, options }) => {
|
|
464
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.history({ target, packageRoot, options });
|
|
465
|
+
if (options.json) {
|
|
466
|
+
console.log(JSON.stringify(result, null, 2));
|
|
467
|
+
} else if (options.compact) {
|
|
468
|
+
for (const event of result.events) {
|
|
469
|
+
console.log(`${event.timestamp ?? "--:--:--"} ${event.type}`);
|
|
470
|
+
}
|
|
471
|
+
} else if (options.verbose) {
|
|
472
|
+
console.log(formatHistoryResult(result));
|
|
473
|
+
for (const event of result.events) {
|
|
474
|
+
console.log(`--- ${event.sequence} ${event.type} ---`);
|
|
475
|
+
console.log(JSON.stringify(event.data, null, 2));
|
|
476
|
+
}
|
|
477
|
+
} else {
|
|
478
|
+
console.log(formatHistoryResult(result));
|
|
479
|
+
}
|
|
480
|
+
return exitCode;
|
|
481
|
+
},
|
|
482
|
+
trace: async ({ target, packageRoot, options }) => {
|
|
483
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.trace({ target, packageRoot, options });
|
|
484
|
+
renderJsonOr(options, result, formatTraceResult);
|
|
485
|
+
return exitCode;
|
|
486
|
+
},
|
|
487
|
+
reflect: async ({ target, packageRoot, options }) => {
|
|
488
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.reflect({ target, packageRoot, options });
|
|
489
|
+
renderJsonOr(options, result, formatReflectResult);
|
|
490
|
+
return exitCode;
|
|
491
|
+
},
|
|
548
492
|
progress: async ({ target, packageRoot, options }) => {
|
|
549
|
-
const result = await
|
|
550
|
-
|
|
551
|
-
return
|
|
493
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.progress({ target, packageRoot, options });
|
|
494
|
+
renderJsonOr(options, result, formatProgressResult);
|
|
495
|
+
return exitCode;
|
|
552
496
|
},
|
|
553
497
|
"record-decision-criterion": async ({ target, packageRoot, options }) => {
|
|
554
|
-
const result = await
|
|
555
|
-
|
|
556
|
-
packageRoot,
|
|
557
|
-
decision: options.decision,
|
|
558
|
-
settledBy: options.settledBy,
|
|
559
|
-
taskId: options.task,
|
|
560
|
-
});
|
|
561
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatRecordDecisionCriterionResult(result));
|
|
498
|
+
const { result } = await COMMAND_EXECUTORS["record-decision-criterion"]({ target, packageRoot, options });
|
|
499
|
+
renderJsonOr(options, result, formatRecordDecisionCriterionResult);
|
|
562
500
|
return 0;
|
|
563
501
|
},
|
|
564
502
|
complete: async ({ target, packageRoot, options }) => {
|
|
565
|
-
const result = await
|
|
566
|
-
|
|
567
|
-
return
|
|
503
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.complete({ target, packageRoot, options });
|
|
504
|
+
renderJsonOr(options, result, formatCompleteResult);
|
|
505
|
+
return exitCode;
|
|
568
506
|
},
|
|
569
507
|
audit: async ({ target, packageRoot, options }) => {
|
|
570
|
-
const result = await
|
|
571
|
-
|
|
572
|
-
return
|
|
508
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.audit({ target, packageRoot, options });
|
|
509
|
+
renderJsonOr(options, result, formatAuditResult);
|
|
510
|
+
return exitCode;
|
|
573
511
|
},
|
|
574
512
|
report: async ({ target, packageRoot, options }) => {
|
|
575
|
-
const result = await
|
|
576
|
-
|
|
577
|
-
return
|
|
513
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.report({ target, packageRoot, options });
|
|
514
|
+
renderJsonOr(options, result, formatReportResult);
|
|
515
|
+
return exitCode;
|
|
578
516
|
},
|
|
579
517
|
policy: async ({ target, packageRoot, options }) => {
|
|
580
|
-
const result = await
|
|
581
|
-
|
|
518
|
+
const { result } = await COMMAND_EXECUTORS.policy({ target, packageRoot, options });
|
|
519
|
+
renderJsonOr(options, result, formatPolicyResult);
|
|
582
520
|
return 0;
|
|
583
521
|
},
|
|
584
522
|
"policy-discover": async ({ target, packageRoot, options }) => {
|
|
585
|
-
const result = await
|
|
586
|
-
|
|
523
|
+
const { result } = await COMMAND_EXECUTORS["policy-discover"]({ target, packageRoot, options });
|
|
524
|
+
renderJsonOr(options, result, formatPolicyDiscoverResult);
|
|
587
525
|
return 0;
|
|
588
526
|
},
|
|
589
527
|
"policy-status": async ({ target, packageRoot, options }) => {
|
|
590
|
-
const result = await
|
|
591
|
-
|
|
592
|
-
return
|
|
528
|
+
const { result, exitCode } = await COMMAND_EXECUTORS["policy-status"]({ target, packageRoot, options });
|
|
529
|
+
renderJsonOr(options, result, formatPolicyStatusResult);
|
|
530
|
+
return exitCode;
|
|
593
531
|
},
|
|
594
532
|
"policy-diff": async ({ target, packageRoot, options }) => {
|
|
595
|
-
const result = await
|
|
596
|
-
|
|
533
|
+
const { result } = await COMMAND_EXECUTORS["policy-diff"]({ target, packageRoot, options });
|
|
534
|
+
renderJsonOr(options, result, formatPolicyDiffResult);
|
|
597
535
|
return 0;
|
|
598
536
|
},
|
|
599
537
|
"rule-verify": async ({ target, packageRoot, options }) => {
|
|
600
|
-
const result = await
|
|
601
|
-
|
|
602
|
-
return
|
|
538
|
+
const { result, exitCode } = await COMMAND_EXECUTORS["rule-verify"]({ target, packageRoot, options });
|
|
539
|
+
renderJsonOr(options, result, formatRuleVerifyResult);
|
|
540
|
+
return exitCode;
|
|
603
541
|
},
|
|
604
542
|
baseline: async ({ target, packageRoot, options }) => {
|
|
605
|
-
const result = await
|
|
606
|
-
|
|
607
|
-
packageRoot,
|
|
608
|
-
record: options.record,
|
|
609
|
-
update: options.update,
|
|
610
|
-
policyResetAuthorized: options.policyResetAuthorized,
|
|
611
|
-
});
|
|
612
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatBaselineResult(result));
|
|
543
|
+
const { result } = await COMMAND_EXECUTORS.baseline({ target, packageRoot, options });
|
|
544
|
+
renderJsonOr(options, result, formatBaselineResult);
|
|
613
545
|
return 0;
|
|
614
546
|
},
|
|
615
547
|
"profile-interview": async ({ target, packageRoot, options }) => {
|
|
616
|
-
const result = await
|
|
617
|
-
|
|
548
|
+
const { result } = await COMMAND_EXECUTORS["profile-interview"]({ target, packageRoot, options });
|
|
549
|
+
renderJsonOr(options, result, formatProfileInterviewResult);
|
|
618
550
|
return 0;
|
|
619
551
|
},
|
|
620
552
|
bundle: async ({ target, packageRoot, options }) => {
|
|
621
|
-
const result = await
|
|
622
|
-
|
|
553
|
+
const { result } = await COMMAND_EXECUTORS.bundle({ target, packageRoot, options });
|
|
554
|
+
renderJsonOr(options, result, formatBundleResult);
|
|
623
555
|
return 0;
|
|
624
556
|
},
|
|
625
557
|
inspect: async ({ target, packageRoot, options }) => {
|
|
626
|
-
const result = await
|
|
627
|
-
|
|
628
|
-
return
|
|
558
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.inspect({ target, packageRoot, options });
|
|
559
|
+
renderJsonOr(options, result, formatInspectResult);
|
|
560
|
+
return exitCode;
|
|
629
561
|
},
|
|
630
562
|
"validate-receipt": async ({ target, packageRoot, options }) => {
|
|
631
|
-
const result = await
|
|
563
|
+
const { result } = await COMMAND_EXECUTORS["validate-receipt"]({ target, packageRoot, options });
|
|
632
564
|
console.log(options.json ? JSON.stringify(result, null, 2) : "valid: execution receipt");
|
|
633
565
|
return 0;
|
|
634
566
|
},
|
|
635
567
|
"validate-protocol": async ({ target, packageRoot, options }) => {
|
|
636
|
-
const result = await
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
stateFile: options.stateFile,
|
|
640
|
-
receiptFile: options.receiptFile,
|
|
641
|
-
routeFile: options.routeFile,
|
|
642
|
-
contractFile: options.contractFile,
|
|
643
|
-
continuityFile: options.continuityFile,
|
|
644
|
-
taskBriefFiles: options.taskBriefFiles,
|
|
645
|
-
delegatedResultFiles: options.delegatedResultFiles,
|
|
646
|
-
taskId: options.task,
|
|
647
|
-
});
|
|
648
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatValidateProtocolResult(result));
|
|
649
|
-
return result.status === "VALID" ? 0 : 1;
|
|
568
|
+
const { result, exitCode } = await COMMAND_EXECUTORS["validate-protocol"]({ target, packageRoot, options });
|
|
569
|
+
renderJsonOr(options, result, formatValidateProtocolResult);
|
|
570
|
+
return exitCode;
|
|
650
571
|
},
|
|
651
572
|
status: async ({ target, packageRoot, options }) => {
|
|
652
|
-
const result = await
|
|
653
|
-
|
|
573
|
+
const { result } = await COMMAND_EXECUTORS.status({ target, packageRoot, options });
|
|
574
|
+
renderJsonOr(options, result, formatStatusResult);
|
|
654
575
|
return 0;
|
|
655
576
|
},
|
|
656
577
|
"validate-state": async ({ target, packageRoot, options }) => {
|
|
657
|
-
const result = await
|
|
658
|
-
|
|
659
|
-
return
|
|
578
|
+
const { result, exitCode } = await COMMAND_EXECUTORS["validate-state"]({ target, packageRoot, options });
|
|
579
|
+
renderJsonOr(options, result, formatValidateStateResult);
|
|
580
|
+
return exitCode;
|
|
660
581
|
},
|
|
661
582
|
"clear-state": async ({ target, options }) => {
|
|
662
|
-
const result = await
|
|
663
|
-
|
|
583
|
+
const { result } = await COMMAND_EXECUTORS["clear-state"]({ target, options });
|
|
584
|
+
renderJsonOr(options, result, formatClearStateResult);
|
|
664
585
|
return 0;
|
|
665
586
|
},
|
|
666
587
|
"task-create": async ({ target, packageRoot, options }) => {
|
|
667
|
-
const result = await
|
|
668
|
-
|
|
669
|
-
packageRoot,
|
|
670
|
-
taskId: options.task,
|
|
671
|
-
claims: options.claims,
|
|
672
|
-
contractFile: options.contractFile,
|
|
673
|
-
});
|
|
674
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatTaskCreateResult(result));
|
|
588
|
+
const { result } = await COMMAND_EXECUTORS["task-create"]({ target, packageRoot, options });
|
|
589
|
+
renderJsonOr(options, result, formatTaskCreateResult);
|
|
675
590
|
return 0;
|
|
676
591
|
},
|
|
677
592
|
"task-list": async ({ target, packageRoot, options }) => {
|
|
678
|
-
const result = await
|
|
679
|
-
|
|
593
|
+
const { result } = await COMMAND_EXECUTORS["task-list"]({ target, packageRoot, options });
|
|
594
|
+
renderJsonOr(options, result, formatTaskListResult);
|
|
680
595
|
return 0;
|
|
681
596
|
},
|
|
682
597
|
"task-show": async ({ target, packageRoot, options }) => {
|
|
683
|
-
const result = await
|
|
684
|
-
|
|
598
|
+
const { result } = await COMMAND_EXECUTORS["task-show"]({ target, packageRoot, options });
|
|
599
|
+
renderJsonOr(options, result, formatTaskShowResult);
|
|
685
600
|
return 0;
|
|
686
601
|
},
|
|
687
602
|
"task-lock-status": async ({ target, packageRoot, options }) => {
|
|
688
|
-
const result = await
|
|
689
|
-
|
|
603
|
+
const { result } = await COMMAND_EXECUTORS["task-lock-status"]({ target, packageRoot, options });
|
|
604
|
+
renderJsonOr(options, result, formatTaskLockStatusResult);
|
|
690
605
|
return 0;
|
|
691
606
|
},
|
|
692
607
|
"task-scope": async ({ target, packageRoot, options }) => {
|
|
693
|
-
const result = await
|
|
694
|
-
|
|
695
|
-
packageRoot,
|
|
696
|
-
taskId: options.task,
|
|
697
|
-
claims: options.claims,
|
|
698
|
-
});
|
|
699
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatTaskScopeResult(result));
|
|
608
|
+
const { result } = await COMMAND_EXECUTORS["task-scope"]({ target, packageRoot, options });
|
|
609
|
+
renderJsonOr(options, result, formatTaskScopeResult);
|
|
700
610
|
return 0;
|
|
701
611
|
},
|
|
702
612
|
"task-migrate": async ({ target, packageRoot, options }) => {
|
|
703
|
-
const result = await
|
|
704
|
-
|
|
613
|
+
const { result } = await COMMAND_EXECUTORS["task-migrate"]({ target, packageRoot, options });
|
|
614
|
+
renderJsonOr(options, result, formatTaskMigrateResult);
|
|
705
615
|
return 0;
|
|
706
616
|
},
|
|
707
617
|
"migrate-protocol": async ({ target, packageRoot, options }) => {
|
|
708
|
-
const result = await
|
|
709
|
-
|
|
618
|
+
const { result } = await COMMAND_EXECUTORS["migrate-protocol"]({ target, packageRoot, options });
|
|
619
|
+
renderJsonOr(options, result, formatMigrateProtocolResult);
|
|
710
620
|
return 0;
|
|
711
621
|
},
|
|
712
622
|
"task-unlock": async ({ target, packageRoot, options }) => {
|
|
713
|
-
const result = await
|
|
714
|
-
|
|
623
|
+
const { result } = await COMMAND_EXECUTORS["task-unlock"]({ target, packageRoot, options });
|
|
624
|
+
renderJsonOr(options, result, formatTaskUnlockResult);
|
|
625
|
+
return 0;
|
|
626
|
+
},
|
|
627
|
+
"task-recover": async ({ target, packageRoot, options }) => {
|
|
628
|
+
if (options.operatorAuthorized && !options.acknowledgeRecovery) {
|
|
629
|
+
console.error("DEPRECATION: --operator-authorized is caller acknowledgement, not host attestation; use --acknowledge-recovery.");
|
|
630
|
+
}
|
|
631
|
+
const { result } = await COMMAND_EXECUTORS["task-recover"]({ target, packageRoot, options });
|
|
632
|
+
renderJsonOr(options, result, formatTaskRecoverResult);
|
|
633
|
+
return 0;
|
|
634
|
+
},
|
|
635
|
+
"task-resume": async ({ target, packageRoot, options }) => {
|
|
636
|
+
const { result } = await COMMAND_EXECUTORS["task-resume"]({ target, packageRoot, options });
|
|
637
|
+
renderJsonOr(options, result, formatTaskResumeResult);
|
|
638
|
+
return 0;
|
|
639
|
+
},
|
|
640
|
+
"task-repair-legacy-recovery": async ({ target, packageRoot, options }) => {
|
|
641
|
+
const { result } = await COMMAND_EXECUTORS["task-repair-legacy-recovery"]({ target, packageRoot, options });
|
|
642
|
+
renderJsonOr(options, result, formatTaskRepairLegacyRecoveryResult);
|
|
715
643
|
return 0;
|
|
716
644
|
},
|
|
717
645
|
"reconcile-closure": async ({ target, packageRoot, options }) => {
|
|
718
|
-
const result = await
|
|
719
|
-
|
|
720
|
-
packageRoot,
|
|
721
|
-
taskId: options.task,
|
|
722
|
-
checkId: options.checkId,
|
|
723
|
-
checkRequirement: options.checkRequirement,
|
|
724
|
-
checkDetails: options.checkDetails,
|
|
725
|
-
commandArgv: options.commandArgv,
|
|
726
|
-
});
|
|
727
|
-
console.log(options.json ? JSON.stringify(result, null, 2) : formatReconcileClosureResult(result));
|
|
646
|
+
const { result } = await COMMAND_EXECUTORS["reconcile-closure"]({ target, packageRoot, options });
|
|
647
|
+
renderJsonOr(options, result, formatReconcileClosureResult);
|
|
728
648
|
return 0;
|
|
729
649
|
},
|
|
730
650
|
update: async ({ target, packageRoot, packageVersion, options }) => {
|
|
731
|
-
const result = await
|
|
651
|
+
const { result, exitCode } = await COMMAND_EXECUTORS.update({ target, packageRoot, packageVersion, options });
|
|
732
652
|
printActions(result.actions);
|
|
733
653
|
for (const conflict of result.conflicts) {
|
|
734
654
|
const code = conflict.code ? `${conflict.code}: ` : "";
|
|
735
655
|
console.log(`conflict: ${code}${conflict.path} - ${conflict.message}`);
|
|
736
656
|
}
|
|
737
|
-
return
|
|
657
|
+
return exitCode;
|
|
738
658
|
},
|
|
739
659
|
});
|
|
740
660
|
|