@deksden-com/dd-flow-cli 0.9.0-beta.11 → 0.9.0-beta.110
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 +520 -0
- package/README.md +68 -0
- package/dist/build-info.json +8 -8
- package/dist/cli/command-inputs.js +305 -0
- package/dist/cli/help.js +89 -13
- package/dist/cli/hook-ingress.js +77 -0
- package/dist/cli/input-preparation.js +116 -0
- package/dist/cli/native-hook-ingress.js +48 -0
- package/dist/cli/run-cli.js +1465 -384
- package/dist/cli.js +8 -2
- package/dist/harness-runtime/DD-ZCODE.md +99 -0
- package/dist/harness-runtime/bin/dd-agy.mjs +52 -0
- package/dist/harness-runtime/bin/dd-codex.mjs +26 -0
- package/dist/harness-runtime/bin/dd-droid.mjs +33 -0
- package/dist/harness-runtime/bin/dd-grok.mjs +30 -0
- package/dist/harness-runtime/bin/dd-opencode.mjs +21 -0
- package/dist/harness-runtime/bin/dd-zcode.mjs +83 -0
- package/dist/harness-runtime/lib/agy-hooks.d.mts +1 -0
- package/dist/harness-runtime/lib/agy-hooks.mjs +9 -0
- package/dist/harness-runtime/lib/daemon-operations.mjs +226 -0
- package/dist/harness-runtime/lib/dd-agy-daemon.d.mts +6 -0
- package/dist/harness-runtime/lib/dd-agy-daemon.mjs +500 -0
- package/dist/harness-runtime/lib/dd-agy.mjs +59 -0
- package/dist/harness-runtime/lib/dd-codex-daemon.d.mts +1 -0
- package/dist/harness-runtime/lib/dd-codex-daemon.mjs +149 -0
- package/dist/harness-runtime/lib/dd-codex.mjs +563 -0
- package/dist/harness-runtime/lib/dd-droid-daemon.mjs +125 -0
- package/dist/harness-runtime/lib/dd-droid.mjs +475 -0
- package/dist/harness-runtime/lib/dd-grok-daemon.mjs +388 -0
- package/dist/harness-runtime/lib/dd-grok.mjs +174 -0
- package/dist/harness-runtime/lib/dd-opencode-daemon.mjs +219 -0
- package/dist/harness-runtime/lib/dd-opencode.mjs +98 -0
- package/dist/harness-runtime/lib/dd-zcode-daemon.mjs +645 -0
- package/dist/harness-runtime/lib/dd-zcode.mjs +982 -0
- package/dist/harness-runtime/lib/delegation-instructions.d.mts +13 -0
- package/dist/harness-runtime/lib/delegation-instructions.mjs +144 -0
- package/dist/harness-runtime/lib/dispatch-fence.mjs +14 -0
- package/dist/harness-runtime/lib/driver-recovery.mjs +129 -0
- package/dist/harness-runtime/lib/droid-observation.mjs +66 -0
- package/dist/harness-runtime/lib/managed-daemon.mjs +327 -0
- package/dist/harness-runtime/lib/model-observations.mjs +77 -0
- package/dist/harness-runtime/lib/native-hook-command.d.mts +3 -0
- package/dist/harness-runtime/lib/native-hook-command.mjs +108 -0
- package/dist/harness-runtime/lib/observation-clock.mjs +36 -0
- package/dist/harness-runtime/lib/operation-context.mjs +5 -0
- package/dist/harness-runtime/lib/operation-errors.mjs +19 -0
- package/dist/harness-runtime/lib/process-json.mjs +71 -0
- package/dist/harness-runtime/lib/process-snapshot.mjs +10 -0
- package/dist/harness-runtime/lib/runner-events.mjs +200 -0
- package/dist/harness-runtime/lib/runner-lock.mjs +42 -0
- package/dist/harness-runtime/lib/session-settlement.mjs +30 -0
- package/dist/harness-runtime/lib/tool-observations.d.mts +17 -0
- package/dist/harness-runtime/lib/tool-observations.mjs +153 -0
- package/dist/harness-runtime/lib/zcode-usage.mjs +54 -0
- package/dist/protocol/local-files.js +18 -9
- package/dist/runtime/context.js +2 -2
- package/dist/schemas/agent-profile.schema.json +1 -1
- package/dist/schemas/code-review-result.schema.json +1 -1
- package/dist/schemas/code-work-batch.schema.json +3 -3
- package/dist/schemas/code-work-result.schema.json +3 -3
- package/dist/schemas/plan-review-result.schema.json +2 -2
- package/dist/schemas/run-control-receipt.schema.json +99 -0
- package/dist/schemas/run-control-request.schema.json +36 -0
- package/dist/schemas/vnext-protocol-plan.schema.json +2 -2
- package/dist/services/canon.js +11 -8
- package/dist/services/cleanup.js +132 -39
- package/dist/services/cli-operation-classifier.js +22 -24
- package/dist/services/code-checks.js +589 -106
- package/dist/services/codex-hook-delivery.js +28 -0
- package/dist/services/command-context.js +80 -0
- package/dist/services/config.js +11 -8
- package/dist/services/continuation-outcome.js +20 -0
- package/dist/services/controller-fanout.js +173 -0
- package/dist/services/dashboard.js +103 -31
- package/dist/services/engines.js +121 -76
- package/dist/services/eval-snapshots.js +994 -97
- package/dist/services/execution-policy.js +181 -0
- package/dist/services/external-work-launch.js +166 -0
- package/dist/services/harness-adapter.js +147 -24
- package/dist/services/harness-config.js +2 -0
- package/dist/services/hooks.js +702 -327
- package/dist/services/lanes.js +78 -65
- package/dist/services/lifecycle-command.js +113 -18
- package/dist/services/lifecycle-contract.js +30 -0
- package/dist/services/lifecycle-invocations.js +1379 -0
- package/dist/services/managed-daemon-binding.js +38 -0
- package/dist/services/managed-processes.js +302 -34
- package/dist/services/merge-queue.js +228 -149
- package/dist/services/merge-server.js +66 -28
- package/dist/services/migrations.js +37 -16
- package/dist/services/native-daemon-history.js +49 -0
- package/dist/services/native-session-control.js +39 -0
- package/dist/services/plan-runtime.js +26 -11
- package/dist/services/plans.js +28 -25
- package/dist/services/projects.js +20 -15
- package/dist/services/prompts.js +25 -16
- package/dist/services/protocols.js +160 -86
- package/dist/services/recovery-observation-budget.js +61 -0
- package/dist/services/recovery-snapshot-database.js +142 -0
- package/dist/services/repair-intents.js +40 -0
- package/dist/services/review-copy.js +136 -0
- package/dist/services/run-control-receipt.js +56 -0
- package/dist/services/run-control-worker.js +351 -0
- package/dist/services/run-control.js +888 -0
- package/dist/services/run-controller-adapter.js +231 -0
- package/dist/services/run-controller-capture.js +167 -0
- package/dist/services/run-controller-process.js +180 -0
- package/dist/services/run-controller-recovery.js +221 -0
- package/dist/services/run-controller-state.js +36 -0
- package/dist/services/run-controller.js +798 -0
- package/dist/services/run-engine-bindings.js +1 -1
- package/dist/services/run-fork.js +142 -0
- package/dist/services/run-observations.js +112 -0
- package/dist/services/run-projection.js +22 -64
- package/dist/services/run-recovery-runtime.js +80 -0
- package/dist/services/run-recovery.js +345 -0
- package/dist/services/runs.js +536 -181
- package/dist/services/runtime-budget.js +413 -0
- package/dist/services/runtime-command.js +43 -0
- package/dist/services/runtime-scope-capture.js +52 -0
- package/dist/services/runtime-scope-control.js +460 -0
- package/dist/services/runtime-scope-resume.js +577 -0
- package/dist/services/runtime-scope-stop.js +159 -0
- package/dist/services/runtime-scope-worker.js +242 -0
- package/dist/services/runtime-service.js +97 -0
- package/dist/services/schema-validation.js +10 -8
- package/dist/services/scope-writer-cleanup.js +26 -0
- package/dist/services/sessions.js +35 -69
- package/dist/services/stage-blocker.js +17 -7
- package/dist/services/stage-context.js +50 -19
- package/dist/services/stage-lifecycle.js +100 -103
- package/dist/services/stage-pause.js +88 -75
- package/dist/services/stage-report-renderer.js +116 -6
- package/dist/services/stage-work-graph.js +35 -0
- package/dist/services/usage.js +35 -98
- package/dist/services/vnext-code-review.js +197 -84
- package/dist/services/vnext-code.js +278 -251
- package/dist/services/vnext-execution-profile.js +5 -3
- package/dist/services/vnext-fanout.js +172 -17
- package/dist/services/vnext-merge.js +345 -111
- package/dist/services/vnext-plan-review.js +171 -111
- package/dist/services/vnext-plan.js +180 -87
- package/dist/services/vnext-protocolize.js +320 -74
- package/dist/services/vnext-specify.js +115 -77
- package/dist/services/work-registry.js +1001 -187
- package/dist/services/workspace-bootstrap.js +76 -0
- package/dist/services/workspace-files.js +83 -0
- package/dist/services/worktrees.js +88 -36
- package/dist/shared/entity-references.js +8 -0
- package/dist/shared/errors.js +12 -0
- package/dist/storage/database.js +692 -35
- package/dist/storage/foreign-key-transaction.js +39 -0
- package/dist/storage/immutable-input.js +45 -0
- package/dist/storage/import-guard.js +102 -0
- package/dist/storage/native-cleanup.js +52 -0
- package/dist/storage/paths.js +17 -4
- package/dist/storage/projection-lock.js +73 -0
- package/dist/storage/work-references.js +23 -0
- package/dist/storage/writer-contract.js +77 -0
- package/dist/storage/writer-migration.js +85 -0
- package/package.json +24 -13
- package/tools/repair-paused-run-status.mjs +84 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parseCommandArgs } from "./lifecycle-command.js";
|
|
1
2
|
export function classifyCliOperation(args, env = process.env) {
|
|
2
3
|
const positional = positionalArgs(args);
|
|
3
4
|
const [family = null, command = null, action = null] = positional;
|
|
@@ -14,19 +15,7 @@ export function classifyCliOperation(args, env = process.env) {
|
|
|
14
15
|
return { mode: "normal_write", operation, family, command, action };
|
|
15
16
|
}
|
|
16
17
|
function positionalArgs(args) {
|
|
17
|
-
|
|
18
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
19
|
-
const value = args[index];
|
|
20
|
-
if (!value)
|
|
21
|
-
continue;
|
|
22
|
-
if (value.startsWith("--")) {
|
|
23
|
-
if (!value.includes("=") && args[index + 1] && !args[index + 1]?.startsWith("--"))
|
|
24
|
-
index += 1;
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
positional.push(value);
|
|
28
|
-
}
|
|
29
|
-
return positional;
|
|
18
|
+
return parseCommandArgs(args).positional;
|
|
30
19
|
}
|
|
31
20
|
export function isReadOnlyCliOperation(args, env = process.env) {
|
|
32
21
|
return classifyCliOperation(args, env).mode === "read_only_diagnostics";
|
|
@@ -57,7 +46,7 @@ function isMbUpgradeMode(args, env) {
|
|
|
57
46
|
}
|
|
58
47
|
return marked && isUpgradeAllowlisted(args);
|
|
59
48
|
}
|
|
60
|
-
function isUpgradeAllowlisted(args) {
|
|
49
|
+
export function isUpgradeAllowlisted(args) {
|
|
61
50
|
const positional = positionalArgs(args);
|
|
62
51
|
const [family, command] = positional;
|
|
63
52
|
if (family === "status")
|
|
@@ -82,14 +71,9 @@ function hasRunBinding(args) {
|
|
|
82
71
|
return Boolean(optionValue(args, "run") || positionalArgs(args).some((value) => value.startsWith("RUN-")));
|
|
83
72
|
}
|
|
84
73
|
function optionValue(args, name) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return args[index + 1] ?? null;
|
|
89
|
-
if (arg?.startsWith(`--${name}=`))
|
|
90
|
-
return arg.slice(name.length + 3);
|
|
91
|
-
}
|
|
92
|
-
return null;
|
|
74
|
+
const values = parseCommandArgs(args).options.get(name);
|
|
75
|
+
const value = values?.[values.length - 1];
|
|
76
|
+
return value && value !== "__dd_flow_flag__" ? value : null;
|
|
93
77
|
}
|
|
94
78
|
function isRouterNative(args) {
|
|
95
79
|
const first = args[0];
|
|
@@ -101,11 +85,17 @@ function isRouterNative(args) {
|
|
|
101
85
|
return true;
|
|
102
86
|
if (["engine", "version", "schema"].includes(first))
|
|
103
87
|
return true;
|
|
88
|
+
if (first === "storage" && args[1] === "migrate-writer")
|
|
89
|
+
return true;
|
|
104
90
|
return (first === "codex" && args[1] === "hook" && args[2] === "handle")
|
|
91
|
+
|| (first === "zcode" && args[1] === "hook" && args[2] === "handle")
|
|
92
|
+
|| (first === "zcode" && args[1] === "invocation" && args[2] === "prepare")
|
|
105
93
|
|| (first === "zcode" && args[1] === "event" && args[2] === "handle")
|
|
106
94
|
|| (first === "zcode" && args[1] === "usage" && args[2] === "ingest")
|
|
107
95
|
|| (first === "grok" && args[1] === "event" && args[2] === "handle")
|
|
108
96
|
|| (first === "grok" && args[1] === "usage" && args[2] === "ingest")
|
|
97
|
+
|| (first === "droid" && args[1] === "event" && args[2] === "handle")
|
|
98
|
+
|| (first === "droid" && args[1] === "usage" && args[2] === "ingest")
|
|
109
99
|
|| (first === "opencode" && args[1] === "event" && args[2] === "handle")
|
|
110
100
|
|| (first === "opencode" && args[1] === "usage" && args[2] === "ingest")
|
|
111
101
|
|| (first === "agy" && args[1] === "event" && args[2] === "handle")
|
|
@@ -119,13 +109,21 @@ function isReadOnlyDiagnostic(family, command, action) {
|
|
|
119
109
|
if (family === "canon")
|
|
120
110
|
return command === "status" || command === "resolve";
|
|
121
111
|
if (family === "project")
|
|
122
|
-
return command === "status" || command === "resolve";
|
|
112
|
+
return command === "status" || command === "resolve" || (command === "config" && action === "status");
|
|
123
113
|
if (family === "protocol")
|
|
124
114
|
return ["status", "branch-status", "ready", "blockers", "implement"].includes(command ?? "");
|
|
125
115
|
if (family === "plan")
|
|
126
116
|
return command === "status";
|
|
127
117
|
if (family === "run")
|
|
128
|
-
return command === "status" || command === "
|
|
118
|
+
return ["status", "list", "timeline"].includes(command ?? "") || (["config", "flags", "drive", "control"].includes(command ?? "") && action === "status") || (command === "vars" && ["ls", "get"].includes(action ?? "")) || (command === "recovery" && action === "inspect");
|
|
119
|
+
if (family === "runtime" && command === "process" && ["status", "check-admission"].includes(action ?? ""))
|
|
120
|
+
return true;
|
|
121
|
+
if (family === "runtime" && command === "scope" && action === "status")
|
|
122
|
+
return true;
|
|
123
|
+
if (family === "work")
|
|
124
|
+
return ["status", "ls", "show"].includes(command ?? "");
|
|
125
|
+
if (family === "stage")
|
|
126
|
+
return command === "fanout" && action === "status";
|
|
129
127
|
if (family === "lane") {
|
|
130
128
|
return (command === "status" ||
|
|
131
129
|
command === "waiters" ||
|