@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.
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  enrichHookPayloadWithFileRefs,
7
7
  preserveHookFileMetadata
8
- } from "../chunk-QIHXTYRD.js";
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 "../chunk-MXVCP33E.js";
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-MXVCP33E.js";
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;
@@ -18,7 +18,7 @@ import {
18
18
  import {
19
19
  enrichHookPayloadWithFileRefs,
20
20
  preserveHookFileMetadata
21
- } from "../chunk-QIHXTYRD.js";
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 "../chunk-MXVCP33E.js";
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());