@relayflows/sdk 2.0.42 → 2.0.44
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/dist/adapters/base.d.ts +12 -1
- package/dist/adapters/base.d.ts.map +1 -1
- package/dist/adapters/base.js +11 -1
- package/dist/adapters/base.js.map +1 -1
- package/dist/adapters/claude.d.ts.map +1 -1
- package/dist/adapters/claude.js +8 -4
- package/dist/adapters/claude.js.map +1 -1
- package/dist/adapters/codex.d.ts.map +1 -1
- package/dist/adapters/codex.js +15 -6
- package/dist/adapters/codex.js.map +1 -1
- package/dist/agent-resume.d.ts +8 -0
- package/dist/agent-resume.d.ts.map +1 -0
- package/dist/agent-resume.js +37 -0
- package/dist/agent-resume.js.map +1 -0
- package/dist/agent-transcript.d.ts.map +1 -1
- package/dist/agent-transcript.js +5 -3
- package/dist/agent-transcript.js.map +1 -1
- package/dist/authored-flow-error.d.ts +10 -2
- package/dist/authored-flow-error.d.ts.map +1 -1
- package/dist/authored-flow-error.js.map +1 -1
- package/dist/authored-flow-executor.d.ts.map +1 -1
- package/dist/authored-flow-executor.js +16 -2
- package/dist/authored-flow-executor.js.map +1 -1
- package/dist/authored-flow-loader.d.ts +6 -0
- package/dist/authored-flow-loader.d.ts.map +1 -1
- package/dist/authored-flow-loader.js +18 -6
- package/dist/authored-flow-loader.js.map +1 -1
- package/dist/authored-helper-effect.js +3 -2
- package/dist/authored-helper-effect.js.map +1 -1
- package/dist/authored-human.d.ts +2 -0
- package/dist/authored-human.d.ts.map +1 -1
- package/dist/authored-human.js +4 -0
- package/dist/authored-human.js.map +1 -1
- package/dist/authored-memory.d.ts +47 -2
- package/dist/authored-memory.d.ts.map +1 -1
- package/dist/authored-memory.js +394 -15
- package/dist/authored-memory.js.map +1 -1
- package/dist/authored-node-entry.js +6 -1
- package/dist/authored-node-entry.js.map +1 -1
- package/dist/authored-node-runner.d.ts +1 -1
- package/dist/authored-node-runner.d.ts.map +1 -1
- package/dist/authored-node-runner.js +6 -3
- package/dist/authored-node-runner.js.map +1 -1
- package/dist/authored-root-readback.d.ts +21 -0
- package/dist/authored-root-readback.d.ts.map +1 -0
- package/dist/authored-root-readback.js +90 -0
- package/dist/authored-root-readback.js.map +1 -0
- package/dist/authored-root.d.ts.map +1 -1
- package/dist/authored-root.js +53 -74
- package/dist/authored-root.js.map +1 -1
- package/dist/authored-step-output.d.ts +2 -0
- package/dist/authored-step-output.d.ts.map +1 -1
- package/dist/authored-step-output.js +1 -0
- package/dist/authored-step-output.js.map +1 -1
- package/dist/authored-worker-step.d.ts.map +1 -1
- package/dist/authored-worker-step.js +26 -4
- package/dist/authored-worker-step.js.map +1 -1
- package/dist/cli/check-helper-body.d.ts +2 -2
- package/dist/cli/check-helper-body.d.ts.map +1 -1
- package/dist/cli/check-helper-body.js +7 -2
- package/dist/cli/check-helper-body.js.map +1 -1
- package/dist/cli/check-helper-surface.d.ts +8 -0
- package/dist/cli/check-helper-surface.d.ts.map +1 -0
- package/dist/cli/check-helper-surface.js +37 -0
- package/dist/cli/check-helper-surface.js.map +1 -0
- package/dist/cli/check-triggers.d.ts +4 -3
- package/dist/cli/check-triggers.d.ts.map +1 -1
- package/dist/cli/check-triggers.js +7 -3
- package/dist/cli/check-triggers.js.map +1 -1
- package/dist/cli/check.d.ts +7 -1
- package/dist/cli/check.d.ts.map +1 -1
- package/dist/cli/check.js +35 -8
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/cloud-answer.d.ts +9 -0
- package/dist/cli/cloud-answer.d.ts.map +1 -0
- package/dist/cli/cloud-answer.js +39 -0
- package/dist/cli/cloud-answer.js.map +1 -0
- package/dist/cli/cloud-connect-cli.d.ts +2 -1
- package/dist/cli/cloud-connect-cli.d.ts.map +1 -1
- package/dist/cli/cloud-connect-cli.js +10 -2
- package/dist/cli/cloud-connect-cli.js.map +1 -1
- package/dist/cli/cloud-human.d.ts +7 -0
- package/dist/cli/cloud-human.d.ts.map +1 -0
- package/dist/cli/cloud-human.js +22 -0
- package/dist/cli/cloud-human.js.map +1 -0
- package/dist/cli/cloud-live.d.ts +2 -2
- package/dist/cli/cloud-live.d.ts.map +1 -1
- package/dist/cli/cloud-live.js +9 -2
- package/dist/cli/cloud-live.js.map +1 -1
- package/dist/cli/cloud-mirror-session.d.ts.map +1 -1
- package/dist/cli/cloud-mirror-session.js +3 -2
- package/dist/cli/cloud-mirror-session.js.map +1 -1
- package/dist/cli/cloud-run.d.ts +1 -1
- package/dist/cli/cloud-run.d.ts.map +1 -1
- package/dist/cli/cloud-run.js +12 -0
- package/dist/cli/cloud-run.js.map +1 -1
- package/dist/cli/detached-record.d.ts +22 -0
- package/dist/cli/detached-record.d.ts.map +1 -0
- package/dist/cli/detached-record.js +57 -0
- package/dist/cli/detached-record.js.map +1 -0
- package/dist/cli/detached-run.d.ts +28 -0
- package/dist/cli/detached-run.d.ts.map +1 -0
- package/dist/cli/detached-run.js +122 -0
- package/dist/cli/detached-run.js.map +1 -0
- package/dist/cli/diagnostic-fold.d.ts +19 -0
- package/dist/cli/diagnostic-fold.d.ts.map +1 -0
- package/dist/cli/diagnostic-fold.js +19 -0
- package/dist/cli/diagnostic-fold.js.map +1 -0
- package/dist/cli/direct-run.d.ts.map +1 -1
- package/dist/cli/direct-run.js +16 -2
- package/dist/cli/direct-run.js.map +1 -1
- package/dist/cli/eval.d.ts +22 -0
- package/dist/cli/eval.d.ts.map +1 -0
- package/dist/cli/eval.js +131 -0
- package/dist/cli/eval.js.map +1 -0
- package/dist/cli/journal-timeout.d.ts +12 -0
- package/dist/cli/journal-timeout.d.ts.map +1 -0
- package/dist/cli/journal-timeout.js +42 -0
- package/dist/cli/journal-timeout.js.map +1 -0
- package/dist/cli/local-agent-remedy.d.ts.map +1 -1
- package/dist/cli/local-agent-remedy.js +5 -4
- package/dist/cli/local-agent-remedy.js.map +1 -1
- package/dist/cli/observer-session.d.ts +1 -0
- package/dist/cli/observer-session.d.ts.map +1 -1
- package/dist/cli/observer-session.js +8 -1
- package/dist/cli/observer-session.js.map +1 -1
- package/dist/cli/reuse.d.ts +8 -0
- package/dist/cli/reuse.d.ts.map +1 -1
- package/dist/cli/reuse.js +24 -0
- package/dist/cli/reuse.js.map +1 -1
- package/dist/cli/run.d.ts +8 -2
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +72 -56
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/running-step.d.ts +9 -0
- package/dist/cli/running-step.d.ts.map +1 -0
- package/dist/cli/running-step.js +156 -0
- package/dist/cli/running-step.js.map +1 -0
- package/dist/cli/status.d.ts.map +1 -1
- package/dist/cli/status.js +12 -8
- package/dist/cli/status.js.map +1 -1
- package/dist/cli-adapter.d.ts +3 -1
- package/dist/cli-adapter.d.ts.map +1 -1
- package/dist/cli-adapter.js +6 -2
- package/dist/cli-adapter.js.map +1 -1
- package/dist/cli-commands.d.ts +77 -11
- package/dist/cli-commands.d.ts.map +1 -1
- package/dist/cli-commands.js +41 -7
- package/dist/cli-commands.js.map +1 -1
- package/dist/cli-watch.d.ts +6 -2
- package/dist/cli-watch.d.ts.map +1 -1
- package/dist/cli-watch.js +7 -6
- package/dist/cli-watch.js.map +1 -1
- package/dist/cli.d.ts +22 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +154 -50
- package/dist/cli.js.map +1 -1
- package/dist/cloud-answer.d.ts +35 -0
- package/dist/cloud-answer.d.ts.map +1 -0
- package/dist/cloud-answer.js +194 -0
- package/dist/cloud-answer.js.map +1 -0
- package/dist/cloud-auth-store.d.ts +46 -0
- package/dist/cloud-auth-store.d.ts.map +1 -0
- package/dist/cloud-auth-store.js +171 -0
- package/dist/cloud-auth-store.js.map +1 -0
- package/dist/cloud-http.d.ts +7 -16
- package/dist/cloud-http.d.ts.map +1 -1
- package/dist/cloud-http.js +59 -40
- package/dist/cloud-http.js.map +1 -1
- package/dist/cloud-human-wait.d.ts +10 -0
- package/dist/cloud-human-wait.d.ts.map +1 -0
- package/dist/cloud-human-wait.js +17 -0
- package/dist/cloud-human-wait.js.map +1 -0
- package/dist/cloud-mirror-transport.d.ts.map +1 -1
- package/dist/cloud-mirror-transport.js +1 -0
- package/dist/cloud-mirror-transport.js.map +1 -1
- package/dist/cloud-run-record.d.ts +7 -2
- package/dist/cloud-run-record.d.ts.map +1 -1
- package/dist/cloud-run-record.js +13 -5
- package/dist/cloud-run-record.js.map +1 -1
- package/dist/cloud-run.d.ts +9 -0
- package/dist/cloud-run.d.ts.map +1 -1
- package/dist/cloud-run.js +36 -2
- package/dist/cloud-run.js.map +1 -1
- package/dist/communication/local.d.ts.map +1 -1
- package/dist/communication/local.js +6 -1
- package/dist/communication/local.js.map +1 -1
- package/dist/communication/worker.d.ts.map +1 -1
- package/dist/communication/worker.js +12 -2
- package/dist/communication/worker.js.map +1 -1
- package/dist/compile.d.ts.map +1 -1
- package/dist/compile.js +5 -3
- package/dist/compile.js.map +1 -1
- package/dist/daemon-spec-validation.d.ts +31 -0
- package/dist/daemon-spec-validation.d.ts.map +1 -0
- package/dist/daemon-spec-validation.js +115 -0
- package/dist/daemon-spec-validation.js.map +1 -0
- package/dist/failure-kinds.d.ts +6 -4
- package/dist/failure-kinds.d.ts.map +1 -1
- package/dist/failure-kinds.js +17 -1
- package/dist/failure-kinds.js.map +1 -1
- package/dist/flow-eval-cloud.d.ts +25 -0
- package/dist/flow-eval-cloud.d.ts.map +1 -0
- package/dist/flow-eval-cloud.js +108 -0
- package/dist/flow-eval-cloud.js.map +1 -0
- package/dist/flow-eval-error.d.ts +7 -0
- package/dist/flow-eval-error.d.ts.map +1 -0
- package/dist/flow-eval-error.js +10 -0
- package/dist/flow-eval-error.js.map +1 -0
- package/dist/flow-eval-gate.d.ts +15 -0
- package/dist/flow-eval-gate.d.ts.map +1 -0
- package/dist/flow-eval-gate.js +102 -0
- package/dist/flow-eval-gate.js.map +1 -0
- package/dist/flow-eval-local.d.ts +54 -0
- package/dist/flow-eval-local.d.ts.map +1 -0
- package/dist/flow-eval-local.js +220 -0
- package/dist/flow-eval-local.js.map +1 -0
- package/dist/flow-eval-outcome.d.ts +22 -0
- package/dist/flow-eval-outcome.d.ts.map +1 -0
- package/dist/flow-eval-outcome.js +37 -0
- package/dist/flow-eval-outcome.js.map +1 -0
- package/dist/flow-eval-report.d.ts +106 -0
- package/dist/flow-eval-report.d.ts.map +1 -0
- package/dist/flow-eval-report.js +4 -0
- package/dist/flow-eval-report.js.map +1 -0
- package/dist/flow-eval-suite.d.ts +46 -0
- package/dist/flow-eval-suite.d.ts.map +1 -0
- package/dist/flow-eval-suite.js +144 -0
- package/dist/flow-eval-suite.js.map +1 -0
- package/dist/flow-eval-version.d.ts +59 -0
- package/dist/flow-eval-version.d.ts.map +1 -0
- package/dist/flow-eval-version.js +303 -0
- package/dist/flow-eval-version.js.map +1 -0
- package/dist/flow-eval.d.ts +41 -0
- package/dist/flow-eval.d.ts.map +1 -0
- package/dist/flow-eval.js +201 -0
- package/dist/flow-eval.js.map +1 -0
- package/dist/helper-operation-use.d.ts +18 -0
- package/dist/helper-operation-use.d.ts.map +1 -0
- package/dist/helper-operation-use.js +336 -0
- package/dist/helper-operation-use.js.map +1 -0
- package/dist/helper-preflight.d.ts.map +1 -1
- package/dist/helper-preflight.js +16 -2
- package/dist/helper-preflight.js.map +1 -1
- package/dist/helper-reference.d.ts +33 -0
- package/dist/helper-reference.d.ts.map +1 -1
- package/dist/helper-reference.js +5 -5
- package/dist/helper-reference.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/journal-budgeted-reads.d.ts +41 -0
- package/dist/journal-budgeted-reads.d.ts.map +1 -0
- package/dist/journal-budgeted-reads.js +142 -0
- package/dist/journal-budgeted-reads.js.map +1 -0
- package/dist/journal-client.d.ts +34 -29
- package/dist/journal-client.d.ts.map +1 -1
- package/dist/journal-client.js +45 -151
- package/dist/journal-client.js.map +1 -1
- package/dist/journal-connection.d.ts +42 -0
- package/dist/journal-connection.d.ts.map +1 -0
- package/dist/journal-connection.js +209 -0
- package/dist/journal-connection.js.map +1 -0
- package/dist/journal-read-policy.d.ts +38 -0
- package/dist/journal-read-policy.d.ts.map +1 -0
- package/dist/journal-read-policy.js +126 -0
- package/dist/journal-read-policy.js.map +1 -0
- package/dist/named-gate-lowering.d.ts.map +1 -1
- package/dist/named-gate-lowering.js +2 -6
- package/dist/named-gate-lowering.js.map +1 -1
- package/dist/re2js-embedded.d.ts +3 -0
- package/dist/re2js-embedded.d.ts.map +1 -0
- package/dist/re2js-embedded.js +4 -0
- package/dist/re2js-embedded.js.map +1 -0
- package/dist/spec.d.ts +10 -0
- package/dist/spec.d.ts.map +1 -1
- package/dist/spec.js.map +1 -1
- package/dist/step-fields.d.ts +1 -1
- package/dist/step-fields.js +1 -1
- package/dist/step-fields.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +15 -0
- package/dist/validate.js.map +1 -1
- package/dist/worker-cli.d.ts +3 -1
- package/dist/worker-cli.d.ts.map +1 -1
- package/dist/worker-cli.js +15 -5
- package/dist/worker-cli.js.map +1 -1
- package/dist/worker-lease.d.ts.map +1 -1
- package/dist/worker-lease.js +11 -3
- package/dist/worker-lease.js.map +1 -1
- package/dist/worker.js +1 -1
- package/dist/worker.js.map +1 -1
- package/package.json +5 -3
- package/src/adapters/base.ts +16 -1
- package/src/adapters/claude.ts +8 -4
- package/src/adapters/codex.ts +15 -6
- package/src/agent-resume.ts +36 -0
- package/src/agent-transcript.ts +5 -3
- package/src/authored-flow-error.ts +9 -0
- package/src/authored-flow-executor.ts +18 -1
- package/src/authored-flow-loader.ts +27 -10
- package/src/authored-helper-effect.ts +3 -2
- package/src/authored-human.ts +5 -0
- package/src/authored-memory.ts +445 -15
- package/src/authored-node-entry.ts +6 -1
- package/src/authored-node-runner.ts +6 -3
- package/src/authored-root-readback.ts +100 -0
- package/src/authored-root.ts +58 -85
- package/src/authored-step-output.ts +3 -0
- package/src/authored-worker-step.ts +29 -4
- package/src/cli/check-helper-body.ts +9 -3
- package/src/cli/check-helper-surface.ts +43 -0
- package/src/cli/check-triggers.ts +9 -4
- package/src/cli/check.ts +37 -7
- package/src/cli/cloud-answer.ts +40 -0
- package/src/cli/cloud-connect-cli.ts +9 -2
- package/src/cli/cloud-human.ts +24 -0
- package/src/cli/cloud-live.ts +10 -5
- package/src/cli/cloud-mirror-session.ts +3 -2
- package/src/cli/cloud-run.ts +10 -1
- package/src/cli/detached-record.ts +71 -0
- package/src/cli/detached-run.ts +131 -0
- package/src/cli/diagnostic-fold.ts +28 -0
- package/src/cli/direct-run.ts +14 -1
- package/src/cli/eval.ts +141 -0
- package/src/cli/journal-timeout.ts +49 -0
- package/src/cli/local-agent-remedy.ts +6 -4
- package/src/cli/observer-session.ts +7 -1
- package/src/cli/reuse.ts +25 -0
- package/src/cli/run.ts +75 -67
- package/src/cli/running-step.ts +140 -0
- package/src/cli/status.ts +19 -13
- package/src/cli-adapter.ts +7 -1
- package/src/cli-commands.ts +43 -7
- package/src/cli-watch.ts +8 -5
- package/src/cli.ts +158 -51
- package/src/cloud-answer.ts +202 -0
- package/src/cloud-auth-store.ts +185 -0
- package/src/cloud-http.ts +61 -50
- package/src/cloud-human-wait.ts +23 -0
- package/src/cloud-mirror-transport.ts +1 -0
- package/src/cloud-run-record.ts +14 -5
- package/src/cloud-run.ts +46 -2
- package/src/communication/local.ts +6 -1
- package/src/communication/worker.ts +11 -3
- package/src/compile.ts +5 -3
- package/src/daemon-spec-validation.ts +126 -0
- package/src/failure-kinds.ts +17 -1
- package/src/flow-eval-cloud.ts +114 -0
- package/src/flow-eval-error.ts +10 -0
- package/src/flow-eval-gate.ts +114 -0
- package/src/flow-eval-local.ts +236 -0
- package/src/flow-eval-outcome.ts +43 -0
- package/src/flow-eval-report.ts +102 -0
- package/src/flow-eval-suite.ts +169 -0
- package/src/flow-eval-version.ts +316 -0
- package/src/flow-eval.ts +234 -0
- package/src/helper-operation-use.ts +285 -0
- package/src/helper-preflight.ts +17 -2
- package/src/helper-reference.ts +6 -6
- package/src/index.ts +15 -1
- package/src/journal-budgeted-reads.ts +134 -0
- package/src/journal-client.ts +59 -166
- package/src/journal-connection.ts +222 -0
- package/src/journal-read-policy.ts +123 -0
- package/src/named-gate-lowering.ts +2 -6
- package/src/re2js-embedded.ts +3 -0
- package/src/spec.ts +10 -0
- package/src/step-fields.ts +1 -1
- package/src/validate.ts +14 -0
- package/src/worker-cli.ts +14 -3
- package/src/worker-lease.ts +11 -3
- package/src/worker.ts +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { unavailableValidation, validationAnnotation } from './daemon-spec-validation.js';
|
|
3
|
+
import { foldUnprovableEffects } from './cli/diagnostic-fold.js';
|
|
4
|
+
import { startDetachedRun, emitDetachedHandle } from './cli/detached-run.js';
|
|
5
|
+
import { takeDetachedReceipt } from './cli/detached-record.js';
|
|
2
6
|
import { withSubscriptionMetadata } from './cli/subscription-report.js';
|
|
3
7
|
import { addPlugin } from './cli/add.js';
|
|
4
8
|
import { parsePluginArgs, runPluginCommand } from './cli/plugin.js';
|
|
@@ -12,11 +16,13 @@ import { realpathSync } from 'node:fs';
|
|
|
12
16
|
import { pathToFileURL } from 'node:url';
|
|
13
17
|
import { checkFlow, inputFailureReport, } from './cli/check.js';
|
|
14
18
|
import { resumeFlow, runFlow, } from './cli/run.js';
|
|
19
|
+
import { runCloudAnswerCli } from './cli/cloud-answer.js';
|
|
15
20
|
import { answerFlow } from './cli/answer.js';
|
|
16
21
|
import { checkAuthoredTriggers } from './cli/check-triggers.js';
|
|
17
22
|
import { parseWebhookArgs, runServeWebhook } from './cli/serve-webhook.js';
|
|
18
23
|
import { runDirectFlow } from './cli/direct-run.js';
|
|
19
24
|
import { parseReplayArgs, replayJournal } from './cli/replay.js';
|
|
25
|
+
import { parseEvalArgs, runEvalCli } from './cli/eval.js';
|
|
20
26
|
import { parseStatusArgs, runStatus } from './cli/status.js';
|
|
21
27
|
import { parseLogsArgs, parseRunsArgs, runCloudLogsCli, runCloudRunsCli, runCloudStatusCli, } from './cli/cloud-read.js';
|
|
22
28
|
import { runCloudLogsFollow, runCloudStatusWatch } from './cli/cloud-live.js';
|
|
@@ -34,7 +40,7 @@ import { parseBuildArgs, runBuild } from './cli/build.js';
|
|
|
34
40
|
import { runHnMonitor } from './cli/hn-monitor.js';
|
|
35
41
|
import { runTickRunner } from './cli/tick-runner.js';
|
|
36
42
|
import { DEFAULT_DATA_DIR } from './daemon-connection.js';
|
|
37
|
-
import { CLI_VERB_NAMES } from './cli-commands.js';
|
|
43
|
+
import { CLI_VERB_NAMES, isGlobalOption } from './cli-commands.js';
|
|
38
44
|
import { isAgentCapacity } from './worker-slots.js';
|
|
39
45
|
import { mintObserverUrl, resolveObserverLinkEnv, } from './observer-link.js';
|
|
40
46
|
import { packageVersion } from './package-version.js';
|
|
@@ -58,18 +64,20 @@ const USAGE = [
|
|
|
58
64
|
'flows schedules [--json]',
|
|
59
65
|
'flows unschedule [--json] <schedule-id>',
|
|
60
66
|
'flows deploy <flow>@sha256:<digest> --to <file-bucket-uri>',
|
|
61
|
-
'flows run <flow>@sha256:<digest> [--bucket <file-bucket-uri>] [--data-dir <dir>] [--json]',
|
|
62
|
-
'flows check [--watch] [--json] <flow.ts|flow.yaml|spec.json>',
|
|
67
|
+
'flows run <flow>@sha256:<digest> [--bucket <file-bucket-uri>] [--data-dir <dir>] [--json] [--detach]',
|
|
68
|
+
'flows check [--against-daemon|--no-daemon-check] [--watch] [--json] [--explain-warnings] <flow.ts|flow.yaml|spec.json>',
|
|
63
69
|
'flows serve-webhook --data-dir <dir> --port <p> [--allow <name>[,<name>]]',
|
|
64
|
-
'flows run [--json] [--no-spawn] [--no-observer-link] [--cloud-mirror] [--data-dir <dir>] [--local-agent [--agent-capacity <n>]] [--reuse-from <run-id>] <flow.yaml|spec.json>',
|
|
70
|
+
'flows run [--json] [--no-spawn] [--no-observer-link] [--cloud-mirror] [--detach] [--data-dir <dir>] [--local-agent [--agent-capacity <n>]] [--reuse-from <run-id>] <flow.yaml|spec.json>',
|
|
65
71
|
'flows run --cloud [--json] [--wait] [--sync-code] [--no-connect] <flow.yaml|spec.json>',
|
|
66
72
|
'flows run --cloud [--json] [--wait] [--sync-code] [--no-connect] <flow.ts> --input <inline-json-or-file>',
|
|
67
73
|
'flows sync [--json] [--dry-run] [--dir <path>] <run-id>',
|
|
68
|
-
'flows run [--json] [--no-spawn] [--no-observer-link] [--cloud-mirror] [--data-dir <dir>] [--local-agent [--agent-capacity <n>]] <flow.ts> --input <inline-json-or-file>',
|
|
74
|
+
'flows run [--json] [--no-spawn] [--no-observer-link] [--cloud-mirror] [--detach] [--data-dir <dir>] [--local-agent [--agent-capacity <n>]] <flow.ts> --input <inline-json-or-file>',
|
|
69
75
|
'flows tick start --schedule-id <id> --interval-ms <ms> [--epoch-ms <ms>] [--max-catch-up <n>] [--poll-interval-ms <ms>] [--data-dir <dir>] <spec.json>',
|
|
70
|
-
'flows resume [--allow-human-influenced] [--json] [--no-spawn] [--no-observer-link] [--cloud-mirror] [--data-dir <dir>] [--local-agent [--agent-capacity <n>]] <run-id>',
|
|
76
|
+
'flows resume [--allow-human-influenced] [--json] [--no-spawn] [--no-observer-link] [--cloud-mirror] [--detach] [--data-dir <dir>] [--local-agent [--agent-capacity <n>]] <run-id>',
|
|
77
|
+
'flows answer --cloud [--json] [--note <text>] [--source <path>] <run-id> <yes|no>',
|
|
71
78
|
'flows answer [--json] [--no-spawn] [--data-dir <dir>] [--note <text>] [--by <identity>] <run-id> <wait-id> <yes|no>',
|
|
72
79
|
'flows replay [--allow-human-influenced] [--json] [--data-dir <dir>] <run-id> [--at <step-id>]',
|
|
80
|
+
'flows eval [--json] [--cloud] [--data-dir <dir>] [--local-agent] [--concurrency <n>] [--report <file>] [--baseline <report.json>] [--expect-version <sha256:hex>] <flow> --cases <suite.json>',
|
|
73
81
|
'flows status [--json] [--data-dir <dir>] [--tail <n>] [<run-id>]',
|
|
74
82
|
'flows status --cloud [--json] [--watch] <run-id>',
|
|
75
83
|
'flows runs [--limit <n>] [--json]',
|
|
@@ -114,11 +122,11 @@ async function withInterrupt(provided, body) {
|
|
|
114
122
|
}
|
|
115
123
|
}
|
|
116
124
|
export async function runCli(args, io = PROCESS_IO, options = {}) {
|
|
117
|
-
if (
|
|
125
|
+
if (isGlobalOption(args, '--version')) {
|
|
118
126
|
io.stdout(options.version ?? packageVersion());
|
|
119
127
|
return 0;
|
|
120
128
|
}
|
|
121
|
-
if (
|
|
129
|
+
if (isGlobalOption(args, '--help')) {
|
|
122
130
|
io.stdout(USAGE);
|
|
123
131
|
return 0;
|
|
124
132
|
}
|
|
@@ -128,6 +136,17 @@ export async function runCli(args, io = PROCESS_IO, options = {}) {
|
|
|
128
136
|
emitCheckReport(report, args.includes('--json'), io);
|
|
129
137
|
return 2;
|
|
130
138
|
}
|
|
139
|
+
if ((parsed.command === 'run' || parsed.command === 'resume') && parsed.detach) {
|
|
140
|
+
const result = await startDetachedRun(args, {
|
|
141
|
+
...parsed, ...(options.selfCommand === undefined ? {} : { selfCommand: options.selfCommand }),
|
|
142
|
+
});
|
|
143
|
+
if ('execution' in result) {
|
|
144
|
+
emitRunReport(result.execution, parsed.json, io);
|
|
145
|
+
return result.execution.exitCode;
|
|
146
|
+
}
|
|
147
|
+
emitDetachedHandle(result.handle, parsed.json, io);
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
131
150
|
if (parsed.command === 'add')
|
|
132
151
|
return addPlugin(parsed.value, io);
|
|
133
152
|
if (parsed.command === 'plugin')
|
|
@@ -158,6 +177,10 @@ export async function runCli(args, io = PROCESS_IO, options = {}) {
|
|
|
158
177
|
return runCloudUnscheduleCli(parsed, io);
|
|
159
178
|
if (parsed.command === 'replay')
|
|
160
179
|
return replayJournal(parsed, io);
|
|
180
|
+
if (parsed.command === 'eval') {
|
|
181
|
+
const evaluation = parsed;
|
|
182
|
+
return withInterrupt(options.signal, (signal) => runEvalCli(evaluation, io, signal));
|
|
183
|
+
}
|
|
161
184
|
// Daemon-free like `check`: reads one journal file and nothing else, so it
|
|
162
185
|
// works inside a step of a run whose daemon is gone (kernel/DAEMON-LIFECYCLE.md §4).
|
|
163
186
|
if (parsed.command === 'status') {
|
|
@@ -179,6 +202,9 @@ export async function runCli(args, io = PROCESS_IO, options = {}) {
|
|
|
179
202
|
? withInterrupt(options.signal, (signal) => runCloudLogsFollow(logs, io, { signal }))
|
|
180
203
|
: runCloudLogsCli(logs, io);
|
|
181
204
|
}
|
|
205
|
+
if (parsed.command === 'cloud-answer') {
|
|
206
|
+
return withInterrupt(options.signal, signal => runCloudAnswerCli(parsed, io, signal));
|
|
207
|
+
}
|
|
182
208
|
if (parsed.command === 'answer') {
|
|
183
209
|
const execution = await answerFlow(parsed.runId, parsed.waitId, parsed.answer, parsed.dataDir, {
|
|
184
210
|
...(parsed.note === undefined ? {} : { note: parsed.note }),
|
|
@@ -194,21 +220,21 @@ export async function runCli(args, io = PROCESS_IO, options = {}) {
|
|
|
194
220
|
return runDeploy(parsed, io);
|
|
195
221
|
if (parsed.command === 'check') {
|
|
196
222
|
if (parsed.watch) {
|
|
197
|
-
return withInterrupt(options.signal, (signal) => watchCheck(parsed.value, parsed.json, io, signal));
|
|
223
|
+
return withInterrupt(options.signal, (signal) => watchCheck(parsed.value, { json: parsed.json, explainWarnings: parsed.explainWarnings }, io, signal, parsed.daemonValidation));
|
|
198
224
|
}
|
|
199
|
-
//
|
|
200
|
-
//
|
|
201
|
-
// refuses `--data-dir` on `check`, so there is no data dir to attach to.
|
|
202
|
-
// `flows check` keeps working with no daemon, no relayflowd binary and no
|
|
203
|
-
// data directory at all -- a property worth keeping, not an omission.
|
|
204
|
-
// Only this invocation opts into `agent_worker_unresolved`: `flows check`
|
|
205
|
-
// attaches no worker and, being daemon-free, cannot see one attached
|
|
206
|
-
// elsewhere. The authored `.flow.ts` path checks header declarations
|
|
207
|
-
// without compiling steps, so it has no agent steps to count.
|
|
225
|
+
// Stateless binary validation opens no socket or data dir (DAEMON-LIFECYCLE §4).
|
|
226
|
+
// Authored bodies are only lowered at run time, so their acceptance is unproven.
|
|
208
227
|
const checked = /\.(?:[cm]?[jt]s)$/.test(parsed.value)
|
|
209
228
|
? await checkAuthoredFlowComposed(parsed.value)
|
|
210
|
-
: checkFlow(parsed.value, { warnUnresolvedAgentWorker: true });
|
|
211
|
-
|
|
229
|
+
: checkFlow(parsed.value, { warnUnresolvedAgentWorker: true, warnUnresolvedHelperCredential: true, daemonValidation: parsed.daemonValidation });
|
|
230
|
+
if (checked.report.validation === undefined) {
|
|
231
|
+
const unavailable = unavailableValidation(parsed.daemonValidation, checked.report.ok ? (parsed.daemonValidation === 'off' ? 'disabled' : 'authored_body') : 'not_reached');
|
|
232
|
+
checked.report.validation = unavailable.validation;
|
|
233
|
+
if (checked.report.ok)
|
|
234
|
+
checked.report.diagnostics.push(...unavailable.diagnostics);
|
|
235
|
+
checked.report.ok = checked.report.ok && !checked.report.diagnostics.some(d => d.severity === 'refusal');
|
|
236
|
+
}
|
|
237
|
+
emitCheckReport(checked.report, parsed.json, io, parsed.explainWarnings);
|
|
212
238
|
return checked.report.ok ? 0 : 2;
|
|
213
239
|
}
|
|
214
240
|
if (parsed.command === 'observer')
|
|
@@ -240,7 +266,9 @@ export async function runCli(args, io = PROCESS_IO, options = {}) {
|
|
|
240
266
|
// not here. Hoisting it above the dispatch would start a daemon as a side
|
|
241
267
|
// effect of an invocation that is about to be refused for bad input.
|
|
242
268
|
const startedSteps = new Map();
|
|
243
|
-
const observer = parsed.noObserverLink ? undefined : createObserverSession(parsed.command, io
|
|
269
|
+
const observer = parsed.noObserverLink ? undefined : createObserverSession(parsed.command, io, process.env, {
|
|
270
|
+
onObserverUrl: url => options.detachedReceipt?.observerUrl(url),
|
|
271
|
+
});
|
|
244
272
|
const runnerLog = [];
|
|
245
273
|
// Opt-in, unlike the observer link beside it. The observer is the default
|
|
246
274
|
// way to watch a local run: it is free, it needs only a workspace key, and
|
|
@@ -285,17 +313,25 @@ export async function runCli(args, io = PROCESS_IO, options = {}) {
|
|
|
285
313
|
localAgent: parsed.localAgent,
|
|
286
314
|
...(parsed.agentCapacity === undefined ? {} : { agentCapacity: parsed.agentCapacity }),
|
|
287
315
|
onProgress: showProgress,
|
|
288
|
-
...(observer === undefined && mirror === undefined ? {} : {
|
|
316
|
+
...(observer === undefined && mirror === undefined && options.detachedReceipt === undefined ? {} : {
|
|
289
317
|
onJournalEntry: (entry) => {
|
|
318
|
+
// Resume's watch replays history before admission; it is not a receipt.
|
|
319
|
+
if (parsed.command === 'run' && entry.entry_type === 'run.spawned') {
|
|
320
|
+
options.detachedReceipt?.started({ runId: entry.run_id });
|
|
321
|
+
}
|
|
290
322
|
observer?.onJournalEntry(entry);
|
|
291
323
|
mirror?.onJournalEntry(entry);
|
|
292
324
|
},
|
|
293
325
|
onRunStarted: (run) => {
|
|
326
|
+
options.detachedReceipt?.started(run);
|
|
294
327
|
observer?.onRunStarted(run);
|
|
295
328
|
mirror?.onRunStarted(run);
|
|
296
329
|
},
|
|
297
|
-
...(mirror === undefined ? {} : {
|
|
298
|
-
onRunReceipt: (run) => {
|
|
330
|
+
...(mirror === undefined && options.detachedReceipt === undefined ? {} : {
|
|
331
|
+
onRunReceipt: (run) => {
|
|
332
|
+
options.detachedReceipt?.started(run);
|
|
333
|
+
mirror?.onRunStarted(run);
|
|
334
|
+
},
|
|
299
335
|
}),
|
|
300
336
|
}),
|
|
301
337
|
onWait: (progress) => {
|
|
@@ -313,6 +349,7 @@ export async function runCli(args, io = PROCESS_IO, options = {}) {
|
|
|
313
349
|
? await runDirectFlow(parsed.value, parsed.input, parsed.dataDir, lifecycle)
|
|
314
350
|
: await runFlow(parsed.value, parsed.dataDir, lifecycle)
|
|
315
351
|
: await resumeFlow(parsed.value, parsed.dataDir, lifecycle);
|
|
352
|
+
options.detachedReceipt?.finished(execution);
|
|
316
353
|
// The link is scoped to the run's channel, so it exists only once the run
|
|
317
354
|
// does. `finish` drains the projection and settles the mint, both bounded;
|
|
318
355
|
// it never rejects (see `createObserverSession`).
|
|
@@ -350,20 +387,33 @@ export async function runCli(args, io = PROCESS_IO, options = {}) {
|
|
|
350
387
|
* aspects' coverage.
|
|
351
388
|
*/
|
|
352
389
|
async function checkAuthoredFlowComposed(path) {
|
|
353
|
-
const
|
|
390
|
+
const invocation = { warnUnresolvedHelperCredential: true };
|
|
391
|
+
const helper = await checkHelperBody(path, invocation);
|
|
354
392
|
if (!helper.report.ok)
|
|
355
393
|
return helper;
|
|
356
394
|
// The activity checker loads the TypeScript compiler. YAML checks and
|
|
357
395
|
// unrelated CLI commands should not pay that startup cost on every run.
|
|
358
396
|
const { checkAuthoredActivities } = await import('./cli/check-activities.js');
|
|
359
397
|
const activities = await checkAuthoredActivities(path);
|
|
360
|
-
if (!activities.report.ok)
|
|
361
|
-
|
|
398
|
+
if (!activities.report.ok) {
|
|
399
|
+
// Keep what is already provable about the flow: its helper warnings and
|
|
400
|
+
// integration requirements, so one check reports both problems.
|
|
401
|
+
const requirements = isAuthoredFlowPath(path)
|
|
402
|
+
? (await checkAuthoredTriggers(path, invocation)).report.requirements : undefined;
|
|
403
|
+
return { report: { ...activities.report,
|
|
404
|
+
diagnostics: [...helper.report.diagnostics, ...activities.report.diagnostics],
|
|
405
|
+
...(requirements === undefined ? {} : { requirements }) } };
|
|
406
|
+
}
|
|
362
407
|
const mcp = await checkTypeScriptFlow(path);
|
|
363
408
|
const triggers = isAuthoredFlowPath(path)
|
|
364
|
-
? await checkAuthoredTriggers(path)
|
|
409
|
+
? await checkAuthoredTriggers(path, invocation)
|
|
365
410
|
: undefined;
|
|
366
411
|
const triggerDiagnostics = triggers?.report.diagnostics ?? [];
|
|
412
|
+
// The trigger leg normally repeats the helper diagnostics; keep any it did not
|
|
413
|
+
// (an early trigger or config failure reports none of them).
|
|
414
|
+
const repeated = new Set(triggerDiagnostics.map(diagnostic => `${diagnostic.kind}\u0000${diagnostic.message}`));
|
|
415
|
+
const helperDiagnostics = helper.report.diagnostics
|
|
416
|
+
.filter(diagnostic => !repeated.has(`${diagnostic.kind}\u0000${diagnostic.message}`));
|
|
367
417
|
const triggerOk = triggers?.report.ok ?? true;
|
|
368
418
|
return {
|
|
369
419
|
report: {
|
|
@@ -374,7 +424,7 @@ async function checkAuthoredFlowComposed(path) {
|
|
|
374
424
|
// The authored definition sees helper flags, body use and `cli:`
|
|
375
425
|
// declarations; the compiled view underneath knows only its steps.
|
|
376
426
|
...(triggers?.report.requirements === undefined ? {} : { requirements: triggers.report.requirements }),
|
|
377
|
-
diagnostics: [...
|
|
427
|
+
diagnostics: [...helperDiagnostics, ...activities.report.diagnostics, ...mcp.report.diagnostics, ...triggerDiagnostics],
|
|
378
428
|
ok: helper.report.ok && activities.report.ok && mcp.report.ok && triggerOk,
|
|
379
429
|
},
|
|
380
430
|
};
|
|
@@ -502,6 +552,8 @@ function parseArgs(args) {
|
|
|
502
552
|
return parsePluginArgs(args.slice(1));
|
|
503
553
|
if (command === 'replay')
|
|
504
554
|
return parseReplayArgs(args.slice(1));
|
|
555
|
+
if (command === 'eval')
|
|
556
|
+
return parseEvalArgs(args.slice(1));
|
|
505
557
|
if (command === 'status')
|
|
506
558
|
return parseStatusArgs(args.slice(1));
|
|
507
559
|
if (command === 'runs')
|
|
@@ -569,11 +621,14 @@ function parseArgs(args) {
|
|
|
569
621
|
return undefined;
|
|
570
622
|
let json = false;
|
|
571
623
|
let watch = false;
|
|
624
|
+
let daemonValidation;
|
|
625
|
+
let explainWarnings = false;
|
|
572
626
|
let cloud = false;
|
|
573
627
|
let wait = false;
|
|
574
628
|
let syncCode = false;
|
|
575
629
|
let noConnect = false;
|
|
576
630
|
let localAgent = false;
|
|
631
|
+
let detach = false;
|
|
577
632
|
let agentCapacity;
|
|
578
633
|
let allowHumanInfluenced = false;
|
|
579
634
|
let dataDir = DEFAULT_DATA_DIR;
|
|
@@ -603,6 +658,12 @@ function parseArgs(args) {
|
|
|
603
658
|
noConnect = true;
|
|
604
659
|
continue;
|
|
605
660
|
}
|
|
661
|
+
if (argument === '--detach') {
|
|
662
|
+
if (command === 'check' || detach)
|
|
663
|
+
return undefined;
|
|
664
|
+
detach = true;
|
|
665
|
+
continue;
|
|
666
|
+
}
|
|
606
667
|
if (argument === '--allow-human-influenced') {
|
|
607
668
|
if (command === 'check' || allowHumanInfluenced)
|
|
608
669
|
return undefined;
|
|
@@ -625,6 +686,18 @@ function parseArgs(args) {
|
|
|
625
686
|
return undefined;
|
|
626
687
|
continue;
|
|
627
688
|
}
|
|
689
|
+
if (argument === '--against-daemon' || argument === '--no-daemon-check') {
|
|
690
|
+
if (command !== 'check' || daemonValidation !== undefined)
|
|
691
|
+
return undefined;
|
|
692
|
+
daemonValidation = argument === '--against-daemon' ? 'required' : 'off';
|
|
693
|
+
continue;
|
|
694
|
+
}
|
|
695
|
+
if (argument === '--explain-warnings') {
|
|
696
|
+
if (command !== 'check' || explainWarnings)
|
|
697
|
+
return undefined;
|
|
698
|
+
explainWarnings = true;
|
|
699
|
+
continue;
|
|
700
|
+
}
|
|
628
701
|
if (argument === '--watch') {
|
|
629
702
|
if (command !== 'check' || watch)
|
|
630
703
|
return undefined;
|
|
@@ -712,7 +785,7 @@ function parseArgs(args) {
|
|
|
712
785
|
// observer-link opt-out -- describes nothing there and is refused rather
|
|
713
786
|
// than ignored. `--input` is the authored body's argument and travels with
|
|
714
787
|
// the source, so it is accepted exactly where a local run accepts it.
|
|
715
|
-
if (allowHumanInfluenced || sawDataDir || !spawn || localAgent || noObserverLink || cloudMirror
|
|
788
|
+
if (detach || allowHumanInfluenced || sawDataDir || !spawn || localAgent || noObserverLink || cloudMirror
|
|
716
789
|
|| reuseFromRunId !== undefined)
|
|
717
790
|
return undefined;
|
|
718
791
|
if (sawInput && !isAuthoredFlowPath(positionals[0]))
|
|
@@ -726,10 +799,12 @@ function parseArgs(args) {
|
|
|
726
799
|
if (command === 'run' && input !== undefined && !isAuthoredFlowPath(positionals[0]))
|
|
727
800
|
return undefined;
|
|
728
801
|
return command === 'check'
|
|
729
|
-
? { command, json, watch, value: positionals[0]
|
|
802
|
+
? { command, json, watch, explainWarnings, value: positionals[0],
|
|
803
|
+
daemonValidation: daemonValidation ?? (process.env['FLOWS_NO_DAEMON_CHECK'] === '1' ? 'off'
|
|
804
|
+
: process.env['FLOWS_CHECK_AGAINST_DAEMON'] === '1' ? 'required' : 'auto') }
|
|
730
805
|
: command === 'run'
|
|
731
|
-
? { command, bucket, reuseFromRunId, localAgent, agentCapacity, dataDir, input, json, spawn, noObserverLink, cloudMirror, allowHumanInfluenced, value: positionals[0] }
|
|
732
|
-
: { command, localAgent, agentCapacity, dataDir, json, spawn, noObserverLink, cloudMirror, allowHumanInfluenced, value: positionals[0] };
|
|
806
|
+
? { command, ...(detach ? { detach } : {}), bucket, reuseFromRunId, localAgent, agentCapacity, dataDir, input, json, spawn, noObserverLink, cloudMirror, allowHumanInfluenced, value: positionals[0] }
|
|
807
|
+
: { command, ...(detach ? { detach } : {}), localAgent, agentCapacity, dataDir, json, spawn, noObserverLink, cloudMirror, allowHumanInfluenced, value: positionals[0] };
|
|
733
808
|
}
|
|
734
809
|
/**
|
|
735
810
|
* `flows answer [--json] [--no-spawn] [--data-dir <dir>] [--note <text>] [--by <identity>] <run-id> <wait-id> <yes|no>`.
|
|
@@ -741,6 +816,8 @@ function parseArgs(args) {
|
|
|
741
816
|
*/
|
|
742
817
|
function parseAnswerArgs(rest) {
|
|
743
818
|
let json = false;
|
|
819
|
+
let cloud = false;
|
|
820
|
+
let source;
|
|
744
821
|
let spawn = true;
|
|
745
822
|
let dataDir = DEFAULT_DATA_DIR;
|
|
746
823
|
let sawDataDir = false;
|
|
@@ -749,6 +826,20 @@ function parseAnswerArgs(rest) {
|
|
|
749
826
|
const positionals = [];
|
|
750
827
|
for (let index = 0; index < rest.length; index += 1) {
|
|
751
828
|
const argument = rest[index];
|
|
829
|
+
if (argument === '--cloud') {
|
|
830
|
+
if (cloud)
|
|
831
|
+
return undefined;
|
|
832
|
+
cloud = true;
|
|
833
|
+
continue;
|
|
834
|
+
}
|
|
835
|
+
if (argument === '--source') {
|
|
836
|
+
const value = rest[index + 1];
|
|
837
|
+
if (source !== undefined || value === undefined || value.startsWith('-'))
|
|
838
|
+
return undefined;
|
|
839
|
+
source = value;
|
|
840
|
+
index += 1;
|
|
841
|
+
continue;
|
|
842
|
+
}
|
|
752
843
|
if (argument === '--json') {
|
|
753
844
|
if (json)
|
|
754
845
|
return undefined;
|
|
@@ -790,6 +881,17 @@ function parseAnswerArgs(rest) {
|
|
|
790
881
|
return undefined;
|
|
791
882
|
positionals.push(argument);
|
|
792
883
|
}
|
|
884
|
+
if (cloud) {
|
|
885
|
+
if (sawDataDir || !spawn || by !== undefined || positionals.length !== 2)
|
|
886
|
+
return undefined;
|
|
887
|
+
const [runId, word] = positionals;
|
|
888
|
+
const answer = word === 'yes' || word === 'true' ? true : word === 'no' || word === 'false' ? false : undefined;
|
|
889
|
+
if (answer === undefined)
|
|
890
|
+
return undefined;
|
|
891
|
+
return { command: 'cloud-answer', runId, answer, json, ...(note === undefined ? {} : { note }), ...(source === undefined ? {} : { source }) };
|
|
892
|
+
}
|
|
893
|
+
if (source !== undefined)
|
|
894
|
+
return undefined;
|
|
793
895
|
if (positionals.length !== 3)
|
|
794
896
|
return undefined;
|
|
795
897
|
const [runId, waitId, word] = positionals;
|
|
@@ -1006,15 +1108,12 @@ function parseTickArgs(rest) {
|
|
|
1006
1108
|
};
|
|
1007
1109
|
}
|
|
1008
1110
|
/**
|
|
1009
|
-
*
|
|
1010
|
-
*
|
|
1011
|
-
* worker, and this says what has to be true for one to be attached. So the
|
|
1012
|
-
* plain-text pass holds it back and emits it in that position, exactly once —
|
|
1013
|
-
* the leading batch below skips it rather than printing it twice. JSON mode
|
|
1014
|
-
* returns before any of this and keeps the single ordered diagnostics array.
|
|
1111
|
+
* Worker and helper warnings annotate REQUIRES. Hold them back until that
|
|
1112
|
+
* line, then emit each once. JSON keeps the single diagnostics array.
|
|
1015
1113
|
*/
|
|
1016
|
-
function
|
|
1017
|
-
return diagnostic.kind === 'agent_worker_unresolved'
|
|
1114
|
+
function isRequiresFootnote(diagnostic) {
|
|
1115
|
+
return diagnostic.kind === 'agent_worker_unresolved'
|
|
1116
|
+
|| diagnostic.kind === 'helper_credential_unresolved';
|
|
1018
1117
|
}
|
|
1019
1118
|
const MODEL_PROVENANCE = {
|
|
1020
1119
|
step: 'step',
|
|
@@ -1025,14 +1124,18 @@ const MODEL_PROVENANCE = {
|
|
|
1025
1124
|
function modelProvenance(source) {
|
|
1026
1125
|
return source === undefined ? '' : ` from ${MODEL_PROVENANCE[source]}`;
|
|
1027
1126
|
}
|
|
1028
|
-
function emitCheckReport(report, json, io) {
|
|
1127
|
+
function emitCheckReport(report, json, io, explainWarnings = false) {
|
|
1128
|
+
const foldOptions = {
|
|
1129
|
+
fold: true, explain: explainWarnings,
|
|
1130
|
+
...(report.gates.length > 0 ? { totalSteps: report.gates.length } : {}),
|
|
1131
|
+
};
|
|
1029
1132
|
if (json) {
|
|
1030
|
-
emitDiagnostics(report.diagnostics, io);
|
|
1133
|
+
emitDiagnostics(report.diagnostics, io, foldOptions);
|
|
1031
1134
|
io.stdout(JSON.stringify(report));
|
|
1032
1135
|
return;
|
|
1033
1136
|
}
|
|
1034
|
-
const deferred = report.diagnostics.filter(
|
|
1035
|
-
emitDiagnostics(report.diagnostics.filter((diagnostic) => !
|
|
1137
|
+
const deferred = report.diagnostics.filter(isRequiresFootnote);
|
|
1138
|
+
emitDiagnostics(report.diagnostics.filter((diagnostic) => !isRequiresFootnote(diagnostic)), io, foldOptions);
|
|
1036
1139
|
for (const gate of report.gates) {
|
|
1037
1140
|
// A gate that accepts every output is legal, but it must not read like a
|
|
1038
1141
|
// gate that judges something.
|
|
@@ -1081,9 +1184,9 @@ function emitCheckReport(report, json, io) {
|
|
|
1081
1184
|
const requires = report.requirements === undefined ? '' : describeFlowRequirements(report.requirements);
|
|
1082
1185
|
if (requires)
|
|
1083
1186
|
io.stdout(`REQUIRES ${requires}`);
|
|
1084
|
-
emitDiagnostics(deferred, io);
|
|
1187
|
+
emitDiagnostics(deferred, io, foldOptions);
|
|
1085
1188
|
if (report.ok)
|
|
1086
|
-
io.stdout(`CHECK PASSED ${report.path ?? ''}`.trimEnd());
|
|
1189
|
+
io.stdout(`CHECK PASSED ${report.path ?? ''}`.trimEnd() + validationAnnotation(report.validation));
|
|
1087
1190
|
}
|
|
1088
1191
|
function emitRunReport(execution, json, io, observerUrl, mirror) {
|
|
1089
1192
|
const { report } = execution;
|
|
@@ -1139,8 +1242,8 @@ function emitRunReport(execution, json, io, observerUrl, mirror) {
|
|
|
1139
1242
|
if (observerUrl !== undefined)
|
|
1140
1243
|
io.stdout(`Observer: ${observerUrl}`);
|
|
1141
1244
|
}
|
|
1142
|
-
function emitDiagnostics(diagnostics, io) {
|
|
1143
|
-
for (const diagnostic of diagnostics) {
|
|
1245
|
+
function emitDiagnostics(diagnostics, io, options = {}) {
|
|
1246
|
+
for (const diagnostic of foldUnprovableEffects(diagnostics, options)) {
|
|
1144
1247
|
io.stderr(`${diagnosticLabel(diagnostic.severity)} [${diagnostic.kind}] ${diagnostic.message}`);
|
|
1145
1248
|
}
|
|
1146
1249
|
}
|
|
@@ -1164,7 +1267,8 @@ function isDirectInvocation(entryPath) {
|
|
|
1164
1267
|
}
|
|
1165
1268
|
}
|
|
1166
1269
|
if (isDirectInvocation(process.argv[1])) {
|
|
1167
|
-
|
|
1270
|
+
const detachedReceipt = takeDetachedReceipt();
|
|
1271
|
+
void runCli(process.argv.slice(2), PROCESS_IO, { detachedReceipt }).then((exitCode) => {
|
|
1168
1272
|
process.exitCode = exitCode;
|
|
1169
1273
|
});
|
|
1170
1274
|
}
|