@code-yeongyu/senpi 2026.9.10-2 → 2026.9.11
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 +48 -0
- package/dist/core/agent-session.d.ts +21 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +45 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +2 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +49 -17
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/brand.d.ts +5 -0
- package/dist/core/brand.d.ts.map +1 -1
- package/dist/core/brand.js +13 -0
- package/dist/core/brand.js.map +1 -1
- package/dist/core/changelog-source.d.ts +8 -0
- package/dist/core/changelog-source.d.ts.map +1 -0
- package/dist/core/changelog-source.js +19 -0
- package/dist/core/changelog-source.js.map +1 -0
- package/dist/core/credential-accounts.d.ts +3 -0
- package/dist/core/credential-accounts.d.ts.map +1 -1
- package/dist/core/credential-accounts.js +20 -1
- package/dist/core/credential-accounts.js.map +1 -1
- package/dist/core/credential-pool/classify.d.ts.map +1 -1
- package/dist/core/credential-pool/classify.js +8 -0
- package/dist/core/credential-pool/classify.js.map +1 -1
- package/dist/core/extensions/builtin/account/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/account/index.js +7 -3
- package/dist/core/extensions/builtin/account/index.js.map +1 -1
- package/dist/core/extensions/builtin/account-display-name.d.ts +7 -0
- package/dist/core/extensions/builtin/account-display-name.d.ts.map +1 -0
- package/dist/core/extensions/builtin/account-display-name.js +40 -0
- package/dist/core/extensions/builtin/account-display-name.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/format.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ask-user/format.js +7 -2
- package/dist/core/extensions/builtin/ask-user/format.js.map +1 -1
- package/dist/core/extensions/builtin/ask-user/pending.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ask-user/pending.js +3 -0
- package/dist/core/extensions/builtin/ask-user/pending.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.js +21 -9
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.d.ts +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.js +11 -6
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.d.ts +9 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.js +10 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js +3 -9
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/routine-settings.js +1 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js +5 -3
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js +3 -9
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js.map +1 -1
- package/dist/core/extensions/builtin/goal/agent-end-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/agent-end-continuation.js +13 -1
- package/dist/core/extensions/builtin/goal/agent-end-continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.js +11 -8
- package/dist/core/extensions/builtin/goal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/goal/terminal-provider-error.d.ts +1 -0
- package/dist/core/extensions/builtin/goal/terminal-provider-error.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/terminal-provider-error.js +28 -0
- package/dist/core/extensions/builtin/goal/terminal-provider-error.js.map +1 -1
- package/dist/core/extensions/builtin/goal/todo-gate.js +2 -2
- package/dist/core/extensions/builtin/goal/todo-gate.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js +2 -2
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-account.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-account.js +19 -8
- package/dist/core/extensions/builtin/gpt-account.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.js +19 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +6 -6
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +26 -7
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +29 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +2 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/remote-catalog-merge.d.ts +16 -0
- package/dist/core/remote-catalog-merge.d.ts.map +1 -0
- package/dist/core/remote-catalog-merge.js +75 -0
- package/dist/core/remote-catalog-merge.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts +3 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +12 -40
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/session-entry-materializer.d.ts +12 -0
- package/dist/core/session-entry-materializer.d.ts.map +1 -0
- package/dist/core/session-entry-materializer.js +26 -0
- package/dist/core/session-entry-materializer.js.map +1 -0
- package/dist/core/session-manager.d.ts +1 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +23 -8
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +10 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/modes/app-server/daemon/process.d.ts +6 -1
- package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
- package/dist/modes/app-server/daemon/process.js +23 -4
- package/dist/modes/app-server/daemon/process.js.map +1 -1
- package/dist/modes/app-server/protocol/account.d.ts +2 -0
- package/dist/modes/app-server/protocol/account.d.ts.map +1 -1
- package/dist/modes/app-server/protocol/account.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-keys.d.ts +1 -1
- package/dist/modes/interactive/components/ask-user-question-keys.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-keys.js +65 -17
- package/dist/modes/interactive/components/ask-user-question-keys.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-render.d.ts +2 -1
- package/dist/modes/interactive/components/ask-user-question-render.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-render.js +39 -9
- package/dist/modes/interactive/components/ask-user-question-render.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-state.d.ts +14 -4
- package/dist/modes/interactive/components/ask-user-question-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-state.js +63 -6
- package/dist/modes/interactive/components/ask-user-question-state.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-question.d.ts +2 -0
- package/dist/modes/interactive/components/ask-user-question.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-question.js +27 -14
- package/dist/modes/interactive/components/ask-user-question.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +51 -19
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +11 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +29 -9
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/help-content.d.ts.map +1 -1
- package/dist/modes/interactive/help-content.js +4 -0
- package/dist/modes/interactive/help-content.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +21 -12
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.js +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.js.map +1 -1
- package/dist/modes/rpc/connection-question-bridge.js +1 -1
- package/dist/modes/rpc/connection-question-bridge.js.map +1 -1
- package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
- package/dist/modes/rpc/host-ensure.js +33 -11
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/modes/rpc/host-lifecycle.d.ts +14 -0
- package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
- package/dist/modes/rpc/host-lifecycle.js +31 -5
- package/dist/modes/rpc/host-lifecycle.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -0
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/changelog.d.ts +3 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +89 -23
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/paths.d.ts +5 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +14 -1
- package/dist/utils/paths.js.map +1 -1
- package/docs/app-server.md +6 -0
- package/docs/extensions.md +19 -3
- package/docs/rpc.md +10 -0
- package/docs/settings.md +2 -1
- package/docs/tui.md +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +16 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +5 -4
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/output/streaming-output-buffer.ts +58 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/output/streaming-output.ts +9 -64
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt-template.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.d.ts +17 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js +90 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/frames.d.ts +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/frames.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/frames.js +71 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/frames.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts +873 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js +303 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js +35 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts +24 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js +116 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts +20 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js +153 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/types.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/types.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js +162 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.lazy.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.lazy.js +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-callback.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-callback.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-callback.js +124 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-callback.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-token.d.ts +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-token.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-token.js +101 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-token.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts +14 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js +111 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts +51 -4
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js +196 -7
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +8 -0
- 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 +10 -0
- 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 +9 -1
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +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 +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +14 -5
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -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 +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js +62 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js +28 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +3 -1
- 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/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js +55 -16
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
|
@@ -19,8 +19,8 @@ export function openTodoCompletionError(openTasks) {
|
|
|
19
19
|
.join(", ");
|
|
20
20
|
const suffix = openTasks.length > MAX_LISTED_TASKS ? ` and ${openTasks.length - MAX_LISTED_TASKS} more` : "";
|
|
21
21
|
return (`cannot mark the goal complete: ${openTasks.length} open todo task(s) remain: ${listed}${suffix}. ` +
|
|
22
|
-
"
|
|
23
|
-
"
|
|
22
|
+
"Do the remaining work, or drop the tasks that are genuinely no longer needed - closing an unfinished task " +
|
|
23
|
+
"to clear this gate reports a completion that did not happen. Then run the completion audit again and retry update_goal.");
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* True when a successful todo tool result came from an add operation (init /
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"todo-gate.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/goal/todo-gate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE7G,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAuB;IAC3D,OAAO,gCAAgC,CAAC,OAAO,CAAC;SAC9C,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;SAC/B,MAAM,CAAC,gBAAgB,CAAC;SACxB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,SAA4B;IACnE,MAAM,MAAM,GAAG,SAAS;SACtB,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC;SAC1B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,GAAG,CAAC;SAC1B,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,QAAQ,SAAS,CAAC,MAAM,GAAG,gBAAgB,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7G,OAAO,CACN,kCAAkC,SAAS,CAAC,MAAM,8BAA8B,MAAM,GAAG,MAAM,IAAI;QACnG,
|
|
1
|
+
{"version":3,"file":"todo-gate.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/goal/todo-gate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MA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,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACnE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAiB;IACtD,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC;IAClE,MAAM,SAAS,GACd,IAAI,KAAK,IAAI;QACZ,CAAC,CAAC,oEAAoE;QACtE,CAAC,CAAC,+GAA+G,CAAC;IACpH,MAAM,OAAO,GACZ,IAAI,KAAK,IAAI;QACZ,CAAC,CAAC,uKAAuK;QACzK,CAAC,CAAC,oMAAoM,CAAC;IACzM,OAAO;QACN,mBAAmB;QACnB,SAAS;QACT,OAAO;QACP,iGAAiG;QACjG,oBAAoB;KACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC","sourcesContent":["import type { SessionEntry } from \"../../../session-manager.ts\";\nimport { getLatestPhasesFromBranchEntries, isIncompleteTodo, isTodoPhaseArray } from \"../todotools/state.ts\";\nimport type { Goal } from \"./types.ts\";\nimport { isRecord } from \"./types.ts\";\n\nconst MAX_LISTED_TASKS = 5;\n\n/**\n * Contents of every non-terminal (pending / in_progress) task in the thread's\n * latest todo list. The goal builtin refuses to mark a goal complete while any\n * of these remain: an open todo task is remaining work by definition.\n */\nexport function openTodoTaskContents(entries: SessionEntry[]): string[] {\n\treturn getLatestPhasesFromBranchEntries(entries)\n\t\t.flatMap((phase) => phase.tasks)\n\t\t.filter(isIncompleteTodo)\n\t\t.map((task) => task.content);\n}\n\nexport function openTodoCompletionError(openTasks: readonly string[]): string {\n\tconst listed = openTasks\n\t\t.slice(0, MAX_LISTED_TASKS)\n\t\t.map((task) => `\"${task}\"`)\n\t\t.join(\", \");\n\tconst suffix = openTasks.length > MAX_LISTED_TASKS ? ` and ${openTasks.length - MAX_LISTED_TASKS} more` : \"\";\n\treturn (\n\t\t`cannot mark the goal complete: ${openTasks.length} open todo task(s) remain: ${listed}${suffix}. ` +\n\t\t\"Do the remaining work, or drop the tasks that are genuinely no longer needed - closing an unfinished task \" +\n\t\t\"to clear this gate reports a completion that did not happen. Then run the completion audit again and retry update_goal.\"\n\t);\n}\n\n/**\n * True when a successful todo tool result came from an add operation (init /\n * append) that left at least one open (pending / in_progress) task behind.\n */\nexport function todoResultAddsOpenTasks(details: unknown): boolean {\n\tif (!isRecord(details)) return false;\n\tconst op = details.op;\n\tif (op !== \"init\" && op !== \"append\") return false;\n\tconst phases = details.phases;\n\tif (!isTodoPhaseArray(phases)) return false;\n\treturn phases.some((phase) => phase.tasks.some(isIncompleteTodo));\n}\n\n/**\n * System reminder injected into a todo tool result when new open tasks were\n * added while the thread has no goal, or only a stale (already complete) one.\n * The mirror of the completion gate above: newly tracked work should be\n * anchored to a live goal when it serves a durable objective.\n */\nexport function staleGoalTodoReminder(goal: Goal | null): string | undefined {\n\tif (goal !== null && goal.status !== \"complete\") return undefined;\n\tconst staleLine =\n\t\tgoal === null\n\t\t\t? \"New todo tasks were added, but this thread has no goal registered.\"\n\t\t\t: \"New todo tasks were added, but the registered goal is already complete (stale), so the new work is untracked.\";\n\tconst fixLine =\n\t\tgoal === null\n\t\t\t? \"If this todo list tracks a durable objective (multi-step work that should survive across turns), register it now with create_goal so progress is tracked and audited.\"\n\t\t\t: \"If this todo list tracks a durable objective (multi-step work that should survive across turns), register it now with create_goal; creating a new goal archives the completed one and replaces it.\";\n\treturn [\n\t\t\"<system-reminder>\",\n\t\tstaleLine,\n\t\tfixLine,\n\t\t\"If the todos are trivial short-lived bookkeeping for the current turn, continue without a goal.\",\n\t\t\"</system-reminder>\",\n\t].join(\"\\n\");\n}\n"]}
|
|
@@ -9,7 +9,7 @@ export function registerGoalTools(pi, deps) {
|
|
|
9
9
|
pi.registerTool({
|
|
10
10
|
name: "create_goal",
|
|
11
11
|
label: "Create Goal",
|
|
12
|
-
description: "
|
|
12
|
+
description: "Register a goal for work that outlives this turn: it waits on external state, or the user's requested outcome needs more than one verify-and-fix round before it is true. A single answer, lookup, or one-shot edit needs no goal.\nObjectives are limited to 4,000 characters. For longer instructions, put the full objective in a file and refer to that file.\nReplaces the current goal when it is complete and archives it; fails if an unfinished goal exists.",
|
|
13
13
|
parameters: Type.Object({
|
|
14
14
|
objective: Type.String({
|
|
15
15
|
description: "Required. The concrete objective to start pursuing. Limit: 4,000 characters. For longer instructions, put the full objective in a file and refer to that file.",
|
|
@@ -36,7 +36,7 @@ export function registerGoalTools(pi, deps) {
|
|
|
36
36
|
pi.registerTool({
|
|
37
37
|
name: "update_goal",
|
|
38
38
|
label: "Update Goal",
|
|
39
|
-
description: "Set the existing goal's status to `complete` or `blocked`; the completion audit and blocked audit in the goal continuation prompt decide which, and only a passing audit permits the call.\n`complete` is rejected while todo tasks are open, and stopping work is never by itself a reason to complete; after it succeeds, report the final elapsed time and token usage from the result to the user.\n`blocked` requires a non-empty `reason` (omit `reason` for `complete`); a user resume starts a fresh blocked audit.\nA missing user decision is a question for the question tool, not a blocked status, until the user fails to answer it.\nPausing and resuming are user or system actions, not this tool.",
|
|
39
|
+
description: "Set the existing goal's status to `complete` or `blocked`; the completion audit and blocked audit in the goal continuation prompt decide which, and only a passing audit permits the call.\n`complete` is rejected while todo tasks are open, and stopping work is never by itself a reason to complete; after it succeeds, report the final elapsed time and token usage from the result to the user.\n`blocked` requires a non-empty `reason` (omit `reason` for `complete`), and is rejected while any resumption channel can still deliver, and again until the same blocker has survived three goal turns since the goal became active or the user last spoke; a user resume starts a fresh blocked audit.\nA missing user decision is a question for the question tool, not a blocked status, until the user fails to answer it. Retries themselves are unbounded.\nPausing and resuming are user or system actions, not this tool.",
|
|
40
40
|
parameters: Type.Object({
|
|
41
41
|
status: Type.Union(MODEL_SETTABLE_GOAL_STATUS_VALUES.map((status) => Type.Literal(status)), { description: "Required. Set to complete when achieved or blocked with a non-empty reason." }),
|
|
42
42
|
reason: Type.Optional(Type.String({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-registration.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/goal/tool-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAA8B,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,EAAE,iCAAiC,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAa/E,MAAM,UAAU,iBAAiB,CAAC,EAAgB,EAAE,IAA8B;IACjF,EAAE,CAAC,YAAY,CAAC;QACf,IAAI,EAAE,aAAa;QACnB,KAAK,EAAE,aAAa;QACpB,WAAW,EACV,uWAAuW;QACxW,UAAU,EAAE,IAAI,CAAC,MAAM,CACtB;YACC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC;gBACtB,WAAW,EACV,gKAAgK;aACjK,CAAC;SACF,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B;QACD,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG;YACzD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YACnC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;YACpC,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,CAA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AC5E,CAAC;QACD,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,CAAC;QACxE,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;KACtF,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,OAA8B;IAC7D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AAChE,CAAC","sourcesContent":["import { Type } from \"typebox\";\nimport type { AgentToolResult, ExtensionAPI, ExtensionContext } from \"../../types.ts\";\nimport { formatGoalToolResponse, type GoalToolRenderDetails, goalToolRenderDetails } from \"./format.ts\";\nimport { renderGoalToolCall, renderGoalToolResult } from \"./renderers.ts\";\nimport { createGoal, objectiveFullTextFileName, readGoal, updateGoal } from \"./store.ts\";\nimport { openTodoCompletionError, openTodoTaskContents } from \"./todo-gate.ts\";\nimport type { Goal, GoalAccountingMode, GoalStoreRef } from \"./types.ts\";\nimport { MODEL_SETTABLE_GOAL_STATUS_VALUES } from \"./types.ts\";\nimport { objectiveTruncationNotice, validateObjective } from \"./validation.ts\";\n\ntype GoalToolResult = AgentToolResult<GoalToolRenderDetails>;\n\nexport type GoalToolRegistrationDeps = {\n\treadonly goalStoreRef: (ctx: ExtensionContext) => GoalStoreRef;\n\treadonly accountCurrentAgentTurn: (ctx: ExtensionContext, mode: GoalAccountingMode) => Promise<Goal | null>;\n\treadonly beginAgentGoalAccounting: (goal: Goal) => void;\n\treadonly markGoalBlockedThisTurn: (goal: Goal) => void;\n\treadonly markGoalCompletedThisTurn: (goal: Goal) => void;\n\treadonly refreshGoalUi: (ctx: ExtensionContext, goal: Goal | null) => void;\n};\n\nexport function registerGoalTools(pi: ExtensionAPI, deps: GoalToolRegistrationDeps): void {\n\tpi.registerTool({\n\t\tname: \"create_goal\",\n\t\tlabel: \"Create Goal\",\n\t\tdescription:\n\t\t\t\"Create a goal only when explicitly requested by the user or system/developer instructions; do not infer goals from ordinary tasks.\\nObjectives are limited to 4,000 characters. For longer instructions, put the full objective in a file and refer to that file.\\nReplaces the current goal when it is complete and archives it; fails if an unfinished goal exists.\",\n\t\tparameters: Type.Object(\n\t\t\t{\n\t\t\t\tobjective: Type.String({\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Required. The concrete objective to start pursuing. Limit: 4,000 characters. For longer instructions, put the full objective in a file and refer to that file.\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t\tasync execute(_toolCallId, params, _signal, _onUpdate, ctx) {\n\t\t\tconst ref = deps.goalStoreRef(ctx);\n\t\t\tconst current = await readGoal(ref);\n\t\t\tif (current !== null && current.status !== \"complete\") {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"cannot create a new goal because this thread already has an unfinished goal; use update_goal only when the existing goal is complete\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst validatedObjective = validateObjective(params.objective, objectiveFullTextFileName(ref));\n\t\t\tconst goal = await createGoal(ref, params.objective);\n\t\t\tdeps.beginAgentGoalAccounting(goal);\n\t\t\tdeps.refreshGoalUi(ctx, goal);\n\t\t\tconst notice = validatedObjective.truncated\n\t\t\t\t? objectiveTruncationNotice(objectiveFullTextFileName(ref))\n\t\t\t\t: undefined;\n\t\t\treturn toolText(formatGoalToolResponse(goal, notice), goalToolRenderDetails(goal, notice));\n\t\t},\n\t\trenderCall: (args, theme) => renderGoalToolCall(\"create_goal\", args, theme),\n\t\trenderResult: (result, options, theme) => renderGoalToolResult(result, options, theme),\n\t});\n\n\tpi.registerTool({\n\t\tname: \"update_goal\",\n\t\tlabel: \"Update Goal\",\n\t\tdescription:\n\t\t\t\"Set the existing goal's status to `complete` or `blocked`; the completion audit and blocked audit in the goal continuation prompt decide which, and only a passing audit permits the call.\\n`complete` is rejected while todo tasks are open, and stopping work is never by itself a reason to complete; after it succeeds, report the final elapsed time and token usage from the result to the user.\\n`blocked` requires a non-empty `reason` (omit `reason` for `complete`); a user resume starts a fresh blocked audit.\\nA missing user decision is a question for the question tool, not a blocked status, until the user fails to answer it.\\nPausing and resuming are user or system actions, not this tool.\",\n\t\tparameters: Type.Object(\n\t\t\t{\n\t\t\t\tstatus: Type.Union(\n\t\t\t\t\tMODEL_SETTABLE_GOAL_STATUS_VALUES.map((status) => Type.Literal(status)),\n\t\t\t\t\t{ description: \"Required. Set to complete when achieved or blocked with a non-empty reason.\" },\n\t\t\t\t),\n\t\t\t\treason: Type.Optional(\n\t\t\t\t\tType.String({\n\t\t\t\t\t\tdescription: \"Required and non-empty when status is blocked; rejected when status is complete.\",\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t\tasync execute(_toolCallId, params, _signal, _onUpdate, ctx) {\n\t\t\tconst reason = typeof params.reason === \"string\" ? params.reason.trim() : undefined;\n\t\t\tif (params.status === \"blocked\" && (reason === undefined || reason.length === 0)) {\n\t\t\t\tthrow new Error(\"reason is required when status is blocked\");\n\t\t\t}\n\t\t\tif (params.status === \"complete\" && reason !== undefined && reason.length > 0) {\n\t\t\t\tthrow new Error(\"reason must not be provided when status is complete\");\n\t\t\t}\n\t\t\tif (params.status === \"complete\") {\n\t\t\t\tconst openTasks = openTodoTaskContents(ctx.sessionManager.getBranch());\n\t\t\t\tif (openTasks.length > 0) throw new Error(openTodoCompletionError(openTasks));\n\t\t\t}\n\t\t\tawait deps.accountCurrentAgentTurn(ctx, \"active\");\n\t\t\tconst goal = await updateGoal(\n\t\t\t\tdeps.goalStoreRef(ctx),\n\t\t\t\tparams.status === \"blocked\" ? { status: \"blocked\", reason } : { status: \"complete\" },\n\t\t\t\t\"model\",\n\t\t\t);\n\t\t\tif (goal.status === \"blocked\") deps.markGoalBlockedThisTurn(goal);\n\t\t\telse deps.markGoalCompletedThisTurn(goal);\n\t\t\tdeps.refreshGoalUi(ctx, goal);\n\t\t\treturn toolText(formatGoalToolResponse(goal), goalToolRenderDetails(goal));\n\t\t},\n\t\trenderCall: (args, theme) => renderGoalToolCall(\"update_goal\", args, theme),\n\t\trenderResult: (result, options, theme) => renderGoalToolResult(result, options, theme),\n\t});\n\n\tpi.registerTool({\n\t\tname: \"get_goal\",\n\t\tlabel: \"Get Goal\",\n\t\tdescription: \"Get the current goal for this thread, including status, token and elapsed-time usage.\",\n\t\tparameters: Type.Object({}, { additionalProperties: false }),\n\t\tasync execute(_toolCallId, _params, _signal, _onUpdate, ctx) {\n\t\t\tconst goal = await deps.accountCurrentAgentTurn(ctx, \"active\");\n\t\t\tdeps.refreshGoalUi(ctx, goal);\n\t\t\treturn toolText(formatGoalToolResponse(goal), goalToolRenderDetails(goal));\n\t\t},\n\t\trenderCall: (args, theme) => renderGoalToolCall(\"get_goal\", args, theme),\n\t\trenderResult: (result, options, theme) => renderGoalToolResult(result, options, theme),\n\t});\n}\n\nfunction toolText(text: string, details: GoalToolRenderDetails): GoalToolResult {\n\treturn { content: [{ type: \"text\" as const, text }], details };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tool-registration.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/goal/tool-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,sBAAsB,EAA8B,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,yBAAyB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE/E,OAAO,EAAE,iCAAiC,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;QAC3E,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;KACtF,CAAC,CAAC;IAEH,EAAE,CAAC,YAAY,CAAC;QACf,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,UAAU;QACjB,WAAW,EAAE,uFAAuF;QACpG,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;QAC5D,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG;YAC1D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YAC/D,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAC9B,OAAO,QAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5E,CAAC;QACD,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,CAAC;QACxE,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC;KACtF,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,OAA8B;IAC7D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC;AAChE,CAAC","sourcesContent":["import { Type } from \"typebox\";\nimport type { AgentToolResult, ExtensionAPI, ExtensionContext } from \"../../types.ts\";\nimport { formatGoalToolResponse, type GoalToolRenderDetails, goalToolRenderDetails } from \"./format.ts\";\nimport { renderGoalToolCall, renderGoalToolResult } from \"./renderers.ts\";\nimport { createGoal, objectiveFullTextFileName, readGoal, updateGoal } from \"./store.ts\";\nimport { openTodoCompletionError, openTodoTaskContents } from \"./todo-gate.ts\";\nimport type { Goal, GoalAccountingMode, GoalStoreRef } from \"./types.ts\";\nimport { MODEL_SETTABLE_GOAL_STATUS_VALUES } from \"./types.ts\";\nimport { objectiveTruncationNotice, validateObjective } from \"./validation.ts\";\n\ntype GoalToolResult = AgentToolResult<GoalToolRenderDetails>;\n\nexport type GoalToolRegistrationDeps = {\n\treadonly goalStoreRef: (ctx: ExtensionContext) => GoalStoreRef;\n\treadonly accountCurrentAgentTurn: (ctx: ExtensionContext, mode: GoalAccountingMode) => Promise<Goal | null>;\n\treadonly beginAgentGoalAccounting: (goal: Goal) => void;\n\treadonly markGoalBlockedThisTurn: (goal: Goal) => void;\n\treadonly markGoalCompletedThisTurn: (goal: Goal) => void;\n\treadonly refreshGoalUi: (ctx: ExtensionContext, goal: Goal | null) => void;\n};\n\nexport function registerGoalTools(pi: ExtensionAPI, deps: GoalToolRegistrationDeps): void {\n\tpi.registerTool({\n\t\tname: \"create_goal\",\n\t\tlabel: \"Create Goal\",\n\t\tdescription:\n\t\t\t\"Register a goal for work that outlives this turn: it waits on external state, or the user's requested outcome needs more than one verify-and-fix round before it is true. A single answer, lookup, or one-shot edit needs no goal.\\nObjectives are limited to 4,000 characters. For longer instructions, put the full objective in a file and refer to that file.\\nReplaces the current goal when it is complete and archives it; fails if an unfinished goal exists.\",\n\t\tparameters: Type.Object(\n\t\t\t{\n\t\t\t\tobjective: Type.String({\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Required. The concrete objective to start pursuing. Limit: 4,000 characters. For longer instructions, put the full objective in a file and refer to that file.\",\n\t\t\t\t}),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t\tasync execute(_toolCallId, params, _signal, _onUpdate, ctx) {\n\t\t\tconst ref = deps.goalStoreRef(ctx);\n\t\t\tconst current = await readGoal(ref);\n\t\t\tif (current !== null && current.status !== \"complete\") {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"cannot create a new goal because this thread already has an unfinished goal; use update_goal only when the existing goal is complete\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst validatedObjective = validateObjective(params.objective, objectiveFullTextFileName(ref));\n\t\t\tconst goal = await createGoal(ref, params.objective);\n\t\t\tdeps.beginAgentGoalAccounting(goal);\n\t\t\tdeps.refreshGoalUi(ctx, goal);\n\t\t\tconst notice = validatedObjective.truncated\n\t\t\t\t? objectiveTruncationNotice(objectiveFullTextFileName(ref))\n\t\t\t\t: undefined;\n\t\t\treturn toolText(formatGoalToolResponse(goal, notice), goalToolRenderDetails(goal, notice));\n\t\t},\n\t\trenderCall: (args, theme) => renderGoalToolCall(\"create_goal\", args, theme),\n\t\trenderResult: (result, options, theme) => renderGoalToolResult(result, options, theme),\n\t});\n\n\tpi.registerTool({\n\t\tname: \"update_goal\",\n\t\tlabel: \"Update Goal\",\n\t\tdescription:\n\t\t\t\"Set the existing goal's status to `complete` or `blocked`; the completion audit and blocked audit in the goal continuation prompt decide which, and only a passing audit permits the call.\\n`complete` is rejected while todo tasks are open, and stopping work is never by itself a reason to complete; after it succeeds, report the final elapsed time and token usage from the result to the user.\\n`blocked` requires a non-empty `reason` (omit `reason` for `complete`), and is rejected while any resumption channel can still deliver, and again until the same blocker has survived three goal turns since the goal became active or the user last spoke; a user resume starts a fresh blocked audit.\\nA missing user decision is a question for the question tool, not a blocked status, until the user fails to answer it. Retries themselves are unbounded.\\nPausing and resuming are user or system actions, not this tool.\",\n\t\tparameters: Type.Object(\n\t\t\t{\n\t\t\t\tstatus: Type.Union(\n\t\t\t\t\tMODEL_SETTABLE_GOAL_STATUS_VALUES.map((status) => Type.Literal(status)),\n\t\t\t\t\t{ description: \"Required. Set to complete when achieved or blocked with a non-empty reason.\" },\n\t\t\t\t),\n\t\t\t\treason: Type.Optional(\n\t\t\t\t\tType.String({\n\t\t\t\t\t\tdescription: \"Required and non-empty when status is blocked; rejected when status is complete.\",\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t},\n\t\t\t{ additionalProperties: false },\n\t\t),\n\t\tasync execute(_toolCallId, params, _signal, _onUpdate, ctx) {\n\t\t\tconst reason = typeof params.reason === \"string\" ? params.reason.trim() : undefined;\n\t\t\tif (params.status === \"blocked\" && (reason === undefined || reason.length === 0)) {\n\t\t\t\tthrow new Error(\"reason is required when status is blocked\");\n\t\t\t}\n\t\t\tif (params.status === \"complete\" && reason !== undefined && reason.length > 0) {\n\t\t\t\tthrow new Error(\"reason must not be provided when status is complete\");\n\t\t\t}\n\t\t\tif (params.status === \"complete\") {\n\t\t\t\tconst openTasks = openTodoTaskContents(ctx.sessionManager.getBranch());\n\t\t\t\tif (openTasks.length > 0) throw new Error(openTodoCompletionError(openTasks));\n\t\t\t}\n\t\t\tawait deps.accountCurrentAgentTurn(ctx, \"active\");\n\t\t\tconst goal = await updateGoal(\n\t\t\t\tdeps.goalStoreRef(ctx),\n\t\t\t\tparams.status === \"blocked\" ? { status: \"blocked\", reason } : { status: \"complete\" },\n\t\t\t\t\"model\",\n\t\t\t);\n\t\t\tif (goal.status === \"blocked\") deps.markGoalBlockedThisTurn(goal);\n\t\t\telse deps.markGoalCompletedThisTurn(goal);\n\t\t\tdeps.refreshGoalUi(ctx, goal);\n\t\t\treturn toolText(formatGoalToolResponse(goal), goalToolRenderDetails(goal));\n\t\t},\n\t\trenderCall: (args, theme) => renderGoalToolCall(\"update_goal\", args, theme),\n\t\trenderResult: (result, options, theme) => renderGoalToolResult(result, options, theme),\n\t});\n\n\tpi.registerTool({\n\t\tname: \"get_goal\",\n\t\tlabel: \"Get Goal\",\n\t\tdescription: \"Get the current goal for this thread, including status, token and elapsed-time usage.\",\n\t\tparameters: Type.Object({}, { additionalProperties: false }),\n\t\tasync execute(_toolCallId, _params, _signal, _onUpdate, ctx) {\n\t\t\tconst goal = await deps.accountCurrentAgentTurn(ctx, \"active\");\n\t\t\tdeps.refreshGoalUi(ctx, goal);\n\t\t\treturn toolText(formatGoalToolResponse(goal), goalToolRenderDetails(goal));\n\t\t},\n\t\trenderCall: (args, theme) => renderGoalToolCall(\"get_goal\", args, theme),\n\t\trenderResult: (result, options, theme) => renderGoalToolResult(result, options, theme),\n\t});\n}\n\nfunction toolText(text: string, details: GoalToolRenderDetails): GoalToolResult {\n\treturn { content: [{ type: \"text\" as const, text }], details };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-account.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/gpt-account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gpt-account.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/gpt-account.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAA2B,MAAM,aAAa,CAAC;AAQzE,MAAM,WAAW,uBAAuB;IACvC,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC3D;AAsED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,GAAE,uBAA4B,GAAG,IAAI,CAoCtG"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { accountLabel } from "@earendil-works/pi-ai/auth/pool/slots";
|
|
1
2
|
import { getCredentialAccounts, pinCredentialAccount, removeCredentialAccount, } from "../../../core/credential-accounts.js";
|
|
3
|
+
import { accountDisplayNameCommand, promptAccountDisplayName } from "./account-display-name.js";
|
|
2
4
|
import { emitProviderAccountsChanged } from "./claude-sdk-oauth/account-events.js";
|
|
3
5
|
import { createExtensionLoginInteraction, LOGIN_CANCELLED_MESSAGE } from "./oauth-login-interaction.js";
|
|
4
6
|
const OPENAI_CODEX_PROVIDER_ID = "openai-codex";
|
|
@@ -7,7 +9,7 @@ function parseArgs(rawArgs) {
|
|
|
7
9
|
return rawArgs.trim().split(/\s+/).filter(Boolean);
|
|
8
10
|
}
|
|
9
11
|
function usage(ctx) {
|
|
10
|
-
ctx.ui.notify("Usage: /gpt-account [add | remove <
|
|
12
|
+
ctx.ui.notify("Usage: /gpt-account [add | remove <id> | pin <id> | unpin | rename <id> <display name...> | clear-name <id>]", "error");
|
|
11
13
|
}
|
|
12
14
|
async function showAccounts(ctx) {
|
|
13
15
|
const accounts = await getCredentialAccounts(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID);
|
|
@@ -15,7 +17,7 @@ async function showAccounts(ctx) {
|
|
|
15
17
|
if (accounts.length === 0)
|
|
16
18
|
lines.push(" (none)");
|
|
17
19
|
for (const account of accounts) {
|
|
18
|
-
const states = [account
|
|
20
|
+
const states = [accountLabel(account), account.source, account.blocked ? "blocked" : "available"];
|
|
19
21
|
if (account.pinned)
|
|
20
22
|
states.push("pinned");
|
|
21
23
|
lines.push(` ${states.join(" | ")}`);
|
|
@@ -28,13 +30,20 @@ async function addAccount(ctx, deps) {
|
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
30
32
|
try {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
let receipt;
|
|
34
|
+
await ctx.modelRegistry.modelRuntime.login(OPENAI_CODEX_PROVIDER_ID, "oauth", {
|
|
35
|
+
...createExtensionLoginInteraction(ctx, {
|
|
36
|
+
providerLabel: OPENAI_CODEX_PROVIDER_LABEL,
|
|
37
|
+
providerId: OPENAI_CODEX_PROVIDER_ID,
|
|
38
|
+
openBrowser: deps.openBrowser,
|
|
39
|
+
}),
|
|
40
|
+
onAccountCommitted: (committed) => {
|
|
41
|
+
receipt = committed;
|
|
42
|
+
},
|
|
43
|
+
});
|
|
36
44
|
emitProviderAccountsChanged(OPENAI_CODEX_PROVIDER_ID);
|
|
37
45
|
ctx.ui.notify("OpenAI Codex OAuth account added.", "info");
|
|
46
|
+
await promptAccountDisplayName(ctx, receipt);
|
|
38
47
|
}
|
|
39
48
|
catch (error) {
|
|
40
49
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -62,8 +71,10 @@ async function pinAccount(ctx, name) {
|
|
|
62
71
|
export default function gptAccountExtension(pi, deps = {}) {
|
|
63
72
|
pi.registerCommand("gpt-account", {
|
|
64
73
|
description: "List and manage OpenAI Codex OAuth accounts.",
|
|
65
|
-
argumentHint: "[add | remove <
|
|
74
|
+
argumentHint: "[add | remove <id> | pin <id> | unpin | rename <id> <display name...> | clear-name <id>]",
|
|
66
75
|
handler: async (rawArgs, ctx) => {
|
|
76
|
+
if (await accountDisplayNameCommand(ctx, OPENAI_CODEX_PROVIDER_ID, rawArgs))
|
|
77
|
+
return;
|
|
67
78
|
const args = parseArgs(rawArgs);
|
|
68
79
|
const action = args[0] ?? "list";
|
|
69
80
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-account.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/gpt-account.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gpt-account.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/gpt-account.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EACN,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,GACvB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAChG,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,EAAE,+BAA+B,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAExG,MAAM,wBAAwB,GAAG,cAAc,CAAC;AAChD,MAAM,2BAA2B,GAAG,oBAAoB,CAAC;AAOzD,SAAS,SAAS,CAAC,OAAe;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AAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC/B,OAAO;gBACR,CAAC;gBACD,IAAI,MAAM,KAAK,OAAO,IAAI,CAAC,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,EAAE,CAAC;oBACrE,MAAM,oBAAoB,CAAC,GAAG,CAAC,aAAa,CAAC,WAAW,EAAE,wBAAwB,EAAE,IAAI,CAAC,CAAC;oBAC1F,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,sCAAsC,EAAE,MAAM,CAAC,CAAC;oBAC9D,OAAO;gBACR,CAAC;gBACD,KAAK,CAAC,GAAG,CAAC,CAAC;YACZ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;YAChF,CAAC;QACF,CAAC;KACD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { AccountLoginReceipt } from \"@earendil-works/pi-ai\";\nimport { accountLabel } from \"@earendil-works/pi-ai/auth/pool/slots\";\nimport {\n\tgetCredentialAccounts,\n\tpinCredentialAccount,\n\tremoveCredentialAccount,\n} from \"../../../core/credential-accounts.ts\";\nimport type { ExtensionAPI, ExtensionCommandContext } from \"../types.ts\";\nimport { accountDisplayNameCommand, promptAccountDisplayName } from \"./account-display-name.ts\";\nimport { emitProviderAccountsChanged } from \"./claude-sdk-oauth/account-events.ts\";\nimport { createExtensionLoginInteraction, LOGIN_CANCELLED_MESSAGE } from \"./oauth-login-interaction.ts\";\n\nconst OPENAI_CODEX_PROVIDER_ID = \"openai-codex\";\nconst OPENAI_CODEX_PROVIDER_LABEL = \"OpenAI Codex OAuth\";\n\nexport interface GptAccountExtensionDeps {\n\t/** Browser launcher for the browser login method; tests inject a recorder. */\n\treadonly openBrowser?: ((url: string) => void) | undefined;\n}\n\nfunction parseArgs(rawArgs: string): string[] {\n\treturn rawArgs.trim().split(/\\s+/).filter(Boolean);\n}\n\nfunction usage(ctx: ExtensionCommandContext): void {\n\tctx.ui.notify(\n\t\t\"Usage: /gpt-account [add | remove <id> | pin <id> | unpin | rename <id> <display name...> | clear-name <id>]\",\n\t\t\"error\",\n\t);\n}\n\nasync function showAccounts(ctx: ExtensionCommandContext): Promise<void> {\n\tconst accounts = await getCredentialAccounts(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID);\n\tconst lines = [\"OpenAI Codex OAuth accounts:\"];\n\tif (accounts.length === 0) lines.push(\" (none)\");\n\tfor (const account of accounts) {\n\t\tconst states = [accountLabel(account), account.source, account.blocked ? \"blocked\" : \"available\"];\n\t\tif (account.pinned) states.push(\"pinned\");\n\t\tlines.push(` ${states.join(\" | \")}`);\n\t}\n\tctx.ui.notify(lines.join(\"\\n\"), \"info\");\n}\n\nasync function addAccount(ctx: ExtensionCommandContext, deps: GptAccountExtensionDeps): Promise<void> {\n\tif (!ctx.hasUI) {\n\t\tctx.ui.notify(\"/gpt-account add requires an interactive UI.\", \"error\");\n\t\treturn;\n\t}\n\ttry {\n\t\tlet receipt: AccountLoginReceipt | undefined;\n\t\tawait ctx.modelRegistry.modelRuntime.login(OPENAI_CODEX_PROVIDER_ID, \"oauth\", {\n\t\t\t...createExtensionLoginInteraction(ctx, {\n\t\t\t\tproviderLabel: OPENAI_CODEX_PROVIDER_LABEL,\n\t\t\t\tproviderId: OPENAI_CODEX_PROVIDER_ID,\n\t\t\t\topenBrowser: deps.openBrowser,\n\t\t\t}),\n\t\t\tonAccountCommitted: (committed) => {\n\t\t\t\treceipt = committed;\n\t\t\t},\n\t\t});\n\t\temitProviderAccountsChanged(OPENAI_CODEX_PROVIDER_ID);\n\t\tctx.ui.notify(\"OpenAI Codex OAuth account added.\", \"info\");\n\t\tawait promptAccountDisplayName(ctx, receipt);\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tif (message === LOGIN_CANCELLED_MESSAGE) return;\n\t\tctx.ui.notify(message, \"error\");\n\t}\n}\n\nasync function removeAccount(ctx: ExtensionCommandContext, name: string | undefined): Promise<void> {\n\tif (!name) {\n\t\tusage(ctx);\n\t\treturn;\n\t}\n\tawait removeCredentialAccount(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID, name);\n\tctx.ui.notify(`Removed OpenAI Codex OAuth account '${name}'.`, \"info\");\n}\n\nasync function pinAccount(ctx: ExtensionCommandContext, name: string | undefined): Promise<void> {\n\tif (!name) {\n\t\tusage(ctx);\n\t\treturn;\n\t}\n\tawait pinCredentialAccount(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID, name);\n\tctx.ui.notify(`Pinned OpenAI Codex OAuth account '${name}'.`, \"info\");\n}\n\nexport default function gptAccountExtension(pi: ExtensionAPI, deps: GptAccountExtensionDeps = {}): void {\n\tpi.registerCommand(\"gpt-account\", {\n\t\tdescription: \"List and manage OpenAI Codex OAuth accounts.\",\n\t\targumentHint: \"[add | remove <id> | pin <id> | unpin | rename <id> <display name...> | clear-name <id>]\",\n\t\thandler: async (rawArgs, ctx) => {\n\t\t\tif (await accountDisplayNameCommand(ctx, OPENAI_CODEX_PROVIDER_ID, rawArgs)) return;\n\t\t\tconst args = parseArgs(rawArgs);\n\t\t\tconst action = args[0] ?? \"list\";\n\t\t\ttry {\n\t\t\t\tif (action === \"list\") {\n\t\t\t\t\tawait showAccounts(ctx);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (action === \"add\") {\n\t\t\t\t\tawait addAccount(ctx, deps);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (action === \"remove\") {\n\t\t\t\t\tawait removeAccount(ctx, args[1]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (action === \"pin\" && args[1] !== \"unpin\") {\n\t\t\t\t\tawait pinAccount(ctx, args[1]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (action === \"unpin\" || (action === \"pin\" && args[1] === \"unpin\")) {\n\t\t\t\t\tawait pinCredentialAccount(ctx.modelRegistry.authStorage, OPENAI_CODEX_PROVIDER_ID, null);\n\t\t\t\t\tctx.ui.notify(\"Unpinned OpenAI Codex OAuth account.\", \"info\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tusage(ctx);\n\t\t\t} catch (error) {\n\t\t\t\tctx.ui.notify(error instanceof Error ? error.message : String(error), \"error\");\n\t\t\t}\n\t\t},\n\t});\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepseek-v4-1-flash.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAGlH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAM5F"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// DeepSeek V4.1 Flash (2026-09-10) is a new pre-train, not a V4 Flash refresh,
|
|
2
|
+
// so it carries none of the DEEPSEEK_V4_RULES: each of those repairs a failure
|
|
3
|
+
// observed on V4-Flash-0731 transcripts, and a re-trained model does not
|
|
4
|
+
// inherit them. DeepSeek's own scaffold comparison (tech report Table 4, same
|
|
5
|
+
// checkpoint) ranks the thinnest harness highest - DSH Minimal, a one-sentence
|
|
6
|
+
// system prompt plus bash, scores 90.6 on Terminal-Bench 2.1 vs 85.8 for DSH
|
|
7
|
+
// Standard - so the preset renders the shared core and the eval-routing stance
|
|
8
|
+
// only. A V4.1-specific rule is added against a V4.1 trace by listing this
|
|
9
|
+
// preset in that rule's `presets`.
|
|
10
|
+
import { buildDynamicSystemPrompt } from "../../../dynamic-prompt/build.js";
|
|
11
|
+
import { buildExecutionToolingSection } from "./execution-tooling.js";
|
|
12
|
+
export function buildDeepseekV41FlashPrompt(options) {
|
|
13
|
+
return buildDynamicSystemPrompt({
|
|
14
|
+
...options,
|
|
15
|
+
tuningSection: buildExecutionToolingSection({ toolNames: options.selectedTools, dialect: "claude" }),
|
|
16
|
+
workstationDialect: "claude",
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=deepseek-v4-1-flash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepseek-v4-1-flash.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,+EAA+E;AAC/E,yEAAyE;AACzE,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,+EAA+E;AAC/E,2EAA2E;AAC3E,mCAAmC;AAEnC,OAAO,EAAwC,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAClH,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,UAAU,2BAA2B,CAAC,OAAwC;IACnF,OAAO,wBAAwB,CAAC;QAC/B,GAAG,OAAO;QACV,aAAa,EAAE,4BAA4B,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;QACpG,kBAAkB,EAAE,QAAQ;KAC5B,CAAC,CAAC;AACJ,CAAC","sourcesContent":["// DeepSeek V4.1 Flash (2026-09-10) is a new pre-train, not a V4 Flash refresh,\n// so it carries none of the DEEPSEEK_V4_RULES: each of those repairs a failure\n// observed on V4-Flash-0731 transcripts, and a re-trained model does not\n// inherit them. DeepSeek's own scaffold comparison (tech report Table 4, same\n// checkpoint) ranks the thinnest harness highest - DSH Minimal, a one-sentence\n// system prompt plus bash, scores 90.6 on Terminal-Bench 2.1 vs 85.8 for DSH\n// Standard - so the preset renders the shared core and the eval-routing stance\n// only. A V4.1-specific rule is added against a V4.1 trace by listing this\n// preset in that rule's `presets`.\n\nimport { type BuildDynamicSystemPromptOptions, buildDynamicSystemPrompt } from \"../../../dynamic-prompt/build.ts\";\nimport { buildExecutionToolingSection } from \"./execution-tooling.ts\";\n\nexport function buildDeepseekV41FlashPrompt(options: BuildDynamicSystemPromptOptions): string {\n\treturn buildDynamicSystemPrompt({\n\t\t...options,\n\t\ttuningSection: buildExecutionToolingSection({ toolNames: options.selectedTools, dialect: \"claude\" }),\n\t\tworkstationDialect: \"claude\",\n\t});\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type BuildDynamicSystemPromptOptions } from "../../../dynamic-prompt/build.ts";
|
|
2
|
-
export type Gpt6AstraRuleId = "initiative-bias" | "approval-last" | "steering" | "no-unsolicited-caution" | "memory-first" | "instruction-precedence" | "pause-transparency" | "eval-first-routing" | "evidence-comparison" | "perceived-state-loop" | "bun-runtime" | "stay-direct-exceptions" | "lsp-symbol-routing" | "delegation" | "legible-messages" | "todo-granularity" | "async-default" | "foreground-exception" | "turn-end-is-wait" | "monitor-conditions" | "verification-once" | "test-first" | "
|
|
2
|
+
export type Gpt6AstraRuleId = "initiative-bias" | "approval-last" | "steering" | "no-unsolicited-caution" | "memory-first" | "instruction-precedence" | "pause-transparency" | "eval-first-routing" | "evidence-comparison" | "perceived-state-loop" | "bun-runtime" | "stay-direct-exceptions" | "lsp-symbol-routing" | "delegation" | "legible-messages" | "todo-granularity" | "async-default" | "foreground-exception" | "turn-end-is-wait" | "monitor-conditions" | "verification-once" | "test-first" | "unbounded-retry" | "atomic-commits" | "no-external-messaging" | "plain-prose" | "slop-ban" | "direct-statements" | "final-message-shape";
|
|
3
3
|
export type Gpt6AstraConcern = "initiative" | "instruction-precedence" | "tool-orchestration" | "symbol-routing" | "delegation" | "todo-discipline" | "async-work" | "verification" | "test-first" | "failure-recovery" | "commit-discipline" | "external-side-effects" | "writing-style" | "reporting";
|
|
4
4
|
export interface Gpt6AstraRule {
|
|
5
5
|
id: Gpt6AstraRuleId;
|
|
@@ -13,7 +13,7 @@ export declare const GPT6_ASTRA_RULES: readonly [{
|
|
|
13
13
|
}, {
|
|
14
14
|
readonly id: "approval-last";
|
|
15
15
|
readonly concern: "initiative";
|
|
16
|
-
readonly directive: "Authorization persists across the session, and read-only actions, reversible local edits, in-scope fixes, and non-destructive validation never need it. Ask only
|
|
16
|
+
readonly directive: "Authorization persists across the session, and read-only actions, reversible local edits, in-scope fixes, and non-destructive validation never need it. Ask only for an answer the session cannot supply that would change the outcome, after finishing everything that does not depend on it, so the user approves a concrete, reviewable result: a deploy, an external write, a merge, or a destructive command is the last step. Stopping to ask costs the user more than a reversible wrong guess costs you. Ask through request_user_input when it is available, with wait_for_answer false so the question rides along while you keep working - true only when an irreversible next step turns on the answer; if it returns no answers, proceed on best judgment. Never use it for permission requests - state those directly.";
|
|
17
17
|
}, {
|
|
18
18
|
readonly id: "steering";
|
|
19
19
|
readonly concern: "initiative";
|
|
@@ -53,7 +53,7 @@ export declare const GPT6_ASTRA_RULES: readonly [{
|
|
|
53
53
|
}, {
|
|
54
54
|
readonly id: "stay-direct-exceptions";
|
|
55
55
|
readonly concern: "tool-orchestration";
|
|
56
|
-
readonly directive: "Skip the cell when it buys nothing: a lone call, an already-small result, a result you must read before choosing the next call, a judgment call between steps, or an action that needs approval.
|
|
56
|
+
readonly directive: "Skip the cell when it buys nothing: a lone call, an already-small result, a result you must read before choosing the next call, a judgment call between steps, or an action that needs approval.";
|
|
57
57
|
}, {
|
|
58
58
|
readonly id: "lsp-symbol-routing";
|
|
59
59
|
readonly concern: "symbol-routing";
|
|
@@ -81,7 +81,7 @@ export declare const GPT6_ASTRA_RULES: readonly [{
|
|
|
81
81
|
}, {
|
|
82
82
|
readonly id: "turn-end-is-wait";
|
|
83
83
|
readonly concern: "async-work";
|
|
84
|
-
readonly directive: "**THERE IS NO WAIT TOOL. WHEN THE NEXT STEP NEEDS A PENDING RESULT
|
|
84
|
+
readonly directive: "**THERE IS NO WAIT TOOL. END YOUR TURN WHEN THE NEXT STEP NEEDS A PENDING RESULT AND A HANDLE WILL WAKE YOU; WITH NOTHING PENDING AND WORK STILL OPEN, THE TURN KEEPS GOING.** Repeated status reads, sleeps, and timed retries replay the whole context for nothing; a single peek serves a midpoint decision only.";
|
|
85
85
|
}, {
|
|
86
86
|
readonly id: "monitor-conditions";
|
|
87
87
|
readonly concern: "async-work";
|
|
@@ -95,9 +95,9 @@ export declare const GPT6_ASTRA_RULES: readonly [{
|
|
|
95
95
|
readonly concern: "test-first";
|
|
96
96
|
readonly directive: "A behavior change starts with one failing test at the seam it touches, watched to fail for the right reason, then the smallest change that passes it. Formatting, comments, renames, dependency bumps, and visual-only work get review and a real-surface check instead; leave out any test that mirrors the implementation or cannot fail for the regression it names.";
|
|
97
97
|
}, {
|
|
98
|
-
readonly id: "
|
|
98
|
+
readonly id: "unbounded-retry";
|
|
99
99
|
readonly concern: "failure-recovery";
|
|
100
|
-
readonly directive: "When an approach fails, change something material - a different algorithm, library, or
|
|
100
|
+
readonly directive: "When an approach fails, change something material - a different algorithm, library, source, or assumption - and re-verify after each attempt, since stale state explains most confusing failures. There is no attempt limit: keep going until the objective holds, and when a lookup comes back empty or thin, widen it to another source or run it directly before you treat the absence as a fact. Restore broken files to the last known-good state before the next approach, and bring the user in only for a decision that is theirs to make.";
|
|
101
101
|
}, {
|
|
102
102
|
readonly id: "atomic-commits";
|
|
103
103
|
readonly concern: "commit-discipline";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gpt-6-astra.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-6-astra.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gpt-6-astra.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/prompt-preset/gpt-6-astra.ts"],"names":[],"mappings":"AAqHA,OAAO,EAAE,KAAK,+BAA+B,EAA4B,MAAM,kCAAkC,CAAC;AAKlH,M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BACnC,kBAAkB;sBAAW,YAAY;;;iBACzC,kBAAkB;sBAAW,iBAAiB;;;iBAC9C,eAAe;sBAAW,YAAY;;;iBACtC,sBAAsB;sBAAW,YAAY;;;iBAC7C,kBAAkB;sBAAW,YAAY;;;iBACzC,oBAAoB;sBAAW,YAAY;;;iBAC3C,mBAAmB;sBAAW,cAAc;;;iBAC5C,YAAY;sBAAW,YAAY;;;iBACnC,iBAAiB;sBAAW,kBAAkB;;;iBAC9C,gBAAgB;sBAAW,mBAAmB;;;iBAC9C,uBAAuB;sBAAW,uBAAuB;;;iBACzD,aAAa;sBAAW,eAAe;;;iBACvC,UAAU;sBAAW,eAAe;;;iBACpC,mBAAmB;sBAAW,eAAe;;;iBAC7C,qBAAqB;sBAAW,WAAW;;EACL,CAAC;AAoF9C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,+BAA+B,GAAG,MAAM,CAErF"}
|
|
@@ -59,6 +59,25 @@
|
|
|
59
59
|
// screenshots across viewports before finishing, so `eval-first-routing`,
|
|
60
60
|
// `evidence-comparison`, and `perceived-state-loop` follow that prior.
|
|
61
61
|
//
|
|
62
|
+
// 2026-09-11: a survey of 703 sessions since 09-04 (16,688 turns) found Astra
|
|
63
|
+
// ending 14.9% of its human-facing turns on a named next step it never took
|
|
64
|
+
// (claude-fable 3.0%, opus 3.7%, kimi 3.1%) and calling update_goal(blocked) 24
|
|
65
|
+
// times against 3 for fable. One session shows the composition: a turn ended on
|
|
66
|
+
// "11개를 모두 넣어야 합니다" with nothing armed, and two blocked calls landed on the
|
|
67
|
+
// second goal turn against data that was one KV namespace away. Three rules owned
|
|
68
|
+
// that: `turn-end-is-wait` was the loudest rule in the file and said only that a
|
|
69
|
+
// pending result ends the turn, so it now carries the condition - a handle must
|
|
70
|
+
// be there to wake the session, and nothing pending with work open keeps the turn
|
|
71
|
+
// going; the reporting sentence let a named next step stand in for taking it; and
|
|
72
|
+
// `failure-cap` capped attempts at three and terminated in a question, which for a
|
|
73
|
+
// model the guide already describes as asking more and stopping earlier reads as
|
|
74
|
+
// permission to stop. It is replaced by `unbounded-retry`: no attempt limit, a
|
|
75
|
+
// material change per attempt, and an empty lookup widens the source before
|
|
76
|
+
// absence is a fact. `approval-last` now defaults wait_for_answer to false and
|
|
77
|
+
// carries the cost of stopping, matching codex's Default collaboration mode
|
|
78
|
+
// ("strongly prefer making reasonable assumptions and executing the user's
|
|
79
|
+
// request"; request_user_input is non-blocking outside Plan mode).
|
|
80
|
+
//
|
|
62
81
|
// Two harness facts Astra cannot derive get their own sections. Astra is
|
|
63
82
|
// trained on async tool calling (an `async: true` call returns later on its
|
|
64
83
|
// original call_id, with an optional developer-defined wait tool), while senpi
|
|
@@ -99,7 +118,7 @@ import { buildTestDisciplineSection } from "../../../dynamic-prompt/verification
|
|
|
99
118
|
import { buildFileOperationsTuning } from "./file-operations.js";
|
|
100
119
|
import { buildGptEvalRoutingTuning } from "./gpt-eval-routing.js";
|
|
101
120
|
const INITIATIVE_BIAS = "The request sets the scope; deliver all of it and only it. Fill routine gaps from the codebase and the conversation, and carry the task to completion through failed tool calls, long turns, and the urge to hand back a draft; when one part is blocked by something outside your reach, finish every other part and say exactly what you left out and why.";
|
|
102
|
-
const APPROVAL_LAST = "Authorization persists across the session, and read-only actions, reversible local edits, in-scope fixes, and non-destructive validation never need it. Ask only
|
|
121
|
+
const APPROVAL_LAST = "Authorization persists across the session, and read-only actions, reversible local edits, in-scope fixes, and non-destructive validation never need it. Ask only for an answer the session cannot supply that would change the outcome, after finishing everything that does not depend on it, so the user approves a concrete, reviewable result: a deploy, an external write, a merge, or a destructive command is the last step. Stopping to ask costs the user more than a reversible wrong guess costs you. Ask through request_user_input when it is available, with wait_for_answer false so the question rides along while you keep working - true only when an irreversible next step turns on the answer; if it returns no answers, proceed on best judgment. Never use it for permission requests - state those directly.";
|
|
103
122
|
const STEERING = "A message that arrives mid-task steers it rather than opening a new request: fold in corrections and constraints, answer a status question in a sentence, and keep going under the reading you already declared, so the reply opens with the work rather than another routing line; drop the task only when the user cancels it or asks for something incompatible.";
|
|
104
123
|
const NO_UNSOLICITED_CAUTION = "When the user's plan is flawed, say what breaks and what to do instead, once, then follow their call. Add no warnings, disclaimers, approval steps, or compliance checklists for hypothetical risk.";
|
|
105
124
|
const MEMORY_FIRST = "Memory holds what this user told earlier sessions: consult it before asking anything it may already answer, and take their preferences and working habits from it, so your defaults are this user's rather than a generic user's.";
|
|
@@ -109,18 +128,18 @@ const EVAL_FIRST_ROUTING = "When `eval` is available, batch the independent read
|
|
|
109
128
|
const EVIDENCE_COMPARISON = "Name the state a cell should produce before running it and compare the returned evidence with that state when it comes back; a cell that changed something is also checked for changes beyond that state. A result that hides a failed item or a truncated tail is not evidence.";
|
|
110
129
|
const PERCEIVED_STATE_LOOP = "When the result must be seen rather than read - a page, a component, an image, a 3D scene, a layout - make one change, render or screenshot it, look, then make the next; check a 3D scene from several angles and a page at desktop and mobile widths for blank, misframed, or overlapping output. Compare what you see with the reference or the stated intent, and ask only where two readings of that intent diverge.";
|
|
111
130
|
const BUN_RUNTIME = "Default to js on Bun: when the eval tool names the bun-1-4 skill, read it before your first js cell and reach for Bun builtins before adding a dependency.";
|
|
112
|
-
const STAY_DIRECT_EXCEPTIONS = "Skip the cell when it buys nothing: a lone call, an already-small result, a result you must read before choosing the next call, a judgment call between steps, or an action that needs approval.
|
|
131
|
+
const STAY_DIRECT_EXCEPTIONS = "Skip the cell when it buys nothing: a lone call, an already-small result, a result you must read before choosing the next call, a judgment call between steps, or an action that needs approval.";
|
|
113
132
|
const LSP_SYMBOL_ROUTING = "Where LSP tools exist, let the language server answer symbol questions - a definition, its callers, the blast radius of a rename, the diagnostics on a file you just touched. Plain text search earns its place on literal strings, filenames, and commit history.";
|
|
114
133
|
const DELEGATION = "Do the work yourself by default: whatever closes in a handful of calls is yours, and a follow-up on work you delegated is yours to take back, not to forward. Only a sizeable track independent of your own earns a subagent; spawn such tracks together in the background, each brief stating what to produce, where its edits may land, the observable condition that ends it, and the evidence it hands back for you to check.";
|
|
115
134
|
const LEGIBLE_MESSAGES = "Messages to other agents and your final answer are read by people: full sentences, proper spaces between words and numbers, no private shorthand.";
|
|
116
135
|
const TODO_GRANULARITY = "Given a todo tool, cut multi-step work into the smallest items that still stand alone - an edit paired with the check that proves it - and move each one the instant its state changes: opened, finished, newly discovered and appended, abandoned and dropped. A one-step ask carries no list.";
|
|
117
136
|
const ASYNC_DEFAULT = "**ASYNCHRONOUS IS THE DEFAULT FORM OF EVERY CALL THAT OFFERS ONE: CHILD TASKS AND BASH SESSIONS START IN THE BACKGROUND, A LONG COMPUTATION DETACHES ITS EVAL CELL, AND A WAIT IS A `tool.monitor` SUBSCRIPTION - NEVER A CELL THAT SITS ON A `--watch` OR A SPAWNED PROCESS, NEVER A CHILD SPAWNED TO WATCH.** Each returns a handle at once and delivers its result later as a message; treat the handle like a pending async call and keep working on everything that does not need it.";
|
|
118
137
|
const FOREGROUND_EXCEPTION = "Block only on a call that finishes within the time a reply takes and decides your very next call, or on an approval-gated or destructive action you must watch directly. A child task never meets the first test; when its result would be your next input, either the work was small enough to do yourself or the child runs in the background and its completion delivers it.";
|
|
119
|
-
const TURN_END_IS_WAIT = "**THERE IS NO WAIT TOOL. WHEN THE NEXT STEP NEEDS A PENDING RESULT
|
|
138
|
+
const TURN_END_IS_WAIT = "**THERE IS NO WAIT TOOL. END YOUR TURN WHEN THE NEXT STEP NEEDS A PENDING RESULT AND A HANDLE WILL WAKE YOU; WITH NOTHING PENDING AND WORK STILL OPEN, THE TURN KEEPS GOING.** Repeated status reads, sleeps, and timed retries replay the whole context for nothing; a single peek serves a midpoint decision only.";
|
|
120
139
|
const MONITOR_CONDITIONS = "**EVERY CONDITION YOU WOULD OTHERWISE CHECK ON GETS A SUBSCRIPTION: `tool.monitor({ description, command, filter })` FROM THE EVAL CELL THAT STARTS THE RUN** (a direct `monitor` call only in a session without `eval`). A build, install, or test run finishing, a CI check or PR turning green, a deploy landing, a log line, a file appearing, another session or machine changing state: arm the watch the moment your work starts it or the user names it. A run, check, PR, or deploy the user mentions is in scope even when the ask is about something else - it gets its watch in the same turn, without being asked. The subscription is the whole cost of the wait and its matching line wakes you; a cell that awaits the wait holds the js kernel until the cell limit kills it. Steer, read, or stop a running session or child through its session tools instead of launching a duplicate.";
|
|
121
140
|
const VERIFICATION_ONCE = "Broaden or repeat checks only when a new change, a failure, or an open concern justifies it; otherwise keep moving toward completion.";
|
|
122
141
|
const TEST_FIRST = "A behavior change starts with one failing test at the seam it touches, watched to fail for the right reason, then the smallest change that passes it. Formatting, comments, renames, dependency bumps, and visual-only work get review and a real-surface check instead; leave out any test that mirrors the implementation or cannot fail for the regression it names.";
|
|
123
|
-
const
|
|
142
|
+
const UNBOUNDED_RETRY = "When an approach fails, change something material - a different algorithm, library, source, or assumption - and re-verify after each attempt, since stale state explains most confusing failures. There is no attempt limit: keep going until the objective holds, and when a lookup comes back empty or thin, widen it to another source or run it directly before you treat the absence as a fact. Restore broken files to the last known-good state before the next approach, and bring the user in only for a decision that is theirs to make.";
|
|
124
143
|
const ATOMIC_COMMITS = "Once commits are authorized, land one per verified increment, written in the convention the log already uses, and each buildable and green on its own rather than a single sweep at the end.";
|
|
125
144
|
const NO_EXTERNAL_MESSAGING = "Never send messages to people through tools - chat, email, issue or PR comments, posts - without the user's explicit authorization for that message.";
|
|
126
145
|
const PLAIN_PROSE = "Write the way a careful engineer writes to a colleague: plain words, concrete nouns, exact paths, commands, numbers, and error text, in connected paragraphs that each develop one idea. Lead with the point, so the reader gets the answer from the first sentence and the reasons from the next few, and calibrate depth to what the user already knows. Use a list only when the items are parallel - several files, several options - and a heading only when a long reply has independent parts a reader will jump between.";
|
|
@@ -150,7 +169,7 @@ export const GPT6_ASTRA_RULES = [
|
|
|
150
169
|
{ id: "monitor-conditions", concern: "async-work", directive: MONITOR_CONDITIONS },
|
|
151
170
|
{ id: "verification-once", concern: "verification", directive: VERIFICATION_ONCE },
|
|
152
171
|
{ id: "test-first", concern: "test-first", directive: TEST_FIRST },
|
|
153
|
-
{ id: "
|
|
172
|
+
{ id: "unbounded-retry", concern: "failure-recovery", directive: UNBOUNDED_RETRY },
|
|
154
173
|
{ id: "atomic-commits", concern: "commit-discipline", directive: ATOMIC_COMMITS },
|
|
155
174
|
{ id: "no-external-messaging", concern: "external-side-effects", directive: NO_EXTERNAL_MESSAGING },
|
|
156
175
|
{ id: "plain-prose", concern: "writing-style", directive: PLAIN_PROSE },
|
|
@@ -207,7 +226,7 @@ Say plainly what you could not run and why; fix failures your change caused and
|
|
|
207
226
|
|
|
208
227
|
The smallest correct change wins: fewer new names, helpers, and layers; single-use logic stays inline; no error handling, fallbacks, retries, or compatibility shims for cases the current contracts exclude; validation at system boundaries only. A pre-existing bug or cleanup opportunity beside your change goes in the final message while the diff stays focused. Match the codebase's style even where you would choose differently.
|
|
209
228
|
|
|
210
|
-
${
|
|
229
|
+
${UNBOUNDED_RETRY}
|
|
211
230
|
|
|
212
231
|
${context.toolSection}
|
|
213
232
|
|
|
@@ -229,7 +248,7 @@ Be direct and tactful: disagree when you have a reason and say the reason; no fl
|
|
|
229
248
|
|
|
230
249
|
## Reporting
|
|
231
250
|
|
|
232
|
-
While working, speak only when something changes the plan - a finding, a tradeoff decision, a blocker - in one or two sentences naming the concrete outcome and the next step
|
|
251
|
+
While working, speak only when something changes the plan - a finding, a tradeoff decision, a blocker - in one or two sentences naming the concrete outcome and the next step, then take that step in the same turn: a plan, a hypothesis, a status report, or an offer to continue never stands in for the work. Routine reads and passing checks go unnarrated. ${FINAL_MESSAGE_SHAPE}
|
|
233
252
|
|
|
234
253
|
Code reviews: findings first, ordered by severity with file references, then open questions and assumptions, then the change summary; with no findings, say so and name the residual risks. Reference code as \`src/auth.ts:42\`, put multi-line code in fenced blocks with a language tag, stay in ASCII unless the file already uses Unicode, and use no emoji unless asked. Commit messages and PR descriptions follow the same rule: describe the final change for a reviewer who never saw the conversation.
|
|
235
254
|
|