@deksden-com/dd-flow-cli 0.9.0-beta.46 → 0.9.0-beta.47

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @deksden-com/dd-flow-cli
2
2
 
3
+ ## 0.9.0-beta.47
4
+
5
+ ### Patch Changes
6
+
7
+ - Initialize the managed Codex hook home for external worker sessions so their
8
+ first `work start` receives a trusted session binding.
9
+
3
10
  ## 0.9.0-beta.44
4
11
 
5
12
  ### Patch Changes
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "cli_package": "@deksden-com/dd-flow-cli",
3
- "cli_version": "0.9.0-beta.46",
4
- "cli_commit": "412219119d588c6d1a3178dd4bd80a54535bebc7",
5
- "built_at": "2026-09-10T19:17:56.481Z",
3
+ "cli_version": "0.9.0-beta.47",
4
+ "cli_commit": "c6ad5bc48196d4f9a616667b737363c04d837e4e",
5
+ "built_at": "2026-09-10T20:41:49.668Z",
6
6
  "built_with_canon": {
7
7
  "version": "4.1.0",
8
8
  "commit": "ef349bf47cba1c987468e51d73a0dbadbd48dc1f",
@@ -9,6 +9,7 @@ import { harnessRuntimeArguments, resolveHarnessCommand } from "./harness-config
9
9
  import { resolveExecutionPolicy, runtimeHarness, validateExecutionOverride } from "./execution-policy.js";
10
10
  import { assertRunMutationAllowed } from "./run-recovery.js";
11
11
  import { assertWorkLaunchReady, workStartCommand } from "./work-registry.js";
12
+ import { initCodexHome } from "./hooks.js";
12
13
  /**
13
14
  * Creates an external provider root for one already-created Work. The launch
14
15
  * is not a Work claim: only the worker's trusted `work start` hook binds it.
@@ -47,7 +48,16 @@ export async function launchExternalWork(context, input) {
47
48
  fs.mkdirSync(root, { recursive: true });
48
49
  const now = context.now();
49
50
  const flowExecutable = prepareHarnessFlowExecutable(context, root);
50
- const runtimeContext = { ...context, env: { ...context.env, DD_FLOW_BIN: flowExecutable } };
51
+ const env = { ...context.env, DD_FLOW_BIN: flowExecutable };
52
+ // An external Codex root is a fresh thread, so it does not inherit the
53
+ // coordinator's managed PreToolUse hook. Its first `work start` must emit
54
+ // that hook event to bind the Work to the physical session.
55
+ if (runtimeHarness(resolved.worker) === "codex-desktop") {
56
+ const codexHome = path.join(root, "codex-home");
57
+ initCodexHome(context, { projectRoot: run.project_root, profile: `external-${operationId}`, targetHome: codexHome, ...(context.env.CODEX_HOME ? { sourceHome: context.env.CODEX_HOME } : {}) });
58
+ env.CODEX_HOME = codexHome;
59
+ }
60
+ const runtimeContext = { ...context, env };
51
61
  const runtimeOwner = { schema_id: "dd-flow/runtime-owner@1", owner_id: `run:${work.run_id}:work:${work.work_id}`, role: "worker", project_id: work.project_id, run_id: work.run_id, work_id: work.work_id, operation_id: operationId, state_dir: root, dd_flow_home: context.ddFlowHome, dd_flow_bin: flowExecutable, resource_home: context.env.DD_FLOW_RESOURCE_HOME ?? context.ddFlowHome, budget: runtimeBudgetForRun(context, work.project_id, work.run_id) };
52
62
  const executable = resolveHarnessCommand(context.ddFlowHome, runtimeHarness(resolved.worker), "adapter");
53
63
  context.db.run("INSERT INTO work_launches (operation_id, work_id, profile_json, profile_hash, status, state_dir, journal_path, provider_session_id, adapter_receipt_json, created_at, updated_at) VALUES (?, ?, ?, ?, 'launching', ?, ?, NULL, NULL, ?, ?)", [operationId, work.work_id, JSON.stringify({ ...resolved, runtime_adapter: { executable, owner: runtimeOwner } }), resolved.profile_hash, root, journal, now, now]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deksden-com/dd-flow-cli",
3
- "version": "0.9.0-beta.46",
3
+ "version": "0.9.0-beta.47",
4
4
  "description": "Mechanical runtime CLI for dd-flow workflows.",
5
5
  "type": "module",
6
6
  "bin": {