@primitive.ai/prim 0.1.0-alpha.118 → 0.1.0-alpha.119
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/dist/{chunk-FPDOBG3H.js → chunk-2AKDX4RU.js} +1 -1
- package/dist/{chunk-CHRICRVE.js → chunk-2JA524SC.js} +21 -14
- package/dist/{chunk-L3NUFCOD.js → chunk-4L7TAM5S.js} +120 -285
- package/dist/{chunk-JGOFEG6T.js → chunk-5BQ2NEMP.js} +2732 -2533
- package/dist/{chunk-B3FVP7VQ.js → chunk-A6M2M5A2.js} +1 -1
- package/dist/{chunk-OHLVHT6R.js → chunk-CCGFRNAA.js} +3 -3
- package/dist/{chunk-SCOEPFOV.js → chunk-CSE44DPA.js} +2 -2
- package/dist/{chunk-Q4CWXKNV.js → chunk-D235RJNO.js} +3 -3
- package/dist/{chunk-QX7QFMLF.js → chunk-GYQOZGGF.js} +2 -2
- package/dist/{chunk-PYIIYC3A.js → chunk-HXICZG5J.js} +4 -4
- package/dist/{chunk-JXQVXU2K.js → chunk-LBCPRHNG.js} +1 -1
- package/dist/{chunk-ECP7EGOD.js → chunk-LTTF4MBE.js} +2 -2
- package/dist/{chunk-VEI7KUOU.js → chunk-MWNRXAEB.js} +1 -1
- package/dist/{chunk-LEEWUN74.js → chunk-NQFRQ56V.js} +2 -2
- package/dist/{chunk-3NJ4FUPK.js → chunk-P2O7NLVN.js} +5 -6
- package/dist/{chunk-4HEWA4IO.js → chunk-SLDZJD6Q.js} +1 -1
- package/dist/{chunk-C2AEY4AI.js → chunk-TC4FTRYO.js} +2 -2
- package/dist/{chunk-UMSJ4DU2.js → chunk-U67RBNIZ.js} +1 -1
- package/dist/{chunk-C2AJBMP2.js → chunk-VOC4KOOP.js} +2 -2
- package/dist/chunk-W27EFR7W.js +271 -0
- package/dist/{chunk-OIXHRN32.js → chunk-XWAKFL3T.js} +9 -7
- package/dist/daemon/server.js +2733 -2531
- package/dist/hook-runtime/daemon/server.js +2733 -2531
- package/dist/hook-runtime/hooks/post-commit.js +2740 -2538
- package/dist/hook-runtime/hooks/post-rewrite.js +2740 -2538
- package/dist/hook-runtime/hooks/post-tool-use.js +2854 -2550
- package/dist/hook-runtime/hooks/pre-tool-use-worker.js +2907 -2564
- package/dist/hook-runtime/hooks/pre-tool-use.js +36 -1
- package/dist/hook-runtime/hooks/prim-hook.js +2853 -2549
- package/dist/hook-runtime/hooks/session-end.js +5 -2
- package/dist/hook-runtime/hooks/session-start.js +2740 -2538
- package/dist/hook-runtime/index.js +2793 -2581
- package/dist/hook-runtime/statusline-main.js +5 -2
- package/dist/hooks/post-commit.js +7 -7
- package/dist/hooks/post-rewrite.js +6 -6
- package/dist/hooks/post-tool-use.js +16 -15
- package/dist/hooks/pre-commit.js +4 -4
- package/dist/hooks/pre-tool-use-worker.js +77 -35
- package/dist/hooks/pre-tool-use.js +26 -1
- package/dist/hooks/prim-hook.js +17 -16
- package/dist/hooks/session-end.js +4 -4
- package/dist/hooks/session-start.js +11 -11
- package/dist/index.js +20 -16
- package/dist/statusline-main.js +5 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19,30 +19,30 @@ import {
|
|
|
19
19
|
resolveRepositoryBinding,
|
|
20
20
|
uninstallGitHookAtPath,
|
|
21
21
|
uninstallProjectGitHook
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-CCGFRNAA.js";
|
|
23
23
|
import {
|
|
24
24
|
requireDurableIngestAcknowledgement
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-A6M2M5A2.js";
|
|
26
26
|
import {
|
|
27
27
|
checkAffectedDecisions,
|
|
28
28
|
daemonOrDirectGet,
|
|
29
29
|
formatDecisionsWarning
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-D235RJNO.js";
|
|
31
31
|
import {
|
|
32
32
|
hasCompleteCoverage,
|
|
33
33
|
requestPreflight,
|
|
34
34
|
waitForPreflight
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-2JA524SC.js";
|
|
36
36
|
import {
|
|
37
37
|
fetchFeedbackCapability
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-2AKDX4RU.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-LBCPRHNG.js";
|
|
46
46
|
import {
|
|
47
47
|
isUnattended,
|
|
48
48
|
unattendedEnv
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
formatStatusline,
|
|
56
56
|
formatTeammates,
|
|
57
57
|
repositoryBindingDiagnosticLabel
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-GYQOZGGF.js";
|
|
59
59
|
import {
|
|
60
60
|
JOURNAL_DIR,
|
|
61
61
|
SESSIONS_DIR,
|
|
@@ -70,11 +70,11 @@ import {
|
|
|
70
70
|
rotationIdentity,
|
|
71
71
|
sweepOrphanedDrainProgress,
|
|
72
72
|
writeDrainCheckpoint
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-LTTF4MBE.js";
|
|
74
74
|
import {
|
|
75
75
|
daemonIsLive,
|
|
76
76
|
daemonRequest
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-SLDZJD6Q.js";
|
|
78
78
|
import {
|
|
79
79
|
RUN_ID,
|
|
80
80
|
demoCommand,
|
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
readDemoJson,
|
|
94
94
|
readRun,
|
|
95
95
|
saveRun
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-4L7TAM5S.js";
|
|
97
97
|
import {
|
|
98
98
|
MANAGED_GIT_HOOK_NAMES,
|
|
99
99
|
assertOwnedHookRuntime,
|
|
@@ -119,8 +119,8 @@ import {
|
|
|
119
119
|
stableNodePath,
|
|
120
120
|
stageHookRuntime,
|
|
121
121
|
stripCommand
|
|
122
|
-
} from "./chunk-
|
|
123
|
-
import "./chunk-
|
|
122
|
+
} from "./chunk-MWNRXAEB.js";
|
|
123
|
+
import "./chunk-NQFRQ56V.js";
|
|
124
124
|
import {
|
|
125
125
|
bold,
|
|
126
126
|
boundedHealthError,
|
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
isMoveIngestRequest,
|
|
146
146
|
isReconcileResolutionResponse,
|
|
147
147
|
stripAnsi
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-5BQ2NEMP.js";
|
|
149
149
|
import {
|
|
150
150
|
CliManagementResponseError,
|
|
151
151
|
HttpError,
|
|
@@ -163,7 +163,7 @@ import {
|
|
|
163
163
|
setStoredToken,
|
|
164
164
|
stripControlChars,
|
|
165
165
|
terminalSafeLine
|
|
166
|
-
} from "./chunk-
|
|
166
|
+
} from "./chunk-U67RBNIZ.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-P2O7NLVN.js";
|
|
201
|
+
import "./chunk-W27EFR7W.js";
|
|
201
202
|
import "./chunk-JSBRDJBE.js";
|
|
202
203
|
|
|
203
204
|
// src/index.ts
|
|
@@ -5919,6 +5920,7 @@ var DecisionRescopeResponseError = class extends Error {
|
|
|
5919
5920
|
};
|
|
5920
5921
|
function projectScope(scope) {
|
|
5921
5922
|
return {
|
|
5923
|
+
...scope.scopeResolution === "unresolved" ? { scopeResolution: "unresolved" } : {},
|
|
5922
5924
|
location: {
|
|
5923
5925
|
repository: scope.location.repository,
|
|
5924
5926
|
directories: scope.location.directories,
|
|
@@ -6200,7 +6202,9 @@ function formatShowHuman(result) {
|
|
|
6200
6202
|
lines.push(` area: ${color(area, colorForArea(area))}`);
|
|
6201
6203
|
}
|
|
6202
6204
|
if (result.scope) {
|
|
6203
|
-
lines.push(
|
|
6205
|
+
lines.push(
|
|
6206
|
+
` scope: ${result.scope.scopeResolution === "unresolved" ? "Scope unknown \u2014 not enforced" : describeScope(result.scope.location)}`
|
|
6207
|
+
);
|
|
6204
6208
|
const effectiveWindow = describeEffectiveWindow(result.scope.time);
|
|
6205
6209
|
if (effectiveWindow) {
|
|
6206
6210
|
lines.push(` effective: ${effectiveWindow}`);
|
package/dist/statusline-main.js
CHANGED
|
@@ -583,7 +583,7 @@ var GIT_TIMEOUT_MS2 = 1e3;
|
|
|
583
583
|
var REPO_SYNC_ID_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
|
|
584
584
|
var PROJECT_INSTALL_FILES = [".claude/settings.json", ".codex/hooks.json", ".cursor/hooks.json"];
|
|
585
585
|
var PRIM_HOOK_BINS = ["prim-hook", "prim-pre-tool-use", "prim-post-tool-use"];
|
|
586
|
-
function repoActiveFlag(cwd) {
|
|
586
|
+
function repoActiveFlag(cwd, strict = false) {
|
|
587
587
|
try {
|
|
588
588
|
const value = execFileSync2("git", ["config", "--get", PRIM_ACTIVE_KEY], {
|
|
589
589
|
cwd,
|
|
@@ -593,8 +593,11 @@ function repoActiveFlag(cwd) {
|
|
|
593
593
|
}).trim();
|
|
594
594
|
if (value === "true") return "true";
|
|
595
595
|
if (value === "false") return "false";
|
|
596
|
+
if (strict) throw new Error("Repository activation is invalid");
|
|
596
597
|
return void 0;
|
|
597
|
-
} catch {
|
|
598
|
+
} catch (error) {
|
|
599
|
+
if (strict && !(typeof error === "object" && error !== null && "status" in error && error.status === 1))
|
|
600
|
+
throw error;
|
|
598
601
|
return void 0;
|
|
599
602
|
}
|
|
600
603
|
}
|
package/package.json
CHANGED