@code-yeongyu/senpi 2026.7.14-3 → 2026.7.16-2

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 (361) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/README.md +6 -6
  3. package/dist/bun/cli.js +2 -0
  4. package/dist/bun/cli.js.map +1 -1
  5. package/dist/cli/args.js +1 -1
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/list-models.d.ts +2 -2
  8. package/dist/cli/list-models.d.ts.map +1 -1
  9. package/dist/cli/list-models.js +3 -3
  10. package/dist/cli/list-models.js.map +1 -1
  11. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  12. package/dist/core/agent-session-runtime.js +3 -0
  13. package/dist/core/agent-session-runtime.js.map +1 -1
  14. package/dist/core/agent-session-services.d.ts +4 -3
  15. package/dist/core/agent-session-services.d.ts.map +1 -1
  16. package/dist/core/agent-session-services.js +14 -5
  17. package/dist/core/agent-session-services.js.map +1 -1
  18. package/dist/core/agent-session.d.ts +8 -4
  19. package/dist/core/agent-session.d.ts.map +1 -1
  20. package/dist/core/agent-session.js +80 -29
  21. package/dist/core/agent-session.js.map +1 -1
  22. package/dist/core/auth-providers.js +1 -1
  23. package/dist/core/auth-providers.js.map +1 -1
  24. package/dist/core/auth-storage.d.ts +32 -87
  25. package/dist/core/auth-storage.d.ts.map +1 -1
  26. package/dist/core/auth-storage.js +158 -221
  27. package/dist/core/auth-storage.js.map +1 -1
  28. package/dist/core/cache-stats.d.ts +2 -2
  29. package/dist/core/cache-stats.d.ts.map +1 -1
  30. package/dist/core/cache-stats.js +1 -1
  31. package/dist/core/cache-stats.js.map +1 -1
  32. package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
  33. package/dist/core/dynamic-prompt/build.js +6 -1
  34. package/dist/core/dynamic-prompt/build.js.map +1 -1
  35. package/dist/core/extensions/builtin/bash-timeout/timeout.js +2 -2
  36. package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
  37. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +8 -8
  38. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  39. package/dist/core/extensions/loader.d.ts.map +1 -1
  40. package/dist/core/extensions/loader.js +8 -2
  41. package/dist/core/extensions/loader.js.map +1 -1
  42. package/dist/core/extensions/runner.d.ts +1 -0
  43. package/dist/core/extensions/runner.d.ts.map +1 -1
  44. package/dist/core/extensions/runner.js +3 -0
  45. package/dist/core/extensions/runner.js.map +1 -1
  46. package/dist/core/extensions/types.d.ts +15 -2
  47. package/dist/core/extensions/types.d.ts.map +1 -1
  48. package/dist/core/extensions/types.js.map +1 -1
  49. package/dist/core/model-config.d.ts +589 -0
  50. package/dist/core/model-config.d.ts.map +1 -0
  51. package/dist/core/model-config.js +288 -0
  52. package/dist/core/model-config.js.map +1 -0
  53. package/dist/core/model-registry.d.ts +17 -146
  54. package/dist/core/model-registry.d.ts.map +1 -1
  55. package/dist/core/model-registry.js +69 -958
  56. package/dist/core/model-registry.js.map +1 -1
  57. package/dist/core/model-resolver.d.ts +8 -5
  58. package/dist/core/model-resolver.d.ts.map +1 -1
  59. package/dist/core/model-resolver.js +18 -18
  60. package/dist/core/model-resolver.js.map +1 -1
  61. package/dist/core/model-runtime.d.ts +81 -0
  62. package/dist/core/model-runtime.d.ts.map +1 -0
  63. package/dist/core/model-runtime.js +442 -0
  64. package/dist/core/model-runtime.js.map +1 -0
  65. package/dist/core/models-store.d.ts +17 -0
  66. package/dist/core/models-store.d.ts.map +1 -0
  67. package/dist/core/models-store.js +46 -0
  68. package/dist/core/models-store.js.map +1 -0
  69. package/dist/core/provider-composer.d.ts +64 -0
  70. package/dist/core/provider-composer.d.ts.map +1 -0
  71. package/dist/core/provider-composer.js +406 -0
  72. package/dist/core/provider-composer.js.map +1 -0
  73. package/dist/core/provider-display-names.js +1 -1
  74. package/dist/core/provider-display-names.js.map +1 -1
  75. package/dist/core/radius.d.ts +0 -19
  76. package/dist/core/radius.d.ts.map +1 -1
  77. package/dist/core/radius.js +0 -28
  78. package/dist/core/radius.js.map +1 -1
  79. package/dist/core/remote-catalog-provider.d.ts +5 -0
  80. package/dist/core/remote-catalog-provider.d.ts.map +1 -0
  81. package/dist/core/remote-catalog-provider.js +83 -0
  82. package/dist/core/remote-catalog-provider.js.map +1 -0
  83. package/dist/core/runtime-credentials.d.ts +15 -0
  84. package/dist/core/runtime-credentials.d.ts.map +1 -0
  85. package/dist/core/runtime-credentials.js +35 -0
  86. package/dist/core/runtime-credentials.js.map +1 -0
  87. package/dist/core/sdk.d.ts +11 -20
  88. package/dist/core/sdk.d.ts.map +1 -1
  89. package/dist/core/sdk.js +61 -89
  90. package/dist/core/sdk.js.map +1 -1
  91. package/dist/core/skills.js +1 -1
  92. package/dist/core/skills.js.map +1 -1
  93. package/dist/index.d.ts +2 -1
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +2 -2
  96. package/dist/index.js.map +1 -1
  97. package/dist/main.d.ts.map +1 -1
  98. package/dist/main.js +10 -13
  99. package/dist/main.js.map +1 -1
  100. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  101. package/dist/modes/interactive/components/assistant-message.js +22 -10
  102. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  103. package/dist/modes/interactive/components/footer.js +1 -1
  104. package/dist/modes/interactive/components/footer.js.map +1 -1
  105. package/dist/modes/interactive/components/login-dialog.d.ts +4 -8
  106. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  107. package/dist/modes/interactive/components/login-dialog.js +14 -12
  108. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  109. package/dist/modes/interactive/components/model-selector.d.ts +13 -4
  110. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  111. package/dist/modes/interactive/components/model-selector.js +84 -41
  112. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  113. package/dist/modes/interactive/components/oauth-selector.d.ts +4 -4
  114. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  115. package/dist/modes/interactive/components/oauth-selector.js +14 -25
  116. package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
  117. package/dist/modes/interactive/interactive-mode.d.ts +5 -1
  118. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  119. package/dist/modes/interactive/interactive-mode.js +154 -128
  120. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  121. package/dist/package-manager-cli.d.ts.map +1 -1
  122. package/dist/package-manager-cli.js +70 -8
  123. package/dist/package-manager-cli.js.map +1 -1
  124. package/docs/custom-provider.md +6 -11
  125. package/docs/extensions.md +78 -555
  126. package/docs/models.md +2 -0
  127. package/docs/packages.md +1 -0
  128. package/docs/providers.md +23 -11
  129. package/docs/sdk.md +79 -105
  130. package/docs/usage.md +1 -0
  131. package/examples/extensions/README.md +1 -0
  132. package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
  133. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  134. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  135. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  136. package/examples/extensions/gondolin/package-lock.json +2 -2
  137. package/examples/extensions/gondolin/package.json +1 -1
  138. package/examples/extensions/kimi-deferred-tools.ts +61 -0
  139. package/examples/extensions/sandbox/package-lock.json +2 -2
  140. package/examples/extensions/sandbox/package.json +1 -1
  141. package/examples/extensions/with-deps/package-lock.json +2 -2
  142. package/examples/extensions/with-deps/package.json +1 -1
  143. package/examples/sdk/02-custom-model.ts +5 -8
  144. package/examples/sdk/09-api-keys-and-oauth.ts +13 -31
  145. package/examples/sdk/12-full-control.ts +8 -13
  146. package/examples/sdk/README.md +14 -18
  147. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +16 -0
  148. package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
  149. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/local-module-loader.ts +2 -2
  150. package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/rewrite-imports.ts +4 -4
  151. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +32 -32
  152. package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
  153. package/node_modules/@earendil-works/pi-ai/README.md +77 -23
  154. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts.map +1 -1
  155. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +9 -10
  156. package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js.map +1 -1
  157. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
  158. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +3 -2
  159. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  160. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +2 -1
  161. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  162. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +42 -2
  163. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  164. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +2 -0
  165. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  166. package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.d.ts +2 -1
  167. package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.d.ts.map +1 -1
  168. package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js +3 -0
  169. package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js.map +1 -1
  170. package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.d.ts +1 -0
  171. package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.d.ts.map +1 -1
  172. package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js +4 -3
  173. package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js.map +1 -1
  174. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts +9 -0
  175. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -0
  176. package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/anthropic.js +51 -116
  177. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -0
  178. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.d.ts.map +1 -0
  179. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.js.map +1 -0
  180. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.d.ts +6 -0
  181. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.d.ts.map +1 -0
  182. package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/github-copilot.js +18 -77
  183. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js.map +1 -0
  184. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts +23 -0
  185. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts.map +1 -0
  186. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js +49 -0
  187. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js.map +1 -0
  188. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/oauth-page.d.ts.map +1 -0
  189. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/oauth-page.js.map +1 -0
  190. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts +9 -0
  191. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts.map +1 -0
  192. package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/openai-codex.js +61 -155
  193. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -0
  194. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/pkce.d.ts.map +1 -0
  195. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/pkce.js.map +1 -0
  196. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts +16 -0
  197. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts.map +1 -0
  198. package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/radius.js +31 -128
  199. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js.map +1 -0
  200. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/xai.d.ts +6 -0
  201. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/xai.d.ts.map +1 -0
  202. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/xai.js +189 -0
  203. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/xai.js.map +1 -0
  204. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -4
  205. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  206. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +9 -7
  207. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  208. package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +49 -10
  209. package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -1
  210. package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -1
  211. package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.d.ts +3 -0
  212. package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.d.ts.map +1 -0
  213. package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js +17 -0
  214. package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js.map +1 -0
  215. package/node_modules/@earendil-works/pi-ai/dist/cli.js +58 -76
  216. package/node_modules/@earendil-works/pi-ai/dist/cli.js.map +1 -1
  217. package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts +42 -0
  218. package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts.map +1 -0
  219. package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.js +2 -0
  220. package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.js.map +1 -0
  221. package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
  222. package/node_modules/@earendil-works/pi-ai/dist/compat.js +46 -22
  223. package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
  224. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -1
  225. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  226. package/node_modules/@earendil-works/pi-ai/dist/images-models.d.ts +4 -2
  227. package/node_modules/@earendil-works/pi-ai/dist/images-models.d.ts.map +1 -1
  228. package/node_modules/@earendil-works/pi-ai/dist/images-models.js +5 -4
  229. package/node_modules/@earendil-works/pi-ai/dist/images-models.js.map +1 -1
  230. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -1
  231. package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
  232. package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
  233. package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
  234. package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts +25 -0
  235. package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts.map +1 -0
  236. package/node_modules/@earendil-works/pi-ai/dist/models-store.js +16 -0
  237. package/node_modules/@earendil-works/pi-ai/dist/models-store.js.map +1 -0
  238. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +69 -30
  239. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  240. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +270 -114
  241. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  242. package/node_modules/@earendil-works/pi-ai/dist/models.js +217 -31
  243. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  244. package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts +2 -1
  245. package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts.map +1 -1
  246. package/node_modules/@earendil-works/pi-ai/dist/oauth.js +1 -1
  247. package/node_modules/@earendil-works/pi-ai/dist/oauth.js.map +1 -1
  248. package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts +2 -1
  249. package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
  250. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +3 -0
  251. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
  252. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
  253. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +51 -10
  254. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
  255. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
  256. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +1 -1
  257. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
  258. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -1
  259. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +4 -3
  260. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -1
  261. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.d.ts.map +1 -1
  262. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js +13 -20
  263. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js.map +1 -1
  264. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-stream.d.ts +8 -0
  265. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-stream.d.ts.map +1 -0
  266. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-stream.js +21 -0
  267. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-stream.js.map +1 -0
  268. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.d.ts.map +1 -1
  269. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.js +2 -1
  270. package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.js.map +1 -1
  271. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.d.ts.map +1 -1
  272. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.js +11 -1
  273. package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.js.map +1 -1
  274. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts.map +1 -1
  275. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +56 -5
  276. package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -1
  277. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts +66 -0
  278. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts.map +1 -1
  279. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js +42 -0
  280. package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js.map +1 -1
  281. package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.d.ts +36 -0
  282. package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.d.ts.map +1 -1
  283. package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js +19 -0
  284. package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js.map +1 -1
  285. package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.d.ts +36 -0
  286. package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.d.ts.map +1 -1
  287. package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js +19 -0
  288. package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js.map +1 -1
  289. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.d.ts.map +1 -1
  290. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js +1 -1
  291. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js.map +1 -1
  292. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +42 -0
  293. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts.map +1 -1
  294. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +178 -142
  295. package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -1
  296. package/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.d.ts +26 -0
  297. package/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.d.ts.map +1 -0
  298. package/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.js +59 -0
  299. package/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.js.map +1 -0
  300. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts +9 -0
  301. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts.map +1 -0
  302. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js +54 -0
  303. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js.map +1 -0
  304. package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts +84 -0
  305. package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -1
  306. package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +72 -0
  307. package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js.map +1 -1
  308. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts +1 -1
  309. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts.map +1 -1
  310. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js +15 -3
  311. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js.map +1 -1
  312. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts +6 -114
  313. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts.map +1 -1
  314. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js +3 -92
  315. package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js.map +1 -1
  316. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +2 -0
  317. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  318. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  319. package/node_modules/@earendil-works/pi-ai/package.json +6 -1
  320. package/node_modules/@earendil-works/pi-pty/package.json +1 -1
  321. package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
  322. package/node_modules/@earendil-works/pi-tui/dist/utils.js +22 -4
  323. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  324. package/node_modules/@earendil-works/pi-tui/package.json +1 -1
  325. package/package.json +6 -6
  326. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts +0 -27
  327. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts.map +0 -1
  328. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js.map +0 -1
  329. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts.map +0 -1
  330. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js.map +0 -1
  331. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts +0 -32
  332. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +0 -1
  333. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +0 -1
  334. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts +0 -59
  335. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts.map +0 -1
  336. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +0 -131
  337. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js.map +0 -1
  338. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.d.ts +0 -5
  339. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.d.ts.map +0 -1
  340. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.js +0 -22
  341. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.js.map +0 -1
  342. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.d.ts.map +0 -1
  343. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.js.map +0 -1
  344. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts +0 -45
  345. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +0 -1
  346. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +0 -1
  347. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.d.ts.map +0 -1
  348. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.js.map +0 -1
  349. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/radius.d.ts +0 -39
  350. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/radius.d.ts.map +0 -1
  351. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/radius.js.map +0 -1
  352. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts +0 -64
  353. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts.map +0 -1
  354. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.js +0 -2
  355. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.js.map +0 -1
  356. /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/device-code.d.ts +0 -0
  357. /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/device-code.js +0 -0
  358. /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/oauth-page.d.ts +0 -0
  359. /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/oauth-page.js +0 -0
  360. /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/pkce.d.ts +0 -0
  361. /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/pkce.js +0 -0
@@ -46,7 +46,7 @@ import {
46
46
  } from "@earendil-works/pi-ai";
47
47
 
48
48
  // =============================================================================
49
- // OAuth Implementation (copied from packages/ai/src/utils/oauth/anthropic.ts)
49
+ // OAuth implementation adapted for the legacy extension compatibility interface.
50
50
  // =============================================================================
51
51
 
52
52
  const decode = (s: string) => atob(s);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.80.7",
3
+ "version": "0.80.9",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.80.7",
9
+ "version": "0.80.9",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.80.7",
4
+ "version": "0.80.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.80.7",
4
+ "version": "0.80.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
- "version": "0.80.7",
3
+ "version": "0.80.9",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-gondolin",
9
- "version": "0.80.7",
9
+ "version": "0.80.9",
10
10
  "dependencies": {
11
11
  "@earendil-works/gondolin": "0.12.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-gondolin",
3
3
  "private": true,
4
- "version": "0.80.7",
4
+ "version": "0.80.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Minimal Kimi deferred-tool loading demo.
3
+ *
4
+ * pi -e ./kimi-deferred-tools.ts
5
+ * example prompt: Use the available tools to calculate 100 + 500. Do not calculate it yourself.
6
+ */
7
+
8
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
9
+ import { Type } from "typebox";
10
+
11
+ function calculate(_expr: string): string {
12
+ return "42";
13
+ }
14
+
15
+ export default function (pi: ExtensionAPI): void {
16
+ pi.registerTool({
17
+ name: "Calculator",
18
+ label: "Calculator",
19
+ description: "Evaluate a simple arithmetic expression.",
20
+ parameters: Type.Object({
21
+ expr: Type.String({ description: "An expression such as 100 + 500" }),
22
+ }),
23
+ async execute(_toolCallId, params) {
24
+ return {
25
+ content: [{ type: "text", text: calculate(params.expr) }],
26
+ details: {},
27
+ };
28
+ },
29
+ });
30
+
31
+ pi.registerTool({
32
+ name: "tool_search",
33
+ label: "Tool Search",
34
+ description: "Find and activate tools for a capability.",
35
+ promptSnippet: "Search for additional tools when the active tools cannot perform the task",
36
+ parameters: Type.Object({
37
+ query: Type.String({ description: "Capability to search for" }),
38
+ }),
39
+ async execute(_toolCallId, params) {
40
+ if (!params.query.toLowerCase().includes("calc")) {
41
+ return {
42
+ content: [{ type: "text", text: "The relevant tools do not exist." }],
43
+ details: { matches: [], added: [] },
44
+ };
45
+ }
46
+
47
+ const active = pi.getActiveTools();
48
+ const added = active.includes("Calculator") ? [] : ["Calculator"];
49
+ if (added.length > 0) pi.setActiveTools([...active, ...added]);
50
+
51
+ return {
52
+ content: [{ type: "text", text: "Success. Found 1 matching tool(s)" }],
53
+ details: { matches: ["Calculator"], added },
54
+ };
55
+ },
56
+ });
57
+
58
+ pi.on("session_start", () => {
59
+ pi.setActiveTools(["tool_search"]);
60
+ });
61
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
- "version": "1.10.7",
3
+ "version": "1.10.9",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "1.10.7",
9
+ "version": "1.10.9",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
3
  "private": true,
4
- "version": "1.10.7",
4
+ "version": "1.10.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.80.7",
3
+ "version": "0.80.9",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.80.7",
9
+ "version": "0.80.9",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.80.7",
4
+ "version": "0.80.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -5,11 +5,9 @@
5
5
  */
6
6
 
7
7
  import { getModel } from "@earendil-works/pi-ai/compat";
8
- import { AuthStorage, createAgentSession, ModelRegistry } from "@earendil-works/pi-coding-agent";
8
+ import { createAgentSession, ModelRuntime } from "@earendil-works/pi-coding-agent";
9
9
 
10
- // Set up auth storage and model registry
11
- const authStorage = AuthStorage.create();
12
- const modelRegistry = ModelRegistry.create(authStorage);
10
+ const modelRuntime = await ModelRuntime.create();
13
11
 
14
12
  // Option 1: Find a specific built-in model by provider/id
15
13
  const opus = getModel("anthropic", "claude-opus-4-5");
@@ -18,13 +16,13 @@ if (opus) {
18
16
  }
19
17
 
20
18
  // Option 2: Find model via registry (includes custom models from models.json)
21
- const customModel = modelRegistry.find("my-provider", "my-model");
19
+ const customModel = modelRuntime.getModel("my-provider", "my-model");
22
20
  if (customModel) {
23
21
  console.log(`Found custom model: ${customModel.provider}/${customModel.id}`);
24
22
  }
25
23
 
26
24
  // Option 3: Pick from available models (have valid API keys)
27
- const available = await modelRegistry.getAvailable();
25
+ const available = await modelRuntime.getAvailable();
28
26
  console.log(
29
27
  "Available models:",
30
28
  available.map((m) => `${m.provider}/${m.id}`),
@@ -34,8 +32,7 @@ if (available.length > 0) {
34
32
  const { session } = await createAgentSession({
35
33
  model: available[0],
36
34
  thinkingLevel: "medium", // off, low, medium, high
37
- authStorage,
38
- modelRegistry,
35
+ modelRuntime,
39
36
  });
40
37
 
41
38
  try {
@@ -1,52 +1,34 @@
1
1
  /**
2
2
  * API Keys and OAuth
3
3
  *
4
- * Configure API key resolution via AuthStorage and ModelRegistry.
4
+ * Configure provider auth through ModelRuntime.
5
5
  */
6
6
 
7
- import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "@code-yeongyu/senpi";
8
-
9
- // Default: AuthStorage uses ~/.senpi/agent/auth.json
10
- // ModelRegistry loads built-in + custom models from ~/.senpi/agent/models.json
11
- const authStorage = AuthStorage.create();
12
- const modelRegistry = ModelRegistry.create(authStorage);
7
+ import { createAgentSession, ModelRuntime, SessionManager } from "@earendil-works/pi-coding-agent";
13
8
 
9
+ const modelRuntime = await ModelRuntime.create();
14
10
  const { session: defaultAuthSession } = await createAgentSession({
15
11
  sessionManager: SessionManager.inMemory(),
16
- authStorage,
17
- modelRegistry,
12
+ modelRuntime,
18
13
  });
19
- console.log("Session with default auth storage and model registry");
14
+ console.log("Session with default model runtime");
20
15
  defaultAuthSession.dispose();
21
16
 
22
- // Custom auth storage location
23
- const customAuthStorage = AuthStorage.create("/tmp/my-app/auth.json");
24
- const customModelRegistry = ModelRegistry.create(customAuthStorage, "/tmp/my-app/models.json");
25
-
17
+ const customRuntime = await ModelRuntime.create({
18
+ authPath: "/tmp/my-app/auth.json",
19
+ modelsPath: "/tmp/my-app/models.json",
20
+ });
26
21
  const { session: customAuthSession } = await createAgentSession({
27
22
  sessionManager: SessionManager.inMemory(),
28
- authStorage: customAuthStorage,
29
- modelRegistry: customModelRegistry,
23
+ modelRuntime: customRuntime,
30
24
  });
31
- console.log("Session with custom auth storage location");
25
+ console.log("Session with custom auth and models locations");
32
26
  customAuthSession.dispose();
33
27
 
34
- // Runtime API key override (not persisted to disk)
35
- authStorage.setRuntimeApiKey("anthropic", "sk-my-temp-key");
28
+ modelRuntime.setRuntimeApiKey("anthropic", "sk-my-temp-key");
36
29
  const { session: runtimeKeySession } = await createAgentSession({
37
30
  sessionManager: SessionManager.inMemory(),
38
- authStorage,
39
- modelRegistry,
31
+ modelRuntime,
40
32
  });
41
33
  console.log("Session with runtime API key override");
42
34
  runtimeKeySession.dispose();
43
-
44
- // No models.json - only built-in models
45
- const simpleRegistry = ModelRegistry.inMemory(authStorage);
46
- const { session: builtInModelsSession } = await createAgentSession({
47
- sessionManager: SessionManager.inMemory(),
48
- authStorage,
49
- modelRegistry: simpleRegistry,
50
- });
51
- console.log("Session with only built-in models");
52
- builtInModelsSession.dispose();
@@ -6,27 +6,23 @@
6
6
 
7
7
  import { getModel } from "@earendil-works/pi-ai/compat";
8
8
  import {
9
- AuthStorage,
10
9
  createAgentSession,
11
10
  createExtensionRuntime,
12
- ModelRegistry,
11
+ ModelRuntime,
13
12
  type ResourceLoader,
14
13
  SessionManager,
15
14
  SettingsManager,
16
15
  } from "@earendil-works/pi-coding-agent";
17
16
 
18
- // Custom auth storage location
19
- const authStorage = AuthStorage.create("/tmp/my-agent/auth.json");
20
-
21
- // Runtime API key override (not persisted)
17
+ const modelRuntime = await ModelRuntime.create({
18
+ authPath: "/tmp/my-agent/auth.json",
19
+ modelsPath: "/tmp/my-agent/models.json",
20
+ });
22
21
  if (process.env.MY_ANTHROPIC_KEY) {
23
- authStorage.setRuntimeApiKey("anthropic", process.env.MY_ANTHROPIC_KEY);
22
+ modelRuntime.setRuntimeApiKey("anthropic", process.env.MY_ANTHROPIC_KEY);
24
23
  }
25
24
 
26
- // Model registry with no custom models.json
27
- const modelRegistry = ModelRegistry.inMemory(authStorage);
28
-
29
- const model = getModel("anthropic", "claude-opus-4-5");
25
+ const model = getModel("anthropic", "claude-sonnet-4-5");
30
26
  if (!model) throw new Error("Model not found");
31
27
 
32
28
  // In-memory settings with overrides
@@ -55,8 +51,7 @@ const { session } = await createAgentSession({
55
51
  agentDir: "/tmp/my-agent",
56
52
  model,
57
53
  thinkingLevel: "off",
58
- authStorage,
59
- modelRegistry,
54
+ modelRuntime,
60
55
  resourceLoader,
61
56
  tools: ["read", "bash"],
62
57
  sessionManager: SessionManager.inMemory(cwd),
@@ -34,46 +34,44 @@ npx tsx examples/sdk/01-minimal.ts
34
34
  ```typescript
35
35
  import { getModel } from "@earendil-works/pi-ai";
36
36
  import {
37
- AuthStorage,
38
37
  createAgentSession,
39
38
  DefaultResourceLoader,
40
- ModelRegistry,
39
+ ModelRuntime,
41
40
  SessionManager,
42
41
  SettingsManager,
43
42
  } from "@code-yeongyu/senpi";
44
43
 
45
- // Auth and models setup
46
- const authStorage = AuthStorage.create();
47
- const modelRegistry = ModelRegistry.create(authStorage);
44
+ const modelRuntime = await ModelRuntime.create();
48
45
 
49
46
  // Minimal
50
- const { session } = await createAgentSession({ authStorage, modelRegistry });
47
+ const { session } = await createAgentSession({ modelRuntime });
51
48
 
52
49
  // Custom model
53
50
  const model = getModel("anthropic", "claude-opus-4-5");
54
- const { session } = await createAgentSession({ model, thinkingLevel: "high", authStorage, modelRegistry });
51
+ const { session } = await createAgentSession({ model, thinkingLevel: "high", modelRuntime });
55
52
 
56
53
  // Modify prompt
57
54
  const loader = new DefaultResourceLoader({
58
55
  systemPromptOverride: (base) => `${base}\n\nBe concise.`,
59
56
  });
60
57
  await loader.reload();
61
- const { session } = await createAgentSession({ resourceLoader: loader, authStorage, modelRegistry });
58
+ const { session } = await createAgentSession({ resourceLoader: loader, modelRuntime });
62
59
 
63
60
  // Read-only
64
- const { session } = await createAgentSession({ tools: ["read", "grep", "find", "ls"], authStorage, modelRegistry });
61
+ const { session } = await createAgentSession({ tools: ["read", "grep", "find", "ls"], modelRuntime });
65
62
 
66
63
  // In-memory
67
64
  const { session } = await createAgentSession({
68
65
  sessionManager: SessionManager.inMemory(),
69
- authStorage,
70
- modelRegistry,
66
+ modelRuntime,
71
67
  });
72
68
 
73
69
  // Full control
74
- const customAuth = AuthStorage.create("/my/app/auth.json");
75
- customAuth.setRuntimeApiKey("anthropic", process.env.MY_KEY!);
76
- const customRegistry = ModelRegistry.create(customAuth);
70
+ const customRuntime = await ModelRuntime.create({
71
+ authPath: "/my/app/auth.json",
72
+ modelsPath: "/my/app/models.json",
73
+ });
74
+ customRuntime.setRuntimeApiKey("anthropic", process.env.MY_KEY!);
77
75
 
78
76
  const resourceLoader = new DefaultResourceLoader({
79
77
  systemPromptOverride: () => "You are helpful.",
@@ -86,8 +84,7 @@ await resourceLoader.reload();
86
84
 
87
85
  const { session } = await createAgentSession({
88
86
  model,
89
- authStorage: customAuth,
90
- modelRegistry: customRegistry,
87
+ modelRuntime: customRuntime,
91
88
  resourceLoader,
92
89
  tools: ["read", "bash", "my_tool"],
93
90
  customTools: [myTool],
@@ -108,8 +105,7 @@ await session.prompt("Hello");
108
105
 
109
106
  | Option | Default | Description |
110
107
  |--------|---------|-------------|
111
- | `authStorage` | `AuthStorage.create()` | Credential storage |
112
- | `modelRegistry` | `ModelRegistry.create(authStorage)` | Model registry |
108
+ | `modelRuntime` | Runtime using `agentDir/auth.json` and `models.json` | Canonical model and authentication runtime |
113
109
  | `cwd` | `process.cwd()` | Working directory |
114
110
  | `agentDir` | `~/.senpi/agent` | Config directory |
115
111
  | `model` | From settings/first available | Model to use |
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## [2026.7.16-2] - 2026-07-16
4
+
5
+ ### Added
6
+
7
+ ### Changed
8
+
9
+ ### Fixed
10
+
11
+ ## [2026.7.16] - 2026-07-16
12
+
13
+ ### Added
14
+
15
+ ### Changed
16
+
17
+ ### Fixed
18
+
3
19
  ## [2026.7.14-3] - 2026-07-14
4
20
 
5
21
  ### Added
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/senpi-codemode",
3
- "version": "2026.7.14-3",
3
+ "version": "2026.7.16-2",
4
4
  "description": "Source-only senpi extension package for codemode evaluation tools",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -30,14 +30,14 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@babel/parser": "7.29.7",
33
- "@earendil-works/pi-ai": "^2026.7.14-3",
33
+ "@earendil-works/pi-ai": "^2026.7.16-2",
34
34
  "typebox": "1.1.38"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@code-yeongyu/senpi": "*"
38
38
  },
39
39
  "devDependencies": {
40
- "@code-yeongyu/senpi": "2026.7.14-3"
40
+ "@code-yeongyu/senpi": "2026.7.16-2"
41
41
  },
42
42
  "keywords": [
43
43
  "senpi",
@@ -47,8 +47,8 @@ function runtimeContext(options: LocalModuleLoaderOptions): RuntimeModuleContext
47
47
  for (const [scheme, root] of Object.entries(options.localRoots ?? {})) {
48
48
  roots[scheme.toLowerCase()] = directoryUrl(root);
49
49
  }
50
- if (options.artifactsDir && roots["local"] === undefined) {
51
- roots["local"] = directoryUrl(join(options.artifactsDir, "local"));
50
+ if (options.artifactsDir && roots.local === undefined) {
51
+ roots.local = directoryUrl(join(options.artifactsDir, "local"));
52
52
  }
53
53
  return {
54
54
  cwdUrl: directoryUrl(options.cwd),
@@ -31,9 +31,9 @@ function isRecord(value: unknown): value is Readonly<Record<string, unknown>> {
31
31
 
32
32
  function nodeFrom(value: unknown): AstNode | undefined {
33
33
  if (!isRecord(value)) return undefined;
34
- const type = value["type"];
35
- const start = value["start"];
36
- const end = value["end"];
34
+ const type = value.type;
35
+ const start = value.start;
36
+ const end = value.end;
37
37
  if (typeof type !== "string" || typeof start !== "number" || typeof end !== "number") return undefined;
38
38
  return { type, start, end, value };
39
39
  }
@@ -131,7 +131,7 @@ function rewriteImportDeclaration(node: ImportDeclaration): string {
131
131
 
132
132
  function dynamicImportEdit(node: AstNode): TextEdit | undefined {
133
133
  if (node.type !== "CallExpression") return undefined;
134
- const callee = nodeFrom(node.value["callee"]);
134
+ const callee = nodeFrom(node.value.callee);
135
135
  if (callee?.type !== "Import") return undefined;
136
136
  return { start: callee.start, end: callee.end, text: DYNAMIC_IMPORT_CALLEE };
137
137
  }
@@ -330,40 +330,40 @@ function statusIcon(op: string): string {
330
330
  function formatStatusEvent(event: EvalStatusEvent, theme: Theme | undefined): string {
331
331
  const op = event.op;
332
332
  const icon = style(theme, "muted", statusIcon(op));
333
- const error = eventString(event["error"]);
333
+ const error = eventString(event.error);
334
334
  if (error !== undefined) return `${icon} ${style(theme, "warning", op)}: ${style(theme, "dim", error)}`;
335
335
  const parts: string[] = [];
336
336
  switch (op) {
337
337
  case "read": {
338
- parts.push(`${eventNumber(event["chars"] ?? event["bytes"])} chars`);
339
- const path = eventString(event["path"]);
338
+ parts.push(`${eventNumber(event.chars ?? event.bytes)} chars`);
339
+ const path = eventString(event.path);
340
340
  if (path !== undefined) parts.push(`from ${path}`);
341
341
  break;
342
342
  }
343
343
  case "write": {
344
- parts.push(`${eventNumber(event["chars"] ?? event["bytes"])} chars`);
345
- const path = eventString(event["path"]);
344
+ parts.push(`${eventNumber(event.chars ?? event.bytes)} chars`);
345
+ const path = eventString(event.path);
346
346
  if (path !== undefined) parts.push(`to ${path}`);
347
347
  break;
348
348
  }
349
349
  case "cat":
350
- parts.push(plural(eventNumber(event["files"]), "file", "files"));
351
- parts.push(`${eventNumber(event["chars"])} chars`);
350
+ parts.push(plural(eventNumber(event.files), "file", "files"));
351
+ parts.push(`${eventNumber(event.chars)} chars`);
352
352
  break;
353
353
  case "ls":
354
- parts.push(plural(eventNumber(event["count"]), "entry", "entries"));
354
+ parts.push(plural(eventNumber(event.count), "entry", "entries"));
355
355
  break;
356
356
  case "env": {
357
- const action = eventString(event["action"]);
358
- const key = eventString(event["key"]);
359
- const value = eventString(event["value"]) ?? "";
357
+ const action = eventString(event.action);
358
+ const key = eventString(event.key);
359
+ const value = eventString(event.value) ?? "";
360
360
  if (action === "set" && key !== undefined) parts.push(`set ${key}=${value.slice(0, 30)}`);
361
361
  else if (action === "get" && key !== undefined) parts.push(`${key}=${value.slice(0, 30)}`);
362
- else parts.push(plural(eventNumber(event["count"]), "variable", "variables"));
362
+ else parts.push(plural(eventNumber(event.count), "variable", "variables"));
363
363
  break;
364
364
  }
365
365
  case "git_status": {
366
- if (event["clean"] === true) parts.push("clean");
366
+ if (event.clean === true) parts.push("clean");
367
367
  else {
368
368
  const changes: string[] = [];
369
369
  for (const key of ["staged", "modified", "untracked"] as const) {
@@ -372,41 +372,41 @@ function formatStatusEvent(event: EvalStatusEvent, theme: Theme | undefined): st
372
372
  }
373
373
  parts.push(changes.join(", ") || "unknown");
374
374
  }
375
- const branch = eventString(event["branch"]);
375
+ const branch = eventString(event.branch);
376
376
  if (branch !== undefined) parts.push(`on ${branch}`);
377
377
  break;
378
378
  }
379
379
  case "git_diff":
380
- parts.push(plural(eventNumber(event["lines"]), "line", "lines"));
381
- if (event["staged"] === true) parts.push("staged");
380
+ parts.push(plural(eventNumber(event.lines), "line", "lines"));
381
+ if (event.staged === true) parts.push("staged");
382
382
  break;
383
383
  case "git_log":
384
- parts.push(plural(eventNumber(event["commits"]), "commit", "commits"));
384
+ parts.push(plural(eventNumber(event.commits), "commit", "commits"));
385
385
  break;
386
386
  case "run":
387
387
  case "sh": {
388
- const command = eventString(event["command"] ?? event["cmd"]);
388
+ const command = eventString(event.command ?? event.cmd);
389
389
  if (command !== undefined) parts.push(command);
390
- if (typeof event["exitCode"] === "number") parts.push(`exit ${event["exitCode"]}`);
390
+ if (typeof event.exitCode === "number") parts.push(`exit ${event.exitCode}`);
391
391
  break;
392
392
  }
393
393
  case "completion": {
394
- const model = eventString(event["model"]);
395
- const tier = eventString(event["tier"]);
394
+ const model = eventString(event.model);
395
+ const tier = eventString(event.tier);
396
396
  if (model !== undefined) parts.push(model);
397
397
  if (tier !== undefined && tier !== model) parts.push(tier);
398
- parts.push(`${eventNumber(event["chars"])} chars`);
398
+ parts.push(`${eventNumber(event.chars)} chars`);
399
399
  break;
400
400
  }
401
401
  case "log":
402
- parts.push(eventString(event["message"]) ?? "");
402
+ parts.push(eventString(event.message) ?? "");
403
403
  break;
404
404
  case "phase":
405
- parts.push(eventString(event["title"]) ?? "");
405
+ parts.push(eventString(event.title) ?? "");
406
406
  break;
407
407
  default: {
408
- if (event["count"] !== undefined) parts.push(String(event["count"]));
409
- const path = eventString(event["path"]);
408
+ if (event.count !== undefined) parts.push(String(event.count));
409
+ const path = eventString(event.path);
410
410
  if (path !== undefined) parts.push(path);
411
411
  }
412
412
  }
@@ -443,7 +443,7 @@ function coalesceAgentEvents(events: readonly EvalStatusEvent[]): EvalStatusEven
443
443
  const rows: EvalStatusEvent[] = [];
444
444
  const indexes = new Map<string, number>();
445
445
  for (const event of events) {
446
- const id = eventString(event["id"]);
446
+ const id = eventString(event.id);
447
447
  if (id === undefined) {
448
448
  rows.push(event);
449
449
  continue;
@@ -480,13 +480,13 @@ function renderAgentProgressEvents(events: readonly EvalStatusEvent[], environme
480
480
  // Senpi Theme has no tree-token API; fixed ├/└/│ glyphs intentionally mirror omp.
481
481
  for (const [index, event] of rows.entries()) {
482
482
  const isLast = index === rows.length - 1;
483
- const status = agentStatus(event["status"]);
483
+ const status = agentStatus(event.status);
484
484
  const presentation = agentPresentation(status, environment.spinnerFrame);
485
- const id = eventString(event["id"]) ?? "agent";
485
+ const id = eventString(event.id) ?? "agent";
486
486
  const styledId = environment.theme === undefined ? id : environment.theme.bold(id);
487
487
  let body = `${style(environment.theme, presentation.color, presentation.icon)} ${styledId} ${presentation.label}`;
488
488
  if (status === "completed" || status === "failed" || status === "aborted") {
489
- const duration = eventNumber(event["durationMs"]);
489
+ const duration = eventNumber(event.durationMs);
490
490
  if (duration > 0) body += ` · ${style(environment.theme, "dim", formatDuration(duration))}`;
491
491
  }
492
492
  const branch = isLast ? "└ " : "├ ";
@@ -496,8 +496,8 @@ function renderAgentProgressEvents(events: readonly EvalStatusEvent[], environme
496
496
  renderPrefixed(body, environment, { prefix: branch, continuation: continuation, color: "dim" }),
497
497
  );
498
498
  if (status !== "running") continue;
499
- const currentTool = eventString(event["currentTool"]);
500
- const lastIntent = eventString(event["lastIntent"]);
499
+ const currentTool = eventString(event.currentTool);
500
+ const lastIntent = eventString(event.lastIntent);
501
501
  if (currentTool === undefined && lastIntent === undefined) continue;
502
502
  const detail =
503
503
  currentTool === undefined