@blackbelt-technology/pi-dashboard-extension 0.7.0 → 0.9.0

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 (265) hide show
  1. package/.pi/skills/browser/SKILL.md +84 -29
  2. package/.pi/skills/browser/UPSTREAM.md +13 -1
  3. package/.pi/skills/browser/references/challenge.md +183 -0
  4. package/.pi/skills/browser/references/dashboard-relay.md +150 -0
  5. package/.pi/skills/browser/references/electron.agent.md +57 -0
  6. package/.pi/skills/browser/references/own-browser.md +305 -0
  7. package/.pi/skills/browser/references/web.agent.md +323 -0
  8. package/.pi/skills/browser/scripts/check-panerelay.sh +157 -0
  9. package/.pi/skills/doctor/SKILL.md +4 -9
  10. package/.pi/skills/doctor/_lib/checks.ts +133 -54
  11. package/.pi/skills/doctor/_lib/derive-tokens.ts +5 -0
  12. package/.pi/skills/doctor/modules/apple-tools.knowledge.hash +1 -0
  13. package/.pi/skills/doctor/modules/apple-tools.md +52 -0
  14. package/.pi/skills/doctor/modules/mcp-builtin.knowledge.hash +1 -0
  15. package/.pi/skills/doctor/modules/mcp-builtin.md +61 -0
  16. package/.pi/skills/doctor/modules/oauth-redirect-base.knowledge.hash +1 -0
  17. package/.pi/skills/doctor/modules/oauth-redirect-base.md +71 -0
  18. package/.pi/skills/doctor/modules/pi-resolution.knowledge.hash +1 -1
  19. package/.pi/skills/doctor/modules/pi-resolution.md +21 -1
  20. package/.pi/skills/doctor/modules/plugins-bridges.md +14 -1
  21. package/.pi/skills/pi-dashboard/SKILL.md +10 -3
  22. package/.pi/skills/pi-dashboard/references/api-reference.agent.md +69 -0
  23. package/.pi/skills/pi-dashboard/scripts/dashboard-bus.ts +4 -4
  24. package/.pi/skills/project-init/SKILL.md +41 -34
  25. package/.pi/skills/project-init/profiles/coding/AGENTS.md.tmpl +0 -23
  26. package/.pi/skills/project-init/profiles/docs/profile.json +1 -1
  27. package/README.md +19 -0
  28. package/agents/DoxTriage.md +80 -0
  29. package/package.json +30 -16
  30. package/src/ask-user-tool.ts +4 -0
  31. package/src/auto-session-namer.ts +486 -70
  32. package/src/autostart-guard.ts +99 -0
  33. package/src/autostart-lock.ts +258 -0
  34. package/src/bridge-activation.ts +26 -0
  35. package/src/bridge-context.ts +106 -23
  36. package/src/bridge-default-model-gate.ts +38 -0
  37. package/src/bridge-polling.ts +148 -0
  38. package/src/bridge-ticket-client.ts +105 -0
  39. package/src/bridge.ts +1760 -350
  40. package/src/canvas-tool.ts +5 -0
  41. package/src/command-handler.ts +392 -71
  42. package/src/connect-target.ts +130 -0
  43. package/src/connection.ts +846 -17
  44. package/src/custom-entry-forward.ts +92 -0
  45. package/src/endpoint-resolution.ts +253 -0
  46. package/src/event-forwarder.ts +42 -0
  47. package/src/extension-identity.ts +59 -0
  48. package/src/flow-event-wiring.ts +125 -3
  49. package/src/followup-buffer.ts +217 -0
  50. package/src/git-dir-watcher.ts +79 -0
  51. package/src/git-poll.ts +45 -12
  52. package/src/git-probe-scheduler.ts +119 -0
  53. package/src/git-tracker.ts +284 -0
  54. package/src/instance-verification.ts +156 -0
  55. package/src/local-token-header.ts +44 -0
  56. package/src/mcp-token-delivery.ts +147 -0
  57. package/src/message-update-coalescer.ts +340 -0
  58. package/src/model-refresh.ts +95 -0
  59. package/src/model-tracker.ts +118 -35
  60. package/src/notify-proxy.ts +36 -0
  61. package/src/path-gate/decide.ts +149 -0
  62. package/src/path-gate/grant-cache.ts +71 -0
  63. package/src/path-gate/grant-link.ts +108 -0
  64. package/src/path-gate/handler.ts +307 -0
  65. package/src/path-gate/index.ts +155 -0
  66. package/src/path-gate/resolve.ts +126 -0
  67. package/src/path-gate/roots.ts +137 -0
  68. package/src/path-gate/suppression.ts +27 -0
  69. package/src/pending-prompt-emitter.ts +59 -0
  70. package/src/pi-env.d.ts +6 -10
  71. package/src/pi-retry-settings.ts +91 -0
  72. package/src/plugin-request-client.ts +114 -0
  73. package/src/poll-cost.ts +40 -0
  74. package/src/pr-status.ts +338 -0
  75. package/src/process-metrics.ts +77 -1
  76. package/src/process-scan-scheduler.ts +137 -0
  77. package/src/process-scanner.ts +226 -247
  78. package/src/project-init/dox-kb-config.ts +3 -0
  79. package/src/project-init/scaffold.ts +1 -4
  80. package/src/project-init/seed-doctrine.ts +23 -60
  81. package/src/prompt-bus.ts +13 -0
  82. package/src/provider-register.ts +92 -21
  83. package/src/remote-registration-gate.ts +102 -0
  84. package/src/retry-tracker.ts +258 -86
  85. package/src/role-manager.ts +38 -91
  86. package/src/role-model-tools.ts +44 -3
  87. package/src/server-auto-start.ts +331 -20
  88. package/src/server-launcher.ts +70 -34
  89. package/src/server-pin-store.ts +92 -0
  90. package/src/session-move.ts +275 -0
  91. package/src/session-sync.ts +75 -20
  92. package/src/slash-dispatch.ts +66 -81
  93. package/src/subagent-fanout-admission.ts +234 -0
  94. package/src/subagent-forward-sites.ts +69 -0
  95. package/src/subagent-frame-buffer.ts +24 -3
  96. package/src/subagent-frame-strip.ts +109 -0
  97. package/src/subagent-saturation.ts +196 -0
  98. package/src/subagent-tick-throttle.ts +250 -0
  99. package/src/terminal-reload.ts +298 -0
  100. package/src/transcript-backfill.ts +151 -0
  101. package/src/transport-diagnostics.ts +76 -0
  102. package/src/tui-prompt-adapter.ts +13 -1
  103. package/src/turn-actionability.ts +20 -0
  104. package/src/ui-stale-guard.ts +58 -0
  105. package/src/usage-drain.ts +167 -0
  106. package/src/vcs-info.ts +261 -63
  107. package/.pi/skills/doctor/AGENTS.md +0 -27
  108. package/.pi/skills/project-init/dox-doctrine.md +0 -104
  109. package/src/AGENTS.md +0 -57
  110. package/src/__tests__/abort-latch.test.ts +0 -97
  111. package/src/__tests__/agent-settled.test.ts +0 -82
  112. package/src/__tests__/artifact-roots.test.ts +0 -83
  113. package/src/__tests__/ask-user-attachments.test.ts +0 -106
  114. package/src/__tests__/ask-user-schema-discriminator.test.ts +0 -141
  115. package/src/__tests__/ask-user-tool.test.ts +0 -571
  116. package/src/__tests__/auto-session-namer.test.ts +0 -339
  117. package/src/__tests__/bridge-default-model-apply.test.ts +0 -242
  118. package/src/__tests__/bridge-default-model-gate.test.ts +0 -50
  119. package/src/__tests__/bridge-entry-id-pi-070.test.ts +0 -174
  120. package/src/__tests__/bridge-followup-chat-order.test.ts +0 -215
  121. package/src/__tests__/bridge-followup-multi-entry.test.ts +0 -202
  122. package/src/__tests__/bridge-followup-mutation.test.ts +0 -217
  123. package/src/__tests__/bridge-followup-queue-drain.test.ts +0 -266
  124. package/src/__tests__/bridge-hasui-flip.test.ts +0 -109
  125. package/src/__tests__/bridge-no-queue-mutation.test.ts +0 -112
  126. package/src/__tests__/bridge-plugin-emit-event.test.ts +0 -44
  127. package/src/__tests__/bridge-queue-update-forward.test.ts +0 -77
  128. package/src/__tests__/bridge-resume-disconnect.test.ts +0 -333
  129. package/src/__tests__/bridge-shadow-queue-gate.test.ts +0 -299
  130. package/src/__tests__/bridge-shutdown-reset.test.ts +0 -159
  131. package/src/__tests__/bridge-slash-command-routing.test.ts +0 -458
  132. package/src/__tests__/bridge-stop-after-turn.test.ts +0 -72
  133. package/src/__tests__/bridge-system-followup.test.ts +0 -163
  134. package/src/__tests__/bridge-thinking-level-select.test.ts +0 -68
  135. package/src/__tests__/browser-skill-registered.test.ts +0 -84
  136. package/src/__tests__/build-provider-catalogue.test.ts +0 -210
  137. package/src/__tests__/command-handler.test.ts +0 -1180
  138. package/src/__tests__/commit-draft.test.ts +0 -100
  139. package/src/__tests__/connection-dropped-frames.test.ts +0 -78
  140. package/src/__tests__/connection-suppress-auto-start.test.ts +0 -97
  141. package/src/__tests__/connection.test.ts +0 -344
  142. package/src/__tests__/credentials-updated.test.ts +0 -26
  143. package/src/__tests__/custom-provider-apikey-roundtrip.test.ts +0 -128
  144. package/src/__tests__/cwd-missing-probe.test.ts +0 -82
  145. package/src/__tests__/dashboard-commands-shipped.test.ts +0 -53
  146. package/src/__tests__/dashboard-context-injector.test.ts +0 -190
  147. package/src/__tests__/dashboard-default-adapter.test.ts +0 -77
  148. package/src/__tests__/dev-build.test.ts +0 -79
  149. package/src/__tests__/doctor/checks.test.ts +0 -121
  150. package/src/__tests__/doctor/modules.test.ts +0 -64
  151. package/src/__tests__/doctor/provenance-hash.test.ts +0 -94
  152. package/src/__tests__/doctor/router.test.ts +0 -143
  153. package/src/__tests__/empty-actionable-guard-config.test.ts +0 -32
  154. package/src/__tests__/empty-actionable-guard.test.ts +0 -73
  155. package/src/__tests__/enrich-model-metadata.test.ts +0 -222
  156. package/src/__tests__/event-forwarder.test.ts +0 -119
  157. package/src/__tests__/extension-slash-command-detection.test.ts +0 -143
  158. package/src/__tests__/filter-enabled-models.test.ts +0 -151
  159. package/src/__tests__/fixtures/turn-actionability-fixtures.ts +0 -69
  160. package/src/__tests__/fork-entryid-timing.test.ts +0 -88
  161. package/src/__tests__/git-info-status.test.ts +0 -73
  162. package/src/__tests__/git-link-builder.test.ts +0 -102
  163. package/src/__tests__/git-poll.test.ts +0 -69
  164. package/src/__tests__/markdown-image-inliner.test.ts +0 -392
  165. package/src/__tests__/model-resolve.test.ts +0 -379
  166. package/src/__tests__/multiselect-dashboard-routing.test.ts +0 -203
  167. package/src/__tests__/multiselect-list.test.ts +0 -137
  168. package/src/__tests__/multiselect-polyfill.test.ts +0 -92
  169. package/src/__tests__/no-session-replacement-calls.test.ts +0 -99
  170. package/src/__tests__/no-tui-multiselect-arm-regression.test.ts +0 -81
  171. package/src/__tests__/openspec-activity-detector.test.ts +0 -337
  172. package/src/__tests__/openspec-cli-shim.test.ts +0 -145
  173. package/src/__tests__/openspec-poller.test.ts +0 -124
  174. package/src/__tests__/pi-version-tracker.test.ts +0 -109
  175. package/src/__tests__/process-metrics.test.ts +0 -47
  176. package/src/__tests__/process-scanner-kill.test.ts +0 -61
  177. package/src/__tests__/process-scanner.test.ts +0 -292
  178. package/src/__tests__/project-init-detect-stack.test.ts +0 -61
  179. package/src/__tests__/project-init-dox-kb-config.test.ts +0 -53
  180. package/src/__tests__/project-init-profiles.test.ts +0 -84
  181. package/src/__tests__/project-init-scaffold.test.ts +0 -139
  182. package/src/__tests__/project-init-seed-doctrine.test.ts +0 -100
  183. package/src/__tests__/project-trust.test.ts +0 -92
  184. package/src/__tests__/prompt-bus-wiring.test.ts +0 -791
  185. package/src/__tests__/prompt-bus.test.ts +0 -513
  186. package/src/__tests__/prompt-expander.test.ts +0 -398
  187. package/src/__tests__/provider-register-native-models.test.ts +0 -182
  188. package/src/__tests__/provider-register-reload.test.ts +0 -498
  189. package/src/__tests__/provider-register-thinking-levels.test.ts +0 -104
  190. package/src/__tests__/retry-tracker.test.ts +0 -152
  191. package/src/__tests__/role-manager.test.ts +0 -585
  192. package/src/__tests__/role-model-tools-registry-readiness.test.ts +0 -114
  193. package/src/__tests__/role-model-tools.test.ts +0 -229
  194. package/src/__tests__/search-files-completeness.test.ts +0 -111
  195. package/src/__tests__/search-files-ranking.test.ts +0 -168
  196. package/src/__tests__/server-auto-start.test.ts +0 -375
  197. package/src/__tests__/server-launcher-launch.test.ts +0 -96
  198. package/src/__tests__/server-launcher.test.ts +0 -101
  199. package/src/__tests__/server-probe.test.ts +0 -25
  200. package/src/__tests__/session-switch.test.ts +0 -139
  201. package/src/__tests__/session-sync.test.ts +0 -243
  202. package/src/__tests__/single-derivation-guard.test.ts +0 -39
  203. package/src/__tests__/source-detector.test.ts +0 -88
  204. package/src/__tests__/stats-extractor.test.ts +0 -92
  205. package/src/__tests__/subagent-frame-buffer.test.ts +0 -239
  206. package/src/__tests__/tool-result-image-inliner.test.ts +0 -206
  207. package/src/__tests__/tui-prompt-adapter.test.ts +0 -213
  208. package/src/__tests__/turn-actionability.test.ts +0 -86
  209. package/src/__tests__/ui-decorators.test.ts +0 -309
  210. package/src/__tests__/ui-modules.test.ts +0 -293
  211. package/src/__tests__/vcs-info.test.ts +0 -265
  212. package/src/__tests__/visibility-intent.test.ts +0 -43
  213. package/src/__tests__/watchdog.test.ts +0 -161
  214. package/src/abort-latch.ts.AGENTS.md +0 -3
  215. package/src/agent-settled.ts +0 -72
  216. package/src/agent-settled.ts.AGENTS.md +0 -3
  217. package/src/artifact-roots.ts.AGENTS.md +0 -3
  218. package/src/ask-user-attachments.ts.AGENTS.md +0 -3
  219. package/src/ask-user-tool.ts.AGENTS.md +0 -3
  220. package/src/auto-session-namer.ts.AGENTS.md +0 -3
  221. package/src/bridge-context.ts.AGENTS.md +0 -3
  222. package/src/bridge-default-model-gate.ts.AGENTS.md +0 -3
  223. package/src/bridge.ts.AGENTS.md +0 -3
  224. package/src/command-handler.ts.AGENTS.md +0 -3
  225. package/src/commit-draft-agent.ts.AGENTS.md +0 -3
  226. package/src/commit-draft.ts.AGENTS.md +0 -3
  227. package/src/connection.ts.AGENTS.md +0 -3
  228. package/src/dashboard-context-injector.ts.AGENTS.md +0 -3
  229. package/src/dashboard-default-adapter.ts.AGENTS.md +0 -3
  230. package/src/dev-build.ts.AGENTS.md +0 -3
  231. package/src/empty-actionable-guard-config.ts.AGENTS.md +0 -3
  232. package/src/empty-actionable-guard.ts.AGENTS.md +0 -3
  233. package/src/event-forwarder.ts.AGENTS.md +0 -3
  234. package/src/flow-event-wiring.ts.AGENTS.md +0 -3
  235. package/src/git-link-builder.ts.AGENTS.md +0 -3
  236. package/src/git-poll.ts.AGENTS.md +0 -3
  237. package/src/hasui-flip.ts.AGENTS.md +0 -3
  238. package/src/markdown-image-inliner.ts.AGENTS.md +0 -3
  239. package/src/model-tracker.ts.AGENTS.md +0 -3
  240. package/src/multiselect-decode.ts.AGENTS.md +0 -3
  241. package/src/multiselect-list.ts.AGENTS.md +0 -3
  242. package/src/multiselect-polyfill.ts.AGENTS.md +0 -3
  243. package/src/openspec-cli-shim.ts.AGENTS.md +0 -7
  244. package/src/process-metrics.ts.AGENTS.md +0 -3
  245. package/src/process-scanner.ts.AGENTS.md +0 -3
  246. package/src/project-init/AGENTS.md +0 -12
  247. package/src/project-trust.ts.AGENTS.md +0 -3
  248. package/src/prompt-bus.ts.AGENTS.md +0 -3
  249. package/src/prompt-expander.ts.AGENTS.md +0 -3
  250. package/src/provider-register.ts.AGENTS.md +0 -3
  251. package/src/retry-tracker.ts.AGENTS.md +0 -3
  252. package/src/role-manager.ts.AGENTS.md +0 -3
  253. package/src/role-model-tools.ts.AGENTS.md +0 -3
  254. package/src/server-auto-start.ts.AGENTS.md +0 -3
  255. package/src/server-launcher.ts.AGENTS.md +0 -3
  256. package/src/session-sync.ts.AGENTS.md +0 -3
  257. package/src/slash-dispatch.ts.AGENTS.md +0 -3
  258. package/src/source-detector.ts.AGENTS.md +0 -3
  259. package/src/subagent-frame-buffer.ts.AGENTS.md +0 -3
  260. package/src/tool-result-image-inliner.ts.AGENTS.md +0 -3
  261. package/src/tui-prompt-adapter.ts.AGENTS.md +0 -3
  262. package/src/turn-actionability.ts.AGENTS.md +0 -3
  263. package/src/ui-modules.ts.AGENTS.md +0 -3
  264. package/src/vcs-info.ts.AGENTS.md +0 -3
  265. package/src/visibility-intent.ts.AGENTS.md +0 -3
@@ -1,239 +0,0 @@
1
- /**
2
- * SubagentFrameBuffer — D1 buffer-and-flush + D2 resync unit coverage.
3
- * See change: fix-subagent-live-detail-reliability (tasks 4.3, 5.4).
4
- */
5
- import { describe, expect, it } from "vitest";
6
- import { SubagentFrameBuffer } from "../subagent-frame-buffer.js";
7
-
8
- function frame(id: string, entries: unknown[] = []) {
9
- return { id, type: "Explore", description: "", details: { entries } };
10
- }
11
-
12
- /** A frame whose details carry the producer's v7 runner `agentSessionId`. */
13
- function frameWithSession(id: string, agentSessionId: string, entries: unknown[] = []) {
14
- return { id, type: "Explore", description: "", details: { entries, agentSessionId } };
15
- }
16
-
17
- describe("SubagentFrameBuffer — channel classification", () => {
18
- it("recognizes subagent channels only", () => {
19
- expect(SubagentFrameBuffer.isSubagentChannel("subagents:started")).toBe(true);
20
- expect(SubagentFrameBuffer.isSubagentChannel("subagents:completed")).toBe(true);
21
- expect(SubagentFrameBuffer.isSubagentChannel("flow:agent-started")).toBe(false);
22
- expect(SubagentFrameBuffer.isSubagentChannel("some:custom")).toBe(false);
23
- });
24
-
25
- it("extracts agentId from data.id", () => {
26
- expect(SubagentFrameBuffer.agentIdOf({ id: "abc" })).toBe("abc");
27
- expect(SubagentFrameBuffer.agentIdOf({})).toBeUndefined();
28
- expect(SubagentFrameBuffer.agentIdOf(undefined)).toBeUndefined();
29
- });
30
- });
31
-
32
- describe("D1 — buffer while not ready, flush on re-register", () => {
33
- it("retains a not-ready frame and returns it on drain (emission order)", () => {
34
- const buf = new SubagentFrameBuffer();
35
- buf.buffer("subagents:started", frame("a"));
36
- buf.buffer("subagents:started", frame("b"));
37
- const drained = buf.drain();
38
- expect(drained.map((f) => f.data.id)).toEqual(["a", "b"]);
39
- expect(buf.stats.buffered).toBe(2);
40
- expect(buf.stats.flushed).toBe(2);
41
- // Buffer is empty after drain.
42
- expect(buf.pendingSize).toBe(0);
43
- expect(buf.drain()).toEqual([]);
44
- });
45
-
46
- it("keeps the latest snapshot per agentId (same agent, buffer pressure)", () => {
47
- const buf = new SubagentFrameBuffer();
48
- buf.buffer("subagents:started", frame("a", [1]));
49
- buf.buffer("subagents:started", frame("a", [1, 2]));
50
- buf.buffer("subagents:started", frame("a", [1, 2, 3]));
51
- const drained = buf.drain();
52
- expect(drained).toHaveLength(1);
53
- expect((drained[0]!.data.details as { entries: unknown[] }).entries).toEqual([1, 2, 3]);
54
- });
55
-
56
- it("bounds the buffer to maxAgents, dropping the oldest agent", () => {
57
- const buf = new SubagentFrameBuffer(2);
58
- buf.buffer("subagents:started", frame("a"));
59
- buf.buffer("subagents:started", frame("b"));
60
- buf.buffer("subagents:started", frame("c")); // evicts "a"
61
- const ids = buf.drain().map((f) => f.data.id);
62
- expect(ids).toEqual(["b", "c"]);
63
- });
64
-
65
- it("re-inserting an agent moves it to the most-recent position", () => {
66
- const buf = new SubagentFrameBuffer(2);
67
- buf.buffer("subagents:started", frame("a"));
68
- buf.buffer("subagents:started", frame("b"));
69
- buf.buffer("subagents:started", frame("a", [1])); // a → most recent
70
- buf.buffer("subagents:started", frame("c")); // evicts "b" (now oldest)
71
- const ids = buf.drain().map((f) => f.data.id);
72
- expect(ids).toEqual(["a", "c"]);
73
- });
74
-
75
- it("counts capacity evictions in stats.overflowEvicted", () => {
76
- const buf = new SubagentFrameBuffer(2);
77
- buf.buffer("subagents:started", frame("a"));
78
- buf.buffer("subagents:started", frame("b"));
79
- buf.buffer("subagents:started", frame("c")); // evicts "a" from pending + snapshots
80
- // One eviction from pending + one from snapshots for the same overflow.
81
- expect(buf.stats.overflowEvicted).toBe(2);
82
- });
83
-
84
- it("cannot buffer a frame without an agentId (counts as dropped)", () => {
85
- const buf = new SubagentFrameBuffer();
86
- expect(buf.buffer("subagents:started", { details: {} })).toBe(false);
87
- expect(buf.stats.droppedNoAgentId).toBe(1);
88
- expect(buf.pendingSize).toBe(0);
89
- });
90
-
91
- it("markForwarded counts the ready path without buffering", () => {
92
- const buf = new SubagentFrameBuffer();
93
- buf.markForwarded("subagents:started", frame("a", [1]));
94
- expect(buf.stats.forwarded).toBe(1);
95
- expect(buf.pendingSize).toBe(0);
96
- });
97
- });
98
-
99
- describe("D2 — resync responder", () => {
100
- it("returns the latest snapshot for a running subagent", () => {
101
- const buf = new SubagentFrameBuffer();
102
- buf.markForwarded("subagents:started", frame("a", [1]));
103
- buf.markForwarded("subagents:started", frame("a", [1, 2]));
104
- const snap = buf.resync("a");
105
- expect(snap).toBeDefined();
106
- expect((snap!.data.details as { entries: unknown[] }).entries).toEqual([1, 2]);
107
- expect(buf.stats.resyncServed).toBe(1);
108
- });
109
-
110
- it("resync tracks buffered (not-ready) frames too", () => {
111
- const buf = new SubagentFrameBuffer();
112
- buf.buffer("subagents:started", frame("a", [1, 2, 3]));
113
- const snap = buf.resync("a");
114
- expect((snap!.data.details as { entries: unknown[] }).entries).toEqual([1, 2, 3]);
115
- });
116
-
117
- it("no-op for an unknown agent", () => {
118
- const buf = new SubagentFrameBuffer();
119
- expect(buf.resync("nope")).toBeUndefined();
120
- expect(buf.stats.resyncNoop).toBe(1);
121
- expect(buf.stats.resyncServed).toBe(0);
122
- });
123
-
124
- it("no-op for a finished (completed/failed) agent", () => {
125
- const buf = new SubagentFrameBuffer();
126
- buf.markForwarded("subagents:started", frame("a", [1]));
127
- buf.markForwarded("subagents:completed", frame("a", [1, 2]));
128
- expect(buf.resync("a")).toBeUndefined();
129
- expect(buf.stats.resyncNoop).toBe(1);
130
- });
131
-
132
- it("bounds retained snapshots to maxAgents (drop-oldest), keeping newest", () => {
133
- const buf = new SubagentFrameBuffer(2);
134
- // Three running agents forwarded live → snapshots must not exceed 2.
135
- buf.markForwarded("subagents:started", frame("a", [1]));
136
- buf.markForwarded("subagents:started", frame("b", [1]));
137
- buf.markForwarded("subagents:started", frame("c", [1])); // evicts oldest "a"
138
- expect(buf.resync("a")).toBeUndefined(); // oldest evicted
139
- expect(buf.resync("b")).toBeDefined();
140
- expect(buf.resync("c")).toBeDefined();
141
- });
142
- });
143
-
144
- describe("D3 — resync resolves by either id (agentId or derived agentSessionId)", () => {
145
- it("agentSessionIdOf reads details.agentSessionId (undefined when absent)", () => {
146
- expect(SubagentFrameBuffer.agentSessionIdOf({ details: { agentSessionId: "S" } })).toBe("S");
147
- expect(SubagentFrameBuffer.agentSessionIdOf({ details: {} })).toBeUndefined();
148
- expect(SubagentFrameBuffer.agentSessionIdOf({})).toBeUndefined();
149
- expect(SubagentFrameBuffer.agentSessionIdOf(undefined)).toBeUndefined();
150
- });
151
-
152
- // X2: retained running snapshot for A with details.agentSessionId=S →
153
- // resync(S) returns it via the values-scan; resync(A) via the fast path.
154
- it("resolves a retained running snapshot by its derived agentSessionId (values-scan)", () => {
155
- const buf = new SubagentFrameBuffer();
156
- buf.markForwarded("subagents:started", frameWithSession("A", "S", [1, 2]));
157
- const byId = buf.resync("A");
158
- expect(byId).toBeDefined();
159
- expect(buf.stats.resyncByAgentId).toBe(1);
160
- const bySession = buf.resync("S");
161
- expect(bySession).toBeDefined();
162
- // state.id stays canonical (the agentId), even when resolved via the v7 id.
163
- expect(bySession!.data.id).toBe("A");
164
- expect(buf.stats.resyncByAgentSessionId).toBe(1);
165
- expect(buf.stats.resyncServed).toBe(2);
166
- });
167
-
168
- // X3: terminal frame removes A's snapshot → resync(A) and resync(S) both no-op.
169
- it("terminated run resolves to nothing by either id", () => {
170
- const buf = new SubagentFrameBuffer();
171
- buf.markForwarded("subagents:started", frameWithSession("A", "S", [1]));
172
- buf.markForwarded("subagents:completed", frameWithSession("A", "S", [1, 2]));
173
- expect(buf.resync("A")).toBeUndefined();
174
- expect(buf.resync("S")).toBeUndefined();
175
- expect(buf.stats.resyncNoop).toBe(2);
176
- });
177
-
178
- // X1 (bridge/frame-buffer half of graceful degrade): frames never carry
179
- // agentSessionId → no session-id resolution, no throw, agentId path intact.
180
- it("graceful degrade: frames without agentSessionId → resync(sessionId) no-ops, no throw", () => {
181
- const buf = new SubagentFrameBuffer();
182
- buf.markForwarded("subagents:started", frame("A", [1]));
183
- expect(buf.resync("A")).toBeDefined();
184
- expect(buf.resync("S")).toBeUndefined();
185
- expect(buf.stats.resyncByAgentSessionId).toBe(0);
186
- });
187
-
188
- // E5: 65 distinct running subagents (each with its own S), then complete →
189
- // the evicted first agentId and its S both no-op; retained ≤ 64; no separate
190
- // index retains completed runs by session id.
191
- it("adds no independent bound (BVA on 64) — session-id resolution inherits the snapshot bound", () => {
192
- const buf = new SubagentFrameBuffer(64);
193
- for (let i = 0; i < 65; i++) {
194
- buf.markForwarded("subagents:started", frameWithSession(`a${i}`, `s${i}`, [1]));
195
- }
196
- // The 65th insert evicted the oldest (a0/s0): retained running snapshots ≤ 64.
197
- expect(buf.resync("a0")).toBeUndefined();
198
- expect(buf.resync("s0")).toBeUndefined();
199
- expect(buf.resync("a64")).toBeDefined();
200
- expect(buf.resync("s64")).toBeDefined();
201
- expect(buf.stats.overflowEvicted).toBeGreaterThanOrEqual(1);
202
- // Complete every still-tracked run → no snapshot retained by either id.
203
- for (let i = 1; i < 65; i++) {
204
- buf.markForwarded("subagents:completed", frameWithSession(`a${i}`, `s${i}`, [1]));
205
- }
206
- expect(buf.resync("a64")).toBeUndefined();
207
- expect(buf.resync("s64")).toBeUndefined();
208
- });
209
-
210
- // P1: snapshots at the 64 cap, resync by a non-matching agentSessionId
211
- // (worst case: full scan, miss) → single call is cheap. The design intent is
212
- // sub-millisecond; the assertion uses a generous upper bound (25 ms) so a
213
- // 64-element scan (microseconds in practice) never false-fails under CI CPU
214
- // jitter / tick resolution, while still catching a pathological regression
215
- // (e.g. an accidental O(n²) or per-call allocation blow-up). CodeRabbit nit.
216
- it("derived scan is cheap on a full buffer (worst-case full-scan miss)", () => {
217
- const buf = new SubagentFrameBuffer(64);
218
- for (let i = 0; i < 64; i++) {
219
- buf.markForwarded("subagents:started", frameWithSession(`a${i}`, `s${i}`, [1]));
220
- }
221
- const t0 = performance.now();
222
- const snap = buf.resync("non-matching-session-id");
223
- const dt = performance.now() - t0;
224
- expect(snap).toBeUndefined();
225
- expect(dt).toBeLessThan(25);
226
- });
227
- });
228
-
229
- describe("reset drops all retained state", () => {
230
- it("clears pending and snapshots", () => {
231
- const buf = new SubagentFrameBuffer();
232
- buf.buffer("subagents:started", frame("a", [1]));
233
- buf.markForwarded("subagents:started", frame("b", [1]));
234
- buf.reset();
235
- expect(buf.pendingSize).toBe(0);
236
- expect(buf.resync("a")).toBeUndefined();
237
- expect(buf.resync("b")).toBeUndefined();
238
- });
239
- });
@@ -1,206 +0,0 @@
1
- /**
2
- * Tests for the bridge's tool-result image inliner (Fix B).
3
- * See change: inline-agent-screenshot-artifacts.
4
- */
5
- import { describe, it, expect } from "vitest";
6
- import { inlineToolResultImages, type ImageContentBlock } from "../tool-result-image-inliner.js";
7
- import { hashBytes, type ReadFileOutcome } from "../markdown-image-inliner.js";
8
-
9
- const PNG = Buffer.from("png-bytes");
10
- const PNG_2 = Buffer.from("other-png-bytes");
11
-
12
- /** In-memory readFile: missing keys → ENOENT. */
13
- function fakeReader(files: Record<string, Buffer>) {
14
- return (absolutePath: string): ReadFileOutcome => {
15
- const v = files[absolutePath];
16
- if (v === undefined) return { ok: false, kind: "ENOENT" };
17
- return { ok: true, bytes: v };
18
- };
19
- }
20
-
21
- function imageBlocks(result: unknown): ImageContentBlock[] {
22
- const content = (result as any)?.content;
23
- if (!Array.isArray(content)) return [];
24
- return content.filter((c: any) => c?.type === "image");
25
- }
26
-
27
- function textOf(result: unknown): string {
28
- const content = (result as any)?.content;
29
- if (!Array.isArray(content)) return "";
30
- return content
31
- .filter((c: any) => c?.type === "text")
32
- .map((c: any) => c.text)
33
- .join("\n");
34
- }
35
-
36
- describe("inlineToolResultImages", () => {
37
- it("single screenshot path → one image block, path stripped (no link)", () => {
38
- const out = inlineToolResultImages("Screenshot saved: /tmp/shots/a.png", {
39
- readFile: fakeReader({ "/tmp/shots/a.png": PNG }),
40
- });
41
- expect(out.inlinedCount).toBe(1);
42
- const blocks = imageBlocks(out.result);
43
- expect(blocks).toHaveLength(1);
44
- expect(blocks[0]).toEqual({
45
- type: "image",
46
- data: PNG.toString("base64"),
47
- mimeType: "image/png",
48
- });
49
- // The consumed path no longer appears in the text → not linkified.
50
- expect(textOf(out.result)).not.toContain("/tmp/shots/a.png");
51
- expect(textOf(out.result)).toContain("Screenshot saved:");
52
- });
53
-
54
- it("two paths, one over per-image cap → one inlined, one left as link", () => {
55
- const big = Buffer.alloc(100);
56
- const out = inlineToolResultImages(
57
- "small /tmp/small.png and big /tmp/big.png",
58
- {
59
- readFile: fakeReader({ "/tmp/small.png": PNG, "/tmp/big.png": big }),
60
- maxPerImageBytes: 50,
61
- },
62
- );
63
- expect(out.inlinedCount).toBe(1);
64
- expect(imageBlocks(out.result)).toHaveLength(1);
65
- // small path stripped, big path remains as text → falls back to Fix A.
66
- const text = textOf(out.result);
67
- expect(text).not.toContain("/tmp/small.png");
68
- expect(text).toContain("/tmp/big.png");
69
- });
70
-
71
- it("isAllowedPath gate: out-of-root path left as text, in-root path inlined", () => {
72
- const reader = fakeReader({ "/allowed/shot.png": PNG, "/etc/secret.png": PNG_2 });
73
- // Out-of-root → not inlined, result unchanged.
74
- const blocked = inlineToolResultImages("leaked /etc/secret.png", {
75
- readFile: reader,
76
- isAllowedPath: (p) => p.startsWith("/allowed/"),
77
- });
78
- expect(blocked.inlinedCount).toBe(0);
79
- expect(blocked.result).toBe("leaked /etc/secret.png");
80
-
81
- // In-root → inlined.
82
- const allowed = inlineToolResultImages("saved /allowed/shot.png", {
83
- readFile: reader,
84
- isAllowedPath: (p) => p.startsWith("/allowed/"),
85
- });
86
- expect(allowed.inlinedCount).toBe(1);
87
- expect(imageBlocks(allowed.result)).toHaveLength(1);
88
- });
89
-
90
- it("non-image path → untouched (result unchanged, no image block)", () => {
91
- const original = "Wrote /tmp/notes.txt";
92
- const out = inlineToolResultImages(original, {
93
- readFile: fakeReader({ "/tmp/notes.txt": Buffer.from("hi") }),
94
- });
95
- expect(out.inlinedCount).toBe(0);
96
- expect(out.result).toBe(original);
97
- });
98
-
99
- it("non-existent image path → untouched", () => {
100
- const original = "Screenshot saved: /tmp/missing.png";
101
- const out = inlineToolResultImages(original, { readFile: fakeReader({}) });
102
- expect(out.inlinedCount).toBe(0);
103
- expect(out.result).toBe(original);
104
- });
105
-
106
- it("caps the number of images inlined per result", () => {
107
- const files: Record<string, Buffer> = {};
108
- let text = "";
109
- for (let i = 0; i < 6; i++) {
110
- const p = `/tmp/s${i}.png`;
111
- files[p] = Buffer.from(`png-${i}`);
112
- text += ` ${p}`;
113
- }
114
- const out = inlineToolResultImages(text, {
115
- readFile: fakeReader(files),
116
- maxImagesPerResult: 4,
117
- });
118
- expect(out.inlinedCount).toBe(4);
119
- expect(imageBlocks(out.result)).toHaveLength(4);
120
- });
121
-
122
- it("respects the per-result cumulative byte budget", () => {
123
- const out = inlineToolResultImages("/tmp/a.png /tmp/b.png", {
124
- readFile: fakeReader({ "/tmp/a.png": PNG, "/tmp/b.png": PNG_2 }),
125
- // Budget room for one image only.
126
- maxPerMessageBytes: PNG.length + 1,
127
- });
128
- expect(out.inlinedCount).toBe(1);
129
- });
130
-
131
- it("extracts image paths from a content-array result", () => {
132
- const out = inlineToolResultImages(
133
- { content: [{ type: "text", text: "saved /tmp/c.png ok" }] },
134
- { readFile: fakeReader({ "/tmp/c.png": PNG }) },
135
- );
136
- expect(out.inlinedCount).toBe(1);
137
- expect(imageBlocks(out.result)[0].mimeType).toBe("image/png");
138
- });
139
-
140
- it("preserves pre-existing non-text content blocks when inlining", () => {
141
- const existingImg = { type: "image", data: "cHJlZXhpc3Rpbmc=", mimeType: "image/jpeg" };
142
- const out = inlineToolResultImages(
143
- {
144
- content: [
145
- { type: "text", text: "saw /tmp/e.png here" },
146
- existingImg,
147
- { type: "resource", uri: "file:///x" },
148
- ],
149
- },
150
- { readFile: fakeReader({ "/tmp/e.png": PNG }) },
151
- );
152
- expect(out.inlinedCount).toBe(1);
153
- const content = (out.result as any).content;
154
- // Pre-existing image + resource blocks survive; new image appended.
155
- expect(content).toContainEqual(existingImg);
156
- expect(content).toContainEqual({ type: "resource", uri: "file:///x" });
157
- expect(content.filter((c: any) => c.type === "image")).toHaveLength(2);
158
- // Consumed path stripped from the original text block.
159
- const textBlock = content.find((c: any) => c.type === "text");
160
- expect(textBlock.text).not.toContain("/tmp/e.png");
161
- });
162
-
163
- it("MCP `browser` shape: native image + path to that SAME file → no duplicate", () => {
164
- // The MCP `browser` screenshot tool returns a text block referencing the
165
- // saved path AND a native image block for that same screenshot. The inliner
166
- // must not append a byte-identical second copy (rendered side-by-side).
167
- const nativeImg = { type: "image", data: PNG.toString("base64"), mimeType: "image/png" };
168
- const out = inlineToolResultImages(
169
- {
170
- content: [
171
- { type: "text", text: "Screenshot saved: /tmp/shots/a.png" },
172
- nativeImg,
173
- ],
174
- },
175
- { readFile: fakeReader({ "/tmp/shots/a.png": PNG }) },
176
- );
177
- // No NEW image inlined …
178
- expect(out.inlinedCount).toBe(0);
179
- // … exactly one image block remains (the native one) — no side-by-side dup.
180
- expect(imageBlocks(out.result)).toHaveLength(1);
181
- expect(imageBlocks(out.result)[0]).toEqual(nativeImg);
182
- // … and the redundant path is stripped so it isn't also linkified.
183
- expect(textOf(out.result)).not.toContain("/tmp/shots/a.png");
184
- expect(textOf(out.result)).toContain("Screenshot saved:");
185
- });
186
-
187
- it("native image + path to a DIFFERENT file → both images kept", () => {
188
- // Distinct bytes must NOT be de-duped: the mixed case still yields 2 images.
189
- const nativeImg = { type: "image", data: PNG_2.toString("base64"), mimeType: "image/jpeg" };
190
- const out = inlineToolResultImages(
191
- { content: [{ type: "text", text: "also /tmp/other.png" }, nativeImg] },
192
- { readFile: fakeReader({ "/tmp/other.png": PNG }) },
193
- );
194
- expect(out.inlinedCount).toBe(1);
195
- expect(imageBlocks(out.result)).toHaveLength(2);
196
- });
197
-
198
- it("dedups a repeated path into a single image block", () => {
199
- const out = inlineToolResultImages("/tmp/d.png twice /tmp/d.png", {
200
- readFile: fakeReader({ "/tmp/d.png": PNG }),
201
- });
202
- expect(out.inlinedCount).toBe(1);
203
- expect(imageBlocks(out.result)).toHaveLength(1);
204
- expect(hashBytes(PNG)).toBeTruthy(); // sanity: helper imported
205
- });
206
- });
@@ -1,213 +0,0 @@
1
- /**
2
- * Tests for the bridge's built-in TUI adapter behavior.
3
- * Tests the production adapter used by bridge.ts.
4
- */
5
-
6
- import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
7
- import { PromptBus } from "../prompt-bus.js";
8
- import { createTuiPromptAdapter } from "../tui-prompt-adapter.js";
9
-
10
- function createMockUi() {
11
- const signals: Record<string, AbortSignal | undefined> = {};
12
- const resolvers: Record<string, { resolve: (v: any) => void }> = {};
13
-
14
- function makeMock(name: string) {
15
- return vi.fn().mockImplementation((_q: string, _a?: any, opts?: any) => {
16
- signals[name] = opts?.signal;
17
- return new Promise((resolve) => {
18
- resolvers[name] = { resolve };
19
- opts?.signal?.addEventListener("abort", () => resolve(undefined), { once: true });
20
- });
21
- });
22
- }
23
-
24
- return {
25
- select: makeMock("select"),
26
- input: makeMock("input"),
27
- confirm: makeMock("confirm"),
28
- editor: makeMock("editor"),
29
- _resolve: (method: string, value: any) => resolvers[method]?.resolve(value),
30
- _signal: (method: string) => signals[method],
31
- };
32
- }
33
-
34
- describe("Bridge TUI adapter", () => {
35
- let bus: PromptBus;
36
- let mockUi: ReturnType<typeof createMockUi>;
37
-
38
- beforeEach(() => {
39
- vi.useFakeTimers();
40
- bus = new PromptBus({ timeoutMs: 5000 });
41
- mockUi = createMockUi();
42
- });
43
-
44
- afterEach(() => {
45
- vi.useRealTimers();
46
- });
47
-
48
- it("calls original select with question and options", () => {
49
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
50
- bus.request({ pipeline: "command", type: "select", question: "Pick:", options: ["A", "B"] });
51
-
52
- expect(mockUi.select).toHaveBeenCalledWith("Pick:", ["A", "B"], expect.objectContaining({ signal: expect.any(AbortSignal) }));
53
- });
54
-
55
- it("calls original input with question and defaultValue", () => {
56
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
57
- bus.request({ pipeline: "command", type: "input", question: "Name:", defaultValue: "default" });
58
-
59
- expect(mockUi.input).toHaveBeenCalledWith("Name:", "default", expect.objectContaining({ signal: expect.any(AbortSignal) }));
60
- });
61
-
62
- it("calls original editor with question and prefill", () => {
63
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
64
- bus.request({
65
- pipeline: "command",
66
- type: "editor",
67
- question: "Edit response:",
68
- defaultValue: "draft",
69
- });
70
-
71
- expect(mockUi.editor).toHaveBeenCalledWith(
72
- "Edit response:",
73
- "draft",
74
- expect.objectContaining({ signal: expect.any(AbortSignal) }),
75
- );
76
- });
77
-
78
- it("calls original confirm with question and message context", () => {
79
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
80
- bus.request({
81
- pipeline: "command",
82
- type: "confirm",
83
- question: "Run production promotion?",
84
- metadata: { message: "Staging passed all verification checks." },
85
- });
86
-
87
- expect(mockUi.confirm).toHaveBeenCalledWith(
88
- "Run production promotion?",
89
- "Staging passed all verification checks.",
90
- expect.objectContaining({ signal: expect.any(AbortSignal) }),
91
- );
92
- });
93
-
94
- it("passes an empty confirm message when context is absent", () => {
95
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
96
- bus.request({ pipeline: "command", type: "confirm", question: "Sure?" });
97
-
98
- expect(mockUi.confirm).toHaveBeenCalledWith(
99
- "Sure?",
100
- "",
101
- expect.objectContaining({ signal: expect.any(AbortSignal) }),
102
- );
103
- });
104
-
105
- it("does not present multiselect prompts in the TUI", () => {
106
- const adapter = createTuiPromptAdapter(mockUi, bus);
107
-
108
- const claim = adapter.onRequest({
109
- id: "multi",
110
- pipeline: "command",
111
- type: "multiselect",
112
- question: "Pick several:",
113
- options: ["A", "B"],
114
- });
115
-
116
- expect(claim).toEqual({});
117
- expect(mockUi.select).not.toHaveBeenCalled();
118
- expect(mockUi.input).not.toHaveBeenCalled();
119
- expect(mockUi.confirm).not.toHaveBeenCalled();
120
- expect(mockUi.editor).not.toHaveBeenCalled();
121
- });
122
-
123
- it("responds via bus when user answers select", async () => {
124
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
125
- const promise = bus.request({ pipeline: "command", type: "select", question: "Q", options: ["A"] });
126
-
127
- mockUi._resolve("select", "A");
128
- await vi.advanceTimersByTimeAsync(0);
129
-
130
- const result = await promise;
131
- expect(result.answer).toBe("A");
132
- expect(result.source).toBe("tui");
133
- });
134
-
135
- it("responds cancelled when user dismisses dialog", async () => {
136
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
137
- const promise = bus.request({ pipeline: "command", type: "select", question: "Q", options: ["A"] });
138
-
139
- mockUi._resolve("select", undefined);
140
- await vi.advanceTimersByTimeAsync(0);
141
-
142
- const result = await promise;
143
- expect(result.cancelled).toBe(true);
144
- });
145
-
146
- it("converts boolean confirm to string", async () => {
147
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
148
- const promise = bus.request({ pipeline: "command", type: "confirm", question: "Sure?" });
149
-
150
- mockUi._resolve("confirm", true);
151
- await vi.advanceTimersByTimeAsync(0);
152
-
153
- const result = await promise;
154
- expect(result.answer).toBe("true");
155
- });
156
-
157
- it("aborts TUI dialog when another adapter answers", async () => {
158
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
159
- const promise = bus.request({ pipeline: "command", type: "select", question: "Q", options: ["A"] });
160
-
161
- // External adapter answers
162
- const id = (mockUi.select.mock.calls[0] as any)?.[2]?.signal ? undefined : undefined;
163
- // Get the prompt id from the bus's pending
164
- bus.respond({ id: (bus as any).pending.keys().next().value, answer: "B", source: "dashboard" });
165
- await vi.advanceTimersByTimeAsync(0);
166
-
167
- const result = await promise;
168
- expect(result.answer).toBe("B");
169
- expect(result.source).toBe("dashboard");
170
- expect(mockUi._signal("select")?.aborted).toBe(true);
171
- });
172
-
173
- it("aborts TUI dialog on cancel", async () => {
174
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
175
- const promise = bus.request({ pipeline: "command", type: "select", question: "Q", options: ["A"] });
176
-
177
- const id = (bus as any).pending.keys().next().value;
178
- bus.cancel(id);
179
- await vi.advanceTimersByTimeAsync(0);
180
-
181
- const result = await promise;
182
- expect(result.cancelled).toBe(true);
183
- expect(mockUi._signal("select")?.aborted).toBe(true);
184
- });
185
-
186
- it("does not respond after being aborted", async () => {
187
- const respondSpy = vi.spyOn(bus, "respond");
188
- bus.registerAdapter(createTuiPromptAdapter(mockUi, bus));
189
- bus.request({ pipeline: "command", type: "select", question: "Q", options: ["A"] });
190
-
191
- const id = (bus as any).pending.keys().next().value;
192
- // Dashboard answers first
193
- bus.respond({ id, answer: "B", source: "dashboard" });
194
- await vi.advanceTimersByTimeAsync(0);
195
-
196
- // TUI resolves after abort — should NOT call respond again
197
- mockUi._resolve("select", "A");
198
- await vi.advanceTimersByTimeAsync(0);
199
-
200
- // respond was called exactly once (by dashboard)
201
- expect(respondSpy.mock.calls.filter(c => c[0].id === id)).toHaveLength(1);
202
- });
203
-
204
- it("returns empty claim (no component)", () => {
205
- const adapter = createTuiPromptAdapter(mockUi, bus);
206
- bus.registerAdapter(adapter);
207
- const claim = adapter.onRequest({
208
- id: "test", pipeline: "command", type: "select", question: "Q", options: ["A"],
209
- });
210
- expect(claim).toEqual({});
211
- expect(claim?.component).toBeUndefined();
212
- });
213
- });