@timurproko/a1 0.1.8-dev.472 → 0.1.8-dev.508

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 (370) hide show
  1. package/bin/cli.js +4 -5
  2. package/bin/guardian.js +5 -1
  3. package/bin/module-identity.js +53 -98
  4. package/bin/module-resolver.js +138 -0
  5. package/bin/pinned-pi-public.js +25 -6
  6. package/bin/ui.js +7 -2
  7. package/bin/update-recovery.js +76 -7
  8. package/bin/warmup.js +3 -0
  9. package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-diagnostics.d.ts +1 -1
  10. package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-image.js +1 -1
  11. package/dist/app/session-shell/helper-pool.d.ts +33 -0
  12. package/dist/app/session-shell/helper-pool.js +98 -0
  13. package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation-client.d.ts +1 -1
  14. package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation-client.js +1 -1
  15. package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation.js +1 -1
  16. package/dist/{integrations/pi/session-ui → app/session-shell}/image-source.js +1 -1
  17. package/dist/{integrations/pi/session-ui → app/session-shell}/image-worker.js +1 -1
  18. package/dist/app/session-shell/index.d.ts +7 -0
  19. package/dist/app/session-shell/index.js +4 -0
  20. package/dist/app/session-shell/paste-executor.d.ts +18 -0
  21. package/dist/{integrations/pi/session-ui → app/session-shell}/paste-executor.js +50 -29
  22. package/dist/{integrations/pi/session-ui → app/session-shell}/paste-helper.js +1 -1
  23. package/dist/app/session-shell/paste-preparation-client.d.ts +31 -0
  24. package/dist/{integrations/pi/session-ui → app/session-shell}/paste-preparation-client.js +19 -8
  25. package/dist/{integrations/pi/session-ui → app/session-shell}/paste-protocol.d.ts +1 -1
  26. package/dist/{integrations/pi/session-ui → app/session-shell}/paste-protocol.js +1 -1
  27. package/dist/app/session-shell/paste-text-preparation.d.ts +6 -0
  28. package/dist/{integrations/pi/session-ui/paste-text-preparation.d.ts → app/session-shell/paste-types.d.ts} +1 -4
  29. package/dist/{integrations/pi/session-ui → app/session-shell}/path-chip-presentation.d.ts +1 -1
  30. package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-chips.d.ts +5 -1
  31. package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-chips.js +6 -2
  32. package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-history-controller.d.ts +2 -2
  33. package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-history-controller.js +2 -2
  34. package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-suggestion-controller.d.ts +1 -1
  35. package/dist/{integrations/pi/session-ui → app/session-shell}/prompt-suggestion-controller.js +2 -2
  36. package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro.js +1 -1
  37. package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-coordinator.d.ts +1 -1
  38. package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-coordinator.js +3 -5
  39. package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-helper.js +1 -1
  40. package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-protocol.d.ts +1 -1
  41. package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-transport.d.ts +10 -2
  42. package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-transport.js +45 -19
  43. package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell-root.d.ts +75 -53
  44. package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell-root.js +30 -20
  45. package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell.d.ts +9 -8
  46. package/dist/{integrations/pi/session-ui → app/session-shell}/session-shell.js +108 -67
  47. package/dist/{integrations/pi/session-ui → app/session-shell}/session-viewport-controller.d.ts +5 -5
  48. package/dist/{integrations/pi/session-ui → app/session-shell}/session-viewport-controller.js +5 -5
  49. package/dist/{integrations/pi/session-ui → app/session-shell}/system-clipboard.d.ts +1 -1
  50. package/dist/{integrations/pi/session-ui → app/session-shell}/system-clipboard.js +1 -1
  51. package/dist/cli/index.d.ts +8 -5
  52. package/dist/cli/index.js +4 -5
  53. package/dist/composition/index.d.ts +0 -1
  54. package/dist/composition/index.js +0 -1
  55. package/dist/composition/owned-ui.d.ts +2 -2
  56. package/dist/composition/owned-ui.js +35 -36
  57. package/dist/composition/settings-route-host.d.ts +2 -2
  58. package/dist/contracts/agent-engine/domain.d.ts +6 -1
  59. package/dist/contracts/agent-engine/index.d.ts +11 -8
  60. package/dist/contracts/agent-engine/index.js +6 -8
  61. package/dist/contracts/owned-ui/extension-ui.d.ts +8 -0
  62. package/dist/contracts/owned-ui/index.d.ts +12 -8
  63. package/dist/contracts/owned-ui/index.js +8 -8
  64. package/dist/features/launch/index.d.ts +12 -6
  65. package/dist/features/launch/index.js +6 -6
  66. package/dist/features/launch/intent.d.ts +5 -5
  67. package/dist/features/launch/intent.js +2 -2
  68. package/dist/features/owned-ui/index.d.ts +6 -6
  69. package/dist/features/owned-ui/index.js +4 -6
  70. package/dist/features/owned-ui/run.d.ts +2 -2
  71. package/dist/features/owned-ui/settings-app.d.ts +2 -2
  72. package/dist/features/owned-ui/settings-app.js +18 -5
  73. package/dist/features/prompt-history/service.d.ts +1 -1
  74. package/dist/features/prompt-history/service.js +1 -1
  75. package/dist/features/prompt-history/store.js +3 -7
  76. package/dist/features/prompt-suggestions/diagnostics.js +1 -1
  77. package/dist/features/prompt-suggestions/index.d.ts +2 -1
  78. package/dist/features/prompt-suggestions/index.js +1 -1
  79. package/dist/foundation/launch-guardian/index.d.ts +2 -1
  80. package/dist/foundation/launch-guardian/index.js +1 -1
  81. package/dist/foundation/lifecycle/index.d.ts +11 -6
  82. package/dist/foundation/lifecycle/index.js +5 -6
  83. package/dist/foundation/process-containment/index.d.ts +8 -6
  84. package/dist/foundation/process-containment/index.js +6 -6
  85. package/dist/foundation/process-containment/native-guardian-containment.js +3 -3
  86. package/dist/foundation/protocol/index.d.ts +3 -2
  87. package/dist/foundation/protocol/index.js +2 -2
  88. package/dist/foundation/release/bootstrap.d.ts +0 -4
  89. package/dist/foundation/release/bootstrap.js +1 -82
  90. package/dist/foundation/release/dependency-layer.d.ts +2 -5
  91. package/dist/foundation/release/endpoints.d.ts +4 -0
  92. package/dist/foundation/release/endpoints.js +86 -2
  93. package/dist/foundation/release/index.d.ts +30 -16
  94. package/dist/foundation/release/index.js +16 -16
  95. package/dist/foundation/release/release.d.ts +1 -1
  96. package/dist/foundation/release/types.d.ts +11 -0
  97. package/dist/foundation/release/types.js +1 -0
  98. package/dist/foundation/release/update-transaction.d.ts +1 -1
  99. package/dist/foundation/release/update.d.ts +2 -1
  100. package/dist/foundation/release/update.js +3 -18
  101. package/dist/foundation/startup/index.d.ts +4 -2
  102. package/dist/foundation/startup/index.js +2 -2
  103. package/dist/foundation/startup/startup-descriptor.js +2 -2
  104. package/dist/foundation/storage/control-store.d.ts +1 -45
  105. package/dist/foundation/storage/control-store.js +54 -277
  106. package/dist/foundation/storage/index.d.ts +1 -1
  107. package/dist/foundation/storage/index.js +1 -1
  108. package/dist/foundation/supervision/index.d.ts +2 -2
  109. package/dist/foundation/supervision/index.js +2 -2
  110. package/dist/foundation/supervision/server.d.ts +5 -10
  111. package/dist/foundation/supervision/server.js +7 -7
  112. package/dist/foundation/terminal-cleanup/index.d.ts +3 -2
  113. package/dist/foundation/terminal-cleanup/index.js +2 -2
  114. package/dist/integrations/pi/components/editor-interaction.d.ts +1 -1
  115. package/dist/integrations/pi/components/history-editor-loader.d.ts +1 -1
  116. package/dist/integrations/pi/components/index.d.ts +20 -13
  117. package/dist/integrations/pi/components/index.js +12 -13
  118. package/dist/integrations/pi/components/owned-editor-ux.js +5 -8
  119. package/dist/integrations/pi/components/resources/builtin-themes.d.ts +7 -5
  120. package/dist/integrations/pi/components/resources/builtin-themes.js +7 -5
  121. package/dist/integrations/pi/components/shell-editor-autocomplete.js +1 -1
  122. package/dist/integrations/pi/components/shell-extension-ui.js +2 -1
  123. package/dist/integrations/pi/components/shell-footer-status.js +1 -1
  124. package/dist/integrations/pi/components/shell-presenters-info.d.ts +1 -1
  125. package/dist/integrations/pi/components/shell-presenters-info.js +1 -1
  126. package/dist/integrations/pi/components/shell-presenters-transcript.js +1 -1
  127. package/dist/integrations/pi/components/shell-selectors-dialogs.d.ts +9 -3
  128. package/dist/integrations/pi/components/shell-selectors-dialogs.js +9 -6
  129. package/dist/integrations/pi/components/shell-shared-facade.d.ts +3 -1
  130. package/dist/integrations/pi/components/shell-shared-facade.js +4 -2
  131. package/dist/integrations/pi/components/submitted-prompt-adapter.d.ts +1 -1
  132. package/dist/integrations/pi/components/submitted-prompt-adapter.js +1 -1
  133. package/dist/integrations/pi/components/tool-image-presentation.d.ts +1 -1
  134. package/dist/integrations/pi/components/tool-image-presentation.js +4 -7
  135. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.d.ts +36 -22
  136. package/dist/integrations/pi/components/upstream/adjacent/core/keybindings.js +43 -7
  137. package/dist/integrations/pi/components/upstream/assets/earendil-image.json +2 -2
  138. package/dist/integrations/pi/components/upstream/components/countdown-timer.d.ts +6 -3
  139. package/dist/integrations/pi/components/upstream/components/daxnuts.d.ts +8 -1
  140. package/dist/integrations/pi/components/upstream/components/daxnuts.js +7 -3
  141. package/dist/integrations/pi/components/upstream/components/earendil-announcement.d.ts +1 -1
  142. package/dist/integrations/pi/components/upstream/components/earendil-announcement.js +10 -4
  143. package/dist/integrations/pi/components/upstream/components/extension-editor.d.ts +7 -4
  144. package/dist/integrations/pi/components/upstream/components/extension-editor.js +7 -4
  145. package/dist/integrations/pi/components/upstream/components/mermaid.js +8 -4
  146. package/dist/integrations/pi/components/upstream/components/owned-editor.d.ts +9 -5
  147. package/dist/integrations/pi/components/upstream/components/owned-editor.js +10 -6
  148. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.d.ts +8 -4
  149. package/dist/integrations/pi/components/upstream/components/scoped-models-selector.js +27 -25
  150. package/dist/integrations/pi/components/upstream/components/session-footer.d.ts +1 -1
  151. package/dist/integrations/pi/components/upstream/components/session-footer.js +8 -10
  152. package/dist/integrations/pi/components/upstream/components/session-selector-search.js +6 -4
  153. package/dist/integrations/pi/components/upstream/components/session-selector.d.ts +1 -1
  154. package/dist/integrations/pi/components/upstream/components/session-selector.js +8 -4
  155. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.d.ts +7 -5
  156. package/dist/integrations/pi/components/upstream/components/skill-invocation-message.js +8 -6
  157. package/dist/integrations/pi/components/upstream/components/status-indicator.d.ts +9 -4
  158. package/dist/integrations/pi/components/upstream/components/status-indicator.js +15 -5
  159. package/dist/integrations/pi/components/upstream/components/tool-execution.d.ts +8 -2
  160. package/dist/integrations/pi/components/upstream/components/tool-execution.js +58 -37
  161. package/dist/integrations/pi/components/upstream/components/tree-selector.d.ts +7 -4
  162. package/dist/integrations/pi/components/upstream/components/tree-selector.js +7 -4
  163. package/dist/integrations/pi/components/upstream/components/trust-selector.d.ts +1 -1
  164. package/dist/integrations/pi/components/upstream/components/trust-selector.js +10 -5
  165. package/dist/integrations/pi/components/upstream/external-editor.js +8 -4
  166. package/dist/integrations/pi/components/upstream/history/editor-core.d.ts +13 -4
  167. package/dist/integrations/pi/components/upstream/history/editor-core.js +112 -30
  168. package/dist/integrations/pi/components/upstream/history/kill-ring.d.ts +6 -3
  169. package/dist/integrations/pi/components/upstream/history/kill-ring.js +6 -3
  170. package/dist/integrations/pi/components/upstream/history/printable-key.js +7 -4
  171. package/dist/integrations/pi/components/upstream/history/text-helpers.js +6 -3
  172. package/dist/integrations/pi/components/upstream/history/undo-stack.d.ts +6 -3
  173. package/dist/integrations/pi/components/upstream/history/undo-stack.js +6 -3
  174. package/dist/integrations/pi/components/upstream/history/word-navigation.js +6 -3
  175. package/dist/integrations/pi/components/upstream/model-search.d.ts +5 -2
  176. package/dist/integrations/pi/components/upstream/theme/theme-controller.d.ts +8 -0
  177. package/dist/integrations/pi/components/upstream/theme/theme-controller.js +0 -3
  178. package/dist/integrations/pi/components/upstream/theme/theme.d.ts +2 -2
  179. package/dist/integrations/pi/components/upstream/theme/theme.js +17 -6
  180. package/dist/integrations/pi/engine/adapter.d.ts +39 -138
  181. package/dist/integrations/pi/engine/adapter.js +338 -3226
  182. package/dist/integrations/pi/engine/command-dispatch.d.ts +41 -0
  183. package/dist/integrations/pi/engine/command-dispatch.js +125 -0
  184. package/dist/integrations/pi/engine/event-delivery.d.ts +100 -0
  185. package/dist/integrations/pi/engine/event-delivery.js +184 -0
  186. package/dist/integrations/pi/engine/extension-ui-binding.d.ts +35 -0
  187. package/dist/integrations/pi/engine/extension-ui-binding.js +81 -0
  188. package/dist/integrations/pi/engine/index.d.ts +18 -14
  189. package/dist/integrations/pi/engine/index.js +10 -14
  190. package/dist/integrations/pi/engine/message-values.d.ts +29 -0
  191. package/dist/integrations/pi/engine/message-values.js +168 -0
  192. package/dist/integrations/pi/engine/pending-delivery.d.ts +2 -2
  193. package/dist/integrations/pi/engine/pending-delivery.js +2 -4
  194. package/dist/integrations/pi/engine/pi-settings-metadata.json +382 -371
  195. package/dist/integrations/pi/engine/prompt-suggestions.d.ts +30 -0
  196. package/dist/integrations/pi/engine/prompt-suggestions.js +102 -0
  197. package/dist/integrations/pi/engine/provider-authentication.d.ts +34 -0
  198. package/dist/integrations/pi/engine/provider-authentication.js +209 -0
  199. package/dist/integrations/pi/engine/resource-catalog.d.ts +49 -0
  200. package/dist/integrations/pi/engine/resource-catalog.js +289 -0
  201. package/dist/integrations/pi/engine/resources/changelog.json +4 -4
  202. package/dist/integrations/pi/engine/session-events.d.ts +48 -0
  203. package/dist/integrations/pi/engine/session-events.js +223 -0
  204. package/dist/integrations/pi/engine/session-integration.js +2 -4
  205. package/dist/integrations/pi/engine/session-runtime.d.ts +84 -0
  206. package/dist/integrations/pi/engine/session-runtime.js +249 -0
  207. package/dist/integrations/pi/engine/{settings-effects.d.ts → settings-bridge.d.ts} +57 -2
  208. package/dist/integrations/pi/engine/settings-bridge.js +514 -0
  209. package/dist/integrations/pi/engine/settings-metadata.d.ts +31 -0
  210. package/dist/integrations/pi/engine/settings-metadata.js +67 -0
  211. package/dist/integrations/pi/engine/settings-port.d.ts +42 -0
  212. package/dist/integrations/pi/engine/settings-port.js +353 -0
  213. package/dist/integrations/pi/engine/transcript-projection.d.ts +39 -0
  214. package/dist/integrations/pi/engine/transcript-projection.js +405 -0
  215. package/dist/integrations/pi/engine/usage-view.d.ts +4 -0
  216. package/dist/integrations/pi/engine/usage-view.js +56 -0
  217. package/dist/integrations/pi/engine/workflow-contexts.d.ts +59 -0
  218. package/dist/integrations/pi/engine/workflow-contexts.js +316 -0
  219. package/dist/integrations/pi/engine/workflow-runner.d.ts +60 -0
  220. package/dist/integrations/pi/engine/workflow-runner.js +509 -0
  221. package/dist/integrations/pi/engine/workflow-support.d.ts +33 -0
  222. package/dist/integrations/pi/engine/workflow-support.js +352 -0
  223. package/dist/integrations/pi/engine/workflows.d.ts +63 -2
  224. package/dist/integrations/pi/engine/workflows.js +5 -2
  225. package/dist/integrations/pi/startup-public.js +576 -554
  226. package/dist/integrations/pi/startup-public.manifest.json +1730 -984
  227. package/dist/integrations/pi/tui-runtime/adapter.js +10 -13
  228. package/dist/integrations/pi/tui-runtime/contracts.d.ts +11 -1
  229. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.d.ts +1 -1
  230. package/dist/integrations/pi/tui-runtime/damage-aware-terminal.js +4 -7
  231. package/dist/integrations/pi/tui-runtime/index.d.ts +8 -6
  232. package/dist/integrations/pi/tui-runtime/index.js +4 -6
  233. package/dist/integrations/pi/tui-runtime/mouse-report-input.js +2 -4
  234. package/dist/integrations/pi/tui-runtime/overlay-geometry.d.ts +2 -2
  235. package/dist/integrations/pi/tui-runtime/overlay-geometry.js +4 -5
  236. package/dist/integrations/pi/tui-runtime/presentation-adapter.js +1 -1
  237. package/dist/native/darwin-arm64/manifest.json +1 -1
  238. package/dist/native/linux-x64/manifest.json +1 -1
  239. package/dist/native/win32-x64/manifest.json +2 -2
  240. package/dist/native/win32-x64/process-guardian.exe +0 -0
  241. package/dist/runtime-payload-inventory.json +51320 -46509
  242. package/dist/ui/apps/index.d.ts +5 -3
  243. package/dist/ui/apps/index.js +3 -3
  244. package/dist/ui/components/index.d.ts +47 -25
  245. package/dist/ui/components/index.js +25 -25
  246. package/dist/ui/components/prompt-input.js +1 -4
  247. package/dist/ui/settings/declarations.d.ts +119 -0
  248. package/dist/ui/settings/declarations.js +20 -11
  249. package/dist/ui/settings/index.d.ts +10 -6
  250. package/dist/ui/settings/index.js +5 -6
  251. package/dist/ui/settings/manager.d.ts +54 -0
  252. package/dist/ui/settings/{session.js → manager.js} +101 -9
  253. package/dist/ui/settings/sections.d.ts +2 -7
  254. package/docs/architecture/boundaries.md +4 -4
  255. package/docs/architecture/history-editor-provenance.md +1 -1
  256. package/docs/architecture/project-structure.md +6 -6
  257. package/docs/architecture/prompt-suggestions.md +1 -1
  258. package/docs/architecture/terminal-host-proof-gate.md +1 -1
  259. package/docs/architecture/terminal-host-spike-evidence.md +1 -1
  260. package/docs/architecture/toolchain.md +8 -0
  261. package/docs/architecture/ui-reference-provenance.md +4 -4
  262. package/docs/ci-release-runbook.md +7 -1
  263. package/docs/features/modal-content-interaction.md +2 -2
  264. package/docs/local-worktree-cleanup.md +4 -2
  265. package/docs/validation.md +6 -4
  266. package/package.json +7 -11
  267. package/bin/pi-tui.d.ts +0 -6
  268. package/bin/pi-tui.js +0 -28
  269. package/bin/sync-pi-tui-proxy.js +0 -97
  270. package/dist/cli/version.d.ts +0 -2
  271. package/dist/cli/version.js +0 -23
  272. package/dist/composition/agent-engine-bridge.d.ts +0 -3
  273. package/dist/composition/agent-engine-bridge.js +0 -108
  274. package/dist/composition/process.d.ts +0 -16
  275. package/dist/composition/process.js +0 -45
  276. package/dist/contracts/workspace/index.d.ts +0 -2
  277. package/dist/contracts/workspace/index.js +0 -2
  278. package/dist/contracts/workspace/model.d.ts +0 -248
  279. package/dist/contracts/workspace/model.js +0 -2
  280. package/dist/contracts/workspace/validation.d.ts +0 -13
  281. package/dist/contracts/workspace/validation.js +0 -335
  282. package/dist/features/owned-ui/customization.d.ts +0 -40
  283. package/dist/features/owned-ui/customization.js +0 -110
  284. package/dist/features/owned-ui/diagnostics.d.ts +0 -34
  285. package/dist/features/owned-ui/diagnostics.js +0 -95
  286. package/dist/features/workspace/capabilities.d.ts +0 -31
  287. package/dist/features/workspace/capabilities.js +0 -75
  288. package/dist/features/workspace/index.d.ts +0 -6
  289. package/dist/features/workspace/index.js +0 -6
  290. package/dist/features/workspace/presentation.d.ts +0 -30
  291. package/dist/features/workspace/presentation.js +0 -70
  292. package/dist/features/workspace/reconciliation.d.ts +0 -15
  293. package/dist/features/workspace/reconciliation.js +0 -82
  294. package/dist/features/workspace/reducer.d.ts +0 -43
  295. package/dist/features/workspace/reducer.js +0 -214
  296. package/dist/features/workspace/router.d.ts +0 -32
  297. package/dist/features/workspace/router.js +0 -125
  298. package/dist/features/workspace/store.d.ts +0 -18
  299. package/dist/features/workspace/store.js +0 -55
  300. package/dist/foundation/native-host-protocol/codec.d.ts +0 -13
  301. package/dist/foundation/native-host-protocol/codec.js +0 -58
  302. package/dist/foundation/native-host-protocol/evidence.d.ts +0 -67
  303. package/dist/foundation/native-host-protocol/evidence.js +0 -141
  304. package/dist/foundation/native-host-protocol/index.d.ts +0 -4
  305. package/dist/foundation/native-host-protocol/index.js +0 -4
  306. package/dist/foundation/native-host-protocol/messages.d.ts +0 -56
  307. package/dist/foundation/native-host-protocol/messages.js +0 -149
  308. package/dist/foundation/native-host-protocol/proof-gate.d.ts +0 -13
  309. package/dist/foundation/native-host-protocol/proof-gate.js +0 -33
  310. package/dist/foundation/structured-agent-runtime/backpressure.d.ts +0 -47
  311. package/dist/foundation/structured-agent-runtime/backpressure.js +0 -119
  312. package/dist/foundation/structured-agent-runtime/commands.d.ts +0 -53
  313. package/dist/foundation/structured-agent-runtime/commands.js +0 -165
  314. package/dist/foundation/structured-agent-runtime/handshake.d.ts +0 -41
  315. package/dist/foundation/structured-agent-runtime/handshake.js +0 -151
  316. package/dist/foundation/structured-agent-runtime/index.d.ts +0 -5
  317. package/dist/foundation/structured-agent-runtime/index.js +0 -5
  318. package/dist/foundation/structured-agent-runtime/reconnection.d.ts +0 -38
  319. package/dist/foundation/structured-agent-runtime/reconnection.js +0 -130
  320. package/dist/foundation/structured-agent-runtime/state.d.ts +0 -57
  321. package/dist/foundation/structured-agent-runtime/state.js +0 -119
  322. package/dist/integrations/pi/components/upstream/components/custom-entry.d.ts +0 -17
  323. package/dist/integrations/pi/components/upstream/components/custom-entry.js +0 -51
  324. package/dist/integrations/pi/components/upstream/components/first-time-setup.d.ts +0 -24
  325. package/dist/integrations/pi/components/upstream/components/first-time-setup.js +0 -105
  326. package/dist/integrations/pi/components/upstream/components/markdown-transform.d.ts +0 -2
  327. package/dist/integrations/pi/components/upstream/components/markdown-transform.js +0 -18
  328. package/dist/integrations/pi/engine/model-auth-integration.d.ts +0 -31
  329. package/dist/integrations/pi/engine/model-auth-integration.js +0 -62
  330. package/dist/integrations/pi/engine/resource-extension-integration.d.ts +0 -32
  331. package/dist/integrations/pi/engine/resource-extension-integration.js +0 -81
  332. package/dist/integrations/pi/engine/settings-effects.js +0 -249
  333. package/dist/integrations/pi/engine/settings-integration.d.ts +0 -43
  334. package/dist/integrations/pi/engine/settings-integration.js +0 -227
  335. package/dist/integrations/pi/engine/workflow-controllers.d.ts +0 -21
  336. package/dist/integrations/pi/engine/workflow-controllers.js +0 -49
  337. package/dist/integrations/pi/session-ui/index.d.ts +0 -5
  338. package/dist/integrations/pi/session-ui/index.js +0 -5
  339. package/dist/integrations/pi/session-ui/paste-executor.d.ts +0 -10
  340. package/dist/integrations/pi/session-ui/paste-preparation-client.d.ts +0 -16
  341. package/dist/integrations/pi/session-ui/route-host.d.ts +0 -5
  342. package/dist/integrations/pi/tui-runtime/conformance.d.ts +0 -18
  343. package/dist/integrations/pi/tui-runtime/conformance.js +0 -145
  344. package/dist/ui/components/prompt-row.d.ts +0 -14
  345. package/dist/ui/components/prompt-row.js +0 -20
  346. package/dist/ui/settings/session.d.ts +0 -36
  347. package/dist/ui/settings/store.d.ts +0 -29
  348. package/dist/ui/settings/store.js +0 -91
  349. package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-diagnostics.js +2 -2
  350. package/dist/{integrations/pi/session-ui → app/session-shell}/clipboard-image.d.ts +0 -0
  351. package/dist/{integrations/pi/session-ui → app/session-shell}/editor-hyperlink-budget.d.ts +0 -0
  352. package/dist/{integrations/pi/session-ui → app/session-shell}/editor-hyperlink-budget.js +0 -0
  353. package/dist/{integrations/pi/session-ui → app/session-shell}/image-preparation.d.ts +0 -0
  354. package/dist/{integrations/pi/session-ui → app/session-shell}/image-source.d.ts +0 -0
  355. package/dist/{integrations/pi/session-ui → app/session-shell}/image-worker.d.ts +0 -0
  356. package/dist/{integrations/pi/session-ui → app/session-shell}/paste-helper.d.ts +0 -0
  357. package/dist/{integrations/pi/session-ui → app/session-shell}/paste-text-preparation.js +0 -0
  358. package/dist/{integrations/pi/session-ui → app/session-shell}/paste-text-worker.d.ts +0 -0
  359. package/dist/{integrations/pi/session-ui → app/session-shell}/paste-text-worker.js +0 -0
  360. package/dist/{integrations/pi/session-ui/response-copy-helper.d.ts → app/session-shell/paste-types.js} +0 -0
  361. package/dist/{integrations/pi/session-ui → app/session-shell}/path-chip-presentation.js +0 -0
  362. package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro-effects.d.ts +0 -0
  363. package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro-effects.js +0 -0
  364. package/dist/{integrations/pi/session-ui → app/session-shell}/quit-outro.d.ts +0 -0
  365. package/dist/{integrations/pi/session-ui/route-host.js → app/session-shell/response-copy-helper.d.ts} +0 -0
  366. package/dist/{integrations/pi/session-ui → app/session-shell}/response-copy-protocol.js +0 -0
  367. package/dist/{integrations/pi/session-ui → app/session-shell}/stream-presentation-coalescer.d.ts +0 -0
  368. package/dist/{integrations/pi/session-ui → app/session-shell}/stream-presentation-coalescer.js +3 -3
  369. /package/dist/{integrations/pi/session-ui → app/session-shell}/text-paste.d.ts +0 -0
  370. /package/dist/{integrations/pi/session-ui → app/session-shell}/text-paste.js +0 -0
@@ -0,0 +1,352 @@
1
+ /** Pure helpers behind pinned Pi's workflows: result wording, session-info presentation, model matching, and option shaping. */
2
+ import { execFile } from "node:child_process";
3
+ import { promisify } from "node:util";
4
+ import { readPinnedCommandChangelog } from "./changelog.js";
5
+ import { dynamicObject, finiteNumber, isRecord, stringProperty, stringValue } from "./message-values.js";
6
+ import { copyToClipboard } from "../startup-public.js";
7
+ const execFileAsync = promisify(execFile);
8
+ export const AUTH_REFRESH_TIMEOUT_MS = 15_000;
9
+ // Provenance: Pi 0.84.2 core/model-resolver.ts defaultModelPerProvider.
10
+ export const PINNED_DEFAULT_MODEL_BY_PROVIDER = Object.freeze({
11
+ "amazon-bedrock": "us.anthropic.claude-opus-4-6-v1",
12
+ "ant-ling": "Ring-2.6-1T",
13
+ anthropic: "claude-opus-4-8",
14
+ openai: "gpt-5.5",
15
+ "azure-openai-responses": "gpt-5.4",
16
+ "openai-codex": "gpt-5.5",
17
+ radius: "auto",
18
+ nvidia: "nvidia/nemotron-3-super-120b-a12b",
19
+ deepseek: "deepseek-v4-pro",
20
+ google: "gemini-3.1-pro-preview",
21
+ "google-vertex": "gemini-3.1-pro-preview",
22
+ "github-copilot": "gpt-5.4",
23
+ openrouter: "moonshotai/kimi-k2.6",
24
+ "vercel-ai-gateway": "zai/glm-5.1",
25
+ xai: "grok-4.5",
26
+ groq: "openai/gpt-oss-120b",
27
+ cerebras: "zai-glm-4.7",
28
+ zai: "glm-5.1",
29
+ "zai-coding-cn": "glm-5.1",
30
+ mistral: "devstral-medium-latest",
31
+ minimax: "MiniMax-M2.7",
32
+ "minimax-cn": "MiniMax-M2.7",
33
+ moonshotai: "kimi-k2.6",
34
+ "moonshotai-cn": "kimi-k2.6",
35
+ huggingface: "moonshotai/Kimi-K2.6",
36
+ fireworks: "accounts/fireworks/models/kimi-k2p6",
37
+ together: "moonshotai/Kimi-K2.6",
38
+ baseten: "zai-org/GLM-5.2",
39
+ opencode: "kimi-k2.6",
40
+ "opencode-go": "kimi-k2.6",
41
+ "kimi-coding": "kimi-for-coding",
42
+ "cloudflare-workers-ai": "@cf/moonshotai/kimi-k2.6",
43
+ "cloudflare-ai-gateway": "workers-ai/@cf/moonshotai/kimi-k2.6",
44
+ "qwen-token-plan": "qwen3.7-max",
45
+ "qwen-token-plan-cn": "qwen3.7-max",
46
+ "qwen-token-plan-individual": "qwen3.8-max",
47
+ xiaomi: "mimo-v2.5-pro",
48
+ "xiaomi-token-plan-cn": "mimo-v2.5-pro",
49
+ "xiaomi-token-plan-ams": "mimo-v2.5-pro",
50
+ "xiaomi-token-plan-sgp": "mimo-v2.5-pro",
51
+ });
52
+ export function pinnedSessionInfoPresentation(value, sessionName, entries, modelRuntime) {
53
+ const stats = isRecord(value) ? value : {};
54
+ const tokens = dynamicObject(stats, "tokens");
55
+ return {
56
+ kind: "session-info",
57
+ ...(sessionName === undefined ? {} : { sessionName }),
58
+ stats: {
59
+ ...(stringProperty(stats, "sessionFile") === undefined ? {} : { sessionFile: stringProperty(stats, "sessionFile") }),
60
+ sessionId: stringProperty(stats, "sessionId") ?? "unknown",
61
+ userMessages: finiteNumber(stats.userMessages),
62
+ assistantMessages: finiteNumber(stats.assistantMessages),
63
+ toolCalls: finiteNumber(stats.toolCalls),
64
+ toolResults: finiteNumber(stats.toolResults),
65
+ totalMessages: finiteNumber(stats.totalMessages),
66
+ tokens: {
67
+ input: finiteNumber(tokens.input),
68
+ output: finiteNumber(tokens.output),
69
+ cacheRead: finiteNumber(tokens.cacheRead),
70
+ cacheWrite: finiteNumber(tokens.cacheWrite),
71
+ total: finiteNumber(tokens.total),
72
+ },
73
+ cost: finiteNumber(stats.cost),
74
+ },
75
+ cacheWaste: pinnedCacheWaste(entries, modelRuntime),
76
+ usageBreakdown: pinnedUsageCostBreakdown(entries),
77
+ };
78
+ }
79
+ export function pinnedUsageCostBreakdown(entries) {
80
+ const totals = new Map();
81
+ for (const entry of entries) {
82
+ if (!isRecord(entry))
83
+ continue;
84
+ let key;
85
+ let usage;
86
+ const message = dynamicObject(entry, "message");
87
+ if (entry.type === "message" && message.role === "assistant") {
88
+ const provider = stringProperty(message, "provider");
89
+ const model = stringProperty(message, "responseModel") ?? stringProperty(message, "model");
90
+ if (provider && model)
91
+ key = `${provider}/${model}`;
92
+ usage = dynamicObject(message, "usage");
93
+ }
94
+ else if (entry.type === "message" && message.role === "toolResult" && isRecord(message.usage)) {
95
+ key = "Tools/summaries";
96
+ usage = message.usage;
97
+ }
98
+ else if ((entry.type === "branch_summary" || entry.type === "compaction") && isRecord(entry.usage)) {
99
+ key = "Tools/summaries";
100
+ usage = entry.usage;
101
+ }
102
+ if (!key || !usage)
103
+ continue;
104
+ const cost = finiteNumber(dynamicObject(usage, "cost").total);
105
+ const tokens = finiteNumber(usage.input) + finiteNumber(usage.output)
106
+ + finiteNumber(usage.cacheRead) + finiteNumber(usage.cacheWrite);
107
+ const current = totals.get(key) ?? { cost: 0, tokens: 0 };
108
+ current.cost += cost;
109
+ current.tokens += tokens;
110
+ totals.set(key, current);
111
+ }
112
+ return [...totals].map(([key, total]) => ({ key, ...total }))
113
+ .filter(entry => entry.cost > 0 || entry.tokens > 0)
114
+ .sort((a, b) => b.cost - a.cost);
115
+ }
116
+ export function pinnedCacheWaste(entries, modelRuntime) {
117
+ let previous;
118
+ const totals = { missedTokens: 0, missedCost: 0, missCount: 0 };
119
+ for (const entry of entries) {
120
+ if (!isRecord(entry))
121
+ continue;
122
+ if (entry.type === "compaction" || entry.type === "branch_summary") {
123
+ previous = undefined;
124
+ continue;
125
+ }
126
+ const message = dynamicObject(entry, "message");
127
+ if (entry.type !== "message" || message.role !== "assistant")
128
+ continue;
129
+ const usage = dynamicObject(message, "usage");
130
+ const input = finiteNumber(usage.input);
131
+ const cacheRead = finiteNumber(usage.cacheRead);
132
+ const cacheWrite = finiteNumber(usage.cacheWrite);
133
+ const promptTokens = input + cacheRead + cacheWrite;
134
+ if (previous && promptTokens > 0 && (cacheRead + cacheWrite > 0 || previous.reportedCache)) {
135
+ const missedTokens = Math.min(previous.promptTokens, promptTokens) - cacheRead;
136
+ if (missedTokens > 1024) {
137
+ const cost = dynamicObject(usage, "cost");
138
+ const paidTokens = input + cacheWrite;
139
+ const paidRate = paidTokens > 0 ? (finiteNumber(cost.input) + finiteNumber(cost.cacheWrite)) / paidTokens : 0;
140
+ const provider = stringProperty(message, "provider") ?? "";
141
+ const modelId = stringProperty(message, "model") ?? "";
142
+ const model = modelRuntime.getModel(provider, modelId);
143
+ const modelCost = dynamicObject(dynamicObject(model, "cost"));
144
+ const readRate = cacheRead > 0
145
+ ? finiteNumber(cost.cacheRead) / cacheRead
146
+ : finiteNumber(modelCost.cacheRead) / 1_000_000;
147
+ totals.missedTokens += missedTokens;
148
+ totals.missedCost += missedTokens * Math.max(0, paidRate - readRate);
149
+ totals.missCount += 1;
150
+ }
151
+ }
152
+ if (promptTokens > 0) {
153
+ const provider = stringProperty(message, "provider") ?? "";
154
+ const model = stringProperty(message, "model") ?? "";
155
+ previous = {
156
+ promptTokens,
157
+ modelKey: `${provider}/${model}`,
158
+ timestamp: finiteNumber(message.timestamp),
159
+ reportedCache: (previous?.reportedCache ?? false) || cacheRead + cacheWrite > 0,
160
+ };
161
+ }
162
+ }
163
+ return totals;
164
+ }
165
+ export function defaultWorkflowHost() {
166
+ return {
167
+ copyText: copyToClipboard,
168
+ async runCommand(command, arguments_, options) {
169
+ const result = await execFileAsync(command, [...arguments_], { encoding: "utf8", signal: options?.signal });
170
+ return { stdout: result.stdout, stderr: result.stderr };
171
+ },
172
+ readChangelog: readPinnedCommandChangelog,
173
+ };
174
+ }
175
+ export function workflowLoginNotification(event) {
176
+ if (!isRecord(event))
177
+ return undefined;
178
+ if (event.type === "auth_url") {
179
+ const url = stringProperty(event, "url");
180
+ if (!url)
181
+ return undefined;
182
+ const instructions = stringProperty(event, "instructions");
183
+ return { type: "auth_url", url, ...(instructions === undefined ? {} : { instructions }) };
184
+ }
185
+ if (event.type === "device_code") {
186
+ const verificationUri = stringProperty(event, "verificationUri");
187
+ const userCode = stringProperty(event, "userCode");
188
+ return verificationUri && userCode ? { type: "device_code", verificationUri, userCode } : undefined;
189
+ }
190
+ const message = stringProperty(event, "message");
191
+ if (!message)
192
+ return undefined;
193
+ if (event.type === "info") {
194
+ const links = Array.isArray(event.links) ? event.links.filter(isRecord).flatMap(link => {
195
+ const url = stringProperty(link, "url");
196
+ if (!url)
197
+ return [];
198
+ const label = stringProperty(link, "label");
199
+ return [{ ...(label === undefined ? {} : { label }), url }];
200
+ }) : [];
201
+ return { type: "info", message, ...(links.length === 0 ? {} : { links }) };
202
+ }
203
+ return { type: event.type === "waiting" ? "waiting" : "progress", message };
204
+ }
205
+ export function workflowResult(command, outcome, message, detail, messageKind, messages) {
206
+ return {
207
+ command,
208
+ outcome,
209
+ message,
210
+ ...(detail === undefined ? {} : { detail }),
211
+ ...(messageKind === undefined ? {} : { messageKind }),
212
+ ...(messages === undefined ? {} : { messages: Object.freeze([...messages]) }),
213
+ };
214
+ }
215
+ export function workflowConfirmation(command, message, detail) {
216
+ return {
217
+ command,
218
+ outcome: "requires-confirmation",
219
+ message,
220
+ ...(detail === undefined ? {} : { detail }),
221
+ selectorTitle: "Confirm",
222
+ options: [
223
+ { id: "yes", label: "Yes" },
224
+ { id: "no", label: "No" },
225
+ ],
226
+ };
227
+ }
228
+ export function errorMessage(error, fallback) {
229
+ return error instanceof Error ? error.message : fallback;
230
+ }
231
+ export function shareCommandFailureDetail(error) {
232
+ // Compatibility: Pi reports a failed child's stderr, not execFile's command wrapper.
233
+ if (isRecord(error) && (typeof error.code === "number" || typeof error.signal === "string") && typeof error.stderr === "string") {
234
+ return error.stderr.trim() || "Unknown error";
235
+ }
236
+ return errorMessage(error, "Unknown error");
237
+ }
238
+ export function commandMissing(error) {
239
+ return isRecord(error) && error.code === "ENOENT";
240
+ }
241
+ export function isAbortError(error) {
242
+ return isRecord(error) && (error.name === "AbortError" || error.code === "ABORT_ERR");
243
+ }
244
+ export function shareViewerUrl(gistId) {
245
+ const baseUrl = process.env.PI_SHARE_VIEWER_URL || "https://pi.dev/session/";
246
+ return `${baseUrl}#${gistId}`;
247
+ }
248
+ export function workflowOptions(value, idKey, labelKey) {
249
+ if (!Array.isArray(value))
250
+ return [];
251
+ return value.filter(isRecord).flatMap(item => {
252
+ const id = stringProperty(item, idKey);
253
+ if (!id)
254
+ return [];
255
+ return [{ id, label: stringProperty(item, labelKey) ?? id }];
256
+ });
257
+ }
258
+ export function sessionInfoOptions(value) {
259
+ return value.filter(isRecord).flatMap(info => {
260
+ const path = stringProperty(info, "path");
261
+ if (!path)
262
+ return [];
263
+ const modified = info.modified instanceof Date ? info.modified.toISOString() : stringProperty(info, "modified") ?? "unknown time";
264
+ const messageCount = typeof info.messageCount === "number" ? info.messageCount : 0;
265
+ return [{
266
+ id: path,
267
+ label: stringProperty(info, "name") ?? stringProperty(info, "firstMessage") ?? stringProperty(info, "id") ?? path,
268
+ description: `${messageCount} messages · ${modified}`,
269
+ }];
270
+ });
271
+ }
272
+ export function pathArgument(value) {
273
+ if (!value)
274
+ return undefined;
275
+ const quote = value[0];
276
+ if (quote === '"' || quote === "'") {
277
+ const closing = value.indexOf(quote, 1);
278
+ return closing < 0 ? undefined : value.slice(1, closing);
279
+ }
280
+ return value.split(/\s/, 1)[0] || undefined;
281
+ }
282
+ export function pinnedHotkeySummary() {
283
+ return [
284
+ "Enter: send message · Alt+Enter: queue follow-up",
285
+ "Escape: cancel/abort · Ctrl+C: clear/exit · Ctrl+D: exit when empty",
286
+ "Shift+Tab: cycle thinking · Ctrl+P/Shift+Ctrl+P: cycle models · Ctrl+L: select model",
287
+ "Ctrl+O: expand tools · Ctrl+T: toggle thinking · Ctrl+X: copy message",
288
+ "Alt+Up: restore queued messages · /: commands · !/!!: bash",
289
+ ].join("\n");
290
+ }
291
+ export function scopedModelRecords(modelRuntime) {
292
+ return modelRuntime.getAvailableSnapshot().map(model => ({
293
+ descriptor: { provider: model.provider, id: model.id, name: model.name ?? model.id },
294
+ model,
295
+ }));
296
+ }
297
+ export function scopedModelReference(value) {
298
+ if (!isRecord(value) || !isRecord(value.model))
299
+ return undefined;
300
+ const provider = stringValue(value.model.provider);
301
+ const id = stringValue(value.model.id);
302
+ return provider && id ? `${provider}/${id}` : undefined;
303
+ }
304
+ export function resolveConfiguredModelIds(patterns, models) {
305
+ const references = models.map(item => `${item.descriptor.provider}/${item.descriptor.id}`);
306
+ const resolved = [];
307
+ for (const pattern of patterns) {
308
+ const thinkingSuffix = /:(?:off|minimal|low|medium|high|xhigh)$/.exec(pattern);
309
+ const modelPattern = thinkingSuffix === null ? pattern : pattern.slice(0, -thinkingSuffix[0].length);
310
+ const matcher = wildcardMatcher(modelPattern);
311
+ const matches = references.filter((reference, index) => matcher.test(reference) || matcher.test(models[index]?.descriptor.id ?? ""));
312
+ if (matches.length === 0) {
313
+ resolved.push(pattern);
314
+ }
315
+ else {
316
+ for (const match of matches)
317
+ if (!resolved.includes(match))
318
+ resolved.push(match);
319
+ }
320
+ }
321
+ return resolved;
322
+ }
323
+ export function wildcardMatcher(pattern) {
324
+ let source = "";
325
+ for (const character of pattern) {
326
+ if (character === "*")
327
+ source += ".*";
328
+ else if (character === "?")
329
+ source += ".";
330
+ else
331
+ source += character.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
332
+ }
333
+ return new RegExp(`^${source}$`, "i");
334
+ }
335
+ export function isUnknownModel(value) {
336
+ return isRecord(value)
337
+ && value.provider === "unknown"
338
+ && value.id === "unknown"
339
+ && value.api === "unknown";
340
+ }
341
+ export function findExactWorkflowModel(reference, models) {
342
+ const normalized = reference.trim().toLowerCase();
343
+ const canonical = models.filter(model => {
344
+ const provider = stringProperty(model, "provider");
345
+ const id = stringProperty(model, "id");
346
+ return provider !== undefined && id !== undefined && `${provider}/${id}`.toLowerCase() === normalized;
347
+ });
348
+ if (canonical.length === 1)
349
+ return canonical[0];
350
+ const bare = models.filter(model => stringProperty(model, "id")?.toLowerCase() === normalized);
351
+ return bare.length === 1 ? bare[0] : undefined;
352
+ }
@@ -1,9 +1,10 @@
1
- export declare const PINNED_PI_WORKFLOW_COMMAND_NAMES: readonly ["settings", "model", "scoped-models", "export", "import", "share", "copy", "name", "session", "changelog", "hotkeys", "fork", "clone", "tree", "trust", "login", "logout", "new", "compact", "resume", "reload", "quit"];
1
+ import type { SessionInfo } from "../startup-public.js";
2
+ export declare const PINNED_PI_WORKFLOW_COMMAND_NAMES: readonly ["settings", "model", "tree", "thinking", "scoped-models", "export", "import", "share", "copy", "name", "session", "changelog", "hotkeys", "fork", "clone", "trust", "login", "logout", "new", "compact", "resume", "reload", "quit"];
2
3
  export declare const PINNED_PI_HIDDEN_COMMAND_NAMES: readonly ["debug", "arminsayshi", "dementedelves"];
3
4
  export type PiWorkflowCommandName = typeof PINNED_PI_WORKFLOW_COMMAND_NAMES[number];
4
5
  export type PiHiddenWorkflowCommandName = typeof PINNED_PI_HIDDEN_COMMAND_NAMES[number];
5
6
  export type PiWorkflowRoute = PiWorkflowCommandName | PiHiddenWorkflowCommandName;
6
- export declare const PINNED_PI_SETTINGS_CALLBACKS: readonly ["onAutoCompactChange", "onShowImagesChange", "onImageWidthCellsChange", "onAutoResizeImagesChange", "onBlockImagesChange", "onEnableSkillCommandsChange", "onSteeringModeChange", "onFollowUpModeChange", "onTransportChange", "onHttpIdleTimeoutMsChange", "onThinkingLevelChange", "onThemeChange", "onThemePreview", "onHideThinkingBlockChange", "onMermaidRenderingModeChange", "onShowCacheMissNoticesChange", "onCollapseChangelogChange", "onEnableInstallTelemetryChange", "onQuietStartupChange", "onDefaultProjectTrustChange", "onDoubleEscapeActionChange", "onTreeFilterModeChange", "onShowHardwareCursorChange", "onEditorPaddingXChange", "onOutputPadChange", "onAutocompleteMaxVisibleChange", "onClearOnShrinkChange", "onShowTerminalProgressChange", "onTuiModeChange", "onFullscreenExitOutputChange", "onFullscreenScrollbarChange", "onWarningsChange", "onCancel"];
7
+ export declare const PINNED_PI_SETTINGS_CALLBACKS: readonly ["onAutoCompactChange", "onShowImagesChange", "onImageWidthCellsChange", "onAutoResizeImagesChange", "onBlockImagesChange", "onEnableSkillCommandsChange", "onSteeringModeChange", "onFollowUpModeChange", "onTransportChange", "onHttpIdleTimeoutMsChange", "onModelThinkingLevelChange", "onModelThinkingLevelRemove", "onThemeChange", "onThemePreview", "onHideThinkingBlockChange", "onMermaidRenderingModeChange", "onShowCacheMissNoticesChange", "onCollapseChangelogChange", "onEnableInstallTelemetryChange", "onQuietStartupChange", "onDefaultProjectTrustChange", "onDoubleEscapeActionChange", "onTreeFilterModeChange", "onShowHardwareCursorChange", "onEditorPaddingXChange", "onOutputPadChange", "onAutocompleteMaxVisibleChange", "onClearOnShrinkChange", "onShowTerminalProgressChange", "onTuiModeChange", "onFullscreenExitOutputChange", "onFullscreenScrollbarChange", "onFullscreenCopyOnSelectChange", "onWarningsChange", "onCancel"];
7
8
  export type PiPinnedSettingsCallback = typeof PINNED_PI_SETTINGS_CALLBACKS[number];
8
9
  export interface PiPinnedSettingsSnapshot {
9
10
  readonly autoCompact: boolean;
@@ -18,6 +19,14 @@ export interface PiPinnedSettingsSnapshot {
18
19
  readonly httpIdleTimeoutMs: number;
19
20
  readonly thinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
20
21
  readonly availableThinkingLevels: readonly ("off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max")[];
22
+ /** The stored global default the selector offers to restore; the session's level may differ. */
23
+ readonly defaultThinkingLevel: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
24
+ /** Per-model thinking overrides keyed `provider/modelId`. */
25
+ readonly modelThinkingLevels: Readonly<Record<string, string>>;
26
+ /** `provider/modelId` of the persisted default model, or the engine's "not set" wording. */
27
+ readonly defaultModel: string;
28
+ readonly currentModel?: unknown;
29
+ readonly availableDefaultModels: readonly unknown[];
21
30
  readonly currentTheme: string;
22
31
  readonly terminalTheme: "dark" | "light";
23
32
  readonly availableThemes: readonly string[];
@@ -39,6 +48,7 @@ export interface PiPinnedSettingsSnapshot {
39
48
  readonly tuiMode: "regular" | "fullscreen";
40
49
  readonly fullscreenExitOutput: "transcript" | "resume-hint";
41
50
  readonly fullscreenScrollbar: "hidden" | "auto" | "always";
51
+ readonly fullscreenCopyOnSelect: boolean;
42
52
  readonly warnings: {
43
53
  readonly anthropicExtraUsage?: boolean;
44
54
  };
@@ -61,6 +71,8 @@ export interface PiWorkflowRequest {
61
71
  readonly command: PiWorkflowRoute;
62
72
  readonly argument: string;
63
73
  readonly selection?: string;
74
+ /** For the model route: also persist the selection as the default model. */
75
+ readonly persist?: boolean;
64
76
  readonly confirmed?: boolean;
65
77
  /** Recovery cwd selected after an import/resume source cwd is unavailable. */
66
78
  readonly cwdOverride?: string;
@@ -188,3 +200,52 @@ export interface PiBashWorkflowResult {
188
200
  readonly truncated: boolean;
189
201
  readonly excludeFromContext: boolean;
190
202
  }
203
+ export interface PiScopedModelDescriptor {
204
+ readonly provider: string;
205
+ readonly id: string;
206
+ readonly name: string;
207
+ }
208
+ export interface PiScopedModelsContext {
209
+ readonly models: readonly PiScopedModelDescriptor[];
210
+ readonly enabledModelIds: readonly string[] | null;
211
+ }
212
+ export interface PiProjectTrustUpdate {
213
+ readonly path: string;
214
+ readonly decision: boolean | null;
215
+ }
216
+ export interface PiProjectTrustContext {
217
+ readonly cwd: string;
218
+ readonly savedDecision: {
219
+ readonly path: string;
220
+ readonly decision: boolean;
221
+ } | null;
222
+ readonly projectTrusted: boolean;
223
+ readonly trustOptions: readonly {
224
+ readonly label: string;
225
+ readonly trusted: boolean;
226
+ readonly updates: readonly PiProjectTrustUpdate[];
227
+ readonly savedPath?: string;
228
+ }[];
229
+ }
230
+ export interface PiTreeSelectorContext {
231
+ readonly tree: readonly unknown[];
232
+ readonly currentLeafId: string | null;
233
+ readonly filterMode: "default" | "no-tools" | "user-only" | "labeled-only" | "all";
234
+ readonly skipSummaryPrompt: boolean;
235
+ readonly appendLabelChange: (entryId: string, label: string | undefined) => void;
236
+ }
237
+ export interface PiSessionResumeMetadata {
238
+ readonly sessionId: string;
239
+ readonly sessionDir: string;
240
+ readonly usesDefaultSessionDir: boolean;
241
+ }
242
+ export interface PiSessionSelectorContext {
243
+ readonly currentSessionFilePath: string | undefined;
244
+ readonly loadCurrentSessions: (onProgress?: (loaded: number, total: number) => void) => Promise<SessionInfo[]>;
245
+ readonly loadAllSessions: (onProgress?: (loaded: number, total: number) => void) => Promise<SessionInfo[]>;
246
+ readonly renameSession: (sessionFilePath: string, nextName: string | undefined) => Promise<void>;
247
+ }
248
+ export interface PiScopedModelsRefreshResult extends PiScopedModelsContext {
249
+ readonly status: string;
250
+ readonly statusKind: "success" | "warning";
251
+ }
@@ -1,6 +1,8 @@
1
1
  export const PINNED_PI_WORKFLOW_COMMAND_NAMES = [
2
2
  "settings",
3
3
  "model",
4
+ "tree",
5
+ "thinking",
4
6
  "scoped-models",
5
7
  "export",
6
8
  "import",
@@ -12,7 +14,6 @@ export const PINNED_PI_WORKFLOW_COMMAND_NAMES = [
12
14
  "hotkeys",
13
15
  "fork",
14
16
  "clone",
15
- "tree",
16
17
  "trust",
17
18
  "login",
18
19
  "logout",
@@ -34,7 +35,8 @@ export const PINNED_PI_SETTINGS_CALLBACKS = [
34
35
  "onFollowUpModeChange",
35
36
  "onTransportChange",
36
37
  "onHttpIdleTimeoutMsChange",
37
- "onThinkingLevelChange",
38
+ "onModelThinkingLevelChange",
39
+ "onModelThinkingLevelRemove",
38
40
  "onThemeChange",
39
41
  "onThemePreview",
40
42
  "onHideThinkingBlockChange",
@@ -55,6 +57,7 @@ export const PINNED_PI_SETTINGS_CALLBACKS = [
55
57
  "onTuiModeChange",
56
58
  "onFullscreenExitOutputChange",
57
59
  "onFullscreenScrollbarChange",
60
+ "onFullscreenCopyOnSelectChange",
58
61
  "onWarningsChange",
59
62
  "onCancel",
60
63
  ];