@primitive.ai/prim 0.1.0-alpha.101 → 0.1.0-alpha.103
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 +16 -0
- package/SKILL.md +49 -0
- package/dist/chunk-6WCBVSND.js +107 -0
- package/dist/{chunk-MXVCP33E.js → chunk-LNFWFYSN.js} +60 -0
- package/dist/{chunk-QIHXTYRD.js → chunk-RCFDZ4DY.js} +1 -1
- package/dist/hook-runtime/hooks/post-tool-use.js +497 -358
- package/dist/hook-runtime/hooks/pre-tool-use.js +214 -74
- package/dist/hook-runtime/hooks/prim-hook.js +260 -123
- package/dist/hook-runtime/index.js +2000 -1412
- package/dist/hooks/post-tool-use.js +9 -2
- package/dist/hooks/pre-tool-use.js +10 -1
- package/dist/hooks/prim-hook.js +9 -2
- package/dist/index.js +611 -80
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
enrichHookPayloadWithFileRefs,
|
|
7
7
|
preserveHookFileMetadata
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-RCFDZ4DY.js";
|
|
9
9
|
import {
|
|
10
10
|
postToolInvocationId,
|
|
11
11
|
toMove,
|
|
@@ -18,11 +18,14 @@ import {
|
|
|
18
18
|
appendMove,
|
|
19
19
|
resolveOrg
|
|
20
20
|
} from "../chunk-JJI7FU24.js";
|
|
21
|
-
import
|
|
21
|
+
import {
|
|
22
|
+
observeDemoInvocation
|
|
23
|
+
} from "../chunk-LNFWFYSN.js";
|
|
22
24
|
import {
|
|
23
25
|
appendCodexContext,
|
|
24
26
|
prepareCodexContext
|
|
25
27
|
} from "../chunk-C4D2LMTS.js";
|
|
28
|
+
import "../chunk-6WCBVSND.js";
|
|
26
29
|
import "../chunk-5HFTJEA6.js";
|
|
27
30
|
import {
|
|
28
31
|
scrubFromCwd
|
|
@@ -172,6 +175,10 @@ async function main() {
|
|
|
172
175
|
return;
|
|
173
176
|
}
|
|
174
177
|
parsed = normalizeEnvelope(incoming, agent);
|
|
178
|
+
if (observeDemoInvocation(parsed, agent).excluded) {
|
|
179
|
+
await emit();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
175
182
|
} catch {
|
|
176
183
|
await emit();
|
|
177
184
|
return;
|
|
@@ -11,13 +11,15 @@ import {
|
|
|
11
11
|
failOpenCursor,
|
|
12
12
|
failOpenHermes,
|
|
13
13
|
failOpenOutput,
|
|
14
|
+
observeDemoInvocation,
|
|
14
15
|
readHookMode
|
|
15
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-LNFWFYSN.js";
|
|
16
17
|
import {
|
|
17
18
|
appendCodexContext,
|
|
18
19
|
hasVisibleCodexMessage,
|
|
19
20
|
prepareCodexContext
|
|
20
21
|
} from "../chunk-C4D2LMTS.js";
|
|
22
|
+
import "../chunk-6WCBVSND.js";
|
|
21
23
|
import "../chunk-5HFTJEA6.js";
|
|
22
24
|
import {
|
|
23
25
|
DEFAULT_RULES,
|
|
@@ -284,6 +286,13 @@ async function main() {
|
|
|
284
286
|
await emit(failOpen());
|
|
285
287
|
return;
|
|
286
288
|
}
|
|
289
|
+
try {
|
|
290
|
+
if (observeDemoInvocation(envelope, agent, false).invocation) {
|
|
291
|
+
await emit(failOpen());
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
} catch {
|
|
295
|
+
}
|
|
287
296
|
if (envelope.hook_event_name !== "PreToolUse") {
|
|
288
297
|
await emit(failOpen());
|
|
289
298
|
return;
|
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-RCFDZ4DY.js";
|
|
22
22
|
import {
|
|
23
23
|
postToolInvocationId,
|
|
24
24
|
shouldFlushAfter,
|
|
@@ -31,10 +31,13 @@ import {
|
|
|
31
31
|
appendMove,
|
|
32
32
|
resolveOrg
|
|
33
33
|
} from "../chunk-JJI7FU24.js";
|
|
34
|
-
import
|
|
34
|
+
import {
|
|
35
|
+
observeDemoInvocation
|
|
36
|
+
} from "../chunk-LNFWFYSN.js";
|
|
35
37
|
import {
|
|
36
38
|
prepareCodexContext
|
|
37
39
|
} from "../chunk-C4D2LMTS.js";
|
|
40
|
+
import "../chunk-6WCBVSND.js";
|
|
38
41
|
import "../chunk-5HFTJEA6.js";
|
|
39
42
|
import {
|
|
40
43
|
scrubFromCwd,
|
|
@@ -131,6 +134,10 @@ async function main() {
|
|
|
131
134
|
const incoming = JSON.parse(raw);
|
|
132
135
|
if (agent !== "cursor" && shouldSuppressImportedCursorHandler(incoming, "prim-hook")) return;
|
|
133
136
|
parsed = normalizeEnvelope(incoming, agent);
|
|
137
|
+
if (observeDemoInvocation(parsed, agent).excluded) {
|
|
138
|
+
await emitOutput(cursorPassiveOutput());
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
134
141
|
} catch (error) {
|
|
135
142
|
writeHookDebug("capture failed", error);
|
|
136
143
|
await emitOutput(cursorPassiveOutput());
|