@primitive.ai/prim 0.1.0-alpha.102 → 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 +20 -1
- package/SKILL.md +49 -0
- package/dist/{chunk-O2WV5SQZ.js → chunk-2EKPBZNA.js} +1 -1
- package/dist/chunk-6WCBVSND.js +107 -0
- package/dist/{chunk-MXVCP33E.js → chunk-LNFWFYSN.js} +60 -0
- package/dist/{chunk-6C3CCVDI.js → chunk-NH3VC7YO.js} +1 -1
- package/dist/{chunk-K4JWJ6OM.js → chunk-PO5QAYD7.js} +8 -5
- 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 +2004 -1413
- package/dist/hooks/post-tool-use.js +11 -4
- package/dist/hooks/pre-tool-use.js +12 -3
- package/dist/hooks/prim-hook.js +11 -4
- package/dist/hooks/session-end.js +2 -2
- package/dist/hooks/session-start.js +3 -3
- package/dist/index.js +613 -82
- package/package.json +4 -4
|
@@ -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
|
|
@@ -41,8 +44,8 @@ import {
|
|
|
41
44
|
parseAgent,
|
|
42
45
|
readHookStdin,
|
|
43
46
|
shouldSuppressImportedCursorHandler
|
|
44
|
-
} from "../chunk-
|
|
45
|
-
import "../chunk-
|
|
47
|
+
} from "../chunk-NH3VC7YO.js";
|
|
48
|
+
import "../chunk-PO5QAYD7.js";
|
|
46
49
|
import "../chunk-5LRKJTLA.js";
|
|
47
50
|
import {
|
|
48
51
|
currentBranch,
|
|
@@ -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,
|
|
@@ -36,8 +38,8 @@ import {
|
|
|
36
38
|
parseAgent,
|
|
37
39
|
readHookStdin,
|
|
38
40
|
shouldSuppressImportedCursorHandler
|
|
39
|
-
} from "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
+
} from "../chunk-NH3VC7YO.js";
|
|
42
|
+
import "../chunk-PO5QAYD7.js";
|
|
41
43
|
import "../chunk-5LRKJTLA.js";
|
|
42
44
|
import {
|
|
43
45
|
canonicalGitRoot,
|
|
@@ -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,
|
|
@@ -49,8 +52,8 @@ import {
|
|
|
49
52
|
parseAgent,
|
|
50
53
|
readHookStdin,
|
|
51
54
|
shouldSuppressImportedCursorHandler
|
|
52
|
-
} from "../chunk-
|
|
53
|
-
import "../chunk-
|
|
55
|
+
} from "../chunk-NH3VC7YO.js";
|
|
56
|
+
import "../chunk-PO5QAYD7.js";
|
|
54
57
|
import "../chunk-5LRKJTLA.js";
|
|
55
58
|
import {
|
|
56
59
|
currentBranch,
|
|
@@ -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());
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
parseAgent,
|
|
5
5
|
readHookStdin,
|
|
6
6
|
shouldSuppressImportedCursorHandler
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
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-
|
|
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-
|
|
45
|
+
} from "../chunk-NH3VC7YO.js";
|
|
46
46
|
import {
|
|
47
47
|
MANAGED_GIT_HOOK_NAMES
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-PO5QAYD7.js";
|
|
49
49
|
import {
|
|
50
50
|
daemonRequest
|
|
51
51
|
} from "../chunk-5LRKJTLA.js";
|