@primitive.ai/prim 0.1.0-alpha.103 → 0.1.0-alpha.104

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
@@ -15,7 +15,10 @@ presence — from the command line and via session + git hooks.
15
15
 
16
16
  ## Installation
17
17
 
18
- Requires Node.js 20+.
18
+ Requires Node.js 22.23.4+, 24.22.1+, or 26.12.1+ within those major versions.
19
+ Node.js 20 is no longer supported. After updating Node.js, restart the daemon
20
+ with `prim daemon restart` and rerun your agent's `prim <agent> install` command
21
+ and `prim hooks install` to repin their runtimes to the updated executable.
19
22
 
20
23
  ```bash
21
24
  npm install -g @primitive.ai/prim
@@ -13,7 +13,7 @@ import {
13
13
  hookBlockContractVersion,
14
14
  inspectGitHookEntrypoint,
15
15
  managedHookBlock
16
- } from "./chunk-K4JWJ6OM.js";
16
+ } from "./chunk-PO5QAYD7.js";
17
17
  import {
18
18
  atomicWriteFile,
19
19
  binFile,
@@ -2,7 +2,7 @@ import {
2
2
  cursorHooksPath,
3
3
  hasExactCursorHandler,
4
4
  readCursorHooks
5
- } from "./chunk-K4JWJ6OM.js";
5
+ } from "./chunk-PO5QAYD7.js";
6
6
  import {
7
7
  resolveRepositoryContext
8
8
  } from "./chunk-XG7S3LIL.js";
@@ -440,15 +440,18 @@ function hasSafeRuntimeLayout(paths, selected) {
440
440
  (relativePath) => privateFile(join(selected.dir, relativePath), DATA_FILE_MODE)
441
441
  );
442
442
  }
443
- function recordedNodeMatchesCurrentProcess(nodePath) {
443
+ function sameNodeExecutable(recorded, desired) {
444
444
  try {
445
- if (!statSync(nodePath).isFile()) return false;
446
- accessSync(nodePath, constants.X_OK);
447
- return realpathSync(nodePath) === realpathSync(process.execPath);
445
+ if (!statSync(recorded).isFile()) return false;
446
+ accessSync(recorded, constants.X_OK);
447
+ return realpathSync(recorded) === realpathSync(desired);
448
448
  } catch {
449
449
  return false;
450
450
  }
451
451
  }
452
+ function recordedNodeMatchesCurrentProcess(nodePath) {
453
+ return sameNodeExecutable(nodePath, process.execPath);
454
+ }
452
455
  function inspectHookRuntime(options = {}) {
453
456
  let paths;
454
457
  try {
@@ -575,7 +578,7 @@ function stageHookRuntime(options = {}) {
575
578
  if (precedence === void 0) {
576
579
  throw new Error("cannot stage hook runtime: selected release version is malformed");
577
580
  }
578
- const selectRequested = !selected || precedence < 0;
581
+ const selectRequested = !selected || precedence < 0 || precedence === 0 && !sameNodeExecutable(selected.manifest.nodePath, nodePath);
579
582
  const requestedExists = existsSync(releaseDir);
580
583
  const protectedBefore = new Set(selected ? [selected.name] : []);
581
584
  if (selectRequested && requestedExists) protectedBefore.add(releaseName);
@@ -33849,15 +33849,18 @@ function hasSafeRuntimeLayout(paths, selected) {
33849
33849
  (relativePath) => privateFile(join11(selected.dir, relativePath), DATA_FILE_MODE)
33850
33850
  );
33851
33851
  }
33852
- function recordedNodeMatchesCurrentProcess(nodePath) {
33852
+ function sameNodeExecutable(recorded, desired) {
33853
33853
  try {
33854
- if (!statSync2(nodePath).isFile()) return false;
33855
- accessSync(nodePath, constants2.X_OK);
33856
- return realpathSync2(nodePath) === realpathSync2(process.execPath);
33854
+ if (!statSync2(recorded).isFile()) return false;
33855
+ accessSync(recorded, constants2.X_OK);
33856
+ return realpathSync2(recorded) === realpathSync2(desired);
33857
33857
  } catch {
33858
33858
  return false;
33859
33859
  }
33860
33860
  }
33861
+ function recordedNodeMatchesCurrentProcess(nodePath) {
33862
+ return sameNodeExecutable(nodePath, process.execPath);
33863
+ }
33861
33864
  function inspectHookRuntime(options = {}) {
33862
33865
  let paths;
33863
33866
  try {
@@ -33984,7 +33987,7 @@ function stageHookRuntime(options = {}) {
33984
33987
  if (precedence === void 0) {
33985
33988
  throw new Error("cannot stage hook runtime: selected release version is malformed");
33986
33989
  }
33987
- const selectRequested = !selected || precedence < 0;
33990
+ const selectRequested = !selected || precedence < 0 || precedence === 0 && !sameNodeExecutable(selected.manifest.nodePath, nodePath);
33988
33991
  const requestedExists = existsSync5(releaseDir);
33989
33992
  const protectedBefore = new Set(selected ? [selected.name] : []);
33990
33993
  if (selectRequested && requestedExists) protectedBefore.add(releaseName);
@@ -44,8 +44,8 @@ import {
44
44
  parseAgent,
45
45
  readHookStdin,
46
46
  shouldSuppressImportedCursorHandler
47
- } from "../chunk-6C3CCVDI.js";
48
- import "../chunk-K4JWJ6OM.js";
47
+ } from "../chunk-NH3VC7YO.js";
48
+ import "../chunk-PO5QAYD7.js";
49
49
  import "../chunk-5LRKJTLA.js";
50
50
  import {
51
51
  currentBranch,
@@ -38,8 +38,8 @@ import {
38
38
  parseAgent,
39
39
  readHookStdin,
40
40
  shouldSuppressImportedCursorHandler
41
- } from "../chunk-6C3CCVDI.js";
42
- import "../chunk-K4JWJ6OM.js";
41
+ } from "../chunk-NH3VC7YO.js";
42
+ import "../chunk-PO5QAYD7.js";
43
43
  import "../chunk-5LRKJTLA.js";
44
44
  import {
45
45
  canonicalGitRoot,
@@ -52,8 +52,8 @@ import {
52
52
  parseAgent,
53
53
  readHookStdin,
54
54
  shouldSuppressImportedCursorHandler
55
- } from "../chunk-6C3CCVDI.js";
56
- import "../chunk-K4JWJ6OM.js";
55
+ } from "../chunk-NH3VC7YO.js";
56
+ import "../chunk-PO5QAYD7.js";
57
57
  import "../chunk-5LRKJTLA.js";
58
58
  import {
59
59
  currentBranch,
@@ -4,8 +4,8 @@ import {
4
4
  parseAgent,
5
5
  readHookStdin,
6
6
  shouldSuppressImportedCursorHandler
7
- } from "../chunk-6C3CCVDI.js";
8
- import "../chunk-K4JWJ6OM.js";
7
+ } from "../chunk-NH3VC7YO.js";
8
+ import "../chunk-PO5QAYD7.js";
9
9
  import {
10
10
  daemonRequest
11
11
  } from "../chunk-5LRKJTLA.js";
@@ -7,7 +7,7 @@ import {
7
7
  kickDaemonEnsure,
8
8
  refreshClaudePlugins,
9
9
  warmBinCache
10
- } from "../chunk-O2WV5SQZ.js";
10
+ } from "../chunk-2EKPBZNA.js";
11
11
  import {
12
12
  buildHookOutput,
13
13
  handoffHookOutput
@@ -42,10 +42,10 @@ import {
42
42
  parseAgent,
43
43
  readHookStdin,
44
44
  shouldSuppressImportedCursorHandler
45
- } from "../chunk-6C3CCVDI.js";
45
+ } from "../chunk-NH3VC7YO.js";
46
46
  import {
47
47
  MANAGED_GIT_HOOK_NAMES
48
- } from "../chunk-K4JWJ6OM.js";
48
+ } from "../chunk-PO5QAYD7.js";
49
49
  import {
50
50
  daemonRequest
51
51
  } from "../chunk-5LRKJTLA.js";
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  resolveRepositoryBinding,
20
20
  uninstallGitHookAtPath,
21
21
  uninstallProjectGitHook
22
- } from "./chunk-O2WV5SQZ.js";
22
+ } from "./chunk-2EKPBZNA.js";
23
23
  import {
24
24
  requireDurableIngestAcknowledgement
25
25
  } from "./chunk-IDMLJ4TM.js";
@@ -138,7 +138,7 @@ import {
138
138
  stableNodePath,
139
139
  stageHookRuntime,
140
140
  stripCommand
141
- } from "./chunk-K4JWJ6OM.js";
141
+ } from "./chunk-PO5QAYD7.js";
142
142
  import {
143
143
  daemonIsLive,
144
144
  daemonRequest
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitive.ai/prim",
3
- "version": "0.1.0-alpha.103",
3
+ "version": "0.1.0-alpha.104",
4
4
  "description": "CLI for Primitive's decision graph — passive decision capture, conflict gate, and team presence",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,7 +24,7 @@
24
24
  "pre-commit"
25
25
  ],
26
26
  "engines": {
27
- "node": ">=20.0.0"
27
+ "node": "^22.23.4 || ^24.22.1 || ^26.12.1"
28
28
  },
29
29
  "packageManager": "pnpm@9.15.9",
30
30
  "bin": {
@@ -76,11 +76,11 @@
76
76
  "@types/diff": "^5.2.0",
77
77
  "@types/node": "^25.5.0",
78
78
  "@types/update-notifier": "^6.0.8",
79
- "@vitest/coverage-v8": "^3.1.0",
79
+ "@vitest/coverage-v8": "^4.1.12",
80
80
  "ajv": "8.20.0",
81
81
  "json-schema-to-typescript": "15.0.4",
82
82
  "tsup": "^8.0.0",
83
83
  "typescript": "^5.5.0",
84
- "vitest": "^3.1.0"
84
+ "vitest": "^4.1.12"
85
85
  }
86
86
  }