@sublang/playbook 0.1.1 → 0.1.2

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/README.md CHANGED
@@ -40,13 +40,13 @@ runtime ported to cligent's `tmux-play` host out of the box.
40
40
 
41
41
  ### Install (users)
42
42
 
43
- Install the package globally alongside its `@sublang/cligent` peer.
44
- The bundled production config wires Anthropic (Captain + Coder) and
45
- OpenAI Codex (Reviewer); both SDKs come along as direct dependencies
46
- of `@sublang/playbook`, so no extra install is needed:
43
+ Install the package globally. The bundled production config wires
44
+ Anthropic (Captain + Coder) and OpenAI Codex (Reviewer); `@sublang/
45
+ cligent`, the two adapter SDKs, and `xstate` are all direct
46
+ dependencies, so a single install pulls in everything:
47
47
 
48
48
  ```sh
49
- npm install -g @sublang/playbook @sublang/cligent
49
+ npm install -g @sublang/playbook
50
50
  ```
51
51
 
52
52
  Each adapter reads its own auth: the Claude SDK uses your local
@@ -60,8 +60,10 @@ playbook-code
60
60
  ```
61
61
 
62
62
  The `playbook-code` bin resolves the bundled
63
- `tmux-play.production.config.yaml` and execs `tmux-play` against it; any
64
- extra flags pass through (`playbook-code --help` lists `tmux-play`'s).
63
+ `tmux-play.production.config.yaml` and execs the bundled `tmux-play`
64
+ CLI (from playbook's own `node_modules/@sublang/cligent`) against it;
65
+ any extra flags pass through (`playbook-code --help` lists
66
+ `tmux-play`'s).
65
67
 
66
68
  ### Install (contributors / from source)
67
69
 
@@ -170,7 +172,8 @@ package.
170
172
 
171
173
  ## Requirements
172
174
 
173
- - Node.js ≥ 20
175
+ - Node.js ≥ 20.6.0 (the `playbook-code` shim uses
176
+ `import.meta.resolve`, unflagged since this release)
174
177
  - pnpm 9 (for the reference package)
175
178
  - A configured `tmux-play` host (for live Boss turns)
176
179
 
@@ -3,33 +3,36 @@
3
3
  // SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
4
4
 
5
5
  // Thin shim that resolves the bundled tmux-play.production.config.yaml
6
- // relative to this script's own location and execs `tmux-play` against
7
- // it. Extra argv is forwarded verbatim, so callers can pass flags like
8
- // --window or override the config with a later --config of their own
9
- // (tmux-play uses the last --config wins).
10
- //
11
- // `tmux-play` is provided by the @sublang/cligent peer; this shim
12
- // expects it to be discoverable on PATH (npm install -g or a project's
13
- // node_modules/.bin).
6
+ // relative to this script's own location and execs cligent's tmux-play
7
+ // CLI from inside @sublang/playbook's own node_modules tree. We resolve
8
+ // the CLI through cligent's `./tmux-play` subpath export instead of
9
+ // relying on `tmux-play` being on PATH npm global installs only link
10
+ // bins from top-level packages, so a transitive cligent's bin won't
11
+ // reach the user's PATH but its files are still resolvable here.
14
12
 
15
13
  import { spawn } from 'node:child_process';
16
- import { dirname, resolve } from 'node:path';
14
+ import { dirname, join, resolve } from 'node:path';
17
15
  import { fileURLToPath } from 'node:url';
18
16
 
19
17
  const here = dirname(fileURLToPath(import.meta.url));
20
18
  const configPath = resolve(here, '..', 'tmux-play.production.config.yaml');
21
19
 
20
+ // cligent's `./tmux-play` subpath export only declares "import"
21
+ // (no "require"/"default"), so createRequire(...).resolve trips
22
+ // ERR_PACKAGE_PATH_NOT_EXPORTED. import.meta.resolve uses ESM rules
23
+ // and follows the "import" condition — works from Node 20.6+.
24
+ const tmuxPlayIndexUrl = import.meta.resolve('@sublang/cligent/tmux-play');
25
+ const tmuxPlayBin = join(dirname(fileURLToPath(tmuxPlayIndexUrl)), 'cli.js');
26
+
22
27
  const child = spawn(
23
- 'tmux-play',
24
- ['--config', configPath, ...process.argv.slice(2)],
28
+ process.execPath,
29
+ [tmuxPlayBin, '--config', configPath, ...process.argv.slice(2)],
25
30
  { stdio: 'inherit' },
26
31
  );
27
32
 
28
33
  child.on('error', (err) => {
29
- const reason = err && err.code === 'ENOENT' ? 'not found on PATH' : err.message;
30
34
  process.stderr.write(
31
- `playbook-code: failed to launch tmux-play: ${reason}\n` +
32
- "Install @sublang/cligent (which provides 'tmux-play') alongside @sublang/playbook.\n",
35
+ `playbook-code: failed to launch tmux-play (${tmuxPlayBin}): ${err.message}\n`,
33
36
  );
34
37
  process.exit(127);
35
38
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sublang/playbook",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Reference CODE playbook — XState v5 FSM, host-agnostic runtime, and tmux-play adapter for a coder/reviewer/committer loop driven by GEARS spec items.",
6
6
  "license": "Apache-2.0",
@@ -22,7 +22,7 @@
22
22
  "tmux-play"
23
23
  ],
24
24
  "engines": {
25
- "node": ">=20"
25
+ "node": ">=20.6.0"
26
26
  },
27
27
  "files": [
28
28
  "code.fsm.ts",
@@ -63,19 +63,15 @@
63
63
  "access": "public",
64
64
  "provenance": true
65
65
  },
66
- "peerDependencies": {
67
- "@sublang/cligent": "^0.3.0",
68
- "xstate": "^5.0.0"
69
- },
70
66
  "dependencies": {
71
67
  "@anthropic-ai/claude-agent-sdk": "^0.3.143",
72
- "@openai/codex-sdk": "^0.130.0"
68
+ "@openai/codex-sdk": "^0.130.0",
69
+ "@sublang/cligent": "^0.3.0",
70
+ "xstate": "^5.19.4"
73
71
  },
74
72
  "devDependencies": {
75
- "@sublang/cligent": "^0.3.0",
76
73
  "@types/node": "^22.0.0",
77
74
  "typescript": "^5.8.0",
78
- "vitest": "^3.0.0",
79
- "xstate": "^5.19.4"
75
+ "vitest": "^3.0.0"
80
76
  }
81
77
  }