@bastani/atomic 0.9.11-alpha.6 → 0.9.11-alpha.8

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 (452) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +3 -5
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/package.json +1 -1
  5. package/dist/builtin/mcp/sampling-handler.ts +1 -5
  6. package/dist/builtin/subagents/package.json +1 -1
  7. package/dist/builtin/web-access/package.json +1 -1
  8. package/dist/builtin/workflows/CHANGELOG.md +1 -0
  9. package/dist/builtin/workflows/README.md +1 -1
  10. package/dist/builtin/workflows/package.json +1 -1
  11. package/dist/builtin/workflows/skills/impeccable/SKILL.md +33 -129
  12. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_asset_producer.toml +11 -3
  13. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_documenter.toml +26 -0
  14. package/dist/builtin/workflows/skills/impeccable/agents/impeccable_finish_reviewer.toml +35 -0
  15. package/dist/builtin/workflows/skills/impeccable/reference/android.md +1 -1
  16. package/dist/builtin/workflows/skills/impeccable/reference/animate.md +72 -189
  17. package/dist/builtin/workflows/skills/impeccable/reference/audit.md +10 -9
  18. package/dist/builtin/workflows/skills/impeccable/reference/audit.native.md +2 -2
  19. package/dist/builtin/workflows/skills/impeccable/reference/bolder.md +19 -108
  20. package/dist/builtin/workflows/skills/impeccable/reference/clarify.md +59 -253
  21. package/dist/builtin/workflows/skills/impeccable/reference/colorize.md +51 -222
  22. package/dist/builtin/workflows/skills/impeccable/reference/craft-floor.md +45 -0
  23. package/dist/builtin/workflows/skills/impeccable/reference/craft.md +3 -121
  24. package/dist/builtin/workflows/skills/impeccable/reference/critique.md +28 -20
  25. package/dist/builtin/workflows/skills/impeccable/reference/degraded/asset-producer.md +97 -0
  26. package/dist/builtin/workflows/skills/impeccable/reference/degraded/documenter.md +23 -0
  27. package/dist/builtin/workflows/skills/impeccable/reference/degraded/finish-reviewer.md +32 -0
  28. package/dist/builtin/workflows/skills/impeccable/reference/degraded/manual-edit-applier.md +92 -0
  29. package/dist/builtin/workflows/skills/impeccable/reference/delight.md +47 -279
  30. package/dist/builtin/workflows/skills/impeccable/reference/distill.md +2 -2
  31. package/dist/builtin/workflows/skills/impeccable/reference/doctor.md +53 -0
  32. package/dist/builtin/workflows/skills/impeccable/reference/document.md +60 -73
  33. package/dist/builtin/workflows/skills/impeccable/reference/harden.md +1 -12
  34. package/dist/builtin/workflows/skills/impeccable/reference/hooks.md +17 -4
  35. package/dist/builtin/workflows/skills/impeccable/reference/init.md +64 -163
  36. package/dist/builtin/workflows/skills/impeccable/reference/ios.md +1 -1
  37. package/dist/builtin/workflows/skills/impeccable/reference/layout.md +52 -153
  38. package/dist/builtin/workflows/skills/impeccable/reference/live.md +44 -32
  39. package/dist/builtin/workflows/skills/impeccable/reference/new-work.md +105 -0
  40. package/dist/builtin/workflows/skills/impeccable/reference/{product.md → operate.md} +6 -5
  41. package/dist/builtin/workflows/skills/impeccable/reference/optimize.md +4 -4
  42. package/dist/builtin/workflows/skills/impeccable/reference/overdrive.md +1 -4
  43. package/dist/builtin/workflows/skills/impeccable/reference/polish.md +68 -212
  44. package/dist/builtin/workflows/skills/impeccable/reference/quieter.md +3 -3
  45. package/dist/builtin/workflows/skills/impeccable/reference/routing.md +18 -0
  46. package/dist/builtin/workflows/skills/impeccable/reference/shape.md +38 -144
  47. package/dist/builtin/workflows/skills/impeccable/reference/typeset.md +48 -269
  48. package/dist/builtin/workflows/skills/impeccable/reference/visualize.md +38 -0
  49. package/dist/builtin/workflows/skills/impeccable/scripts/command-metadata.json +1 -1
  50. package/dist/builtin/workflows/skills/impeccable/scripts/concept-seed.mjs +584 -0
  51. package/dist/builtin/workflows/skills/impeccable/scripts/context-signals.mjs +117 -9
  52. package/dist/builtin/workflows/skills/impeccable/scripts/context.mjs +486 -59
  53. package/dist/builtin/workflows/skills/impeccable/scripts/critique-storage.mjs +16 -45
  54. package/dist/builtin/workflows/skills/impeccable/scripts/detector/browser/injected/index.mjs +96 -10
  55. package/dist/builtin/workflows/skills/impeccable/scripts/detector/cli/main.mjs +143 -26
  56. package/dist/builtin/workflows/skills/impeccable/scripts/detector/design-system.mjs +181 -12
  57. package/dist/builtin/workflows/skills/impeccable/scripts/detector/detect-antipatterns-browser.js +3187 -182
  58. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/browser/detect-url.mjs +102 -7
  59. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/regex/detect-text.mjs +282 -70
  60. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +183 -15
  61. package/dist/builtin/workflows/skills/impeccable/scripts/detector/engines/static-html/detect-html.mjs +22 -7
  62. package/dist/builtin/workflows/skills/impeccable/scripts/detector/findings.mjs +7 -1
  63. package/dist/builtin/workflows/skills/impeccable/scripts/detector/node/file-system.mjs +16 -2
  64. package/dist/builtin/workflows/skills/impeccable/scripts/detector/registry/antipatterns.mjs +155 -42
  65. package/dist/builtin/workflows/skills/impeccable/scripts/detector/rules/checks.mjs +2988 -155
  66. package/dist/builtin/workflows/skills/impeccable/scripts/detector/shared/constants.mjs +11 -0
  67. package/dist/builtin/workflows/skills/impeccable/scripts/doctor.mjs +336 -0
  68. package/dist/builtin/workflows/skills/impeccable/scripts/generate-image.mjs +232 -0
  69. package/dist/builtin/workflows/skills/impeccable/scripts/hook-admin.mjs +90 -10
  70. package/dist/builtin/workflows/skills/impeccable/scripts/hook-lib.mjs +410 -78
  71. package/dist/builtin/workflows/skills/impeccable/scripts/hook.mjs +25 -8
  72. package/dist/builtin/workflows/skills/impeccable/scripts/lib/artifact-schema.mjs +93 -0
  73. package/dist/builtin/workflows/skills/impeccable/scripts/lib/composition-catalog.mjs +165 -0
  74. package/dist/builtin/workflows/skills/impeccable/scripts/lib/concept-catalog.mjs +329 -0
  75. package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-config.mjs +20 -5
  76. package/dist/builtin/workflows/skills/impeccable/scripts/lib/impeccable-paths.mjs +16 -8
  77. package/dist/builtin/workflows/skills/impeccable/scripts/lib/provider.mjs +1 -0
  78. package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-deep.mjs +455 -0
  79. package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness-notice.mjs +169 -0
  80. package/dist/builtin/workflows/skills/impeccable/scripts/lib/staleness.mjs +457 -0
  81. package/dist/builtin/workflows/skills/impeccable/scripts/lib/surface-briefs.mjs +151 -0
  82. package/dist/builtin/workflows/skills/impeccable/scripts/lib/target-slug.mjs +33 -0
  83. package/dist/builtin/workflows/skills/impeccable/scripts/lib/template-extensions.mjs +146 -0
  84. package/dist/builtin/workflows/skills/impeccable/scripts/live/completion.mjs +10 -1
  85. package/dist/builtin/workflows/skills/impeccable/scripts/live/event-validation.mjs +15 -0
  86. package/dist/builtin/workflows/skills/impeccable/scripts/live/generation-preflight.mjs +149 -0
  87. package/dist/builtin/workflows/skills/impeccable/scripts/live/poll-lanes.mjs +14 -0
  88. package/dist/builtin/workflows/skills/impeccable/scripts/live/session-store.mjs +109 -32
  89. package/dist/builtin/workflows/skills/impeccable/scripts/live/source-lock.mjs +105 -0
  90. package/dist/builtin/workflows/skills/impeccable/scripts/live/source-search.mjs +105 -0
  91. package/dist/builtin/workflows/skills/impeccable/scripts/live/sveltekit-adapter.mjs +8 -6
  92. package/dist/builtin/workflows/skills/impeccable/scripts/live/tanstack-adapter.mjs +280 -0
  93. package/dist/builtin/workflows/skills/impeccable/scripts/live-accept.mjs +208 -68
  94. package/dist/builtin/workflows/skills/impeccable/scripts/live-browser.js +563 -112
  95. package/dist/builtin/workflows/skills/impeccable/scripts/live-commit-manual-edits.mjs +3 -0
  96. package/dist/builtin/workflows/skills/impeccable/scripts/live-inject.mjs +198 -13
  97. package/dist/builtin/workflows/skills/impeccable/scripts/live-insert.mjs +24 -6
  98. package/dist/builtin/workflows/skills/impeccable/scripts/live-manual-edit-evidence.mjs +6 -1
  99. package/dist/builtin/workflows/skills/impeccable/scripts/live-poll.mjs +44 -14
  100. package/dist/builtin/workflows/skills/impeccable/scripts/live-server.mjs +398 -33
  101. package/dist/builtin/workflows/skills/impeccable/scripts/live-status.mjs +9 -5
  102. package/dist/builtin/workflows/skills/impeccable/scripts/live-wrap.mjs +81 -67
  103. package/dist/builtin/workflows/skills/impeccable/scripts/live.mjs +7 -2
  104. package/dist/builtin/workflows/skills/impeccable/scripts/palette.mjs +76 -81
  105. package/dist/builtin/workflows/skills/impeccable/scripts/pin.mjs +2 -2
  106. package/dist/builtin/workflows/skills/impeccable/scripts/serve-question.mjs +890 -0
  107. package/dist/builtin/workflows/skills/impeccable/scripts/surface-brief.mjs +74 -0
  108. package/dist/builtin/workflows/src/extension/extension-runtime-state.ts +1 -24
  109. package/dist/builtin/workflows/src/extension/index.bundle.mjs +232 -50
  110. package/dist/builtin/workflows/src/extension/workflow-model-catalog.ts +26 -0
  111. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +3 -2
  112. package/dist/builtin/workflows/src/runs/foreground/executor-stage-control.ts +23 -9
  113. package/dist/builtin/workflows/src/runs/foreground/executor-stage-replay.ts +1 -0
  114. package/dist/builtin/workflows/src/runs/foreground/postmortem-stage-chat.ts +20 -5
  115. package/dist/builtin/workflows/src/runs/foreground/stage-control-registry.ts +10 -0
  116. package/dist/builtin/workflows/src/runs/foreground/stage-delivery-activity.ts +86 -0
  117. package/dist/builtin/workflows/src/runs/foreground/stage-runner-context.ts +6 -2
  118. package/dist/builtin/workflows/src/runs/foreground/stage-runner-controller.ts +24 -18
  119. package/dist/builtin/workflows/src/runs/foreground/stage-runner-send-user-message.ts +8 -0
  120. package/dist/builtin/workflows/src/runs/foreground/stage-runner-session-options.ts +3 -3
  121. package/dist/builtin/workflows/src/runs/foreground/stage-runner-session.ts +2 -2
  122. package/dist/builtin/workflows/src/runs/foreground/stage-runner-types.ts +16 -0
  123. package/dist/builtin/workflows/src/tui/stage-chat-view-delivery-activity.ts +121 -0
  124. package/dist/builtin/workflows/src/tui/stage-chat-view-live-events.ts +42 -0
  125. package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +16 -0
  126. package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +4 -0
  127. package/dist/cli/list-models.d.ts +2 -2
  128. package/dist/cli/list-models.d.ts.map +1 -1
  129. package/dist/cli/list-models.js +5 -5
  130. package/dist/cli/list-models.js.map +1 -1
  131. package/dist/core/agent-session-accessors.js +1 -1
  132. package/dist/core/agent-session-accessors.js.map +1 -1
  133. package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
  134. package/dist/core/agent-session-auto-compaction.js +2 -5
  135. package/dist/core/agent-session-auto-compaction.js.map +1 -1
  136. package/dist/core/agent-session-compaction.js +1 -1
  137. package/dist/core/agent-session-compaction.js.map +1 -1
  138. package/dist/core/agent-session-extension-bindings.js +5 -5
  139. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  140. package/dist/core/agent-session-methods.d.ts +4 -4
  141. package/dist/core/agent-session-methods.d.ts.map +1 -1
  142. package/dist/core/agent-session-methods.js.map +1 -1
  143. package/dist/core/agent-session-models.d.ts +1 -1
  144. package/dist/core/agent-session-models.d.ts.map +1 -1
  145. package/dist/core/agent-session-models.js +18 -14
  146. package/dist/core/agent-session-models.js.map +1 -1
  147. package/dist/core/agent-session-post-tool-compaction.d.ts.map +1 -1
  148. package/dist/core/agent-session-post-tool-compaction.js +2 -4
  149. package/dist/core/agent-session-post-tool-compaction.js.map +1 -1
  150. package/dist/core/agent-session-prompt.d.ts.map +1 -1
  151. package/dist/core/agent-session-prompt.js +3 -7
  152. package/dist/core/agent-session-prompt.js.map +1 -1
  153. package/dist/core/agent-session-retry.js +1 -1
  154. package/dist/core/agent-session-retry.js.map +1 -1
  155. package/dist/core/agent-session-runtime-auth.d.ts +3 -3
  156. package/dist/core/agent-session-runtime-auth.d.ts.map +1 -1
  157. package/dist/core/agent-session-runtime-auth.js +4 -14
  158. package/dist/core/agent-session-runtime-auth.js.map +1 -1
  159. package/dist/core/agent-session-runtime.d.ts +1 -1
  160. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  161. package/dist/core/agent-session-runtime.js +3 -3
  162. package/dist/core/agent-session-runtime.js.map +1 -1
  163. package/dist/core/agent-session-services.d.ts +3 -8
  164. package/dist/core/agent-session-services.d.ts.map +1 -1
  165. package/dist/core/agent-session-services.js +16 -23
  166. package/dist/core/agent-session-services.js.map +1 -1
  167. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  168. package/dist/core/agent-session-tool-registry.js +2 -1
  169. package/dist/core/agent-session-tool-registry.js.map +1 -1
  170. package/dist/core/agent-session-types.d.ts +2 -2
  171. package/dist/core/agent-session-types.d.ts.map +1 -1
  172. package/dist/core/agent-session-types.js.map +1 -1
  173. package/dist/core/agent-session.d.ts +2 -2
  174. package/dist/core/agent-session.d.ts.map +1 -1
  175. package/dist/core/agent-session.js +1 -1
  176. package/dist/core/agent-session.js.map +1 -1
  177. package/dist/core/auth-storage-backends.d.ts +1 -0
  178. package/dist/core/auth-storage-backends.d.ts.map +1 -1
  179. package/dist/core/auth-storage-backends.js +18 -4
  180. package/dist/core/auth-storage-backends.js.map +1 -1
  181. package/dist/core/auth-storage.d.ts +12 -139
  182. package/dist/core/auth-storage.d.ts.map +1 -1
  183. package/dist/core/auth-storage.js +68 -374
  184. package/dist/core/auth-storage.js.map +1 -1
  185. package/dist/core/copilot-env-routing.d.ts +36 -0
  186. package/dist/core/copilot-env-routing.d.ts.map +1 -0
  187. package/dist/core/copilot-env-routing.js +94 -0
  188. package/dist/core/copilot-env-routing.js.map +1 -0
  189. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  190. package/dist/core/extensions/loader-virtual-modules.js +10 -2
  191. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  192. package/dist/core/extensions/provider-types.d.ts +0 -40
  193. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  194. package/dist/core/extensions/provider-types.js.map +1 -1
  195. package/dist/core/fallback-models.d.ts +4 -4
  196. package/dist/core/fallback-models.d.ts.map +1 -1
  197. package/dist/core/fallback-models.js +3 -3
  198. package/dist/core/fallback-models.js.map +1 -1
  199. package/dist/core/model-config.d.ts +542 -0
  200. package/dist/core/model-config.d.ts.map +1 -0
  201. package/dist/core/{model-registry-schemas.js → model-config.js} +85 -34
  202. package/dist/core/model-config.js.map +1 -0
  203. package/dist/core/model-registry.d.ts +25 -85
  204. package/dist/core/model-registry.d.ts.map +1 -1
  205. package/dist/core/model-registry.js +65 -388
  206. package/dist/core/model-registry.js.map +1 -1
  207. package/dist/core/model-resolver-cli.d.ts +2 -2
  208. package/dist/core/model-resolver-cli.d.ts.map +1 -1
  209. package/dist/core/model-resolver-cli.js +2 -2
  210. package/dist/core/model-resolver-cli.js.map +1 -1
  211. package/dist/core/model-resolver-initial.d.ts +4 -4
  212. package/dist/core/model-resolver-initial.d.ts.map +1 -1
  213. package/dist/core/model-resolver-initial.js +17 -17
  214. package/dist/core/model-resolver-initial.js.map +1 -1
  215. package/dist/core/model-resolver-scope.d.ts +3 -3
  216. package/dist/core/model-resolver-scope.d.ts.map +1 -1
  217. package/dist/core/model-resolver-scope.js +4 -4
  218. package/dist/core/model-resolver-scope.js.map +1 -1
  219. package/dist/core/model-runtime-auth.d.ts +7 -0
  220. package/dist/core/model-runtime-auth.d.ts.map +1 -0
  221. package/dist/core/model-runtime-auth.js +14 -0
  222. package/dist/core/model-runtime-auth.js.map +1 -0
  223. package/dist/core/model-runtime-providers.d.ts +6 -0
  224. package/dist/core/model-runtime-providers.d.ts.map +1 -0
  225. package/dist/core/model-runtime-providers.js +22 -0
  226. package/dist/core/model-runtime-providers.js.map +1 -0
  227. package/dist/core/model-runtime-restoration.d.ts +6 -0
  228. package/dist/core/model-runtime-restoration.d.ts.map +1 -0
  229. package/dist/core/model-runtime-restoration.js +21 -0
  230. package/dist/core/model-runtime-restoration.js.map +1 -0
  231. package/dist/core/model-runtime-snapshot.d.ts +16 -0
  232. package/dist/core/model-runtime-snapshot.d.ts.map +1 -0
  233. package/dist/core/model-runtime-snapshot.js +52 -0
  234. package/dist/core/model-runtime-snapshot.js.map +1 -0
  235. package/dist/core/model-runtime-streaming.d.ts +17 -0
  236. package/dist/core/model-runtime-streaming.d.ts.map +1 -0
  237. package/dist/core/model-runtime-streaming.js +66 -0
  238. package/dist/core/model-runtime-streaming.js.map +1 -0
  239. package/dist/core/model-runtime-types.d.ts +21 -0
  240. package/dist/core/model-runtime-types.d.ts.map +1 -0
  241. package/dist/core/model-runtime-types.js +2 -0
  242. package/dist/core/model-runtime-types.js.map +1 -0
  243. package/dist/core/model-runtime.d.ts +50 -29
  244. package/dist/core/model-runtime.d.ts.map +1 -1
  245. package/dist/core/model-runtime.js +330 -90
  246. package/dist/core/model-runtime.js.map +1 -1
  247. package/dist/core/models-store.d.ts +2 -10
  248. package/dist/core/models-store.d.ts.map +1 -1
  249. package/dist/core/models-store.js +2 -29
  250. package/dist/core/models-store.js.map +1 -1
  251. package/dist/core/oauth-login.d.ts +24 -0
  252. package/dist/core/oauth-login.d.ts.map +1 -0
  253. package/dist/core/oauth-login.js +87 -0
  254. package/dist/core/oauth-login.js.map +1 -0
  255. package/dist/core/oauth-provider-metadata.d.ts +5 -0
  256. package/dist/core/oauth-provider-metadata.d.ts.map +1 -0
  257. package/dist/core/oauth-provider-metadata.js +19 -0
  258. package/dist/core/oauth-provider-metadata.js.map +1 -0
  259. package/dist/core/provider-composer-internal.d.ts +53 -0
  260. package/dist/core/provider-composer-internal.d.ts.map +1 -0
  261. package/dist/core/provider-composer-internal.js +273 -0
  262. package/dist/core/provider-composer-internal.js.map +1 -0
  263. package/dist/core/provider-composer.d.ts +16 -0
  264. package/dist/core/provider-composer.d.ts.map +1 -0
  265. package/dist/core/provider-composer.js +108 -0
  266. package/dist/core/provider-composer.js.map +1 -0
  267. package/dist/core/remote-catalog-provider.d.ts.map +1 -1
  268. package/dist/core/remote-catalog-provider.js +74 -122
  269. package/dist/core/remote-catalog-provider.js.map +1 -1
  270. package/dist/core/resolve-config-value.d.ts +8 -7
  271. package/dist/core/resolve-config-value.d.ts.map +1 -1
  272. package/dist/core/resolve-config-value.js +26 -23
  273. package/dist/core/resolve-config-value.js.map +1 -1
  274. package/dist/core/runtime-credentials.d.ts +16 -0
  275. package/dist/core/runtime-credentials.d.ts.map +1 -0
  276. package/dist/core/runtime-credentials.js +42 -0
  277. package/dist/core/runtime-credentials.js.map +1 -0
  278. package/dist/core/sdk-types.d.ts +1 -7
  279. package/dist/core/sdk-types.d.ts.map +1 -1
  280. package/dist/core/sdk-types.js.map +1 -1
  281. package/dist/core/sdk.d.ts.map +1 -1
  282. package/dist/core/sdk.js +27 -28
  283. package/dist/core/sdk.js.map +1 -1
  284. package/dist/extensions/llama/index.js +1 -1
  285. package/dist/extensions/llama/index.js.map +1 -1
  286. package/dist/extensions/llama/provider.d.ts +2 -4
  287. package/dist/extensions/llama/provider.d.ts.map +1 -1
  288. package/dist/extensions/llama/provider.js +25 -17
  289. package/dist/extensions/llama/provider.js.map +1 -1
  290. package/dist/index.d.ts +2 -3
  291. package/dist/index.d.ts.map +1 -1
  292. package/dist/index.js +3 -4
  293. package/dist/index.js.map +1 -1
  294. package/dist/main-runtime-api-key.d.ts +6 -0
  295. package/dist/main-runtime-api-key.d.ts.map +1 -0
  296. package/dist/main-runtime-api-key.js +6 -0
  297. package/dist/main-runtime-api-key.js.map +1 -0
  298. package/dist/main-session-options.d.ts +2 -2
  299. package/dist/main-session-options.d.ts.map +1 -1
  300. package/dist/main-session-options.js +3 -3
  301. package/dist/main-session-options.js.map +1 -1
  302. package/dist/main.d.ts.map +1 -1
  303. package/dist/main.js +9 -11
  304. package/dist/main.js.map +1 -1
  305. package/dist/modes/interactive/components/chat-session-host-actions.d.ts.map +1 -1
  306. package/dist/modes/interactive/components/chat-session-host-actions.js +2 -14
  307. package/dist/modes/interactive/components/chat-session-host-actions.js.map +1 -1
  308. package/dist/modes/interactive/components/chat-session-host-events.d.ts.map +1 -1
  309. package/dist/modes/interactive/components/chat-session-host-events.js +9 -0
  310. package/dist/modes/interactive/components/chat-session-host-events.js.map +1 -1
  311. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts +25 -0
  312. package/dist/modes/interactive/components/chat-session-host-runtime.d.ts.map +1 -1
  313. package/dist/modes/interactive/components/chat-session-host-runtime.js +53 -0
  314. package/dist/modes/interactive/components/chat-session-host-runtime.js.map +1 -1
  315. package/dist/modes/interactive/components/chat-session-host.d.ts +13 -0
  316. package/dist/modes/interactive/components/chat-session-host.d.ts.map +1 -1
  317. package/dist/modes/interactive/components/chat-session-host.js +22 -1
  318. package/dist/modes/interactive/components/chat-session-host.js.map +1 -1
  319. package/dist/modes/interactive/components/footer.js +1 -1
  320. package/dist/modes/interactive/components/footer.js.map +1 -1
  321. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  322. package/dist/modes/interactive/components/login-dialog.js +1 -3
  323. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  324. package/dist/modes/interactive/components/model-selector.d.ts +4 -3
  325. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  326. package/dist/modes/interactive/components/model-selector.js +56 -73
  327. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  328. package/dist/modes/interactive/components/oauth-selector.d.ts +4 -3
  329. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  330. package/dist/modes/interactive/components/oauth-selector.js +15 -24
  331. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  332. package/dist/modes/interactive/interactive-agent-events.js +10 -4
  333. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  334. package/dist/modes/interactive/interactive-auth-login.js +20 -31
  335. package/dist/modes/interactive/interactive-auth-login.js.map +1 -1
  336. package/dist/modes/interactive/interactive-auth-routing.d.ts +1 -1
  337. package/dist/modes/interactive/interactive-auth-routing.d.ts.map +1 -1
  338. package/dist/modes/interactive/interactive-auth-routing.js +21 -47
  339. package/dist/modes/interactive/interactive-auth-routing.js.map +1 -1
  340. package/dist/modes/interactive/interactive-autocomplete.js +3 -3
  341. package/dist/modes/interactive/interactive-autocomplete.js.map +1 -1
  342. package/dist/modes/interactive/interactive-deferred-startup.js +8 -8
  343. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
  344. package/dist/modes/interactive/interactive-extension-runtime.js +2 -1
  345. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  346. package/dist/modes/interactive/interactive-model-catalog-startup.js +2 -2
  347. package/dist/modes/interactive/interactive-model-catalog-startup.js.map +1 -1
  348. package/dist/modes/interactive/interactive-model-routing.js +11 -11
  349. package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
  350. package/dist/modes/interactive/interactive-render-chat.js +1 -1
  351. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  352. package/dist/modes/interactive/interactive-slash-commands.js +2 -2
  353. package/dist/modes/interactive/interactive-slash-commands.js.map +1 -1
  354. package/dist/modes/interactive/interactive-startup.js +1 -1
  355. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  356. package/dist/modes/interactive-engine/isolated-auth.d.ts +2 -2
  357. package/dist/modes/interactive-engine/isolated-auth.d.ts.map +1 -1
  358. package/dist/modes/interactive-engine/isolated-auth.js +4 -3
  359. package/dist/modes/interactive-engine/isolated-auth.js.map +1 -1
  360. package/dist/modes/interactive-engine/isolated-runtime.d.ts.map +1 -1
  361. package/dist/modes/interactive-engine/isolated-runtime.js +4 -3
  362. package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
  363. package/dist/modes/interactive-engine/remote-model-catalog.d.ts +0 -1
  364. package/dist/modes/interactive-engine/remote-model-catalog.d.ts.map +1 -1
  365. package/dist/modes/interactive-engine/remote-model-catalog.js +11 -50
  366. package/dist/modes/interactive-engine/remote-model-catalog.js.map +1 -1
  367. package/dist/modes/rpc/rpc-client-api.d.ts +2 -2
  368. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  369. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  370. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  371. package/dist/modes/rpc/rpc-command-handler.js +26 -19
  372. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  373. package/dist/modes/rpc/rpc-oauth-client.d.ts +1 -1
  374. package/dist/modes/rpc/rpc-oauth-client.d.ts.map +1 -1
  375. package/dist/modes/rpc/rpc-oauth-client.js +1 -1
  376. package/dist/modes/rpc/rpc-oauth-client.js.map +1 -1
  377. package/dist/modes/rpc/rpc-oauth-interaction.d.ts +1 -1
  378. package/dist/modes/rpc/rpc-oauth-interaction.d.ts.map +1 -1
  379. package/dist/modes/rpc/rpc-oauth-interaction.js +1 -1
  380. package/dist/modes/rpc/rpc-oauth-interaction.js.map +1 -1
  381. package/dist/modes/rpc/rpc-provider-auth.d.ts +4 -5
  382. package/dist/modes/rpc/rpc-provider-auth.d.ts.map +1 -1
  383. package/dist/modes/rpc/rpc-provider-auth.js +19 -66
  384. package/dist/modes/rpc/rpc-provider-auth.js.map +1 -1
  385. package/dist/modes/rpc/rpc-session-binding.js +1 -1
  386. package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
  387. package/dist/modes/rpc/rpc-types.d.ts +7 -4
  388. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  389. package/dist/modes/rpc/rpc-types.js.map +1 -1
  390. package/dist/package-manager-cli.d.ts.map +1 -1
  391. package/dist/package-manager-cli.js +5 -7
  392. package/dist/package-manager-cli.js.map +1 -1
  393. package/docs/changelog.mdx +1 -1
  394. package/docs/custom-provider.md +1 -1
  395. package/docs/models.md +4 -6
  396. package/docs/providers.md +13 -0
  397. package/docs/quickstart.md +2 -1
  398. package/docs/sdk.md +32 -49
  399. package/docs/tui.md +7 -2
  400. package/docs/workflows.md +4 -4
  401. package/examples/sdk/02-custom-model.ts +8 -10
  402. package/examples/sdk/09-api-keys-and-oauth.ts +17 -23
  403. package/examples/sdk/12-full-control.ts +9 -11
  404. package/examples/sdk/README.md +17 -21
  405. package/npm-shrinkwrap.json +23 -23
  406. package/package.json +2 -2
  407. package/dist/builtin/workflows/skills/impeccable/reference/brand.md +0 -108
  408. package/dist/builtin/workflows/skills/impeccable/reference/codex.md +0 -105
  409. package/dist/builtin/workflows/skills/impeccable/reference/interaction-design.md +0 -189
  410. package/dist/core/model-registry-auth.d.ts +0 -10
  411. package/dist/core/model-registry-auth.d.ts.map +0 -1
  412. package/dist/core/model-registry-auth.js +0 -98
  413. package/dist/core/model-registry-auth.js.map +0 -1
  414. package/dist/core/model-registry-builtins.d.ts +0 -8
  415. package/dist/core/model-registry-builtins.d.ts.map +0 -1
  416. package/dist/core/model-registry-builtins.js +0 -104
  417. package/dist/core/model-registry-builtins.js.map +0 -1
  418. package/dist/core/model-registry-custom-loader.d.ts +0 -3
  419. package/dist/core/model-registry-custom-loader.d.ts.map +0 -1
  420. package/dist/core/model-registry-custom-loader.js +0 -255
  421. package/dist/core/model-registry-custom-loader.js.map +0 -1
  422. package/dist/core/model-registry-dynamic.d.ts +0 -7
  423. package/dist/core/model-registry-dynamic.d.ts.map +0 -1
  424. package/dist/core/model-registry-dynamic.js +0 -189
  425. package/dist/core/model-registry-dynamic.js.map +0 -1
  426. package/dist/core/model-registry-extension-refresh.d.ts +0 -23
  427. package/dist/core/model-registry-extension-refresh.d.ts.map +0 -1
  428. package/dist/core/model-registry-extension-refresh.js +0 -32
  429. package/dist/core/model-registry-extension-refresh.js.map +0 -1
  430. package/dist/core/model-registry-loader.d.ts +0 -5
  431. package/dist/core/model-registry-loader.d.ts.map +0 -1
  432. package/dist/core/model-registry-loader.js +0 -29
  433. package/dist/core/model-registry-loader.js.map +0 -1
  434. package/dist/core/model-registry-schemas.d.ts +0 -1399
  435. package/dist/core/model-registry-schemas.d.ts.map +0 -1
  436. package/dist/core/model-registry-schemas.js.map +0 -1
  437. package/dist/core/model-registry-types.d.ts +0 -91
  438. package/dist/core/model-registry-types.d.ts.map +0 -1
  439. package/dist/core/model-registry-types.js +0 -2
  440. package/dist/core/model-registry-types.js.map +0 -1
  441. package/dist/core/model-registry-validation.d.ts +0 -7
  442. package/dist/core/model-registry-validation.d.ts.map +0 -1
  443. package/dist/core/model-registry-validation.js +0 -12
  444. package/dist/core/model-registry-validation.js.map +0 -1
  445. package/dist/core/oauth-compat.d.ts +0 -17
  446. package/dist/core/oauth-compat.d.ts.map +0 -1
  447. package/dist/core/oauth-compat.js +0 -2
  448. package/dist/core/oauth-compat.js.map +0 -1
  449. package/dist/core/oauth-provider-bridge.d.ts +0 -63
  450. package/dist/core/oauth-provider-bridge.d.ts.map +0 -1
  451. package/dist/core/oauth-provider-bridge.js +0 -232
  452. package/dist/core/oauth-provider-bridge.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { getOAuthProviderMetadata, isOAuthLoginCancelled, loginOAuthProvider, normalizeOAuthLoginError, } from "../../core/oauth-provider-bridge.js";
1
+ import { createAuthInteraction, isOAuthLoginCancelled } from "../../core/oauth-login.js";
2
2
  import { createRpcOAuthCallbacks } from "./rpc-oauth-interaction.js";
3
3
  export class RpcProviderAuth {
4
4
  constructor(inputForm, oauthTransport) {
@@ -7,40 +7,31 @@ export class RpcProviderAuth {
7
7
  this.oauthTransport = oauthTransport;
8
8
  }
9
9
  async login(session, provider, loginId = provider) {
10
- const customAuth = session.modelRegistry.getCustomApiKeyAuth(provider);
11
- if (!customAuth)
12
- throw new Error(`Provider does not support custom API-key login: ${provider}`);
10
+ if (!session.modelRuntime.getProvider(provider)?.auth.apiKey)
11
+ throw new Error(`Provider does not support API-key login: ${provider}`);
13
12
  if (!this.inputForm)
14
13
  throw new Error("Provider login requires an interactive input host");
15
14
  const controller = this.begin(provider, loginId);
16
15
  try {
17
- const credential = await customAuth.login({
16
+ const credential = await session.modelRuntime.login(provider, "api_key", {
18
17
  signal: controller.signal,
19
18
  prompt: async (prompt) => {
20
- const values = await this.inputForm.open({
21
- title: prompt.message,
22
- heading: "PROVIDER LOGIN",
23
- submitLabel: "[ Submit ]",
24
- fields: [{
25
- name: "value", type: "string", required: false, initialValue: "",
26
- placeholder: prompt.placeholder,
27
- }],
28
- }, controller.signal);
19
+ const values = await this.inputForm.open({ title: prompt.message, heading: "PROVIDER LOGIN", submitLabel: "[ Submit ]", fields: [{ name: "value", type: "string", required: false, initialValue: "", placeholder: "placeholder" in prompt ? prompt.placeholder : undefined }] }, controller.signal);
29
20
  if (!values || controller.signal.aborted)
30
21
  throw new Error("Login cancelled");
31
22
  return values.value ?? "";
32
23
  },
24
+ notify: () => { },
33
25
  });
34
26
  if (controller.signal.aborted)
35
27
  return { provider, cancelled: true };
36
- session.modelRegistry.authStorage.set(provider, credential);
37
- await session.modelRegistry.refresh();
28
+ if (credential.type !== "api_key")
29
+ throw new Error(`Provider returned an unexpected ${credential.type} credential`);
38
30
  return { provider, cancelled: false, credential, ...this.catalog(session) };
39
31
  }
40
32
  catch (error) {
41
- if (controller.signal.aborted || (error instanceof Error && error.message === "Login cancelled")) {
33
+ if (controller.signal.aborted || (error instanceof Error && error.message === "Login cancelled"))
42
34
  return { provider, cancelled: true };
43
- }
44
35
  throw error;
45
36
  }
46
37
  finally {
@@ -48,17 +39,15 @@ export class RpcProviderAuth {
48
39
  }
49
40
  }
50
41
  async loginOAuth(session, provider, loginId = provider) {
51
- if (!getOAuthProviderMetadata().some(({ id }) => id === provider)) {
42
+ if (!session.modelRuntime.getProvider(provider)?.auth.oauth)
52
43
  throw new Error(`Unknown OAuth provider: ${provider}`);
53
- }
54
44
  if (!this.oauthTransport)
55
45
  throw new Error("OAuth login requires an interactive host");
56
46
  const controller = this.begin(provider, loginId);
57
47
  try {
58
48
  const callbacks = createRpcOAuthCallbacks(provider, loginId, controller.signal, this.oauthTransport);
59
- let credential;
60
49
  try {
61
- credential = await loginOAuthProvider(provider, callbacks);
50
+ await session.modelRuntime.login(provider, "oauth", createAuthInteraction(callbacks));
62
51
  }
63
52
  catch (error) {
64
53
  if (isOAuthLoginCancelled(error, controller.signal))
@@ -67,7 +56,7 @@ export class RpcProviderAuth {
67
56
  }
68
57
  if (controller.signal.aborted)
69
58
  return { provider, cancelled: true };
70
- await this.persistOAuthAndRefresh(session, provider, credential, controller.signal);
59
+ session.refreshCurrentModelFromRegistry();
71
60
  return { provider, cancelled: false, ...this.catalog(session) };
72
61
  }
73
62
  finally {
@@ -75,8 +64,7 @@ export class RpcProviderAuth {
75
64
  }
76
65
  }
77
66
  async save(session, provider, credential) {
78
- await session.modelRegistry.authStorage.asCredentialStore().modify(provider, async () => credential);
79
- await session.modelRegistry.refresh();
67
+ await session.modelRuntime.saveCredential(provider, credential);
80
68
  session.refreshCurrentModelFromRegistry();
81
69
  return this.catalog(session);
82
70
  }
@@ -87,58 +75,23 @@ export class RpcProviderAuth {
87
75
  active.controller.abort();
88
76
  return;
89
77
  }
90
- for (const active of this.controllers.values()) {
78
+ for (const active of this.controllers.values())
91
79
  if (active.provider === provider)
92
80
  active.controller.abort();
93
- }
94
81
  }
95
82
  begin(provider, loginId) {
96
- if ([...this.controllers.values()].some((active) => active.provider === provider)) {
83
+ if ([...this.controllers.values()].some((active) => active.provider === provider))
97
84
  throw new Error(`Login already in progress: ${provider}`);
98
- }
99
85
  const controller = new AbortController();
100
86
  this.controllers.set(loginId, { provider, controller });
101
87
  return controller;
102
88
  }
103
- finish(loginId, controller) {
104
- if (this.controllers.get(loginId)?.controller === controller)
105
- this.controllers.delete(loginId);
106
- }
107
- async persistOAuthAndRefresh(session, provider, credential, signal) {
108
- const storage = session.modelRegistry.authStorage;
109
- const previous = storage.get(provider);
110
- const credentialStore = storage.asCredentialStore();
111
- if (signal.aborted)
112
- throw normalizeOAuthLoginError(signal.reason, signal);
113
- await credentialStore.modify(provider, async () => credential);
114
- try {
115
- if (signal.aborted)
116
- throw normalizeOAuthLoginError(signal.reason, signal);
117
- const result = await session.modelRegistry.refresh();
118
- const failures = [...result.errors.entries()];
119
- if (failures.length > 0) {
120
- throw new Error(failures.map(([id, error]) => `${id}: ${error.message}`).join("; "));
121
- }
122
- if (signal.aborted)
123
- throw normalizeOAuthLoginError(signal.reason, signal);
124
- if (result.aborted)
125
- throw new Error("Model refresh aborted after OAuth login");
126
- session.refreshCurrentModelFromRegistry();
127
- }
128
- catch (error) {
129
- if (previous === undefined)
130
- await credentialStore.delete(provider);
131
- else
132
- await credentialStore.modify(provider, async () => previous);
133
- throw error;
134
- }
135
- }
89
+ finish(loginId, controller) { if (this.controllers.get(loginId)?.controller === controller)
90
+ this.controllers.delete(loginId); }
136
91
  catalog(session) {
137
92
  return {
138
- models: session.modelRegistry.getAvailable(),
139
- scopedModels: [...session.scopedModels],
140
- customAuthProviders: session.modelRegistry.getCustomApiKeyAuthProviders(),
141
- oauthProviders: getOAuthProviderMetadata(),
93
+ models: [...session.modelRuntime.getAvailableSnapshot()], scopedModels: [...session.scopedModels], customAuthProviders: [],
94
+ oauthProviders: session.modelRuntime.getOAuthProviderMetadata(),
142
95
  };
143
96
  }
144
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-provider-auth.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-provider-auth.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,wBAAwB,GACxB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAkC,MAAM,4BAA4B,CAAC;AAYrG,MAAM,OAAO,eAAe;IAK3B,YAAY,SAA8B,EAAE,cAA0C;QAJrE,gBAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;QAK7D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAAqB,EAAE,QAAgB,EAAE,OAAO,GAAG,QAAQ;QACtE,MAAM,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACvE,IAAI,CAAC,UAAU;Y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CAAC;YACvC,mBAAmB,EAAE,OAAO,CAAC,aAAa,CAAC,4BAA4B,EAAE;YACzE,cAAc,EAAE,wBAAwB,EAAE;SAC1C,CAAC;IACH,CAAC;CACD","sourcesContent":["import type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { AuthCredential } from \"../../core/auth-storage.ts\";\nimport type { HostInputFormRequest } from \"../../core/extensions/ui-types.ts\";\nimport {\n\tgetOAuthProviderMetadata,\n\tisOAuthLoginCancelled,\n\tloginOAuthProvider,\n\tnormalizeOAuthLoginError,\n} from \"../../core/oauth-provider-bridge.ts\";\nimport { createRpcOAuthCallbacks, type OAuthInteractionTransport } from \"./rpc-oauth-interaction.ts\";\nimport type { RpcLoginProviderResult, RpcModelCatalog, RpcOAuthLoginProviderResult } from \"./rpc-types.ts\";\n\nexport interface ProviderLoginInput {\n\topen(request: HostInputFormRequest, signal?: AbortSignal): Promise<Record<string, string> | undefined>;\n}\n\ninterface ActiveLogin {\n\tprovider: string;\n\tcontroller: AbortController;\n}\n\nexport class RpcProviderAuth {\n\tprivate readonly controllers = new Map<string, ActiveLogin>();\n\tprivate readonly inputForm?: ProviderLoginInput;\n\tprivate readonly oauthTransport?: OAuthInteractionTransport;\n\n\tconstructor(inputForm?: ProviderLoginInput, oauthTransport?: OAuthInteractionTransport) {\n\t\tthis.inputForm = inputForm;\n\t\tthis.oauthTransport = oauthTransport;\n\t}\n\n\tasync login(session: AgentSession, provider: string, loginId = provider): Promise<RpcLoginProviderResult> {\n\t\tconst customAuth = session.modelRegistry.getCustomApiKeyAuth(provider);\n\t\tif (!customAuth) throw new Error(`Provider does not support custom API-key login: ${provider}`);\n\t\tif (!this.inputForm) throw new Error(\"Provider login requires an interactive input host\");\n\t\tconst controller = this.begin(provider, loginId);\n\t\ttry {\n\t\t\tconst credential = await customAuth.login({\n\t\t\t\tsignal: controller.signal,\n\t\t\t\tprompt: async (prompt) => {\n\t\t\t\t\tconst values = await this.inputForm!.open({\n\t\t\t\t\t\ttitle: prompt.message,\n\t\t\t\t\t\theading: \"PROVIDER LOGIN\",\n\t\t\t\t\t\tsubmitLabel: \"[ Submit ]\",\n\t\t\t\t\t\tfields: [{\n\t\t\t\t\t\t\tname: \"value\", type: \"string\", required: false, initialValue: \"\",\n\t\t\t\t\t\t\tplaceholder: prompt.placeholder,\n\t\t\t\t\t\t}],\n\t\t\t\t\t}, controller.signal);\n\t\t\t\t\tif (!values || controller.signal.aborted) throw new Error(\"Login cancelled\");\n\t\t\t\t\treturn values.value ?? \"\";\n\t\t\t\t},\n\t\t\t});\n\t\t\tif (controller.signal.aborted) return { provider, cancelled: true };\n\t\t\tsession.modelRegistry.authStorage.set(provider, credential);\n\t\t\tawait session.modelRegistry.refresh();\n\t\t\treturn { provider, cancelled: false, credential, ...this.catalog(session) };\n\t\t} catch (error) {\n\t\t\tif (controller.signal.aborted || (error instanceof Error && error.message === \"Login cancelled\")) {\n\t\t\t\treturn { provider, cancelled: true };\n\t\t\t}\n\t\t\tthrow error;\n\t\t} finally {\n\t\t\tthis.finish(loginId, controller);\n\t\t}\n\t}\n\n\tasync loginOAuth(session: AgentSession, provider: string, loginId = provider): Promise<RpcOAuthLoginProviderResult> {\n\t\tif (!getOAuthProviderMetadata().some(({ id }) => id === provider)) {\n\t\t\tthrow new Error(`Unknown OAuth provider: ${provider}`);\n\t\t}\n\t\tif (!this.oauthTransport) throw new Error(\"OAuth login requires an interactive host\");\n\t\tconst controller = this.begin(provider, loginId);\n\t\ttry {\n\t\t\tconst callbacks = createRpcOAuthCallbacks(provider, loginId, controller.signal, this.oauthTransport);\n\t\t\tlet credential: AuthCredential;\n\t\t\ttry {\n\t\t\t\tcredential = await loginOAuthProvider(provider, callbacks);\n\t\t\t} catch (error) {\n\t\t\t\tif (isOAuthLoginCancelled(error, controller.signal)) return { provider, cancelled: true };\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tif (controller.signal.aborted) return { provider, cancelled: true };\n\t\t\tawait this.persistOAuthAndRefresh(session, provider, credential, controller.signal);\n\t\t\treturn { provider, cancelled: false, ...this.catalog(session) };\n\t\t} finally {\n\t\t\tthis.finish(loginId, controller);\n\t\t}\n\t}\n\n\tasync save(session: AgentSession, provider: string, credential: AuthCredential): Promise<RpcModelCatalog> {\n\t\tawait session.modelRegistry.authStorage.asCredentialStore().modify(provider, async () => credential);\n\t\tawait session.modelRegistry.refresh();\n\t\tsession.refreshCurrentModelFromRegistry();\n\t\treturn this.catalog(session);\n\t}\n\n\tcancel(provider: string, loginId?: string): void {\n\t\tif (loginId !== undefined) {\n\t\t\tconst active = this.controllers.get(loginId);\n\t\t\tif (active?.provider === provider) active.controller.abort();\n\t\t\treturn;\n\t\t}\n\t\tfor (const active of this.controllers.values()) {\n\t\t\tif (active.provider === provider) active.controller.abort();\n\t\t}\n\t}\n\n\tprivate begin(provider: string, loginId: string): AbortController {\n\t\tif ([...this.controllers.values()].some((active) => active.provider === provider)) {\n\t\t\tthrow new Error(`Login already in progress: ${provider}`);\n\t\t}\n\t\tconst controller = new AbortController();\n\t\tthis.controllers.set(loginId, { provider, controller });\n\t\treturn controller;\n\t}\n\n\tprivate finish(loginId: string, controller: AbortController): void {\n\t\tif (this.controllers.get(loginId)?.controller === controller) this.controllers.delete(loginId);\n\t}\n\n\tprivate async persistOAuthAndRefresh(\n\t\tsession: AgentSession,\n\t\tprovider: string,\n\t\tcredential: AuthCredential,\n\t\tsignal: AbortSignal,\n\t): Promise<void> {\n\t\tconst storage = session.modelRegistry.authStorage;\n\t\tconst previous = storage.get(provider);\n\t\tconst credentialStore = storage.asCredentialStore();\n\t\tif (signal.aborted) throw normalizeOAuthLoginError(signal.reason, signal);\n\t\tawait credentialStore.modify(provider, async () => credential);\n\t\ttry {\n\t\t\tif (signal.aborted) throw normalizeOAuthLoginError(signal.reason, signal);\n\t\t\tconst result = await session.modelRegistry.refresh();\n\t\t\tconst failures = [...result.errors.entries()];\n\t\t\tif (failures.length > 0) {\n\t\t\t\tthrow new Error(failures.map(([id, error]) => `${id}: ${error.message}`).join(\"; \"));\n\t\t\t}\n\t\t\tif (signal.aborted) throw normalizeOAuthLoginError(signal.reason, signal);\n\t\t\tif (result.aborted) throw new Error(\"Model refresh aborted after OAuth login\");\n\t\t\tsession.refreshCurrentModelFromRegistry();\n\t\t} catch (error) {\n\t\t\tif (previous === undefined) await credentialStore.delete(provider);\n\t\t\telse await credentialStore.modify(provider, async () => previous);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate catalog(session: AgentSession): RpcModelCatalog {\n\t\treturn {\n\t\t\tmodels: session.modelRegistry.getAvailable(),\n\t\t\tscopedModels: [...session.scopedModels],\n\t\t\tcustomAuthProviders: session.modelRegistry.getCustomApiKeyAuthProviders(),\n\t\t\toauthProviders: getOAuthProviderMetadata(),\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"rpc-provider-auth.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-provider-auth.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAkC,MAAM,4BAA4B,CAAC;AAQrG,MAAM,OAAO,eAAe;IAI3B,YAAY,SAA8B,EAAE,cAA0C;QAHrE,gBAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;QAI7D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,OAAqB,EAAE,QAAgB,EAAE,OAAO,GAAG,QAAQ;QACtE,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,4CAA4C,QAAQ,EAAE,CAAC,CAAC;QACtI,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QAC1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MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,EAAE,CAAC,CAAC;QAC7I,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC;QAAC,OAAO,UAAU,CAAC;IACtH,CAAC;IACO,MAAM,CAAC,OAAe,EAAE,UAA2B,IAAU,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,UAAU,KAAK,UAAU;QAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9J,OAAO,CAAC,OAAqB;QACpC,OAAO;YACN,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,oBAAoB,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,EAAE,mBAAmB,EAAE,EAAE;YAC1H,cAAc,EAAE,OAAO,CAAC,YAAY,CAAC,wBAAwB,EAAE;SAC/D,CAAC;IACH,CAAC;CACD","sourcesContent":["import type { Credential } from \"@earendil-works/pi-ai\";\nimport type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { HostInputFormRequest } from \"../../core/extensions/ui-types.ts\";\nimport { createAuthInteraction, isOAuthLoginCancelled } from \"../../core/oauth-login.ts\";\nimport { createRpcOAuthCallbacks, type OAuthInteractionTransport } from \"./rpc-oauth-interaction.ts\";\nimport type { RpcLoginProviderResult, RpcModelCatalog, RpcOAuthLoginProviderResult } from \"./rpc-types.ts\";\n\nexport interface ProviderLoginInput {\n\topen(request: HostInputFormRequest, signal?: AbortSignal): Promise<Record<string, string> | undefined>;\n}\ninterface ActiveLogin { provider: string; controller: AbortController; }\n\nexport class RpcProviderAuth {\n\tprivate readonly controllers = new Map<string, ActiveLogin>();\n\tprivate readonly inputForm: ProviderLoginInput | undefined;\n\tprivate readonly oauthTransport: OAuthInteractionTransport | undefined;\n\tconstructor(inputForm?: ProviderLoginInput, oauthTransport?: OAuthInteractionTransport) {\n\t\tthis.inputForm = inputForm;\n\t\tthis.oauthTransport = oauthTransport;\n\t}\n\n\tasync login(session: AgentSession, provider: string, loginId = provider): Promise<RpcLoginProviderResult> {\n\t\tif (!session.modelRuntime.getProvider(provider)?.auth.apiKey) throw new Error(`Provider does not support API-key login: ${provider}`);\n\t\tif (!this.inputForm) throw new Error(\"Provider login requires an interactive input host\");\n\t\tconst controller = this.begin(provider, loginId);\n\t\ttry {\n\t\t\tconst credential = await session.modelRuntime.login(provider, \"api_key\", {\n\t\t\t\tsignal: controller.signal,\n\t\t\t\tprompt: async (prompt) => {\n\t\t\t\t\tconst values = await this.inputForm!.open({ title: prompt.message, heading: \"PROVIDER LOGIN\", submitLabel: \"[ Submit ]\", fields: [{ name: \"value\", type: \"string\", required: false, initialValue: \"\", placeholder: \"placeholder\" in prompt ? prompt.placeholder : undefined }] }, controller.signal);\n\t\t\t\t\tif (!values || controller.signal.aborted) throw new Error(\"Login cancelled\");\n\t\t\t\t\treturn values.value ?? \"\";\n\t\t\t\t},\n\t\t\t\tnotify: () => {},\n\t\t\t});\n\t\t\tif (controller.signal.aborted) return { provider, cancelled: true };\n\t\t\tif (credential.type !== \"api_key\") throw new Error(`Provider returned an unexpected ${credential.type} credential`);\n\t\t\treturn { provider, cancelled: false, credential, ...this.catalog(session) };\n\t\t} catch (error) {\n\t\t\tif (controller.signal.aborted || (error instanceof Error && error.message === \"Login cancelled\")) return { provider, cancelled: true };\n\t\t\tthrow error;\n\t\t} finally { this.finish(loginId, controller); }\n\t}\n\n\tasync loginOAuth(session: AgentSession, provider: string, loginId = provider): Promise<RpcOAuthLoginProviderResult> {\n\t\tif (!session.modelRuntime.getProvider(provider)?.auth.oauth) throw new Error(`Unknown OAuth provider: ${provider}`);\n\t\tif (!this.oauthTransport) throw new Error(\"OAuth login requires an interactive host\");\n\t\tconst controller = this.begin(provider, loginId);\n\t\ttry {\n\t\t\tconst callbacks = createRpcOAuthCallbacks(provider, loginId, controller.signal, this.oauthTransport);\n\t\t\ttry { await session.modelRuntime.login(provider, \"oauth\", createAuthInteraction(callbacks)); }\n\t\t\tcatch (error) { if (isOAuthLoginCancelled(error, controller.signal)) return { provider, cancelled: true }; throw error; }\n\t\t\tif (controller.signal.aborted) return { provider, cancelled: true };\n\t\t\tsession.refreshCurrentModelFromRegistry();\n\t\t\treturn { provider, cancelled: false, ...this.catalog(session) };\n\t\t} finally { this.finish(loginId, controller); }\n\t}\n\n\tasync save(session: AgentSession, provider: string, credential: Credential): Promise<RpcModelCatalog> {\n\t\tawait session.modelRuntime.saveCredential(provider, credential);\n\t\tsession.refreshCurrentModelFromRegistry();\n\t\treturn this.catalog(session);\n\t}\n\tcancel(provider: string, loginId?: string): void {\n\t\tif (loginId !== undefined) { const active = this.controllers.get(loginId); if (active?.provider === provider) active.controller.abort(); return; }\n\t\tfor (const active of this.controllers.values()) if (active.provider === provider) active.controller.abort();\n\t}\n\tprivate begin(provider: string, loginId: string): AbortController {\n\t\tif ([...this.controllers.values()].some((active) => active.provider === provider)) throw new Error(`Login already in progress: ${provider}`);\n\t\tconst controller = new AbortController(); this.controllers.set(loginId, { provider, controller }); return controller;\n\t}\n\tprivate finish(loginId: string, controller: AbortController): void { if (this.controllers.get(loginId)?.controller === controller) this.controllers.delete(loginId); }\n\tprivate catalog(session: AgentSession): RpcModelCatalog {\n\t\treturn {\n\t\t\tmodels: [...session.modelRuntime.getAvailableSnapshot()], scopedModels: [...session.scopedModels], customAuthProviders: [],\n\t\t\toauthProviders: session.modelRuntime.getOAuthProviderMetadata(),\n\t\t};\n\t}\n}\n"]}
@@ -29,7 +29,7 @@ export class RpcSessionBinding {
29
29
  // sessions instead of defaulting to 0.
30
30
  const models = session.scopedModels.length > 0
31
31
  ? session.scopedModels.map((scoped) => scoped.model)
32
- : session.modelRegistry.getAvailable();
32
+ : session.modelRuntime.getAvailableSnapshot();
33
33
  this.footerDataProvider.setAvailableProviderCount(new Set(models.map((model) => model.provider)).size);
34
34
  try {
35
35
  await session.bindExtensions({
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-session-binding.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-session-binding.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAK1E,OAAO,EAAE,2BAA2B,EAAoC,MAAM,uBAAuB,CAAC;AAgBtG,MAAM,OAAO,iBAAiB;IAe7B,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,wBAAwB,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAA4B;QAC7K,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;QACzD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IACpC,CAAC;IAED,IAAI,cAAc;QACjB,OAAO,IAAI,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,aAAa;QAClB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,oBAAoB,EAAE,CAAC;Q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CAAC,uBAAuB,GAAG,SAAS,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACrC,CAAC;CACD","sourcesContent":["import type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { AgentSessionRuntime } from \"../../core/agent-session-runtime.ts\";\nimport { FooterDataProvider } from \"../../core/footer-data-provider.ts\";\nimport { waitForRawStdoutBackpressure } from \"../../core/output-guard.ts\";\nimport type { EngineCustomUiService } from \"../interactive-engine/engine-custom-ui.ts\";\nimport type { EngineInputFormService } from \"../interactive-engine/engine-input-form.ts\";\nimport type { EngineRenderService } from \"../interactive-engine/engine-render-service.ts\";\nimport type { EngineSessionPickerService } from \"../interactive-engine/engine-session-picker.ts\";\nimport { createRpcExtensionUIContext, type RpcPendingExtensionRequests } from \"./rpc-extension-ui.ts\";\nimport type { KeybindingsReloadCoordinator } from \"./rpc-keybindings-reload.ts\";\nimport type { RpcOutput } from \"./rpc-responses.ts\";\n\ninterface RpcSessionBindingOptions {\n\truntimeHost: AgentSessionRuntime;\n\toutput: RpcOutput;\n\tpendingExtensionRequests: RpcPendingExtensionRequests;\n\tcustomUi?: EngineCustomUiService;\n\trenderService?: EngineRenderService;\n\tsessionPicker?: EngineSessionPickerService;\n\tinputForm?: EngineInputFormService;\n\trequestShutdown: () => void;\n\treloadCoordinator?: KeybindingsReloadCoordinator<AgentSession>;\n}\n\nexport class RpcSessionBinding {\n\tprivate session: AgentSession;\n\tprivate unsubscribe?: () => void;\n\tprivate unsubscribeBackpressure?: () => void;\n\tprivate readonly runtimeHost: AgentSessionRuntime;\n\tprivate readonly output: RpcOutput;\n\tprivate readonly pendingExtensionRequests: RpcPendingExtensionRequests;\n\tprivate readonly customUi: EngineCustomUiService | undefined;\n\tprivate readonly renderService: EngineRenderService | undefined;\n\tprivate readonly sessionPicker: EngineSessionPickerService | undefined;\n\tprivate readonly inputForm: EngineInputFormService | undefined;\n\tprivate readonly requestShutdown: () => void;\n\tprivate readonly reloadCoordinator: KeybindingsReloadCoordinator<AgentSession> | undefined;\n\n\tprivate footerDataProvider: FooterDataProvider | undefined;\n\tconstructor({ runtimeHost, output, pendingExtensionRequests, requestShutdown, customUi, renderService, sessionPicker, inputForm, reloadCoordinator }: RpcSessionBindingOptions) {\n\t\tthis.runtimeHost = runtimeHost;\n\t\tthis.output = output;\n\t\tthis.pendingExtensionRequests = pendingExtensionRequests;\n\t\tthis.requestShutdown = requestShutdown;\n\t\tthis.customUi = customUi;\n\t\tthis.renderService = renderService;\n\t\tthis.sessionPicker = sessionPicker;\n\t\tthis.inputForm = inputForm;\n\t\tthis.reloadCoordinator = reloadCoordinator;\n\t\tthis.session = runtimeHost.session;\n\t}\n\n\tget currentSession(): AgentSession {\n\t\treturn this.session;\n\t}\n\n\tasync rebindSession(): Promise<void> {\n\t\tthis.session = this.runtimeHost.session;\n\t\tthis.disposeSubscriptions();\n\t\tconst session = this.session;\n\t\tthis.renderService?.bindSession(session);\n\t\tthis.footerDataProvider = new FooterDataProvider(session.sessionManager.getCwd());\n\t\t// Seed the provider count from the current catalog snapshot, mirroring\n\t\t// updateProviderCountFromSnapshot() in interactive startup, so the\n\t\t// embedded footer shows the (provider) model prefix in multi-provider\n\t\t// sessions instead of defaulting to 0.\n\t\tconst models = session.scopedModels.length > 0\n\t\t\t? session.scopedModels.map((scoped) => scoped.model)\n\t\t\t: session.modelRegistry.getAvailable();\n\t\tthis.footerDataProvider.setAvailableProviderCount(new Set(models.map((model) => model.provider)).size);\n\n\t\ttry {\n\t\t\tawait session.bindExtensions({\n\t\t\t\tuiContext: createRpcExtensionUIContext({\n\t\t\t\t\toutput: this.output,\n\t\t\t\t\tpendingExtensionRequests: this.pendingExtensionRequests,\n\t\t\t\t\tcustomUi: this.customUi,\n\t\t\t\t\tsessionPicker: this.sessionPicker,\n\t\t\t\t\tinputForm: this.inputForm,\n\t\t\t\t\tfooterDataProvider: this.footerDataProvider,\n\t\t\t\t}),\n\t\t\t\tmode: this.customUi ? \"tui\" : \"rpc\",\n\t\t\t\tcommandContextActions: {\n\t\t\t\t\twaitForIdle: () => this.session.agent.waitForIdle(),\n\t\t\t\t\tnewSession: async (options) => this.runtimeHost.newSession(options),\n\t\t\t\t\tfork: async (entryId, forkOptions) => {\n\t\t\t\t\t\tconst result = await this.runtimeHost.fork(entryId, forkOptions);\n\t\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t\t},\n\t\t\t\t\tnavigateTree: async (targetId, options) => {\n\t\t\t\t\t\tconst result = await this.session.navigateTree(targetId, {\n\t\t\t\t\t\t\tsummarize: options?.summarize,\n\t\t\t\t\t\t\tcustomInstructions: options?.customInstructions,\n\t\t\t\t\t\t\treplaceInstructions: options?.replaceInstructions,\n\t\t\t\t\t\t\tlabel: options?.label,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t\t},\n\t\t\t\t\tswitchSession: async (sessionPath, options) => {\n\t\t\t\t\t\treturn this.runtimeHost.switchSession(sessionPath, options);\n\t\t\t\t\t},\n\t\t\t\t\treload: async () => {\n\t\t\t\t\t\tconst steeringMode = this.session.steeringMode;\n\t\t\t\t\t\tconst followUpMode = this.session.followUpMode;\n\t\t\t\t\t\tif (this.reloadCoordinator) await this.reloadCoordinator.reload(this.session);\n\t\t\t\t\t\telse await this.session.reload();\n\t\t\t\t\t\tthis.session.setSteeringMode(steeringMode);\n\t\t\t\t\t\tthis.session.setFollowUpMode(followUpMode);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tshutdownHandler: this.requestShutdown,\n\t\t\t\tonError: (err) => {\n\t\t\t\t\tthis.output({ type: \"extension_error\", extensionPath: err.extensionPath, event: err.event, error: err.error });\n\t\t\t\t},\n\t\t\t});\n\t\t\tthis.footerDataProvider.startGitWatcher();\n\t\t} catch (error) {\n\t\t\t// Leave no partially-initialized footer state behind if extension\n\t\t\t// binding fails; dispose the provider and rethrow.\n\t\t\tthis.footerDataProvider.dispose();\n\t\t\tthis.footerDataProvider = undefined;\n\t\t\tthrow error;\n\t\t}\n\n\t\tthis.unsubscribe = session.subscribe((event) => {\n\t\t\tthis.output(event);\n\t\t});\n\t\tthis.unsubscribeBackpressure = session.agent.subscribe(async () => {\n\t\t\tawait waitForRawStdoutBackpressure();\n\t\t});\n\t\tthis.reloadCoordinator?.publishCurrentState(session);\n\t}\n\n\tdisposeSubscriptions(): void {\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribeBackpressure?.();\n\t\tthis.footerDataProvider?.dispose();\n\t\tthis.unsubscribe = undefined;\n\t\tthis.unsubscribeBackpressure = undefined;\n\t\tthis.footerDataProvider = undefined;\n\t}\n}\n"]}
1
+ {"version":3,"file":"rpc-session-binding.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-session-binding.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAK1E,OAAO,EAAE,2BAA2B,EAAoC,MAAM,uBAAuB,CAAC;AAgBtG,MAAM,OAAO,iBAAiB;IAe7B,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,wBAAwB,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAA4B;QAC7K,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;QACzD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,CAAC,O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B,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,oBAAoB;QACnB,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACrB,IAAI,CAAC,uBAAuB,EAAE,EAAE,CAAC;QACjC,IAAI,CAAC,kBAAkB,EAAE,OAAO,EAAE,CAAC;QACnC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,IAAI,CAAC,uBAAuB,GAAG,SAAS,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACrC,CAAC;CACD","sourcesContent":["import type { AgentSession } from \"../../core/agent-session.ts\";\nimport type { AgentSessionRuntime } from \"../../core/agent-session-runtime.ts\";\nimport { FooterDataProvider } from \"../../core/footer-data-provider.ts\";\nimport { waitForRawStdoutBackpressure } from \"../../core/output-guard.ts\";\nimport type { EngineCustomUiService } from \"../interactive-engine/engine-custom-ui.ts\";\nimport type { EngineInputFormService } from \"../interactive-engine/engine-input-form.ts\";\nimport type { EngineRenderService } from \"../interactive-engine/engine-render-service.ts\";\nimport type { EngineSessionPickerService } from \"../interactive-engine/engine-session-picker.ts\";\nimport { createRpcExtensionUIContext, type RpcPendingExtensionRequests } from \"./rpc-extension-ui.ts\";\nimport type { KeybindingsReloadCoordinator } from \"./rpc-keybindings-reload.ts\";\nimport type { RpcOutput } from \"./rpc-responses.ts\";\n\ninterface RpcSessionBindingOptions {\n\truntimeHost: AgentSessionRuntime;\n\toutput: RpcOutput;\n\tpendingExtensionRequests: RpcPendingExtensionRequests;\n\tcustomUi?: EngineCustomUiService;\n\trenderService?: EngineRenderService;\n\tsessionPicker?: EngineSessionPickerService;\n\tinputForm?: EngineInputFormService;\n\trequestShutdown: () => void;\n\treloadCoordinator?: KeybindingsReloadCoordinator<AgentSession>;\n}\n\nexport class RpcSessionBinding {\n\tprivate session: AgentSession;\n\tprivate unsubscribe?: () => void;\n\tprivate unsubscribeBackpressure?: () => void;\n\tprivate readonly runtimeHost: AgentSessionRuntime;\n\tprivate readonly output: RpcOutput;\n\tprivate readonly pendingExtensionRequests: RpcPendingExtensionRequests;\n\tprivate readonly customUi: EngineCustomUiService | undefined;\n\tprivate readonly renderService: EngineRenderService | undefined;\n\tprivate readonly sessionPicker: EngineSessionPickerService | undefined;\n\tprivate readonly inputForm: EngineInputFormService | undefined;\n\tprivate readonly requestShutdown: () => void;\n\tprivate readonly reloadCoordinator: KeybindingsReloadCoordinator<AgentSession> | undefined;\n\n\tprivate footerDataProvider: FooterDataProvider | undefined;\n\tconstructor({ runtimeHost, output, pendingExtensionRequests, requestShutdown, customUi, renderService, sessionPicker, inputForm, reloadCoordinator }: RpcSessionBindingOptions) {\n\t\tthis.runtimeHost = runtimeHost;\n\t\tthis.output = output;\n\t\tthis.pendingExtensionRequests = pendingExtensionRequests;\n\t\tthis.requestShutdown = requestShutdown;\n\t\tthis.customUi = customUi;\n\t\tthis.renderService = renderService;\n\t\tthis.sessionPicker = sessionPicker;\n\t\tthis.inputForm = inputForm;\n\t\tthis.reloadCoordinator = reloadCoordinator;\n\t\tthis.session = runtimeHost.session;\n\t}\n\n\tget currentSession(): AgentSession {\n\t\treturn this.session;\n\t}\n\n\tasync rebindSession(): Promise<void> {\n\t\tthis.session = this.runtimeHost.session;\n\t\tthis.disposeSubscriptions();\n\t\tconst session = this.session;\n\t\tthis.renderService?.bindSession(session);\n\t\tthis.footerDataProvider = new FooterDataProvider(session.sessionManager.getCwd());\n\t\t// Seed the provider count from the current catalog snapshot, mirroring\n\t\t// updateProviderCountFromSnapshot() in interactive startup, so the\n\t\t// embedded footer shows the (provider) model prefix in multi-provider\n\t\t// sessions instead of defaulting to 0.\n\t\tconst models = session.scopedModels.length > 0\n\t\t\t? session.scopedModels.map((scoped) => scoped.model)\n\t\t\t: session.modelRuntime.getAvailableSnapshot();\n\t\tthis.footerDataProvider.setAvailableProviderCount(new Set(models.map((model) => model.provider)).size);\n\n\t\ttry {\n\t\t\tawait session.bindExtensions({\n\t\t\t\tuiContext: createRpcExtensionUIContext({\n\t\t\t\t\toutput: this.output,\n\t\t\t\t\tpendingExtensionRequests: this.pendingExtensionRequests,\n\t\t\t\t\tcustomUi: this.customUi,\n\t\t\t\t\tsessionPicker: this.sessionPicker,\n\t\t\t\t\tinputForm: this.inputForm,\n\t\t\t\t\tfooterDataProvider: this.footerDataProvider,\n\t\t\t\t}),\n\t\t\t\tmode: this.customUi ? \"tui\" : \"rpc\",\n\t\t\t\tcommandContextActions: {\n\t\t\t\t\twaitForIdle: () => this.session.agent.waitForIdle(),\n\t\t\t\t\tnewSession: async (options) => this.runtimeHost.newSession(options),\n\t\t\t\t\tfork: async (entryId, forkOptions) => {\n\t\t\t\t\t\tconst result = await this.runtimeHost.fork(entryId, forkOptions);\n\t\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t\t},\n\t\t\t\t\tnavigateTree: async (targetId, options) => {\n\t\t\t\t\t\tconst result = await this.session.navigateTree(targetId, {\n\t\t\t\t\t\t\tsummarize: options?.summarize,\n\t\t\t\t\t\t\tcustomInstructions: options?.customInstructions,\n\t\t\t\t\t\t\treplaceInstructions: options?.replaceInstructions,\n\t\t\t\t\t\t\tlabel: options?.label,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn { cancelled: result.cancelled };\n\t\t\t\t\t},\n\t\t\t\t\tswitchSession: async (sessionPath, options) => {\n\t\t\t\t\t\treturn this.runtimeHost.switchSession(sessionPath, options);\n\t\t\t\t\t},\n\t\t\t\t\treload: async () => {\n\t\t\t\t\t\tconst steeringMode = this.session.steeringMode;\n\t\t\t\t\t\tconst followUpMode = this.session.followUpMode;\n\t\t\t\t\t\tif (this.reloadCoordinator) await this.reloadCoordinator.reload(this.session);\n\t\t\t\t\t\telse await this.session.reload();\n\t\t\t\t\t\tthis.session.setSteeringMode(steeringMode);\n\t\t\t\t\t\tthis.session.setFollowUpMode(followUpMode);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tshutdownHandler: this.requestShutdown,\n\t\t\t\tonError: (err) => {\n\t\t\t\t\tthis.output({ type: \"extension_error\", extensionPath: err.extensionPath, event: err.event, error: err.error });\n\t\t\t\t},\n\t\t\t});\n\t\t\tthis.footerDataProvider.startGitWatcher();\n\t\t} catch (error) {\n\t\t\t// Leave no partially-initialized footer state behind if extension\n\t\t\t// binding fails; dispose the provider and rethrow.\n\t\t\tthis.footerDataProvider.dispose();\n\t\t\tthis.footerDataProvider = undefined;\n\t\t\tthrow error;\n\t\t}\n\n\t\tthis.unsubscribe = session.subscribe((event) => {\n\t\t\tthis.output(event);\n\t\t});\n\t\tthis.unsubscribeBackpressure = session.agent.subscribe(async () => {\n\t\t\tawait waitForRawStdoutBackpressure();\n\t\t});\n\t\tthis.reloadCoordinator?.publishCurrentState(session);\n\t}\n\n\tdisposeSubscriptions(): void {\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribeBackpressure?.();\n\t\tthis.footerDataProvider?.dispose();\n\t\tthis.unsubscribe = undefined;\n\t\tthis.unsubscribeBackpressure = undefined;\n\t\tthis.footerDataProvider = undefined;\n\t}\n}\n"]}
@@ -8,14 +8,15 @@ import type { AgentMessage, ThinkingLevel } from "@earendil-works/pi-agent-core"
8
8
  import type { AuthInfoLink, OAuthAuthInfo, OAuthDeviceCodeInfo, OAuthPrompt, OAuthSelectPrompt } from "@earendil-works/pi-ai";
9
9
  import type { Api, ImageContent, Model } from "@earendil-works/pi-ai/compat";
10
10
  import type { AgentSessionEvent, SessionStats } from "../../core/agent-session.ts";
11
- import type { AuthCredential, AuthStatus } from "../../core/auth-storage.ts";
11
+ import type { AuthStatus } from "../../core/provider-composer.ts";
12
+ import type { Credential } from "@earendil-works/pi-ai";
12
13
  import type { BashResult } from "../../core/bash-executor.ts";
13
14
  import type { VerbatimCompactionResult } from "../../core/compaction/index.ts";
14
15
  import type { SessionEntry, SessionTreeNode } from "../../core/session-manager.ts";
15
16
  import type { SourceInfo } from "../../core/source-info.ts";
16
17
  import type { ResourceOverlap } from "../../core/diagnostics.ts";
17
18
  import type { ModelFallbackReason } from "../../core/model-resolver-types.ts";
18
- import type { OAuthProviderMetadata } from "../../core/oauth-provider-bridge.ts";
19
+ import type { OAuthProviderMetadata } from "../../core/oauth-login.ts";
19
20
  export interface RpcModelCatalog {
20
21
  models: Model<Api>[];
21
22
  scopedModels: Array<{
@@ -38,7 +39,9 @@ export interface RpcModelRefreshResult extends RpcModelCatalog {
38
39
  export type RpcLoginProviderResult = (RpcModelCatalog & {
39
40
  provider: string;
40
41
  cancelled: false;
41
- credential: import("../../core/auth-storage.ts").ApiKeyCredential;
42
+ credential: Extract<Credential, {
43
+ type: "api_key";
44
+ }>;
42
45
  }) | {
43
46
  provider: string;
44
47
  cancelled: true;
@@ -98,7 +101,7 @@ export type RpcCommand = {
98
101
  id?: string;
99
102
  type: "save_provider_credential";
100
103
  provider: string;
101
- credential: AuthCredential;
104
+ credential: Credential;
102
105
  } | {
103
106
  id?: string;
104
107
  type: "cancel_login_provider";
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-types.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC9H,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK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;AAMlE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-types.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { AuthInfoLink, OAuthAuthInfo, OAuthDeviceCodeInfo, OAuthPrompt, OAuthSelectPrompt } from \"@earendil-works/pi-ai\";\nimport type { Api, ImageContent, Model } from \"@earendil-works/pi-ai/compat\";\nimport type { AgentSessionEvent, SessionStats } from \"../../core/agent-session.ts\";\nimport type { AuthCredential, AuthStatus } from \"../../core/auth-storage.ts\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { VerbatimCompactionResult } from \"../../core/compaction/index.ts\";\nimport type { SessionEntry, SessionTreeNode } from \"../../core/session-manager.ts\";\nimport type { SourceInfo } from \"../../core/source-info.ts\";\nimport type { ResourceOverlap } from \"../../core/diagnostics.ts\";\nimport type { ModelFallbackReason } from \"../../core/model-resolver-types.ts\";\nimport type { OAuthProviderMetadata } from \"../../core/oauth-provider-bridge.ts\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport interface RpcModelCatalog {\n\tmodels: Model<Api>[];\n\tscopedModels: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\tcustomAuthProviders: Array<{ id: string; name: string }>;\n\toauthProviders?: OAuthProviderMetadata[];\n}\n\nexport interface RpcModelRefreshResult extends RpcModelCatalog {\n\taborted: boolean;\n\terrors: Array<{ provider: string; message: string }>;\n}\nexport type RpcLoginProviderResult =\n\t| (RpcModelCatalog & {\n\t\t\tprovider: string;\n\t\t\tcancelled: false;\n\t\t\tcredential: import(\"../../core/auth-storage.ts\").ApiKeyCredential;\n\t })\n\t| { provider: string; cancelled: true };\n\nexport type RpcOAuthLoginProviderResult =\n\t| (RpcModelCatalog & { provider: string; cancelled: false })\n\t| { provider: string; cancelled: true };\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\"; direction?: \"forward\" | \"backward\" }\n\t| { id?: string; type: \"get_available_models\" }\n\t| { id?: string; type: \"login_provider\"; provider: string; authType?: \"api_key\" | \"oauth\"; loginId?: string }\n\t| { id?: string; type: \"save_provider_credential\"; provider: string; credential: AuthCredential }\n\t| { id?: string; type: \"cancel_login_provider\"; provider: string; loginId?: string }\n\t| { id?: string; type: \"logout_provider\"; provider: string }\n\t| { id?: string; type: \"refresh_models\"; timeoutMs?: number; force?: boolean; allowNetwork?: boolean }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\t| { id?: string; type: \"get_available_thinking_levels\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\" }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\t| { id?: string; type: \"abort_compaction\" }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\t| { id?: string; type: \"clear_queue\" }\n\t| { id?: string; type: \"pause_queued_messages\" }\n\t| { id?: string; type: \"resume_queued_messages\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"user_bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"abort_bash\"; requestId?: string }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"import_session\"; inputPath: string; cwdOverride?: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"clone\" }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_entries\"; since?: string }\n\t| { id?: string; type: \"get_tree\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\t| { id?: string; type: \"navigate_tree\"; targetId: string; options?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string } }\n\t| { id?: string; type: \"set_label\"; entryId: string; label?: string }\n\t| { id?: string; type: \"reload\" }\n\t| { id?: string; type: \"get_shortcuts\" }\n\t| { id?: string; type: \"invoke_shortcut\"; key: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands and their live argument completions\n\t| { id?: string; type: \"get_commands\" }\n\t| { id?: string; type: \"get_command_completions\"; commandName: string; argumentPrefix: string };\n// ============================================================================\n// RPC Argument Completion\n// ============================================================================\n\nexport interface RpcAutocompleteItem {\n\tvalue: string;\n\tlabel: string;\n\tdescription?: string;\n}\n\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** Whether the engine can evaluate argument completions for this command. */\n\thasArgumentCompletions?: boolean;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Source metadata for the owning resource */\n\tsourceInfo: SourceInfo;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<Api>;\n\tmodelFallbackMessage?: string;\n\tmodelFallbackReason?: ModelFallbackReason;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n\tqueuedMessagesPaused: boolean;\n\tresourceOverlaps?: ResourceOverlap[];\n}\n\nexport interface RpcLogoutProviderResult {\n\tprovider: string;\n\tauthStatus: AuthStatus;\n\tmodels: Model<Api>[];\n\tscopedModels?: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting (async - events follow)\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"follow_up\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<Api>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<Api>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcModelCatalog;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"refresh_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcModelRefreshResult;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"login_provider\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcLoginProviderResult | RpcOAuthLoginProviderResult;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"save_provider_credential\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcModelCatalog;\n\t }\n\t| { id?: string; type: \"response\"; command: \"cancel_login_provider\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"logout_provider\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcLogoutProviderResult;\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_thinking_levels\";\n\t\t\tsuccess: true;\n\t\t\tdata: { levels: ThinkingLevel[] };\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: VerbatimCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"clear_queue\"; success: true; data: { steering: string[]; followUp: string[] } }\n\t| { id?: string; type: \"response\"; command: \"pause_queued_messages\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"resume_queued_messages\"; success: true; data: { released: boolean } }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"user_bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"import_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"clone\"; success: true; data: { cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_entries\";\n\t\t\tsuccess: true;\n\t\t\tdata: { entries: SessionEntry[]; leafId: string | null };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_tree\";\n\t\t\tsuccess: true;\n\t\t\tdata: { tree: SessionTreeNode[]; leafId: string | null };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"navigate_tree\"; success: true; data: { cancelled: boolean; editorText?: string } }\n\t| { id?: string; type: \"response\"; command: \"set_label\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"reload\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"get_shortcuts\"; success: true; data: { shortcuts: Array<{ key: string; description?: string }> } }\n\t| { id?: string; type: \"response\"; command: \"invoke_shortcut\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_command_completions\";\n\t\t\tsuccess: true;\n\t\t\tdata: { completions: RpcAutocompleteItem[] | null };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// RPC Events (stdout)\n// ============================================================================\n\n/** Events streamed by RPC mode as session activity occurs. */\nexport type RpcEvent = AgentSessionEvent;\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\ntype RpcOAuthUIEnvelope = { type: \"extension_ui_request\"; id: string; provider: string; loginId: string };\n\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"input\"; title: string; placeholder?: string; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"notify\"; message: string; notifyType?: \"info\" | \"warning\" | \"error\" }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setStatus\"; statusKey: string; statusText: string | undefined }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setWidget\"; widgetKey: string; widgetLines: string[] | undefined; widgetPlacement?: \"aboveEditor\" | \"belowEditor\" }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string }\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_auth\"; info: OAuthAuthInfo })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_device_code\"; info: OAuthDeviceCodeInfo })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_progress\"; message: string })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_info\"; message: string; links: AuthInfoLink[] })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_prompt\"; prompt: OAuthPrompt })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_select\"; prompt: OAuthSelectPrompt })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_manual_code\" })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_manual_code_cancel\" });\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
1
+ {"version":3,"file":"rpc-types.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * RPC protocol types for headless operation.\n *\n * Commands are sent as JSON lines on stdin.\n * Responses and events are emitted as JSON lines on stdout.\n */\n\nimport type { AgentMessage, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type { AuthInfoLink, OAuthAuthInfo, OAuthDeviceCodeInfo, OAuthPrompt, OAuthSelectPrompt } from \"@earendil-works/pi-ai\";\nimport type { Api, ImageContent, Model } from \"@earendil-works/pi-ai/compat\";\nimport type { AgentSessionEvent, SessionStats } from \"../../core/agent-session.ts\";\nimport type { AuthStatus } from \"../../core/provider-composer.ts\";\nimport type { Credential } from \"@earendil-works/pi-ai\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { VerbatimCompactionResult } from \"../../core/compaction/index.ts\";\nimport type { SessionEntry, SessionTreeNode } from \"../../core/session-manager.ts\";\nimport type { SourceInfo } from \"../../core/source-info.ts\";\nimport type { ResourceOverlap } from \"../../core/diagnostics.ts\";\nimport type { ModelFallbackReason } from \"../../core/model-resolver-types.ts\";\nimport type { OAuthProviderMetadata } from \"../../core/oauth-login.ts\";\n\n// ============================================================================\n// RPC Commands (stdin)\n// ============================================================================\n\nexport interface RpcModelCatalog {\n\tmodels: Model<Api>[];\n\tscopedModels: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n\tcustomAuthProviders: Array<{ id: string; name: string }>;\n\toauthProviders?: OAuthProviderMetadata[];\n}\n\nexport interface RpcModelRefreshResult extends RpcModelCatalog {\n\taborted: boolean;\n\terrors: Array<{ provider: string; message: string }>;\n}\nexport type RpcLoginProviderResult =\n\t| (RpcModelCatalog & {\n\t\t\tprovider: string;\n\t\t\tcancelled: false;\n\t\t\tcredential: Extract<Credential, { type: \"api_key\" }>;\n\t })\n\t| { provider: string; cancelled: true };\n\nexport type RpcOAuthLoginProviderResult =\n\t| (RpcModelCatalog & { provider: string; cancelled: false })\n\t| { provider: string; cancelled: true };\n\nexport type RpcCommand =\n\t// Prompting\n\t| { id?: string; type: \"prompt\"; message: string; images?: ImageContent[]; streamingBehavior?: \"steer\" | \"followUp\" }\n\t| { id?: string; type: \"steer\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"follow_up\"; message: string; images?: ImageContent[] }\n\t| { id?: string; type: \"abort\" }\n\t| { id?: string; type: \"new_session\"; parentSession?: string }\n\n\t// State\n\t| { id?: string; type: \"get_state\" }\n\n\t// Model\n\t| { id?: string; type: \"set_model\"; provider: string; modelId: string }\n\t| { id?: string; type: \"cycle_model\"; direction?: \"forward\" | \"backward\" }\n\t| { id?: string; type: \"get_available_models\" }\n\t| { id?: string; type: \"login_provider\"; provider: string; authType?: \"api_key\" | \"oauth\"; loginId?: string }\n\t| { id?: string; type: \"save_provider_credential\"; provider: string; credential: Credential }\n\t| { id?: string; type: \"cancel_login_provider\"; provider: string; loginId?: string }\n\t| { id?: string; type: \"logout_provider\"; provider: string }\n\t| { id?: string; type: \"refresh_models\"; timeoutMs?: number; force?: boolean; allowNetwork?: boolean }\n\n\t// Thinking\n\t| { id?: string; type: \"set_thinking_level\"; level: ThinkingLevel }\n\t| { id?: string; type: \"cycle_thinking_level\" }\n\t| { id?: string; type: \"get_available_thinking_levels\" }\n\n\t// Queue modes\n\t| { id?: string; type: \"set_steering_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\t| { id?: string; type: \"set_follow_up_mode\"; mode: \"all\" | \"one-at-a-time\" }\n\n\t// Compaction\n\t| { id?: string; type: \"compact\" }\n\t| { id?: string; type: \"set_auto_compaction\"; enabled: boolean }\n\t| { id?: string; type: \"abort_compaction\" }\n\n\t// Retry\n\t| { id?: string; type: \"set_auto_retry\"; enabled: boolean }\n\t| { id?: string; type: \"abort_retry\" }\n\t| { id?: string; type: \"clear_queue\" }\n\t| { id?: string; type: \"pause_queued_messages\" }\n\t| { id?: string; type: \"resume_queued_messages\" }\n\n\t// Bash\n\t| { id?: string; type: \"bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"user_bash\"; command: string; excludeFromContext?: boolean }\n\t| { id?: string; type: \"abort_bash\"; requestId?: string }\n\n\t// Session\n\t| { id?: string; type: \"get_session_stats\" }\n\t| { id?: string; type: \"export_html\"; outputPath?: string }\n\t| { id?: string; type: \"switch_session\"; sessionPath: string }\n\t| { id?: string; type: \"import_session\"; inputPath: string; cwdOverride?: string }\n\t| { id?: string; type: \"fork\"; entryId: string }\n\t| { id?: string; type: \"clone\" }\n\t| { id?: string; type: \"get_fork_messages\" }\n\t| { id?: string; type: \"get_entries\"; since?: string }\n\t| { id?: string; type: \"get_tree\" }\n\t| { id?: string; type: \"get_last_assistant_text\" }\n\t| { id?: string; type: \"set_session_name\"; name: string }\n\t| { id?: string; type: \"navigate_tree\"; targetId: string; options?: { summarize?: boolean; customInstructions?: string; replaceInstructions?: boolean; label?: string } }\n\t| { id?: string; type: \"set_label\"; entryId: string; label?: string }\n\t| { id?: string; type: \"reload\" }\n\t| { id?: string; type: \"get_shortcuts\" }\n\t| { id?: string; type: \"invoke_shortcut\"; key: string }\n\n\t// Messages\n\t| { id?: string; type: \"get_messages\" }\n\n\t// Commands and their live argument completions\n\t| { id?: string; type: \"get_commands\" }\n\t| { id?: string; type: \"get_command_completions\"; commandName: string; argumentPrefix: string };\n// ============================================================================\n// RPC Argument Completion\n// ============================================================================\n\nexport interface RpcAutocompleteItem {\n\tvalue: string;\n\tlabel: string;\n\tdescription?: string;\n}\n\n// RPC Slash Command (for get_commands response)\n// ============================================================================\n\n/** A command available for invocation via prompt */\nexport interface RpcSlashCommand {\n\t/** Command name (without leading slash) */\n\tname: string;\n\t/** Human-readable description */\n\tdescription?: string;\n\t/** Whether the engine can evaluate argument completions for this command. */\n\thasArgumentCompletions?: boolean;\n\t/** What kind of command this is */\n\tsource: \"extension\" | \"prompt\" | \"skill\";\n\t/** Source metadata for the owning resource */\n\tsourceInfo: SourceInfo;\n}\n\n// ============================================================================\n// RPC State\n// ============================================================================\n\nexport interface RpcSessionState {\n\tmodel?: Model<Api>;\n\tmodelFallbackMessage?: string;\n\tmodelFallbackReason?: ModelFallbackReason;\n\tthinkingLevel: ThinkingLevel;\n\tisStreaming: boolean;\n\tisCompacting: boolean;\n\tsteeringMode: \"all\" | \"one-at-a-time\";\n\tfollowUpMode: \"all\" | \"one-at-a-time\";\n\tsessionFile?: string;\n\tsessionId: string;\n\tsessionName?: string;\n\tautoCompactionEnabled: boolean;\n\tmessageCount: number;\n\tpendingMessageCount: number;\n\tqueuedMessagesPaused: boolean;\n\tresourceOverlaps?: ResourceOverlap[];\n}\n\nexport interface RpcLogoutProviderResult {\n\tprovider: string;\n\tauthStatus: AuthStatus;\n\tmodels: Model<Api>[];\n\tscopedModels?: Array<{ model: Model<Api>; thinkingLevel?: ThinkingLevel }>;\n}\n\n// ============================================================================\n// RPC Responses (stdout)\n// ============================================================================\n\n// Success responses with data\nexport type RpcResponse =\n\t// Prompting (async - events follow)\n\t| { id?: string; type: \"response\"; command: \"prompt\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"steer\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"follow_up\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"new_session\"; success: true; data: { cancelled: boolean } }\n\n\t// State\n\t| { id?: string; type: \"response\"; command: \"get_state\"; success: true; data: RpcSessionState }\n\n\t// Model\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"set_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: Model<Api>;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_model\";\n\t\t\tsuccess: true;\n\t\t\tdata: { model: Model<Api>; thinkingLevel: ThinkingLevel; isScoped: boolean } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcModelCatalog;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"refresh_models\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcModelRefreshResult;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"login_provider\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcLoginProviderResult | RpcOAuthLoginProviderResult;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"save_provider_credential\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcModelCatalog;\n\t }\n\t| { id?: string; type: \"response\"; command: \"cancel_login_provider\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"logout_provider\";\n\t\t\tsuccess: true;\n\t\t\tdata: RpcLogoutProviderResult;\n\t }\n\n\t// Thinking\n\t| { id?: string; type: \"response\"; command: \"set_thinking_level\"; success: true }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"cycle_thinking_level\";\n\t\t\tsuccess: true;\n\t\t\tdata: { level: ThinkingLevel } | null;\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_available_thinking_levels\";\n\t\t\tsuccess: true;\n\t\t\tdata: { levels: ThinkingLevel[] };\n\t }\n\n\t// Queue modes\n\t| { id?: string; type: \"response\"; command: \"set_steering_mode\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"set_follow_up_mode\"; success: true }\n\n\t// Compaction\n\t| { id?: string; type: \"response\"; command: \"compact\"; success: true; data: VerbatimCompactionResult }\n\t| { id?: string; type: \"response\"; command: \"set_auto_compaction\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_compaction\"; success: true }\n\n\t// Retry\n\t| { id?: string; type: \"response\"; command: \"set_auto_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"abort_retry\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"clear_queue\"; success: true; data: { steering: string[]; followUp: string[] } }\n\t| { id?: string; type: \"response\"; command: \"pause_queued_messages\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"resume_queued_messages\"; success: true; data: { released: boolean } }\n\n\t// Bash\n\t| { id?: string; type: \"response\"; command: \"bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"user_bash\"; success: true; data: BashResult }\n\t| { id?: string; type: \"response\"; command: \"abort_bash\"; success: true }\n\n\t// Session\n\t| { id?: string; type: \"response\"; command: \"get_session_stats\"; success: true; data: SessionStats }\n\t| { id?: string; type: \"response\"; command: \"import_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"export_html\"; success: true; data: { path: string } }\n\t| { id?: string; type: \"response\"; command: \"switch_session\"; success: true; data: { cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"fork\"; success: true; data: { text: string; cancelled: boolean } }\n\t| { id?: string; type: \"response\"; command: \"clone\"; success: true; data: { cancelled: boolean } }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_fork_messages\";\n\t\t\tsuccess: true;\n\t\t\tdata: { messages: Array<{ entryId: string; text: string }> };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_entries\";\n\t\t\tsuccess: true;\n\t\t\tdata: { entries: SessionEntry[]; leafId: string | null };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_tree\";\n\t\t\tsuccess: true;\n\t\t\tdata: { tree: SessionTreeNode[]; leafId: string | null };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_last_assistant_text\";\n\t\t\tsuccess: true;\n\t\t\tdata: { text: string | null };\n\t }\n\t| { id?: string; type: \"response\"; command: \"set_session_name\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"navigate_tree\"; success: true; data: { cancelled: boolean; editorText?: string } }\n\t| { id?: string; type: \"response\"; command: \"set_label\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"reload\"; success: true }\n\t| { id?: string; type: \"response\"; command: \"get_shortcuts\"; success: true; data: { shortcuts: Array<{ key: string; description?: string }> } }\n\t| { id?: string; type: \"response\"; command: \"invoke_shortcut\"; success: true }\n\n\t// Messages\n\t| { id?: string; type: \"response\"; command: \"get_messages\"; success: true; data: { messages: AgentMessage[] } }\n\n\t// Commands\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_commands\";\n\t\t\tsuccess: true;\n\t\t\tdata: { commands: RpcSlashCommand[] };\n\t }\n\t| {\n\t\t\tid?: string;\n\t\t\ttype: \"response\";\n\t\t\tcommand: \"get_command_completions\";\n\t\t\tsuccess: true;\n\t\t\tdata: { completions: RpcAutocompleteItem[] | null };\n\t }\n\n\t// Error response (any command can fail)\n\t| { id?: string; type: \"response\"; command: string; success: false; error: string };\n\n// ============================================================================\n// RPC Events (stdout)\n// ============================================================================\n\n/** Events streamed by RPC mode as session activity occurs. */\nexport type RpcEvent = AgentSessionEvent;\n\n// ============================================================================\n// Extension UI Events (stdout)\n// ============================================================================\ntype RpcOAuthUIEnvelope = { type: \"extension_ui_request\"; id: string; provider: string; loginId: string };\n\nexport type RpcExtensionUIRequest =\n\t| { type: \"extension_ui_request\"; id: string; method: \"select\"; title: string; options: string[]; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"confirm\"; title: string; message: string; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"input\"; title: string; placeholder?: string; timeout?: number }\n\t| { type: \"extension_ui_request\"; id: string; method: \"editor\"; title: string; prefill?: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"notify\"; message: string; notifyType?: \"info\" | \"warning\" | \"error\" }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setStatus\"; statusKey: string; statusText: string | undefined }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setWidget\"; widgetKey: string; widgetLines: string[] | undefined; widgetPlacement?: \"aboveEditor\" | \"belowEditor\" }\n\t| { type: \"extension_ui_request\"; id: string; method: \"setTitle\"; title: string }\n\t| { type: \"extension_ui_request\"; id: string; method: \"set_editor_text\"; text: string }\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_auth\"; info: OAuthAuthInfo })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_device_code\"; info: OAuthDeviceCodeInfo })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_progress\"; message: string })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_info\"; message: string; links: AuthInfoLink[] })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_prompt\"; prompt: OAuthPrompt })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_select\"; prompt: OAuthSelectPrompt })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_manual_code\" })\n\t| (RpcOAuthUIEnvelope & { method: \"oauth_manual_code_cancel\" });\n\n// ============================================================================\n// Extension UI Commands (stdin)\n// ============================================================================\n\n/** Response to an extension UI request */\nexport type RpcExtensionUIResponse =\n\t| { type: \"extension_ui_response\"; id: string; value: string }\n\t| { type: \"extension_ui_response\"; id: string; confirmed: boolean }\n\t| { type: \"extension_ui_response\"; id: string; cancelled: true };\n\n// ============================================================================\n// Helper type for extracting command types\n// ============================================================================\n\nexport type RpcCommandType = RpcCommand[\"type\"];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"package-manager-cli.d.ts","sourceRoot":"","sources":["../src/package-manager-cli.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAKlE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AA4B7D,wBAAsB,oBAAoB,CACzC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,eAAe,CAAC;IAAC,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAA;CAAO,GACvG,OAAO,CAAC,IAAI,CAAC,CA4Cf;A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-8,7 +8,7 @@ import { AuthStorage } from "./core/auth-storage.js";
8
8
  import { DefaultPackageManager } from "./core/package-manager.js";
9
9
  import { resolveProjectTrusted } from "./core/project-trust.js";
10
10
  import { DefaultResourceLoader } from "./core/resource-loader.js";
11
- import { ModelRegistry } from "./core/model-registry.js";
11
+ import { ModelRuntime } from "./core/model-runtime.js";
12
12
  import { SettingsManager } from "./core/settings-manager.js";
13
13
  import { hasProjectTrustInputs, ProjectTrustStore } from "./core/trust-manager.js";
14
14
  import { spawnProcess } from "./utils/child-process.js";
@@ -53,9 +53,7 @@ export async function refreshModelCatalogs(agentDir, options = {}) {
53
53
  throw new Error("Model catalog refresh timed out.");
54
54
  const authPaths = [join(agentDir, "auth.json"), ...getAgentConfigPaths("auth.json")]
55
55
  .filter((path, index, paths) => paths.indexOf(path) === index);
56
- const modelPaths = [join(agentDir, "models.json"), ...getAgentConfigPaths("models.json")]
57
- .filter((path, index, paths) => paths.indexOf(path) === index);
58
- const modelRegistry = ModelRegistry.create(AuthStorage.create(authPaths), modelPaths);
56
+ const modelRuntime = await ModelRuntime.create({ credentials: AuthStorage.create(authPaths), modelsPath: join(agentDir, "models.json") });
59
57
  const extensionsResult = resourceLoader.getExtensions();
60
58
  if (extensionsResult.errors.length > 0) {
61
59
  const details = extensionsResult.errors.map(({ path, error }) => `${path}: ${error}`).join("; ");
@@ -63,11 +61,11 @@ export async function refreshModelCatalogs(agentDir, options = {}) {
63
61
  }
64
62
  for (const registration of extensionsResult.runtime.pendingProviderRegistrations) {
65
63
  if ("provider" in registration)
66
- modelRegistry.registerProvider(registration.provider);
64
+ modelRuntime.registerNativeProvider(registration.provider);
67
65
  else
68
- modelRegistry.registerProvider(registration.name, registration.config);
66
+ modelRuntime.registerProvider(registration.name, registration.config);
69
67
  }
70
- const refresh = modelRegistry.refresh({ allowNetwork: true, force: true, signal: controller.signal });
68
+ const refresh = modelRuntime.refresh({ allowNetwork: true, force: true, signal: controller.signal });
71
69
  const result = await Promise.race([refresh, aborted]);
72
70
  if (!result || result.aborted)
73
71
  throw new Error("Model catalog refresh timed out.");