@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,57 @@
1
+ {
2
+ "name": "tool-success",
3
+ "steps": [
4
+ {
5
+ "at": 0,
6
+ "do": {
7
+ "emit": {
8
+ "channel": "wire",
9
+ "event": "turn.prompt",
10
+ "with": { "input": [{ "type": "text", "text": "$stimulus.text" }], "origin": { "kind": "user" } }
11
+ }
12
+ }
13
+ },
14
+ {
15
+ "at": 20,
16
+ "do": {
17
+ "emit": {
18
+ "channel": "wire",
19
+ "event": "context.append_loop_event",
20
+ "with": {
21
+ "event": {
22
+ "type": "tool.call",
23
+ "uuid": "$uuid:tool-event",
24
+ "turnId": "0",
25
+ "step": 1,
26
+ "stepUuid": "$uuid:step",
27
+ "toolCallId": "call-imposter",
28
+ "name": "Bash",
29
+ "args": { "command": "printf ok" }
30
+ }
31
+ }
32
+ }
33
+ }
34
+ },
35
+ {
36
+ "at": 40,
37
+ "do": {
38
+ "emit": {
39
+ "channel": "wire",
40
+ "event": "context.append_loop_event",
41
+ "with": {
42
+ "event": {
43
+ "type": "tool.result",
44
+ "parentUuid": "$uuid:tool-event",
45
+ "toolCallId": "call-imposter",
46
+ "result": { "output": "ok" }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ {
53
+ "at": 60,
54
+ "do": { "emit": { "channel": "wire", "event": "turn.ended", "with": { "turnId": 0, "reason": "completed" } } }
55
+ }
56
+ ]
57
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "unknown-record",
3
+ "steps": [
4
+ {
5
+ "at": 0,
6
+ "do": {
7
+ "emit": {
8
+ "channel": "wire",
9
+ "event": "future.record",
10
+ "with": { "future_field": "retained by the imposter log" }
11
+ }
12
+ }
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,32 @@
1
+ # OpenCode Imposter persona
2
+
3
+ This persona impersonates OpenCode 1.18.16 on its native loopback REST and SSE
4
+ surface. Native paths and operation ids live in `http-serve.json`; the shared
5
+ transport contains no OpenCode route names. All requests, successful results,
6
+ SSE properties, and complete `{id,type,properties}` carriers validate against
7
+ the Surface-owned ASM before delivery.
8
+
9
+ Start the backend with the same invocation shape as the real binary:
10
+
11
+ ```sh
12
+ OPENCODE_SERVER_PASSWORD='<secret>' \
13
+ ai --opencode serve --hostname 127.0.0.1 --port 0 --pure
14
+ ```
15
+
16
+ Readiness is the native `opencode server listening on http://…` stdout line.
17
+ The default username is `opencode`; setting no password disables authentication,
18
+ matching the upstream server. Durable HTTP state is stored below
19
+ `PUPPETEER_IMPOSTER_HOME` when that isolated root is supplied.
20
+
21
+ The shared viewer attaches to the exact existing session without creating a
22
+ second one:
23
+
24
+ ```sh
25
+ OPENCODE_SERVER_PASSWORD='<secret>' \
26
+ ai --opencode attach http://127.0.0.1:PORT \
27
+ --dir /workspace --session ses_ID --pure
28
+ ```
29
+
30
+ SSE reconnect intentionally replays nothing. The viewer and future adapter
31
+ rehydrate messages and session state through REST, reflecting the behavior of
32
+ the pinned native server rather than inventing a cursor.
@@ -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,18 @@
1
+ {
2
+ "name": "permission-turn",
3
+ "reply": "imposter: permission resolved",
4
+ "ops": [
5
+ { "op": "turn.start", "with": { "text": "$stimulus.text" } },
6
+ {
7
+ "op": "permission.ask",
8
+ "with": {
9
+ "permission": "bash",
10
+ "patterns": ["echo imposter"],
11
+ "metadata": { "command": "echo imposter" },
12
+ "always": ["echo *"]
13
+ }
14
+ },
15
+ { "op": "assistant.delta", "with": { "text": "$reply" } },
16
+ { "op": "turn.end" }
17
+ ]
18
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$server": {
3
+ "command": "serve",
4
+ "hostnameFlag": "--hostname",
5
+ "portFlag": "--port",
6
+ "defaultHostname": "127.0.0.1",
7
+ "defaultPort": 0,
8
+ "directoryQuery": "directory",
9
+ "directoryHeader": "x-opencode-directory",
10
+ "auth": {
11
+ "usernameEnv": "OPENCODE_SERVER_USERNAME",
12
+ "passwordEnv": "OPENCODE_SERVER_PASSWORD",
13
+ "defaultUsername": "opencode"
14
+ },
15
+ "attach": {
16
+ "command": "attach",
17
+ "sessionFlag": "--session",
18
+ "directoryFlag": "--dir"
19
+ }
20
+ },
21
+ "routes": [
22
+ { "event": "http/event.subscribe", "method": "GET", "path": "/event", "action": "event.subscribe" },
23
+ { "event": "http/session.create", "method": "POST", "path": "/session", "action": "session.create" },
24
+ { "event": "http/session.list", "method": "GET", "path": "/session", "action": "session.list" },
25
+ { "event": "http/session.status", "method": "GET", "path": "/session/status", "action": "session.status" },
26
+ { "event": "http/permission.list", "method": "GET", "path": "/permission", "action": "permission.list" },
27
+ { "event": "http/question.list", "method": "GET", "path": "/question", "action": "question.list" },
28
+ { "event": "http/vcs.diff", "method": "GET", "path": "/vcs/diff", "action": "vcs.diff" },
29
+ { "event": "http/session.get", "method": "GET", "path": "/session/:sessionID", "action": "session.get" },
30
+ { "event": "http/session.update", "method": "PATCH", "path": "/session/:sessionID", "action": "session.update" },
31
+ { "event": "http/session.delete", "method": "DELETE", "path": "/session/:sessionID", "action": "session.delete" },
32
+ {
33
+ "event": "http/session.messages",
34
+ "method": "GET",
35
+ "path": "/session/:sessionID/message",
36
+ "action": "session.messages"
37
+ },
38
+ {
39
+ "event": "http/session.prompt_async",
40
+ "method": "POST",
41
+ "path": "/session/:sessionID/prompt_async",
42
+ "action": "session.prompt"
43
+ },
44
+ { "event": "http/session.abort", "method": "POST", "path": "/session/:sessionID/abort", "action": "session.abort" },
45
+ {
46
+ "event": "http/session.children",
47
+ "method": "GET",
48
+ "path": "/session/:sessionID/children",
49
+ "action": "session.children"
50
+ },
51
+ { "event": "http/session.diff", "method": "GET", "path": "/session/:sessionID/diff", "action": "session.diff" },
52
+ { "event": "http/session.fork", "method": "POST", "path": "/session/:sessionID/fork", "action": "session.fork" },
53
+ {
54
+ "event": "http/permission.reply",
55
+ "method": "POST",
56
+ "path": "/permission/:requestID/reply",
57
+ "action": "permission.reply"
58
+ },
59
+ {
60
+ "event": "http/question.reply",
61
+ "method": "POST",
62
+ "path": "/question/:requestID/reply",
63
+ "action": "question.reply"
64
+ },
65
+ {
66
+ "event": "http/question.reject",
67
+ "method": "POST",
68
+ "path": "/question/:requestID/reject",
69
+ "action": "question.reject"
70
+ }
71
+ ]
72
+ }
@@ -0,0 +1,250 @@
1
+ {
2
+ "session.start": [
3
+ {
4
+ "channel": "sse",
5
+ "event": "session.created",
6
+ "with": {
7
+ "sessionID": "$sessionId",
8
+ "info": {
9
+ "id": "$sessionId",
10
+ "slug": "$sessionSlug",
11
+ "version": "$vendorVersion",
12
+ "projectID": "$projectId",
13
+ "directory": "$cwd",
14
+ "path": "$cwd",
15
+ "title": "$sessionTitle",
16
+ "model": "$sessionModel",
17
+ "permission": "$sessionPermission",
18
+ "cost": 0,
19
+ "tokens": {
20
+ "input": 0,
21
+ "output": 0,
22
+ "reasoning": 0,
23
+ "cache": {
24
+ "read": 0,
25
+ "write": 0
26
+ }
27
+ },
28
+ "time": {
29
+ "created": "$sessionCreatedAt",
30
+ "updated": "$sessionUpdatedAt"
31
+ }
32
+ }
33
+ }
34
+ }
35
+ ],
36
+ "turn.start": [
37
+ {
38
+ "channel": "sse",
39
+ "event": "message.updated",
40
+ "with": {
41
+ "sessionID": "$sessionId",
42
+ "info": {
43
+ "id": "$userMessageId",
44
+ "role": "user",
45
+ "sessionID": "$sessionId",
46
+ "time": {
47
+ "created": "$promptCreatedAt"
48
+ },
49
+ "agent": "$promptAgent",
50
+ "model": "$promptModel"
51
+ }
52
+ }
53
+ },
54
+ {
55
+ "channel": "sse",
56
+ "event": "message.part.updated",
57
+ "with": {
58
+ "sessionID": "$sessionId",
59
+ "part": {
60
+ "id": "$nativeId:prt:user-part",
61
+ "messageID": "$userMessageId",
62
+ "sessionID": "$sessionId",
63
+ "type": "text",
64
+ "text": "$op.text"
65
+ },
66
+ "time": "$promptCreatedAt"
67
+ }
68
+ },
69
+ {
70
+ "channel": "sse",
71
+ "event": "session.status",
72
+ "with": {
73
+ "sessionID": "$sessionId",
74
+ "status": {
75
+ "type": "busy"
76
+ }
77
+ }
78
+ },
79
+ {
80
+ "channel": "sse",
81
+ "event": "message.updated",
82
+ "with": {
83
+ "sessionID": "$sessionId",
84
+ "info": {
85
+ "id": "$nativeId:msg:assistant-message",
86
+ "parentID": "$userMessageId",
87
+ "role": "assistant",
88
+ "mode": "build",
89
+ "agent": "$promptAgent",
90
+ "path": {
91
+ "cwd": "$cwd",
92
+ "root": "$cwd"
93
+ },
94
+ "cost": 0,
95
+ "tokens": {
96
+ "input": 0,
97
+ "output": 0,
98
+ "reasoning": 0,
99
+ "cache": {
100
+ "read": 0,
101
+ "write": 0
102
+ }
103
+ },
104
+ "modelID": "$modelId",
105
+ "providerID": "imposter",
106
+ "time": {
107
+ "created": "$promptCreatedAt"
108
+ },
109
+ "sessionID": "$sessionId"
110
+ }
111
+ }
112
+ },
113
+ {
114
+ "channel": "sse",
115
+ "event": "message.part.updated",
116
+ "with": {
117
+ "sessionID": "$sessionId",
118
+ "part": {
119
+ "id": "$nativeId:prt:step-start",
120
+ "messageID": "$nativeId:msg:assistant-message",
121
+ "sessionID": "$sessionId",
122
+ "type": "step-start"
123
+ },
124
+ "time": "$nowMs"
125
+ }
126
+ }
127
+ ],
128
+ "assistant.delta": [
129
+ {
130
+ "channel": "sse",
131
+ "event": "message.part.updated",
132
+ "with": {
133
+ "sessionID": "$sessionId",
134
+ "part": {
135
+ "id": "$nativeId:prt:assistant-part",
136
+ "messageID": "$nativeId:msg:assistant-message",
137
+ "sessionID": "$sessionId",
138
+ "type": "text",
139
+ "text": "$op.text",
140
+ "time": {
141
+ "start": "$promptCreatedAt",
142
+ "end": "$nowMs"
143
+ }
144
+ },
145
+ "time": "$nowMs"
146
+ }
147
+ }
148
+ ],
149
+ "permission.ask": [
150
+ {
151
+ "channel": "sse",
152
+ "event": "permission.asked",
153
+ "await": true,
154
+ "with": {
155
+ "id": "$nativeId:per:permission",
156
+ "sessionID": "$sessionId",
157
+ "permission": "$op.permission",
158
+ "patterns": "$op.patterns",
159
+ "metadata": "$op.metadata",
160
+ "always": "$op.always",
161
+ "tool": {
162
+ "messageID": "$nativeId:msg:assistant-message",
163
+ "callID": "$uuid:tool-call"
164
+ }
165
+ }
166
+ }
167
+ ],
168
+ "turn.end": [
169
+ {
170
+ "channel": "sse",
171
+ "event": "message.part.updated",
172
+ "with": {
173
+ "sessionID": "$sessionId",
174
+ "part": {
175
+ "id": "$nativeId:prt:step-finish",
176
+ "messageID": "$nativeId:msg:assistant-message",
177
+ "sessionID": "$sessionId",
178
+ "type": "step-finish",
179
+ "reason": "stop",
180
+ "cost": 0,
181
+ "tokens": {
182
+ "total": 18,
183
+ "input": 11,
184
+ "output": 7,
185
+ "reasoning": 0,
186
+ "cache": {
187
+ "read": 0,
188
+ "write": 0
189
+ }
190
+ }
191
+ },
192
+ "time": "$nowMs"
193
+ }
194
+ },
195
+ {
196
+ "channel": "sse",
197
+ "event": "message.updated",
198
+ "with": {
199
+ "sessionID": "$sessionId",
200
+ "info": {
201
+ "id": "$nativeId:msg:assistant-message",
202
+ "parentID": "$userMessageId",
203
+ "role": "assistant",
204
+ "mode": "build",
205
+ "agent": "$promptAgent",
206
+ "path": {
207
+ "cwd": "$cwd",
208
+ "root": "$cwd"
209
+ },
210
+ "cost": 0,
211
+ "tokens": {
212
+ "total": 18,
213
+ "input": 11,
214
+ "output": 7,
215
+ "reasoning": 0,
216
+ "cache": {
217
+ "read": 0,
218
+ "write": 0
219
+ }
220
+ },
221
+ "modelID": "$modelId",
222
+ "providerID": "imposter",
223
+ "time": {
224
+ "created": "$promptCreatedAt",
225
+ "completed": "$nowMs"
226
+ },
227
+ "sessionID": "$sessionId",
228
+ "finish": "stop"
229
+ }
230
+ }
231
+ },
232
+ {
233
+ "channel": "sse",
234
+ "event": "session.status",
235
+ "with": {
236
+ "sessionID": "$sessionId",
237
+ "status": {
238
+ "type": "idle"
239
+ }
240
+ }
241
+ },
242
+ {
243
+ "channel": "sse",
244
+ "event": "session.idle",
245
+ "with": {
246
+ "sessionID": "$sessionId"
247
+ }
248
+ }
249
+ ]
250
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "vendor": "opencode",
3
+ "asm": {
4
+ "package": "@vibefield/puppeteer-surface",
5
+ "path": "vendors/opencode"
6
+ },
7
+ "shimNames": ["opencode"],
8
+ "envelope": {},
9
+ "sessionIdTemplate": "$nativeId:ses:session",
10
+ "bindings": {
11
+ "$projectId": "imposter-project",
12
+ "$sessionSlug": "$uuid:session-slug",
13
+ "$sessionModel": { "id": "opencode-imposter", "providerID": "imposter" },
14
+ "$sessionPermission": [{ "permission": "*", "pattern": "*", "action": "allow" }],
15
+ "$sessionCreatedAt": "$nowMs",
16
+ "$sessionUpdatedAt": "$nowMs",
17
+ "$promptCreatedAt": "$nowMs",
18
+ "$promptAgent": "build",
19
+ "$promptModel": { "providerID": "imposter", "modelID": "opencode-imposter" }
20
+ },
21
+ "boot": [{ "op": "session.start" }, { "op": "session.ready" }]
22
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "version": 1,
3
+ "flows": [
4
+ {
5
+ "id": "happy-turn",
6
+ "intent": "turn.basic",
7
+ "scenario": "happy-turn",
8
+ "title": "Happy turn",
9
+ "summary": "Busy, assistant message and part, then durable idle.",
10
+ "kind": "typical"
11
+ },
12
+ {
13
+ "id": "permission-allow",
14
+ "intent": "blocker.permission.allow",
15
+ "scenario": "permission-allow",
16
+ "title": "Permission allow",
17
+ "summary": "SSE permission request resolved by a later HTTP decision.",
18
+ "kind": "lifecycle"
19
+ },
20
+ {
21
+ "id": "question-reply",
22
+ "intent": "blocker.question.reply",
23
+ "scenario": "question-reply",
24
+ "title": "Question reply",
25
+ "summary": "Structured native question resolved with nested answer arrays.",
26
+ "kind": "lifecycle"
27
+ },
28
+ {
29
+ "id": "reconnect",
30
+ "intent": "transport.reconnect",
31
+ "scenario": "reconnect",
32
+ "title": "SSE reconnect",
33
+ "summary": "A replacement stream connects without fabricating history replay.",
34
+ "kind": "adversarial"
35
+ },
36
+ {
37
+ "id": "out-of-order",
38
+ "intent": "transport.out-of-order",
39
+ "scenario": "out-of-order",
40
+ "title": "Part before message",
41
+ "summary": "A message part arrives before the durable owner message.",
42
+ "kind": "adversarial"
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "duplicate-event",
3
+ "steps": [
4
+ {
5
+ "emit": {
6
+ "event": "session.status",
7
+ "with": {
8
+ "sessionID": "$sessionId",
9
+ "status": {
10
+ "type": "busy"
11
+ }
12
+ }
13
+ }
14
+ },
15
+ {
16
+ "emit": {
17
+ "event": "session.status",
18
+ "with": {
19
+ "sessionID": "$sessionId",
20
+ "status": {
21
+ "type": "busy"
22
+ }
23
+ }
24
+ }
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "failure",
3
+ "steps": [
4
+ {
5
+ "emit": {
6
+ "event": "session.error",
7
+ "with": {
8
+ "sessionID": "$sessionId",
9
+ "error": {
10
+ "name": "UnknownError",
11
+ "data": {
12
+ "message": "controlled imposter failure"
13
+ }
14
+ }
15
+ }
16
+ }
17
+ },
18
+ {
19
+ "emit": {
20
+ "event": "session.status",
21
+ "with": {
22
+ "sessionID": "$sessionId",
23
+ "status": {
24
+ "type": "idle"
25
+ }
26
+ }
27
+ }
28
+ }
29
+ ]
30
+ }
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "happy-turn",
3
+ "steps": [
4
+ {
5
+ "emit": {
6
+ "event": "session.status",
7
+ "with": {
8
+ "sessionID": "$sessionId",
9
+ "status": {
10
+ "type": "busy"
11
+ }
12
+ }
13
+ }
14
+ },
15
+ {
16
+ "emit": {
17
+ "event": "message.updated",
18
+ "with": {
19
+ "sessionID": "$sessionId",
20
+ "info": {
21
+ "id": "$nativeId:msg:assistant",
22
+ "parentID": "$nativeId:msg:user",
23
+ "role": "assistant",
24
+ "mode": "build",
25
+ "agent": "build",
26
+ "path": {
27
+ "cwd": "$cwd",
28
+ "root": "$cwd"
29
+ },
30
+ "cost": 0,
31
+ "tokens": {
32
+ "input": 0,
33
+ "output": 0,
34
+ "reasoning": 0,
35
+ "cache": {
36
+ "read": 0,
37
+ "write": 0
38
+ }
39
+ },
40
+ "modelID": "opencode-imposter",
41
+ "providerID": "imposter",
42
+ "time": {
43
+ "created": "$nowMs"
44
+ },
45
+ "sessionID": "$sessionId"
46
+ }
47
+ }
48
+ }
49
+ },
50
+ {
51
+ "emit": {
52
+ "event": "message.part.updated",
53
+ "with": {
54
+ "sessionID": "$sessionId",
55
+ "part": {
56
+ "id": "$nativeId:prt:text",
57
+ "messageID": "$nativeId:msg:assistant",
58
+ "sessionID": "$sessionId",
59
+ "type": "text",
60
+ "text": "imposter: ok"
61
+ },
62
+ "time": "$nowMs"
63
+ }
64
+ }
65
+ },
66
+ {
67
+ "emit": {
68
+ "event": "session.status",
69
+ "with": {
70
+ "sessionID": "$sessionId",
71
+ "status": {
72
+ "type": "idle"
73
+ }
74
+ }
75
+ }
76
+ },
77
+ {
78
+ "emit": {
79
+ "event": "session.idle",
80
+ "with": {
81
+ "sessionID": "$sessionId"
82
+ }
83
+ }
84
+ }
85
+ ]
86
+ }