@vibefield/puppeteer-imposter 0.0.0-stage → 0.2.1

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.
Files changed (250) hide show
  1. package/LICENSE +21 -0
  2. package/bin/ai.mjs +17 -0
  3. package/dist/cli/argv.d.ts +40 -0
  4. package/dist/cli/argv.d.ts.map +1 -0
  5. package/dist/cli/argv.js +62 -0
  6. package/dist/cli/argv.js.map +1 -0
  7. package/dist/cli/http-persona.d.ts +15 -0
  8. package/dist/cli/http-persona.d.ts.map +1 -0
  9. package/dist/cli/http-persona.js +216 -0
  10. package/dist/cli/http-persona.js.map +1 -0
  11. package/dist/cli/main.d.ts +11 -0
  12. package/dist/cli/main.d.ts.map +1 -0
  13. package/dist/cli/main.js +671 -0
  14. package/dist/cli/main.js.map +1 -0
  15. package/dist/cli/prompt-line.d.ts +27 -0
  16. package/dist/cli/prompt-line.d.ts.map +1 -0
  17. package/dist/cli/prompt-line.js +93 -0
  18. package/dist/cli/prompt-line.js.map +1 -0
  19. package/dist/control/client.d.ts +51 -0
  20. package/dist/control/client.d.ts.map +1 -0
  21. package/dist/control/client.js +206 -0
  22. package/dist/control/client.js.map +1 -0
  23. package/dist/control/index.d.ts +10 -0
  24. package/dist/control/index.d.ts.map +1 -0
  25. package/dist/control/index.js +10 -0
  26. package/dist/control/index.js.map +1 -0
  27. package/dist/control/peer.d.ts +42 -0
  28. package/dist/control/peer.d.ts.map +1 -0
  29. package/dist/control/peer.js +174 -0
  30. package/dist/control/peer.js.map +1 -0
  31. package/dist/control/protocol.d.ts +207 -0
  32. package/dist/control/protocol.d.ts.map +1 -0
  33. package/dist/control/protocol.js +535 -0
  34. package/dist/control/protocol.js.map +1 -0
  35. package/dist/index.d.ts +36 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +36 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/persona/launch.d.ts +7 -0
  40. package/dist/persona/launch.d.ts.map +1 -0
  41. package/dist/persona/launch.js +26 -0
  42. package/dist/persona/launch.js.map +1 -0
  43. package/dist/persona/load.d.ts +28 -0
  44. package/dist/persona/load.d.ts.map +1 -0
  45. package/dist/persona/load.js +705 -0
  46. package/dist/persona/load.js.map +1 -0
  47. package/dist/persona/session-id.d.ts +4 -0
  48. package/dist/persona/session-id.d.ts.map +1 -0
  49. package/dist/persona/session-id.js +12 -0
  50. package/dist/persona/session-id.js.map +1 -0
  51. package/dist/persona/types.d.ts +265 -0
  52. package/dist/persona/types.d.ts.map +1 -0
  53. package/dist/persona/types.js +38 -0
  54. package/dist/persona/types.js.map +1 -0
  55. package/dist/session/channels/hook.d.ts +31 -0
  56. package/dist/session/channels/hook.d.ts.map +1 -0
  57. package/dist/session/channels/hook.js +114 -0
  58. package/dist/session/channels/hook.js.map +1 -0
  59. package/dist/session/channels/http-sse.d.ts +67 -0
  60. package/dist/session/channels/http-sse.d.ts.map +1 -0
  61. package/dist/session/channels/http-sse.js +212 -0
  62. package/dist/session/channels/http-sse.js.map +1 -0
  63. package/dist/session/channels/jsonrpc.d.ts +56 -0
  64. package/dist/session/channels/jsonrpc.d.ts.map +1 -0
  65. package/dist/session/channels/jsonrpc.js +196 -0
  66. package/dist/session/channels/jsonrpc.js.map +1 -0
  67. package/dist/session/channels/leader-ipc.d.ts +27 -0
  68. package/dist/session/channels/leader-ipc.d.ts.map +1 -0
  69. package/dist/session/channels/leader-ipc.js +314 -0
  70. package/dist/session/channels/leader-ipc.js.map +1 -0
  71. package/dist/session/channels/native-store.d.ts +31 -0
  72. package/dist/session/channels/native-store.d.ts.map +1 -0
  73. package/dist/session/channels/native-store.js +275 -0
  74. package/dist/session/channels/native-store.js.map +1 -0
  75. package/dist/session/channels/statusline.d.ts +20 -0
  76. package/dist/session/channels/statusline.d.ts.map +1 -0
  77. package/dist/session/channels/statusline.js +48 -0
  78. package/dist/session/channels/statusline.js.map +1 -0
  79. package/dist/session/channels/terminal.d.ts +27 -0
  80. package/dist/session/channels/terminal.d.ts.map +1 -0
  81. package/dist/session/channels/terminal.js +108 -0
  82. package/dist/session/channels/terminal.js.map +1 -0
  83. package/dist/session/channels/transcript.d.ts +16 -0
  84. package/dist/session/channels/transcript.d.ts.map +1 -0
  85. package/dist/session/channels/transcript.js +24 -0
  86. package/dist/session/channels/transcript.js.map +1 -0
  87. package/dist/session/channels/ws-unix.d.ts +57 -0
  88. package/dist/session/channels/ws-unix.d.ts.map +1 -0
  89. package/dist/session/channels/ws-unix.js +396 -0
  90. package/dist/session/channels/ws-unix.js.map +1 -0
  91. package/dist/session/http-session-server.d.ts +31 -0
  92. package/dist/session/http-session-server.d.ts.map +1 -0
  93. package/dist/session/http-session-server.js +508 -0
  94. package/dist/session/http-session-server.js.map +1 -0
  95. package/dist/session/scenario-driver.d.ts +105 -0
  96. package/dist/session/scenario-driver.d.ts.map +1 -0
  97. package/dist/session/scenario-driver.js +211 -0
  98. package/dist/session/scenario-driver.js.map +1 -0
  99. package/dist/session/scenario.d.ts +119 -0
  100. package/dist/session/scenario.d.ts.map +1 -0
  101. package/dist/session/scenario.js +299 -0
  102. package/dist/session/scenario.js.map +1 -0
  103. package/dist/session/serve.d.ts +124 -0
  104. package/dist/session/serve.d.ts.map +1 -0
  105. package/dist/session/serve.js +136 -0
  106. package/dist/session/serve.js.map +1 -0
  107. package/dist/session/session.d.ts +125 -0
  108. package/dist/session/session.d.ts.map +1 -0
  109. package/dist/session/session.js +781 -0
  110. package/dist/session/session.js.map +1 -0
  111. package/dist/session/template.d.ts +35 -0
  112. package/dist/session/template.d.ts.map +1 -0
  113. package/dist/session/template.js +133 -0
  114. package/dist/session/template.js.map +1 -0
  115. package/dist/session/timeline.d.ts +81 -0
  116. package/dist/session/timeline.d.ts.map +1 -0
  117. package/dist/session/timeline.js +155 -0
  118. package/dist/session/timeline.js.map +1 -0
  119. package/dist/tui/app.d.ts +30 -0
  120. package/dist/tui/app.d.ts.map +1 -0
  121. package/dist/tui/app.js +72 -0
  122. package/dist/tui/app.js.map +1 -0
  123. package/dist/tui/mount.d.ts +37 -0
  124. package/dist/tui/mount.d.ts.map +1 -0
  125. package/dist/tui/mount.js +88 -0
  126. package/dist/tui/mount.js.map +1 -0
  127. package/dist/tui/store.d.ts +38 -0
  128. package/dist/tui/store.d.ts.map +1 -0
  129. package/dist/tui/store.js +56 -0
  130. package/dist/tui/store.js.map +1 -0
  131. package/dist/tui/theme.d.ts +40 -0
  132. package/dist/tui/theme.d.ts.map +1 -0
  133. package/dist/tui/theme.js +54 -0
  134. package/dist/tui/theme.js.map +1 -0
  135. package/package.json +67 -3
  136. package/personas/antigravity/behavior/happy-turn.json +9 -0
  137. package/personas/antigravity/ops.json +14 -0
  138. package/personas/antigravity/persona.json +15 -0
  139. package/personas/antigravity/runflows.json +6 -0
  140. package/personas/antigravity/scenarios/happy-turn.json +25 -0
  141. package/personas/claude/behavior/happy-turn.json +19 -0
  142. package/personas/claude/ops.json +128 -0
  143. package/personas/claude/persona.json +29 -0
  144. package/personas/claude/runflows.json +45 -0
  145. package/personas/claude/scenarios/channel-disconnect.json +19 -0
  146. package/personas/claude/scenarios/crash-mid-turn.json +42 -0
  147. package/personas/claude/scenarios/cross-layer-implementation.json +488 -0
  148. package/personas/claude/scenarios/deep-research.json +494 -0
  149. package/personas/claude/scenarios/duplicate-out-of-order.json +57 -0
  150. package/personas/claude/scenarios/flood.json +11 -0
  151. package/personas/claude/scenarios/happy-turn.json +57 -0
  152. package/personas/claude/scenarios/incident-investigation.json +465 -0
  153. package/personas/claude/scenarios/late-after-exit.json +27 -0
  154. package/personas/claude/scenarios/permission-allow.json +55 -0
  155. package/personas/claude/scenarios/permission-deny.json +71 -0
  156. package/personas/claude/scenarios/token-usage-refresh.json +33 -0
  157. package/personas/claude/scenarios/unknown-event.json +14 -0
  158. package/personas/codex/behavior/approval-turn.json +15 -0
  159. package/personas/codex/behavior/happy-turn.json +10 -0
  160. package/personas/codex/ops.json +159 -0
  161. package/personas/codex/persona.json +36 -0
  162. package/personas/codex/runflows.json +45 -0
  163. package/personas/codex/scenarios/channel-disconnect.json +31 -0
  164. package/personas/codex/scenarios/crash-mid-turn.json +30 -0
  165. package/personas/codex/scenarios/cross-layer-implementation.json +725 -0
  166. package/personas/codex/scenarios/deep-research.json +684 -0
  167. package/personas/codex/scenarios/duplicate-out-of-order.json +87 -0
  168. package/personas/codex/scenarios/flood.json +22 -0
  169. package/personas/codex/scenarios/happy-turn.json +81 -0
  170. package/personas/codex/scenarios/incident-investigation.json +695 -0
  171. package/personas/codex/scenarios/late-after-exit.json +59 -0
  172. package/personas/codex/scenarios/permission-allow.json +110 -0
  173. package/personas/codex/scenarios/permission-deny.json +83 -0
  174. package/personas/codex/scenarios/token-usage-refresh.json +49 -0
  175. package/personas/codex/scenarios/unknown-event.json +17 -0
  176. package/personas/codex/serve.json +124 -0
  177. package/personas/copilot/behavior/happy-turn.json +9 -0
  178. package/personas/copilot/ops.json +28 -0
  179. package/personas/copilot/persona.json +17 -0
  180. package/personas/copilot/runflows.json +6 -0
  181. package/personas/copilot/scenarios/happy-turn.json +50 -0
  182. package/personas/grok/behavior/approval-turn.json +16 -0
  183. package/personas/grok/behavior/happy-turn.json +13 -0
  184. package/personas/grok/ops.json +330 -0
  185. package/personas/grok/persona.json +24 -0
  186. package/personas/grok/runflows.json +25 -0
  187. package/personas/grok/scenarios/agent-team-lifecycle.json +74 -0
  188. package/personas/grok/scenarios/compact-lifecycle.json +61 -0
  189. package/personas/grok/serve.json +57 -0
  190. package/personas/hermes/behavior/approval-turn.json +11 -0
  191. package/personas/hermes/behavior/happy-turn.json +9 -0
  192. package/personas/hermes/ops.json +227 -0
  193. package/personas/hermes/persona.json +15 -0
  194. package/personas/hermes/runflows.json +50 -0
  195. package/personas/hermes/scenarios/happy-turn.json +25 -0
  196. package/personas/hermes/scenarios/late-after-exit.json +21 -0
  197. package/personas/hermes/scenarios/permission-deny.json +54 -0
  198. package/personas/hermes/scenarios/unknown-event.json +14 -0
  199. package/personas/hermes/serve.json +54 -0
  200. package/personas/kimi/behavior/happy-turn.json +9 -0
  201. package/personas/kimi/ops.json +357 -0
  202. package/personas/kimi/persona.json +23 -0
  203. package/personas/kimi/runflows.json +84 -0
  204. package/personas/kimi/scenarios/compaction-lifecycle.json +20 -0
  205. package/personas/kimi/scenarios/duplicate-out-of-order.json +60 -0
  206. package/personas/kimi/scenarios/happy-turn.json +66 -0
  207. package/personas/kimi/scenarios/late-after-end.json +28 -0
  208. package/personas/kimi/scenarios/tool-failure.json +43 -0
  209. package/personas/kimi/scenarios/tool-success.json +57 -0
  210. package/personas/kimi/scenarios/unknown-record.json +15 -0
  211. package/personas/opencode/README.md +32 -0
  212. package/personas/opencode/behavior/happy-turn.json +9 -0
  213. package/personas/opencode/behavior/permission-turn.json +18 -0
  214. package/personas/opencode/http-serve.json +72 -0
  215. package/personas/opencode/ops.json +250 -0
  216. package/personas/opencode/persona.json +22 -0
  217. package/personas/opencode/runflows.json +45 -0
  218. package/personas/opencode/scenarios/duplicate-event.json +27 -0
  219. package/personas/opencode/scenarios/failure.json +30 -0
  220. package/personas/opencode/scenarios/happy-turn.json +86 -0
  221. package/personas/opencode/scenarios/late-event.json +29 -0
  222. package/personas/opencode/scenarios/out-of-order.json +42 -0
  223. package/personas/opencode/scenarios/permission-allow.json +31 -0
  224. package/personas/opencode/scenarios/permission-deny.json +31 -0
  225. package/personas/opencode/scenarios/question-reject.json +37 -0
  226. package/personas/opencode/scenarios/question-reply.json +38 -0
  227. package/personas/opencode/scenarios/reconnect.json +22 -0
  228. package/personas/opencode/scenarios/resume.json +30 -0
  229. package/personas/opencode/scenarios/unknown-event.json +15 -0
  230. package/personas/pi/behavior/happy-turn.json +9 -0
  231. package/personas/pi/ops.json +19 -0
  232. package/personas/pi/persona.json +16 -0
  233. package/personas/pi/runflows.json +6 -0
  234. package/personas/pi/scenarios/happy-turn.json +52 -0
  235. package/personas/synthetic/behavior/happy-turn.json +12 -0
  236. package/personas/synthetic/groundtruth.html +164 -0
  237. package/personas/synthetic/groundtruth.json +380 -0
  238. package/personas/synthetic/model/behavior.json +27 -0
  239. package/personas/synthetic/model/channels.json +16 -0
  240. package/personas/synthetic/model/detection.json +13 -0
  241. package/personas/synthetic/model/events/agent.action.json +16 -0
  242. package/personas/synthetic/model/events/agent.boot.json +16 -0
  243. package/personas/synthetic/model/events/agent.halt.json +16 -0
  244. package/personas/synthetic/model/events/agent.prompt.json +16 -0
  245. package/personas/synthetic/model/events/agent.reply.json +16 -0
  246. package/personas/synthetic/model/events/agent.settled.json +16 -0
  247. package/personas/synthetic/model/manifest.json +7 -0
  248. package/personas/synthetic/ops.json +18 -0
  249. package/personas/synthetic/persona.json +11 -0
  250. package/README.md +0 -3
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Presentation: the same four lines of information, rendered two ways
3
+ * (docs/archive/IMPOSTER.md §4.2).
4
+ *
5
+ * Headless is not a fallback — CI runs it, and so does the control centre's
6
+ * spawner, because Ink's pinned layout needs a real TTY and neither has one.
7
+ * Both modes share `formatFrame`, so what a line *says* never depends on how it
8
+ * is displayed.
9
+ *
10
+ * Ink is loaded through a dynamic import, so a headless process never pays for
11
+ * React at all: the cost of the pinned layout falls only on the mode that gets
12
+ * the pinned layout.
13
+ */
14
+ import type { PresentationFrame } from '../session/timeline.ts';
15
+ export interface Presentation {
16
+ frame(frame: PresentationFrame): void;
17
+ channels(channels: readonly string[]): void;
18
+ /** Portable scenario-intent state; never presented as native vendor truth. */
19
+ scenario(state: string): void;
20
+ /** Pasted-but-not-submitted text. */
21
+ staged(text: string): void;
22
+ notice(text: string): void;
23
+ readonly interactive: boolean;
24
+ stop(): Promise<void>;
25
+ }
26
+ export interface PresentationOptions {
27
+ vendor: string;
28
+ version: string;
29
+ sessionId: string;
30
+ channels: readonly string[];
31
+ /** Overridable so tests can assert the headless stream without a real stdout. */
32
+ write?: (text: string) => void;
33
+ /** Force a mode; defaults to whether both ends of the terminal are real. */
34
+ interactive?: boolean;
35
+ }
36
+ export declare function createPresentation(options: PresentationOptions): Promise<Presentation>;
37
+ //# sourceMappingURL=mount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../src/tui/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5C,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,qCAAqC;IACrC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,iFAAiF;IACjF,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,4EAA4E;IAC5E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAkCD,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CA8C5F"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Presentation: the same four lines of information, rendered two ways
3
+ * (docs/archive/IMPOSTER.md §4.2).
4
+ *
5
+ * Headless is not a fallback — CI runs it, and so does the control centre's
6
+ * spawner, because Ink's pinned layout needs a real TTY and neither has one.
7
+ * Both modes share `formatFrame`, so what a line *says* never depends on how it
8
+ * is displayed.
9
+ *
10
+ * Ink is loaded through a dynamic import, so a headless process never pays for
11
+ * React at all: the cost of the pinned layout falls only on the mode that gets
12
+ * the pinned layout.
13
+ */
14
+ import { createTuiStore, formatFrame } from "./store.js";
15
+ /**
16
+ * Ink costs ~40 MB of RSS per process (77 MB headless vs 117 MB with Ink
17
+ * loaded, node 26.5, measured 2026-08-08). One imposter does not care; twenty
18
+ * of them in a swarm pane is 800 MB of chrome. `PUPPETEER_IMPOSTER_TUI=off`
19
+ * is the contained retreat §4.1.2 reserved — the append-only sink is a
20
+ * first-class mode, so falling back to it costs nothing but the pinned layout.
21
+ */
22
+ function isInteractive() {
23
+ if (process.env.PUPPETEER_IMPOSTER_TUI === 'off')
24
+ return false;
25
+ return Boolean(process.stdin.isTTY && process.stdout.isTTY);
26
+ }
27
+ /** Append-only stdout: what the adapter's pipe, and therefore CI, sees. */
28
+ function headlessPresentation(options) {
29
+ const write = options.write ?? ((text) => void process.stdout.write(text));
30
+ write(`IMPOSTER · ${options.vendor} ${options.version} · ${options.sessionId} · ${options.channels.join(' ')}\r\n`);
31
+ return {
32
+ interactive: false,
33
+ frame: (frame) => write(`${formatFrame(frame)}\r\n`),
34
+ channels: (channels) => write(`channels: ${channels.join(' ')}\r\n`),
35
+ // Transitions are already implied by the op lines above them, so an
36
+ // append-only stream says nothing: repeating it every op would double the
37
+ // log for a reader who can see `turn.start` perfectly well.
38
+ scenario: () => { },
39
+ // Clearing the staged text is a TUI concern; an append-only stream has
40
+ // nothing to clear, so it says nothing.
41
+ staged: (text) => void (text && write(`\r\n[staged] ${text}\r\n`)),
42
+ notice: (text) => write(`${text}\r\n`),
43
+ stop: async () => { },
44
+ };
45
+ }
46
+ export async function createPresentation(options) {
47
+ if (!(options.interactive ?? isInteractive()))
48
+ return headlessPresentation(options);
49
+ const store = createTuiStore(options.channels);
50
+ // Imported here, and only here: a piped run never loads Ink or React.
51
+ const [{ render }, { createElement }, { ImposterApp }] = await Promise.all([
52
+ import('ink'),
53
+ import('react'),
54
+ import("./app.js"),
55
+ ]);
56
+ const instance = render(createElement(ImposterApp, {
57
+ vendor: options.vendor,
58
+ version: options.version,
59
+ sessionId: options.sessionId,
60
+ store,
61
+ }), {
62
+ // Ink must not touch input. `exitOnCtrlC` installs a key handler, and
63
+ // Ctrl-C is an interrupt the session has to see as bytes like any other
64
+ // (§4.1.1); `patchConsole` would swallow the debug log.
65
+ exitOnCtrlC: false,
66
+ patchConsole: false,
67
+ // Ink's own detection is `!isInCi && stdout.isTTY`, and `is-in-ci` is
68
+ // just `CI` or `CONTINUOUS_INTEGRATION` being set. We only get here after
69
+ // checking BOTH ends are real terminals, so we know better than the
70
+ // guess: without this, an imposter run inside anything that exports CI —
71
+ // a container, a CI shell, plenty of dev environments — would paint one
72
+ // frame at exit and look frozen for the whole session.
73
+ interactive: true,
74
+ });
75
+ return {
76
+ interactive: true,
77
+ frame: (frame) => store.line(formatFrame(frame)),
78
+ channels: (channels) => store.channels(channels),
79
+ scenario: (state) => store.scenario(state),
80
+ staged: (text) => store.staged(text),
81
+ notice: (text) => store.notice(text),
82
+ async stop() {
83
+ instance.unmount();
84
+ await instance.waitUntilExit().catch(() => undefined);
85
+ },
86
+ };
87
+ }
88
+ //# sourceMappingURL=mount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mount.js","sourceRoot":"","sources":["../../src/tui/mount.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAyBzD;;;;;;GAMG;AACH,SAAS,aAAa;IACpB,IAAI,OAAO,CAAC,GAAG,CAAC,sBAAsB,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAC/D,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED,2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,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACxD,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * What the TUI renders (docs/archive/IMPOSTER.md §4), as an external store.
3
+ *
4
+ * The session pushes into this from outside React; the Ink component only
5
+ * subscribes. Keeping the state here rather than in a component is what lets
6
+ * the headless sink and the TUI share one formatter — the two modes differ in
7
+ * how a line is displayed, never in what a line says.
8
+ */
9
+ import type { PresentationFrame } from '../session/timeline.ts';
10
+ export interface TuiSnapshot {
11
+ channels: readonly string[];
12
+ lines: readonly string[];
13
+ /** Portable scenario-intent state, e.g. `turn.thinking`. */
14
+ scenario: string;
15
+ /** Pasted-but-not-submitted text, shown at the prompt. */
16
+ staged: string;
17
+ notice: string;
18
+ }
19
+ export interface TuiStore {
20
+ getSnapshot(): TuiSnapshot;
21
+ subscribe(listener: (snapshot: TuiSnapshot) => void): () => void;
22
+ line(text: string): void;
23
+ channels(channels: readonly string[]): void;
24
+ scenario(scenario: string): void;
25
+ staged(text: string): void;
26
+ notice(text: string): void;
27
+ }
28
+ /**
29
+ * One line per op or event, identical in both modes. Cosmetic only — nothing
30
+ * ever parses this back, which is the whole reason the TUI is allowed to be a
31
+ * summary rather than a faithful reproduction (§4).
32
+ *
33
+ * A silent op is still shown: it happened, the persona just binds no channel
34
+ * for it, and seeing the gap is the point (see the note in timeline.ts).
35
+ */
36
+ export declare function formatFrame(frame: PresentationFrame): string;
37
+ export declare function createTuiStore(channels: readonly string[]): TuiStore;
38
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/tui/store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,4DAA4D;IAC5D,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,IAAI,WAAW,CAAC;IAC3B,SAAS,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACjE,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAKD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAI5D;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,QAAQ,CAgCpE"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * What the TUI renders (docs/archive/IMPOSTER.md §4), as an external store.
3
+ *
4
+ * The session pushes into this from outside React; the Ink component only
5
+ * subscribes. Keeping the state here rather than in a component is what lets
6
+ * the headless sink and the TUI share one formatter — the two modes differ in
7
+ * how a line is displayed, never in what a line says.
8
+ */
9
+ /** Enough scrollback to debug a turn; the terminal only ever shows a window of it. */
10
+ const MAX_LINES = 500;
11
+ /**
12
+ * One line per op or event, identical in both modes. Cosmetic only — nothing
13
+ * ever parses this back, which is the whole reason the TUI is allowed to be a
14
+ * summary rather than a faithful reproduction (§4).
15
+ *
16
+ * A silent op is still shown: it happened, the persona just binds no channel
17
+ * for it, and seeing the gap is the point (see the note in timeline.ts).
18
+ */
19
+ export function formatFrame(frame) {
20
+ const at = frame.at.slice(11, 23);
21
+ const detail = frame.with.text ?? frame.with.tool ?? frame.with.reason ?? '';
22
+ return `${at} ${frame.op}${detail ? ` ${JSON.stringify(detail)}` : ''}${frame.silent ? ' (unbound)' : ''}`;
23
+ }
24
+ export function createTuiStore(channels) {
25
+ let snapshot = { channels: [...channels], lines: [], scenario: 'starting', staged: '', notice: '' };
26
+ const listeners = new Set();
27
+ const commit = (next) => {
28
+ snapshot = next;
29
+ for (const listener of listeners)
30
+ listener(snapshot);
31
+ };
32
+ return {
33
+ getSnapshot: () => snapshot,
34
+ subscribe(listener) {
35
+ listeners.add(listener);
36
+ return () => listeners.delete(listener);
37
+ },
38
+ line(text) {
39
+ const lines = [...snapshot.lines, text];
40
+ commit({ ...snapshot, lines: lines.length > MAX_LINES ? lines.slice(-MAX_LINES) : lines });
41
+ },
42
+ channels(channels) {
43
+ commit({ ...snapshot, channels: [...channels] });
44
+ },
45
+ scenario(scenario) {
46
+ commit({ ...snapshot, scenario });
47
+ },
48
+ staged(text) {
49
+ commit({ ...snapshot, staged: text });
50
+ },
51
+ notice(text) {
52
+ commit({ ...snapshot, notice: text });
53
+ },
54
+ };
55
+ }
56
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/tui/store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAwBH,sFAAsF;AACtF,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,KAAwB;IAClD,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,IAA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Q,CAAC,QAAQ;YACf,MAAM,CAAC,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,QAAQ,CAAC,QAAQ;YACf,MAAM,CAAC,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpC,CAAC;QACD,MAAM,CAAC,IAAI;YACT,MAAM,CAAC,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACxC,CAAC;QACD,MAAM,CAAC,IAAI;YACT,MAAM,CAAC,EAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACxC,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * One palette, shared by the TUI and the control console (docs/archive/IMPOSTER.md §4).
3
+ *
4
+ * Purple and blue, because the imposter must never be mistaken for the vendor
5
+ * it is impersonating. Claude Code is orange, Codex is green — a puppeteer
6
+ * imposter that borrowed either would invite exactly the confusion §1.1 exists
7
+ * to prevent. The chrome says "this is a stand-in" at a glance, from across the
8
+ * room, in a pane you did not launch yourself.
9
+ *
10
+ * Hex rather than the sixteen ANSI names: Ink hands these to chalk, which
11
+ * degrades them on terminals without truecolour, and the named colours vary so
12
+ * wildly between themes that "purple" could arrive as anything.
13
+ */
14
+ export declare const THEME: {
15
+ /** The frame, the ghost, and anything that means "imposter". */
16
+ readonly violet: "#a78bfa";
17
+ readonly violetDeep: "#7c5cff";
18
+ /** Live channels, session identity, the prompt caret. */
19
+ readonly blue: "#60a5fa";
20
+ readonly sky: "#38bdf8";
21
+ /** Body text and the op stream. */
22
+ readonly text: "#d7dce2";
23
+ readonly muted: "#7c8496";
24
+ /** Only for a turn that failed or an op the scenario driver did not expect. */
25
+ readonly warn: "#f0788a";
26
+ };
27
+ /**
28
+ * The ghost. Box-drawing plus an ASCII tilde hem: every glyph here is in the
29
+ * base box-drawing block or plain ASCII, so it renders in any terminal font
30
+ * rather than turning into replacement boxes in the one the user actually has.
31
+ *
32
+ * Three lines, all six columns wide — the header lays it out beside the
33
+ * identity block, and a ragged edge there would be visible immediately.
34
+ */
35
+ export declare const GHOST: readonly [" ╭───╮", " │· ·│", " ╰~~~╯"];
36
+ /** Ghost eyes follow scenario intent: the one wink of personality this chrome gets. */
37
+ export declare function ghostFace(state: string): readonly string[];
38
+ /** Lifecycle states, coloured within the two prime hues so nothing reads as a vendor. */
39
+ export declare function stateColor(state: string): string;
40
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/tui/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,KAAK;IAChB,gEAAgE;;;IAGhE,yDAAyD;;;IAGzD,mCAAmC;;;IAGnC,+EAA+E;;CAEvE,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,yCAA0C,CAAC;AAE7D,uFAAuF;AACvF,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAI1D;AAED,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKhD"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * One palette, shared by the TUI and the control console (docs/archive/IMPOSTER.md §4).
3
+ *
4
+ * Purple and blue, because the imposter must never be mistaken for the vendor
5
+ * it is impersonating. Claude Code is orange, Codex is green — a puppeteer
6
+ * imposter that borrowed either would invite exactly the confusion §1.1 exists
7
+ * to prevent. The chrome says "this is a stand-in" at a glance, from across the
8
+ * room, in a pane you did not launch yourself.
9
+ *
10
+ * Hex rather than the sixteen ANSI names: Ink hands these to chalk, which
11
+ * degrades them on terminals without truecolour, and the named colours vary so
12
+ * wildly between themes that "purple" could arrive as anything.
13
+ */
14
+ export const THEME = {
15
+ /** The frame, the ghost, and anything that means "imposter". */
16
+ violet: '#a78bfa',
17
+ violetDeep: '#7c5cff',
18
+ /** Live channels, session identity, the prompt caret. */
19
+ blue: '#60a5fa',
20
+ sky: '#38bdf8',
21
+ /** Body text and the op stream. */
22
+ text: '#d7dce2',
23
+ muted: '#7c8496',
24
+ /** Only for a turn that failed or an op the scenario driver did not expect. */
25
+ warn: '#f0788a',
26
+ };
27
+ /**
28
+ * The ghost. Box-drawing plus an ASCII tilde hem: every glyph here is in the
29
+ * base box-drawing block or plain ASCII, so it renders in any terminal font
30
+ * rather than turning into replacement boxes in the one the user actually has.
31
+ *
32
+ * Three lines, all six columns wide — the header lays it out beside the
33
+ * identity block, and a ragged edge there would be visible immediately.
34
+ */
35
+ export const GHOST = [' ╭───╮', ' │· ·│', ' ╰~~~╯'];
36
+ /** Ghost eyes follow scenario intent: the one wink of personality this chrome gets. */
37
+ export function ghostFace(state) {
38
+ if (state === 'ended')
39
+ return [' ╭───╮', ' │x x│', ' ╰~~~╯'];
40
+ if (state.startsWith('turn.'))
41
+ return [' ╭───╮', ' │◦ ◦│', ' ╰~~~╯'];
42
+ return GHOST;
43
+ }
44
+ /** Lifecycle states, coloured within the two prime hues so nothing reads as a vendor. */
45
+ export function stateColor(state) {
46
+ if (state === 'ended')
47
+ return THEME.muted;
48
+ if (state.startsWith('turn.'))
49
+ return THEME.violet;
50
+ if (state === 'ready')
51
+ return THEME.sky;
52
+ return THEME.blue;
53
+ }
54
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/tui/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,gEAAgE;IAChE,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,SAAS;IACrB,yDAAyD;IACzD,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,mCAAmC;IACnC,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,+EAA+E;IAC/E,IAAI,EAAE,SAAS;CACP,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAE7D,uFAAuF;AACvF,MAAM,UAAU,SAAS,CAAC,KAAa;IACrC,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC7D,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC;IAC1C,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC,MAAM,CAAC;IACnD,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC;IACxC,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,70 @@
1
1
  {
2
2
  "name": "@vibefield/puppeteer-imposter",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.1",
4
+ "type": "module",
5
+ "description": "One executable that impersonates every coding agent from versioned Surface models and vendor-native channels.",
6
+ "license": "MIT",
7
+ "author": "James Yong",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/vibefield/puppeteer.git",
11
+ "directory": "packages/imposter"
12
+ },
13
+ "main": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./cli": {
21
+ "types": "./dist/cli/main.d.ts",
22
+ "import": "./dist/cli/main.js"
23
+ },
24
+ "./control": {
25
+ "types": "./dist/control/index.d.ts",
26
+ "import": "./dist/control/index.js"
27
+ },
28
+ "./scenario-driver": {
29
+ "types": "./dist/session/scenario-driver.d.ts",
30
+ "import": "./dist/session/scenario-driver.js"
31
+ },
32
+ "./package.json": "./package.json"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "bin",
40
+ "personas"
41
+ ],
42
+ "dependencies": {
43
+ "ink": "^7.1.1",
44
+ "react": "^19.2.7",
45
+ "xstate": "^5.32.5",
46
+ "@vibefield/puppeteer-surface": "0.2.1"
47
+ },
48
+ "engines": {
49
+ "node": ">=22.18.0"
50
+ },
51
+ "devDependencies": {
52
+ "@types/react": "^19.2.17",
53
+ "@vibefield/puppeteer-adapter-codex": "0.2.1",
54
+ "@vibefield/puppeteer-adapter-claude": "0.2.1",
55
+ "@vibefield/puppeteer-adapter-kimi": "0.2.1",
56
+ "@vibefield/puppeteer-adapter-grok": "0.2.1",
57
+ "@vibefield/puppeteer-core": "0.2.1",
58
+ "@vibefield/puppeteer-testing": "0.2.1"
59
+ },
60
+ "bin": {
61
+ "ai": "./bin/ai.mjs",
62
+ "imposter": "./bin/ai.mjs"
63
+ },
64
+ "scripts": {
65
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
66
+ "build": "pnpm clean && tsc -p tsconfig.build.json",
67
+ "typecheck": "tsc -p tsconfig.json --noEmit",
68
+ "test": "vitest run"
69
+ }
6
70
  }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "happy-turn",
3
+ "reply": "imposter: ok",
4
+ "ops": [
5
+ { "op": "turn.start", "with": { "text": "$stimulus.text" } },
6
+ { "op": "assistant.delta", "with": { "text": "$reply" } },
7
+ { "op": "turn.end" }
8
+ ]
9
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "turn.start": [
3
+ { "channel": "native-log", "event": "USER_INPUT", "with": { "source": "USER_EXPLICIT", "status": "DONE", "content": "$op.text" } }
4
+ ],
5
+ "tool.start": [
6
+ { "channel": "native-log", "event": "PLANNER_RESPONSE", "with": { "source": "MODEL", "status": "DONE", "tool_calls": [{ "name": "$op.tool", "args": "$op.input" }] } }
7
+ ],
8
+ "tool.end": [
9
+ { "channel": "native-log", "event": "RUN_COMMAND", "with": { "source": "MODEL", "status": "DONE", "exit_code": 0, "content": "$op.output" } }
10
+ ],
11
+ "turn.end": [
12
+ { "channel": "native-log", "event": "PLANNER_RESPONSE", "with": { "source": "MODEL", "status": "DONE", "content": "$reply" } }
13
+ ]
14
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "vendor": "antigravity",
3
+ "asm": { "package": "@vibefield/puppeteer-surface", "path": "vendors/antigravity" },
4
+ "shimNames": ["agy", "antigravity"],
5
+ "envelope": {},
6
+ "nativeStore": {
7
+ "rootEnv": "PUPPETEER_ANTIGRAVITY_DATA_ROOT",
8
+ "sessionPath": ["brain", "$sessionId", ".system_generated", "logs"],
9
+ "updatesFile": "transcript.jsonl",
10
+ "recordFormat": "flat-record",
11
+ "recordTimestamp": { "field": "created_at", "format": "iso" },
12
+ "recordSequence": { "field": "step_index", "start": 0 }
13
+ },
14
+ "boot": [{ "op": "session.start" }, { "op": "session.ready" }]
15
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 1,
3
+ "flows": [
4
+ { "id": "happy-turn", "intent": "turn.basic", "scenario": "happy-turn", "title": "Basic Antigravity transcript turn", "summary": "Native USER_INPUT followed by a terminal PLANNER_RESPONSE.", "kind": "typical", "danger": "safe", "tags": ["transcript", "turn"], "defaultStimulus": { "text": "hello" }, "defaultSpeed": 4 }
5
+ ]
6
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "happy-turn",
3
+ "steps": [
4
+ {
5
+ "at": 0,
6
+ "do": {
7
+ "emit": {
8
+ "channel": "transcript",
9
+ "event": "USER_INPUT",
10
+ "with": { "source": "USER_EXPLICIT", "status": "DONE", "content": "$stimulus.text" }
11
+ }
12
+ }
13
+ },
14
+ {
15
+ "at": 40,
16
+ "do": {
17
+ "emit": {
18
+ "channel": "transcript",
19
+ "event": "PLANNER_RESPONSE",
20
+ "with": { "source": "MODEL", "status": "DONE", "content": "imposter: ok" }
21
+ }
22
+ }
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "happy-turn",
3
+ "reply": "imposter: ok",
4
+ "statusLine": {
5
+ "modelId": "claude-sonnet-5",
6
+ "modelDisplayName": "Sonnet 5 (imposter)",
7
+ "capacityTokens": 200000,
8
+ "tokensPerTurn": 12400,
9
+ "rateLimits": {
10
+ "five_hour": { "used_percentage": 12, "resetsInSeconds": 14400 },
11
+ "seven_day": { "used_percentage": 3, "resetsInSeconds": 518400 }
12
+ }
13
+ },
14
+ "ops": [
15
+ { "op": "turn.start", "with": { "text": "$stimulus.text" } },
16
+ { "op": "assistant.delta", "with": { "text": "$reply" } },
17
+ { "op": "turn.end", "with": { "text": "$reply" } }
18
+ ]
19
+ }
@@ -0,0 +1,128 @@
1
+ {
2
+ "session.start": [
3
+ {
4
+ "channel": "hook",
5
+ "event": "SessionStart",
6
+ "with": { "source": "$op.source", "session_title": "$sessionTitle" }
7
+ }
8
+ ],
9
+ "session.ready": [
10
+ {
11
+ "channel": "hook",
12
+ "event": "InstructionsLoaded",
13
+ "with": { "file_path": "$claudeMdPath", "memory_type": "User", "load_reason": "session_start" }
14
+ }
15
+ ],
16
+ "session.end": [
17
+ {
18
+ "channel": "hook",
19
+ "event": "SessionEnd",
20
+ "with": { "reason": "$op.reason", "prompt_id": "$uuid:prompt" }
21
+ }
22
+ ],
23
+ "turn.start": [
24
+ {
25
+ "channel": "hook",
26
+ "event": "UserPromptSubmit",
27
+ "with": {
28
+ "prompt": "$op.text",
29
+ "prompt_id": "$uuid:prompt",
30
+ "session_title": "$sessionTitle",
31
+ "permission_mode": "$permissionMode"
32
+ }
33
+ },
34
+ {
35
+ "channel": "transcript",
36
+ "with": {
37
+ "type": "user",
38
+ "uuid": "$uuid:user",
39
+ "promptId": "$uuid:prompt",
40
+ "sessionId": "$sessionId",
41
+ "timestamp": "$now",
42
+ "cwd": "$cwd",
43
+ "version": "$vendorVersion",
44
+ "message": { "role": "user", "content": "$op.text" }
45
+ }
46
+ }
47
+ ],
48
+ "assistant.delta": [
49
+ {
50
+ "channel": "transcript",
51
+ "with": {
52
+ "type": "assistant",
53
+ "uuid": "$uuid:assistant",
54
+ "sessionId": "$sessionId",
55
+ "timestamp": "$now",
56
+ "cwd": "$cwd",
57
+ "version": "$vendorVersion",
58
+ "message": {
59
+ "type": "message",
60
+ "id": "$uuid:message",
61
+ "role": "assistant",
62
+ "model": "$modelId",
63
+ "content": [{ "type": "text", "text": "$op.text" }]
64
+ }
65
+ }
66
+ }
67
+ ],
68
+ "permission.ask": [
69
+ {
70
+ "channel": "hook",
71
+ "event": "PermissionRequest",
72
+ "with": {
73
+ "tool_name": "$op.tool",
74
+ "tool_input": "$op.input",
75
+ "prompt_id": "$uuid:prompt",
76
+ "permission_mode": "$permissionMode",
77
+ "permission_suggestions": [],
78
+ "effort": { "level": "xhigh" }
79
+ }
80
+ }
81
+ ],
82
+ "tool.start": [
83
+ {
84
+ "channel": "hook",
85
+ "event": "PreToolUse",
86
+ "with": {
87
+ "tool_name": "$op.tool",
88
+ "tool_input": "$op.input",
89
+ "tool_use_id": "$uuid:tool",
90
+ "prompt_id": "$uuid:prompt",
91
+ "permission_mode": "$permissionMode",
92
+ "effort": { "level": "xhigh" }
93
+ }
94
+ }
95
+ ],
96
+ "tool.end": [
97
+ {
98
+ "channel": "hook",
99
+ "event": "PostToolUse",
100
+ "with": {
101
+ "tool_name": "$op.tool",
102
+ "tool_input": "$op.input",
103
+ "tool_response": "$op.output",
104
+ "tool_use_id": "$uuid:tool",
105
+ "prompt_id": "$uuid:prompt",
106
+ "permission_mode": "$permissionMode",
107
+ "duration_ms": 42,
108
+ "effort": { "level": "xhigh" }
109
+ }
110
+ }
111
+ ],
112
+ "turn.end": [
113
+ {
114
+ "channel": "hook",
115
+ "event": "Stop",
116
+ "with": {
117
+ "prompt_id": "$uuid:prompt",
118
+ "last_assistant_message": "$op.text",
119
+ "stop_hook_active": false,
120
+ "background_tasks": [],
121
+ "session_crons": [],
122
+ "permission_mode": "$permissionMode",
123
+ "effort": { "level": "xhigh" }
124
+ }
125
+ }
126
+ ],
127
+ "usage.refresh": [{ "channel": "statusline" }]
128
+ }