@primitive.ai/prim 0.1.0-alpha.117 → 0.1.0-alpha.118
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 +21 -21
- package/SKILL.md +3 -3
- package/dist/{chunk-XG7S3LIL.js → chunk-3NJ4FUPK.js} +889 -919
- package/dist/{chunk-J5HBSRAV.js → chunk-4HEWA4IO.js} +1 -1
- package/dist/{chunk-LEUZDTNT.js → chunk-B3FVP7VQ.js} +1 -1
- package/dist/{chunk-4OEJ2ONG.js → chunk-C2AEY4AI.js} +2 -13
- package/dist/{chunk-S55JKCHQ.js → chunk-C2AJBMP2.js} +2 -2
- package/dist/{chunk-D3ZDZZYS.js → chunk-CHRICRVE.js} +17 -10
- package/dist/{chunk-HMD5K6W7.js → chunk-ECP7EGOD.js} +2 -2
- package/dist/{chunk-FTW4ZCBA.js → chunk-FPDOBG3H.js} +1 -1
- package/dist/{chunk-3TIKBQHV.js → chunk-JGOFEG6T.js} +6 -4
- package/dist/chunk-JSBRDJBE.js +30 -0
- package/dist/{chunk-KGBMU76T.js → chunk-JXQVXU2K.js} +1 -1
- package/dist/chunk-KZB4ABIB.js +13 -0
- package/dist/{chunk-I3J344DF.js → chunk-L3NUFCOD.js} +5 -5
- package/dist/{chunk-6IRAGUYK.js → chunk-LEEWUN74.js} +2 -2
- package/dist/{chunk-JKJ22ONL.js → chunk-OHLVHT6R.js} +6 -6
- package/dist/{chunk-RLBASQJD.js → chunk-OIXHRN32.js} +4 -4
- package/dist/{chunk-LLKJAET2.js → chunk-PYIIYC3A.js} +8 -16
- package/dist/{chunk-NEQI2VLM.js → chunk-Q4CWXKNV.js} +5 -5
- package/dist/{chunk-4SN5BCIG.js → chunk-QX7QFMLF.js} +2 -2
- package/dist/{chunk-CXMLAWC2.js → chunk-SCOEPFOV.js} +2 -2
- package/dist/{chunk-6JHKKLA2.js → chunk-UMSJ4DU2.js} +46 -46
- package/dist/{chunk-JKO6PZWQ.js → chunk-VEI7KUOU.js} +26 -48
- package/dist/hook-runtime/daemon/server.js +1 -0
- package/dist/hook-runtime/hooks/post-commit.js +1 -0
- package/dist/hook-runtime/hooks/post-rewrite.js +1 -0
- package/dist/hook-runtime/hooks/post-tool-use.js +29 -29
- package/dist/hook-runtime/hooks/pre-commit.js +1 -0
- package/dist/hook-runtime/hooks/pre-tool-use-worker.js +34746 -0
- package/dist/hook-runtime/hooks/pre-tool-use.js +82 -35547
- package/dist/hook-runtime/hooks/prim-hook.js +22 -22
- package/dist/hook-runtime/hooks/session-end.js +14 -14
- package/dist/hook-runtime/hooks/session-start.js +100 -100
- package/dist/hook-runtime/index.js +244 -256
- package/dist/hook-runtime/statusline-main.js +1 -0
- package/dist/hooks/post-commit.js +8 -7
- package/dist/hooks/post-rewrite.js +7 -6
- package/dist/hooks/post-tool-use.js +25 -22
- package/dist/hooks/pre-commit.js +5 -4
- package/dist/hooks/pre-tool-use-worker.js +222 -0
- package/dist/hooks/pre-tool-use.js +73 -255
- package/dist/hooks/prim-hook.js +25 -22
- package/dist/hooks/session-end.js +10 -7
- package/dist/hooks/session-start.js +22 -19
- package/dist/index.js +54 -53
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -19,34 +19,43 @@ import {
|
|
|
19
19
|
resolveRepositoryBinding,
|
|
20
20
|
uninstallGitHookAtPath,
|
|
21
21
|
uninstallProjectGitHook
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OHLVHT6R.js";
|
|
23
23
|
import {
|
|
24
24
|
requireDurableIngestAcknowledgement
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-B3FVP7VQ.js";
|
|
26
26
|
import {
|
|
27
27
|
checkAffectedDecisions,
|
|
28
28
|
daemonOrDirectGet,
|
|
29
29
|
formatDecisionsWarning
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-Q4CWXKNV.js";
|
|
31
31
|
import {
|
|
32
32
|
hasCompleteCoverage,
|
|
33
33
|
requestPreflight,
|
|
34
34
|
waitForPreflight
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-CHRICRVE.js";
|
|
36
36
|
import {
|
|
37
37
|
fetchFeedbackCapability
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-FPDOBG3H.js";
|
|
39
39
|
import {
|
|
40
40
|
POST_COMMIT_GRACE_MS,
|
|
41
41
|
clearHooksWired,
|
|
42
42
|
inspectPostCommitFiring,
|
|
43
43
|
lastConversationCaptured,
|
|
44
44
|
recordHooksWired
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-JXQVXU2K.js";
|
|
46
46
|
import {
|
|
47
47
|
isUnattended,
|
|
48
48
|
unattendedEnv
|
|
49
49
|
} from "./chunk-OYHYCK4K.js";
|
|
50
|
+
import {
|
|
51
|
+
MS_PER_SECOND,
|
|
52
|
+
deliveryBacklogState,
|
|
53
|
+
deliveryBacklogSummary,
|
|
54
|
+
formatPendingBacklog,
|
|
55
|
+
formatStatusline,
|
|
56
|
+
formatTeammates,
|
|
57
|
+
repositoryBindingDiagnosticLabel
|
|
58
|
+
} from "./chunk-QX7QFMLF.js";
|
|
50
59
|
import {
|
|
51
60
|
JOURNAL_DIR,
|
|
52
61
|
SESSIONS_DIR,
|
|
@@ -61,7 +70,11 @@ import {
|
|
|
61
70
|
rotationIdentity,
|
|
62
71
|
sweepOrphanedDrainProgress,
|
|
63
72
|
writeDrainCheckpoint
|
|
64
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-ECP7EGOD.js";
|
|
74
|
+
import {
|
|
75
|
+
daemonIsLive,
|
|
76
|
+
daemonRequest
|
|
77
|
+
} from "./chunk-4HEWA4IO.js";
|
|
65
78
|
import {
|
|
66
79
|
RUN_ID,
|
|
67
80
|
demoCommand,
|
|
@@ -80,17 +93,34 @@ import {
|
|
|
80
93
|
readDemoJson,
|
|
81
94
|
readRun,
|
|
82
95
|
saveRun
|
|
83
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-L3NUFCOD.js";
|
|
84
97
|
import {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
98
|
+
MANAGED_GIT_HOOK_NAMES,
|
|
99
|
+
assertOwnedHookRuntime,
|
|
100
|
+
atomicWrite,
|
|
101
|
+
ensureRegistration,
|
|
102
|
+
entryHasCommand,
|
|
103
|
+
hookRuntimePaths,
|
|
104
|
+
inspectFailureProtection,
|
|
105
|
+
inspectGitHookEntrypoint,
|
|
106
|
+
inspectHookRuntime,
|
|
107
|
+
inspectHookRuntimeResolutions,
|
|
108
|
+
inspectHookRuntimeResolutions2,
|
|
109
|
+
makeRegistration,
|
|
110
|
+
managedHookBlock,
|
|
111
|
+
performStatus,
|
|
112
|
+
performStatus2,
|
|
113
|
+
projectRoot,
|
|
114
|
+
readSettings,
|
|
115
|
+
registerClaudeCommands,
|
|
116
|
+
registerCursorCommands,
|
|
117
|
+
removeHookRuntime,
|
|
118
|
+
reportFailureProtection,
|
|
119
|
+
stableNodePath,
|
|
120
|
+
stageHookRuntime,
|
|
121
|
+
stripCommand
|
|
122
|
+
} from "./chunk-VEI7KUOU.js";
|
|
123
|
+
import "./chunk-LEEWUN74.js";
|
|
94
124
|
import {
|
|
95
125
|
bold,
|
|
96
126
|
boundedHealthError,
|
|
@@ -115,7 +145,7 @@ import {
|
|
|
115
145
|
isMoveIngestRequest,
|
|
116
146
|
isReconcileResolutionResponse,
|
|
117
147
|
stripAnsi
|
|
118
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-JGOFEG6T.js";
|
|
119
149
|
import {
|
|
120
150
|
CliManagementResponseError,
|
|
121
151
|
HttpError,
|
|
@@ -133,37 +163,7 @@ import {
|
|
|
133
163
|
setStoredToken,
|
|
134
164
|
stripControlChars,
|
|
135
165
|
terminalSafeLine
|
|
136
|
-
} from "./chunk-
|
|
137
|
-
import {
|
|
138
|
-
MANAGED_GIT_HOOK_NAMES,
|
|
139
|
-
assertOwnedHookRuntime,
|
|
140
|
-
atomicWrite,
|
|
141
|
-
ensureRegistration,
|
|
142
|
-
entryHasCommand,
|
|
143
|
-
hookRuntimePaths,
|
|
144
|
-
inspectFailureProtection,
|
|
145
|
-
inspectGitHookEntrypoint,
|
|
146
|
-
inspectHookRuntime,
|
|
147
|
-
inspectHookRuntimeResolutions,
|
|
148
|
-
inspectHookRuntimeResolutions2,
|
|
149
|
-
makeRegistration,
|
|
150
|
-
managedHookBlock,
|
|
151
|
-
performStatus,
|
|
152
|
-
performStatus2,
|
|
153
|
-
projectRoot,
|
|
154
|
-
readSettings,
|
|
155
|
-
registerClaudeCommands,
|
|
156
|
-
registerCursorCommands,
|
|
157
|
-
removeHookRuntime,
|
|
158
|
-
reportFailureProtection,
|
|
159
|
-
stableNodePath,
|
|
160
|
-
stageHookRuntime,
|
|
161
|
-
stripCommand
|
|
162
|
-
} from "./chunk-JKO6PZWQ.js";
|
|
163
|
-
import {
|
|
164
|
-
daemonIsLive,
|
|
165
|
-
daemonRequest
|
|
166
|
-
} from "./chunk-J5HBSRAV.js";
|
|
166
|
+
} from "./chunk-UMSJ4DU2.js";
|
|
167
167
|
import {
|
|
168
168
|
REFRESH_TOKEN_PATH,
|
|
169
169
|
TOKEN_FILE_PATH,
|
|
@@ -197,7 +197,8 @@ import {
|
|
|
197
197
|
syncDirectory,
|
|
198
198
|
withFileLock,
|
|
199
199
|
withFileLockSync
|
|
200
|
-
} from "./chunk-
|
|
200
|
+
} from "./chunk-3NJ4FUPK.js";
|
|
201
|
+
import "./chunk-JSBRDJBE.js";
|
|
201
202
|
|
|
202
203
|
// src/index.ts
|
|
203
204
|
import { readFileSync as readFileSync12 } from "fs";
|
|
@@ -7597,7 +7598,7 @@ var CAPTURE_EVENTS = [
|
|
|
7597
7598
|
"on_session_end",
|
|
7598
7599
|
"subagent_stop"
|
|
7599
7600
|
];
|
|
7600
|
-
var GATE_TIMEOUT_SECONDS =
|
|
7601
|
+
var GATE_TIMEOUT_SECONDS = 2;
|
|
7601
7602
|
var REGISTRATIONS = [
|
|
7602
7603
|
...CAPTURE_EVENTS.map((event) => ({ event, bin: CAPTURE_BIN2 })),
|
|
7603
7604
|
{ event: "pre_tool_call", matcher: EDIT_MATCHER, bin: GATE_BIN2, timeout: GATE_TIMEOUT_SECONDS },
|
|
@@ -7619,7 +7620,7 @@ function entryFor(reg) {
|
|
|
7619
7620
|
if (reg.timeout !== void 0) {
|
|
7620
7621
|
entry.timeout = reg.timeout;
|
|
7621
7622
|
}
|
|
7622
|
-
if (reg.bin === GATE_BIN2) entry.fail_closed =
|
|
7623
|
+
if (reg.bin === GATE_BIN2) entry.fail_closed = false;
|
|
7623
7624
|
return entry;
|
|
7624
7625
|
}
|
|
7625
7626
|
function stripBin(list, bin) {
|
|
@@ -8892,7 +8893,7 @@ function checkPreflightHosts() {
|
|
|
8892
8893
|
return hosts.map((host) => {
|
|
8893
8894
|
const protection = inspectFailureProtection(host);
|
|
8894
8895
|
return {
|
|
8895
|
-
name: `${host} gate failure
|
|
8896
|
+
name: `${host} gate timeout and failure behavior`,
|
|
8896
8897
|
status: protection.status === "supported" ? "ok" : protection.status === "limited" ? "warn" : "fail",
|
|
8897
8898
|
detail: protection.detail
|
|
8898
8899
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primitive.ai/prim",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.118",
|
|
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",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"SKILL.md"
|
|
50
50
|
],
|
|
51
51
|
"scripts": {
|
|
52
|
-
"build": "tsup src/index.ts src/hooks/pre-commit.ts src/hooks/post-commit.ts src/hooks/post-rewrite.ts src/hooks/prim-hook.ts src/hooks/pre-tool-use.ts src/hooks/post-tool-use.ts src/hooks/session-start.ts src/hooks/session-end.ts --format esm --clean && tsup src/statusline-main.ts src/daemon/server.ts --format esm --splitting false && tsup --config tsup.hook-runtime.config.ts",
|
|
52
|
+
"build": "tsup src/index.ts src/hooks/pre-commit.ts src/hooks/post-commit.ts src/hooks/post-rewrite.ts src/hooks/prim-hook.ts src/hooks/pre-tool-use.ts src/hooks/pre-tool-use-worker.ts src/hooks/post-tool-use.ts src/hooks/session-start.ts src/hooks/session-end.ts --format esm --clean && tsup src/statusline-main.ts src/daemon/server.ts --format esm --splitting false && tsup --config tsup.hook-runtime.config.ts",
|
|
53
53
|
"contracts:generate": "node scripts/generate-cli-contract.mjs --write",
|
|
54
54
|
"contracts:check": "node scripts/generate-cli-contract.mjs --check",
|
|
55
55
|
"contracts:provenance": "node scripts/update-cli-contract.mjs --check",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"check:approval-copy-golden": "node scripts/check-approval-copy-golden.mjs",
|
|
61
61
|
"contracts:update": "node scripts/update-cli-contract.mjs",
|
|
62
62
|
"postbuild": "chmod +x ./dist/index.js ./dist/statusline-main.js ./dist/hooks/pre-commit.js ./dist/hooks/post-commit.js ./dist/hooks/post-rewrite.js ./dist/hooks/prim-hook.js ./dist/hooks/pre-tool-use.js ./dist/hooks/post-tool-use.js ./dist/hooks/session-start.js ./dist/hooks/session-end.js ./dist/daemon/server.js && node scripts/check-hook-runtime.mjs",
|
|
63
|
-
"dev": "tsup src/index.ts src/statusline-main.ts src/hooks/pre-commit.ts src/hooks/post-commit.ts src/hooks/post-rewrite.ts src/hooks/prim-hook.ts src/hooks/pre-tool-use.ts src/hooks/post-tool-use.ts src/hooks/session-start.ts src/hooks/session-end.ts src/daemon/server.ts --format esm --watch --clean --splitting false",
|
|
63
|
+
"dev": "tsup src/index.ts src/statusline-main.ts src/hooks/pre-commit.ts src/hooks/post-commit.ts src/hooks/post-rewrite.ts src/hooks/prim-hook.ts src/hooks/pre-tool-use.ts src/hooks/pre-tool-use-worker.ts src/hooks/post-tool-use.ts src/hooks/session-start.ts src/hooks/session-end.ts src/daemon/server.ts --format esm --watch --clean --splitting false",
|
|
64
64
|
"clean": "rm -rf dist coverage",
|
|
65
65
|
"lint": "biome check src/ scripts/",
|
|
66
66
|
"format": "biome check --fix src/ scripts/",
|