@code-yeongyu/senpi 2026.9.9 → 2026.9.10
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 +82 -1
- package/README.md +2 -0
- package/dist/beta/omo-local-update-worker.js.map +1 -1
- package/dist/beta/omo-local-update.d.ts.map +1 -1
- package/dist/brand-dir-migration.js.map +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +1 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-check.js.map +1 -1
- package/dist/cli/experimental/command.d.ts.map +1 -1
- package/dist/cli/grok-neo-gate.js.map +1 -1
- package/dist/cli/startup-ui.js.map +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/client/remote-session.d.ts.map +1 -1
- package/dist/client/remote-session.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +43 -19
- package/dist/config.js.map +1 -1
- package/dist/core/agent-abort-provenance.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +46 -7
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +109 -6
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/agent-settled-delivery.d.ts.map +1 -1
- package/dist/core/auth-providers.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/brand.js.map +1 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/lifecycle.d.ts.map +1 -1
- package/dist/core/compaction/stream-watchdog.d.ts.map +1 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/credential-accounts.js.map +1 -1
- package/dist/core/credential-pool/classify.js.map +1 -1
- package/dist/core/credential-pool/failover.d.ts.map +1 -1
- package/dist/core/credential-pool/rotation-stream.js.map +1 -1
- package/dist/core/credential-pool/state-store.d.ts +2 -2
- package/dist/core/credential-pool/state-store.d.ts.map +1 -1
- package/dist/core/credential-pool/state-store.js.map +1 -1
- package/dist/core/dynamic-prompt/verification.d.ts.map +1 -1
- package/dist/core/edited-assistant-message.d.ts +24 -0
- package/dist/core/edited-assistant-message.d.ts.map +1 -0
- package/dist/core/edited-assistant-message.js +57 -0
- package/dist/core/edited-assistant-message.js.map +1 -0
- package/dist/core/experimental.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ask-user/extension.d.ts +3 -0
- package/dist/core/extensions/builtin/ask-user/extension.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/extension.js +47 -0
- package/dist/core/extensions/builtin/ask-user/extension.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/family.d.ts +8 -0
- package/dist/core/extensions/builtin/ask-user/family.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/family.js +6 -0
- package/dist/core/extensions/builtin/ask-user/family.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/format.d.ts +22 -0
- package/dist/core/extensions/builtin/ask-user/format.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/format.js +109 -0
- package/dist/core/extensions/builtin/ask-user/format.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/index.d.ts +4 -0
- package/dist/core/extensions/builtin/ask-user/index.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/index.js +4 -0
- package/dist/core/extensions/builtin/ask-user/index.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/params.d.ts +27 -0
- package/dist/core/extensions/builtin/ask-user/params.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/params.js +78 -0
- package/dist/core/extensions/builtin/ask-user/params.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/pending.d.ts +58 -0
- package/dist/core/extensions/builtin/ask-user/pending.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/pending.js +130 -0
- package/dist/core/extensions/builtin/ask-user/pending.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/registry.d.ts +21 -0
- package/dist/core/extensions/builtin/ask-user/registry.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/registry.js +20 -0
- package/dist/core/extensions/builtin/ask-user/registry.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/render.d.ts +4 -0
- package/dist/core/extensions/builtin/ask-user/render.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/render.js +25 -0
- package/dist/core/extensions/builtin/ask-user/render.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/resume.d.ts +4 -0
- package/dist/core/extensions/builtin/ask-user/resume.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/resume.js +85 -0
- package/dist/core/extensions/builtin/ask-user/resume.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/schema.d.ts +40 -0
- package/dist/core/extensions/builtin/ask-user/schema.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/schema.js +102 -0
- package/dist/core/extensions/builtin/ask-user/schema.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/tool.d.ts +8 -0
- package/dist/core/extensions/builtin/ask-user/tool.d.ts.map +1 -0
- package/dist/core/extensions/builtin/ask-user/tool.js +195 -0
- package/dist/core/extensions/builtin/ask-user/tool.js.map +1 -0
- package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
- package/dist/core/extensions/builtin/btw/panel.d.ts.map +1 -1
- package/dist/core/extensions/builtin/btw/side-query.js.map +1 -1
- package/dist/core/extensions/builtin/cache-keepalive/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cache-keepalive/index.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.js.map +1 -1
- 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.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/affinity.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/affinity.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/availability.d.ts +11 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/availability.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/availability.js +12 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/availability.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/custom-tools.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.d.ts +14 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.d.ts.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.js +42 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.js.map +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/executable.d.ts +18 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/executable.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/executable.js +105 -36
- package/dist/core/extensions/builtin/claude-sdk-oauth/executable.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/failover.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/index.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/refusal.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js +4 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/stream-protocol.d.ts +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/tool-watch.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/context-reduction.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/lane-policy.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/openai-remote-convert.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/openai-remote.js.map +1 -1
- package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/resume-admission.d.ts +7 -0
- package/dist/core/extensions/builtin/compaction/resume-admission.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/resume-admission.js +7 -0
- package/dist/core/extensions/builtin/compaction/resume-admission.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/resume-slice.d.ts +23 -0
- package/dist/core/extensions/builtin/compaction/resume-slice.d.ts.map +1 -0
- package/dist/core/extensions/builtin/compaction/resume-slice.js +99 -0
- package/dist/core/extensions/builtin/compaction/resume-slice.js.map +1 -0
- package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
- package/dist/core/extensions/builtin/compaction/summarization-retry.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/index.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/log.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/protocol.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/reload-deferral.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/watch-engine.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/watch-event-source.js.map +1 -1
- 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.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/index.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/cache-warm-renderer.js.map +1 -1
- package/dist/core/extensions/builtin/goal/command-registration.js.map +1 -1
- package/dist/core/extensions/builtin/goal/direct-input-lifecycle.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/elapsed-ticker.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/monitor-continuation.js +57 -4
- package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/persistence.js.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.js +9 -6
- package/dist/core/extensions/builtin/goal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/goal/store.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
- package/dist/core/extensions/builtin/goal/turn-usage.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/ui.js.map +1 -1
- package/dist/core/extensions/builtin/goal/wait-progress.js.map +1 -1
- package/dist/core/extensions/builtin/goal/wait-ticker.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-account.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-account.js +1 -0
- package/dist/core/extensions/builtin/gpt-account.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/preview-format.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/preview.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/streaming-parser.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
- package/dist/core/extensions/builtin/help/panel.d.ts.map +1 -1
- package/dist/core/extensions/builtin/history-search/index.js.map +1 -1
- package/dist/core/extensions/builtin/history-search/overlay.d.ts.map +1 -1
- package/dist/core/extensions/builtin/hooks/command-runner.js.map +1 -1
- package/dist/core/extensions/builtin/hooks/dispatcher.js.map +1 -1
- package/dist/core/extensions/builtin/hooks/plugin-loader.js.map +1 -1
- package/dist/core/extensions/builtin/hooks/tool-adapter.js.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust-storage.d.ts.map +1 -1
- package/dist/core/extensions/builtin/hooks/trust.js.map +1 -1
- package/dist/core/extensions/builtin/hooks/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/imagegen/index.js.map +1 -1
- package/dist/core/extensions/builtin/imagegen/params.d.ts +45 -0
- package/dist/core/extensions/builtin/imagegen/params.d.ts.map +1 -0
- package/dist/core/extensions/builtin/imagegen/params.js +81 -0
- package/dist/core/extensions/builtin/imagegen/params.js.map +1 -0
- package/dist/core/extensions/builtin/imagegen/paths.d.ts +10 -4
- package/dist/core/extensions/builtin/imagegen/paths.d.ts.map +1 -1
- package/dist/core/extensions/builtin/imagegen/paths.js +43 -10
- package/dist/core/extensions/builtin/imagegen/paths.js.map +1 -1
- package/dist/core/extensions/builtin/imagegen/reference-images.d.ts +20 -0
- package/dist/core/extensions/builtin/imagegen/reference-images.d.ts.map +1 -0
- package/dist/core/extensions/builtin/imagegen/reference-images.js +70 -0
- package/dist/core/extensions/builtin/imagegen/reference-images.js.map +1 -0
- package/dist/core/extensions/builtin/imagegen/skill/SKILL.md +58 -33
- package/dist/core/extensions/builtin/imagegen/tool.d.ts +15 -19
- package/dist/core/extensions/builtin/imagegen/tool.d.ts.map +1 -1
- package/dist/core/extensions/builtin/imagegen/tool.js +74 -52
- package/dist/core/extensions/builtin/imagegen/tool.js.map +1 -1
- package/dist/core/extensions/builtin/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/index.js +2 -0
- package/dist/core/extensions/builtin/index.js.map +1 -1
- package/dist/core/extensions/builtin/look-at/model-selector.d.ts.map +1 -1
- package/dist/core/extensions/builtin/look-at/runner.js.map +1 -1
- package/dist/core/extensions/builtin/loop/command.js.map +1 -1
- package/dist/core/extensions/builtin/loop/cron-planner.js.map +1 -1
- package/dist/core/extensions/builtin/loop/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop/loopfile.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/scheduler.js.map +1 -1
- package/dist/core/extensions/builtin/loop/status.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/escalation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/escalation.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/index.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/renderer.js.map +1 -1
- package/dist/core/extensions/builtin/loop-guard/tracker.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/active-set.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/auth/callback.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/auth/oauth-errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/auth/oauth-errors.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/auth/oauth-provider.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/auth/oauth-refresh.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/auth/oauth-refresh.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/auth/oauth.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/auth/token-store.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/catalog.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/config-schema.d.ts +28 -28
- package/dist/core/extensions/builtin/mcp/config.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/connection.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/elicitation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/elicitation.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/errors.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/register.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/expose/session.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/guard/output-guard.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/guard/output-guard.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/log.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/reconnect.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service-register.js.map +1 -1
- package/dist/core/extensions/builtin/mcp/service.d.ts.map +1 -1
- package/dist/core/extensions/builtin/mcp/service.js.map +1 -1
- package/dist/core/extensions/builtin/nested-agents-md/core/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/nested-agents-md/core/injection-cache.d.ts.map +1 -1
- package/dist/core/extensions/builtin/nested-agents-md/core/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/oauth-login-interaction.d.ts +13 -6
- package/dist/core/extensions/builtin/oauth-login-interaction.d.ts.map +1 -1
- package/dist/core/extensions/builtin/oauth-login-interaction.js +43 -19
- package/dist/core/extensions/builtin/oauth-login-interaction.js.map +1 -1
- package/dist/core/extensions/builtin/openai-image-gen/inject.d.ts +5 -3
- package/dist/core/extensions/builtin/openai-image-gen/inject.d.ts.map +1 -1
- package/dist/core/extensions/builtin/openai-image-gen/inject.js +7 -4
- package/dist/core/extensions/builtin/openai-image-gen/inject.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/arity.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/parsers.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/service.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/service.js.map +1 -1
- package/dist/core/extensions/builtin/permission-system/types.d.ts.map +1 -1
- package/dist/core/extensions/builtin/permission-system/wildcard.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/glm-5.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +4 -4
- 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 +4 -4
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +1 -1
- package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/rule-activation/renderer.js.map +1 -1
- package/dist/core/extensions/builtin/rules/commands.js.map +1 -1
- package/dist/core/extensions/builtin/rules/config.js.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/rules/rules/project-root.js.map +1 -1
- package/dist/core/extensions/builtin/rules/ui/dynamic-border.d.ts.map +1 -1
- package/dist/core/extensions/builtin/rules/ui/rules-banner.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/manager.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/manager.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/monitor-status-ticker.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/notify.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/restore.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/runtime-session.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/session-bundle.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/render.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/index.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/normalize.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/todo-operations.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/todo-widget-component.d.ts.map +1 -1
- package/dist/core/extensions/builtin/todotools/todo-widget-component.js.map +1 -1
- package/dist/core/extensions/builtin/todotools/tools/todo.js.map +1 -1
- package/dist/core/extensions/builtin/tool-search/native-search.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/service.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tool-search/service.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/detectors/leak-context.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/detectors/token-grammar.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/manager.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/message-update.js.map +1 -1
- package/dist/core/extensions/builtin/ttsr/repetitive-turns-lane.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/stream-utils.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ttsr/watch.d.ts.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/errors.d.ts.map +1 -1
- package/dist/core/extensions/builtin/webfetch/webfetch/tool.d.ts +1 -1
- package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +2 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +17 -8
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/notice/box.d.ts.map +1 -1
- package/dist/core/extensions/notice/box.js +13 -5
- package/dist/core/extensions/notice/box.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +11 -0
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +23 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +76 -1
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/http-dispatcher.d.ts.map +1 -1
- package/dist/core/http-dispatcher.js.map +1 -1
- package/dist/core/keybindings.d.ts +182 -177
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +5 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/lockfile-policy.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-config-schema.d.ts +150 -150
- package/dist/core/model-config-schema.d.ts.map +1 -1
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts +2 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +11 -7
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/retry-fallback/controller.d.ts.map +1 -1
- package/dist/core/retry-fallback/cooldown.d.ts.map +1 -1
- package/dist/core/retry-fallback/cooldown.js.map +1 -1
- package/dist/core/retry-fallback/expansion.js.map +1 -1
- package/dist/core/retry-fallback/log.js.map +1 -1
- package/dist/core/retry-fallback/probe-scheduler.d.ts.map +1 -1
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +24 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-activity.d.ts.map +1 -1
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-log.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-resident-store.d.ts.map +1 -1
- package/dist/core/session-sidecar-store.d.ts.map +1 -1
- package/dist/core/session-summary-lru.d.ts.map +1 -1
- package/dist/core/session-work-barrier.d.ts.map +1 -1
- package/dist/core/settings-manager.d.ts +6 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +14 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-shapes.d.ts +7 -0
- package/dist/core/settings-shapes.d.ts.map +1 -1
- package/dist/core/settings-shapes.js +3 -1
- package/dist/core/settings-shapes.js.map +1 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bounded-realpath.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/read-classifiers.d.ts +17 -0
- package/dist/core/tools/read-classifiers.d.ts.map +1 -0
- package/dist/core/tools/read-classifiers.js +26 -0
- package/dist/core/tools/read-classifiers.js.map +1 -0
- package/dist/core/tools/read.d.ts +5 -1
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +21 -1
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/tail-window.d.ts.map +1 -1
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/core/tools/write-result.js.map +1 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/extensions/llama/client.d.ts.map +1 -1
- package/dist/extensions/llama/client.js.map +1 -1
- package/dist/extensions/llama/huggingface.d.ts.map +1 -1
- package/dist/extensions/llama/huggingface.js.map +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/from-source-config-guard.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/app-server/daemon/occupancy.d.ts.map +1 -1
- package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
- package/dist/modes/app-server/daemon/process.js.map +1 -1
- package/dist/modes/app-server/daemon.js.map +1 -1
- package/dist/modes/app-server/protocol/collaboration-mode.d.ts.map +1 -1
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputAnswer.d.ts +7 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputAnswer.d.ts.map +1 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputAnswer.js +4 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputAnswer.js.map +1 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputOption.d.ts +8 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputOption.d.ts.map +1 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputOption.js +4 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputOption.js.map +1 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputParams.d.ts +12 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputParams.d.ts.map +1 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputParams.js +4 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputParams.js.map +1 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputQuestion.d.ts +13 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputQuestion.d.ts.map +1 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputQuestion.js +4 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputQuestion.js.map +1 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputResponse.d.ts +10 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputResponse.d.ts.map +1 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputResponse.js +4 -0
- package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputResponse.js.map +1 -0
- package/dist/modes/app-server/protocol/index.d.ts +2 -0
- package/dist/modes/app-server/protocol/index.d.ts.map +1 -1
- package/dist/modes/app-server/protocol/index.js.map +1 -1
- package/dist/modes/app-server/protocol/methods.d.ts +1 -0
- package/dist/modes/app-server/protocol/methods.d.ts.map +1 -1
- package/dist/modes/app-server/protocol/methods.js +1 -0
- package/dist/modes/app-server/protocol/methods.js.map +1 -1
- package/dist/modes/app-server/rpc/errors.d.ts.map +1 -1
- package/dist/modes/app-server/runtime.d.ts.map +1 -1
- package/dist/modes/app-server/runtime.js +22 -6
- package/dist/modes/app-server/runtime.js.map +1 -1
- package/dist/modes/app-server/search/fuzzy-files.js.map +1 -1
- package/dist/modes/app-server/search/fuzzy-search-service.d.ts.map +1 -1
- package/dist/modes/app-server/server/account.js.map +1 -1
- package/dist/modes/app-server/server/approval-bridge.d.ts.map +1 -1
- package/dist/modes/app-server/server/approval-types.d.ts.map +1 -1
- package/dist/modes/app-server/server/approval-ui-context.d.ts +2 -1
- package/dist/modes/app-server/server/approval-ui-context.d.ts.map +1 -1
- package/dist/modes/app-server/server/approval-ui-context.js +9 -1
- package/dist/modes/app-server/server/approval-ui-context.js.map +1 -1
- package/dist/modes/app-server/server/catalogs.js.map +1 -1
- package/dist/modes/app-server/server/config.js.map +1 -1
- package/dist/modes/app-server/server/connection.d.ts.map +1 -1
- package/dist/modes/app-server/server/models.js.map +1 -1
- package/dist/modes/app-server/server/notifications.d.ts.map +1 -1
- package/dist/modes/app-server/server/notifications.js.map +1 -1
- package/dist/modes/app-server/server/server-core.d.ts.map +1 -1
- package/dist/modes/app-server/server/server-core.js.map +1 -1
- package/dist/modes/app-server/server/skills.js.map +1 -1
- package/dist/modes/app-server/server/user-input-bridge.d.ts +16 -0
- package/dist/modes/app-server/server/user-input-bridge.d.ts.map +1 -0
- package/dist/modes/app-server/server/user-input-bridge.js +142 -0
- package/dist/modes/app-server/server/user-input-bridge.js.map +1 -0
- package/dist/modes/app-server/server/user-input-types.d.ts +43 -0
- package/dist/modes/app-server/server/user-input-types.d.ts.map +1 -0
- package/dist/modes/app-server/server/user-input-types.js +51 -0
- package/dist/modes/app-server/server/user-input-types.js.map +1 -0
- package/dist/modes/app-server/threads/archive-state.d.ts.map +1 -1
- package/dist/modes/app-server/threads/handlers.js.map +1 -1
- package/dist/modes/app-server/threads/mcp-wire-status.d.ts.map +1 -1
- package/dist/modes/app-server/threads/metadata-state.d.ts.map +1 -1
- package/dist/modes/app-server/threads/projection-file-changes.js.map +1 -1
- package/dist/modes/app-server/threads/projection-message-items.d.ts.map +1 -1
- package/dist/modes/app-server/threads/projection-turn-diff.d.ts.map +1 -1
- package/dist/modes/app-server/threads/projection-web-search.js.map +1 -1
- package/dist/modes/app-server/threads/projection.d.ts.map +1 -1
- package/dist/modes/app-server/threads/registry.d.ts.map +1 -1
- package/dist/modes/app-server/threads/registry.js.map +1 -1
- package/dist/modes/app-server/threads/search-cache.d.ts.map +1 -1
- package/dist/modes/app-server/threads/turn-log.d.ts.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.d.ts.map +1 -1
- package/dist/modes/app-server/threads/turn-runtime.js.map +1 -1
- package/dist/modes/app-server/threads/turns.js.map +1 -1
- package/dist/modes/app-server/threads/wire-thread.js.map +1 -1
- package/dist/modes/app-server/transports/unix-socket.d.ts.map +1 -1
- package/dist/modes/app-server/transports/unix-socket.js.map +1 -1
- package/dist/modes/app-server/transports/websocket.d.ts.map +1 -1
- package/dist/modes/app-server/turn-adapter.d.ts +3 -3
- package/dist/modes/app-server/turn-adapter.d.ts.map +1 -1
- package/dist/modes/app-server/turn-adapter.js +36 -5
- package/dist/modes/app-server/turn-adapter.js.map +1 -1
- package/dist/modes/interactive/compaction-queue-transfer.js.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts +39 -0
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -0
- package/dist/modes/interactive/components/ask-user-async-widget.js +82 -0
- package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -0
- package/dist/modes/interactive/components/ask-user-question-keys.d.ts +21 -0
- package/dist/modes/interactive/components/ask-user-question-keys.d.ts.map +1 -0
- package/dist/modes/interactive/components/ask-user-question-keys.js +115 -0
- package/dist/modes/interactive/components/ask-user-question-keys.js.map +1 -0
- package/dist/modes/interactive/components/ask-user-question-render.d.ts +17 -0
- package/dist/modes/interactive/components/ask-user-question-render.d.ts.map +1 -0
- package/dist/modes/interactive/components/ask-user-question-render.js +75 -0
- package/dist/modes/interactive/components/ask-user-question-render.js.map +1 -0
- package/dist/modes/interactive/components/ask-user-question-state.d.ts +52 -0
- package/dist/modes/interactive/components/ask-user-question-state.d.ts.map +1 -0
- package/dist/modes/interactive/components/ask-user-question-state.js +134 -0
- package/dist/modes/interactive/components/ask-user-question-state.js.map +1 -0
- package/dist/modes/interactive/components/ask-user-question.d.ts +50 -0
- package/dist/modes/interactive/components/ask-user-question.d.ts.map +1 -0
- package/dist/modes/interactive/components/ask-user-question.js +148 -0
- package/dist/modes/interactive/components/ask-user-question.js.map +1 -0
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/assistant-render-descriptors.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/continuity-notice.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/diff.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/favorite-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/progressive-transcript-container.d.ts.map +1 -1
- package/dist/modes/interactive/components/render-signature.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/shortcut-overlay.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution-images.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution-renderer.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-renderer-boundary.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +4 -0
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +17 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/grok/chrome.d.ts.map +1 -1
- package/dist/modes/interactive/grok/footer.d.ts.map +1 -1
- package/dist/modes/interactive/grok/input-card.d.ts.map +1 -1
- package/dist/modes/interactive/grok/palette.d.ts.map +1 -1
- package/dist/modes/interactive/grok/tool-row.d.ts.map +1 -1
- package/dist/modes/interactive/grok/welcome-card.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-host-runtime.d.ts +6 -0
- package/dist/modes/interactive/interactive-host-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-host-runtime.js +32 -3
- package/dist/modes/interactive/interactive-host-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +35 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +413 -100
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/login-outcome.d.ts +20 -0
- package/dist/modes/interactive/login-outcome.d.ts.map +1 -0
- package/dist/modes/interactive/login-outcome.js +35 -0
- package/dist/modes/interactive/login-outcome.js.map +1 -0
- package/dist/modes/interactive/startup-tools.js.map +1 -1
- package/dist/modes/interactive/streaming-reveal-content.d.ts.map +1 -1
- package/dist/modes/interactive/streaming-reveal-content.js.map +1 -1
- package/dist/modes/interactive/streaming-reveal.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.d.ts +7 -7
- package/dist/modes/interactive/tips/catalog/input-tips.d.ts.map +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.js +5 -0
- package/dist/modes/interactive/tips/catalog/input-tips.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/model-tips.d.ts +1 -1
- package/dist/modes/interactive/tips/catalog/workspace-tips.d.ts +1 -1
- package/dist/modes/interactive/tips/scheduler.js.map +1 -1
- package/dist/modes/interactive/tips/working-tip.d.ts.map +1 -1
- package/dist/modes/interactive/tool-args-reveal.d.ts.map +1 -1
- package/dist/modes/interactive/tool-result-reveal.d.ts.map +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +8 -0
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/provider-native-rendering.d.ts.map +1 -1
- package/dist/modes/provider-native-rendering.js +35 -0
- package/dist/modes/provider-native-rendering.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +72 -1
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/connection-question-bridge.d.ts +18 -0
- package/dist/modes/rpc/connection-question-bridge.d.ts.map +1 -0
- package/dist/modes/rpc/connection-question-bridge.js +156 -0
- package/dist/modes/rpc/connection-question-bridge.js.map +1 -0
- package/dist/modes/rpc/custom-capability.d.ts +2 -0
- package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
- package/dist/modes/rpc/custom-capability.js +2 -0
- package/dist/modes/rpc/custom-capability.js.map +1 -1
- package/dist/modes/rpc/event-output-buffer.js.map +1 -1
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
- package/dist/modes/rpc/host-lifecycle.js.map +1 -1
- package/dist/modes/rpc/host-watchdog.js.map +1 -1
- package/dist/modes/rpc/jsonl.js.map +1 -1
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/ownership-safe-lock.d.ts.map +1 -1
- package/dist/modes/rpc/ownership-safe-lock.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +20 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +35 -3
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-input-validation.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +103 -3
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +6 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-binding.js.map +1 -1
- package/dist/modes/rpc/session-command-router.d.ts +4 -4
- package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
- package/dist/modes/rpc/session-command-router.js +14 -8
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-event-fanout.d.ts +2 -0
- package/dist/modes/rpc/session-event-fanout.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-fanout.js +25 -1
- package/dist/modes/rpc/session-event-fanout.js.map +1 -1
- package/dist/modes/rpc/session-event-writer.d.ts +7 -1
- package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-writer.js +17 -4
- package/dist/modes/rpc/session-event-writer.js.map +1 -1
- package/dist/modes/rpc/session-extension-ui-requests.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js +11 -1
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-client.js.map +1 -1
- package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-requests.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-requests.js +1 -1
- package/dist/modes/rpc/session-worker-requests.js.map +1 -1
- package/dist/modes/rpc/session-worker.js +10 -2
- package/dist/modes/rpc/session-worker.js.map +1 -1
- package/dist/modes/rpc/socket-event-fanout.d.ts +14 -1
- package/dist/modes/rpc/socket-event-fanout.d.ts.map +1 -1
- package/dist/modes/rpc/socket-event-fanout.js +48 -2
- package/dist/modes/rpc/socket-event-fanout.js.map +1 -1
- package/dist/modes/rpc/socket-ownership.js.map +1 -1
- package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/worker-session-registry.js +2 -1
- package/dist/modes/rpc/worker-session-registry.js.map +1 -1
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/self-update-bootstrap.js.map +1 -1
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/clipboard-native.js.map +1 -1
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/exif-orientation.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/management-http.js.map +1 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/photon.js.map +1 -1
- package/dist/utils/pi-user-agent.js.map +1 -1
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/syntax-highlight.js.map +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/docs/app-server.md +14 -0
- package/docs/extensions.md +28 -1
- package/docs/keybindings.md +1 -0
- package/docs/providers.md +1 -0
- package/docs/rpc.md +95 -3
- package/docs/settings.md +18 -0
- package/docs/skills.md +1 -1
- package/docs/tui.md +6 -0
- package/docs/usage.md +2 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +30 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +17 -2
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +35 -15
- package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +13 -2
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt-template.ts +76 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +6 -77
- package/node_modules/@code-yeongyu/senpi-codemode/src/timeouts/run-budget.ts +107 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-deadlines.ts +76 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +25 -14
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-contract.ts +4 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +47 -40
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-notification.ts +2 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-snapshot.ts +5 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +8 -3
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +17 -187
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/run-eval-cell.ts +189 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +66 -56
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts +36 -36
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +5 -0
- package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
- package/node_modules/@earendil-works/pi-ai/README.md +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +6 -2
- package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.lazy.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/context-room.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/stream-retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
- 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.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +5 -0
- 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-images-edit.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-edit.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-edit.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-edit.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-params.d.ts +60 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-params.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-params.js +93 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-params.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-result.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-result.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-result.js +96 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-result.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images.d.ts +3 -6
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images.js +26 -119
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-images.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js.map +1 -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/oauth/load.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth-refresh.d.ts +47 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth-refresh.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth-refresh.js +126 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth-refresh.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/select.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/refresh-credential.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/refresh-credential.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/refresh-credential.js +44 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/refresh-credential.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -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 +26 -35
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/model-capabilities.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +99 -66
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +34 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/images.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/images.js +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/images.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts.map +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.generated.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +3 -28
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/node/provider-scope.d.ts.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/nvidia.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/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/venice.json +1 -0
- 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/faux.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/venice.d.ts +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/venice.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/venice.js +15 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/venice.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/venice.models.d.ts +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/venice.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/venice.models.js +6 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/venice.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/recovery-wrapper-state.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/parse.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-content-lifecycle.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-event-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-native-projection.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-native-projection.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-stream-terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-stream-wrapper.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-text-projection.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-text-projection.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-thinking-projection.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper-shared.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper-shared.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +20 -3
- 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/deferred-tools.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +3 -3
- package/node_modules/@earendil-works/pi-pty/dist/loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/pipe-fallback.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/pipe-fallback.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/quarantine.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry-types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/registry.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/session-bun.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/session.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-pty/dist/session.js.map +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +2 -2
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/latex.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/stack.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/image-markers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/mux.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/native-module-path.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/paste-markers.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-capabilities.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tmux-image-probe.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +2 -2
- package/node_modules/css-tree/cjs/data-patch.cjs +853 -5
- package/node_modules/css-tree/cjs/data.cjs +13598 -3
- package/node_modules/css-tree/cjs/version.cjs +1 -3
- package/node_modules/css-tree/lib/data-patch.js +853 -4
- package/node_modules/css-tree/lib/data.js +13598 -5
- package/node_modules/css-tree/lib/version.js +1 -5
- package/package.json +8 -8
- package/vendor/pi-client/client.d.ts.map +1 -1
- package/vendor/pi-client/client.js.map +1 -1
- package/vendor/pi-client/connection.d.ts.map +1 -1
- package/vendor/pi-client/connection.js.map +1 -1
- package/vendor/pi-client/errors.d.ts.map +1 -1
- package/vendor/pi-client/session-handle.d.ts.map +1 -1
- package/vendor/pi-client/state.d.ts.map +1 -1
- package/vendor/pi-protocol/cbor/decoder.js.map +1 -1
- package/vendor/pi-protocol/cbor/options.d.ts.map +1 -1
- package/vendor/pi-protocol/codec.d.ts.map +1 -1
- package/vendor/pi-protocol/codec.js.map +1 -1
- package/vendor/pi-protocol/framing.d.ts.map +1 -1
- package/vendor/pi-protocol/schemas.d.ts +678 -678
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
export declare const CODEX_PARAMS: Type.TObject<{
|
|
3
|
+
questions: Type.TArray<Type.TObject<{
|
|
4
|
+
id: Type.TString;
|
|
5
|
+
header: Type.TString;
|
|
6
|
+
question: Type.TString;
|
|
7
|
+
options: Type.TArray<Type.TObject<{
|
|
8
|
+
label: Type.TString;
|
|
9
|
+
description: Type.TString;
|
|
10
|
+
}>>;
|
|
11
|
+
multiSelect: Type.TOptional<Type.TBoolean>;
|
|
12
|
+
}>>;
|
|
13
|
+
wait_for_answer: Type.TBoolean;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const CLAUDE_PARAMS: Type.TObject<{
|
|
16
|
+
questions: Type.TArray<Type.TObject<{
|
|
17
|
+
question: Type.TString;
|
|
18
|
+
header: Type.TString;
|
|
19
|
+
options: Type.TOptional<Type.TArray<Type.TObject<{
|
|
20
|
+
label: Type.TString;
|
|
21
|
+
description: Type.TOptional<Type.TString>;
|
|
22
|
+
}>>>;
|
|
23
|
+
multiSelect: Type.TBoolean;
|
|
24
|
+
}>>;
|
|
25
|
+
waitForAnswer: Type.TBoolean;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=params.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA0C/B,eAAO,MAAM,YAAY;;;;;;;;;;;;EAaxB,CAAC;AAyCF,eAAO,MAAM,aAAa;;;;;;;;;;;EAUxB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Type } from "typebox";
|
|
2
|
+
const CODEX_OPTION = Type.Object({
|
|
3
|
+
label: Type.String({ description: "User-facing label (1-5 words)." }),
|
|
4
|
+
description: Type.String({
|
|
5
|
+
description: "One short sentence explaining impact/tradeoff if selected.",
|
|
6
|
+
}),
|
|
7
|
+
}, { additionalProperties: false });
|
|
8
|
+
const CODEX_QUESTION = Type.Object({
|
|
9
|
+
id: Type.String({
|
|
10
|
+
pattern: "^[a-z][a-z0-9]*(_[a-z0-9]+)*$",
|
|
11
|
+
description: "Stable identifier for mapping answers (snake_case).",
|
|
12
|
+
}),
|
|
13
|
+
header: Type.String({
|
|
14
|
+
minLength: 1,
|
|
15
|
+
maxLength: 12,
|
|
16
|
+
description: "Short header label shown in the UI (12 or fewer chars).",
|
|
17
|
+
}),
|
|
18
|
+
question: Type.String({
|
|
19
|
+
minLength: 1,
|
|
20
|
+
description: "Single-sentence prompt shown to the user.",
|
|
21
|
+
}),
|
|
22
|
+
options: Type.Array(CODEX_OPTION, {
|
|
23
|
+
minItems: 2,
|
|
24
|
+
maxItems: 3,
|
|
25
|
+
description: 'Provide 2-3 mutually exclusive choices. Put the recommended option first and suffix its label with "(Recommended)". Do not include an "Other" option in this list; the client will add a free-form "Other" option automatically.',
|
|
26
|
+
}),
|
|
27
|
+
multiSelect: Type.Optional(Type.Boolean({
|
|
28
|
+
description: "Set to true to allow the user to select multiple options instead of just one.",
|
|
29
|
+
})),
|
|
30
|
+
}, { additionalProperties: false });
|
|
31
|
+
export const CODEX_PARAMS = Type.Object({
|
|
32
|
+
questions: Type.Array(CODEX_QUESTION, {
|
|
33
|
+
minItems: 1,
|
|
34
|
+
maxItems: 3,
|
|
35
|
+
description: "Questions to show the user. Prefer 1 and do not exceed 3",
|
|
36
|
+
}),
|
|
37
|
+
wait_for_answer: Type.Boolean({
|
|
38
|
+
description: "Set true to pause here until the user answers; set false to keep working and receive the answer later as a user message.",
|
|
39
|
+
}),
|
|
40
|
+
}, { additionalProperties: false });
|
|
41
|
+
const CLAUDE_OPTION = Type.Object({
|
|
42
|
+
label: Type.String({
|
|
43
|
+
description: "The display text for this option that the user will see and select. Should be concise (1-5 words) and clearly describe the choice.",
|
|
44
|
+
}),
|
|
45
|
+
description: Type.Optional(Type.String({
|
|
46
|
+
description: "Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.",
|
|
47
|
+
})),
|
|
48
|
+
});
|
|
49
|
+
const CLAUDE_QUESTION = Type.Object({
|
|
50
|
+
question: Type.String({
|
|
51
|
+
minLength: 1,
|
|
52
|
+
description: 'The complete question to ask the user. Should be clear, specific, and end with a question mark. Example: "Which library should we use for date formatting?" If multiSelect is true, phrase it accordingly, e.g. "Which features do you want to enable?"',
|
|
53
|
+
}),
|
|
54
|
+
header: Type.String({
|
|
55
|
+
minLength: 1,
|
|
56
|
+
maxLength: 12,
|
|
57
|
+
description: 'Very short label displayed as a chip/tag (max 12 chars). Examples: "Auth method", "Library", "Approach".',
|
|
58
|
+
}),
|
|
59
|
+
options: Type.Optional(Type.Array(CLAUDE_OPTION, {
|
|
60
|
+
minItems: 2,
|
|
61
|
+
maxItems: 4,
|
|
62
|
+
description: "The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no Other option, that will be provided automatically.",
|
|
63
|
+
})),
|
|
64
|
+
multiSelect: Type.Boolean({
|
|
65
|
+
description: "Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.",
|
|
66
|
+
}),
|
|
67
|
+
});
|
|
68
|
+
export const CLAUDE_PARAMS = Type.Object({
|
|
69
|
+
questions: Type.Array(CLAUDE_QUESTION, {
|
|
70
|
+
minItems: 1,
|
|
71
|
+
maxItems: 4,
|
|
72
|
+
description: "Questions to ask the user (1-4 questions)",
|
|
73
|
+
}),
|
|
74
|
+
waitForAnswer: Type.Boolean({
|
|
75
|
+
description: "Set true to pause here until the user answers; set false to keep working and receive the answer later as a user message.",
|
|
76
|
+
}),
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAC/B;IACC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IACrE,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC;QACxB,WAAW,EAAE,4DAA4D;KACzE,CAAC;CACF,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAEF,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CACjC;IACC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,+BAA+B;QACxC,WAAW,EAAE,qDAAqD;KAClE,CAAC;IACF,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,yDAAyD;KACtE,CAAC;IACF,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC;QACrB,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,2CAA2C;KACxD,CAAC;IACF,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE;QACjC,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;QACX,WAAW,EACV,kOAAkO;KACnO,CAAC;IACF,WAAW,EAAE,IAAI,CAAC,QAAQ,CACzB,IAAI,CAAC,OAAO,CAAC;QACZ,WAAW,EAAE,+EAA+E;KAC5F,CAAC,CACF;CACD,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CACtC;IACC,SAAS,EAAE,IAAI,CAAC,KAAK,C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AAC;IACF,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC;QAC3B,WAAW,EACV,0HAA0H;KAC3H,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { Type } from \"typebox\";\n\nconst CODEX_OPTION = Type.Object(\n\t{\n\t\tlabel: Type.String({ description: \"User-facing label (1-5 words).\" }),\n\t\tdescription: Type.String({\n\t\t\tdescription: \"One short sentence explaining impact/tradeoff if selected.\",\n\t\t}),\n\t},\n\t{ additionalProperties: false },\n);\n\nconst CODEX_QUESTION = Type.Object(\n\t{\n\t\tid: Type.String({\n\t\t\tpattern: \"^[a-z][a-z0-9]*(_[a-z0-9]+)*$\",\n\t\t\tdescription: \"Stable identifier for mapping answers (snake_case).\",\n\t\t}),\n\t\theader: Type.String({\n\t\t\tminLength: 1,\n\t\t\tmaxLength: 12,\n\t\t\tdescription: \"Short header label shown in the UI (12 or fewer chars).\",\n\t\t}),\n\t\tquestion: Type.String({\n\t\t\tminLength: 1,\n\t\t\tdescription: \"Single-sentence prompt shown to the user.\",\n\t\t}),\n\t\toptions: Type.Array(CODEX_OPTION, {\n\t\t\tminItems: 2,\n\t\t\tmaxItems: 3,\n\t\t\tdescription:\n\t\t\t\t'Provide 2-3 mutually exclusive choices. Put the recommended option first and suffix its label with \"(Recommended)\". Do not include an \"Other\" option in this list; the client will add a free-form \"Other\" option automatically.',\n\t\t}),\n\t\tmultiSelect: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Set to true to allow the user to select multiple options instead of just one.\",\n\t\t\t}),\n\t\t),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport const CODEX_PARAMS = Type.Object(\n\t{\n\t\tquestions: Type.Array(CODEX_QUESTION, {\n\t\t\tminItems: 1,\n\t\t\tmaxItems: 3,\n\t\t\tdescription: \"Questions to show the user. Prefer 1 and do not exceed 3\",\n\t\t}),\n\t\twait_for_answer: Type.Boolean({\n\t\t\tdescription:\n\t\t\t\t\"Set true to pause here until the user answers; set false to keep working and receive the answer later as a user message.\",\n\t\t}),\n\t},\n\t{ additionalProperties: false },\n);\n\nconst CLAUDE_OPTION = Type.Object({\n\tlabel: Type.String({\n\t\tdescription:\n\t\t\t\"The display text for this option that the user will see and select. Should be concise (1-5 words) and clearly describe the choice.\",\n\t}),\n\tdescription: Type.Optional(\n\t\tType.String({\n\t\t\tdescription:\n\t\t\t\t\"Explanation of what this option means or what will happen if chosen. Useful for providing context about trade-offs or implications.\",\n\t\t}),\n\t),\n});\n\nconst CLAUDE_QUESTION = Type.Object({\n\tquestion: Type.String({\n\t\tminLength: 1,\n\t\tdescription:\n\t\t\t'The complete question to ask the user. Should be clear, specific, and end with a question mark. Example: \"Which library should we use for date formatting?\" If multiSelect is true, phrase it accordingly, e.g. \"Which features do you want to enable?\"',\n\t}),\n\theader: Type.String({\n\t\tminLength: 1,\n\t\tmaxLength: 12,\n\t\tdescription:\n\t\t\t'Very short label displayed as a chip/tag (max 12 chars). Examples: \"Auth method\", \"Library\", \"Approach\".',\n\t}),\n\toptions: Type.Optional(\n\t\tType.Array(CLAUDE_OPTION, {\n\t\t\tminItems: 2,\n\t\t\tmaxItems: 4,\n\t\t\tdescription:\n\t\t\t\t\"The available choices for this question. Must have 2-4 options. Each option should be a distinct, mutually exclusive choice (unless multiSelect is enabled). There should be no Other option, that will be provided automatically.\",\n\t\t}),\n\t),\n\tmultiSelect: Type.Boolean({\n\t\tdescription:\n\t\t\t\"Set to true to allow the user to select multiple options instead of just one. Use when choices are not mutually exclusive.\",\n\t}),\n});\n\nexport const CLAUDE_PARAMS = Type.Object({\n\tquestions: Type.Array(CLAUDE_QUESTION, {\n\t\tminItems: 1,\n\t\tmaxItems: 4,\n\t\tdescription: \"Questions to ask the user (1-4 questions)\",\n\t}),\n\twaitForAnswer: Type.Boolean({\n\t\tdescription:\n\t\t\t\"Set true to pause here until the user answers; set false to keep working and receive the answer later as a user message.\",\n\t}),\n});\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type QuestionOption = {
|
|
2
|
+
label: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
};
|
|
5
|
+
export type QuestionItem = {
|
|
6
|
+
id: string;
|
|
7
|
+
header: string;
|
|
8
|
+
question: string;
|
|
9
|
+
options: QuestionOption[];
|
|
10
|
+
multiSelect: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type QuestionRequest = {
|
|
13
|
+
requestId: string;
|
|
14
|
+
questions: QuestionItem[];
|
|
15
|
+
waitForAnswer: boolean;
|
|
16
|
+
timeoutMs: number;
|
|
17
|
+
};
|
|
18
|
+
export type QuestionAnswer = {
|
|
19
|
+
selected: string[];
|
|
20
|
+
text?: string;
|
|
21
|
+
};
|
|
22
|
+
export type QuestionAnswers = Record<string, QuestionAnswer>;
|
|
23
|
+
export type QuestionResponseStatus = "answered" | "comment-submitted" | "timed_out" | "cancelled" | "orphaned-after-restart" | "unavailable";
|
|
24
|
+
export type QuestionResponse = {
|
|
25
|
+
status: QuestionResponseStatus;
|
|
26
|
+
answers: QuestionAnswers;
|
|
27
|
+
comment?: string;
|
|
28
|
+
unanswered: string[];
|
|
29
|
+
autoResolvedAfterMs?: number;
|
|
30
|
+
};
|
|
31
|
+
export type QuestionDraft = {
|
|
32
|
+
answers: QuestionAnswers;
|
|
33
|
+
comment?: string;
|
|
34
|
+
};
|
|
35
|
+
export type CancelReason = "cancelled" | "orphaned-after-restart" | "unavailable";
|
|
36
|
+
export type PendingTimerHandle = ReturnType<typeof setTimeout>;
|
|
37
|
+
export type PendingQuestionOptions = {
|
|
38
|
+
request: QuestionRequest;
|
|
39
|
+
now: () => number;
|
|
40
|
+
idleTimeoutMs: number;
|
|
41
|
+
hardCapMs?: number;
|
|
42
|
+
onTimeout?: (result: QuestionResponse) => void;
|
|
43
|
+
setTimeout?: (handler: () => void, delayMs: number) => PendingTimerHandle;
|
|
44
|
+
clearTimeout?: (handle: PendingTimerHandle) => void;
|
|
45
|
+
};
|
|
46
|
+
export type PendingQuestionState = "pending" | QuestionResponseStatus;
|
|
47
|
+
export type PendingQuestion = {
|
|
48
|
+
touch(draft?: QuestionDraft): void;
|
|
49
|
+
submit(answers: QuestionAnswers, comment?: string): QuestionResponse | false;
|
|
50
|
+
cancel(reason?: CancelReason): QuestionResponse;
|
|
51
|
+
timeout(): QuestionResponse;
|
|
52
|
+
readonly state: PendingQuestionState;
|
|
53
|
+
readonly deadlineAtMs: number;
|
|
54
|
+
remainingMs(now: number): number;
|
|
55
|
+
readonly result: QuestionResponse | undefined;
|
|
56
|
+
};
|
|
57
|
+
export declare function createPendingQuestion(options: PendingQuestionOptions): PendingQuestion;
|
|
58
|
+
//# sourceMappingURL=pending.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/pending.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAE7D,MAAM,MAAM,sBAAsB,GAC/B,UAA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CAAC,EAAE,YAAY,GAAG,gBAAgB,CAAC;IAChD,OAAO,IAAI,gBAAgB,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,GAAG,SAAS,CAAC;CAC9C,CAAC;AA+CF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CA0FtF"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
const DEFAULT_HARD_CAP_MS = 7_200_000;
|
|
2
|
+
function copyAnswers(answers) {
|
|
3
|
+
const copied = {};
|
|
4
|
+
for (const [id, answer] of Object.entries(answers)) {
|
|
5
|
+
copied[id] = {
|
|
6
|
+
selected: [...answer.selected],
|
|
7
|
+
...(answer.text !== undefined ? { text: answer.text } : {}),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
return copied;
|
|
11
|
+
}
|
|
12
|
+
function hasAnswer(answer) {
|
|
13
|
+
if (answer === undefined)
|
|
14
|
+
return false;
|
|
15
|
+
if (answer.selected.length > 0)
|
|
16
|
+
return true;
|
|
17
|
+
return answer.text !== undefined && answer.text.trim() !== "";
|
|
18
|
+
}
|
|
19
|
+
function unansweredIds(request, answers) {
|
|
20
|
+
const unanswered = [];
|
|
21
|
+
for (const question of request.questions) {
|
|
22
|
+
if (!hasAnswer(answers[question.id]))
|
|
23
|
+
unanswered.push(question.id);
|
|
24
|
+
}
|
|
25
|
+
return unanswered;
|
|
26
|
+
}
|
|
27
|
+
function isCommentPresent(comment) {
|
|
28
|
+
return comment !== undefined && comment.trim() !== "";
|
|
29
|
+
}
|
|
30
|
+
function buildResponse(status, request, answers, comment, autoResolvedAfterMs) {
|
|
31
|
+
return {
|
|
32
|
+
status,
|
|
33
|
+
answers: copyAnswers(answers),
|
|
34
|
+
...(isCommentPresent(comment) ? { comment } : {}),
|
|
35
|
+
unanswered: unansweredIds(request, answers),
|
|
36
|
+
...(autoResolvedAfterMs !== undefined ? { autoResolvedAfterMs } : {}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function createPendingQuestion(options) {
|
|
40
|
+
const createdAtMs = options.now();
|
|
41
|
+
const hardCapMs = options.hardCapMs ?? DEFAULT_HARD_CAP_MS;
|
|
42
|
+
const hardDeadlineAtMs = createdAtMs + hardCapMs;
|
|
43
|
+
const schedule = options.setTimeout ?? ((handler, delayMs) => setTimeout(handler, delayMs));
|
|
44
|
+
const unsched = options.clearTimeout ?? clearTimeout;
|
|
45
|
+
let deadlineAtMs = Math.min(createdAtMs + options.idleTimeoutMs, hardDeadlineAtMs);
|
|
46
|
+
let draftAnswers = {};
|
|
47
|
+
let draftComment;
|
|
48
|
+
let terminal;
|
|
49
|
+
let timer;
|
|
50
|
+
const disarm = () => {
|
|
51
|
+
if (timer === undefined)
|
|
52
|
+
return;
|
|
53
|
+
unsched(timer);
|
|
54
|
+
timer = undefined;
|
|
55
|
+
};
|
|
56
|
+
const settle = (response, notifyTimeout) => {
|
|
57
|
+
if (terminal !== undefined)
|
|
58
|
+
return terminal;
|
|
59
|
+
terminal = response;
|
|
60
|
+
disarm();
|
|
61
|
+
if (notifyTimeout)
|
|
62
|
+
options.onTimeout?.(response);
|
|
63
|
+
return response;
|
|
64
|
+
};
|
|
65
|
+
const fireTimeout = () => {
|
|
66
|
+
const elapsedMs = Math.max(0, options.now() - createdAtMs);
|
|
67
|
+
return settle(buildResponse("timed_out", options.request, draftAnswers, draftComment, elapsedMs), true);
|
|
68
|
+
};
|
|
69
|
+
const arm = () => {
|
|
70
|
+
disarm();
|
|
71
|
+
if (terminal !== undefined)
|
|
72
|
+
return;
|
|
73
|
+
const delayMs = deadlineAtMs - options.now();
|
|
74
|
+
if (delayMs <= 0) {
|
|
75
|
+
fireTimeout();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
timer = schedule(() => {
|
|
79
|
+
timer = undefined;
|
|
80
|
+
fireTimeout();
|
|
81
|
+
}, delayMs);
|
|
82
|
+
};
|
|
83
|
+
arm();
|
|
84
|
+
return {
|
|
85
|
+
touch(draft) {
|
|
86
|
+
if (terminal !== undefined)
|
|
87
|
+
return;
|
|
88
|
+
if (draft !== undefined) {
|
|
89
|
+
draftAnswers = copyAnswers(draft.answers);
|
|
90
|
+
draftComment = draft.comment;
|
|
91
|
+
}
|
|
92
|
+
deadlineAtMs = Math.min(options.now() + options.idleTimeoutMs, hardDeadlineAtMs);
|
|
93
|
+
arm();
|
|
94
|
+
},
|
|
95
|
+
submit(answers, comment) {
|
|
96
|
+
if (terminal !== undefined)
|
|
97
|
+
return terminal;
|
|
98
|
+
if (isCommentPresent(comment)) {
|
|
99
|
+
return settle(buildResponse("comment-submitted", options.request, answers, comment), false);
|
|
100
|
+
}
|
|
101
|
+
if (unansweredIds(options.request, answers).length === 0) {
|
|
102
|
+
return settle(buildResponse("answered", options.request, answers, comment), false);
|
|
103
|
+
}
|
|
104
|
+
return false;
|
|
105
|
+
},
|
|
106
|
+
cancel(reason = "cancelled") {
|
|
107
|
+
if (terminal !== undefined)
|
|
108
|
+
return terminal;
|
|
109
|
+
return settle(buildResponse(reason, options.request, draftAnswers, draftComment), false);
|
|
110
|
+
},
|
|
111
|
+
timeout() {
|
|
112
|
+
if (terminal !== undefined)
|
|
113
|
+
return terminal;
|
|
114
|
+
return fireTimeout();
|
|
115
|
+
},
|
|
116
|
+
get state() {
|
|
117
|
+
return terminal?.status ?? "pending";
|
|
118
|
+
},
|
|
119
|
+
get deadlineAtMs() {
|
|
120
|
+
return deadlineAtMs;
|
|
121
|
+
},
|
|
122
|
+
remainingMs(now) {
|
|
123
|
+
return Math.max(0, deadlineAtMs - now);
|
|
124
|
+
},
|
|
125
|
+
get result() {
|
|
126
|
+
return terminal;
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=pending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/pending.ts"],"names":[],"mappings":"AAmDA,MAAM,mBAAmB,GAAG,SAAS,CAAC;AA2BtC,SAAS,WAAW,CAAC,OAAwB;IAC5C,MAAM,MAAM,GAAoB,EAAE,CAAC;IACnC,KAAK,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACpD,MAAM,CAAC,EAAE,CAAC,GAAG;YACZ,QAAQ,EAAE,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;YAC9B,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3D,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,SAAS,CAAC,MAAkC;IACpD,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACvC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,OAAO,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,aAAa,CAAC,OAAwB,EAAE,OAAwB;IACxE,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QAC1C,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,UAAU,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AK;YACR,OAAO,QAAQ,EAAE,MAAM,IAAI,SAAS,CAAC;QACtC,CAAC;QACD,IAAI,YAAY;YACf,OAAO,YAAY,CAAC;QACrB,CAAC;QACD,WAAW,CAAC,GAAG;YACd,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,GAAG,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,MAAM;YACT,OAAO,QAAQ,CAAC;QACjB,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["// TODO(t1-merge): import from ./schema.ts\nexport type QuestionOption = {\n\tlabel: string;\n\tdescription?: string;\n};\n\nexport type QuestionItem = {\n\tid: string;\n\theader: string;\n\tquestion: string;\n\toptions: QuestionOption[];\n\tmultiSelect: boolean;\n};\n\nexport type QuestionRequest = {\n\trequestId: string;\n\tquestions: QuestionItem[];\n\twaitForAnswer: boolean;\n\ttimeoutMs: number;\n};\n\nexport type QuestionAnswer = {\n\tselected: string[];\n\ttext?: string;\n};\n\nexport type QuestionAnswers = Record<string, QuestionAnswer>;\n\nexport type QuestionResponseStatus =\n\t| \"answered\"\n\t| \"comment-submitted\"\n\t| \"timed_out\"\n\t| \"cancelled\"\n\t| \"orphaned-after-restart\"\n\t| \"unavailable\";\n\nexport type QuestionResponse = {\n\tstatus: QuestionResponseStatus;\n\tanswers: QuestionAnswers;\n\tcomment?: string;\n\tunanswered: string[];\n\tautoResolvedAfterMs?: number;\n};\n\nexport type QuestionDraft = {\n\tanswers: QuestionAnswers;\n\tcomment?: string;\n};\n\nexport type CancelReason = \"cancelled\" | \"orphaned-after-restart\" | \"unavailable\";\n\nconst DEFAULT_HARD_CAP_MS = 7_200_000;\n\nexport type PendingTimerHandle = ReturnType<typeof setTimeout>;\n\nexport type PendingQuestionOptions = {\n\trequest: QuestionRequest;\n\tnow: () => number;\n\tidleTimeoutMs: number;\n\thardCapMs?: number;\n\tonTimeout?: (result: QuestionResponse) => void;\n\tsetTimeout?: (handler: () => void, delayMs: number) => PendingTimerHandle;\n\tclearTimeout?: (handle: PendingTimerHandle) => void;\n};\n\nexport type PendingQuestionState = \"pending\" | QuestionResponseStatus;\n\nexport type PendingQuestion = {\n\ttouch(draft?: QuestionDraft): void;\n\tsubmit(answers: QuestionAnswers, comment?: string): QuestionResponse | false;\n\tcancel(reason?: CancelReason): QuestionResponse;\n\ttimeout(): QuestionResponse;\n\treadonly state: PendingQuestionState;\n\treadonly deadlineAtMs: number;\n\tremainingMs(now: number): number;\n\treadonly result: QuestionResponse | undefined;\n};\n\nfunction copyAnswers(answers: QuestionAnswers): QuestionAnswers {\n\tconst copied: QuestionAnswers = {};\n\tfor (const [id, answer] of Object.entries(answers)) {\n\t\tcopied[id] = {\n\t\t\tselected: [...answer.selected],\n\t\t\t...(answer.text !== undefined ? { text: answer.text } : {}),\n\t\t};\n\t}\n\treturn copied;\n}\n\nfunction hasAnswer(answer: QuestionAnswer | undefined): boolean {\n\tif (answer === undefined) return false;\n\tif (answer.selected.length > 0) return true;\n\treturn answer.text !== undefined && answer.text.trim() !== \"\";\n}\n\nfunction unansweredIds(request: QuestionRequest, answers: QuestionAnswers): string[] {\n\tconst unanswered: string[] = [];\n\tfor (const question of request.questions) {\n\t\tif (!hasAnswer(answers[question.id])) unanswered.push(question.id);\n\t}\n\treturn unanswered;\n}\n\nfunction isCommentPresent(comment: string | undefined): comment is string {\n\treturn comment !== undefined && comment.trim() !== \"\";\n}\n\nfunction buildResponse(\n\tstatus: QuestionResponseStatus,\n\trequest: QuestionRequest,\n\tanswers: QuestionAnswers,\n\tcomment: string | undefined,\n\tautoResolvedAfterMs?: number,\n): QuestionResponse {\n\treturn {\n\t\tstatus,\n\t\tanswers: copyAnswers(answers),\n\t\t...(isCommentPresent(comment) ? { comment } : {}),\n\t\tunanswered: unansweredIds(request, answers),\n\t\t...(autoResolvedAfterMs !== undefined ? { autoResolvedAfterMs } : {}),\n\t};\n}\n\nexport function createPendingQuestion(options: PendingQuestionOptions): PendingQuestion {\n\tconst createdAtMs = options.now();\n\tconst hardCapMs = options.hardCapMs ?? DEFAULT_HARD_CAP_MS;\n\tconst hardDeadlineAtMs = createdAtMs + hardCapMs;\n\tconst schedule: NonNullable<PendingQuestionOptions[\"setTimeout\"]> =\n\t\toptions.setTimeout ?? ((handler, delayMs) => setTimeout(handler, delayMs));\n\tconst unsched: NonNullable<PendingQuestionOptions[\"clearTimeout\"]> = options.clearTimeout ?? clearTimeout;\n\n\tlet deadlineAtMs = Math.min(createdAtMs + options.idleTimeoutMs, hardDeadlineAtMs);\n\tlet draftAnswers: QuestionAnswers = {};\n\tlet draftComment: string | undefined;\n\tlet terminal: QuestionResponse | undefined;\n\tlet timer: PendingTimerHandle | undefined;\n\n\tconst disarm = () => {\n\t\tif (timer === undefined) return;\n\t\tunsched(timer);\n\t\ttimer = undefined;\n\t};\n\n\tconst settle = (response: QuestionResponse, notifyTimeout: boolean): QuestionResponse => {\n\t\tif (terminal !== undefined) return terminal;\n\t\tterminal = response;\n\t\tdisarm();\n\t\tif (notifyTimeout) options.onTimeout?.(response);\n\t\treturn response;\n\t};\n\n\tconst fireTimeout = (): QuestionResponse => {\n\t\tconst elapsedMs = Math.max(0, options.now() - createdAtMs);\n\t\treturn settle(buildResponse(\"timed_out\", options.request, draftAnswers, draftComment, elapsedMs), true);\n\t};\n\n\tconst arm = () => {\n\t\tdisarm();\n\t\tif (terminal !== undefined) return;\n\t\tconst delayMs = deadlineAtMs - options.now();\n\t\tif (delayMs <= 0) {\n\t\t\tfireTimeout();\n\t\t\treturn;\n\t\t}\n\t\ttimer = schedule(() => {\n\t\t\ttimer = undefined;\n\t\t\tfireTimeout();\n\t\t}, delayMs);\n\t};\n\n\tarm();\n\n\treturn {\n\t\ttouch(draft) {\n\t\t\tif (terminal !== undefined) return;\n\t\t\tif (draft !== undefined) {\n\t\t\t\tdraftAnswers = copyAnswers(draft.answers);\n\t\t\t\tdraftComment = draft.comment;\n\t\t\t}\n\t\t\tdeadlineAtMs = Math.min(options.now() + options.idleTimeoutMs, hardDeadlineAtMs);\n\t\t\tarm();\n\t\t},\n\t\tsubmit(answers, comment) {\n\t\t\tif (terminal !== undefined) return terminal;\n\t\t\tif (isCommentPresent(comment)) {\n\t\t\t\treturn settle(buildResponse(\"comment-submitted\", options.request, answers, comment), false);\n\t\t\t}\n\t\t\tif (unansweredIds(options.request, answers).length === 0) {\n\t\t\t\treturn settle(buildResponse(\"answered\", options.request, answers, comment), false);\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tcancel(reason = \"cancelled\") {\n\t\t\tif (terminal !== undefined) return terminal;\n\t\t\treturn settle(buildResponse(reason, options.request, draftAnswers, draftComment), false);\n\t\t},\n\t\ttimeout() {\n\t\t\tif (terminal !== undefined) return terminal;\n\t\t\treturn fireTimeout();\n\t\t},\n\t\tget state() {\n\t\t\treturn terminal?.status ?? \"pending\";\n\t\t},\n\t\tget deadlineAtMs() {\n\t\t\treturn deadlineAtMs;\n\t\t},\n\t\tremainingMs(now) {\n\t\t\treturn Math.max(0, deadlineAtMs - now);\n\t\t},\n\t\tget result() {\n\t\t\treturn terminal;\n\t\t},\n\t};\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ExtensionUIDialogOptions } from "../../types.ts";
|
|
2
|
+
import type { PendingQuestion } from "./pending.ts";
|
|
3
|
+
import type { QuestionRequest, QuestionResponse } from "./schema.ts";
|
|
4
|
+
/** Additive options consumed by question-capable UI bridges. Delivery belongs to the UI. */
|
|
5
|
+
export interface QuestionDialogOptions extends ExtensionUIDialogOptions {
|
|
6
|
+
deliver: "tool-result" | "user-message";
|
|
7
|
+
hardDeadlineAtMs: number;
|
|
8
|
+
onProgress: (draft: {
|
|
9
|
+
answers?: QuestionResponse["answers"];
|
|
10
|
+
comment?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface PendingQuestionEntry {
|
|
14
|
+
request: QuestionRequest;
|
|
15
|
+
pending: PendingQuestion;
|
|
16
|
+
completion: Promise<QuestionResponse>;
|
|
17
|
+
cancel(message?: string): void;
|
|
18
|
+
}
|
|
19
|
+
export declare function getPendingQuestions(sessionId: string): readonly PendingQuestionEntry[];
|
|
20
|
+
export declare function registerPendingQuestion(sessionId: string, entry: PendingQuestionEntry): () => void;
|
|
21
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAErE,4FAA4F;AAC5F,MAAM,WAAW,qBAAsB,SAAQ,wBAAwB;IACtE,OAAO,EAAE,aAAa,GAAG,cAAc,CAAC;IACxC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACzF;AACD,MAAM,WAAW,oBAAoB;IACpC,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,eAAe,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACtC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,oBAAoB,EAAE,CAEtF;AACD,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB,GAAG,MAAM,IAAI,CAYlG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const sessions = new Map();
|
|
2
|
+
export function getPendingQuestions(sessionId) {
|
|
3
|
+
return [...(sessions.get(sessionId)?.values() ?? [])];
|
|
4
|
+
}
|
|
5
|
+
export function registerPendingQuestion(sessionId, entry) {
|
|
6
|
+
let entries = sessions.get(sessionId);
|
|
7
|
+
if (!entries) {
|
|
8
|
+
entries = new Map();
|
|
9
|
+
sessions.set(sessionId, entries);
|
|
10
|
+
}
|
|
11
|
+
entries.set(entry.request.requestId, entry);
|
|
12
|
+
return () => {
|
|
13
|
+
if (entries.get(entry.request.requestId) !== entry)
|
|
14
|
+
return;
|
|
15
|
+
entries.delete(entry.request.requestId);
|
|
16
|
+
if (entries.size === 0)
|
|
17
|
+
sessions.delete(sessionId);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/registry.ts"],"names":[],"mappings":"AAgBA,MAAM,QAAQ,GAAG,IAAI,GAAG,EAA6C,CAAC;AACtE,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACpD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACvD,CAAC;AACD,MAAM,UAAU,uBAAuB,CAAC,SAAiB,EAAE,KAA2B;IACrF,IAAI,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACtC,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;QACpB,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAC5C,OAAO,GAAG,EAAE;QACX,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,KAAK;YAAE,OAAO;QAC3D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACxC,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC;YAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC,CAAC;AACH,CAAC","sourcesContent":["import type { ExtensionUIDialogOptions } from \"../../types.ts\";\nimport type { PendingQuestion } from \"./pending.ts\";\nimport type { QuestionRequest, QuestionResponse } from \"./schema.ts\";\n\n/** Additive options consumed by question-capable UI bridges. Delivery belongs to the UI. */\nexport interface QuestionDialogOptions extends ExtensionUIDialogOptions {\n\tdeliver: \"tool-result\" | \"user-message\";\n\thardDeadlineAtMs: number;\n\tonProgress: (draft: { answers?: QuestionResponse[\"answers\"]; comment?: string }) => void;\n}\nexport interface PendingQuestionEntry {\n\trequest: QuestionRequest;\n\tpending: PendingQuestion;\n\tcompletion: Promise<QuestionResponse>;\n\tcancel(message?: string): void;\n}\nconst sessions = new Map<string, Map<string, PendingQuestionEntry>>();\nexport function getPendingQuestions(sessionId: string): readonly PendingQuestionEntry[] {\n\treturn [...(sessions.get(sessionId)?.values() ?? [])];\n}\nexport function registerPendingQuestion(sessionId: string, entry: PendingQuestionEntry): () => void {\n\tlet entries = sessions.get(sessionId);\n\tif (!entries) {\n\t\tentries = new Map();\n\t\tsessions.set(sessionId, entries);\n\t}\n\tentries.set(entry.request.requestId, entry);\n\treturn () => {\n\t\tif (entries.get(entry.request.requestId) !== entry) return;\n\t\tentries.delete(entry.request.requestId);\n\t\tif (entries.size === 0) sessions.delete(sessionId);\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/render.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,cAAc,CAAC,YAAY,CAAC,CAchE,CAAC;AACF,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,cAAc,CAAC,cAAc,CAAC,CAepE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Text } from "@earendil-works/pi-tui";
|
|
2
|
+
export const renderCall = (args, theme) => {
|
|
3
|
+
const values = typeof args === "object" && args !== null ? args : {};
|
|
4
|
+
const headers = "questions" in values && Array.isArray(values.questions)
|
|
5
|
+
? values.questions
|
|
6
|
+
.map((q) => typeof q === "object" && q !== null && "header" in q ? `[${q.header}]` : "[Question]")
|
|
7
|
+
.join(" ")
|
|
8
|
+
: "Question";
|
|
9
|
+
const wait = ("waitForAnswer" in values && values.waitForAnswer === true) ||
|
|
10
|
+
("wait_for_answer" in values && values.wait_for_answer === true);
|
|
11
|
+
return new Text(`${theme.fg("toolTitle", headers)} ${wait ? "wait for answer" : "answer later"}`, 0, 0);
|
|
12
|
+
};
|
|
13
|
+
export const renderResult = (result) => {
|
|
14
|
+
const details = result.details;
|
|
15
|
+
let summary = "";
|
|
16
|
+
if (typeof details === "object" && details !== null && "status" in details) {
|
|
17
|
+
summary = String(details.status);
|
|
18
|
+
if ("answers" in details && typeof details.answers === "object" && details.answers !== null)
|
|
19
|
+
summary += `; ${Object.keys(details.answers).length} answered`;
|
|
20
|
+
if ("unanswered" in details && Array.isArray(details.unanswered))
|
|
21
|
+
summary += `; ${details.unanswered.length} unanswered`;
|
|
22
|
+
}
|
|
23
|
+
return new Text([summary, ...result.content.flatMap((c) => (c.type === "text" ? [c.text] : []))].filter(Boolean).join("\n"), 0, 0);
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/render.ts"],"names":[],"mappings":"A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AAQ,IAAI,OAAO,EAAE,CAAC;QAC5E,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,SAAS,IAAI,OAAO,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI;YAC1F,OAAO,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,WAAW,CAAC;QAChE,IAAI,YAAY,IAAI,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;YAC/D,OAAO,IAAI,KAAK,OAAO,CAAC,UAAU,CAAC,MAAM,aAAa,CAAC;IACzD,CAAC;IACD,OAAO,IAAI,IAAI,CACd,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAC3G,CAAC,EACD,CAAC,CACD,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { Text } from \"@earendil-works/pi-tui\";\nimport type { ToolDefinition } from \"../../types.ts\";\n\nexport const renderCall: NonNullable<ToolDefinition[\"renderCall\"]> = (args, theme) => {\n\tconst values = typeof args === \"object\" && args !== null ? args : {};\n\tconst headers =\n\t\t\"questions\" in values && Array.isArray(values.questions)\n\t\t\t? values.questions\n\t\t\t\t\t.map((q: unknown) =>\n\t\t\t\t\t\ttypeof q === \"object\" && q !== null && \"header\" in q ? `[${q.header}]` : \"[Question]\",\n\t\t\t\t\t)\n\t\t\t\t\t.join(\" \")\n\t\t\t: \"Question\";\n\tconst wait =\n\t\t(\"waitForAnswer\" in values && values.waitForAnswer === true) ||\n\t\t(\"wait_for_answer\" in values && values.wait_for_answer === true);\n\treturn new Text(`${theme.fg(\"toolTitle\", headers)} ${wait ? \"wait for answer\" : \"answer later\"}`, 0, 0);\n};\nexport const renderResult: NonNullable<ToolDefinition[\"renderResult\"]> = (result) => {\n\tconst details: unknown = result.details;\n\tlet summary = \"\";\n\tif (typeof details === \"object\" && details !== null && \"status\" in details) {\n\t\tsummary = String(details.status);\n\t\tif (\"answers\" in details && typeof details.answers === \"object\" && details.answers !== null)\n\t\t\tsummary += `; ${Object.keys(details.answers).length} answered`;\n\t\tif (\"unanswered\" in details && Array.isArray(details.unanswered))\n\t\t\tsummary += `; ${details.unanswered.length} unanswered`;\n\t}\n\treturn new Text(\n\t\t[summary, ...result.content.flatMap((c) => (c.type === \"text\" ? [c.text] : []))].filter(Boolean).join(\"\\n\"),\n\t\t0,\n\t\t0,\n\t);\n};\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ExtensionAPI, ExtensionContext, SessionStartEvent } from "../../types.ts";
|
|
2
|
+
export declare const ASK_USER_RESUMED_ENTRY = "ask-user:resumed";
|
|
3
|
+
export declare function resumeDanglingQuestion(pi: Pick<ExtensionAPI, "appendEntry" | "sendUserMessage">, event: Pick<SessionStartEvent, "reason">, ctx: Pick<ExtensionContext, "sessionManager" | "ui" | "getAskUserSettings">): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=resume.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/resume.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAWxF,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAqEzD,wBAAsB,sBAAsB,CAC3C,EAAE,EAAE,IAAI,CAAC,YAAY,EAAE,aAAa,GAAG,iBAAiB,CAAC,EACzD,KAAK,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EACxC,GAAG,EAAE,IAAI,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,GAAG,oBAAoB,CAAC,GACzE,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TOOL_NAMES } from "./family.js";
|
|
2
|
+
import { formatUserMessage } from "./format.js";
|
|
3
|
+
import { DEFAULT_ASK_USER_TIMEOUT_MS, toCanonical, } from "./schema.js";
|
|
4
|
+
export const ASK_USER_RESUMED_ENTRY = "ask-user:resumed";
|
|
5
|
+
function isRecord(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
function variantFor(name) {
|
|
9
|
+
if (name === TOOL_NAMES.claude)
|
|
10
|
+
return "claude";
|
|
11
|
+
if (name === TOOL_NAMES.codex)
|
|
12
|
+
return "codex";
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
function findDanglingQuestion(entries) {
|
|
16
|
+
const results = new Set();
|
|
17
|
+
const resumed = new Set();
|
|
18
|
+
for (const entry of entries) {
|
|
19
|
+
if (entry.type === "custom" && entry.customType === ASK_USER_RESUMED_ENTRY && isRecord(entry.data)) {
|
|
20
|
+
const toolCallId = entry.data.toolCallId;
|
|
21
|
+
if (typeof toolCallId === "string")
|
|
22
|
+
resumed.add(toolCallId);
|
|
23
|
+
}
|
|
24
|
+
if (entry.type === "message" && entry.message.role === "toolResult") {
|
|
25
|
+
results.add(entry.message.toolCallId);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (let index = entries.length - 1; index >= 0; index--) {
|
|
29
|
+
const entry = entries[index];
|
|
30
|
+
if (entry?.type !== "message" || entry.message.role !== "assistant")
|
|
31
|
+
continue;
|
|
32
|
+
const content = entry.message.content;
|
|
33
|
+
for (let blockIndex = content.length - 1; blockIndex >= 0; blockIndex--) {
|
|
34
|
+
const block = content[blockIndex];
|
|
35
|
+
if (block?.type !== "toolCall" || block.incomplete === true)
|
|
36
|
+
continue;
|
|
37
|
+
const variant = variantFor(block.name);
|
|
38
|
+
if (!variant || results.has(block.id) || resumed.has(block.id))
|
|
39
|
+
continue;
|
|
40
|
+
return { toolCallId: block.id, variant, args: block.arguments };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
function requestFromCall(dangling, timeoutMs) {
|
|
46
|
+
try {
|
|
47
|
+
return toCanonical(dangling.variant, dangling.args, { requestId: dangling.toolCallId, timeoutMs });
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return { requestId: dangling.toolCallId, questions: [], waitForAnswer: false, timeoutMs };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function orphaned(request) {
|
|
54
|
+
return {
|
|
55
|
+
status: "orphaned-after-restart",
|
|
56
|
+
answers: {},
|
|
57
|
+
unanswered: request.questions.map((question) => question.id),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function deliver(pi, request, response) {
|
|
61
|
+
pi.sendUserMessage(formatUserMessage(response, request.requestId, request.questions));
|
|
62
|
+
}
|
|
63
|
+
export async function resumeDanglingQuestion(pi, event, ctx) {
|
|
64
|
+
if (event.reason !== "resume" && event.reason !== "reload")
|
|
65
|
+
return;
|
|
66
|
+
const dangling = findDanglingQuestion(ctx.sessionManager.getBranch());
|
|
67
|
+
if (!dangling)
|
|
68
|
+
return;
|
|
69
|
+
pi.appendEntry(ASK_USER_RESUMED_ENTRY, { toolCallId: dangling.toolCallId });
|
|
70
|
+
const timeoutMs = (ctx.getAskUserSettings?.().timeoutMinutes ?? DEFAULT_ASK_USER_TIMEOUT_MS / 60_000) * 60_000;
|
|
71
|
+
const request = requestFromCall(dangling, timeoutMs);
|
|
72
|
+
const question = ctx.ui.question;
|
|
73
|
+
if (!question) {
|
|
74
|
+
deliver(pi, request, orphaned(request));
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const response = await question.call(ctx.ui, request, { timeout: request.timeoutMs });
|
|
79
|
+
deliver(pi, request, response);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
deliver(pi, request, orphaned(request));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=resume.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/resume.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAEN,2BAA2B,EAG3B,WAAW,GACX,MAAM,aAAa,CAAC;AAErB,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAQzD,SAAS,QAAQ,CAAC,KAAc;IAC/B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC/B,IAAI,IAAI,KAAK,UAAU,CAAC,MAAM;QAAE,OAAO,QAAQ,CAAC;IAChD,IAAI,IAAI,KAAK,UAAU,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IAC9C,OAAO,SAAS,CAAC;AAClB,CAAC;AAED,SAAS,oBAAoB,CAAC,OAAgC;IAC7D,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,KAAK,sBAAsB,IAAI,QAAQ,CAAC,KAAK,CA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W,CAAC,sBAAsB,EAAE,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAC5E,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,CAAC,cAAc,IAAI,2BAA2B,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC;IAC/G,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACrD,MAAM,QAAQ,GAAG,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC;IACjC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QACxC,OAAO;IACR,CAAC;IACD,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACtF,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,CAAC,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACzC,CAAC;AACF,CAAC","sourcesContent":["import type { SessionEntry } from \"../../../session-manager.ts\";\nimport type { ExtensionAPI, ExtensionContext, SessionStartEvent } from \"../../types.ts\";\nimport { TOOL_NAMES } from \"./family.ts\";\nimport { formatUserMessage } from \"./format.ts\";\nimport {\n\ttype AskUserVariant,\n\tDEFAULT_ASK_USER_TIMEOUT_MS,\n\ttype QuestionRequest,\n\ttype QuestionResponse,\n\ttoCanonical,\n} from \"./schema.ts\";\n\nexport const ASK_USER_RESUMED_ENTRY = \"ask-user:resumed\";\n\ntype DanglingQuestion = {\n\ttoolCallId: string;\n\tvariant: AskUserVariant;\n\targs: unknown;\n};\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction variantFor(name: string): AskUserVariant | undefined {\n\tif (name === TOOL_NAMES.claude) return \"claude\";\n\tif (name === TOOL_NAMES.codex) return \"codex\";\n\treturn undefined;\n}\n\nfunction findDanglingQuestion(entries: readonly SessionEntry[]): DanglingQuestion | undefined {\n\tconst results = new Set<string>();\n\tconst resumed = new Set<string>();\n\tfor (const entry of entries) {\n\t\tif (entry.type === \"custom\" && entry.customType === ASK_USER_RESUMED_ENTRY && isRecord(entry.data)) {\n\t\t\tconst toolCallId = entry.data.toolCallId;\n\t\t\tif (typeof toolCallId === \"string\") resumed.add(toolCallId);\n\t\t}\n\t\tif (entry.type === \"message\" && entry.message.role === \"toolResult\") {\n\t\t\tresults.add(entry.message.toolCallId);\n\t\t}\n\t}\n\tfor (let index = entries.length - 1; index >= 0; index--) {\n\t\tconst entry = entries[index];\n\t\tif (entry?.type !== \"message\" || entry.message.role !== \"assistant\") continue;\n\t\tconst content = entry.message.content;\n\t\tfor (let blockIndex = content.length - 1; blockIndex >= 0; blockIndex--) {\n\t\t\tconst block = content[blockIndex];\n\t\t\tif (block?.type !== \"toolCall\" || block.incomplete === true) continue;\n\t\t\tconst variant = variantFor(block.name);\n\t\t\tif (!variant || results.has(block.id) || resumed.has(block.id)) continue;\n\t\t\treturn { toolCallId: block.id, variant, args: block.arguments };\n\t\t}\n\t}\n\treturn undefined;\n}\n\nfunction requestFromCall(dangling: DanglingQuestion, timeoutMs: number): QuestionRequest {\n\ttry {\n\t\treturn toCanonical(dangling.variant, dangling.args, { requestId: dangling.toolCallId, timeoutMs });\n\t} catch {\n\t\treturn { requestId: dangling.toolCallId, questions: [], waitForAnswer: false, timeoutMs };\n\t}\n}\n\nfunction orphaned(request: QuestionRequest): QuestionResponse {\n\treturn {\n\t\tstatus: \"orphaned-after-restart\",\n\t\tanswers: {},\n\t\tunanswered: request.questions.map((question) => question.id),\n\t};\n}\n\nfunction deliver(\n\tpi: Pick<ExtensionAPI, \"sendUserMessage\">,\n\trequest: QuestionRequest,\n\tresponse: QuestionResponse,\n): void {\n\tpi.sendUserMessage(formatUserMessage(response, request.requestId, request.questions));\n}\n\nexport async function resumeDanglingQuestion(\n\tpi: Pick<ExtensionAPI, \"appendEntry\" | \"sendUserMessage\">,\n\tevent: Pick<SessionStartEvent, \"reason\">,\n\tctx: Pick<ExtensionContext, \"sessionManager\" | \"ui\" | \"getAskUserSettings\">,\n): Promise<void> {\n\tif (event.reason !== \"resume\" && event.reason !== \"reload\") return;\n\tconst dangling = findDanglingQuestion(ctx.sessionManager.getBranch());\n\tif (!dangling) return;\n\tpi.appendEntry(ASK_USER_RESUMED_ENTRY, { toolCallId: dangling.toolCallId });\n\tconst timeoutMs = (ctx.getAskUserSettings?.().timeoutMinutes ?? DEFAULT_ASK_USER_TIMEOUT_MS / 60_000) * 60_000;\n\tconst request = requestFromCall(dangling, timeoutMs);\n\tconst question = ctx.ui.question;\n\tif (!question) {\n\t\tdeliver(pi, request, orphaned(request));\n\t\treturn;\n\t}\n\ttry {\n\t\tconst response = await question.call(ctx.ui, request, { timeout: request.timeoutMs });\n\t\tdeliver(pi, request, response);\n\t} catch {\n\t\tdeliver(pi, request, orphaned(request));\n\t}\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export { CLAUDE_PARAMS, CODEX_PARAMS } from "./params.ts";
|
|
2
|
+
export interface QuestionRequest {
|
|
3
|
+
requestId: string;
|
|
4
|
+
questions: Array<{
|
|
5
|
+
id: string;
|
|
6
|
+
header: string;
|
|
7
|
+
question: string;
|
|
8
|
+
options: Array<{
|
|
9
|
+
label: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
}>;
|
|
12
|
+
multiSelect: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
waitForAnswer: boolean;
|
|
15
|
+
timeoutMs: number;
|
|
16
|
+
}
|
|
17
|
+
export interface QuestionResponse {
|
|
18
|
+
status: "answered" | "comment-submitted" | "timed_out" | "cancelled" | "orphaned-after-restart" | "unavailable";
|
|
19
|
+
answers: Record<string, {
|
|
20
|
+
selected: string[];
|
|
21
|
+
text?: string;
|
|
22
|
+
}>;
|
|
23
|
+
comment?: string;
|
|
24
|
+
unanswered: string[];
|
|
25
|
+
autoResolvedAfterMs?: number;
|
|
26
|
+
}
|
|
27
|
+
export type AskUserVariant = "codex" | "claude";
|
|
28
|
+
export type Question = QuestionRequest["questions"][number];
|
|
29
|
+
export type QuestionOption = Question["options"][number];
|
|
30
|
+
export declare const WAIT_FLAG_STEER_TEXT = "This call omitted wait_for_answer (or waitForAnswer). Set true to pause here until the user answers, false to keep working and receive the answer later as a user message.";
|
|
31
|
+
export declare const DEFAULT_ASK_USER_TIMEOUT_MS: number;
|
|
32
|
+
export declare class AskUserSchemaError extends Error {
|
|
33
|
+
constructor(message: string);
|
|
34
|
+
}
|
|
35
|
+
export type ToCanonicalOptions = {
|
|
36
|
+
requestId?: string;
|
|
37
|
+
timeoutMs?: number;
|
|
38
|
+
};
|
|
39
|
+
export declare function toCanonical(variant: AskUserVariant, args: unknown, options?: ToCanonicalOptions): QuestionRequest;
|
|
40
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/ask-user/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG1D,MAAM,WAAW,eAAe;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,KAAK,CAAC;QAChB,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,KAAK,CAAC;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACx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