@bakers-build/addon-codex 0.10.1-next.7 → 0.10.1-next.9

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.
Files changed (2) hide show
  1. package/dist/src/run.js +13 -16
  2. package/package.json +4 -4
package/dist/src/run.js CHANGED
@@ -1,15 +1,11 @@
1
- import { copyFileSync, cpSync, existsSync, lstatSync, mkdirSync, readdirSync, realpathSync, symlinkSync, writeFileSync, } from 'node:fs';
2
- import { join } from 'node:path';
3
- /** Entries prepared below, and those Codex writes while it runs. */
4
- const NOT_LINKED = new Set([
5
- 'auth.json',
6
- 'sessions',
7
- 'config.toml',
8
- 'rules',
9
- 'log',
10
- 'shell_snapshots',
11
- 'tmp',
12
- ]);
1
+ import { copyFileSync, cpSync, existsSync, lstatSync, mkdirSync, realpathSync, symlinkSync, writeFileSync, } from 'node:fs';
2
+ import { dirname, join } from 'node:path';
3
+ /**
4
+ * Source directories shared read-only; everything else starts fresh and
5
+ * writable in the private home, since Codex writes leftovers such as
6
+ * thread-writer-locks at startup. Marketplace clones live in .tmp/marketplaces.
7
+ */
8
+ const SHARED = ['plugins', 'skills', 'packages', '.tmp/marketplaces'];
13
9
  /** Prepare Codex's files in the home supplied by any execution backend. */
14
10
  export function prepareCodexRun(context, configDir, hostEnv = process.env) {
15
11
  const source = context.env.CODEX_HOME ?? configDir;
@@ -28,15 +24,16 @@ export function prepareCodexRun(context, configDir, hostEnv = process.env) {
28
24
  recursive: true,
29
25
  dereference: true,
30
26
  });
31
- // Directories (plugins, marketplaces, skills) are shared read-only, each on
32
- // its own: the runtimes refuse a write path inside a read path.
27
+ // Shared directories are linked each on its own: the runtimes refuse a
28
+ // write path inside a read path.
33
29
  // shortcut: files such as the state DB and history start empty in the
34
30
  // private home and are discarded with it; link one if it must persist.
35
31
  const readPaths = [];
36
- for (const name of readdirSync(source)) {
32
+ for (const name of SHARED) {
37
33
  const path = join(source, name);
38
- if (NOT_LINKED.has(name) || !lstatSync(path).isDirectory())
34
+ if (!existsSync(path) || !lstatSync(path).isDirectory())
39
35
  continue;
36
+ mkdirSync(dirname(join(home, name)), { recursive: true });
40
37
  symlinkSync(path, join(home, name));
41
38
  readPaths.push(path);
42
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-codex",
3
- "version": "0.10.1-next.7",
3
+ "version": "0.10.1-next.9",
4
4
  "description": "bakers.build agent plugin for the Codex CLI.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "directory": "bakers-cli/addons/codex"
23
23
  },
24
24
  "peerDependencies": {
25
- "@bakers-build/conductor": "^0.10.1-next.7",
26
- "@bakers-build/core": "^0.10.1-next.7"
25
+ "@bakers-build/conductor": "^0.10.1-next.9",
26
+ "@bakers-build/core": "^0.10.1-next.9"
27
27
  },
28
28
  "bakersBuild": {
29
- "commit": "c45a694ff28d41c3755ec40bddc9b685295004e8",
29
+ "commit": "8e53a3481528f0a2c43c4783f2e1adf9385e0625",
30
30
  "channel": "next"
31
31
  }
32
32
  }