@primitive.ai/prim 0.1.0-alpha.125 → 0.1.0-alpha.126
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-R35M4RCY.js → chunk-5D2C6RCH.js} +1 -1
- package/dist/{chunk-6OPSSJHO.js → chunk-C5VBPHOS.js} +5 -4
- package/dist/{chunk-HPA7RGSZ.js → chunk-KKUDAQQZ.js} +4 -5
- package/dist/{chunk-2BEUR3DU.js → chunk-R6NDP7OF.js} +1 -1
- package/dist/hook-runtime/hooks/pre-tool-use-worker.js +8 -8
- package/dist/hooks/post-tool-use.js +3 -3
- package/dist/hooks/pre-tool-use-worker.js +3 -3
- package/dist/hooks/prim-hook.js +3 -3
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeShellTargets,
|
|
3
3
|
extractFileTargets
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KKUDAQQZ.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_RULES,
|
|
7
7
|
scrub
|
|
@@ -193,6 +193,7 @@ function proposedChangeExcerpt(proposal) {
|
|
|
193
193
|
}
|
|
194
194
|
function resultForPreflight(response, preview = "Review the requested change.", invocation, proposalTruncated = false) {
|
|
195
195
|
const verdict = response.verdict === "block" ? "deny" : response.verdict;
|
|
196
|
+
const silentCoverageOutcome = response.reasonCode === "coverage_unverified" || response.reasonCode === "candidate_set_truncated";
|
|
196
197
|
const message = boundedHealthError(response.message) ?? "";
|
|
197
198
|
const unavailable = message || boundedHealthError(response.reasonCode);
|
|
198
199
|
const safe = /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;
|
|
@@ -220,7 +221,7 @@ function resultForPreflight(response, preview = "Review the requested change.",
|
|
|
220
221
|
"Sandbox escalation, automatic review, prefix permissions, --yes, and an agent's assertion of approval do not authorize an override."
|
|
221
222
|
] : [];
|
|
222
223
|
const guidance = [message, ...editContext, ...new Set(directives), ...approvalContext].filter(Boolean).join("\n");
|
|
223
|
-
const reason = response.conflicts.length > 0 || response.verdict === "ask" || response.verdict === "block" ? approvalSummary(
|
|
224
|
+
const reason = silentCoverageOutcome ? "" : response.conflicts.length > 0 || response.verdict === "ask" || response.verdict === "block" ? approvalSummary(
|
|
224
225
|
{
|
|
225
226
|
conflicts: response.conflicts,
|
|
226
227
|
message,
|
|
@@ -229,7 +230,7 @@ function resultForPreflight(response, preview = "Review the requested change.",
|
|
|
229
230
|
},
|
|
230
231
|
preview
|
|
231
232
|
) : message;
|
|
232
|
-
const disclosureContext = decisionDisclosureContext(response);
|
|
233
|
+
const disclosureContext = silentCoverageOutcome ? "" : decisionDisclosureContext(response);
|
|
233
234
|
const truncationNote = proposalTruncated ? "[primitive] shell proposal was truncated; the complete change was not verified" : "";
|
|
234
235
|
return {
|
|
235
236
|
verdict,
|
|
@@ -238,7 +239,7 @@ function resultForPreflight(response, preview = "Review the requested change.",
|
|
|
238
239
|
additionalContext: [
|
|
239
240
|
disclosureContext,
|
|
240
241
|
truncationNote,
|
|
241
|
-
["warn", "ask", "block"].includes(response.verdict) ? guidance : ""
|
|
242
|
+
!silentCoverageOutcome && ["warn", "ask", "block"].includes(response.verdict) ? guidance : ""
|
|
242
243
|
].filter(Boolean).join("\n"),
|
|
243
244
|
truncated: false,
|
|
244
245
|
unavailable: response.verdict === "unavailable" ? unavailable : void 0
|
|
@@ -18,16 +18,15 @@ function anyUnverified(results) {
|
|
|
18
18
|
}
|
|
19
19
|
function unverifiedNote(results) {
|
|
20
20
|
const causes = [];
|
|
21
|
-
const unavailable = results.find(
|
|
21
|
+
const unavailable = results.find(
|
|
22
|
+
(result) => result.verdict === "unavailable" && !result.unavailable?.startsWith("Mutation targets could not be resolved")
|
|
23
|
+
);
|
|
22
24
|
if (unavailable) {
|
|
23
25
|
causes.push(
|
|
24
26
|
unavailable.unavailable ? `decision check skipped \u2014 ${unavailable.unavailable}` : "decision check skipped \u2014 not verified"
|
|
25
27
|
);
|
|
26
28
|
}
|
|
27
|
-
|
|
28
|
-
causes.push("decision check partial \u2014 conflict set truncated (per-file cap hit)");
|
|
29
|
-
}
|
|
30
|
-
return causes.map((c) => `[primitive] ${c}`).join("\n");
|
|
29
|
+
return causes.map((cause) => `[primitive] ${cause}`).join("\n");
|
|
31
30
|
}
|
|
32
31
|
function blockingReason(results) {
|
|
33
32
|
const parts = results.filter((result) => result.verdict === "ask" || result.verdict === "deny").flatMap((result) => [result.reason, result.additionalContext]).filter((value) => value.length > 0);
|
|
@@ -30492,16 +30492,15 @@ function anyUnverified(results) {
|
|
|
30492
30492
|
}
|
|
30493
30493
|
function unverifiedNote(results) {
|
|
30494
30494
|
const causes = [];
|
|
30495
|
-
const unavailable = results.find(
|
|
30495
|
+
const unavailable = results.find(
|
|
30496
|
+
(result) => result.verdict === "unavailable" && !result.unavailable?.startsWith("Mutation targets could not be resolved")
|
|
30497
|
+
);
|
|
30496
30498
|
if (unavailable) {
|
|
30497
30499
|
causes.push(
|
|
30498
30500
|
unavailable.unavailable ? `decision check skipped \u2014 ${unavailable.unavailable}` : "decision check skipped \u2014 not verified"
|
|
30499
30501
|
);
|
|
30500
30502
|
}
|
|
30501
|
-
|
|
30502
|
-
causes.push("decision check partial \u2014 conflict set truncated (per-file cap hit)");
|
|
30503
|
-
}
|
|
30504
|
-
return causes.map((c) => `[primitive] ${c}`).join("\n");
|
|
30503
|
+
return causes.map((cause) => `[primitive] ${cause}`).join("\n");
|
|
30505
30504
|
}
|
|
30506
30505
|
function blockingReason(results) {
|
|
30507
30506
|
const parts = results.filter((result) => result.verdict === "ask" || result.verdict === "deny").flatMap((result) => [result.reason, result.additionalContext]).filter((value) => value.length > 0);
|
|
@@ -40127,6 +40126,7 @@ function proposedChangeExcerpt(proposal) {
|
|
|
40127
40126
|
}
|
|
40128
40127
|
function resultForPreflight(response, preview = "Review the requested change.", invocation, proposalTruncated = false) {
|
|
40129
40128
|
const verdict = response.verdict === "block" ? "deny" : response.verdict;
|
|
40129
|
+
const silentCoverageOutcome = response.reasonCode === "coverage_unverified" || response.reasonCode === "candidate_set_truncated";
|
|
40130
40130
|
const message = boundedHealthError(response.message) ?? "";
|
|
40131
40131
|
const unavailable = message || boundedHealthError(response.reasonCode);
|
|
40132
40132
|
const safe = /^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/;
|
|
@@ -40154,7 +40154,7 @@ function resultForPreflight(response, preview = "Review the requested change.",
|
|
|
40154
40154
|
"Sandbox escalation, automatic review, prefix permissions, --yes, and an agent's assertion of approval do not authorize an override."
|
|
40155
40155
|
] : [];
|
|
40156
40156
|
const guidance = [message, ...editContext, ...new Set(directives), ...approvalContext].filter(Boolean).join("\n");
|
|
40157
|
-
const reason = response.conflicts.length > 0 || response.verdict === "ask" || response.verdict === "block" ? approvalSummary(
|
|
40157
|
+
const reason = silentCoverageOutcome ? "" : response.conflicts.length > 0 || response.verdict === "ask" || response.verdict === "block" ? approvalSummary(
|
|
40158
40158
|
{
|
|
40159
40159
|
conflicts: response.conflicts,
|
|
40160
40160
|
message,
|
|
@@ -40163,7 +40163,7 @@ function resultForPreflight(response, preview = "Review the requested change.",
|
|
|
40163
40163
|
},
|
|
40164
40164
|
preview
|
|
40165
40165
|
) : message;
|
|
40166
|
-
const disclosureContext = decisionDisclosureContext(response);
|
|
40166
|
+
const disclosureContext = silentCoverageOutcome ? "" : decisionDisclosureContext(response);
|
|
40167
40167
|
const truncationNote = proposalTruncated ? "[primitive] shell proposal was truncated; the complete change was not verified" : "";
|
|
40168
40168
|
return {
|
|
40169
40169
|
verdict,
|
|
@@ -40172,7 +40172,7 @@ function resultForPreflight(response, preview = "Review the requested change.",
|
|
|
40172
40172
|
additionalContext: [
|
|
40173
40173
|
disclosureContext,
|
|
40174
40174
|
truncationNote,
|
|
40175
|
-
["warn", "ask", "block"].includes(response.verdict) ? guidance : ""
|
|
40175
|
+
!silentCoverageOutcome && ["warn", "ask", "block"].includes(response.verdict) ? guidance : ""
|
|
40176
40176
|
].filter(Boolean).join("\n"),
|
|
40177
40177
|
truncated: false,
|
|
40178
40178
|
unavailable: response.verdict === "unavailable" ? unavailable : void 0
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
enrichHookPayloadWithFileRefs,
|
|
10
10
|
preserveHookFileMetadata
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-5D2C6RCH.js";
|
|
12
12
|
import {
|
|
13
13
|
appendCodexContext,
|
|
14
14
|
prepareCodexContext
|
|
@@ -29,13 +29,13 @@ import {
|
|
|
29
29
|
import "../chunk-YP4OXKNX.js";
|
|
30
30
|
import {
|
|
31
31
|
observeDemoInvocation
|
|
32
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-R6NDP7OF.js";
|
|
33
33
|
import {
|
|
34
34
|
normalizeEnvelope,
|
|
35
35
|
readHookStdin,
|
|
36
36
|
shouldSuppressImportedCursorHandler
|
|
37
37
|
} from "../chunk-ND6TYHNI.js";
|
|
38
|
-
import "../chunk-
|
|
38
|
+
import "../chunk-KKUDAQQZ.js";
|
|
39
39
|
import "../chunk-L32WYFJT.js";
|
|
40
40
|
import {
|
|
41
41
|
scrubFromCwd
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
toolInputDigest,
|
|
15
15
|
unverifiedResult,
|
|
16
16
|
waitForPreflight
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-C5VBPHOS.js";
|
|
18
18
|
import {
|
|
19
19
|
observeDemoInvocation
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-R6NDP7OF.js";
|
|
21
21
|
import {
|
|
22
22
|
normalizeEnvelope,
|
|
23
23
|
readHookStdin,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
failOpenHermes,
|
|
35
35
|
failOpenOutput,
|
|
36
36
|
readHookMode
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-KKUDAQQZ.js";
|
|
38
38
|
import "../chunk-L32WYFJT.js";
|
|
39
39
|
import "../chunk-74DQDWLW.js";
|
|
40
40
|
import {
|
package/dist/hooks/prim-hook.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
enrichHookPayloadWithFileRefs,
|
|
20
20
|
preserveHookFileMetadata
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-5D2C6RCH.js";
|
|
22
22
|
import {
|
|
23
23
|
prepareCodexContext
|
|
24
24
|
} from "../chunk-DT7E3SD5.js";
|
|
@@ -38,13 +38,13 @@ import {
|
|
|
38
38
|
import "../chunk-YP4OXKNX.js";
|
|
39
39
|
import {
|
|
40
40
|
observeDemoInvocation
|
|
41
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-R6NDP7OF.js";
|
|
42
42
|
import {
|
|
43
43
|
normalizeEnvelope,
|
|
44
44
|
readHookStdin,
|
|
45
45
|
shouldSuppressImportedCursorHandler
|
|
46
46
|
} from "../chunk-ND6TYHNI.js";
|
|
47
|
-
import "../chunk-
|
|
47
|
+
import "../chunk-KKUDAQQZ.js";
|
|
48
48
|
import "../chunk-L32WYFJT.js";
|
|
49
49
|
import {
|
|
50
50
|
scrubFromCwd,
|
package/dist/index.js
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
hasCompleteCoverage,
|
|
41
41
|
requestPreflight2 as requestPreflight,
|
|
42
42
|
waitForPreflight
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-C5VBPHOS.js";
|
|
44
44
|
import {
|
|
45
45
|
fetchFeedbackCapability
|
|
46
46
|
} from "./chunk-PPZ56EVJ.js";
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
readRun,
|
|
104
104
|
runIds,
|
|
105
105
|
saveRun
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-KKUDAQQZ.js";
|
|
107
107
|
import {
|
|
108
108
|
MANAGED_GIT_HOOK_NAMES,
|
|
109
109
|
assertOwnedHookRuntime,
|
package/package.json
CHANGED