@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.
- package/CHANGELOG.md +105 -0
- package/README.md +6 -6
- package/dist/bun/cli.js +2 -0
- package/dist/bun/cli.js.map +1 -1
- package/dist/cli/args.js +1 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/list-models.d.ts +2 -2
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/list-models.js.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +3 -0
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +4 -3
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +14 -5
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +8 -4
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +80 -29
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-providers.js +1 -1
- package/dist/core/auth-providers.js.map +1 -1
- package/dist/core/auth-storage.d.ts +32 -87
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +158 -221
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/cache-stats.d.ts +2 -2
- package/dist/core/cache-stats.d.ts.map +1 -1
- package/dist/core/cache-stats.js +1 -1
- package/dist/core/cache-stats.js.map +1 -1
- package/dist/core/dynamic-prompt/build.d.ts.map +1 -1
- package/dist/core/dynamic-prompt/build.js +6 -1
- package/dist/core/dynamic-prompt/build.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.js +2 -2
- package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +8 -8
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +8 -2
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +1 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +3 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +15 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-config.d.ts +589 -0
- package/dist/core/model-config.d.ts.map +1 -0
- package/dist/core/model-config.js +288 -0
- package/dist/core/model-config.js.map +1 -0
- package/dist/core/model-registry.d.ts +17 -146
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +69 -958
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +8 -5
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +18 -18
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +81 -0
- package/dist/core/model-runtime.d.ts.map +1 -0
- package/dist/core/model-runtime.js +442 -0
- package/dist/core/model-runtime.js.map +1 -0
- package/dist/core/models-store.d.ts +17 -0
- package/dist/core/models-store.d.ts.map +1 -0
- package/dist/core/models-store.js +46 -0
- package/dist/core/models-store.js.map +1 -0
- package/dist/core/provider-composer.d.ts +64 -0
- package/dist/core/provider-composer.d.ts.map +1 -0
- package/dist/core/provider-composer.js +406 -0
- package/dist/core/provider-composer.js.map +1 -0
- package/dist/core/provider-display-names.js +1 -1
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/radius.d.ts +0 -19
- package/dist/core/radius.d.ts.map +1 -1
- package/dist/core/radius.js +0 -28
- package/dist/core/radius.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts +5 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -0
- package/dist/core/remote-catalog-provider.js +83 -0
- package/dist/core/remote-catalog-provider.js.map +1 -0
- package/dist/core/runtime-credentials.d.ts +15 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -0
- package/dist/core/runtime-credentials.js +35 -0
- package/dist/core/runtime-credentials.js.map +1 -0
- package/dist/core/sdk.d.ts +11 -20
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +61 -89
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/skills.js +1 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +10 -13
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +22 -10
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +4 -8
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +14 -12
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +13 -4
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +84 -41
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +4 -4
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +14 -25
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +5 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +154 -128
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +70 -8
- package/dist/package-manager-cli.js.map +1 -1
- package/docs/custom-provider.md +6 -11
- package/docs/extensions.md +78 -555
- package/docs/models.md +2 -0
- package/docs/packages.md +1 -0
- package/docs/providers.md +23 -11
- package/docs/sdk.md +79 -105
- package/docs/usage.md +1 -0
- package/examples/extensions/README.md +1 -0
- package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/kimi-deferred-tools.ts +61 -0
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/sdk/02-custom-model.ts +5 -8
- package/examples/sdk/09-api-keys-and-oauth.ts +13 -31
- package/examples/sdk/12-full-control.ts +8 -13
- package/examples/sdk/README.md +14 -18
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +16 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +3 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/local-module-loader.ts +2 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/kernels/js/rewrite-imports.ts +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +32 -32
- package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
- package/node_modules/@earendil-works/pi-ai/README.md +77 -23
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js +9 -10
- package/node_modules/@earendil-works/pi-ai/dist/api/lazy.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js +3 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +42 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/auth/helpers.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/anthropic.js +51 -116
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/anthropic.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/device-code.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.d.ts +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/github-copilot.js +18 -77
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/github-copilot.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js +49 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/oauth-page.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/oauth-page.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/openai-codex.js +61 -155
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/pkce.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/pkce.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/radius.js +31 -128
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/radius.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/xai.d.ts +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/xai.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/xai.js +189 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/xai.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -4
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +9 -7
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +49 -10
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cli.js +58 -76
- package/node_modules/@earendil-works/pi-ai/dist/cli.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts +42 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat/extension-oauth-types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +46 -22
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/images-models.d.ts +4 -2
- package/node_modules/@earendil-works/pi-ai/dist/images-models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/images-models.js +5 -4
- package/node_modules/@earendil-works/pi-ai/dist/images-models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models-store.js +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/models-store.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +69 -30
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +270 -114
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +217 -31
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/oauth.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/oauth.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/oauth.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +51 -10
- package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js +4 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-ai-gateway.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js +13 -20
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-auth.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-stream.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-stream.js +21 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-stream.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cloudflare-workers-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.js +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/github-copilot.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js +56 -5
- package/node_modules/@earendil-works/pi-ai/dist/providers/google-vertex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts +66 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js +42 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/kimi-coding.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.d.ts +36 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai-cn.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.d.ts +36 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/moonshotai.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts +42 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js +178 -142
- package/node_modules/@earendil-works/pi-ai/dist/providers/openrouter.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.d.ts +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.js +59 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius-config.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts +9 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js +54 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts +84 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js +72 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/vercel-ai-gateway.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js +15 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts +6 -114
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js +3 -92
- package/node_modules/@earendil-works/pi-ai/dist/providers/xai.models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +6 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js +22 -4
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +6 -6
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts +0 -27
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/anthropic.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts +0 -32
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts +0 -59
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +0 -131
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.d.ts +0 -5
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.js +0 -22
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/load.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/oauth-page.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts +0 -45
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/openai-codex.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/pkce.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/radius.d.ts +0 -39
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/radius.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/radius.js.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts +0 -64
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.js +0 -2
- package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/types.js.map +0 -1
- /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/device-code.d.ts +0 -0
- /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/device-code.js +0 -0
- /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/oauth-page.d.ts +0 -0
- /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/oauth-page.js +0 -0
- /package/node_modules/@earendil-works/pi-ai/dist/{utils → auth}/oauth/pkce.d.ts +0 -0
- /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
|
|
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.
|
|
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.
|
|
9
|
+
"version": "0.80.9",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-gondolin",
|
|
3
|
-
"version": "0.80.
|
|
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.
|
|
9
|
+
"version": "0.80.9",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@earendil-works/gondolin": "0.12.0"
|
|
12
12
|
}
|
|
@@ -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.
|
|
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.
|
|
9
|
+
"version": "1.10.9",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.80.
|
|
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.
|
|
9
|
+
"version": "0.80.9",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { getModel } from "@earendil-works/pi-ai/compat";
|
|
8
|
-
import {
|
|
8
|
+
import { createAgentSession, ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
9
9
|
|
|
10
|
-
|
|
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 =
|
|
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
|
|
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
|
-
|
|
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
|
|
4
|
+
* Configure provider auth through ModelRuntime.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
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
|
-
|
|
17
|
-
modelRegistry,
|
|
12
|
+
modelRuntime,
|
|
18
13
|
});
|
|
19
|
-
console.log("Session with default
|
|
14
|
+
console.log("Session with default model runtime");
|
|
20
15
|
defaultAuthSession.dispose();
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
29
|
-
modelRegistry: customModelRegistry,
|
|
23
|
+
modelRuntime: customRuntime,
|
|
30
24
|
});
|
|
31
|
-
console.log("Session with custom auth
|
|
25
|
+
console.log("Session with custom auth and models locations");
|
|
32
26
|
customAuthSession.dispose();
|
|
33
27
|
|
|
34
|
-
|
|
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
|
-
|
|
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
|
-
|
|
11
|
+
ModelRuntime,
|
|
13
12
|
type ResourceLoader,
|
|
14
13
|
SessionManager,
|
|
15
14
|
SettingsManager,
|
|
16
15
|
} from "@earendil-works/pi-coding-agent";
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
22
|
+
modelRuntime.setRuntimeApiKey("anthropic", process.env.MY_ANTHROPIC_KEY);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
|
|
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
|
-
|
|
59
|
-
modelRegistry,
|
|
54
|
+
modelRuntime,
|
|
60
55
|
resourceLoader,
|
|
61
56
|
tools: ["read", "bash"],
|
|
62
57
|
sessionManager: SessionManager.inMemory(cwd),
|
package/examples/sdk/README.md
CHANGED
|
@@ -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
|
-
|
|
39
|
+
ModelRuntime,
|
|
41
40
|
SessionManager,
|
|
42
41
|
SettingsManager,
|
|
43
42
|
} from "@code-yeongyu/senpi";
|
|
44
43
|
|
|
45
|
-
|
|
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({
|
|
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",
|
|
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,
|
|
58
|
+
const { session } = await createAgentSession({ resourceLoader: loader, modelRuntime });
|
|
62
59
|
|
|
63
60
|
// Read-only
|
|
64
|
-
const { session } = await createAgentSession({ tools: ["read", "grep", "find", "ls"],
|
|
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
|
-
|
|
70
|
-
modelRegistry,
|
|
66
|
+
modelRuntime,
|
|
71
67
|
});
|
|
72
68
|
|
|
73
69
|
// Full control
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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
|
-
| `
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-codemode",
|
|
3
|
-
"version": "2026.7.
|
|
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.
|
|
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.
|
|
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
|
|
51
|
-
roots
|
|
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
|
|
35
|
-
const start = value
|
|
36
|
-
const end = value
|
|
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
|
|
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
|
|
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
|
|
339
|
-
const path = eventString(event
|
|
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
|
|
345
|
-
const path = eventString(event
|
|
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
|
|
351
|
-
parts.push(`${eventNumber(event
|
|
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
|
|
354
|
+
parts.push(plural(eventNumber(event.count), "entry", "entries"));
|
|
355
355
|
break;
|
|
356
356
|
case "env": {
|
|
357
|
-
const action = eventString(event
|
|
358
|
-
const key = eventString(event
|
|
359
|
-
const value = eventString(event
|
|
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
|
|
362
|
+
else parts.push(plural(eventNumber(event.count), "variable", "variables"));
|
|
363
363
|
break;
|
|
364
364
|
}
|
|
365
365
|
case "git_status": {
|
|
366
|
-
if (event
|
|
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
|
|
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
|
|
381
|
-
if (event
|
|
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
|
|
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
|
|
388
|
+
const command = eventString(event.command ?? event.cmd);
|
|
389
389
|
if (command !== undefined) parts.push(command);
|
|
390
|
-
if (typeof event
|
|
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
|
|
395
|
-
const tier = eventString(event
|
|
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
|
|
398
|
+
parts.push(`${eventNumber(event.chars)} chars`);
|
|
399
399
|
break;
|
|
400
400
|
}
|
|
401
401
|
case "log":
|
|
402
|
-
parts.push(eventString(event
|
|
402
|
+
parts.push(eventString(event.message) ?? "");
|
|
403
403
|
break;
|
|
404
404
|
case "phase":
|
|
405
|
-
parts.push(eventString(event
|
|
405
|
+
parts.push(eventString(event.title) ?? "");
|
|
406
406
|
break;
|
|
407
407
|
default: {
|
|
408
|
-
if (event
|
|
409
|
-
const path = eventString(event
|
|
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
|
|
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
|
|
483
|
+
const status = agentStatus(event.status);
|
|
484
484
|
const presentation = agentPresentation(status, environment.spinnerFrame);
|
|
485
|
-
const id = eventString(event
|
|
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
|
|
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
|
|
500
|
-
const lastIntent = eventString(event
|
|
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
|