ccdeck 1.33.142 → 1.33.143

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/bin/ccdeck.js +23 -1
  2. package/package.json +2 -2
package/bin/ccdeck.js CHANGED
@@ -1,5 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { spawn } from 'child_process';
3
+ import { existsSync } from 'fs';
4
+ import { createRequire } from 'module';
3
5
  import { fileURLToPath, pathToFileURL } from 'url';
4
6
  import { dirname, resolve } from 'path';
5
7
 
@@ -11,7 +13,27 @@ const __dir = dirname(fileURLToPath(import.meta.url));
11
13
  // resolve to different copies, and so an `exports` map added to agents-deck
12
14
  // later cannot turn this into a startup crash. The dependency is pinned to the
13
15
  // exact version at publish time, so the file is always there.
14
- const pkg = resolve(__dir, '../../agents-deck');
16
+ //
17
+ // TWO LAYOUTS, because npm has two and only one of them was ever handled. Under
18
+ // `npx ccdeck` the dependency is a sibling — `_npx/<hash>/node_modules/{ccdeck,
19
+ // agents-deck}` — and `../../agents-deck` finds it. Under `npm i -g ccdeck` it
20
+ // is NOT: npm stopped hoisting a global package's dependencies in v7, so it
21
+ // lands at `lib/node_modules/ccdeck/node_modules/agents-deck` while
22
+ // `../../agents-deck` points at `lib/node_modules/agents-deck`, which does not
23
+ // exist. That is not a hypothetical — installing the published 1.33.142 this
24
+ // way and running it gives ERR_MODULE_NOT_FOUND before the deck prints
25
+ // anything, so the one command every surface tells people to run has been dead
26
+ // on arrival for every global install. npx was the only shape anybody tested.
27
+ //
28
+ // So: try the nested layout first (it is the one that was broken), then the
29
+ // sibling, then let node resolve it — which covers a workspace, a pnpm store
30
+ // and any future layout none of us predicted. Path-first, resolution last,
31
+ // keeps the guarantee in the paragraph above wherever a path does answer.
32
+ const nested = resolve(__dir, '../node_modules/agents-deck');
33
+ const sibling = resolve(__dir, '../../agents-deck');
34
+ const pkg = existsSync(resolve(nested, 'package.json')) ? nested
35
+ : existsSync(resolve(sibling, 'package.json')) ? sibling
36
+ : dirname(createRequire(import.meta.url).resolve('agents-deck/package.json'));
15
37
  const { dieOfSignal } = await import(pathToFileURL(resolve(pkg, 'src/server/supervisor.mjs')).href);
16
38
 
17
39
  const bin = resolve(pkg, 'bin/agent-dag.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccdeck",
3
- "version": "1.33.142",
3
+ "version": "1.33.143",
4
4
  "description": "Alias for agents-deck — live deck of Claude Code and Codex agents. Run with: npx ccdeck",
5
5
  "type": "module",
6
6
  "bin": {
@@ -12,7 +12,7 @@
12
12
  "LICENSE"
13
13
  ],
14
14
  "dependencies": {
15
- "agents-deck": "1.33.142"
15
+ "agents-deck": "1.33.143"
16
16
  },
17
17
  "engines": {
18
18
  "node": ">=18"