@xingular/harness 2.0.0 → 2.0.1-unstable

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 (1095) hide show
  1. package/CHANGELOG.md +635 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE.md +50 -0
  4. package/README.md +241 -90
  5. package/THIRD_PARTY_LICENSES.md +942 -0
  6. package/browser-extension/README.md +32 -0
  7. package/browser-extension/background.js +612 -0
  8. package/browser-extension/manifest.json +16 -0
  9. package/browser-extension/overlay.js +97 -0
  10. package/browser-extension/popup.css +19 -0
  11. package/browser-extension/popup.html +30 -0
  12. package/browser-extension/popup.js +101 -0
  13. package/browser-extension/site-access.js +63 -0
  14. package/builtin/skills/plugin-authoring/SKILL.md +53 -0
  15. package/dist/cli.js +32851 -17155
  16. package/dist/sdk/accounts/accounts.d.ts +195 -0
  17. package/dist/sdk/accounts/accounts.js +821 -0
  18. package/dist/sdk/accounts/choices.d.ts +41 -0
  19. package/dist/sdk/accounts/choices.js +89 -0
  20. package/dist/sdk/accounts/env.d.ts +78 -0
  21. package/dist/sdk/accounts/env.js +294 -0
  22. package/dist/sdk/accounts/secrets.d.ts +28 -0
  23. package/dist/sdk/accounts/secrets.js +147 -0
  24. package/dist/sdk/accounts/store.d.ts +139 -0
  25. package/dist/sdk/accounts/store.js +255 -0
  26. package/dist/sdk/agents/builtin.d.ts +2 -0
  27. package/dist/sdk/agents/builtin.js +50 -0
  28. package/dist/sdk/agents/narrow.d.ts +13 -0
  29. package/dist/sdk/agents/narrow.js +29 -0
  30. package/dist/sdk/agents/planResearch.d.ts +27 -0
  31. package/dist/sdk/agents/planResearch.js +82 -0
  32. package/dist/sdk/agents/profiles.d.ts +93 -0
  33. package/dist/sdk/agents/profiles.js +289 -0
  34. package/dist/sdk/annotations/bridge.d.ts +44 -0
  35. package/dist/sdk/annotations/bridge.js +268 -0
  36. package/dist/sdk/annotations/capture.d.ts +158 -0
  37. package/dist/sdk/annotations/capture.js +409 -0
  38. package/dist/sdk/annotations/delivery.d.ts +79 -0
  39. package/dist/sdk/annotations/delivery.js +163 -0
  40. package/dist/sdk/annotations/inspect.d.ts +10 -0
  41. package/dist/sdk/annotations/inspect.js +34 -0
  42. package/dist/sdk/annotations/isolated.d.ts +6 -0
  43. package/dist/sdk/annotations/isolated.js +51 -0
  44. package/dist/sdk/annotations/pageScript.d.ts +28 -0
  45. package/dist/sdk/annotations/pageScript.js +871 -0
  46. package/dist/sdk/annotations/part.d.ts +8 -0
  47. package/dist/sdk/annotations/part.js +126 -0
  48. package/dist/sdk/annotations/queue.d.ts +4 -0
  49. package/dist/sdk/annotations/queue.js +45 -0
  50. package/dist/sdk/annotations/serverMethods.d.ts +3 -0
  51. package/dist/sdk/annotations/serverMethods.js +66 -0
  52. package/dist/sdk/annotations/store.d.ts +159 -0
  53. package/dist/sdk/annotations/store.js +404 -0
  54. package/dist/sdk/browser/backend.d.ts +16 -0
  55. package/dist/sdk/browser/backend.js +17 -0
  56. package/dist/sdk/browser/config.d.ts +19 -0
  57. package/dist/sdk/browser/config.js +23 -0
  58. package/dist/sdk/browser/contracts.d.ts +19 -0
  59. package/dist/sdk/browser/contracts.js +116 -0
  60. package/dist/sdk/browser/diagnostics.d.ts +4 -0
  61. package/dist/sdk/browser/diagnostics.js +38 -0
  62. package/dist/sdk/browser/extension/bridge.d.ts +55 -0
  63. package/dist/sdk/browser/extension/bridge.js +336 -0
  64. package/dist/sdk/browser/extension/session.d.ts +50 -0
  65. package/dist/sdk/browser/extension/session.js +321 -0
  66. package/dist/sdk/browser/index.d.ts +33 -0
  67. package/dist/sdk/browser/index.js +105 -0
  68. package/dist/sdk/browser/network.d.ts +10 -0
  69. package/dist/sdk/browser/network.js +59 -0
  70. package/dist/sdk/browser/serverMethods.d.ts +3 -0
  71. package/dist/sdk/browser/serverMethods.js +10 -0
  72. package/dist/sdk/browser/session.d.ts +85 -0
  73. package/dist/sdk/browser/session.js +228 -0
  74. package/dist/sdk/browser/tools.d.ts +102 -0
  75. package/dist/sdk/browser/tools.js +257 -0
  76. package/dist/sdk/capabilities/api.d.ts +22 -0
  77. package/dist/sdk/capabilities/api.js +54 -0
  78. package/dist/sdk/capabilities/runSnapshot.d.ts +18 -0
  79. package/dist/sdk/capabilities/runSnapshot.js +53 -0
  80. package/dist/sdk/capabilities/types.d.ts +29 -0
  81. package/dist/sdk/capabilities/types.js +1 -0
  82. package/dist/sdk/cli.d.ts +2 -0
  83. package/dist/sdk/cli.js +172 -0
  84. package/dist/sdk/commands/extensionOwners.d.ts +4 -0
  85. package/dist/sdk/commands/extensionOwners.js +17 -0
  86. package/dist/sdk/commands/list.d.ts +3 -0
  87. package/dist/sdk/commands/list.js +90 -0
  88. package/dist/sdk/commands/promptLoader.d.ts +5 -0
  89. package/dist/sdk/commands/promptLoader.js +76 -0
  90. package/dist/sdk/commands/promptRoutes.d.ts +13 -0
  91. package/dist/sdk/commands/promptRoutes.js +46 -0
  92. package/dist/sdk/commands/registry.d.ts +299 -0
  93. package/dist/sdk/commands/registry.js +54 -0
  94. package/dist/sdk/commands/routes.d.ts +16 -0
  95. package/dist/sdk/commands/routes.js +33 -0
  96. package/dist/sdk/commands/runtimeRouter.d.ts +4 -0
  97. package/dist/sdk/commands/runtimeRouter.js +48 -0
  98. package/dist/sdk/computer/boundary.d.ts +40 -0
  99. package/dist/sdk/computer/boundary.js +79 -0
  100. package/dist/sdk/computer/contracts.d.ts +127 -0
  101. package/dist/sdk/computer/contracts.js +13 -0
  102. package/dist/sdk/computer/control.d.ts +34 -0
  103. package/dist/sdk/computer/control.js +112 -0
  104. package/dist/sdk/computer/screenshot.d.ts +32 -0
  105. package/dist/sdk/computer/screenshot.js +35 -0
  106. package/dist/sdk/computer/terminalCapture.d.ts +26 -0
  107. package/dist/sdk/computer/terminalCapture.js +64 -0
  108. package/dist/sdk/computer/volatileImages.d.ts +9 -0
  109. package/dist/sdk/computer/volatileImages.js +50 -0
  110. package/dist/sdk/context/attribution.d.ts +18 -0
  111. package/dist/sdk/context/attribution.js +295 -0
  112. package/dist/sdk/context/runDetails.d.ts +16 -0
  113. package/dist/sdk/context/runDetails.js +22 -0
  114. package/dist/sdk/context/types.d.ts +94 -0
  115. package/dist/sdk/context/types.js +10 -0
  116. package/dist/sdk/core/bus.d.ts +23 -0
  117. package/dist/sdk/core/bus.js +76 -0
  118. package/dist/sdk/core/caller.d.ts +22 -0
  119. package/dist/sdk/core/caller.js +16 -0
  120. package/dist/sdk/core/changes.d.ts +15 -0
  121. package/dist/sdk/core/changes.js +15 -0
  122. package/dist/sdk/core/commandBudget.d.ts +23 -0
  123. package/dist/sdk/core/commandBudget.js +62 -0
  124. package/dist/sdk/core/effort.d.ts +2 -0
  125. package/dist/sdk/core/effort.js +1 -0
  126. package/dist/sdk/core/env.d.ts +18 -0
  127. package/dist/sdk/core/env.js +8 -0
  128. package/dist/sdk/core/errors.d.ts +15 -0
  129. package/dist/sdk/core/errors.js +24 -0
  130. package/dist/sdk/core/frontmatter.d.ts +12 -0
  131. package/dist/sdk/core/frontmatter.js +50 -0
  132. package/dist/sdk/core/fs.d.ts +18 -0
  133. package/dist/sdk/core/fs.js +106 -0
  134. package/dist/sdk/core/index.d.ts +24 -0
  135. package/dist/sdk/core/index.js +203 -0
  136. package/dist/sdk/core/interactiveProfile.d.ts +46 -0
  137. package/dist/sdk/core/interactiveProfile.js +143 -0
  138. package/dist/sdk/core/links.d.ts +51 -0
  139. package/dist/sdk/core/links.js +155 -0
  140. package/dist/sdk/core/path.d.ts +7 -0
  141. package/dist/sdk/core/path.js +79 -0
  142. package/dist/sdk/core/projects.d.ts +18 -0
  143. package/dist/sdk/core/projects.js +67 -0
  144. package/dist/sdk/core/secrets.d.ts +2 -0
  145. package/dist/sdk/core/secrets.js +5 -0
  146. package/dist/sdk/core/shell.d.ts +20 -0
  147. package/dist/sdk/core/shell.js +73 -0
  148. package/dist/sdk/core/text.d.ts +7 -0
  149. package/dist/sdk/core/text.js +40 -0
  150. package/dist/sdk/core/workspace.d.ts +13 -0
  151. package/dist/sdk/core/workspace.js +88 -0
  152. package/dist/sdk/core/workspaceBashTool.d.ts +20 -0
  153. package/dist/sdk/core/workspaceBashTool.js +50 -0
  154. package/dist/sdk/core/workspaceSandbox.d.ts +41 -0
  155. package/dist/sdk/core/workspaceSandbox.js +360 -0
  156. package/dist/sdk/core/workspaceWriteOperations.d.ts +57 -0
  157. package/dist/sdk/core/workspaceWriteOperations.js +245 -0
  158. package/dist/sdk/doctor/checks.d.ts +5 -0
  159. package/dist/sdk/doctor/checks.js +270 -0
  160. package/dist/sdk/doctor/probe.d.ts +4 -0
  161. package/dist/sdk/doctor/probe.js +94 -0
  162. package/dist/sdk/doctor/serverMethods.d.ts +3 -0
  163. package/dist/sdk/doctor/serverMethods.js +8 -0
  164. package/dist/sdk/doctor/service.d.ts +23 -0
  165. package/dist/sdk/doctor/service.js +144 -0
  166. package/dist/sdk/doctor/types.d.ts +141 -0
  167. package/dist/sdk/doctor/types.js +29 -0
  168. package/dist/sdk/harness.d.ts +172 -0
  169. package/dist/sdk/harness.js +387 -0
  170. package/dist/sdk/history/lessonPrompt.d.ts +2 -0
  171. package/dist/sdk/history/lessonPrompt.js +15 -0
  172. package/dist/sdk/history/lessons.d.ts +52 -0
  173. package/dist/sdk/history/lessons.js +173 -0
  174. package/dist/sdk/history/recall.d.ts +68 -0
  175. package/dist/sdk/history/recall.js +199 -0
  176. package/dist/sdk/history/serverMethods.d.ts +3 -0
  177. package/dist/sdk/history/serverMethods.js +8 -0
  178. package/dist/sdk/history/trajectory.d.ts +7 -0
  179. package/dist/sdk/history/trajectory.js +218 -0
  180. package/dist/sdk/hub/catalog.json +123 -0
  181. package/dist/sdk/hub/cli.d.ts +7 -0
  182. package/dist/sdk/hub/cli.js +81 -0
  183. package/dist/sdk/hub/hub.d.ts +74 -0
  184. package/dist/sdk/hub/hub.js +476 -0
  185. package/dist/sdk/hub/schema.d.ts +280 -0
  186. package/dist/sdk/hub/schema.js +78 -0
  187. package/dist/sdk/hub/serverMethods.d.ts +3 -0
  188. package/dist/sdk/hub/serverMethods.js +11 -0
  189. package/dist/sdk/index.d.ts +80 -0
  190. package/dist/sdk/index.js +60 -0
  191. package/dist/sdk/mcp/connections.d.ts +83 -0
  192. package/dist/sdk/mcp/connections.js +676 -0
  193. package/dist/sdk/mcp/manager.d.ts +26 -0
  194. package/dist/sdk/mcp/manager.js +124 -0
  195. package/dist/sdk/mcp/oauth.d.ts +35 -0
  196. package/dist/sdk/mcp/oauth.js +171 -0
  197. package/dist/sdk/mcp/scopeMigration.d.ts +19 -0
  198. package/dist/sdk/mcp/scopeMigration.js +198 -0
  199. package/dist/sdk/mcp/serverMethods.d.ts +3 -0
  200. package/dist/sdk/mcp/serverMethods.js +22 -0
  201. package/dist/sdk/mcp/service.d.ts +160 -0
  202. package/dist/sdk/mcp/service.js +510 -0
  203. package/dist/sdk/mcp/types.d.ts +131 -0
  204. package/dist/sdk/mcp/types.js +49 -0
  205. package/dist/sdk/pi/retryPolicy.d.ts +19 -0
  206. package/dist/sdk/pi/retryPolicy.js +11 -0
  207. package/dist/sdk/pi/runtime.d.ts +14 -0
  208. package/dist/sdk/pi/runtime.js +31 -0
  209. package/dist/sdk/plugins/api.d.ts +66 -0
  210. package/dist/sdk/plugins/api.js +155 -0
  211. package/dist/sdk/plugins/attachments.d.ts +46 -0
  212. package/dist/sdk/plugins/attachments.js +111 -0
  213. package/dist/sdk/plugins/builtin.d.ts +7 -0
  214. package/dist/sdk/plugins/builtin.js +182 -0
  215. package/dist/sdk/plugins/builtinRegistry.d.ts +62 -0
  216. package/dist/sdk/plugins/builtinRegistry.js +77 -0
  217. package/dist/sdk/plugins/catalogue.d.ts +29 -0
  218. package/dist/sdk/plugins/catalogue.js +197 -0
  219. package/dist/sdk/plugins/cli.d.ts +13 -0
  220. package/dist/sdk/plugins/cli.js +188 -0
  221. package/dist/sdk/plugins/commandPrefix.d.ts +8 -0
  222. package/dist/sdk/plugins/commandPrefix.js +21 -0
  223. package/dist/sdk/plugins/discover.d.ts +48 -0
  224. package/dist/sdk/plugins/discover.js +230 -0
  225. package/dist/sdk/plugins/firstParty.d.ts +50 -0
  226. package/dist/sdk/plugins/firstParty.js +119 -0
  227. package/dist/sdk/plugins/hooks.d.ts +94 -0
  228. package/dist/sdk/plugins/hooks.js +162 -0
  229. package/dist/sdk/plugins/identity.d.ts +19 -0
  230. package/dist/sdk/plugins/identity.js +48 -0
  231. package/dist/sdk/plugins/install.d.ts +24 -0
  232. package/dist/sdk/plugins/install.js +160 -0
  233. package/dist/sdk/plugins/inventory.d.ts +22 -0
  234. package/dist/sdk/plugins/inventory.js +111 -0
  235. package/dist/sdk/plugins/manifest.d.ts +21 -0
  236. package/dist/sdk/plugins/manifest.js +94 -0
  237. package/dist/sdk/plugins/plugins.d.ts +106 -0
  238. package/dist/sdk/plugins/plugins.js +165 -0
  239. package/dist/sdk/plugins/proposals.d.ts +17 -0
  240. package/dist/sdk/plugins/proposals.js +147 -0
  241. package/dist/sdk/plugins/runtime.d.ts +9 -0
  242. package/dist/sdk/plugins/runtime.js +95 -0
  243. package/dist/sdk/plugins/surfaces.d.ts +5 -0
  244. package/dist/sdk/plugins/surfaces.js +11 -0
  245. package/dist/sdk/plugins/trust.d.ts +44 -0
  246. package/dist/sdk/plugins/trust.js +120 -0
  247. package/dist/sdk/plugins/types.d.ts +174 -0
  248. package/dist/sdk/plugins/types.js +7 -0
  249. package/dist/sdk/prompt/compile.d.ts +245 -0
  250. package/dist/sdk/prompt/compile.js +535 -0
  251. package/dist/sdk/prompt/reporting.d.ts +2 -0
  252. package/dist/sdk/prompt/reporting.js +94 -0
  253. package/dist/sdk/prompt/standard.d.ts +32 -0
  254. package/dist/sdk/prompt/standard.js +76 -0
  255. package/dist/sdk/refine/cli.d.ts +4 -0
  256. package/dist/sdk/refine/cli.js +186 -0
  257. package/dist/sdk/refine/demo.d.ts +21 -0
  258. package/dist/sdk/refine/demo.js +114 -0
  259. package/dist/sdk/refine/evidence.d.ts +55 -0
  260. package/dist/sdk/refine/evidence.js +330 -0
  261. package/dist/sdk/refine/host.d.ts +59 -0
  262. package/dist/sdk/refine/host.js +105 -0
  263. package/dist/sdk/refine/ledger.d.ts +48 -0
  264. package/dist/sdk/refine/ledger.js +76 -0
  265. package/dist/sdk/refine/library.d.ts +55 -0
  266. package/dist/sdk/refine/library.js +177 -0
  267. package/dist/sdk/refine/pi.d.ts +72 -0
  268. package/dist/sdk/refine/pi.js +248 -0
  269. package/dist/sdk/refine/prompts.d.ts +60 -0
  270. package/dist/sdk/refine/prompts.js +434 -0
  271. package/dist/sdk/refine/recursion.d.ts +113 -0
  272. package/dist/sdk/refine/recursion.js +258 -0
  273. package/dist/sdk/refine/runner.d.ts +83 -0
  274. package/dist/sdk/refine/runner.js +151 -0
  275. package/dist/sdk/refine/selection.d.ts +57 -0
  276. package/dist/sdk/refine/selection.js +251 -0
  277. package/dist/sdk/refine/serverMethods.d.ts +3 -0
  278. package/dist/sdk/refine/serverMethods.js +23 -0
  279. package/dist/sdk/refine/service.d.ts +115 -0
  280. package/dist/sdk/refine/service.js +280 -0
  281. package/dist/sdk/refine/suite.d.ts +67 -0
  282. package/dist/sdk/refine/suite.js +174 -0
  283. package/dist/sdk/refine/trajectory.d.ts +9 -0
  284. package/dist/sdk/refine/trajectory.js +73 -0
  285. package/dist/sdk/refine/types.d.ts +93 -0
  286. package/dist/sdk/refine/types.js +10 -0
  287. package/dist/sdk/remote/addresses.d.ts +19 -0
  288. package/dist/sdk/remote/addresses.js +52 -0
  289. package/dist/sdk/remote/pairing.d.ts +59 -0
  290. package/dist/sdk/remote/pairing.js +160 -0
  291. package/dist/sdk/remote/seal.d.ts +28 -0
  292. package/dist/sdk/remote/seal.js +84 -0
  293. package/dist/sdk/remote/server.d.ts +28 -0
  294. package/dist/sdk/remote/server.js +158 -0
  295. package/dist/sdk/remote/service.d.ts +125 -0
  296. package/dist/sdk/remote/service.js +330 -0
  297. package/dist/sdk/remote/webClient.d.ts +4 -0
  298. package/dist/sdk/remote/webClient.js +452 -0
  299. package/dist/sdk/server/methods.d.ts +3 -0
  300. package/dist/sdk/server/methods.js +365 -0
  301. package/dist/sdk/server/params.d.ts +4 -0
  302. package/dist/sdk/server/params.js +11 -0
  303. package/dist/sdk/server/remote.d.ts +19 -0
  304. package/dist/sdk/server/remote.js +109 -0
  305. package/dist/sdk/server/rpc.d.ts +20 -0
  306. package/dist/sdk/server/rpc.js +102 -0
  307. package/dist/sdk/server/serve.d.ts +13 -0
  308. package/dist/sdk/server/serve.js +25 -0
  309. package/dist/sdk/server/socket.d.ts +28 -0
  310. package/dist/sdk/server/socket.js +122 -0
  311. package/dist/sdk/sessions/approvals.d.ts +47 -0
  312. package/dist/sdk/sessions/approvals.js +119 -0
  313. package/dist/sdk/sessions/checkpoint.d.ts +7 -0
  314. package/dist/sdk/sessions/checkpoint.js +41 -0
  315. package/dist/sdk/sessions/compactionCheckpoint.d.ts +18 -0
  316. package/dist/sdk/sessions/compactionCheckpoint.js +79 -0
  317. package/dist/sdk/sessions/completionCheck.d.ts +51 -0
  318. package/dist/sdk/sessions/completionCheck.js +161 -0
  319. package/dist/sdk/sessions/continuation.d.ts +53 -0
  320. package/dist/sdk/sessions/continuation.js +90 -0
  321. package/dist/sdk/sessions/contracts.d.ts +991 -0
  322. package/dist/sdk/sessions/contracts.js +545 -0
  323. package/dist/sdk/sessions/control.d.ts +72 -0
  324. package/dist/sdk/sessions/control.js +158 -0
  325. package/dist/sdk/sessions/extensionUi.d.ts +19 -0
  326. package/dist/sdk/sessions/extensionUi.js +64 -0
  327. package/dist/sdk/sessions/goal.d.ts +145 -0
  328. package/dist/sdk/sessions/goal.js +405 -0
  329. package/dist/sdk/sessions/goalLoop.d.ts +37 -0
  330. package/dist/sdk/sessions/goalLoop.js +125 -0
  331. package/dist/sdk/sessions/goalPrompts.d.ts +4 -0
  332. package/dist/sdk/sessions/goalPrompts.js +93 -0
  333. package/dist/sdk/sessions/goalStop.d.ts +27 -0
  334. package/dist/sdk/sessions/goalStop.js +41 -0
  335. package/dist/sdk/sessions/history.d.ts +16 -0
  336. package/dist/sdk/sessions/history.js +68 -0
  337. package/dist/sdk/sessions/initialBash.d.ts +7 -0
  338. package/dist/sdk/sessions/initialBash.js +7 -0
  339. package/dist/sdk/sessions/lineageJoin.d.ts +2 -0
  340. package/dist/sdk/sessions/lineageJoin.js +61 -0
  341. package/dist/sdk/sessions/live.d.ts +101 -0
  342. package/dist/sdk/sessions/live.js +265 -0
  343. package/dist/sdk/sessions/planMode.d.ts +116 -0
  344. package/dist/sdk/sessions/planMode.js +281 -0
  345. package/dist/sdk/sessions/policy.d.ts +43 -0
  346. package/dist/sdk/sessions/policy.js +1 -0
  347. package/dist/sdk/sessions/pricing.d.ts +34 -0
  348. package/dist/sdk/sessions/pricing.js +40 -0
  349. package/dist/sdk/sessions/reasoningSummaries.d.ts +11 -0
  350. package/dist/sdk/sessions/reasoningSummaries.js +61 -0
  351. package/dist/sdk/sessions/registry.d.ts +124 -0
  352. package/dist/sdk/sessions/registry.js +392 -0
  353. package/dist/sdk/sessions/runIndex.d.ts +21 -0
  354. package/dist/sdk/sessions/runIndex.js +65 -0
  355. package/dist/sdk/sessions/runStore.d.ts +82 -0
  356. package/dist/sdk/sessions/runStore.js +393 -0
  357. package/dist/sdk/sessions/runner.d.ts +291 -0
  358. package/dist/sdk/sessions/runner.js +1040 -0
  359. package/dist/sdk/sessions/sessionState.d.ts +13 -0
  360. package/dist/sdk/sessions/sessionState.js +31 -0
  361. package/dist/sdk/sessions/sessions.d.ts +238 -0
  362. package/dist/sdk/sessions/sessions.js +923 -0
  363. package/dist/sdk/sessions/sideQuestionServerMethods.d.ts +3 -0
  364. package/dist/sdk/sessions/sideQuestionServerMethods.js +19 -0
  365. package/dist/sdk/sessions/sideQuestions.d.ts +66 -0
  366. package/dist/sdk/sessions/sideQuestions.js +290 -0
  367. package/dist/sdk/sessions/stallWatch.d.ts +35 -0
  368. package/dist/sdk/sessions/stallWatch.js +42 -0
  369. package/dist/sdk/sessions/subagentServerMethods.d.ts +3 -0
  370. package/dist/sdk/sessions/subagentServerMethods.js +41 -0
  371. package/dist/sdk/sessions/subagentService.d.ts +88 -0
  372. package/dist/sdk/sessions/subagentService.js +546 -0
  373. package/dist/sdk/sessions/subagents.d.ts +98 -0
  374. package/dist/sdk/sessions/subagents.js +136 -0
  375. package/dist/sdk/sessions/workSlice.d.ts +167 -0
  376. package/dist/sdk/sessions/workSlice.js +266 -0
  377. package/dist/sdk/sessions/workspaceBoundary.d.ts +15 -0
  378. package/dist/sdk/sessions/workspaceBoundary.js +46 -0
  379. package/dist/sdk/terminal/accountsMenu.d.ts +46 -0
  380. package/dist/sdk/terminal/accountsMenu.js +392 -0
  381. package/dist/sdk/terminal/browser.d.ts +62 -0
  382. package/dist/sdk/terminal/browser.js +41 -0
  383. package/dist/sdk/terminal/browserControl.d.ts +29 -0
  384. package/dist/sdk/terminal/browserControl.js +187 -0
  385. package/dist/sdk/terminal/cli.d.ts +20 -0
  386. package/dist/sdk/terminal/cli.js +121 -0
  387. package/dist/sdk/terminal/client.d.ts +20 -0
  388. package/dist/sdk/terminal/client.js +148 -0
  389. package/dist/sdk/terminal/commandHelp.d.ts +17 -0
  390. package/dist/sdk/terminal/commandHelp.js +20 -0
  391. package/dist/sdk/terminal/control.d.ts +4 -0
  392. package/dist/sdk/terminal/control.js +25 -0
  393. package/dist/sdk/terminal/controller.d.ts +136 -0
  394. package/dist/sdk/terminal/controller.js +579 -0
  395. package/dist/sdk/terminal/credentialStore.d.ts +4 -0
  396. package/dist/sdk/terminal/credentialStore.js +33 -0
  397. package/dist/sdk/terminal/daemon.d.ts +44 -0
  398. package/dist/sdk/terminal/daemon.js +264 -0
  399. package/dist/sdk/terminal/hubMenu.d.ts +10 -0
  400. package/dist/sdk/terminal/hubMenu.js +34 -0
  401. package/dist/sdk/terminal/launch.d.ts +5 -0
  402. package/dist/sdk/terminal/launch.js +27 -0
  403. package/dist/sdk/terminal/liveTerminal.d.ts +96 -0
  404. package/dist/sdk/terminal/liveTerminal.js +436 -0
  405. package/dist/sdk/terminal/logs.d.ts +14 -0
  406. package/dist/sdk/terminal/logs.js +59 -0
  407. package/dist/sdk/terminal/opentui/ansi.d.ts +25 -0
  408. package/dist/sdk/terminal/opentui/ansi.js +192 -0
  409. package/dist/sdk/terminal/opentui/model.d.ts +163 -0
  410. package/dist/sdk/terminal/opentui/model.js +484 -0
  411. package/dist/sdk/terminal/opentui/subagentsWidget.d.ts +28 -0
  412. package/dist/sdk/terminal/opentui/subagentsWidget.js +54 -0
  413. package/dist/sdk/terminal/opentui/theme.d.ts +47 -0
  414. package/dist/sdk/terminal/opentui/theme.js +93 -0
  415. package/dist/sdk/terminal/piExtension.d.ts +12 -0
  416. package/dist/sdk/terminal/piExtension.js +847 -0
  417. package/dist/sdk/terminal/pluginMenu.d.ts +34 -0
  418. package/dist/sdk/terminal/pluginMenu.js +101 -0
  419. package/dist/sdk/terminal/socket.d.ts +73 -0
  420. package/dist/sdk/terminal/socket.js +287 -0
  421. package/dist/sdk/terminal/standalone.d.ts +52 -0
  422. package/dist/sdk/terminal/standalone.js +329 -0
  423. package/dist/sdk/terminal/subagentMonitor.d.ts +62 -0
  424. package/dist/sdk/terminal/subagentMonitor.js +176 -0
  425. package/dist/sdk/terminal/terminals.d.ts +312 -0
  426. package/dist/sdk/terminal/terminals.js +1782 -0
  427. package/dist/sdk/terminal/toolName.d.ts +6 -0
  428. package/dist/sdk/terminal/toolName.js +12 -0
  429. package/dist/sdk/terminal/trajectory.d.ts +15 -0
  430. package/dist/sdk/terminal/trajectory.js +38 -0
  431. package/dist/sdk/terminal/tui/annotateCommand.d.ts +7 -0
  432. package/dist/sdk/terminal/tui/annotateCommand.js +36 -0
  433. package/dist/sdk/terminal/tui/annotateSend.d.ts +30 -0
  434. package/dist/sdk/terminal/tui/annotateSend.js +40 -0
  435. package/dist/sdk/terminal/tui/chrome.d.ts +68 -0
  436. package/dist/sdk/terminal/tui/chrome.js +182 -0
  437. package/dist/sdk/terminal/tui/clipboardFiles.d.ts +11 -0
  438. package/dist/sdk/terminal/tui/clipboardFiles.js +74 -0
  439. package/dist/sdk/terminal/tui/commandPages.d.ts +16 -0
  440. package/dist/sdk/terminal/tui/commandPages.js +136 -0
  441. package/dist/sdk/terminal/tui/commands.d.ts +71 -0
  442. package/dist/sdk/terminal/tui/commands.js +496 -0
  443. package/dist/sdk/terminal/tui/dialogGeometry.d.ts +27 -0
  444. package/dist/sdk/terminal/tui/dialogGeometry.js +52 -0
  445. package/dist/sdk/terminal/tui/dialogs.d.ts +81 -0
  446. package/dist/sdk/terminal/tui/dialogs.js +372 -0
  447. package/dist/sdk/terminal/tui/goalCommand.d.ts +19 -0
  448. package/dist/sdk/terminal/tui/goalCommand.js +83 -0
  449. package/dist/sdk/terminal/tui/harnessRuntime.d.ts +8 -0
  450. package/dist/sdk/terminal/tui/harnessRuntime.js +771 -0
  451. package/dist/sdk/terminal/tui/keybindings.d.ts +11 -0
  452. package/dist/sdk/terminal/tui/keybindings.js +49 -0
  453. package/dist/sdk/terminal/tui/list.d.ts +86 -0
  454. package/dist/sdk/terminal/tui/list.js +278 -0
  455. package/dist/sdk/terminal/tui/markdown.d.ts +16 -0
  456. package/dist/sdk/terminal/tui/markdown.js +55 -0
  457. package/dist/sdk/terminal/tui/modeChoices.d.ts +61 -0
  458. package/dist/sdk/terminal/tui/modeChoices.js +95 -0
  459. package/dist/sdk/terminal/tui/modelPicker.d.ts +55 -0
  460. package/dist/sdk/terminal/tui/modelPicker.js +150 -0
  461. package/dist/sdk/terminal/tui/mouse.d.ts +3 -0
  462. package/dist/sdk/terminal/tui/mouse.js +3 -0
  463. package/dist/sdk/terminal/tui/mouseReport.d.ts +30 -0
  464. package/dist/sdk/terminal/tui/mouseReport.js +80 -0
  465. package/dist/sdk/terminal/tui/page.d.ts +17 -0
  466. package/dist/sdk/terminal/tui/page.js +1 -0
  467. package/dist/sdk/terminal/tui/pageOverlay.d.ts +30 -0
  468. package/dist/sdk/terminal/tui/pageOverlay.js +183 -0
  469. package/dist/sdk/terminal/tui/pages/accountsPage.d.ts +76 -0
  470. package/dist/sdk/terminal/tui/pages/accountsPage.js +409 -0
  471. package/dist/sdk/terminal/tui/pages/agentsPage.d.ts +74 -0
  472. package/dist/sdk/terminal/tui/pages/agentsPage.js +193 -0
  473. package/dist/sdk/terminal/tui/pages/annotatePage.d.ts +148 -0
  474. package/dist/sdk/terminal/tui/pages/annotatePage.js +576 -0
  475. package/dist/sdk/terminal/tui/pages/browserPage.d.ts +87 -0
  476. package/dist/sdk/terminal/tui/pages/browserPage.js +739 -0
  477. package/dist/sdk/terminal/tui/pages/componentsPage.d.ts +47 -0
  478. package/dist/sdk/terminal/tui/pages/componentsPage.js +119 -0
  479. package/dist/sdk/terminal/tui/pages/contextPage.d.ts +91 -0
  480. package/dist/sdk/terminal/tui/pages/contextPage.js +585 -0
  481. package/dist/sdk/terminal/tui/pages/doctorPage.d.ts +39 -0
  482. package/dist/sdk/terminal/tui/pages/doctorPage.js +233 -0
  483. package/dist/sdk/terminal/tui/pages/followUpQueuePage.d.ts +34 -0
  484. package/dist/sdk/terminal/tui/pages/followUpQueuePage.js +130 -0
  485. package/dist/sdk/terminal/tui/pages/hubPage.d.ts +52 -0
  486. package/dist/sdk/terminal/tui/pages/hubPage.js +292 -0
  487. package/dist/sdk/terminal/tui/pages/logPage.d.ts +38 -0
  488. package/dist/sdk/terminal/tui/pages/logPage.js +189 -0
  489. package/dist/sdk/terminal/tui/pages/permissionsPage.d.ts +44 -0
  490. package/dist/sdk/terminal/tui/pages/permissionsPage.js +124 -0
  491. package/dist/sdk/terminal/tui/pages/pluginsPage.d.ts +65 -0
  492. package/dist/sdk/terminal/tui/pages/pluginsPage.js +519 -0
  493. package/dist/sdk/terminal/tui/pages/remoteControlPage.d.ts +32 -0
  494. package/dist/sdk/terminal/tui/pages/remoteControlPage.js +170 -0
  495. package/dist/sdk/terminal/tui/pages/settingsPage.d.ts +63 -0
  496. package/dist/sdk/terminal/tui/pages/settingsPage.js +103 -0
  497. package/dist/sdk/terminal/tui/pages/subagentsPage.d.ts +24 -0
  498. package/dist/sdk/terminal/tui/pages/subagentsPage.js +155 -0
  499. package/dist/sdk/terminal/tui/pages/textPage.d.ts +17 -0
  500. package/dist/sdk/terminal/tui/pages/textPage.js +52 -0
  501. package/dist/sdk/terminal/tui/pages/trajectoryPage.d.ts +66 -0
  502. package/dist/sdk/terminal/tui/pages/trajectoryPage.js +490 -0
  503. package/dist/sdk/terminal/tui/pages/usagePage.d.ts +45 -0
  504. package/dist/sdk/terminal/tui/pages/usagePage.js +397 -0
  505. package/dist/sdk/terminal/tui/pages/worktreesPage.d.ts +72 -0
  506. package/dist/sdk/terminal/tui/pages/worktreesPage.js +203 -0
  507. package/dist/sdk/terminal/tui/piAdapter.d.ts +17 -0
  508. package/dist/sdk/terminal/tui/piAdapter.js +46 -0
  509. package/dist/sdk/terminal/tui/planMode.d.ts +2 -0
  510. package/dist/sdk/terminal/tui/planMode.js +2 -0
  511. package/dist/sdk/terminal/tui/pluginCommands.d.ts +16 -0
  512. package/dist/sdk/terminal/tui/pluginCommands.js +41 -0
  513. package/dist/sdk/terminal/tui/qr.d.ts +4 -0
  514. package/dist/sdk/terminal/tui/qr.js +35 -0
  515. package/dist/sdk/terminal/tui/questionPicker.d.ts +20 -0
  516. package/dist/sdk/terminal/tui/questionPicker.js +150 -0
  517. package/dist/sdk/terminal/tui/questions.d.ts +21 -0
  518. package/dist/sdk/terminal/tui/questions.js +42 -0
  519. package/dist/sdk/terminal/tui/runtime.d.ts +117 -0
  520. package/dist/sdk/terminal/tui/runtime.js +544 -0
  521. package/dist/sdk/terminal/tui/search.d.ts +22 -0
  522. package/dist/sdk/terminal/tui/search.js +61 -0
  523. package/dist/sdk/terminal/tui/selection.d.ts +16 -0
  524. package/dist/sdk/terminal/tui/selection.js +16 -0
  525. package/dist/sdk/terminal/tui/sessionPicker.d.ts +40 -0
  526. package/dist/sdk/terminal/tui/sessionPicker.js +141 -0
  527. package/dist/sdk/terminal/tui/sessionUi.d.ts +3 -0
  528. package/dist/sdk/terminal/tui/sessionUi.js +30 -0
  529. package/dist/sdk/terminal/tui/settingsModel.d.ts +14 -0
  530. package/dist/sdk/terminal/tui/settingsModel.js +195 -0
  531. package/dist/sdk/terminal/tui/sideQuestion.d.ts +57 -0
  532. package/dist/sdk/terminal/tui/sideQuestion.js +241 -0
  533. package/dist/sdk/terminal/tui/skillInvocation.d.ts +28 -0
  534. package/dist/sdk/terminal/tui/skillInvocation.js +63 -0
  535. package/dist/sdk/terminal/tui/status.d.ts +18 -0
  536. package/dist/sdk/terminal/tui/status.js +67 -0
  537. package/dist/sdk/terminal/tui/theme.d.ts +54 -0
  538. package/dist/sdk/terminal/tui/theme.js +185 -0
  539. package/dist/sdk/terminal/tui/thinkingLevels.d.ts +11 -0
  540. package/dist/sdk/terminal/tui/thinkingLevels.js +31 -0
  541. package/dist/sdk/terminal/tui/treeModel.d.ts +79 -0
  542. package/dist/sdk/terminal/tui/treeModel.js +483 -0
  543. package/dist/sdk/terminal/tui/treePicker.d.ts +49 -0
  544. package/dist/sdk/terminal/tui/treePicker.js +251 -0
  545. package/dist/sdk/terminal/tui/ui.d.ts +49 -0
  546. package/dist/sdk/terminal/tui/ui.js +149 -0
  547. package/dist/sdk/terminal/tui/variantCommands.d.ts +32 -0
  548. package/dist/sdk/terminal/tui/variantCommands.js +359 -0
  549. package/dist/sdk/terminal/tui/workingStatus.d.ts +9 -0
  550. package/dist/sdk/terminal/tui/workingStatus.js +229 -0
  551. package/dist/sdk/terminal/variantControl.d.ts +24 -0
  552. package/dist/sdk/terminal/variantControl.js +145 -0
  553. package/dist/sdk/tools/askUser.d.ts +6 -0
  554. package/dist/sdk/tools/askUser.js +92 -0
  555. package/dist/sdk/tools/defaultSkills.d.ts +23 -0
  556. package/dist/sdk/tools/defaultSkills.js +46 -0
  557. package/dist/sdk/tools/definitions.d.ts +32 -0
  558. package/dist/sdk/tools/definitions.js +133 -0
  559. package/dist/sdk/tools/dispatch.d.ts +16 -0
  560. package/dist/sdk/tools/dispatch.js +92 -0
  561. package/dist/sdk/tools/getCapabilities.d.ts +31 -0
  562. package/dist/sdk/tools/getCapabilities.js +34 -0
  563. package/dist/sdk/tools/harnessTools.d.ts +8 -0
  564. package/dist/sdk/tools/harnessTools.js +20 -0
  565. package/dist/sdk/tools/sessionName.d.ts +16 -0
  566. package/dist/sdk/tools/sessionName.js +78 -0
  567. package/dist/sdk/tools/spawnSubagent.d.ts +4 -0
  568. package/dist/sdk/tools/spawnSubagent.js +63 -0
  569. package/dist/sdk/tools/todo.d.ts +15 -0
  570. package/dist/sdk/tools/todo.js +66 -0
  571. package/dist/sdk/tools/types.d.ts +48 -0
  572. package/dist/sdk/tools/types.js +1 -0
  573. package/dist/sdk/usage/analytics.d.ts +20 -0
  574. package/dist/sdk/usage/analytics.js +151 -0
  575. package/dist/sdk/usage/ledger.d.ts +38 -0
  576. package/dist/sdk/usage/ledger.js +142 -0
  577. package/dist/sdk/usage/limits/adapters.d.ts +11 -0
  578. package/dist/sdk/usage/limits/adapters.js +349 -0
  579. package/dist/sdk/usage/limits/capture.d.ts +8 -0
  580. package/dist/sdk/usage/limits/capture.js +47 -0
  581. package/dist/sdk/usage/limits/http.d.ts +12 -0
  582. package/dist/sdk/usage/limits/http.js +51 -0
  583. package/dist/sdk/usage/limits/normalize.d.ts +15 -0
  584. package/dist/sdk/usage/limits/normalize.js +211 -0
  585. package/dist/sdk/usage/limits/service.d.ts +30 -0
  586. package/dist/sdk/usage/limits/service.js +176 -0
  587. package/dist/sdk/usage/limits/types.d.ts +65 -0
  588. package/dist/sdk/usage/limits/types.js +1 -0
  589. package/dist/sdk/usage/serverMethods.d.ts +3 -0
  590. package/dist/sdk/usage/serverMethods.js +22 -0
  591. package/dist/sdk/usage/service.d.ts +32 -0
  592. package/dist/sdk/usage/service.js +66 -0
  593. package/dist/sdk/usage/settings.d.ts +7 -0
  594. package/dist/sdk/usage/settings.js +28 -0
  595. package/dist/sdk/usage/types.d.ts +60 -0
  596. package/dist/sdk/usage/types.js +4 -0
  597. package/dist/sdk/variant/components.d.ts +34 -0
  598. package/dist/sdk/variant/components.js +230 -0
  599. package/dist/sdk/variant/materialise.d.ts +66 -0
  600. package/dist/sdk/variant/materialise.js +81 -0
  601. package/dist/sdk/variant/migrate.d.ts +4 -0
  602. package/dist/sdk/variant/migrate.js +41 -0
  603. package/dist/sdk/variant/seed.d.ts +20 -0
  604. package/dist/sdk/variant/seed.js +116 -0
  605. package/dist/sdk/variant/store.d.ts +114 -0
  606. package/dist/sdk/variant/store.js +256 -0
  607. package/dist/sdk/variant/surface.d.ts +56 -0
  608. package/dist/sdk/variant/surface.js +81 -0
  609. package/dist/sdk/variant/trust.d.ts +27 -0
  610. package/dist/sdk/variant/trust.js +64 -0
  611. package/dist/sdk/variant/variant.d.ts +71 -0
  612. package/dist/sdk/variant/variant.js +331 -0
  613. package/dist/sdk/web/markdown.d.ts +10 -0
  614. package/dist/sdk/web/markdown.js +66 -0
  615. package/dist/sdk/web/part.d.ts +10 -0
  616. package/dist/sdk/web/part.js +6 -0
  617. package/dist/sdk/web/safeRequest.d.ts +34 -0
  618. package/dist/sdk/web/safeRequest.js +175 -0
  619. package/dist/sdk/web/search.d.ts +53 -0
  620. package/dist/sdk/web/search.js +168 -0
  621. package/dist/sdk/web/serverMethods.d.ts +3 -0
  622. package/dist/sdk/web/serverMethods.js +7 -0
  623. package/dist/sdk/web/text.d.ts +2 -0
  624. package/dist/sdk/web/text.js +7 -0
  625. package/dist/sdk/web/tools.d.ts +22 -0
  626. package/dist/sdk/web/tools.js +195 -0
  627. package/dist/sdk/web/turndown-plugin-gfm.d.ts +4 -0
  628. package/dist/sdk/wiki/notes.d.ts +68 -0
  629. package/dist/sdk/wiki/notes.js +297 -0
  630. package/dist/sdk/wiki/serverMethods.d.ts +3 -0
  631. package/dist/sdk/wiki/serverMethods.js +26 -0
  632. package/dist/sdk/worktrees/cli.d.ts +11 -0
  633. package/dist/sdk/worktrees/cli.js +146 -0
  634. package/dist/sdk/worktrees/copy.d.ts +9 -0
  635. package/dist/sdk/worktrees/copy.js +111 -0
  636. package/dist/sdk/worktrees/git.d.ts +18 -0
  637. package/dist/sdk/worktrees/git.js +89 -0
  638. package/dist/sdk/worktrees/serverMethods.d.ts +3 -0
  639. package/dist/sdk/worktrees/serverMethods.js +30 -0
  640. package/dist/sdk/worktrees/service.d.ts +73 -0
  641. package/dist/sdk/worktrees/service.js +483 -0
  642. package/dist/sdk/worktrees/setup.d.ts +23 -0
  643. package/dist/sdk/worktrees/setup.js +65 -0
  644. package/dist/sdk/worktrees/snapshot.d.ts +16 -0
  645. package/dist/sdk/worktrees/snapshot.js +83 -0
  646. package/dist/sdk/worktrees/types.d.ts +91 -0
  647. package/dist/sdk/worktrees/types.js +1 -0
  648. package/dist/sdk/world/actions.d.ts +23 -0
  649. package/dist/sdk/world/actions.js +31 -0
  650. package/dist/sdk/world/cli.d.ts +12 -0
  651. package/dist/sdk/world/cli.js +166 -0
  652. package/dist/sdk/world/images.d.ts +20 -0
  653. package/dist/sdk/world/images.js +48 -0
  654. package/dist/sdk/world/untrusted.d.ts +12 -0
  655. package/dist/sdk/world/untrusted.js +20 -0
  656. package/dist/sdk/world/world.d.ts +75 -0
  657. package/dist/sdk/world/world.js +117 -0
  658. package/dist/terminal-opentui.js +30986 -0
  659. package/dist/terminal-pi.js +3008 -610
  660. package/docs/README.md +45 -1
  661. package/docs/architecture/00-overview.md +171 -0
  662. package/docs/architecture/01-extension-points.md +78 -0
  663. package/docs/architecture/02-sessions-and-runs.md +505 -0
  664. package/docs/architecture/03-variants.md +122 -0
  665. package/docs/architecture/04-prompt.md +277 -0
  666. package/docs/architecture/05-refinement.md +134 -0
  667. package/docs/architecture/06-plugins-and-capabilities.md +208 -0
  668. package/docs/architecture/07-tools-and-gate.md +245 -0
  669. package/docs/architecture/08-memory-and-history.md +100 -0
  670. package/docs/architecture/09-accounts-and-connectors.md +153 -0
  671. package/docs/architecture/10-server-protocol.md +403 -0
  672. package/docs/architecture/11-terminal.md +555 -0
  673. package/docs/architecture/12-storage.md +118 -0
  674. package/docs/architecture/13-world-tools.md +114 -0
  675. package/docs/architecture/14-surfaces-and-parity.md +151 -0
  676. package/docs/architecture/15-remote-control.md +120 -0
  677. package/docs/architecture/README.md +143 -0
  678. package/docs/architecture/proposals/PROP-0001-reporting-section.md +106 -0
  679. package/docs/architecture/proposals/PROP-0002-retain-rollout-workspaces.md +104 -0
  680. package/docs/architecture/proposals/PROP-0003-executor-settings.md +81 -0
  681. package/docs/architecture/proposals/PROP-0004-flexible-reporting-guidance.md +71 -0
  682. package/docs/architecture/proposals/PROP-0005-xharness-cli-name.md +78 -0
  683. package/docs/architecture/proposals/PROP-0006-run-checklist.md +72 -0
  684. package/docs/architecture/proposals/PROP-0007-run-continuation.md +80 -0
  685. package/docs/architecture/proposals/PROP-0008-lessons-from-runs.md +80 -0
  686. package/docs/architecture/proposals/PROP-0009-foundation-and-variants.md +78 -0
  687. package/docs/architecture/proposals/PROP-0010-session-names.md +73 -0
  688. package/docs/architecture/proposals/PROP-0011-doctor.md +63 -0
  689. package/docs/architecture/proposals/PROP-0012-release-baseline.md +56 -0
  690. package/docs/architecture/proposals/PROP-0013-resource-browser.md +58 -0
  691. package/docs/architecture/proposals/PROP-0014-fullscreen-browser-tabs.md +58 -0
  692. package/docs/architecture/proposals/PROP-0015-one-capability-surface.md +88 -0
  693. package/docs/architecture/proposals/PROP-0016-managed-worktrees.md +156 -0
  694. package/docs/architecture/proposals/PROP-0017-page-annotations.md +131 -0
  695. package/docs/architecture/proposals/PROP-0018-annotation-queue-and-app-targets.md +183 -0
  696. package/docs/architecture/proposals/PROP-0019-contextual-side-questions.md +122 -0
  697. package/docs/architecture/proposals/PROP-0020-builtin-feature-plugins.md +105 -0
  698. package/docs/architecture/proposals/PROP-0021-command-namespaces-and-duplicates.md +99 -0
  699. package/docs/architecture/proposals/PROP-0022-plan-only-questions.md +102 -0
  700. package/docs/architecture/proposals/PROP-0023-xagent-cli-name.md +61 -0
  701. package/docs/architecture/proposals/PROP-0024-question-sketch-previews.md +130 -0
  702. package/docs/architecture/proposals/PROP-0025-contextual-question-wireframes.md +49 -0
  703. package/docs/architecture/proposals/PROP-0026-connected-sketch-display.md +96 -0
  704. package/docs/architecture/proposals/PROP-0027-xingular-agent-product-identity.md +60 -0
  705. package/docs/architecture/proposals/PROP-0028-normalize-question-wireframes.md +55 -0
  706. package/docs/architecture/proposals/PROP-0029-agent-profiles.md +124 -0
  707. package/docs/architecture/proposals/PROP-0030-subagent-title.md +86 -0
  708. package/docs/architecture/proposals/PROP-0031-plugin-command-owner-namespaces.md +54 -0
  709. package/docs/architecture/proposals/PROP-0032-planning-quality.md +196 -0
  710. package/docs/architecture/proposals/PROP-0033-compaction-plan-checkpoints.md +75 -0
  711. package/docs/architecture/proposals/PROP-0034-conversation-fast-mode.md +120 -0
  712. package/docs/architecture/proposals/PROP-0035-retain-subagent-status.md +47 -0
  713. package/docs/architecture/proposals/PROP-0036-first-class-harness-commands.md +59 -0
  714. package/docs/architecture/proposals/PROP-0037-workspace-write-boundary.md +63 -0
  715. package/docs/architecture/proposals/PROP-0038-annotate-open-shadow-roots.md +73 -0
  716. package/docs/architecture/proposals/PROP-0039-workspace-boundary-hardening.md +139 -0
  717. package/docs/architecture/proposals/PROP-0040-one-launch-path.md +87 -0
  718. package/docs/architecture/proposals/PROP-0041-bounded-work-slices.md +260 -0
  719. package/docs/architecture/proposals/PROP-0042-usage-and-provider-limits.md +127 -0
  720. package/docs/architecture/proposals/PROP-0043-read-only-plan-bash.md +74 -0
  721. package/docs/architecture/proposals/PROP-0044-work-slice-defaults.md +93 -0
  722. package/docs/architecture/proposals/PROP-0045-rename-checklist-to-todo.md +132 -0
  723. package/docs/architecture/proposals/PROP-0046-progress-aware-stall-guards.md +82 -0
  724. package/docs/architecture/proposals/PROP-0047-plugins-hub-separation.md +122 -0
  725. package/docs/architecture/proposals/PROP-0048-simple-annotate.md +85 -0
  726. package/docs/architecture/proposals/PROP-0049-context-attribution.md +415 -0
  727. package/docs/architecture/proposals/PROP-0050-run-stop-codes-and-refusals.md +30 -0
  728. package/docs/architecture/proposals/PROP-0051-unfinished-run-handoff.md +110 -0
  729. package/docs/architecture/proposals/PROP-0052-terminal-refine-and-variant-switch.md +111 -0
  730. package/docs/architecture/proposals/README.md +123 -0
  731. package/docs/decisions/ADR-0001-owned-terminal.md +10 -3
  732. package/docs/decisions/ADR-0003-shared-asynchronous-subagents.md +3 -1
  733. package/docs/decisions/ADR-0004-fullscreen-terminal-layout.md +3 -2
  734. package/docs/decisions/ADR-0006-opentui-only-terminal.md +47 -0
  735. package/docs/decisions/ADR-0007-reporting-section.md +33 -0
  736. package/docs/decisions/ADR-0008-flexible-reporting-guidance.md +41 -0
  737. package/docs/decisions/ADR-0009-xharness-command.md +39 -0
  738. package/docs/decisions/ADR-0010-lessons-in-the-wiki.md +31 -0
  739. package/docs/decisions/ADR-0011-foundation-and-variants.md +28 -0
  740. package/docs/decisions/ADR-0012-native-session-names.md +34 -0
  741. package/docs/decisions/ADR-0013-doctor.md +27 -0
  742. package/docs/decisions/ADR-0014-public-release-baseline.md +22 -0
  743. package/docs/decisions/ADR-0015-resource-browser.md +28 -0
  744. package/docs/decisions/ADR-0016-fullscreen-browser-tabs.md +31 -0
  745. package/docs/decisions/ADR-0017-one-capability-surface.md +34 -0
  746. package/docs/decisions/ADR-0018-builtin-feature-plugins.md +35 -0
  747. package/docs/decisions/ADR-0019-managed-git-worktrees.md +31 -0
  748. package/docs/decisions/ADR-0020-page-annotations.md +37 -0
  749. package/docs/decisions/ADR-0021-required-command-namespaces.md +40 -0
  750. package/docs/decisions/ADR-0022-plan-only-question-tools.md +34 -0
  751. package/docs/decisions/ADR-0023-contextual-side-question-runs.md +35 -0
  752. package/docs/decisions/ADR-0024-xagent-command.md +40 -0
  753. package/docs/decisions/ADR-0025-question-choice-sketches.md +49 -0
  754. package/docs/decisions/ADR-0026-contextual-question-wireframes.md +58 -0
  755. package/docs/decisions/ADR-0027-connected-sketch-display.md +62 -0
  756. package/docs/decisions/ADR-0028-xingular-agent-product-identity.md +56 -0
  757. package/docs/decisions/ADR-0029-normalized-question-wireframe-borders.md +33 -0
  758. package/docs/decisions/ADR-0030-agent-profiles.md +43 -0
  759. package/docs/decisions/ADR-0031-plugin-command-owner-namespaces.md +37 -0
  760. package/docs/decisions/ADR-0032-compaction-run-checkpoints.md +35 -0
  761. package/docs/decisions/ADR-0033-plan-mode-research-delegation.md +47 -0
  762. package/docs/decisions/ADR-0034-first-class-harness-terminal-commands.md +25 -0
  763. package/docs/decisions/ADR-0035-one-launch-path.md +40 -0
  764. package/docs/decisions/ADR-0036-workspace-write-operation-boundary.md +54 -0
  765. package/docs/decisions/ADR-0037-usage-ledger-and-provider-limits.md +44 -0
  766. package/docs/decisions/ADR-0038-plan-bash-os-read-only.md +29 -0
  767. package/docs/decisions/ADR-0039-progress-aware-stall-guards.md +43 -0
  768. package/docs/decisions/ADR-0040-architecture-change-workflow.md +31 -0
  769. package/docs/decisions/ADR-0041-plugins-hub-separation.md +41 -0
  770. package/docs/decisions/ADR-0042-windows-shell-without-sandbox.md +40 -0
  771. package/docs/decisions/ADR-0043-parents-continue-stopped-subagents.md +49 -0
  772. package/docs/decisions/ADR-0044-annotations-pending-or-sent.md +24 -0
  773. package/docs/decisions/ADR-0045-default-plugin-authoring-skill.md +9 -0
  774. package/docs/decisions/ADR-0046-hash-bound-plugin-proposals.md +20 -0
  775. package/docs/decisions/ADR-0047-links-open-with-the-os-handler.md +47 -0
  776. package/docs/decisions/ADR-0048-required-skills-from-a-message.md +42 -0
  777. package/docs/decisions/ADR-0050-approved-window-screenshots.md +19 -0
  778. package/docs/decisions/ADR-0051-terminal-decision-wait.md +10 -0
  779. package/docs/decisions/ADR-0052-per-profile-subagent-budgets.md +25 -0
  780. package/docs/decisions/ADR-0053-no-repeated-work-guard.md +45 -0
  781. package/docs/decisions/ADR-0054-terminal-reply-heartbeat-and-stall.md +52 -0
  782. package/docs/decisions/ADR-0055-plan-output-repair.md +51 -0
  783. package/docs/decisions/ADR-0056-remote-control.md +53 -0
  784. package/docs/decisions/ADR-0057-structured-plan-outcomes.md +39 -0
  785. package/docs/decisions/ADR-0058-ask-user-only-plan-clarification.md +36 -0
  786. package/docs/decisions/ADR-0059-run-diagnostic-evidence.md +35 -0
  787. package/docs/decisions/ADR-0060-approvals-are-controls.md +40 -0
  788. package/docs/decisions/ADR-0061-strict-plugin-command-namespaces.md +41 -0
  789. package/docs/decisions/ADR-0062-shared-account-state.md +67 -0
  790. package/docs/decisions/ADR-0063-unfinished-work-handoffs.md +34 -0
  791. package/docs/decisions/ADR-0064-account-model-fallback-on-resume.md +79 -0
  792. package/docs/decisions/ADR-0065-variant-switch-at-turn-boundaries.md +31 -0
  793. package/docs/decisions/ADR-0066-guided-refinement-from-turn-snapshots.md +37 -0
  794. package/docs/decisions/ADR-0067-cache-stable-compaction-checkpoint.md +54 -0
  795. package/docs/decisions/ADR-0068-scope-and-completion-report.md +60 -0
  796. package/docs/decisions/ADR-0069-stop-gate-and-finish.md +136 -0
  797. package/docs/decisions/ADR-0070-terminal-slice-continuation.md +49 -0
  798. package/docs/decisions/ADR-0071-completion-check.md +104 -0
  799. package/docs/decisions/ADR-0072-codex-prompts-and-goal.md +108 -0
  800. package/docs/decisions/ADR-0073-large-reporting-prompt.md +89 -0
  801. package/docs/decisions/ADR-0074-report-content-not-report-blocks.md +90 -0
  802. package/docs/decisions/ADR-0075-no-todo-gate.md +84 -0
  803. package/docs/decisions/ADR-0076-codex-final-answer-verbatim.md +98 -0
  804. package/docs/decisions/ADR-0077-plan-runs-may-conclude-no-plan-needed.md +120 -0
  805. package/docs/decisions/ADR-0078-child-aware-stall-watch.md +46 -0
  806. package/docs/decisions/ADR-0079-phase-led-reporting-guidance.md +72 -0
  807. package/docs/decisions/ADR-0080-fixed-width-question-sketch-canvas.md +50 -0
  808. package/docs/decisions/ADR-0081-no-work-slice-budget-by-default.md +36 -0
  809. package/docs/decisions/ADR-0082-connected-brave-browser.md +72 -0
  810. package/docs/decisions/ADR-0083-one-live-session-runtime.md +256 -0
  811. package/docs/doctor.md +95 -0
  812. package/docs/experiments/EXP-0001-terminal-input-latency/plan.md +81 -0
  813. package/docs/experiments/EXP-0001-terminal-input-latency/results.md +46 -0
  814. package/docs/experiments/EXP-0002-opentui-typing-latency/plan.md +70 -0
  815. package/docs/experiments/EXP-0002-opentui-typing-latency/results.md +92 -0
  816. package/docs/experiments/EXP-0003-performance-audit/data/session-runtime-replication.json +420 -0
  817. package/docs/experiments/EXP-0003-performance-audit/data/session-runtime.json +420 -0
  818. package/docs/experiments/EXP-0003-performance-audit/data/terminal-compact.json +376 -0
  819. package/docs/experiments/EXP-0003-performance-audit/data/terminal-history.json +422 -0
  820. package/docs/experiments/EXP-0003-performance-audit/data/terminal-question.json +95 -0
  821. package/docs/experiments/EXP-0003-performance-audit/data/terminal-wide.json +1036 -0
  822. package/docs/experiments/EXP-0003-performance-audit/plan.md +109 -0
  823. package/docs/experiments/EXP-0003-performance-audit/results.md +151 -0
  824. package/docs/features/README.md +46 -0
  825. package/docs/features/automations/README.md +41 -0
  826. package/docs/features/cores/README.md +39 -0
  827. package/docs/features/google-harness2/README.md +52 -0
  828. package/docs/features/integrations/README.md +40 -0
  829. package/docs/features/interfaces/README.md +29 -0
  830. package/docs/features/memory/README.md +28 -0
  831. package/docs/future-work.md +48 -0
  832. package/docs/handoff-2026-10-25-app-parity-and-solo-tabs.md +202 -0
  833. package/docs/parity.md +158 -0
  834. package/docs/releases/1.0.0.md +40 -0
  835. package/docs/releases/1.1.1.md +28 -0
  836. package/docs/releases/1.2.0.md +49 -0
  837. package/docs/releases/1.3.0.md +21 -0
  838. package/docs/releases/1.3.1-unstable.1.md +8 -0
  839. package/docs/releases/1.3.1-unstable.2.md +11 -0
  840. package/docs/releases/1.3.1-unstable.3.md +54 -0
  841. package/docs/releases/1.3.1-unstable.4.md +56 -0
  842. package/docs/releases/1.3.1-unstable.5.md +53 -0
  843. package/docs/releases/1.3.1-unstable.6.md +31 -0
  844. package/docs/releases/1.3.1-unstable.7.md +17 -0
  845. package/docs/releases/1.3.1-unstable.8.md +19 -0
  846. package/docs/releases/1.3.1-unstable.9.md +54 -0
  847. package/docs/releases/1.4.0-unstable.md +25 -0
  848. package/docs/releases/1.5.0-unstable.md +32 -0
  849. package/docs/releases/1.5.1-unstable.md +24 -0
  850. package/docs/releases/1.6.0-unstable.md +59 -0
  851. package/docs/releases/2.0.1-unstable.md +63 -0
  852. package/docs/releases/4.0.0.md +47 -0
  853. package/docs/releases/README.md +49 -0
  854. package/docs/study/00-index.md +112 -0
  855. package/docs/study/STUDY-0003-long-horizon-runs.md +210 -0
  856. package/docs/study/STUDY-0004-turn-end-controls.md +130 -0
  857. package/docs/study/STUDY-0005-skill-installation-guidance.md +146 -0
  858. package/docs/study/STUDY-0006-reporting-prompts.md +119 -0
  859. package/docs/study/STUDY-0007-claude-code-prompt.md +162 -0
  860. package/docs/study/STUDY-0008-browser-control.md +281 -0
  861. package/docs/study/STUDY-0009-claude-code-reporting.md +205 -0
  862. package/docs/study/arms/00-matrix.md +20 -0
  863. package/docs/study/arms/01-system-prompt.md +211 -0
  864. package/docs/study/arms/02-tools.md +79 -0
  865. package/docs/study/arms/03-subagents.md +90 -0
  866. package/docs/study/arms/04-skills.md +81 -0
  867. package/docs/study/arms/05-context-management.md +90 -0
  868. package/docs/study/arms/06-memory.md +90 -0
  869. package/docs/study/arms/07-governance.md +71 -0
  870. package/docs/study/arms/08-execution.md +69 -0
  871. package/docs/study/arms/09-observability.md +60 -0
  872. package/docs/study/arms/10-refinement.md +110 -0
  873. package/docs/study/autonomous-engineering-sources.md +277 -0
  874. package/docs/study/autonomy-sources.md +147 -0
  875. package/docs/study/btw-comparison.md +37 -0
  876. package/docs/study/feature-gap-review.md +42 -0
  877. package/docs/study/insights.md +123 -0
  878. package/docs/study/proactive-autonomy.md +408 -0
  879. package/docs/study/roadmap.md +72 -0
  880. package/docs/study/sources/claude-code.md +56 -0
  881. package/docs/study/sources/deepseek-harness.md +102 -0
  882. package/docs/study/sources/harness2.md +50 -0
  883. package/docs/study/sources/kimi-cli.md +42 -0
  884. package/docs/study/sources/omp.md +93 -0
  885. package/docs/study/sources/opencode.md +43 -0
  886. package/docs/study/sources/openhands.md +46 -0
  887. package/docs/study/sources/smolagents.md +40 -0
  888. package/docs/study/sources/swe-agent.md +34 -0
  889. package/docs/study/tui-resource-browser.md +78 -0
  890. package/docs/system-prompt-design.md +196 -0
  891. package/docs/terminal-tui.md +887 -109
  892. package/package.json +46 -13
  893. package/src/accounts/accounts.test.ts +0 -419
  894. package/src/accounts/accounts.ts +0 -760
  895. package/src/accounts/env.test.ts +0 -95
  896. package/src/accounts/env.ts +0 -338
  897. package/src/accounts/secrets.ts +0 -50
  898. package/src/accounts/store.ts +0 -338
  899. package/src/capabilities/api.ts +0 -75
  900. package/src/capabilities/runSnapshot.ts +0 -59
  901. package/src/capabilities/types.ts +0 -34
  902. package/src/cli.ts +0 -118
  903. package/src/core/bus.test.ts +0 -22
  904. package/src/core/bus.ts +0 -49
  905. package/src/core/changes.ts +0 -33
  906. package/src/core/env.ts +0 -27
  907. package/src/core/errors.ts +0 -32
  908. package/src/core/frontmatter.ts +0 -47
  909. package/src/core/fs.test.ts +0 -38
  910. package/src/core/fs.ts +0 -92
  911. package/src/core/index.ts +0 -193
  912. package/src/core/path.test.ts +0 -14
  913. package/src/core/path.ts +0 -79
  914. package/src/core/projects.ts +0 -90
  915. package/src/core/text.ts +0 -39
  916. package/src/harness.ts +0 -322
  917. package/src/hub/catalog.json +0 -123
  918. package/src/hub/cli.ts +0 -59
  919. package/src/hub/hub.test.ts +0 -205
  920. package/src/hub/hub.ts +0 -256
  921. package/src/hub/schema.ts +0 -81
  922. package/src/index.ts +0 -80
  923. package/src/mcp/connections.ts +0 -641
  924. package/src/mcp/manager.ts +0 -130
  925. package/src/mcp/oauth.ts +0 -195
  926. package/src/mcp/scopeMigration.test.ts +0 -79
  927. package/src/mcp/scopeMigration.ts +0 -204
  928. package/src/mcp/service.test.ts +0 -422
  929. package/src/mcp/service.ts +0 -560
  930. package/src/mcp/types.ts +0 -118
  931. package/src/memory/api.test.ts +0 -82
  932. package/src/memory/api.ts +0 -303
  933. package/src/memory/blocks.test.ts +0 -78
  934. package/src/memory/blocks.ts +0 -408
  935. package/src/memory/caller.ts +0 -69
  936. package/src/memory/curation.test.ts +0 -206
  937. package/src/memory/curation.ts +0 -64
  938. package/src/memory/dispatch.ts +0 -64
  939. package/src/memory/facts.test.ts +0 -41
  940. package/src/memory/facts.ts +0 -248
  941. package/src/memory/graph.ts +0 -103
  942. package/src/memory/health.test.ts +0 -130
  943. package/src/memory/health.ts +0 -74
  944. package/src/memory/maintainer.ts +0 -272
  945. package/src/memory/maintenance.test.ts +0 -192
  946. package/src/memory/maintenance.ts +0 -679
  947. package/src/memory/migrate.ts +0 -79
  948. package/src/memory/operations.ts +0 -150
  949. package/src/memory/proposals.test.ts +0 -168
  950. package/src/memory/proposals.ts +0 -584
  951. package/src/memory/recall.test.ts +0 -115
  952. package/src/memory/recall.ts +0 -279
  953. package/src/memory/references.ts +0 -77
  954. package/src/memory/runContext.ts +0 -93
  955. package/src/memory/secrets.ts +0 -6
  956. package/src/memory/store.test.ts +0 -66
  957. package/src/memory/store.ts +0 -385
  958. package/src/memory/trajectory.test.ts +0 -178
  959. package/src/memory/trajectory.ts +0 -220
  960. package/src/memory/wiki.test.ts +0 -47
  961. package/src/memory/wiki.ts +0 -423
  962. package/src/memory/wikiIndex.test.ts +0 -88
  963. package/src/memory/wikiIndex.ts +0 -117
  964. package/src/plugins/api.ts +0 -181
  965. package/src/plugins/attachments.test.ts +0 -84
  966. package/src/plugins/attachments.ts +0 -141
  967. package/src/plugins/builtin.ts +0 -84
  968. package/src/plugins/catalogue.test.ts +0 -254
  969. package/src/plugins/catalogue.ts +0 -251
  970. package/src/plugins/cli.ts +0 -184
  971. package/src/plugins/discover.ts +0 -151
  972. package/src/plugins/firstParty.test.ts +0 -143
  973. package/src/plugins/firstParty.ts +0 -129
  974. package/src/plugins/hooks.test.ts +0 -250
  975. package/src/plugins/hooks.ts +0 -239
  976. package/src/plugins/identity.ts +0 -37
  977. package/src/plugins/install.test.ts +0 -107
  978. package/src/plugins/install.ts +0 -106
  979. package/src/plugins/inventory.ts +0 -123
  980. package/src/plugins/manifest.ts +0 -76
  981. package/src/plugins/plugins.test.ts +0 -205
  982. package/src/plugins/plugins.ts +0 -189
  983. package/src/plugins/proposal.ts +0 -121
  984. package/src/plugins/runtime.test.ts +0 -40
  985. package/src/plugins/runtime.ts +0 -82
  986. package/src/plugins/trust.ts +0 -142
  987. package/src/plugins/types.ts +0 -149
  988. package/src/prompt/compile.test.ts +0 -261
  989. package/src/prompt/compile.ts +0 -732
  990. package/src/server/methods.ts +0 -355
  991. package/src/server/remote.ts +0 -77
  992. package/src/server/rpc.ts +0 -116
  993. package/src/server/serve.ts +0 -28
  994. package/src/server/server.test.ts +0 -193
  995. package/src/sessions/approvals.test.ts +0 -49
  996. package/src/sessions/approvals.ts +0 -140
  997. package/src/sessions/contracts.ts +0 -336
  998. package/src/sessions/conversation.test.ts +0 -233
  999. package/src/sessions/extensionSession.test.ts +0 -74
  1000. package/src/sessions/extensionUi.test.ts +0 -65
  1001. package/src/sessions/extensionUi.ts +0 -102
  1002. package/src/sessions/history.ts +0 -51
  1003. package/src/sessions/lineageJoin.ts +0 -75
  1004. package/src/sessions/policy.ts +0 -36
  1005. package/src/sessions/pricing.ts +0 -60
  1006. package/src/sessions/questionBatches.test.ts +0 -110
  1007. package/src/sessions/reasoningSummaries.ts +0 -59
  1008. package/src/sessions/registry.ts +0 -412
  1009. package/src/sessions/runIndex.ts +0 -99
  1010. package/src/sessions/runStore.test.ts +0 -152
  1011. package/src/sessions/runStore.ts +0 -346
  1012. package/src/sessions/runner.ts +0 -610
  1013. package/src/sessions/runtimeResources.test.ts +0 -61
  1014. package/src/sessions/sessions.test.ts +0 -588
  1015. package/src/sessions/sessions.ts +0 -331
  1016. package/src/sessions/subagentService.test.ts +0 -159
  1017. package/src/sessions/subagentService.ts +0 -236
  1018. package/src/sessions/subagents.ts +0 -97
  1019. package/src/skills/registry.test.ts +0 -104
  1020. package/src/skills/registry.ts +0 -413
  1021. package/src/terminal/accountsMenu.test.ts +0 -225
  1022. package/src/terminal/accountsMenu.ts +0 -382
  1023. package/src/terminal/cli.ts +0 -149
  1024. package/src/terminal/client.ts +0 -74
  1025. package/src/terminal/control.test.ts +0 -23
  1026. package/src/terminal/control.ts +0 -23
  1027. package/src/terminal/controller.ts +0 -354
  1028. package/src/terminal/hubMenu.ts +0 -24
  1029. package/src/terminal/launch.test.ts +0 -25
  1030. package/src/terminal/launch.ts +0 -48
  1031. package/src/terminal/piExtension.lifecycle.test.ts +0 -55
  1032. package/src/terminal/piExtension.ts +0 -295
  1033. package/src/terminal/pluginControl.test.ts +0 -146
  1034. package/src/terminal/pluginMenu.ts +0 -112
  1035. package/src/terminal/socket.test.ts +0 -94
  1036. package/src/terminal/socket.ts +0 -256
  1037. package/src/terminal/standalone.test.ts +0 -167
  1038. package/src/terminal/standalone.ts +0 -165
  1039. package/src/terminal/terminal.test.ts +0 -534
  1040. package/src/terminal/terminals.ts +0 -661
  1041. package/src/terminal/trajectory.test.ts +0 -66
  1042. package/src/terminal/trajectory.ts +0 -44
  1043. package/src/terminal/tui/application.test.ts +0 -290
  1044. package/src/terminal/tui/application.ts +0 -653
  1045. package/src/terminal/tui/commands.test.ts +0 -278
  1046. package/src/terminal/tui/commands.ts +0 -443
  1047. package/src/terminal/tui/dialogs.ts +0 -301
  1048. package/src/terminal/tui/editor.test.ts +0 -113
  1049. package/src/terminal/tui/editor.ts +0 -109
  1050. package/src/terminal/tui/keybindings.test.ts +0 -30
  1051. package/src/terminal/tui/keybindings.ts +0 -59
  1052. package/src/terminal/tui/piAdapter.ts +0 -62
  1053. package/src/terminal/tui/planMode.test.ts +0 -10
  1054. package/src/terminal/tui/planMode.ts +0 -12
  1055. package/src/terminal/tui/presentation.test.ts +0 -79
  1056. package/src/terminal/tui/questions.test.ts +0 -41
  1057. package/src/terminal/tui/questions.ts +0 -47
  1058. package/src/terminal/tui/runtime.socket.test.ts +0 -178
  1059. package/src/terminal/tui/runtime.test.ts +0 -225
  1060. package/src/terminal/tui/runtime.ts +0 -403
  1061. package/src/terminal/tui/screen.test.ts +0 -143
  1062. package/src/terminal/tui/screen.ts +0 -121
  1063. package/src/terminal/tui/sessionUi.ts +0 -24
  1064. package/src/terminal/tui/settings.test.ts +0 -150
  1065. package/src/terminal/tui/settings.ts +0 -188
  1066. package/src/terminal/tui/skillInvocation.test.ts +0 -71
  1067. package/src/terminal/tui/skillInvocation.ts +0 -51
  1068. package/src/terminal/tui/status.test.ts +0 -48
  1069. package/src/terminal/tui/status.ts +0 -82
  1070. package/src/terminal/tui/theme.ts +0 -185
  1071. package/src/terminal/tui/tools.test.ts +0 -145
  1072. package/src/terminal/tui/tools.ts +0 -142
  1073. package/src/terminal/tui/trajectoryPanel.test.ts +0 -99
  1074. package/src/terminal/tui/trajectoryPanel.ts +0 -226
  1075. package/src/terminal/tui/transcript.test.ts +0 -39
  1076. package/src/terminal/tui/transcript.ts +0 -135
  1077. package/src/terminal/tui/ui.test.ts +0 -313
  1078. package/src/terminal/tui/ui.ts +0 -166
  1079. package/src/terminal/tui/welcome.ts +0 -102
  1080. package/src/terminal/tui/workingStatus.test.ts +0 -44
  1081. package/src/terminal/tui/workingStatus.ts +0 -238
  1082. package/src/tools/askUser.test.ts +0 -69
  1083. package/src/tools/askUser.ts +0 -59
  1084. package/src/tools/definitions.ts +0 -228
  1085. package/src/tools/maintenance.ts +0 -29
  1086. package/src/tools/memoryTools.ts +0 -22
  1087. package/src/tools/pluginPropose.ts +0 -41
  1088. package/src/tools/registryWrite.test.ts +0 -101
  1089. package/src/tools/registryWrite.ts +0 -182
  1090. package/src/tools/spawnSubagent.ts +0 -47
  1091. package/src/tools/types.ts +0 -41
  1092. package/src/web/safeRequest.ts +0 -171
  1093. package/src/web/text.ts +0 -53
  1094. package/src/web/tools.ts +0 -134
  1095. package/src/web/web.test.ts +0 -141
@@ -1,7 +1,115 @@
1
1
  # Harness terminal frontend
2
2
 
3
- Status: implemented in the working tree; publication is separate. Last updated: 2026-10-18.
4
- Decision: [ADR-0001](decisions/ADR-0001-owned-terminal.md).
3
+ Status: terminal behavior and message-delivery contract
4
+ ([known drift D-20](architecture/README.md#known-drift)).
5
+ Decision: [ADR-0001](decisions/ADR-0001-owned-terminal.md),
6
+ [ADR-0006](decisions/ADR-0006-opentui-only-terminal.md),
7
+ [ADR-0009](decisions/ADR-0009-xharness-command.md),
8
+ [ADR-0021](decisions/ADR-0021-required-command-namespaces.md),
9
+ [ADR-0024](decisions/ADR-0024-xagent-command.md),
10
+ [ADR-0026](decisions/ADR-0026-contextual-question-wireframes.md),
11
+ [ADR-0027](decisions/ADR-0027-connected-sketch-display.md),
12
+ [ADR-0028](decisions/ADR-0028-xingular-agent-product-identity.md).
13
+
14
+ ## OpenTUI terminal
15
+
16
+ OpenTUI/Solid, built from [`src/terminal/opentui/`](../src/terminal/opentui/), is the only terminal
17
+ frontend. It needs Bun 1.3.14 or newer for its build and runtime:
18
+
19
+ ```sh
20
+ npm run build:tui
21
+ node dist/cli.js terminal
22
+ ```
23
+
24
+ `npm run build` builds `dist/terminal-opentui.js`; without Bun the build fails, because there is no
25
+ second frontend to fall back to. The harness passes `--conditions=browser` when it launches the
26
+ bundle so Solid resolves to its client build, not its server build. `XINGULAR_HARNESS_BUN`
27
+ overrides the Bun executable.
28
+
29
+ [`app.ts`](../src/terminal/opentui/app.ts) owns the terminal lifecycle and reuses the shared
30
+ `TerminalRuntime`, session replacement, commands, decisions, account pinning and run records. It
31
+ projects the runtime's snapshot and transcript into an OpenCode-inspired view, with a native
32
+ OpenTUI textarea for the prompt and `Ctrl+K` for the command palette. `Return` sends or queues a
33
+ follow-up; `Cmd+Return`, `Ctrl+Return` or `Alt+Return` steers a running reply, and `Shift+Return`
34
+ inserts a newline. Typing `/` at the start of the draft filters matching commands, and typing `$` at any word start
35
+ filters matching skills; `Tab` inserts the selected entry and leaves the cursor after it. A `$`
36
+ entry replaces only the token being typed, so text before and after it stays in place.
37
+ With an empty composer, unmodified Up recalls the latest non-empty user message from the active session.
38
+ With a draft, unmodified Up browses older history and Down browses newer history when the caret is at
39
+ either absolute draft endpoint (start or end). Down past the newest entry restores the draft, cursor
40
+ and attachments that were present when history browsing began. At non-endpoint positions, Up on the
41
+ first visual line moves the cursor to the first character and Down on the last visual line moves it
42
+ to the final character; elsewhere, Up/Down move the caret normally. Ctrl+Up/Down remain explicit
43
+ history shortcuts from anywhere. History includes
44
+ user messages and Bash commands from the active Pi session; recalled Bash commands return to `!`
45
+ mode. Executed slash commands from this terminal instance are included too, across session switches.
46
+ `/new` and `/session` (also `/resume`) switch the saved-message and Bash history to that session.
47
+ Modified Enter shortcuts depend on the terminal reporting the modifier distinctly; Cmd may require
48
+ the kitty keyboard protocol. In the composer, `Tab` opens up to eight matching filesystem entries for the path token at the cursor, or current-folder entries when the token is empty. The list has no heading or hint row. Up/Down select; Enter or Tab inserts the selection; Escape closes the list. Directories end in `/`, and Bash mode escapes shell-special characters. Use `/effort` or Shift+Up/Down to change effort. The command palette opens above the composer under a muted (`dim`) top rule, and has no other border. Its rows align slash commands and descriptions in two columns: the command column sizes to the widest visible name, bounded to preserve description space, and both columns wrap instead of truncating. The plan-choice rule, question block's top-only divider, and `/btw` block's top rule use the same muted color as the normal composer divider. The console has no background of its own: the renderer, root surface
49
+ and transcript are transparent, so the terminal's own background shows through, while panels,
50
+ dialogs and the scrim stay opaque. The composer has no panel background: it is bounded by a top and
51
+ a bottom rule, with the working status and spinner above it and a wrapping status bar below it. Its
52
+ fixed-width left gutter shows `❯` on the first input row and leaves continuation rows blank, including
53
+ explicit newlines and soft wraps; Bash mode shows `!` on the first row instead. In plan mode,
54
+ `plan mode` is right-aligned within the top rule, followed by exactly one divider character. The status bar shows the working folder's name and Git branch together as `<repo>:<branch>`, followed by the account, model and effort separated by spaces, and input (`↑`) and output (`↓`) token counts with each glyph adjacent to its count; `|` separates the groups. Token counts
55
+ below 1,000 show as whole numbers and larger counts use K/M/B suffixes. A leading `!`
56
+ enters Bash mode: the chevron becomes `!`, and the marker and both rules use the `bashMode` colour.
57
+ In plan mode, the marker and rules use the plan blue and `plan mode` is right-aligned within the
58
+ top rule with exactly one divider character after it; in the normal prompt, the marker matches the divider. The command body keeps the normal
59
+ text color. Every terminal animates the same star
60
+ glyphs (`·✢✳✶✻✽`) while working, with Ghostty's existing variant; there is no ASCII line fallback.
61
+ Extension dialogs, pages, custom editors, widgets, headers and footers keep using Pi's component
62
+ API through [`dialogHost.ts`](../src/terminal/opentui/dialogHost.ts): a small fake `TUI` renders
63
+ `Component.render(width)` ANSI into stacked overlays and forwards raw key sequences. Extensions
64
+ never receive an OpenTUI renderable or a second account. A theme an extension selects still colors
65
+ its own components, while the OpenTUI chrome keeps the fixed OpenCode-inspired palette. Component
66
+ UI is supported; an extension that draws only by writing raw ANSI through the TUI terminal is not.
67
+
68
+ Most pages become centered dialogs. The page commands `/permissions`, `/log`, the `/model` and
69
+ `/history` pickers, and
70
+ the `select`, `confirm`, `input` and `editor` dialogs (such as `/effort` and the Thinking setting),
71
+ take 80% of the terminal, capped at 100 columns by 30 rows, on a flat panel in the console's panel
72
+ colour. A full-screen scrim dims the console behind the panel so the transcript stays faintly
73
+ visible. Centered Harness dialogs fit their rendered content, capped by the available dialog
74
+ height, with four columns of horizontal padding and two rows of vertical padding to account for
75
+ the terminal's taller-than-wide cells. They use a plain title with a muted `Esc` hint and
76
+ omit divider rules and footer hints. Shortcut behavior remains available. Bracketed paste and the
77
+ clipboard-paste shortcut insert text into the active dialog input or search field, using that
78
+ component's input semantics; images and file attachments remain composer-only. Searchable lists share
79
+ the same glyph, placeholder, spacing, and muted result note, with search context included on that
80
+ row. A terminal too small for a 30-column by
81
+ 12-row dialog falls back to the full-screen page chrome. A plugin's full-screen surface stays full
82
+ screen. `/settings` fills the terminal with its category tabs, search, settings list and full-screen
83
+ page chrome. `/accounts` also fills the terminal with Accounts/Pools tabs and search. Wide terminals
84
+ show selected-account details beside the list; opening an account reveals grouped actions in that
85
+ inspector. On compact terminals, opening an account replaces the list with a full-page detail view
86
+ and its grouped actions. `Enter` opens the selected account; `Esc` returns to the list. Tab and
87
+ Shift+Tab move focus between tabs, the list and (when open) actions; Left/Right changes a focused
88
+ tab and Up/Down moves the focused list or action list. Search, section and account selection survive
89
+ returning and resizing.
90
+ Account actions are grouped by Session, Account, Sign-in and Remove; pool
91
+ actions are grouped by Manage and Remove. Existing confirmations and account-service calls remain
92
+ unchanged. The Harness resource browser and all its shortcuts use a full-screen page with persistent
93
+ resource-section tabs.
94
+
95
+ The frontend is verified with a real isolated PTY and a loopback provider. Run
96
+ `python3 scripts/verify-terminal.py --welcome-only --sizes 40x20,80x24,120x40` to check the empty
97
+ welcome, product label, accent colors and `/help` transition. Run
98
+ `python3 scripts/verify-terminal.py --composer-only` for recognized slash-command colors in the composer
99
+ and a user bubble, enabled-skill colors in the composer (leading and after text), unknown-token and argument colors,
100
+ explicit-newline and soft-wrap checks of both prompt gutters, and normal/plan/Bash mode exclusivity.
101
+ Run it with `--sizes 40x20,80x24,120x40` for compact through wide layouts. Use `--dialog-paste-only` to verify bracketed paste into a centered
102
+ input dialog, `--file-completion-only` for filesystem completion and insertion,
103
+ `--history-only` for active-session history across `/new` and `/session`, `--resume-only` for the full-screen searchable, unnumbered two-line saved-session picker, `--help-only` for `/help` replacing the welcome screen with grouped two-column output that wraps without per-command gaps, `--questions-only` for multi-select marker glyphs, recommended choices,
104
+ selected-row and Continue/Submit colors, `--jump-latest-only` for scroll-away badge visibility and click-to-latest (screen-level click assertions use optional `pyte`), and choice-backed “Something else” answers, or `--thinking-only` for `/thinking` visibility toggles. The full suite covers a complete turn, `read`, `bash` approval, `ask_user_question` approval and picker, plugin overlay/widget/status
105
+ disposal, a completed run record with usage and decision events, `/help`, `/permissions`,
106
+ `/settings`, `/model`, palette selection, confirm cancel, and Ctrl+D exit. `--questions-only` checks
107
+ recommended choices, bounded literal ASCII sketch previews, focus-driven preview changes and answer
108
+ colors; run it with `--sizes 40x20,80x24,120x40` for compact through wide layouts. At 80 columns and
109
+ above it also checks wrapped notes and free-text; the narrowest run keeps the sketch and answer
110
+ interaction compact. The normal turn omits question tools; plan-mode flows exercise `ask_user` batches
111
+ and `ask_user_question` cancellation. Live-provider behavior, exact OpenCode parity and concurrent
112
+ session tabs are not established.
5
113
 
6
114
  ## Native subagents (2026-10-18)
7
115
 
@@ -14,33 +122,64 @@ The terminal joins outstanding children before its final reply, projects child a
14
122
  with their original run IDs, and stops descendants when interrupted or disposed. Connected apps
15
123
  need not be enabled. `TerminalPrepareInput.subagents: null` disables the capability.
16
124
 
17
- Real scripted Pi execution over the actual terminal socket verifies result delivery and decision
18
- routing. It does not establish live-provider behavior or new visual UI parity. See
125
+ The terminal also projects the latest parent's subagent descendants into rows under the status line
126
+ and a searchable `/subagents` page. The rows poll a private monitor route once per second
127
+ during a turn and make a final read at settlement. They sit one blank row below the status line, with
128
+ no heading, and each reads: the status mark, the agent profile name in its colour (`subagent` for a
129
+ copy of the parent), the title the parent gave the child (PROP-0030), and `n of m tasks` from the
130
+ child's own todo list. At most three show, active first, then `+N more · /subagents`. The
131
+ `/subagents` page uses a colored profile and normal-color title on the first line, then muted account,
132
+ effective model, effort and cumulative usage metadata on the second. One blank row separates each
133
+ two-line entry. The page also shows status, elapsed time and the latest tool name. Runtime metadata
134
+ stays in the private terminal projection.
135
+ Usage contains safe token/cache/cost/context totals, not per-request payloads or reasoning summaries.
136
+ The projection is read-only, flat across nested descendants, and scoped to the latest parent run in
137
+ this terminal session; finished rows remain visible until the next parent run starts. The page also
138
+ pins a `main` row for the parent run itself, with the same details; the rows under the status line
139
+ leave it out. Reopening a conversation (a new launch, `/resume`, or a switch) rebuilds the rows from
140
+ the branch's latest parent run and its saved child runs, with their final status, until the next run
141
+ starts. A switch to a conversation without one clears them, as does disposal. It never includes tool
142
+ arguments (beyond the title), output or todo item text.
143
+
144
+ An interrupted or failed child keeps its saved conversation. The next reply is told which children
145
+ stopped before it answers, and the parent continues one with `spawn_subagent { continue: <runId> }`,
146
+ which reopens that child's own history with its profile and tools (ADR-0043). Esc therefore does
147
+ not lose a child's progress.
148
+
149
+ `/agents` opens the Agents page (PROP-0029): built-in, global, project and variant profiles with
150
+ their tools, plugins, variant, model and instructions. Enter on a row edits a person's own profile
151
+ in `$VISUAL`/`$EDITOR`, copies one, or deletes one after confirmation; New profile writes a template
152
+ in the project or global folder and opens it.
153
+
154
+ Real scripted Pi execution over the actual terminal socket verifies result delivery, decision
155
+ routing, and the monitor's parent scoping and summary redaction. It does not establish live-provider
156
+ behavior. See
19
157
  [ADR-0003](decisions/ADR-0003-shared-asynchronous-subagents.md) for recovery and lifecycle details.
20
158
 
21
159
  ## Ownership and process boundary
22
160
 
23
- Harness owns its interactive terminal application in [`src/terminal/tui/`](../src/terminal/tui/).
24
- [`TerminalApplication`](../src/terminal/tui/application.ts) owns terminal lifecycle, screen
25
- composition, focus, input dispatch, scrolling, editor mounting, dialogs and keyboard actions.
26
- It does not construct Pi's `InteractiveMode`. Pi 1.2.0 supplies the persistent agent session,
27
- model and auth runtime, native JSONL history, tool execution and rich content components.
161
+ Harness owns its interactive terminal application in
162
+ [`src/terminal/opentui/`](../src/terminal/opentui/). [`app.ts`](../src/terminal/opentui/app.ts)
163
+ owns terminal lifecycle, submission, commands, decisions and run records;
164
+ [`root.tsx`](../src/terminal/opentui/root.tsx) owns composition, the transcript, the composer,
165
+ palette and dialogs. It does not construct Pi's `InteractiveMode`. Pi 1.4.0 supplies the
166
+ persistent agent session, model and auth runtime, native JSONL history, tool execution and rich
167
+ content components.
28
168
 
29
- The parent process still calls `Terminals.prepare()`, spawns its returned specification in a
30
- PTY or inherited terminal, and eventually calls `dispose()`. Its default command is the active
31
- Node runtime followed by the existing Harness CLI and `terminal-frontend`; it requires no global
32
- `pi` command. `TerminalAssets` remains `{ node, cli, piExtension }`, and the existing
33
- `prepare`, `send`, `state`, `input` and `dispose` contracts remain in place. The `piExtension`
34
- path remains the final prepared extension argument. The owned runtime recognizes that bridge
35
- position and loads its trusted, bundled factory inline after the selected disk extensions.
169
+ The parent process calls `Terminals.prepare()`, spawns its returned specification in a PTY or
170
+ inherited terminal, and eventually calls `dispose()`. Its command is Bun with
171
+ `--conditions=browser` and the built `dist/terminal-opentui.js`; it requires no global `pi`
172
+ command. `TerminalAssets` is `{ node, cli, piExtension, openTui }`, and the existing `prepare`,
173
+ `send`, `state`, `input` and `dispose` contracts remain in place. The `piExtension` path remains
174
+ the final prepared extension argument. The runtime recognizes that bridge position and loads its
175
+ trusted, bundled factory inline after the selected disk extensions.
36
176
 
37
177
  ```text
38
178
  Harness parent: account + compiled context + trusted resources + run writer
39
179
  | launch specification / existing session socket
40
- Harness terminal child: TerminalApplication + persistent Pi AgentSessionRuntime
180
+ Harness terminal child: OpenTUI application + persistent Pi AgentSessionRuntime
41
181
  | typed native events / plugin UI callbacks
42
- Harness screen: transcript, with the product lockup above it until the first message, above a dock
43
- (status, editor, footer), with dialogs and overlays
182
+ Harness screen: transcript above the composer, with centered page dialogs and blocks
44
183
  ```
45
184
 
46
185
  [`runtime.ts`](../src/terminal/tui/runtime.ts) builds a public `AgentSessionRuntime` around
@@ -59,44 +198,401 @@ unattended execution path.
59
198
 
60
199
  ## Screen layout
61
200
 
62
- [`screen.ts`](../src/terminal/tui/screen.ts) chooses the screen from Pi's `tuiMode` in the
63
- account's `settings.json`; the default is `fullscreen`. Fullscreen uses Pi 1.2.0's
64
- `TuiAltScreen` with a layout root: a `ScrollView` holds the transcript (with the product lockup
65
- above it) and fills the terminal, and a `VStack` dock sits below it. The dock holds the working
66
- line, queued messages, widgets, the editor with its status band, and the footer. Terminal notices
67
- (mode changes, errors, the keyboard list) are rows in the transcript, so they scroll with the
68
- conversation and clear with its session. The dock stays on the last rows as the transcript grows,
69
- and scrolling moves only the transcript. When the screen is short, the prompt and status keep
70
- their full height, and queued messages and widgets show their first rows and scroll for the rest. Pi's `tui.altScreen.*` bindings
71
- (PgUp/PgDn, Ctrl+Home/End and the rest), mouse wheel, selection and search apply. The scrollbar,
72
- wheel step and copy-on-select behaviour are read from Pi's `fullscreen*` settings. Submitting a
73
- message and changing session return the transcript to its latest row. The product lockup
74
- (`welcome.ts`) is the first row of the transcript only while the current chat has no user
75
- message, so a resumed session with history starts without it and a new, cleared or switched-to
76
- empty chat shows it again. A header set by a trusted extension with `setHeader` replaces the
77
- lockup and is never hidden. Hiding the lockup shrinks the rendered rows, so the main screen clears
78
- and reprints once when the first message is sent.
79
-
80
- `regular` uses the main screen with the same components flowing in order, and the terminal keeps
81
- the scrollback. Leaving fullscreen with `fullscreenExitOutput: "transcript"` (Pi's default) copies
82
- the rendered conversation into the normal scrollback once the alternate screen is gone; a session
83
- with no messages writes nothing, and a started chat copies it without the product lockup. Other
84
- exit-output values are not implemented and write nothing.
85
- The decision and its consequences are recorded in
86
- [ADR-0004](decisions/ADR-0004-fullscreen-terminal-layout.md).
201
+ [`root.tsx`](../src/terminal/opentui/root.tsx) draws the terminal on OpenTUI's alternate screen.
202
+ An empty conversation shows a centered welcome. The default `Xingular Agent` identity appears as
203
+ an orange block `X` and blue letter-spaced `A G E N T`, followed by `Welcome.`, the tagline
204
+ `One run, done well.`, and a blue `/help` hint. Explicit host product names use the same generic mark and
205
+ subline formatting. The current model and thinking level remain available in dim text. Once a message
206
+ exists, a scrollable transcript fills the space above the composer. Assistant replies, plan bodies,
207
+ and other transcript Markdown use one renderer. Single-line notices
208
+ can appear with the welcome, while multiline notices such as `/help` switch to the transcript layout
209
+ so their output cannot overlap it. The composer is a single top and bottom rule, with the right-aligned `plan mode` label followed by one divider character in the top rule,
210
+ and the textarea in the middle.
211
+ The working status row shows the active verb with a soft, warm glint that feathers across it and
212
+ fades past its edges, followed by run duration and the latest completed assistant response's output
213
+ rate, formatted as `(time, tok/s)`; the spinner and metrics stay steady, and duration updates during a run.
214
+ Until response usage is available, the rate shows `— tok/s`. On settlement, the completion verb and
215
+ final run statistics stay in that row until the next run replaces them; they do not become a transcript
216
+ entry. Notifications, queue announcements and retry updates—including retries while summarizing
217
+ context or branches—are one-line transcript entries at the point they occur, so subsequent chat
218
+ moves them up rather than keeping them pinned at the bottom.
219
+
220
+ When the verb would hide what the reply is doing, the working line names it instead
221
+ (`src/terminal/opentui/workingPhase.ts`): `Waiting on 2 subagents · last activity 12s ago (Read)`,
222
+ `Running Bash · 1m 23s` (a tool past ten seconds), `Waiting for the model · no output for 1m 15s`
223
+ (past one minute of silence), `No progress for 6m · Esc to stop` (past five), and
224
+ `Reconnecting 2/8 · retry in 12s · Connection error` while a failed model request waits to be
225
+ retried. The verb returns as soon as the reply produces output again. A model request that fails for
226
+ a transient reason is retried up to eight times over about four minutes (`src/pi/retryPolicy.ts`;
227
+ a person's own `retry` settings win) before the reply ends with the error in the transcript.
228
+
229
+ While context compaction runs, the working line shows `Compacting context` (or `Retrying
230
+ compaction`) with the same spinner, in place of the working verb. During a run it keeps the run's
231
+ clock; a `/compact` while idle shows the spinner with its own clock. Compaction does not start a new
232
+ session or hide earlier chat. After it, the transcript shows, in order: the whole conversation from
233
+ before the compaction (rebuilt from Pi's session history, kept messages included); a rule labelled
234
+ `Context compacted · <tokens> tokens`; the summary printed as a normal reply; an `End of summary`
235
+ rule; then the work that followed. The summary is shown by default. Clicking either rule hides or
236
+ shows it, and Ctrl+O shows every summary again. On a narrow screen the rule drops the click hint, then
237
+ the token count. Earlier compactions in the same session keep their own rules and summary in place.
238
+ Notices stay after the message they followed. The model sees the summary and recent messages plus a
239
+ bounded, hidden checkpoint of the active request, todo list and plan instructions when available,
240
+ for a compaction that happened during the running reply. It is built once per compaction and sits
241
+ unchanged right after the summary until the run settles, so later requests keep the provider cache. The visible
242
+ transcript remains a presentation of the full history, not the model context.
243
+ Transcript entry ids follow positions in the displayed message list, so when a rebuilt list moves a
244
+ different kind of entry onto an id, the renderer builds a new component for it instead of reusing the
245
+ old layout, and each entry draws inside its own error boundary. A run therefore keeps updating live
246
+ through a compaction; it does not need `/resume` to show its later output.
247
+ A successful copy shows a temporary, opaque toast anchored at the terminal's top-right. Interactive blocks and widgets remain docked above the composer. A wrapping status bar
248
+ below the composer shows `<repo>:<branch>`, account, model, effort and token totals, with `|` between groups. After
249
+ the input token count it shows cache hit rate as `R<percentage>%`: cache reads divided by input
250
+ tokens over the last 10 model responses in the current context (`CACHE_HIT_WINDOW`), so a collapse
251
+ shows within a few requests instead of being averaged away by a healthy start. Responses without
252
+ prompt tokens, such as aborted ones, are skipped. Below 70 percent the rate and its `⚠` are coloured
253
+ warning yellow; below 40 percent, they are coloured error red. Cache hit warnings appear in the status
254
+ bar only; they do not add a transcript notice. A single response only writes the cache, so the rate is
255
+ judged once the window holds two, and a window with no cache reads or writes is not judged, since its
256
+ provider may not report them. The footer shows status messages without a shortcut-hint row. Press `?` with an empty
257
+ composer to open the shortcut reference. Transcript entries include
258
+ messages, thinking, tools, notices and extension ANSI components. Image blocks returned by tools
259
+ appear as separate image-result entries immediately after their tool call, within the scrollable
260
+ transcript; they move up with newer chat. The `/settings` Show images option controls whether the
261
+ image data is rendered. Mouse-wheel scrolling and PgUp/PgDn
262
+ move the transcript without moving the composer; Ctrl+Home and Ctrl+End jump to its beginning and
263
+ end. A narrow `▕` thumb marks transcript position at the right edge; its mouse and keyboard scrolling remain native. The transcript has one blank row between each pair of entries, including assistant replies,
264
+ thinking, tools, image results, notices, summaries, custom messages, user messages, plan cards and
265
+ Bash entries. User, plan and Bash bubbles also have one blank row of internal padding above and below
266
+ their content; other entries have no internal vertical padding. Bubble padding is additional to the
267
+ inter-entry gap. A plan card carries its title as an underlined header in the plan blue, then one
268
+ blank row before the plan body. A tool, a custom message type and a running child's activity are
269
+ labelled with their name in CamelCase—`todo_write` reads `TodoWrite`, `computer-screenshot` reads
270
+ `ComputerScreenshot`, and `xingular-slice-continue` reads `XingularSliceContinue`—while the todo
271
+ card reads `Todo` and an approval prompt names its tool the same way. Internal lines within an entry
272
+ stay together. The transcript stays
273
+ pinned to the latest message until you scroll away. While scrolled away, a `↓ Jump to latest` badge overlays the
274
+ transcript's lower-right corner; clicking it returns to the newest message and hides the badge.
275
+ `Ctrl+End` remains an alternate way to jump to the end. A primary click in the transcript or empty
276
+ welcome area focuses the composer. Dragging to select text anywhere in the TUI—including the
277
+ composer, transcript, widgets, dialogs and pages—copies the selected plain text when selection ends;
278
+ a simple click does not copy. `/copy` and `Ctrl+X` continue to copy the latest assistant reply.
279
+
280
+ Mouse movement highlights the row under the pointer in the command palette, plan choices, question
281
+ dock, searchable dialogs and Harness page lists; the highlight uses the same selection style as
282
+ keyboard navigation. A primary click activates the row, and clicks on page tabs switch that page's
283
+ section. In `/accounts`, clicking an account opens its inspector or compact detail view, and clicking
284
+ an action runs the existing account flow. Question choices still stage their answer until the
285
+ question's action is clicked. Dialogs preserve their existing confirmation safeguards. OpenTUI enables terminal mouse-motion reporting for
286
+ hover; terminals or multiplexers that do not report motion retain keyboard navigation. ANSI-only
287
+ custom UI without a mouse handler remains keyboard-driven.
288
+
289
+ A mouse report the terminal delivers in two pieces across the input parser's timeout arrives as
290
+ printable keys. The composer and every single-line field drop the report's `<button;column;row>`
291
+ tail instead of keeping it, so a stray scroll never becomes a draft, a filter or a prompt; text typed
292
+ at human speed is untouched even when it spells the same shape. Recorded text never prints a
293
+ reported sequence on a page, and a bare tail that was recorded stays visible as recorded evidence.
294
+
295
+ Page dialogs and blocks are absolute overlays, so the transcript stays behind them. The screen
296
+ restores the terminal's alternate-screen state when the application exits.
297
+
298
+ ### Markdown transcript
299
+
300
+ Assistant replies, plan-card bodies and Markdown image-result text share one style map. Heading
301
+ levels use the Harness palette; links are blue and underlined, and only their labels appear in the
302
+ transcript. Hovering a link changes the terminal pointer to a hand and recolours the link's own
303
+ text (`theme.linkHover`); the status line says nothing about it. The gesture that opens a link is
304
+ the one the platform uses: **Ctrl+click** where the terminal reports the modifier, and on macOS the
305
+ **primary click**, because ⌘ is not part of the terminal mouse protocol (a macOS terminal opens an
306
+ OSC 8 link itself on ⌘+click). Either way the link opens with the operating system's handler for
307
+ its kind: a web address in the browser, `mailto:` in the mail client, a file in its default
308
+ application, a folder in Finder. A click that opens a link leaves the composer focused. `core/links.ts` decides what
309
+ may open (ADR-0047): a relative path resolves against the session's folder, and an application
310
+ bundle, an installer, a launchable script or an executable file is refused with a notice instead of
311
+ being run. The launcher receives the address as one argument without a shell. OSC 8 metadata is
312
+ emitted where available, but link activation does not depend on terminal OSC 8 support; a terminal
313
+ that opens OSC 8 links itself acts on its own modifier, so the Harness keeps the primary click.
314
+ Inline code uses a subtle panel fill. Fenced code appears in a bordered panel labeled with the
315
+ opening fence's language; JavaScript, TypeScript/TSX, Zig and other bundled grammars use tree-sitter,
316
+ while Python, shell and JSON receive lightweight token highlighting. Unknown or unlabeled languages
317
+ remain readable in the same panel, with `CODE` shown when no language is given. The code itself
318
+ stays selectable and copyable, and the panel updates while a reply streams. Emphasis, quotes, list
319
+ markers, tables, dividers and task-list markers use the existing titanium palette. Images display their alt
320
+ text and are not fetched or rendered as image files.
321
+
322
+ ## Todo block
323
+
324
+ `todo_write` is registered in terminal sessions (PAR-001). Each call renders in the transcript as
325
+ a todo block: a status mark, `Todo · n of m done`, then one line per item with `✓` (done, success
326
+ colour), `●` (in progress, warning yellow, bold) or `○` (pending, dim). Each row reserves a one-cell
327
+ status column and one-cell gap; item text and wrapped lines share the same starting column. A call
328
+ whose arguments are not a todo list, or that failed, stays an ordinary tool row. The prompt's
329
+ Progress group says the list shows progress and is not the scope of the work, asks the model to keep
330
+ it current, and says a reply that ends with open items is sent back; unfinished work remains
331
+ unfinished rather than being marked complete.
332
+
333
+ `/todo` (alias `/checklist`) appends a snapshot of the current list: the same header and rows, with
334
+ no status mark on the header, because it is not a tool call. It reads the latest non-side-question
335
+ run of this terminal's native session and makes no model request; an empty list is a one-line
336
+ notice.
337
+
338
+ ## Blocks and pages
339
+
340
+ In Pi's own terminal UI, [`chrome.ts`](../src/terminal/tui/chrome.ts) gives terminal surfaces one
341
+ of two rule-based shapes, using the 2-cell composer gutter on each side and a dim hint row.
342
+
343
+ - A **block** docks at the bottom like the slash-command list above the composer. It has an amber
344
+ (`warning`) rule, a bold title row with an optional dim note at the right edge (a dialog's
345
+ countdown), the body, a hint row, and a neutral (`dim`) closing rule. It is as tall as its body.
346
+ Approvals, questions, and the `select`, `confirm`, `input` and `editor` dialogs use this shape
347
+ there. OpenTUI renders Harness-managed centered dialogs with the inset header treatment below.
348
+ - A **page** is a header row (title left, position or status right), a neutral rule, the body,
349
+ a neutral rule, and the hint row. `/settings`, `/log`, `/permissions`, and the `/accounts`,
350
+ `/plugins` and `/hub` menus are pages. Section labels inside a page are plain bold headings, never
351
+ text set into a rule. `/trajectory` is a full-screen page with searchable Runs and Events
352
+ tabs; its Events view keeps the event list beside the selected event's JSON on wide terminals.
353
+ `/context` is a full-screen page with Request and Growth tabs: one bar that gives each kind of
354
+ context its own colour — foundation blue, variant orange, your application green, conversation
355
+ amber, the same four values as the App's `--data-1..4` tokens — with the track for free space and a
356
+ `│` where Pi would start compacting, a legend naming every run, then one row per contributor (`❯` on the selected one, `·` for a section that arrives per request) reading
357
+ `tokens` and `share`, group headings carrying their own total, the reserve and free space, and an
358
+ On demand list. `space` folds a group, `enter` shows the text a row contributed, `g` regroups rows
359
+ by owner or by kind, `c` compacts after a confirmation, and `v` opens `/harness`. It reads
360
+ `terminal.context` and draws no figure it did not receive.
361
+
362
+ `DialogPanel` takes a `variant` (`block` by default). `ui.select` accepts a harness-owned `page`
363
+ option, which Pi's own dialogs ignore, so the same extension code runs in either terminal. Selected
364
+ rows keep the full-width `selectedBg` highlight and `❯` marker the slash-command list uses. Both
365
+ frontends draw that field from the same muted-blue selection palette (`selection.ts`) and use
366
+ explicit high-contrast text on it instead of the accent colour, so a choice reads the same in every
367
+ list. Rules use the theme's `warning` and `dim` colors, so a custom theme restyles them.
368
+
369
+ The broad Harness resource browser (PROP-0013) unifies Overview, Foundation, Variant, Skills,
370
+ Plugins, Connections, Tools and Library. `/harness` opens Overview; `/skills`, `/connections`
371
+ (`/mcp`), `/tools` and `/components` open sections. `/plugins` is a separate
372
+ full-screen local manager with Plugins, Trust and Packages tabs; `/hub` is a separate
373
+ full-screen Community catalog with Catalog and Installed tabs. Both keep a searchable
374
+ inventory beside selected-item details on wide terminals, stacking details below the list
375
+ on compact terminals. The existing Accounts, Permissions, Settings, Trajectory and Log
376
+ pages retain their own tabs.
377
+
378
+ `/settings` includes a device-local Browser tab. It selects the isolated browser or Brave profile,
379
+ with explicit confirmation before selecting Brave, and shows extension pairing and connection status.
380
+ Brave site access is granted separately from its toolbar popup; the in-page badge offers Pause and
381
+ Stop. The extension controls normal tabs only (never Incognito) and does not request history or
382
+ cookie permissions or export cookies. If it disconnects, browser calls fail without switching
383
+ backends. **Private address access** is off by default; enabling it asks for confirmation and allows
384
+ agent browsing and annotation capture to reach localhost and private networks.
385
+
386
+ Within the broad `/harness` browser, resource sections share Installed/Discover and source filters.
387
+ Installed includes locally present resources; current-session availability comes only from the runtime
388
+ loader and active tool registry. Discover uses the unfiltered Hub service with All/Community/Official
389
+ filters and an explicit refresh. No matching Community entries is an empty result, never replaced with
390
+ built-in resources. The view preserves search across source switches and restores section selection.
391
+
392
+ The dedicated `/hub` Catalog shows Community entries across supported types only. Its Installed tab
393
+ shows receipts from every channel with the channel labeled. On each page entry, cached/bundled entries
394
+ appear first, then the remote catalog refreshes; the status keeps the origin, last-refresh time and any
395
+ stale/error feedback visible. Manual refresh remains available. Catalog installs are pinned to the
396
+ selected version, and Hub uninstalls remove only receipt-owned resources. Registry/document entries
397
+ offer a bounded payload Preview; Pi packages have no JSON payload Preview.
398
+
399
+ The `/plugins` manager keeps local switching, code trust and settings separate from public discovery.
400
+ Its Packages tab adds local package installation, update and removal. Hub-owned packages remain pinned
401
+ to exact catalog versions; removal goes through Hub receipt cleanup, and updating requires an explicit
402
+ Hub version replacement.
403
+
404
+ The browser fills the terminal (PROP-0014), with Overview, Foundation, Variant, Skills, Plugins,
405
+ Connections, Tools and Library as persistent top tabs. The section dropdown and sidebar are removed.
406
+ When the strip cannot fit, it shows the active tab and its position with previous/next navigation.
407
+ At 88 content columns, inventory sits beside an inspector containing metadata, actions and readable
408
+ content. Enter focuses the inspector. Its action rows group related tasks under Use, Inspect, Manage,
409
+ Access and Remove. Compact terminals show details/content within the active tab; resizing preserves
410
+ the selected resource and content position, clamped to the available height.
411
+
412
+ Tab/Shift+Tab focuses tabs, source, filter, toolbar actions, list and (when available) inspector.
413
+ Left/Right changes the focused tab or control; Enter on the tab strip returns to the inventory.
414
+ Ctrl+F focuses search. Escape returns from content to actions, returns to the list, clears search,
415
+ then closes. Mouse clicks select tabs directly, activate resource actions and focus filters;
416
+ wheel scrolling targets the list or inspector under the pointer. Other command pages keep their
417
+ centered presentation; `/settings`, `/accounts`, `/plugins` and `/hub` use full-screen page layouts.
418
+ Closing the browser preserves the composer draft and attachments.
419
+
420
+ Foundation explains fixed runtime ownership; it is read-only. Variant shows c1–c8 with the
421
+ prepared version and current head separately. It previews pinned files from the preparation
422
+ snapshot and compares their text with the latest saved version. No in-place editing or adoption
423
+ is added. Library skills and rules are added through `terminal.components.add`, which commits a
424
+ validated future version. Directory-backed variants stay read-only.
425
+
426
+ Skill browsing is independent of the Skill commands setting. Use inserts `$name` without submitting. Ctrl+K opens a separate command filter; choosing a browser section keeps
427
+ the existing draft text and attachment labels. Canceling the filter restores that draft. OpenTUI completes
428
+ loaded skills for a `$` at any word start; Enter or Tab inserts the selected skill rather than sending.
429
+ Plugin contributions, settings, attachment and code trust share one detail flow. Package install
430
+ and removal delegate to existing services; installing never trusts or activates code.
431
+
432
+ Connections supports local stdio and remote HTTP forms, masked credentials, explicit scope,
433
+ saved disabled defaults, explicit testing and OAuth sign-in. Browsing never starts an MCP process.
434
+ Saved test results show timestamps rather than claiming a live connection. A Hub connector document
435
+ is inert: a separate setup action validates supported remote-definition fields before opening the
436
+ normal connection form. Other document kinds stay inspectable data. Tools show their owner,
437
+ parameters, active state and saved approval; each call still passes the gate.
438
+
439
+ The typed model is `terminal/browser.ts`; the protected adapter is `terminal/browserControl.ts`.
440
+ The browser accepts resource IDs for bounded regular-file previews, not arbitrary paths. Local
441
+ skill import rejects symbolic links and limits bytes, files and traversal. See
442
+ [source study and wireframes](study/tui-resource-browser.md),
443
+ [PROP-0013](architecture/proposals/PROP-0013-resource-browser.md) and
444
+ [ADR-0015](decisions/ADR-0015-resource-browser.md).
445
+
446
+ ## Annotate page (PROP-0018, PROP-0048)
447
+
448
+ `/annotate:` opens the full-screen annotate page beside the window being inspected. It has two tabs:
449
+ **Annotate** and **All annotations** (`/annotate:notes` opens on the second). Add a page address with
450
+ `/annotate: [url]`; without one, the page returns to the window that is still open, with its URL and
451
+ the inspector on, and asks for an address only when no window is open. The target window is one of:
452
+ - the visible capture browser
453
+ - an app's own windows over its DevTools port (`--app [port]`, or `a` in the page)
454
+ - app windows that loaded the page bridge script (`--bridge`)
455
+
456
+ The header shows the target and window and whether the inspector is on. Click a component in the
457
+ window and choose **Annotate** or **Annotate & send** (Cmd/Ctrl+Enter). Every annotation is shared
458
+ with this session; the list groups them as Unsent and Sent. While the inspector is on, the page polls
459
+ for the next popover comment every 400 ms, shows the result as a notice, and refreshes the list.
460
+
461
+ | Key | Action |
462
+ |---|---|
463
+ | `i` | inspector on/off |
464
+ | `s` | send every unsent annotation (page-origin ones are confirmed once first) |
465
+ | `o` | type a page address |
466
+ | `a` | apps with a DevTools port: pick one, type a port, start an app with one, or use the bridge |
467
+ | `t` | choose a window |
468
+ | `Enter` | the annotation menu |
469
+ | `Tab` | switch tab |
470
+
471
+ The Annotate tab has no search row, so these letters are free for actions. `/annotate:submit <request>`
472
+ sends the unsent annotations with your request after them; `/annotate:clear` resolves the unsent ones
473
+ and stops sharing them.
474
+
475
+ ## Pending messages and barriers
476
+
477
+ The terminal shows pending steering, follow-up and deferred plan/Bash inputs above the working
478
+ line, one row per item: `Steer:` or `Follow-up:` in the accent blue for the two native queues, and a
479
+ muted `Plan:`, `Bash:` or `Prompt:` for deferred input, followed by the single-line text. A steering
480
+ message is intended for the active reply; a follow-up waits until it finishes. With no active reply,
481
+ a normal message starts a turn. Pi's steering and follow-up settings determine delivery within
482
+ those queues. Hover or click a native `Steer` or `Follow-up` row, or use `/follow-up`, to open the
483
+ queue page. It separates the two kinds, edits the selected message, sends the next eligible item,
484
+ or removes the selection. Editing keeps attached images with that queued message; identical text is
485
+ still distinguished by a stable local queue identity.
486
+
487
+ A queued plan or `!` Bash command is a barrier: it runs as a standalone turn after the current
488
+ response, and subsequent inputs wait behind it rather than entering Pi's native queues and
489
+ crossing the barrier. On a successful reply, Pi keeps its configured queue behavior. After an
490
+ explicit user stop (`Esc`, `Ctrl-C` or `/stop`), the terminal sends one unconsumed steer before any
491
+ follow-up and returns the rest to Pi. It does not dispatch at retry boundaries, after a final
492
+ provider error, or after a non-user interruption. `Alt+Up` restores queued text to the draft;
493
+ queued images are dropped with a warning. Pi's queue projection can briefly include an item already
494
+ taken for delivery; the queue page gives duplicate text stable local identities. Deferred Plan/Bash
495
+ work retains its barrier ordering and is not released by the native queue page.
496
+
497
+ ## `/goal` (ADR-0072)
498
+
499
+ `/goal <objective>` starts a long run on an objective; see page 11 for the rules. Bare `/goal` shows
500
+ `Goal`, `Status`, `Objective`, `Rounds`, `Time used`, the last check and the commands that apply.
501
+ The status bar adds one group while a goal exists: `Pursuing goal (2m, round 3/30)`, `Goal paused
502
+ (/goal resume)`, `Goal stalled (/goal resume)`, `Goal hit usage limits (/goal resume)`, `Goal unmet
503
+ (30/30 rounds, 8h 0m)` or `Goal achieved (1h 12m)`. Replacing an unfinished goal asks first. Esc or
504
+ Ctrl-C on a running goal pauses it; `/goal resume` continues.
87
505
 
88
506
  ## Plan mode and thinking keys
89
507
 
90
- Shift+Tab switches the terminal between normal and plan mode. The switch is announced in the
91
- transcript. Plan mode narrows the session to read-only inspection (`read`, `grep`, `find`, `ls`),
92
- questions (`ask_user`, `ask_user_question`) and recall (history and Wiki reads, `memory_facts`). Edits,
93
- writes, shell commands, memory writes, subagents and connected-app tools are withdrawn until plan mode
94
- is switched off, and switching back restores the tools the session had. Plan mode belongs to the open
95
- conversation: a new or resumed session starts in normal mode.
508
+ Use `/plan <brief>` for one read-only planning request. A plan waits outside Pi's native follow-up
509
+ queue until the active response settles, then runs by itself. Later messages remain behind it, even
510
+ when Pi's follow-up mode is `all`. During that run the session narrows to read-only inspection
511
+ (`read`, `grep`, `find`, `ls`), web search/page reading, questions (`ask_user`, `ask_user_question`)
512
+ and recall (history and Wiki reads, `memory_facts`). The parent may also run Bash in the
513
+ OS-enforced read-only sandbox: no network and no writes except a discarded per-command temporary
514
+ directory (PROP-0043). It may delegate bounded research to a named profile whose effective tool and
515
+ plugin allowlists qualify for research; the child inherits plan mode and receives only the
516
+ intersection of the parent's frozen capabilities, profile and plan-research set. Children cannot
517
+ write, run commands, ask the user, use connectors or spawn more children; they remain bounded by the
518
+ configured work-slice policy without gaining `checkpoint_write`, and the Harness records an
519
+ evidence-derived checkpoint if the child stops at a boundary. Normal mode omits both question tools
520
+ from the active set; the plan request enables registered questions and research delegation
521
+ temporarily and restores the normal set when it settles, including on failure or interruption.
522
+ Providers may mark individual calls as safe for research; every other call is blocked before
523
+ approval. Edits, writes, memory writes and connected-app tools remain unavailable to parent and
524
+ child; generic browser controls are also blocked. Sandboxed read-only Bash is the parent's only
525
+ plan-mode shell exception; children cannot run commands. The plan instructions arrive as a
526
+ request-scoped prompt section, which the next ordinary request withdraws.
527
+
528
+ Each mode keeps its own model and effort for the account. Every selection the person makes (the model
529
+ picker, `/effort`, Shift+Up/Down, Ctrl+P) is saved against the mode it was made in, so Shift+Tab switches to that
530
+ mode's model and effort, and a new conversation starts on the normal mode's latest choice. A mode with no
531
+ choice of its own takes normal's, field by field; when neither has a saved effort, the mode uses Pi's
532
+ default level rather than keeping the level chosen in the other mode. A resumed conversation keeps the model in its history while
533
+ the account can use it, and a saved model the account cannot use is skipped. When the conversation's
534
+ model is not offered by the account or holds no credentials there — a different account, a signed-out
535
+ provider, a retired model — the conversation starts on this account's own newest selection instead:
536
+ the mode's choice, then normal's, then the newest selection in any mode, with its effort, skipping any
537
+ model the account cannot use. That start is the terminal's own change: it is written into the
538
+ conversation, never into the person's saved choice, and the terminal says in one notice which model it
539
+ replaced and which it used. With no usable saved model, Pi's own fallback applies and its message is
540
+ shown. The choices live in the account's `choices.json`,
541
+ and the App reads and writes them through `accounts.choices` and `accounts.choose`.
542
+
543
+ A bare `/plan` toggles plan mode, and Shift+Tab cycles between normal and plan mode. Normal, plan
544
+ and Bash are mutually exclusive composer modes. While plan mode is on, each submitted message is sent
545
+ as a plan request through that same queue, and the composer's top and bottom rules take the plan colour.
546
+ Commands still run as commands. The model may run Bash during a plan request, only in the read-only sandbox scope (PROP-0043); your own `!` commands are not part of the plan. Entering Bash with a leading `!` exits plan mode; Shift+Tab from Bash
547
+ switches to plan mode and keeps the draft text. Turning plan mode off returns to normal mode. The old
548
+ on/off/toggle forms are rejected; a bare `/plan` is the switch.
549
+
550
+ When a plan request ends with a complete `<proposed_plan>` block, the terminal shows it as a bordered
551
+ card at the end of the reply, with the text around the block left as ordinary assistant text. A choice
552
+ block then appears above the composer with `Plan ready`, a blank row, then `Implement "<title>"` or
553
+ `Edit the plan`, followed by a blank row and the hint. Up and Down choose, Enter confirms, and Escape
554
+ dismisses it; the block yields to the composer as soon as the draft has text.
555
+ Implement leaves plan mode, so the normal tools and the mode's own model and effort come back, and sends
556
+ `Implement the plan: <title>`; the plan itself is already in the conversation. Edit the plan stays in plan
557
+ mode and focuses the composer, so the next message revises the plan and offers a new choice. A plan run
558
+ that was interrupted, failed, or had work queued behind it is not offered. A plan request whose reply
559
+ needs no plan — the work already exists, or the person asked not to plan — ends as ordinary text with
560
+ no card, notice or warning. If a completed plan run left its block incomplete after the harness's one
561
+ repair attempt, the terminal shows a warning notice instead of a plan choice; the plan request can be
562
+ sent again.
563
+
564
+ A recognized leading slash command uses the selected theme's link color while typing and in its
565
+ user-message bubble. Only the command token is accented; arguments and unknown slash tokens keep the
566
+ normal text color. Recognition follows the active command registry, including built-in commands and
567
+ aliases, loaded extension and prompt commands, and enabled skill invocations written as
568
+ `/skill:name`.
569
+
570
+ SDK session runs receive plan instructions as a dynamic context update, leaving the stable system
571
+ prompt unchanged; their session gate refuses calls outside the read-only set. The standalone
572
+ terminal applies the same instructions and tool restrictions to each plan request. Shift+Up and
573
+ Shift+Down step the thinking level within the levels the model supports, and do not wrap. Use `/thinking` to toggle transcript thinking visibility, or `/thinking show` and `/thinking hide` to set it explicitly. This changes only whether thinking blocks appear in the transcript; it does not change model reasoning or effort, and it shares the Hide thinking setting with Ctrl+T and `/settings`.
574
+
575
+ ## Bash command mode
576
+
577
+ Typing or pasting `!` at the start of the composer enters Bash mode: the first-row prompt marker
578
+ changes from `❯` to `!`, and the `!` and the composer rules use the `bashMode` theme color while the
579
+ command body keeps the normal text color. Continuation rows keep their blank gutter. Entering Bash
580
+ exits plan mode; Shift+Tab from Bash switches to plan mode and preserves the draft. Plan mode colors
581
+ the marker and rules blue; in the normal prompt, the marker matches the divider color. Backspace on
582
+ an empty Bash body returns to the normal prompt. Submitting while a reply is active queues
583
+ the command as a standalone turn; it does not steer the current model request.
96
584
 
97
- The model is not yet told about the mode through the prompt; it only sees the narrower tool set. That
98
- instruction belongs in the prompt compiler, the one place model instructions are built. Shift+Up and
99
- Shift+Down step the thinking level within the levels the model supports, and do not wrap.
585
+ The terminal checks Bash policy before using Pi's native `executeBash`. Ordinary `!command` runs
586
+ workspace-scoped; `!outside <command>` explicitly requests human-only approval before the command
587
+ runs once with broader filesystem access. The complete command is shown as escaped, scrollable
588
+ approval details; if the terminal is too small to show both details and choices, the request is
589
+ denied. Shell output never triggers approval or replay. Output streams into the transcript while the
590
+ command runs, so browser-login URLs are visible before the
591
+ command finishes; the running item shows that Escape stops the command. The native result is
592
+ recorded in run activity and session history before the model is prompted to read and explain it.
593
+ This does not attach interactive stdin to the shell. SDK callers may opt into this behavior with
594
+ `SessionRunInput.initialBashCommand`; it is restricted to a new interactive user turn and the
595
+ session runner applies the same Bash gate and explicit outside-scope request.
100
596
 
101
597
  ## Reference and reproduced presentation
102
598
 
@@ -112,39 +608,47 @@ not an arbitrary checkout of upstream main. The source repository is
112
608
  | Native `omp` artifact used for observation | `d518310d647d467a2c5c3f2d38e34489a761996d766395c03b37c61a2203d02b` |
113
609
 
114
610
  In the extracted `pi-tui` package, `src/theme/defaults/titanium.json` establishes the titanium
115
- palette and `src/prompt/welcome.ts` establishes the five-row Pi logo, exact diagonal RGB stops
116
- and indexed-color fallback, centered lockup and narrow-width behavior. Harness adapts these
117
- into [`theme.ts`](../src/terminal/tui/theme.ts) and [`welcome.ts`](../src/terminal/tui/welcome.ts),
118
- with its own product name, package version and existing-command tips. The text-only status band in
119
- [`status.ts`](../src/terminal/tui/status.ts) shows the project name, branch, account/model/effort,
120
- the last completed response's output rate and current-session input/output totals. Input totals add
121
- cache reads and exclude cache writes. The prompt
122
- frame is implemented in [`editor.ts`](../src/terminal/tui/editor.ts): two full-width neutral
123
- rules around the prompt, a dim `❯` glyph, a `Try "…"` placeholder before the first prompt of a
124
- launch, and a `? for shortcuts` footer line above the band. The frame follows the observed
125
- composer of Claude Code 2.1.302, reproduced from its visible values; no code is copied, and
126
- `?` opens the same list as `/hotkeys`. Startup selects the Harness titanium presentation
127
- without rewriting the user's saved theme settings. The shipped OMP light palette is also
128
- available as `light`; native rich components and the status band switch together. Missing
129
- Pi-specific color tokens use documented Harness fallbacks in `theme.ts`.
611
+ palette and its indexed-color fallbacks. Harness adapts these into
612
+ [`theme.ts`](../src/terminal/tui/theme.ts) and
613
+ [`opentui/theme.ts`](../src/terminal/opentui/theme.ts). The OpenTUI status bar shows the project name and
614
+ branch together as `<repo>:<branch>`, followed by account, model and current-session
615
+ input/output totals. Input totals add cache reads and exclude cache writes; its `R<percentage>%`
616
+ hit rate is cache reads divided by input over the last 10 responses, not the session total. A rate under 70 percent carries the `⚠` glyph and
617
+ colour described in the composer status bar, and under 40 percent it is red. Token counts below 1,000 show as whole numbers;
618
+ larger counts use floor-rounded K/M/B suffixes without decimals. The band carries no context-use
619
+ reading; `/context` reports the share of the window.
620
+
621
+ The OpenTUI composer follows the observed composer of Claude Code 2.1.302, reproduced from its
622
+ visible values; no code is copied. The command palette follows the same borderless convention.
623
+ Startup selects the Harness titanium presentation without rewriting the user's saved theme
624
+ settings. The shipped OMP light palette is also available as `light`; native rich components and
625
+ the OpenTUI chrome switch together. Missing Pi-specific color tokens use documented Harness
626
+ fallbacks in `theme.ts`.
130
627
 
131
628
  The frontend exposes capabilities already present in Harness/Pi. It does not import OMP's
132
629
  agent runtime, tools, providers, MCP implementation, task system or other product features.
133
- Harness-owned composition reuses public Pi Markdown, message, tree/model selector and rich
134
- tool components. Tool diffs, expandable output, images and extension renderers therefore retain
135
- the existing Pi interpretation. This is an implementation of the requested terminal presentation;
136
- complete visual or behavioral parity with every OMP surface has not been established.
630
+ OpenTUI owns screen composition and transcript rendering. Dialogs and extensions continue to use
631
+ Pi's component API through `dialogHost.ts`. Image blocks returned by tools appear as separate
632
+ scrollable image-result entries, rendered inline when `/settings` Show images is on; Markdown
633
+ images continue to show alt text only. This is an implementation of the requested terminal
634
+ presentation; complete visual or behavioral parity with every OMP surface has not been established.
137
635
 
138
636
  Full upstream copyright and MIT permission notices are in [NOTICE.md](../NOTICE.md).
139
637
 
140
638
  ## Runtime compatibility adapter
141
639
 
142
640
  Most integration uses public Pi exports. [`piAdapter.ts`](../src/terminal/tui/piAdapter.ts)
143
- contains the remaining implementation dependencies and requires exactly Pi **1.2.0** before
144
- loading them:
641
+ contains the remaining presentation dependencies and requires exactly Pi **1.4.0** before
642
+ loading them. The shared [`runtime.ts`](../src/pi/runtime.ts) loader imports Pi first, then invokes
643
+ the same HTTP dispatcher hook as Pi's CLI before any Harness Pi runtime is used. This reapplies
644
+ the process `HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY` settings after Pi's bundled Undici has
645
+ loaded. Account and model checks, sessions, maintenance, plugin discovery and installation,
646
+ pricing, and the standalone terminal all use this loader. It is process-wide and coalesces
647
+ concurrent initialization.
145
648
 
146
649
  | Internal dependency | Reason |
147
650
  |---|---|
651
+ | `dist/bundle/chunks/chunk-MM3LKT73.js:configureHttpDispatcher` | Restore Pi's environment-aware HTTP proxy dispatcher after the SDK import |
148
652
  | `dist/extensions/index.js` builtin inventory | Preserve selected `llama.cpp`, `codemode`, `tool-search` and MCP builtins with the CLI's replacement semantics |
149
653
  | `dist/modes/interactive/theme/theme.js:setThemeInstance` | Keep public native rich components on the same active theme as the Harness screen |
150
654
  | `dist/core/tools/renderers/index.js:withBuiltInRenderers` | Preserve existing read/edit/bash/write formatting without replacing tool execution |
@@ -152,7 +656,46 @@ loading them:
152
656
 
153
657
  The adapter is initialized once; its global theme setter and renderer lookup are synchronous
154
658
  thereafter. A Pi dependency upgrade must update this adapter deliberately and rerun the
155
- terminal compatibility tests. These module imports do not instantiate `InteractiveMode`.
659
+ terminal compatibility tests. The dispatcher compatibility check also pins the private Pi bundle
660
+ chunk and fails with a clear error if that hook moves or disappears. A local proxy fixture test
661
+ checks that a Pi HTTP request reaches the configured proxy without contacting an external host.
662
+ These module imports do not instantiate `InteractiveMode`.
663
+
664
+ ## Attachments: images and large pastes
665
+
666
+ Images are sent to the model as image content in the same user message, not as file paths
667
+ (`TerminalRuntime.submit(text, followUp, images)` and `submitPlan(text, images)` pass Pi's
668
+ `PromptOptions.images`). [`attachments.ts`](../src/terminal/opentui/attachments.ts) holds the
669
+ draft's attachments; [`composerMarks.ts`](../src/terminal/opentui/composerMarks.ts) keeps one
670
+ virtual OpenTUI extmark on each label, so the label is drawn in the `attachment` colour and the
671
+ cursor, Backspace and Delete treat it as one unit.
672
+
673
+ - **Cmd+V, drag and drop.** The composer intercepts the terminal's bracketed paste. An empty paste
674
+ (what terminals send when the clipboard holds only an image) reads the clipboard; a paste made
675
+ only of existing image paths — escaped, quoted, `file://` or one unescaped path — attaches those
676
+ files. `Ctrl+V` (and `Alt+V`) on macOS, `Ctrl+V` elsewhere, read the clipboard directly, and a
677
+ `super+v` key from a terminal that forwards Cmd+V does the same.
678
+ - **Labels.** An image shows as `[Image #n]`. A paste of more than three lines or 800 characters
679
+ shows as `[Pasted text #n +L lines]` (or `… N chars]`). Numbering restarts after each send.
680
+ - **Deleting.** Backspace or Delete next to a label removes it whole. A word or line delete that
681
+ cuts into a label removes the rest of it, and the attachment goes with it.
682
+ - **Sending.** Pasted text is put back in place of its label; image labels stay in the text so the
683
+ model can refer to "Image #1", and the images follow in label order. Sent user messages colour
684
+ `[Image #n]` the same way. Images are resized with Pi's `resizeImage`; one that cannot be
685
+ shrunk and is over 5 MB is refused.
686
+ - **Refusals.** A model whose `input` lacks `image` refuses the attach with a notice naming the
687
+ model. Bash mode and plugin editors take no images. A slash command or Bash command sent with
688
+ images runs without them, with a warning. Alt+Up (dequeue) restores queued text and drops
689
+ queued images; deferred images produce a warning.
690
+
691
+ Finder-copied file paths are read before clipboard image pixels. On macOS, `.heic` and `.heif`
692
+ files are converted with `/usr/bin/sips` to private temporary PNGs, preserving the copied path
693
+ order and leaving the originals untouched; temporary files are removed when the terminal shuts
694
+ down. Clipboard image pixels go through Pi's native adapter, which reads PNG/TIFF on macOS and
695
+ normalizes TIFF to PNG. `python3 scripts/verify-terminal.py --attachments-only` checks a dropped
696
+ image path, label colour, collapsed pastes, whole-label Backspace and Alt+Backspace, and that the
697
+ loopback provider receives an image part and the expanded text. Whether a given emulator sends an
698
+ empty bracketed paste for an image-only clipboard has to be checked by hand in that emulator.
156
699
 
157
700
  ## Accounts, history and resource trust
158
701
 
@@ -161,7 +704,7 @@ personal Pi profile. Provider authentication and model catalogs use that account
161
704
  The selected account stays pinned. The existing `/accounts` command requests a parent-managed
162
705
  restart to use a different account while resuming the conversation.
163
706
 
164
- An initial `--session` or `/resume` target must resolve inside the prepared history directory,
707
+ An initial `--session` option or `/session` target (also accepted as `/resume`) must resolve inside the prepared history directory,
165
708
  including symlink targets, and its stored absolute working folder must match the terminal's
166
709
  canonical working folder. `/import` may copy an explicitly selected external native JSONL file
167
710
  only when its recorded working folder matches. A caller cannot override a foreign recorded
@@ -185,12 +728,14 @@ second key once with `control.claim`, before plugin code loads. [`control.ts`](.
185
728
  retains it in a process-local promise shared with the bridge; it is never written to disk or
186
729
  placed in the environment. It survives `/new`, resume, fork and reload.
187
730
 
188
- The private key is required for `terminal.policy`, `terminal.approval`, `terminal.pending`,
731
+ The private key is required for `terminal.policy`, `terminal.approval`, `terminal.pending`, `terminal.pending.wait`,
189
732
  `terminal.approve`, `terminal.answer`, `terminal.draft`, `terminal.interrupt` and
190
733
  `terminal.resources`, as well as existing account and plugin mutations. A model-spawned shell with
191
734
  only the environment token cannot submit policy or approval decisions, change permissions, or
192
735
  answer its own pending questions. The application renders decisions obtained from the existing
193
736
  controller and returns the person's answer through these calls.
737
+ The frontend waits on revisioned decision snapshots instead of polling continuously; a bounded wait
738
+ and reconnect resynchronize the inbox after a lost connection.
194
739
 
195
740
  Approval prompts offer **Allow once**, **Always allow this tool everywhere** when the host policy
196
741
  marks the decision rememberable, and **Deny**. A tool grant covers every call with that tool name
@@ -208,13 +753,86 @@ a tool waiting forever on a question after the screen has closed. Native `sessio
208
753
  clears controller readiness and stops that session's poller; the replacement's `session_start`
209
754
  restores readiness while retaining the same process control claim.
210
755
 
211
- The bridge exposes the shared `ask_user` batch tool alongside the existing single-question
212
- `ask_user_question` contract. Registry events project the actual batch IDs, order, summaries,
213
- choices and descriptions into the terminal inbox. The frontend stages answers locally and
214
- submits them together through protected `terminal.answers`; the registry validates the entire
215
- batch before resolving any question. Escape interrupts a pending question; cancelling optional
216
- text entry returns to the choices and preserves selections. Disappearing requests abort their
217
- open dialogs. Labels are numbered so a real choice cannot collide with a dialog action.
756
+ The bridge registers the shared `ask_user` batch tool alongside the single-question
757
+ `ask_user_question` contract; only plan requests activate them. Each question has a concise 1–2 word
758
+ label, at least one choice, and at least one recommended choice; recommendations remain visual and
759
+ never preselect. Choice-based questions also retain a free-text “Something else” answer. A pending
760
+ question occupies the composer position in a flat block, not a modal, with the chat transcript
761
+ above it. The dock fits its content and grows to at most two-thirds of the terminal height; each
762
+ question tab is sized from its own content. When content overflows, its body scrolls while tabs and
763
+ answer/action controls stay outside that region.
764
+ The final choice sits one blank row above “Something else”. The block has only a muted top divider
765
+ and separates its hint from the content by one blank line; below 60 terminal columns, it uses a
766
+ compact hint. While the dock is active, PageUp/PageDown scroll its body and Ctrl+Home/End jump to
767
+ its beginning/end instead of the transcript. Focused choices and note fields are brought into view.
768
+ A tab strip shows each question label above the active question title, with one blank row below the tabs
769
+ and below the title;
770
+ clicking a tab or using Left/Right changes questions without discarding staged answers. The header has
771
+ no pager controls, and the block cannot be collapsed. Choices and descriptions appear above the numbered free-text answer and Continue or Skip
772
+ action. Selected choices fill the whole row with subtle dark green; Continue and Submit uses a
773
+ green-filled button, while Skip remains neutral. While the block is active, the chat composer and
774
+ its lower status bar are hidden. Tab and Shift+Tab move through the available controls; `n` opens a
775
+ note for the focused selected choice. Its editor appears below that choice, aligned with the description
776
+ column, and begins with an accent-colored `Note:` label. Tab only visits note fields that are already
777
+ open. Notes are submitted by choice label and cleared when that choice is deselected. Notes and
778
+ free-text answers wrap across lines. Tab takes precedence over normal thinking and plan-mode shortcuts. Up
779
+ and Down navigate choices. Enter selects a choice, activates the focused action, or submits the
780
+ answer or note field. Escape cancels the pending question and interrupts the run. A refused answer
781
+ keeps the dock, its choices, notes and typed text, shows the reason inside the dock, and can be
782
+ submitted again after the change; writing a different answer clears the message.
783
+
784
+ Questions may set `uiSketch: true` to enable a choice sketch preview. Every choice must then include
785
+ an ASCII sketch of 1–24 LF-separated lines, no more than 80 printable ASCII characters per line
786
+ (1,943 bytes maximum), and at least one visible character. Tabs, CR, controls, escape sequences and
787
+ non-ASCII text are rejected. Without the flag, choice sketches are rejected. Tool guidance asks for
788
+ contextual UI wireframes with actual panel/table structure and neighboring elements, consistent
789
+ across alternatives, rather than isolated decorative diagrams; quality is not a schema guarantee.
790
+
791
+ The dock uses one shared measured layout for all choices: marker gutter, one-third label cell,
792
+ two-cell gap, and remaining description cell. Boundaries align across rows at every width, including
793
+ compact terminals; both cells wrap independently, missing descriptions keep their cell, and columns
794
+ never stack. Recommendation text becomes `(Rec.)` when the label column is fewer than 14 cells.
795
+ Multi-select choices use `✓` when selected and `○` when unselected, matching checklist glyphs;
796
+ single-choice options remain numbered.
797
+
798
+ One shared border-only monospace preview below the choices follows the hovered choice, falling
799
+ back to keyboard focus. It has no visible caption or extra left rule. Under the approved
800
+ [PROP-0026](architecture/proposals/PROP-0026-connected-sketch-display.md) /
801
+ [ADR-0027](decisions/ADR-0027-connected-sketch-display.md), amended by
802
+ [ADR-0080](decisions/ADR-0080-fixed-width-question-sketch-canvas.md), and
803
+ [PROP-0028](architecture/proposals/PROP-0028-normalize-question-wireframes.md) /
804
+ [ADR-0029](decisions/ADR-0029-normalized-question-wireframe-borders.md) amendments,
805
+ the terminal display uses a bounded structural projection in
806
+ `src/terminal/opentui/sketchPanel.ts`: recognized ASCII table-border rows—including title-bearing
807
+ top rules—and enclosed vertical table edges become connected box-drawing glyphs. Internal framed
808
+ tables keep their original widths and positions. Within a high-confidence frame, a missing side
809
+ edge may be filled or a displaced edge moved only through whitespace to matched corner columns;
810
+ interior text and ambiguous rows remain literal. The display uses a fixed 80-column content canvas:
811
+ short rows are padded and bare standalone hyphen dividers expand to 80 columns, attaching to the
812
+ outer single-line frame with `├` and `┤`. The outer frame stays within the available dock width;
813
+ Shift+arrows pan the canvas when it overflows. Prose, content operators, ordinary pipes and
814
+ unrecognized rows remain literal; there is no global `+|-` substitution. The original validated
815
+ ASCII source, including whitespace, is persisted untouched; padding, normalization and projected
816
+ glyphs are display-only.
817
+
818
+ A bounded two-axis viewport exposes all overflow without wrapping, reflow, truncation or
819
+ Markdown/ANSI interpretation. Shift+arrows pan the sketch; ordinary arrows retain question/choice
820
+ navigation. Hosts may keep literal previews of that same source. The preview does not change the
821
+ selected answer, and sketch metadata is not included in the answer event. The 80×24 source bounds
822
+ and dock layout remain as specified by
823
+ [PROP-0025](architecture/proposals/PROP-0025-contextual-question-wireframes.md) and
824
+ [ADR-0026](decisions/ADR-0026-contextual-question-wireframes.md). Isolated production PTY evidence
825
+ for [PROP-0026](architecture/proposals/PROP-0026-connected-sketch-display.md) and
826
+ [PROP-0028](architecture/proposals/PROP-0028-normalize-question-wireframes.md) is retained under
827
+ `docs/evidence/terminal-wireframe-normalization/`; it does not claim every-emulator rendering or
828
+ live-model sketch quality.
829
+
830
+ Recommended choices appear first with a warning-colored marker, without changing their labels or
831
+ preselecting them; every question requires at least one recommendation. A single-choice question
832
+ allows at most one recommendation, while multi-select questions may recommend several. The frontend stages each answer locally and submits the complete
833
+ batch together through protected `terminal.answers`; a single question uses `terminal.answer`. The
834
+ registry validates answers before resolving the request. If a request disappears, its block and
835
+ staged answers are discarded.
218
836
 
219
837
  Plugin UI methods carry a generation guard, including methods a plugin retained before an
220
838
  `await`. Session replacement, reload and disposal revoke the old generation. Outgoing native
@@ -222,31 +840,133 @@ event subscriptions and custom transcript components detach before native invali
222
840
  Cleanup failures cannot prevent terminal restoration. Fatal asynchronous errors restore the
223
841
  terminal and exit with failure; startup failures and suspend/resume use the same lifecycle.
224
842
 
225
- The command registry supplies help and completion for every pinned Pi built-in command name,
226
- plus Harness commands supplied by the bridge. `/trust` opens the existing protected code-review
227
- workflow in `/plugins`; trust changes require a freshly prepared terminal. `/bug` opens a
228
- reviewable Harness issue draft after confirmation, without attaching history. `/changelog`
229
- reads bundled Harness change notes. `/reload` also applies the isolated account's edited
230
- keyboard bindings through the public TUI manager.
843
+ The command registry supplies help and slash completion for Harness commands, loaded extensions
844
+ and prompts. `/session` selects a saved session (`/resume` remains an alias), and `/history` navigates
845
+ branches in the current session (`/tree` remains an alias). `/btw <question>` asks a side question;
846
+ `/side` is its alias. Help and the slash-command palette show each pair once, as `/session (resume)`,
847
+ `/history (tree)` and `/btw (side)`; aliases still match palette searches.
848
+ With no path argument, `/session` opens a full-screen searchable page. Each unnumbered row shows a
849
+ normal-color title and a muted second line with relative activity time, `<project>:<branch>` and JSONL
850
+ file size separated by ` · `. One blank line separates each session. Enter resumes the selected
851
+ session; account and folder scope checks
852
+ remain enforced. Supplying an explicit path continues directly without opening the picker.
853
+ The `$` palette completes enabled skill invocations using the same two-column palette as slash
854
+ commands, at any word start in the draft; `/skills` always browses skills. Choosing a skill inserts
855
+ `$name` at the caret without submitting. Every recognized `$name` that names a loaded skill uses the
856
+ blue accent in the composer, while its arguments, unavailable names and ordinary currency text keep
857
+ the normal color. Sending a message that contains `$name` makes that skill required for the request:
858
+ the terminal appends its text and the requirement as a hidden request-scoped message, and the
859
+ person's wording is sent unchanged. `/help` renders the command list as one
860
+ transcript entry, grouped under Core, Run, Model, Session, Inspect, Harness, Plugins and Prompts;
861
+ command names and descriptions wrap in aligned columns, with no blank rows between choices. `/plugins`
862
+ opens the focused local manager; its Packages tab installs, updates and removes packages with protected
863
+ Harness operations. Settings use `plugins.configure`; on/off settings and bounded whole-number settings
864
+ keep their existing ranges. Saved settings are read when the plugin next uses them and do not require a
865
+ restart. The standalone
866
+ terminal no longer has separate `/login`, `/trust`, `/bug`, `/changelog`, `/share`, `/scoped-mode` or
867
+ `/import` commands. `/btw <question>` (or `/side <question>`) starts a separate Harness run with the
868
+ main run's effective instructions, visible conversation and redacted public tool inputs/results.
869
+ Hidden reasoning and image bytes are excluded; the side run has no tools. Its block puts the
870
+ question after `/btw`, shows the normal animated spinner while answering, renders the answer as
871
+ Markdown, and separates the answer and hint by one blank row; it has no status labels. Headings,
872
+ emphasis, lists, quotes, links, tables and fenced code keep the theme's markdown colours, and a
873
+ streaming answer re-renders as it grows. PageUp/PageDown, or the mouse wheel over the block, browse
874
+ an answer taller than the block; Ctrl+X copies the full answer. Escape or either command with no
875
+ question dismisses the dock and interrupts
876
+ only that side run; the main reply continues. `/stop` interrupts the current main reply. The `/accounts` page handles sign-in
877
+ and sign-out. `/components` browses reusable skills, prompts and rules; a confirmed skill or rule addition
878
+ creates a variant version for future sessions while the current terminal keeps its pinned version. `/reload` applies trusted resource and keybinding changes.
879
+
880
+ `/variant` lists this scope's versions (tags, source, which is the head and which this chat runs) and
881
+ offers switch, restore, compare, tag and take-components on one; `/variant use|restore|tag|untag|diff|revert`
882
+ are the typed forms. A switch waits for the current reply, then restarts the frontend on that version
883
+ and resumes the conversation; the prompt cache starts over, and a version tuned for another model
884
+ says so. `/refine [--k N] [--mode m] [--model id] [--executor-model id] [what to look at]` replays the
885
+ latest request typed here from its turn snapshot: a confirmation shows the request, focus, run count
886
+ and models, then it runs in the background with a `refine` status item and a notice when done.
887
+ `/refine status`, `/refine stop` and `/refine review` follow it; review lists every candidate with the
888
+ selector's pick starred, shows its changes and its output in a scrollable page, and adopts any one
889
+ (with an optional tag), which switches this chat to it (PROP-0052).
231
890
 
232
891
  `/trajectory` opens the newest recorded run for the current native conversation; `/trajectory <run-id>`
233
- opens a selected run from that conversation. Left/right changes runs, up/down selects recorded
234
- events, PageUp/PageDown scrolls event details, and `c` copies the selected event. Active runs
235
- refresh while the overlay is open. The protected terminal socket scopes both the run list and event
236
- reads to the current terminal and native session file.
892
+ opens a selected run from that conversation. The full-screen page keeps searchable Runs and Events
893
+ tabs. In Events, the list sits beside the selected event's JSON on wide terminals and stacks above it
894
+ on compact terminals. Type to search run IDs, goals, event types, timestamps, summaries and payload
895
+ text; `[` and `]` change runs, up/down selects events, PageUp/PageDown scrolls event details, and
896
+ `Shift+C` copies the selected event JSON. Active runs refresh while the page is open. The protected
897
+ terminal socket scopes both the run list and event reads to the current terminal and native session file.
898
+
899
+ `/log` opens a centered page dialog with separate Harness diagnostics and current-conversation
900
+ run-event views. The diagnostic file is read at its captured size in bounded socket chunks. Tab/Shift+Tab
901
+ switches views; arrows, PageUp/PageDown, Home and End scroll; Escape closes. Fetch
902
+ diagnostics retain available error stacks and safe request metadata, while the viewer redacts secrets
903
+ and URL queries and omits response bodies, prompts and message contents. Embedded hosts without a
904
+ `harness.log` still show the conversation's recorded run events.
905
+
906
+ ## Slash command ownership
907
+
908
+ Harness core commands are unprefixed and live in the core terminal command registry, independently
909
+ of feature-plugin command metadata: `/doctor`, `/worktree`, `/trajectory`, `/subagents`, and `/agents`.
910
+ `/history` (also `/tree`) continues to navigate session branches. `/mcp` and `/connections` open the
911
+ Connections browser. Feature descriptors and their services remain registered; only these terminal
912
+ routes move out of the plugin command registry. Other plugin-owned commands continue to use
913
+ `/<owner-prefix>:<command>`. The annotations plugin uses `/annotate:notes`, `/annotate:submit` and
914
+ `/annotate:clear`; `/annotate:` opens its annotate page (a root-only command with no named route). Pi package extensions use their normalized package name
915
+ as owner prefix unless `harness.commandPrefix` overrides it; loose extensions use their normalized
916
+ extension name. A plugin prefix collision or a duplicate command within one owner is rejected with
917
+ owner paths in the diagnostic. The former owner-qualified and `/plugin:<command>` routes of promoted
918
+ Harness commands remain hidden compatibility aliases for one release, omitted from help and
919
+ completion. Prompt templates and `/skill:<name>` keep their existing forms.
920
+
921
+ ## Input performance profile
922
+
923
+ `npm run profile:terminal-latency` (`scripts/profile-terminal-latency.py`) types into the real
924
+ terminal in a PTY and times each key until it is visible on a virtual screen, while idle, after a
925
+ long tool history, while a reply streams, and with an approval or question waiting. It can run pure
926
+ Pi and opencode the same way for comparison; method and results are in
927
+ [EXP-0002](experiments/EXP-0002-opentui-typing-latency/results.md).
928
+ `npm run profile:terminal-input` still measures the local draft-control socket on its own.
929
+
930
+ How the frontend keeps typing fast:
931
+
932
+ - **Rendering on demand.** The renderer is not started in continuous mode, so a key is drawn as soon
933
+ as it arrives instead of waiting for the next fixed tick; `maxFps` is 120.
934
+ - **Fine-grained view.** `root.tsx` keeps the application view in a Solid store and reconciles each
935
+ update by item id, so a streamed delta updates one markdown block in place (`streaming` is passed
936
+ to `<markdown>`) and a keystroke does not redraw the transcript.
937
+ - **Coalesced background updates.** `change()` publishes runtime events at most once per frame,
938
+ 33 ms while a run is active. A person's input (keys, the composer, the question dock) publishes at
939
+ once and synchronously, in order with the composer's own events.
940
+ - **Draft read at key time.** The composer reports its text in a microtask, after all keys of one
941
+ input chunk; the root reads the composer before each key so Enter never sends a stale draft.
942
+ - **Cached derived data.** Finished messages keep their transcript items until their position or tool
943
+ results change; session statistics refresh at most every 250 ms during a run.
944
+ - **Kept connections.** Session-socket requests ask to `keep` their connection, so the two 100 ms
945
+ polls and per-key draft updates reuse a connection instead of opening one each.
946
+ - **No swallowed keys.** While a question is active, an unused printable character moves focus to
947
+ “Something else” and is typed there when free text is allowed; it never creates a hidden chat draft.
237
948
 
238
949
  ## Verification and remaining limits
239
950
 
240
- Fullscreen layout verification, 2026-10-18: [`screen.test.ts`](../src/terminal/tui/screen.test.ts)
241
- covers the dock on the last rows as the transcript grows and scrolls, notice clipping, regular
242
- flow, and the exit copy. The PTY verifier against the built CLI passed all 14 interaction groups at
243
- 40×20, 80×24 and 120×40; the retained result is
951
+ Release-candidate verification, 2026-10-19: clean `npm ci` and `npm run ci` passed—541 tests
952
+ (two skipped), typecheck, build and standalone proof. In the sibling App, typecheck, layer check and
953
+ sidecar build passed; its renderer tests passed (561), but one sidecar screenshot assertion and two
954
+ Rust tests failed in the broader in-progress App worktree. Those failures do not touch the Harness
955
+ release files; the App changes were not included in this package.
956
+
957
+ OpenTUI verification, 2026-10-20: the OpenTUI unit tests cover the transcript model, palette,
958
+ Bash mode, dialog geometry, composer, theme and component host. Targeted PTY probes against the
959
+ production bundle cover centered page dialogs at 40×20, 80×24 and 120×40, palette ranking, and
960
+ Bash mode through its approval gate; see
961
+ [docs/evidence/terminal-2026-10-20-console-tui](evidence/terminal-2026-10-20-console-tui/README.md).
962
+ The full `scripts/verify-terminal.py` run under OpenTUI stops at `/settings` because the verifier
963
+ sends the command and Return in one burst; the targeted probes send them separately. Run
964
+ `python3 scripts/verify-terminal.py --sizes 80x24 --click-focus-only` to check composer focus from
965
+ the empty welcome area, transcript text and blank transcript space in an isolated PTY.
966
+
967
+ Earlier fullscreen-layout verification, 2026-10-18, covered the removed Pi frontend's dock,
968
+ notice clipping, regular flow and exit copy. It is retained as history in
244
969
  [docs/evidence/terminal-2026-10-18-fullscreen](evidence/terminal-2026-10-18-fullscreen/verification.json).
245
- The verifier's keyboard-list check now waits for the list's first line, because a long notice shows
246
- its first rows in the dock and scrolls for the rest. The App sidecar's suite passes 30 of 30 and
247
- `cargo test` passes 217 tests against this tree. The App's root Vitest suite has one failure, the
248
- pre-existing `PendingRequestDock` expectation. The App sidecar's own `tsc` run reports four errors
249
- in `agentRuns.ts` and `app.test.ts` that also occur on the checkpoint commit.
250
970
 
251
971
  Earlier verification, before the fullscreen layout: Harness typecheck, **419 passing tests / two platform skips**, build and standalone proof
252
972
  passed on 2026-10-17. A final cleanup-order adjustment was rechecked with all **91 frontend
@@ -281,7 +1001,7 @@ Already-running sessions need to exit and relaunch to load the replacement.
281
1001
  A direct REA comparison of the pinned OMP executable and Harness at 80×24 captures startup and
282
1002
  settings without output truncation; both exit 0. The [readable comparison](evidence/terminal-2026-10-17-followup/reference-comparison.md)
283
1003
  retains exact frame/evidence IDs. It established matching centered welcome/composer geometry,
284
- rounded settings framing and the need for flat settings rows at 80 columns; the latter was
1004
+ rounded settings framing (since replaced by [pages](#blocks-and-pages)) and the need for flat settings rows at 80 columns; the latter was
285
1005
  corrected using the shipped SettingsList's minimum editable-pane width. Product lockups, tips,
286
1006
  capability tabs, setting names, paths and unavailable-model guidance differ deliberately.
287
1007
  This is bounded visual review, not proof of equivalence for every OMP surface.
@@ -300,11 +1020,12 @@ a successful response or tool execution. Harness persisted the failed run and re
300
1020
  terminal; the source sign-in file was unchanged and the disposable credentials were deleted.
301
1021
  The [live report and capture](evidence/terminal-2026-10-17-followup/live-codex/README.md) retain
302
1022
  this quota failure explicitly. Successful live streaming/tool acceptance remains open until
303
- account capacity is available. GitHub gist publication, actual OS clipboard/image transfer,
304
- Windows behavior and every terminal emulator remain unverified. Rich image/diff rendering and clipboard adapters have
305
- focused compatibility tests; that does not establish OS interaction. These working-tree changes
306
- are not a published release and the complete plan's acceptance remains open while required
307
- integration/provider evidence is outstanding.
1023
+ account capacity is available. GitHub gist publication, actual OS clipboard pixel transfer,
1024
+ Windows behavior and every terminal emulator remain unverified. HEIC/HEIF file staging has focused
1025
+ conversion tests; that does not establish Finder or Warp OS interaction. Rich image/diff rendering
1026
+ and clipboard adapters have focused compatibility tests; that does not establish OS interaction. These changes shipped in
1027
+ `@xingular/harness` 2.0.0 (commit `44471bc`), while the complete plan's acceptance remains
1028
+ open pending the required integration and provider evidence.
308
1029
 
309
1030
  To reproduce the controlled scenario after building:
310
1031
 
@@ -342,3 +1063,60 @@ inherit that retained ledger.
342
1063
  - The portable OMP/Harness runtime evidence IDs and selected frame numbers are recorded in
343
1064
  the readable comparison and manifest linked above. An earlier OMP capture sent input before
344
1065
  startup completed; it is retained as incomplete evidence and excluded from the comparison.
1066
+
1067
+ ## Agent-managed session names
1068
+
1069
+ Agents can use `session_name({ name: string })` to name work before their first other tool call
1070
+ when a request needs tools or changes state, and revise the name only when the objective changes.
1071
+ Names submitted by agents are short imperative
1072
+ sentences with at most six words. The agent may revise a manual name; `/name` remains
1073
+ available and manual names have no new word limit. Pi stores the name in native history,
1074
+ so resuming the same conversation restores it without another model request.
1075
+
1076
+ A substantive first turn also gets a provisional name through the terminal policy when the
1077
+ session is unnamed; a refused or failed name leaves it unnamed. Each turn appends a hidden
1078
+ `xingular-session-state` message with the current name and this run's empty todo, with the
1079
+ previous run's list as context; the message is request-only and does not enter the stable pack.
1080
+
1081
+ The working line shows `Working (2m, 50 tok/s) – Add web browser integrations`; the name
1082
+ also stays on the completion line. Unnamed sessions have no separator, and narrow terminals
1083
+ truncate trailing text. Renaming refreshes the line through Pi's existing metadata event.
1084
+
1085
+ ## `/doctor`
1086
+
1087
+ Checks accounts/models, tools, MCP, plugins/skills, variant/prompt validity, runtime assets, storage
1088
+ and startup recovery. The summary keeps mode, progress, account/model and status counts visible above
1089
+ the findings. Wide layouts use aligned Status, Check, Category and Verification columns, with evidence
1090
+ and any next step beneath each finding; narrow layouts stack those fields. Status colors follow the
1091
+ active theme: pass is success, warning/blocked warning, fail error, disabled dim and unverified muted.
1092
+
1093
+ `r` refreshes, `t` retries one local finding, `l` selects live checks, `c` cancels, Up/Down scroll by
1094
+ line, PgUp/PgDn or the mouse wheel by page, and Home/End jump to the first/last finding. Escape
1095
+ closes/cancels. Live
1096
+ checks show their costs and isolated resources before confirmation. Providers without diagnostic
1097
+ callbacks are reported unverified. See [Doctor](doctor.md).
1098
+
1099
+ ## Resource browser verification (2026-10-22)
1100
+
1101
+ The [retained evidence](evidence/terminal-resource-browser/README.md) records three-size PTY
1102
+ acceptance, pointer/filter and resize behavior, skill completion/insertion and preserved drafts,
1103
+ with zero model requests. Isolated idle/history/stream input profiling reported no missed keys
1104
+ and p95 14.81/14.27/17.32 ms. The manifest binds both the CLI and OpenTUI bundle to their digests.
1105
+ Live external connector authentication and community package installation were not exercised.
1106
+
1107
+
1108
+ ## Full-screen browser verification (2026-10-23)
1109
+
1110
+ [PROP-0014](architecture/proposals/PROP-0014-fullscreen-browser-tabs.md) and
1111
+ [ADR-0016](decisions/ADR-0016-fullscreen-browser-tabs.md) replace the browser's centered layout
1112
+ with full-screen section tabs and a responsive inventory/inspector. The
1113
+ [retained PTY evidence](evidence/terminal-fullscreen-browser/README.md) covers 40×20, 80×24 and
1114
+ 120×40, keyboard and pointer tab selection, filter interaction, resizing and draft preservation,
1115
+ with zero model requests. The manifest binds the CLI, OpenTUI bundle and verification script.
1116
+
1117
+ Harness typecheck, full tests (893 passing, three platform skips), build and standalone proof
1118
+ passed. The final focused browser/page/command run passed 75 tests. Agent app typecheck, layer
1119
+ checks, frontend tests, all 40 sidecar tests and 240 Rust tests passed (one Rust test ignored).
1120
+ Sidecar tests were rerun with two workers and a 30-second timeout after four five-second timeouts
1121
+ under concurrent load. Socket-backed Harness and PTY checks required sandbox escalation;
1122
+ verification used local fixtures and disposable session data.