@code-yeongyu/senpi 2026.9.10 → 2026.9.12-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +123 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +5 -1
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +70 -9
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +183 -140
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +2 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +49 -17
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/brand.d.ts +5 -0
- package/dist/core/brand.d.ts.map +1 -1
- package/dist/core/brand.js +13 -0
- package/dist/core/brand.js.map +1 -1
- package/dist/core/changelog-source.d.ts +8 -0
- package/dist/core/changelog-source.d.ts.map +1 -0
- package/dist/core/changelog-source.js +19 -0
- package/dist/core/changelog-source.js.map +1 -0
- package/dist/core/credential-accounts.d.ts +3 -0
- package/dist/core/credential-accounts.d.ts.map +1 -1
- package/dist/core/credential-accounts.js +20 -1
- package/dist/core/credential-accounts.js.map +1 -1
- package/dist/core/credential-pool/classify.d.ts.map +1 -1
- package/dist/core/credential-pool/classify.js +8 -0
- package/dist/core/credential-pool/classify.js.map +1 -1
- package/dist/core/cursor-history-admission.d.ts +50 -0
- package/dist/core/cursor-history-admission.d.ts.map +1 -0
- package/dist/core/cursor-history-admission.js +130 -0
- package/dist/core/cursor-history-admission.js.map +1 -0
- package/dist/core/extensions/builtin/account/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/account/index.js +7 -3
- package/dist/core/extensions/builtin/account/index.js.map +1 -1
- package/dist/core/extensions/builtin/account-display-name.d.ts +7 -0
- package/dist/core/extensions/builtin/account-display-name.d.ts.map +1 -0
- package/dist/core/extensions/builtin/account-display-name.js +40 -0
- package/dist/core/extensions/builtin/account-display-name.js.map +1 -0
- package/dist/core/extensions/builtin/ask-user/format.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ask-user/format.js +7 -2
- package/dist/core/extensions/builtin/ask-user/format.js.map +1 -1
- package/dist/core/extensions/builtin/ask-user/pending.d.ts.map +1 -1
- package/dist/core/extensions/builtin/ask-user/pending.js +3 -0
- package/dist/core/extensions/builtin/ask-user/pending.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.js +21 -9
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.d.ts +1 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.js +11 -6
- package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.d.ts +9 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.js +10 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js +3 -0
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js +19 -10
- package/dist/core/extensions/builtin/claude-sdk-oauth/session-reattach.js.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js +3 -9
- package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js.map +1 -1
- package/dist/core/extensions/builtin/config-reload/routine-settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/config-reload/routine-settings.js +1 -0
- package/dist/core/extensions/builtin/config-reload/routine-settings.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js +5 -3
- package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts +1 -0
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js +2 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/models.js.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js +3 -9
- package/dist/core/extensions/builtin/cursor-cli-oauth/settings.js.map +1 -1
- package/dist/core/extensions/builtin/goal/agent-end-continuation.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/agent-end-continuation.js +13 -1
- package/dist/core/extensions/builtin/goal/agent-end-continuation.js.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/prompt.js +11 -8
- package/dist/core/extensions/builtin/goal/prompt.js.map +1 -1
- package/dist/core/extensions/builtin/goal/terminal-provider-error.d.ts +1 -0
- package/dist/core/extensions/builtin/goal/terminal-provider-error.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/terminal-provider-error.js +28 -0
- package/dist/core/extensions/builtin/goal/terminal-provider-error.js.map +1 -1
- package/dist/core/extensions/builtin/goal/todo-gate.js +2 -2
- package/dist/core/extensions/builtin/goal/todo-gate.js.map +1 -1
- package/dist/core/extensions/builtin/goal/tool-registration.js +2 -2
- package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
- package/dist/core/extensions/builtin/gpt-account.d.ts.map +1 -1
- package/dist/core/extensions/builtin/gpt-account.js +19 -8
- package/dist/core/extensions/builtin/gpt-account.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.d.ts +3 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.d.ts.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.js +19 -0
- package/dist/core/extensions/builtin/prompt-preset/deepseek-v4-1-flash.js.map +1 -0
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +6 -6
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +26 -7
- package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/presets.js +29 -0
- package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.d.ts.map +1 -1
- package/dist/core/extensions/builtin/prompt-preset/settings.js +1 -0
- package/dist/core/extensions/builtin/prompt-preset/settings.js.map +1 -1
- package/dist/core/high-reasoning-warning.d.ts.map +1 -1
- package/dist/core/high-reasoning-warning.js +5 -1
- package/dist/core/high-reasoning-warning.js.map +1 -1
- package/dist/core/manual-continue.d.ts +14 -0
- package/dist/core/manual-continue.d.ts.map +1 -1
- package/dist/core/manual-continue.js +13 -0
- package/dist/core/manual-continue.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +2 -2
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/remote-catalog-merge.d.ts +16 -0
- package/dist/core/remote-catalog-merge.d.ts.map +1 -0
- package/dist/core/remote-catalog-merge.js +75 -0
- package/dist/core/remote-catalog-merge.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts +3 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +12 -40
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/session-entry-materializer.d.ts +12 -0
- package/dist/core/session-entry-materializer.d.ts.map +1 -0
- package/dist/core/session-entry-materializer.js +26 -0
- package/dist/core/session-entry-materializer.js.map +1 -0
- package/dist/core/session-manager.d.ts +38 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +60 -21
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/session-write-reservation.d.ts +9 -0
- package/dist/core/session-write-reservation.d.ts.map +1 -1
- package/dist/core/session-write-reservation.js +33 -0
- package/dist/core/session-write-reservation.js.map +1 -1
- package/dist/core/settings-manager.d.ts +3 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +10 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/modes/app-server/daemon/process.d.ts +6 -1
- package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
- package/dist/modes/app-server/daemon/process.js +23 -4
- package/dist/modes/app-server/daemon/process.js.map +1 -1
- package/dist/modes/app-server/protocol/account.d.ts +2 -0
- package/dist/modes/app-server/protocol/account.d.ts.map +1 -1
- package/dist/modes/app-server/protocol/account.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts +2 -0
- package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-async-widget.js +17 -1
- package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-keys.d.ts +1 -1
- package/dist/modes/interactive/components/ask-user-question-keys.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-keys.js +65 -17
- package/dist/modes/interactive/components/ask-user-question-keys.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-render.d.ts +2 -1
- package/dist/modes/interactive/components/ask-user-question-render.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-render.js +39 -9
- package/dist/modes/interactive/components/ask-user-question-render.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-state.d.ts +14 -4
- package/dist/modes/interactive/components/ask-user-question-state.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-question-state.js +63 -6
- package/dist/modes/interactive/components/ask-user-question-state.js.map +1 -1
- package/dist/modes/interactive/components/ask-user-question.d.ts +2 -0
- package/dist/modes/interactive/components/ask-user-question.d.ts.map +1 -1
- package/dist/modes/interactive/components/ask-user-question.js +27 -14
- package/dist/modes/interactive/components/ask-user-question.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +51 -19
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +11 -0
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +29 -9
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +7 -0
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/help-content.d.ts.map +1 -1
- package/dist/modes/interactive/help-content.js +4 -0
- package/dist/modes/interactive/help-content.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -4
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +46 -17
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.js +1 -1
- package/dist/modes/interactive/tips/catalog/input-tips.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +3 -1
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/connection-question-bridge.js +1 -1
- package/dist/modes/rpc/connection-question-bridge.js.map +1 -1
- package/dist/modes/rpc/host-ensure.d.ts.map +1 -1
- package/dist/modes/rpc/host-ensure.js +33 -11
- package/dist/modes/rpc/host-ensure.js.map +1 -1
- package/dist/modes/rpc/host-lifecycle.d.ts +14 -0
- package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
- package/dist/modes/rpc/host-lifecycle.js +31 -5
- package/dist/modes/rpc/host-lifecycle.js.map +1 -1
- package/dist/modes/rpc/rpc-input-validation.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-input-validation.js +2 -0
- package/dist/modes/rpc/rpc-input-validation.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +4 -1
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js +1 -0
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-path-reservations.d.ts +30 -0
- package/dist/modes/rpc/session-path-reservations.d.ts.map +1 -0
- package/dist/modes/rpc/session-path-reservations.js +58 -0
- package/dist/modes/rpc/session-path-reservations.js.map +1 -0
- package/dist/modes/rpc/session-registry.d.ts +3 -1
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/dist/modes/rpc/session-worker-client.d.ts +10 -8
- package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-client.js +14 -23
- package/dist/modes/rpc/session-worker-client.js.map +1 -1
- package/dist/modes/rpc/session-worker-credit.d.ts +17 -0
- package/dist/modes/rpc/session-worker-credit.d.ts.map +1 -0
- package/dist/modes/rpc/session-worker-credit.js +39 -0
- package/dist/modes/rpc/session-worker-credit.js.map +1 -0
- package/dist/modes/rpc/session-worker-protocol.d.ts +10 -0
- package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
- package/dist/modes/rpc/session-worker-protocol.js +2 -0
- package/dist/modes/rpc/session-worker-protocol.js.map +1 -1
- package/dist/modes/rpc/session-worker-signals.d.ts +7 -0
- package/dist/modes/rpc/session-worker-signals.d.ts.map +1 -0
- package/dist/modes/rpc/session-worker-signals.js +19 -0
- package/dist/modes/rpc/session-worker-signals.js.map +1 -0
- package/dist/modes/rpc/session-worker.js +12 -16
- package/dist/modes/rpc/session-worker.js.map +1 -1
- package/dist/modes/rpc/worker-session-registry.d.ts +12 -0
- package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/worker-session-registry.js +51 -24
- package/dist/modes/rpc/worker-session-registry.js.map +1 -1
- package/dist/utils/changelog.d.ts +3 -1
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +89 -23
- package/dist/utils/changelog.js.map +1 -1
- package/dist/utils/paths.d.ts +5 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +14 -1
- package/dist/utils/paths.js.map +1 -1
- package/docs/app-server.md +6 -0
- package/docs/extensions.md +19 -3
- package/docs/rpc.md +24 -6
- package/docs/settings.md +2 -1
- package/docs/tui.md +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +52 -0
- package/node_modules/@code-yeongyu/senpi-codemode/README.md +5 -4
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/output/streaming-output-buffer.ts +58 -0
- package/node_modules/@code-yeongyu/senpi-codemode/src/output/streaming-output.ts +9 -64
- package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt-template.ts +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts +11 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js +18 -0
- 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.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js +5 -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/devin-agent/discovery.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js +135 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/discovery.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/frames.d.ts +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/frames.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/frames.js +71 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/frames.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts +1261 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js +431 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/gen/cascade_pb.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts +42 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js +68 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/metadata.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts +43 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js +43 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/paths.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts +36 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js +158 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/request.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js +145 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/stream-state.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.d.ts +16 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.js +69 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/trailer.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/types.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/types.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/types.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.d.ts +26 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.js +61 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/unary.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent/wire.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts +22 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js +217 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.lazy.d.ts +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.lazy.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.lazy.js +23 -0
- package/node_modules/@earendil-works/pi-ai/dist/api/devin-agent.lazy.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-callback.d.ts +25 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-callback.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-callback.js +124 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-callback.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-token.d.ts +18 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-token.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-token.js +101 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin-token.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts +19 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js +116 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/devin.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js +5 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-coding.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-identity.d.ts +24 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-identity.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-identity.js +86 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/kimi-identity.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js +5 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts +51 -4
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js +196 -7
- package/node_modules/@earendil-works/pi-ai/dist/auth/pool/slots.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +8 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +10 -0
- package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts +9 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/auth/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/bun-oauth.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/compat.js +3 -0
- package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts +32 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js +62 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/context-limit-store.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/cursor/store-migration.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +4 -4
- package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/index.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts +11 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/model.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/models.js +14 -5
- package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js +2 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/cursor.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opengateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/venice.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js +62 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js +37 -0
- package/node_modules/@earendil-works/pi-ai/dist/providers/devin.models.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +3 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts +12 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.d.ts.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js +93 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/cursor-context-limit.js.map +1 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js +4 -0
- package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js +55 -16
- package/node_modules/@earendil-works/pi-tui/dist/dollar-invocation-autocomplete.js.map +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export interface DaemonPidFile {
|
|
2
2
|
readonly pid: number;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Identity guard for the recorded pid. `null` means the host was registered while its
|
|
5
|
+
* identity probe was starved: the pid is known, ownership is not provable, and no caller
|
|
6
|
+
* may signal it on that record.
|
|
7
|
+
*/
|
|
8
|
+
readonly processStartTime: string | null;
|
|
4
9
|
}
|
|
5
10
|
export declare function parseDaemonPidFile(text: string): DaemonPidFile | undefined;
|
|
6
11
|
export type ProcessIdentityResult = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../../src/modes/app-server/daemon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error;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
const unguarded = parsed !== null && isRecord(parsed) && parsed.processStartTime === null;
|
|
13
|
+
if (!isRecord(parsed) ||
|
|
14
|
+
typeof parsed.pid !== "number" ||
|
|
15
|
+
(!unguarded && typeof parsed.processStartTime !== "string")) {
|
|
13
16
|
return undefined;
|
|
14
17
|
}
|
|
15
|
-
if (!Number.isInteger(parsed.pid) || parsed.pid <= 0
|
|
18
|
+
if (!Number.isInteger(parsed.pid) || parsed.pid <= 0)
|
|
19
|
+
return undefined;
|
|
20
|
+
if (unguarded)
|
|
21
|
+
return { pid: parsed.pid, processStartTime: null };
|
|
22
|
+
if (typeof parsed.processStartTime !== "string" || parsed.processStartTime.trim() === "")
|
|
16
23
|
return undefined;
|
|
17
|
-
}
|
|
18
24
|
return { pid: parsed.pid, processStartTime: parsed.processStartTime };
|
|
19
25
|
}
|
|
20
26
|
/** Thrown when a live process refuses to yield an identity after the retry budget. */
|
|
@@ -35,13 +41,26 @@ export class ProcessIdentityUnreadableError extends Error {
|
|
|
35
41
|
* ProcessIdentityUnreadableError. It never leaks the raw probe error as a verdict.
|
|
36
42
|
*/
|
|
37
43
|
export async function processMatchesPidFile(pidFile, readStartTime = readProcessStartTime, isLive = processIsLive, retry = {}) {
|
|
44
|
+
// A record without an identity guard answers only the liveness half of the question: a pid
|
|
45
|
+
// that is gone is gone, and a live one stays unknown so it is never claimed or signalled.
|
|
46
|
+
if (pidFile.processStartTime === null) {
|
|
47
|
+
if (!isLive(pidFile.pid))
|
|
48
|
+
return false;
|
|
49
|
+
throw new ProcessIdentityUnreadableError(pidFile.pid, 0, new Error("pidfile carries no process identity guard"));
|
|
50
|
+
}
|
|
38
51
|
const attempts = Math.max(1, retry.attempts ?? 5);
|
|
39
52
|
const delayMs = retry.delayMs ?? 200;
|
|
40
53
|
let lastError;
|
|
41
54
|
for (let attempt = 1; attempt <= attempts; attempt++) {
|
|
42
55
|
try {
|
|
43
56
|
const current = await readStartTime(pidFile.pid);
|
|
44
|
-
|
|
57
|
+
if (current !== undefined)
|
|
58
|
+
return current === pidFile.processStartTime;
|
|
59
|
+
if (!isLive(pidFile.pid))
|
|
60
|
+
return false;
|
|
61
|
+
lastError = new Error("process identity probe returned no identity for a live process");
|
|
62
|
+
if (attempt < attempts)
|
|
63
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
45
64
|
}
|
|
46
65
|
catch (error) {
|
|
47
66
|
if (!isLive(pidFile.pid))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../../src/modes/app-server/daemon/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAO9C,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC9C,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACJ,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACzB,IAAI,KAAK,YAAY,WAAW;YAAE,OAAO,SAAS,CAAC;QACnD,MAAM,KAAK,CAAC;IACb,CAAC;IACD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ,EAAE,CAAC;QACxG,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAC/F,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,CAAC;AACvE,CAAC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IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC7E,CAAC;AAED,SAAS,eAAe,CAAC,KAAc,EAAE,IAAY;IACpD,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;AACzE,CAAC","sourcesContent":["import { execFile } from \"node:child_process\";\n\nexport interface DaemonPidFile {\n\treadonly pid: number;\n\treadonly processStartTime: string;\n}\n\nexport function parseDaemonPidFile(text: string): DaemonPidFile | undefined {\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch (error: unknown) {\n\t\tif (error instanceof SyntaxError) return undefined;\n\t\tthrow error;\n\t}\n\tif (!isRecord(parsed) || typeof parsed.pid !== \"number\" || typeof parsed.processStartTime !== \"string\") {\n\t\treturn undefined;\n\t}\n\tif (!Number.isInteger(parsed.pid) || parsed.pid <= 0 || parsed.processStartTime.trim() === \"\") {\n\t\treturn undefined;\n\t}\n\treturn { pid: parsed.pid, processStartTime: parsed.processStartTime };\n}\n\nexport type ProcessIdentityResult =\n\t| { readonly kind: \"present\"; readonly identity: string }\n\t| { readonly kind: \"absent\" }\n\t| { readonly kind: \"error\"; readonly error: unknown };\n\n/** Thrown when a live process refuses to yield an identity after the retry budget. */\nexport class ProcessIdentityUnreadableError extends Error {\n\treadonly pid: number;\n\treadonly attempts: number;\n\toverride readonly cause: unknown;\n\n\tconstructor(pid: number, attempts: number, cause: unknown) {\n\t\tsuper(\n\t\t\t`process identity for live pid ${pid} stayed unreadable after ${attempts} probe attempt(s): ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t);\n\t\tthis.name = \"ProcessIdentityUnreadableError\";\n\t\tthis.pid = pid;\n\t\tthis.attempts = attempts;\n\t\tthis.cause = cause;\n\t}\n}\n\nexport interface IdentityProbeRetry {\n\t/** Probe attempts against a live pid before giving up (default 5). */\n\treadonly attempts?: number;\n\t/** Pause between attempts in ms (default 200). */\n\treadonly delayMs?: number;\n}\n\n/**\n * True when the pidfile still describes the running process. A probe FAILURE is not\n * an answer: on a pid that is no longer live it means \"gone\" (false); on a live pid it\n * is an observation gap — the platform query was starved or exited non-zero — so the\n * probe is retried within a bounded budget and only then surfaces as\n * ProcessIdentityUnreadableError. It never leaks the raw probe error as a verdict.\n */\nexport async function processMatchesPidFile(\n\tpidFile: DaemonPidFile,\n\treadStartTime: (pid: number) => Promise<string | undefined> = readProcessStartTime,\n\tisLive: (pid: number) => boolean = processIsLive,\n\tretry: IdentityProbeRetry = {},\n): Promise<boolean> {\n\tconst attempts = Math.max(1, retry.attempts ?? 5);\n\tconst delayMs = retry.delayMs ?? 200;\n\tlet lastError: unknown;\n\tfor (let attempt = 1; attempt <= attempts; attempt++) {\n\t\ttry {\n\t\t\tconst current = await readStartTime(pidFile.pid);\n\t\t\treturn current === pidFile.processStartTime;\n\t\t} catch (error: unknown) {\n\t\t\tif (!isLive(pidFile.pid)) return false;\n\t\t\tlastError = error;\n\t\t\tif (attempt < attempts) await new Promise<void>((resolve) => setTimeout(resolve, delayMs));\n\t\t}\n\t}\n\tthrow new ProcessIdentityUnreadableError(pidFile.pid, attempts, lastError);\n}\n\nexport async function readProcessIdentity(\n\tpid: number,\n\tplatform: NodeJS.Platform = process.platform,\n\ttimeoutMs?: number,\n\tisLive: (pid: number) => boolean = processIsLive,\n): Promise<ProcessIdentityResult> {\n\tconst command =\n\t\tplatform === \"win32\"\n\t\t\t? {\n\t\t\t\t\texecutable: \"powershell.exe\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\t\"-NoProfile\",\n\t\t\t\t\t\t\"-NonInteractive\",\n\t\t\t\t\t\t\"-Command\",\n\t\t\t\t\t\t`$process = Get-CimInstance Win32_Process -Filter \"ProcessId=${String(pid)}\" -ErrorAction Stop; if ($null -eq $process) { Write-Output '__SENPI_ABSENT__'; exit 0 }; $process.CreationDate.ToFileTimeUtc().ToString(\"D\", [Globalization.CultureInfo]::InvariantCulture)`,\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t: { executable: \"ps\", args: [\"-o\", \"lstart=\", \"-p\", String(pid)] };\n\treturn new Promise((resolve) => {\n\t\tconst effectiveTimeoutMs = timeoutMs ?? (platform === \"win32\" ? 1_000 : undefined);\n\t\texecFile(\n\t\t\tcommand.executable,\n\t\t\tcommand.args,\n\t\t\t{ windowsHide: true, ...(effectiveTimeoutMs === undefined ? {} : { timeout: effectiveTimeoutMs }) },\n\t\t\t(error, stdout) => {\n\t\t\t\tif (error) {\n\t\t\t\t\tconst code = \"code\" in error ? error.code : undefined;\n\t\t\t\t\t// ps exits 1 for an unknown pid; on every platform a query that fails against a\n\t\t\t\t\t// pid that is no longer live has answered the question. Only a failure against a\n\t\t\t\t\t// LIVE pid is an observation error the caller must treat as unknown.\n\t\t\t\t\tif ((platform !== \"win32\" && code === 1) || !isLive(pid)) {\n\t\t\t\t\t\tresolve({ kind: \"absent\" });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tresolve({ kind: \"error\", error });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst output = stdout.trim();\n\t\t\t\tif (output === \"__SENPI_ABSENT__\") return resolve({ kind: \"absent\" });\n\t\t\t\tif (!output || (platform === \"win32\" && !/^\\d+$/.test(output)))\n\t\t\t\t\treturn resolve({ kind: \"error\", error: new Error(\"invalid process identity output\") });\n\t\t\t\tresolve({ kind: \"present\", identity: output });\n\t\t\t},\n\t\t).once(\"error\", (error) => resolve({ kind: \"error\", error }));\n\t});\n}\n\nexport async function stopValidatedPid(pidFile: DaemonPidFile, signal: NodeJS.Signals): Promise<void> {\n\tif (!(await processMatchesPidFile(pidFile))) return;\n\ttry {\n\t\tprocess.kill(pidFile.pid, signal);\n\t} catch (error: unknown) {\n\t\tif (!isNodeErrorCode(error, \"ESRCH\")) throw error;\n\t}\n\tif (signal === \"SIGTERM\") await waitForGone(pidFile, 10_000);\n\tif (signal === \"SIGKILL\") await waitForGone(pidFile, 2_000);\n}\n\nexport async function waitForGone(pidFile: DaemonPidFile, timeoutMs: number): Promise<boolean> {\n\tconst deadline = Date.now() + timeoutMs;\n\twhile (Date.now() <= deadline) {\n\t\tif (!(await processMatchesPidFile(pidFile))) return true;\n\t\tawait delay(100);\n\t}\n\treturn !(await processMatchesPidFile(pidFile));\n}\n\nexport async function readProcessStartTime(\n\tpid: number,\n\tplatform: NodeJS.Platform = process.platform,\n\ttimeoutMs?: number,\n): Promise<string | undefined> {\n\treturn readProcessIdentity(pid, platform, timeoutMs).then((result) => {\n\t\tif (result.kind === \"error\") throw result.error;\n\t\treturn result.kind === \"present\" ? result.identity : undefined;\n\t});\n}\n\nexport function processIsLive(pid: number): boolean {\n\ttry {\n\t\tprocess.kill(pid, 0);\n\t\treturn true;\n\t} catch (error: unknown) {\n\t\tif (isNodeErrorCode(error, \"ESRCH\")) return false;\n\t\tif (isNodeErrorCode(error, \"EPERM\")) return true;\n\t\tthrow error;\n\t}\n}\n\n/**\n * Wait for a spawned pid's process identity.\n *\n * Returns `undefined` (UNKNOWN) when the budget is exhausted but the process is still alive:\n * budget exhaustion is an OBSERVABILITY failure, not evidence the child failed to start. On a\n * loaded Windows runner every `Get-CimInstance` probe can outlive `readProcessIdentity`'s 1s win32\n * default, so all ~9 attempts inside a 10s budget time out and throw while the process runs\n * normally (PR #1351/#1352 CI, runs 33839093178 / 33842155236). Only a pid that is really gone is\n * a startup failure, so callers can distinguish \"no identity yet\" from \"child died\".\n */\nexport async function waitForStartTime(\n\tpid: number,\n\ttimeoutMs: number,\n\treadStartTime: (pid: number) => Promise<string | undefined> = readProcessStartTime,\n\tisLive: (pid: number) => boolean = processIsLive,\n): Promise<string | undefined> {\n\tconst deadline = Date.now() + timeoutMs;\n\twhile (Date.now() <= deadline) {\n\t\tlet startTime: string | undefined;\n\t\ttry {\n\t\t\tstartTime = await readStartTime(pid);\n\t\t} catch {\n\t\t\t// Process identity queries can fail transiently while a Windows process is\n\t\t\t// entering the CIM table. Keep the bounded startup wait alive so callers do\n\t\t\t// not mistake an observability failure for a child startup failure.\n\t\t}\n\t\tif (startTime) return startTime;\n\t\tawait delay(20);\n\t}\n\tif (isLive(pid)) return undefined;\n\tthrow new Error(`spawned daemon pid ${pid} had no process start time`);\n}\n\nfunction delay(ms: number): Promise<void> {\n\treturn new Promise((resolveDelay) => setTimeout(resolveDelay, ms));\n}\n\nfunction isRecord(value: unknown): value is Readonly<Record<string, unknown>> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isNodeErrorCode(error: unknown, code: string): boolean {\n\treturn error instanceof Error && \"code\" in error && error.code === code;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"process.js","sourceRoot":"","sources":["../../../../src/modes/app-server/daemon/process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAY9C,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC9C,IAAI,MAAe,CAAC;IACpB,IAAI,CAAC;QACJ,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACzB,IAAI,KAAK,YAAY,WAAW;YAAE,OAAO,SAAS,CAAC;QACnD,MAAM,KAAK,CAAC;IACb,CAAC;IACD,MAAM,SAAS,GAAG,MAAM,KAAK,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,gBAAgB,KAAK,IAAI,CAAC;IAC1F,IACC,CAAC,QAAQ,CAAC,MAAM,CAAC;QACjB,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ;QAC9B,CAAC,CAAC,SAAS,IAAI,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ,CAAC,EAC1D,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,G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AK,IAAI,CAAC;AACzE,CAAC","sourcesContent":["import { execFile } from \"node:child_process\";\n\nexport interface DaemonPidFile {\n\treadonly pid: number;\n\t/**\n\t * Identity guard for the recorded pid. `null` means the host was registered while its\n\t * identity probe was starved: the pid is known, ownership is not provable, and no caller\n\t * may signal it on that record.\n\t */\n\treadonly processStartTime: string | null;\n}\n\nexport function parseDaemonPidFile(text: string): DaemonPidFile | undefined {\n\tlet parsed: unknown;\n\ttry {\n\t\tparsed = JSON.parse(text);\n\t} catch (error: unknown) {\n\t\tif (error instanceof SyntaxError) return undefined;\n\t\tthrow error;\n\t}\n\tconst unguarded = parsed !== null && isRecord(parsed) && parsed.processStartTime === null;\n\tif (\n\t\t!isRecord(parsed) ||\n\t\ttypeof parsed.pid !== \"number\" ||\n\t\t(!unguarded && typeof parsed.processStartTime !== \"string\")\n\t) {\n\t\treturn undefined;\n\t}\n\tif (!Number.isInteger(parsed.pid) || parsed.pid <= 0) return undefined;\n\tif (unguarded) return { pid: parsed.pid, processStartTime: null };\n\tif (typeof parsed.processStartTime !== \"string\" || parsed.processStartTime.trim() === \"\") return undefined;\n\treturn { pid: parsed.pid, processStartTime: parsed.processStartTime };\n}\n\nexport type ProcessIdentityResult =\n\t| { readonly kind: \"present\"; readonly identity: string }\n\t| { readonly kind: \"absent\" }\n\t| { readonly kind: \"error\"; readonly error: unknown };\n\n/** Thrown when a live process refuses to yield an identity after the retry budget. */\nexport class ProcessIdentityUnreadableError extends Error {\n\treadonly pid: number;\n\treadonly attempts: number;\n\toverride readonly cause: unknown;\n\n\tconstructor(pid: number, attempts: number, cause: unknown) {\n\t\tsuper(\n\t\t\t`process identity for live pid ${pid} stayed unreadable after ${attempts} probe attempt(s): ${cause instanceof Error ? cause.message : String(cause)}`,\n\t\t);\n\t\tthis.name = \"ProcessIdentityUnreadableError\";\n\t\tthis.pid = pid;\n\t\tthis.attempts = attempts;\n\t\tthis.cause = cause;\n\t}\n}\n\nexport interface IdentityProbeRetry {\n\t/** Probe attempts against a live pid before giving up (default 5). */\n\treadonly attempts?: number;\n\t/** Pause between attempts in ms (default 200). */\n\treadonly delayMs?: number;\n}\n\n/**\n * True when the pidfile still describes the running process. A probe FAILURE is not\n * an answer: on a pid that is no longer live it means \"gone\" (false); on a live pid it\n * is an observation gap — the platform query was starved or exited non-zero — so the\n * probe is retried within a bounded budget and only then surfaces as\n * ProcessIdentityUnreadableError. It never leaks the raw probe error as a verdict.\n */\nexport async function processMatchesPidFile(\n\tpidFile: DaemonPidFile,\n\treadStartTime: (pid: number) => Promise<string | undefined> = readProcessStartTime,\n\tisLive: (pid: number) => boolean = processIsLive,\n\tretry: IdentityProbeRetry = {},\n): Promise<boolean> {\n\t// A record without an identity guard answers only the liveness half of the question: a pid\n\t// that is gone is gone, and a live one stays unknown so it is never claimed or signalled.\n\tif (pidFile.processStartTime === null) {\n\t\tif (!isLive(pidFile.pid)) return false;\n\t\tthrow new ProcessIdentityUnreadableError(pidFile.pid, 0, new Error(\"pidfile carries no process identity guard\"));\n\t}\n\tconst attempts = Math.max(1, retry.attempts ?? 5);\n\tconst delayMs = retry.delayMs ?? 200;\n\tlet lastError: unknown;\n\tfor (let attempt = 1; attempt <= attempts; attempt++) {\n\t\ttry {\n\t\t\tconst current = await readStartTime(pidFile.pid);\n\t\t\tif (current !== undefined) return current === pidFile.processStartTime;\n\t\t\tif (!isLive(pidFile.pid)) return false;\n\t\t\tlastError = new Error(\"process identity probe returned no identity for a live process\");\n\t\t\tif (attempt < attempts) await new Promise<void>((resolve) => setTimeout(resolve, delayMs));\n\t\t} catch (error: unknown) {\n\t\t\tif (!isLive(pidFile.pid)) return false;\n\t\t\tlastError = error;\n\t\t\tif (attempt < attempts) await new Promise<void>((resolve) => setTimeout(resolve, delayMs));\n\t\t}\n\t}\n\tthrow new ProcessIdentityUnreadableError(pidFile.pid, attempts, lastError);\n}\n\nexport async function readProcessIdentity(\n\tpid: number,\n\tplatform: NodeJS.Platform = process.platform,\n\ttimeoutMs?: number,\n\tisLive: (pid: number) => boolean = processIsLive,\n): Promise<ProcessIdentityResult> {\n\tconst command =\n\t\tplatform === \"win32\"\n\t\t\t? {\n\t\t\t\t\texecutable: \"powershell.exe\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\t\"-NoProfile\",\n\t\t\t\t\t\t\"-NonInteractive\",\n\t\t\t\t\t\t\"-Command\",\n\t\t\t\t\t\t`$process = Get-CimInstance Win32_Process -Filter \"ProcessId=${String(pid)}\" -ErrorAction Stop; if ($null -eq $process) { Write-Output '__SENPI_ABSENT__'; exit 0 }; $process.CreationDate.ToFileTimeUtc().ToString(\"D\", [Globalization.CultureInfo]::InvariantCulture)`,\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t: { executable: \"ps\", args: [\"-o\", \"lstart=\", \"-p\", String(pid)] };\n\treturn new Promise((resolve) => {\n\t\tconst effectiveTimeoutMs = timeoutMs ?? (platform === \"win32\" ? 1_000 : undefined);\n\t\texecFile(\n\t\t\tcommand.executable,\n\t\t\tcommand.args,\n\t\t\t{ windowsHide: true, ...(effectiveTimeoutMs === undefined ? {} : { timeout: effectiveTimeoutMs }) },\n\t\t\t(error, stdout) => {\n\t\t\t\tif (error) {\n\t\t\t\t\tconst code = \"code\" in error ? error.code : undefined;\n\t\t\t\t\t// ps exits 1 for an unknown pid; on every platform a query that fails against a\n\t\t\t\t\t// pid that is no longer live has answered the question. Only a failure against a\n\t\t\t\t\t// LIVE pid is an observation error the caller must treat as unknown.\n\t\t\t\t\tif ((platform !== \"win32\" && code === 1) || !isLive(pid)) {\n\t\t\t\t\t\tresolve({ kind: \"absent\" });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tresolve({ kind: \"error\", error });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst output = stdout.trim();\n\t\t\t\tif (output === \"__SENPI_ABSENT__\") return resolve({ kind: \"absent\" });\n\t\t\t\tif (!output || (platform === \"win32\" && !/^\\d+$/.test(output)))\n\t\t\t\t\treturn resolve({ kind: \"error\", error: new Error(\"invalid process identity output\") });\n\t\t\t\tresolve({ kind: \"present\", identity: output });\n\t\t\t},\n\t\t).once(\"error\", (error) => resolve({ kind: \"error\", error }));\n\t});\n}\n\nexport async function stopValidatedPid(pidFile: DaemonPidFile, signal: NodeJS.Signals): Promise<void> {\n\tif (!(await processMatchesPidFile(pidFile))) return;\n\ttry {\n\t\tprocess.kill(pidFile.pid, signal);\n\t} catch (error: unknown) {\n\t\tif (!isNodeErrorCode(error, \"ESRCH\")) throw error;\n\t}\n\tif (signal === \"SIGTERM\") await waitForGone(pidFile, 10_000);\n\tif (signal === \"SIGKILL\") await waitForGone(pidFile, 2_000);\n}\n\nexport async function waitForGone(pidFile: DaemonPidFile, timeoutMs: number): Promise<boolean> {\n\tconst deadline = Date.now() + timeoutMs;\n\twhile (Date.now() <= deadline) {\n\t\tif (!(await processMatchesPidFile(pidFile))) return true;\n\t\tawait delay(100);\n\t}\n\treturn !(await processMatchesPidFile(pidFile));\n}\n\nexport async function readProcessStartTime(\n\tpid: number,\n\tplatform: NodeJS.Platform = process.platform,\n\ttimeoutMs?: number,\n): Promise<string | undefined> {\n\treturn readProcessIdentity(pid, platform, timeoutMs).then((result) => {\n\t\tif (result.kind === \"error\") throw result.error;\n\t\treturn result.kind === \"present\" ? result.identity : undefined;\n\t});\n}\n\nexport function processIsLive(pid: number): boolean {\n\ttry {\n\t\tprocess.kill(pid, 0);\n\t\treturn true;\n\t} catch (error: unknown) {\n\t\tif (isNodeErrorCode(error, \"ESRCH\")) return false;\n\t\tif (isNodeErrorCode(error, \"EPERM\")) return true;\n\t\tthrow error;\n\t}\n}\n\n/**\n * Wait for a spawned pid's process identity.\n *\n * Returns `undefined` (UNKNOWN) when the budget is exhausted but the process is still alive:\n * budget exhaustion is an OBSERVABILITY failure, not evidence the child failed to start. On a\n * loaded Windows runner every `Get-CimInstance` probe can outlive `readProcessIdentity`'s 1s win32\n * default, so all ~9 attempts inside a 10s budget time out and throw while the process runs\n * normally (PR #1351/#1352 CI, runs 33839093178 / 33842155236). Only a pid that is really gone is\n * a startup failure, so callers can distinguish \"no identity yet\" from \"child died\".\n */\nexport async function waitForStartTime(\n\tpid: number,\n\ttimeoutMs: number,\n\treadStartTime: (pid: number) => Promise<string | undefined> = readProcessStartTime,\n\tisLive: (pid: number) => boolean = processIsLive,\n): Promise<string | undefined> {\n\tconst deadline = Date.now() + timeoutMs;\n\twhile (Date.now() <= deadline) {\n\t\tlet startTime: string | undefined;\n\t\ttry {\n\t\t\tstartTime = await readStartTime(pid);\n\t\t} catch {\n\t\t\t// Process identity queries can fail transiently while a Windows process is\n\t\t\t// entering the CIM table. Keep the bounded startup wait alive so callers do\n\t\t\t// not mistake an observability failure for a child startup failure.\n\t\t}\n\t\tif (startTime) return startTime;\n\t\tawait delay(20);\n\t}\n\tif (isLive(pid)) return undefined;\n\tthrow new Error(`spawned daemon pid ${pid} had no process start time`);\n}\n\nfunction delay(ms: number): Promise<void> {\n\treturn new Promise((resolveDelay) => setTimeout(resolveDelay, ms));\n}\n\nfunction isRecord(value: unknown): value is Readonly<Record<string, unknown>> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isNodeErrorCode(error: unknown, code: string): boolean {\n\treturn error instanceof Error && \"code\" in error && error.code === code;\n}\n"]}
|
|
@@ -19,7 +19,9 @@ export type AccountReadResponse = {
|
|
|
19
19
|
/** Additive Senpi provider-account surface; desktop consumers update separately. */
|
|
20
20
|
export type ProviderAccountSource = "login" | "import" | "env";
|
|
21
21
|
export type ProviderAccount = {
|
|
22
|
+
/** Immutable selector ID; render displayName (name) when metadata is present. */
|
|
22
23
|
readonly name: string;
|
|
24
|
+
readonly displayName?: string;
|
|
23
25
|
readonly source: ProviderAccountSource;
|
|
24
26
|
readonly blocked: boolean;
|
|
25
27
|
readonly pinned: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../src/modes/app-server/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,CAAC;CAC3E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../src/modes/app-server/protocol/account.ts"],"names":[],"mappings":"","sourcesContent":["export type PlanType =\n\t| \"free\"\n\t| \"go\"\n\t| \"plus\"\n\t| \"pro\"\n\t| \"prolite\"\n\t| \"team\"\n\t| \"self_serve_business_usage_based\"\n\t| \"business\"\n\t| \"enterprise_cbp_usage_based\"\n\t| \"enterprise\"\n\t| \"edu\"\n\t| \"unknown\";\n\nexport type Account =\n\t| { readonly type: \"apiKey\" }\n\t| { readonly type: \"chatgpt\"; readonly email: string | null; readonly planType: PlanType }\n\t| { readonly type: \"amazonBedrock\"; readonly usesCodexManagedCredentials: boolean };\n\nexport type AccountReadParams = { readonly refreshToken?: boolean };\nexport type AccountReadResponse = {\n\treadonly account: Account | null;\n\treadonly requiresOpenaiAuth: boolean;\n};\n\n/** Additive Senpi provider-account surface; desktop consumers update separately. */\nexport type ProviderAccountSource = \"login\" | \"import\" | \"env\";\nexport type ProviderAccount = {\n\treadonly name: string;\n\treadonly source: ProviderAccountSource;\n\treadonly blocked: boolean;\n\treadonly pinned: boolean;\n};\nexport type ProviderAccountsReadParams = { readonly provider: string };\nexport type ProviderAccountsReadResponse = {\n\treadonly provider: string;\n\treadonly accounts: readonly ProviderAccount[];\n};\nexport type ProviderAccountsPinParams = { readonly provider: string; readonly name: string | null };\nexport type ProviderAccountsRemoveParams = { readonly provider: string; readonly name: string };\nexport type ProviderAccountsUpdatedNotification = { readonly provider: string };\nexport type ProviderAccountFailoverNotification = {\n\treadonly provider: string;\n\treadonly from: string;\n\treadonly to: string;\n\treadonly reason: string;\n};\n\nexport type RateLimitWindow = {\n\treadonly usedPercent: number;\n\treadonly windowDurationMins: number | null;\n\treadonly resetsAt: number | null;\n};\nexport type CreditsSnapshot = {\n\treadonly hasCredits: boolean;\n\treadonly unlimited: boolean;\n\treadonly balance: string | null;\n};\nexport type SpendControlLimitSnapshot = {\n\treadonly limit: string;\n\treadonly used: string;\n\treadonly remainingPercent: number;\n\treadonly resetsAt: number;\n};\nexport type RateLimitReachedType =\n\t| \"rate_limit_reached\"\n\t| \"workspace_owner_credits_depleted\"\n\t| \"workspace_member_credits_depleted\"\n\t| \"workspace_owner_usage_limit_reached\"\n\t| \"workspace_member_usage_limit_reached\";\nexport type RateLimitSnapshot = {\n\treadonly limitId: string | null;\n\treadonly limitName: string | null;\n\treadonly primary: RateLimitWindow | null;\n\treadonly secondary: RateLimitWindow | null;\n\treadonly credits: CreditsSnapshot | null;\n\treadonly individualLimit: SpendControlLimitSnapshot | null;\n\treadonly spendControlReached: boolean | null;\n\treadonly planType: PlanType | null;\n\treadonly rateLimitReachedType: RateLimitReachedType | null;\n};\n\nexport type RateLimitResetType = \"codexRateLimits\" | \"unknown\";\nexport type RateLimitResetCreditStatus = \"available\" | \"redeeming\" | \"redeemed\" | \"unknown\";\nexport type RateLimitResetCredit = {\n\treadonly id: string;\n\treadonly resetType: RateLimitResetType;\n\treadonly status: RateLimitResetCreditStatus;\n\treadonly grantedAt: number;\n\treadonly expiresAt: number | null;\n\treadonly title: string | null;\n\treadonly description: string | null;\n};\nexport type RateLimitResetCreditsSummary = {\n\treadonly availableCount: number;\n\treadonly credits: readonly RateLimitResetCredit[] | null;\n};\n\nexport type AccountRateLimitsReadParams = undefined;\nexport type AccountRateLimitsReadResponse = {\n\treadonly rateLimits: RateLimitSnapshot;\n\treadonly rateLimitsByLimitId: Readonly<Record<string, RateLimitSnapshot | undefined>> | null;\n\treadonly rateLimitResetCredits: RateLimitResetCreditsSummary | null;\n};\n\nexport type AccountTokenUsageSummary = {\n\treadonly lifetimeTokens: number | null;\n\treadonly peakDailyTokens: number | null;\n\treadonly longestRunningTurnSec: number | null;\n\treadonly currentStreakDays: number | null;\n\treadonly longestStreakDays: number | null;\n};\nexport type AccountTokenUsageDailyBucket = {\n\treadonly startDate: string;\n\treadonly tokens: number;\n};\nexport type AccountUsageReadParams = undefined;\nexport type AccountUsageReadResponse = {\n\treadonly summary: AccountTokenUsageSummary;\n\treadonly dailyUsageBuckets: readonly AccountTokenUsageDailyBucket[] | null;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../src/modes/app-server/protocol/account.ts"],"names":[],"mappings":"","sourcesContent":["export type PlanType =\n\t| \"free\"\n\t| \"go\"\n\t| \"plus\"\n\t| \"pro\"\n\t| \"prolite\"\n\t| \"team\"\n\t| \"self_serve_business_usage_based\"\n\t| \"business\"\n\t| \"enterprise_cbp_usage_based\"\n\t| \"enterprise\"\n\t| \"edu\"\n\t| \"unknown\";\n\nexport type Account =\n\t| { readonly type: \"apiKey\" }\n\t| { readonly type: \"chatgpt\"; readonly email: string | null; readonly planType: PlanType }\n\t| { readonly type: \"amazonBedrock\"; readonly usesCodexManagedCredentials: boolean };\n\nexport type AccountReadParams = { readonly refreshToken?: boolean };\nexport type AccountReadResponse = {\n\treadonly account: Account | null;\n\treadonly requiresOpenaiAuth: boolean;\n};\n\n/** Additive Senpi provider-account surface; desktop consumers update separately. */\nexport type ProviderAccountSource = \"login\" | \"import\" | \"env\";\nexport type ProviderAccount = {\n\t/** Immutable selector ID; render displayName (name) when metadata is present. */\n\treadonly name: string;\n\treadonly displayName?: string;\n\treadonly source: ProviderAccountSource;\n\treadonly blocked: boolean;\n\treadonly pinned: boolean;\n};\nexport type ProviderAccountsReadParams = { readonly provider: string };\nexport type ProviderAccountsReadResponse = {\n\treadonly provider: string;\n\treadonly accounts: readonly ProviderAccount[];\n};\nexport type ProviderAccountsPinParams = { readonly provider: string; readonly name: string | null };\nexport type ProviderAccountsRemoveParams = { readonly provider: string; readonly name: string };\nexport type ProviderAccountsUpdatedNotification = { readonly provider: string };\nexport type ProviderAccountFailoverNotification = {\n\treadonly provider: string;\n\treadonly from: string;\n\treadonly to: string;\n\treadonly reason: string;\n};\n\nexport type RateLimitWindow = {\n\treadonly usedPercent: number;\n\treadonly windowDurationMins: number | null;\n\treadonly resetsAt: number | null;\n};\nexport type CreditsSnapshot = {\n\treadonly hasCredits: boolean;\n\treadonly unlimited: boolean;\n\treadonly balance: string | null;\n};\nexport type SpendControlLimitSnapshot = {\n\treadonly limit: string;\n\treadonly used: string;\n\treadonly remainingPercent: number;\n\treadonly resetsAt: number;\n};\nexport type RateLimitReachedType =\n\t| \"rate_limit_reached\"\n\t| \"workspace_owner_credits_depleted\"\n\t| \"workspace_member_credits_depleted\"\n\t| \"workspace_owner_usage_limit_reached\"\n\t| \"workspace_member_usage_limit_reached\";\nexport type RateLimitSnapshot = {\n\treadonly limitId: string | null;\n\treadonly limitName: string | null;\n\treadonly primary: RateLimitWindow | null;\n\treadonly secondary: RateLimitWindow | null;\n\treadonly credits: CreditsSnapshot | null;\n\treadonly individualLimit: SpendControlLimitSnapshot | null;\n\treadonly spendControlReached: boolean | null;\n\treadonly planType: PlanType | null;\n\treadonly rateLimitReachedType: RateLimitReachedType | null;\n};\n\nexport type RateLimitResetType = \"codexRateLimits\" | \"unknown\";\nexport type RateLimitResetCreditStatus = \"available\" | \"redeeming\" | \"redeemed\" | \"unknown\";\nexport type RateLimitResetCredit = {\n\treadonly id: string;\n\treadonly resetType: RateLimitResetType;\n\treadonly status: RateLimitResetCreditStatus;\n\treadonly grantedAt: number;\n\treadonly expiresAt: number | null;\n\treadonly title: string | null;\n\treadonly description: string | null;\n};\nexport type RateLimitResetCreditsSummary = {\n\treadonly availableCount: number;\n\treadonly credits: readonly RateLimitResetCredit[] | null;\n};\n\nexport type AccountRateLimitsReadParams = undefined;\nexport type AccountRateLimitsReadResponse = {\n\treadonly rateLimits: RateLimitSnapshot;\n\treadonly rateLimitsByLimitId: Readonly<Record<string, RateLimitSnapshot | undefined>> | null;\n\treadonly rateLimitResetCredits: RateLimitResetCreditsSummary | null;\n};\n\nexport type AccountTokenUsageSummary = {\n\treadonly lifetimeTokens: number | null;\n\treadonly peakDailyTokens: number | null;\n\treadonly longestRunningTurnSec: number | null;\n\treadonly currentStreakDays: number | null;\n\treadonly longestStreakDays: number | null;\n};\nexport type AccountTokenUsageDailyBucket = {\n\treadonly startDate: string;\n\treadonly tokens: number;\n};\nexport type AccountUsageReadParams = undefined;\nexport type AccountUsageReadResponse = {\n\treadonly summary: AccountTokenUsageSummary;\n\treadonly dailyUsageBuckets: readonly AccountTokenUsageDailyBucket[] | null;\n};\n"]}
|
|
@@ -12,6 +12,8 @@ import { type QuestionDraft } from "./ask-user-question-state.ts";
|
|
|
12
12
|
export declare const ASK_USER_WIDGET_KEY = "ask-user";
|
|
13
13
|
/** Editor shortcut that expands the pending question into the full component. */
|
|
14
14
|
export declare const ASK_USER_ANSWER_KEY = "alt+a";
|
|
15
|
+
/** True when `data` is the editor input that expands the pending question on `platform`. */
|
|
16
|
+
export declare function matchesAskUserAnswerKey(data: string, platform?: NodeJS.Platform): boolean;
|
|
15
17
|
/** Question ids the draft has not answered yet. */
|
|
16
18
|
export declare function unansweredIds(request: QuestionRequest, draft: QuestionDraft): string[];
|
|
17
19
|
/** Response for composer text typed while the question is pending: the text is the comment. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-async-widget.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-async-widget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ask-user-async-widget.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-async-widget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAA0C,KAAK,GAAG,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAE3F,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAIxF,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,iFAAiF;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ordinary composer text into the comment answer.
|
|
7
7
|
*/
|
|
8
|
-
import { Container, Text } from "@earendil-works/pi-tui";
|
|
8
|
+
import { Container, decodeKittyPrintable, matchesKey, Text } from "@earendil-works/pi-tui";
|
|
9
9
|
import { theme } from "../theme/theme.js";
|
|
10
10
|
import { formatCountdownLabel } from "./ask-user-question-state.js";
|
|
11
11
|
import { CountdownTimer } from "./countdown-timer.js";
|
|
@@ -14,6 +14,22 @@ import { rawKeyHint } from "./keybinding-hints.js";
|
|
|
14
14
|
export const ASK_USER_WIDGET_KEY = "ask-user";
|
|
15
15
|
/** Editor shortcut that expands the pending question into the full component. */
|
|
16
16
|
export const ASK_USER_ANSWER_KEY = "alt+a";
|
|
17
|
+
/**
|
|
18
|
+
* What the `a` key types on macOS when the terminal lets Option compose
|
|
19
|
+
* characters instead of sending it as Alt (the default in Terminal.app,
|
|
20
|
+
* iTerm2, Ghostty and kitty). Accepting these keeps the advertised `option+a`
|
|
21
|
+
* working without a terminal-settings detour; other platforms never see
|
|
22
|
+
* Option this way, so they keep treating the glyphs as text.
|
|
23
|
+
*/
|
|
24
|
+
const DARWIN_OPTION_A_GLYPHS = new Set(["å", "Å"]);
|
|
25
|
+
/** True when `data` is the editor input that expands the pending question on `platform`. */
|
|
26
|
+
export function matchesAskUserAnswerKey(data, platform = process.platform) {
|
|
27
|
+
if (matchesKey(data, ASK_USER_ANSWER_KEY))
|
|
28
|
+
return true;
|
|
29
|
+
if (platform !== "darwin")
|
|
30
|
+
return false;
|
|
31
|
+
return DARWIN_OPTION_A_GLYPHS.has(decodeKittyPrintable(data) ?? data);
|
|
32
|
+
}
|
|
17
33
|
function hasAnswer(answer) {
|
|
18
34
|
if (!answer)
|
|
19
35
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-async-widget.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-async-widget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,IAAI,EAAY,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ask-user-async-widget.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-async-widget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,UAAU,EAAE,IAAI,EAAY,MAAM,wBAAwB,CAAC;AAErG,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAsB,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAC9C,iFAAiF;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC3C;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAExE,4FAA4F;AAC5F,MAAM,UAAU,uBAAuB,CAAC,IAAY,EAAE,QAAQ,GAAoB,OAAO,CAAC,QAAQ;IACjG,IAAI,UAAU,CAAC,IAAI,EAAE,mBAAmB,CAAC;QAAE,OAAO,IAAI,CAAC;IACvD,IAAI,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACxC,OAAO,sBAAsB,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;AACvE,CAAC;AAED,SAAS,SAAS,CAAC,MAAuD;IACzE,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5C,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,C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IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAClF,CAAC;CACD","sourcesContent":["/**\n * Collapsed one-line widget for a pending async (waitForAnswer=false)\n * question: it sits above the editor, shows the unanswered count and the\n * idle countdown, and names the shortcut that expands the full\n * AskUserQuestionComponent. The response-building helpers here are pure so\n * interactive-mode can turn ordinary composer text into the comment answer.\n */\n\nimport { Container, decodeKittyPrintable, matchesKey, Text, type TUI } from \"@earendil-works/pi-tui\";\nimport type { QuestionRequest, QuestionResponse } from \"../../../core/extensions/types.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { formatCountdownLabel, type QuestionDraft } from \"./ask-user-question-state.ts\";\nimport { CountdownTimer } from \"./countdown-timer.ts\";\nimport { rawKeyHint } from \"./keybinding-hints.ts\";\n\n/** Widget slot key used with `setWidget`; one pending async question at a time. */\nexport const ASK_USER_WIDGET_KEY = \"ask-user\";\n/** Editor shortcut that expands the pending question into the full component. */\nexport const ASK_USER_ANSWER_KEY = \"alt+a\";\n/**\n * What the `a` key types on macOS when the terminal lets Option compose\n * characters instead of sending it as Alt (the default in Terminal.app,\n * iTerm2, Ghostty and kitty). Accepting these keeps the advertised `option+a`\n * working without a terminal-settings detour; other platforms never see\n * Option this way, so they keep treating the glyphs as text.\n */\nconst DARWIN_OPTION_A_GLYPHS: ReadonlySet<string> = new Set([\"å\", \"Å\"]);\n\n/** True when `data` is the editor input that expands the pending question on `platform`. */\nexport function matchesAskUserAnswerKey(data: string, platform: NodeJS.Platform = process.platform): boolean {\n\tif (matchesKey(data, ASK_USER_ANSWER_KEY)) return true;\n\tif (platform !== \"darwin\") return false;\n\treturn DARWIN_OPTION_A_GLYPHS.has(decodeKittyPrintable(data) ?? data);\n}\n\nfunction hasAnswer(answer: QuestionResponse[\"answers\"][string] | undefined): boolean {\n\tif (!answer) return false;\n\tif (answer.selected.length > 0) return true;\n\treturn (answer.text ?? \"\").trim() !== \"\";\n}\n\n/** Question ids the draft has not answered yet. */\nexport function unansweredIds(request: QuestionRequest, draft: QuestionDraft): string[] {\n\treturn request.questions.filter((question) => !hasAnswer(draft.answers?.[question.id])).map((q) => q.id);\n}\n\n/** Response for composer text typed while the question is pending: the text is the comment. */\nexport function buildCommentResponse(\n\trequest: QuestionRequest,\n\tdraft: QuestionDraft,\n\tcomment: string,\n): QuestionResponse {\n\treturn {\n\t\tstatus: \"comment-submitted\",\n\t\tanswers: draft.answers ?? {},\n\t\tcomment,\n\t\tunanswered: unansweredIds(request, draft),\n\t};\n}\n\n/** Response for an idle countdown that expired while the widget was collapsed. */\nexport function buildTimedOutResponse(\n\trequest: QuestionRequest,\n\tdraft: QuestionDraft,\n\tautoResolvedAfterMs: number,\n): QuestionResponse {\n\tconst comment = draft.comment?.trim();\n\treturn {\n\t\tstatus: \"timed_out\",\n\t\tanswers: draft.answers ?? {},\n\t\t...(comment ? { comment } : {}),\n\t\tunanswered: unansweredIds(request, draft),\n\t\tautoResolvedAfterMs,\n\t};\n}\n\nexport function renderAsyncQuestionLine(unanswered: number, countdownLabel: string): string {\n\tconst countdown = countdownLabel === \"\" ? \"\" : theme.fg(\"muted\", ` · ${countdownLabel}`);\n\treturn (\n\t\ttheme.fg(\"accent\", theme.bold(\"?\")) +\n\t\ttheme.fg(\"text\", ` Question pending (${unanswered} unanswered)`) +\n\t\ttheme.fg(\"muted\", \" - \") +\n\t\trawKeyHint(ASK_USER_ANSWER_KEY, \"to answer, or just type your reply\") +\n\t\tcountdown\n\t);\n}\n\nexport interface AskUserAsyncWidgetOptions {\n\tunanswered: number;\n\t/** Idle countdown shown in the line; 0 disables it. */\n\ttimeoutMs: number;\n\ttui?: TUI;\n\tonExpire: () => void;\n}\n\nexport class AskUserAsyncWidget extends Container {\n\tprivate readonly line = new Text(\"\", 1, 0);\n\tprivate readonly countdown: CountdownTimer | undefined;\n\tprivate unanswered: number;\n\tprivate countdownLabel = \"\";\n\n\tconstructor(options: AskUserAsyncWidgetOptions) {\n\t\tsuper();\n\t\tthis.unanswered = options.unanswered;\n\t\tthis.addChild(this.line);\n\t\tif (options.timeoutMs > 0) {\n\t\t\tthis.countdown = new CountdownTimer(\n\t\t\t\toptions.timeoutMs,\n\t\t\t\toptions.tui,\n\t\t\t\t(seconds) => {\n\t\t\t\t\tthis.countdownLabel = formatCountdownLabel(seconds * 1000);\n\t\t\t\t\tthis.update();\n\t\t\t\t},\n\t\t\t\toptions.onExpire,\n\t\t\t);\n\t\t}\n\t\tthis.update();\n\t}\n\n\tsetUnanswered(count: number): void {\n\t\tthis.unanswered = count;\n\t\tthis.update();\n\t}\n\n\tdispose(): void {\n\t\tthis.countdown?.dispose();\n\t}\n\n\tprivate update(): void {\n\t\tthis.line.setText(renderAsyncQuestionLine(this.unanswered, this.countdownLabel));\n\t}\n}\n"]}
|
|
@@ -12,7 +12,7 @@ export interface AskUserKeyHandlerContext {
|
|
|
12
12
|
commentInput: Input;
|
|
13
13
|
finish(status: QuestionResponse["status"], autoResolvedAfterMs?: number): void;
|
|
14
14
|
attemptSubmit(): void;
|
|
15
|
-
openOwnAnswer(): void;
|
|
15
|
+
openOwnAnswer(initialText?: string): void;
|
|
16
16
|
commitOwnAnswer(): void;
|
|
17
17
|
emitProgress(): void;
|
|
18
18
|
updateAll(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-question-keys.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-question-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAkB,KAAK,KAAK,EAAc,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,MAAM,WAAW,wBAAwB;IACxC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,cAAc,EAAE,KAAK,CAAC;IACtB,YAAY,EAAE,KAAK,CAAC;IACpB,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/E,aAAa,IAAI,IAAI,CAAC;IACtB,aAAa,
|
|
1
|
+
{"version":3,"file":"ask-user-question-keys.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-question-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAkB,KAAK,KAAK,EAAc,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,MAAM,WAAW,wBAAwB;IACxC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,cAAc,EAAE,KAAK,CAAC;IACtB,YAAY,EAAE,KAAK,CAAC;IACpB,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/E,aAAa,IAAI,IAAI,CAAC;IACtB,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,eAAe,IAAI,IAAI,CAAC;IACxB,YAAY,IAAI,IAAI,CAAC;IACrB,SAAS,IAAI,IAAI,CAAC;CAClB;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,wBAAwB,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAevF"}
|
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
import { getKeybindings, matchesKey } from "@earendil-works/pi-tui";
|
|
7
7
|
export function handleAskUserKeyInput(ctx, data) {
|
|
8
8
|
const kb = getKeybindings();
|
|
9
|
+
if (matchesKey(data, "ctrl+c")) {
|
|
10
|
+
ctx.finish("cancelled");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
9
13
|
if (ctx.state.focus === "own-answer") {
|
|
10
14
|
handleOwnAnswerKey(ctx, data, kb);
|
|
11
15
|
return;
|
|
12
16
|
}
|
|
13
|
-
if (ctx.state.focus === "
|
|
14
|
-
|
|
17
|
+
if (ctx.state.focus === "submit") {
|
|
18
|
+
handleSubmitKey(ctx, data, kb);
|
|
15
19
|
return;
|
|
16
20
|
}
|
|
17
21
|
handleOptionsKey(ctx, data, kb);
|
|
@@ -24,23 +28,41 @@ function handleOwnAnswerKey(ctx, data, kb) {
|
|
|
24
28
|
}
|
|
25
29
|
if (kb.matches(data, "tui.select.confirm") || data === "\n") {
|
|
26
30
|
ctx.commitOwnAnswer();
|
|
31
|
+
ctx.state.advance();
|
|
32
|
+
ctx.updateAll();
|
|
27
33
|
return;
|
|
28
34
|
}
|
|
29
35
|
if (kb.matches(data, "tui.select.cancel")) {
|
|
30
|
-
ctx.state.
|
|
36
|
+
if (ctx.state.request.waitForAnswer)
|
|
37
|
+
ctx.state.returnToOptions();
|
|
38
|
+
else
|
|
39
|
+
ctx.finish("cancelled");
|
|
31
40
|
ctx.updateAll();
|
|
32
41
|
return;
|
|
33
42
|
}
|
|
34
43
|
ctx.ownAnswerInput.handleInput(data);
|
|
35
44
|
ctx.emitProgress();
|
|
36
45
|
}
|
|
37
|
-
function
|
|
46
|
+
function handleSubmitKey(ctx, data, kb) {
|
|
38
47
|
if (matchesKey(data, "ctrl+enter") || kb.matches(data, "tui.input.submit") || data === "\n") {
|
|
39
48
|
ctx.attemptSubmit();
|
|
40
49
|
return;
|
|
41
50
|
}
|
|
42
51
|
if (kb.matches(data, "tui.select.cancel")) {
|
|
43
|
-
ctx.state.
|
|
52
|
+
if (ctx.state.request.waitForAnswer)
|
|
53
|
+
ctx.state.returnToOptions();
|
|
54
|
+
else
|
|
55
|
+
ctx.finish("cancelled");
|
|
56
|
+
ctx.updateAll();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (matchesKey(data, "shift+tab") || matchesKey(data, "left")) {
|
|
60
|
+
ctx.state.switchTab(-1);
|
|
61
|
+
ctx.updateAll();
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (matchesKey(data, "tab") || matchesKey(data, "right")) {
|
|
65
|
+
ctx.state.switchTab(1);
|
|
44
66
|
ctx.updateAll();
|
|
45
67
|
return;
|
|
46
68
|
}
|
|
@@ -55,16 +77,19 @@ function handleOptionsKey(ctx, data, kb) {
|
|
|
55
77
|
return;
|
|
56
78
|
}
|
|
57
79
|
if (kb.matches(data, "tui.select.cancel")) {
|
|
58
|
-
|
|
80
|
+
if (!state.request.waitForAnswer || state.requestDismiss() === "cancel")
|
|
81
|
+
ctx.finish("cancelled");
|
|
82
|
+
else
|
|
83
|
+
ctx.updateAll();
|
|
59
84
|
return;
|
|
60
85
|
}
|
|
61
86
|
if (matchesKey(data, "tab") || matchesKey(data, "right")) {
|
|
62
|
-
state.
|
|
87
|
+
state.switchTab(1);
|
|
63
88
|
ctx.updateAll();
|
|
64
89
|
return;
|
|
65
90
|
}
|
|
66
91
|
if (matchesKey(data, "shift+tab") || matchesKey(data, "left")) {
|
|
67
|
-
state.
|
|
92
|
+
state.switchTab(-1);
|
|
68
93
|
ctx.updateAll();
|
|
69
94
|
return;
|
|
70
95
|
}
|
|
@@ -74,10 +99,7 @@ function handleOptionsKey(ctx, data, kb) {
|
|
|
74
99
|
return;
|
|
75
100
|
}
|
|
76
101
|
if (kb.matches(data, "tui.select.down") || data === "j") {
|
|
77
|
-
|
|
78
|
-
state.focus = "comment";
|
|
79
|
-
else
|
|
80
|
-
state.highlightIndex += 1;
|
|
102
|
+
state.highlightIndex = Math.min(state.ownAnswerRowIndex, state.highlightIndex + 1);
|
|
81
103
|
ctx.updateAll();
|
|
82
104
|
return;
|
|
83
105
|
}
|
|
@@ -86,20 +108,35 @@ function handleOptionsKey(ctx, data, kb) {
|
|
|
86
108
|
if (option) {
|
|
87
109
|
state.activateOption(state.activeQuestion.id, option.label);
|
|
88
110
|
ctx.emitProgress();
|
|
111
|
+
if (!state.activeQuestion.multiSelect) {
|
|
112
|
+
if (state.request.waitForAnswer && state.request.questions.length === 1)
|
|
113
|
+
ctx.attemptSubmit();
|
|
114
|
+
else
|
|
115
|
+
state.advance();
|
|
116
|
+
}
|
|
89
117
|
ctx.updateAll();
|
|
90
118
|
}
|
|
91
119
|
return;
|
|
92
120
|
}
|
|
93
|
-
if (matchesKey(data, "space")
|
|
94
|
-
activateHighlighted(ctx);
|
|
121
|
+
if (matchesKey(data, "space")) {
|
|
122
|
+
activateHighlighted(ctx, false);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (kb.matches(data, "tui.select.confirm") || data === "\n") {
|
|
126
|
+
activateHighlighted(ctx, true);
|
|
95
127
|
return;
|
|
96
128
|
}
|
|
97
129
|
if (data === "c") {
|
|
98
|
-
state.focus = "
|
|
130
|
+
state.focus = "submit";
|
|
131
|
+
ctx.updateAll();
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (data.length === 1 && data >= " " && data !== "c") {
|
|
135
|
+
ctx.openOwnAnswer(data);
|
|
99
136
|
ctx.updateAll();
|
|
100
137
|
}
|
|
101
138
|
}
|
|
102
|
-
function activateHighlighted(ctx) {
|
|
139
|
+
function activateHighlighted(ctx, confirm) {
|
|
103
140
|
const state = ctx.state;
|
|
104
141
|
if (state.highlightIndex === state.ownAnswerRowIndex) {
|
|
105
142
|
ctx.openOwnAnswer();
|
|
@@ -108,8 +145,19 @@ function activateHighlighted(ctx) {
|
|
|
108
145
|
const option = state.activeQuestion.options[state.highlightIndex];
|
|
109
146
|
if (!option)
|
|
110
147
|
return;
|
|
111
|
-
|
|
148
|
+
if (!confirm || !state.activeQuestion.multiSelect) {
|
|
149
|
+
state.activateOption(state.activeQuestion.id, option.label);
|
|
150
|
+
}
|
|
112
151
|
ctx.emitProgress();
|
|
113
152
|
ctx.updateAll();
|
|
153
|
+
if (confirm) {
|
|
154
|
+
if (!state.activeQuestion.multiSelect && state.request.waitForAnswer && state.request.questions.length === 1) {
|
|
155
|
+
ctx.attemptSubmit();
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
state.advance();
|
|
159
|
+
ctx.updateAll();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
114
162
|
}
|
|
115
163
|
//# sourceMappingURL=ask-user-question-keys.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-question-keys.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-question-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAc,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAgBhF,MAAM,UAAU,qBAAqB,CAAC,GAA6B,EAAE,IAAY;IAChF,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IAC5B,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;QACtC,kBAAkB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAClC,OAAO;IACR,CAAC;IACD,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACnC,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAChC,OAAO;IACR,CAAC;IACD,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,kBAAkB,CAAC,GAA6B,EAAE,IAAY,EAAE,EAAqC;IAC7G,IAAI,UAAU,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC;QACpC,GAAG,CAAC,eAAe,EAAE,CAAC;QACtB,GAAG,CAAC,aAAa,EAAE,CAAC;QACpB,OAAO;IACR,CAAC;IACD,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,oBAAoB,CAAC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC7D,GAAG,CAAC,eAAe,EAAE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cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,IAAI,MAAM,EAAE,CAAC;YACZ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5D,GAAG,CAAC,YAAY,EAAE,CAAC;YACnB,GAAG,CAAC,SAAS,EAAE,CAAC;QACjB,CAAC;QACD,OAAO;IACR,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,oBAAoB,CAAC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC1F,mBAAmB,CAAC,GAAG,CAAC,CAAC;QACzB,OAAO;IACR,CAAC;IACD,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;QAClB,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;QACxB,GAAG,CAAC,SAAS,EAAE,CAAC;IACjB,CAAC;AACF,CAAC;AAED,SAAS,mBAAmB,CAAC,GAA6B;IACzD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IACxB,IAAI,KAAK,CAAC,cAAc,KAAK,KAAK,CAAC,iBAAiB,EAAE,CAAC;QACtD,GAAG,CAAC,aAAa,EAAE,CAAC;QACpB,OAAO;IACR,CAAC;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAClE,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5D,GAAG,CAAC,YAAY,EAAE,CAAC;IACnB,GAAG,CAAC,SAAS,EAAE,CAAC;AACjB,CAAC","sourcesContent":["/**\n * Key dispatch for the ask-user question overlay. Split from the component to\n * keep every sibling under 250 LOC; handlers operate on the shared state and\n * the component's Inputs via an explicit context.\n */\n\nimport { getKeybindings, type Input, matchesKey } from \"@earendil-works/pi-tui\";\nimport type { QuestionResponse } from \"../../../core/extensions/types.ts\";\nimport type { AskUserQuestionState } from \"./ask-user-question-state.ts\";\n\nexport interface AskUserKeyHandlerContext {\n\tstate: AskUserQuestionState;\n\townAnswerInput: Input;\n\tcommentInput: Input;\n\tfinish(status: QuestionResponse[\"status\"], autoResolvedAfterMs?: number): void;\n\tattemptSubmit(): void;\n\topenOwnAnswer(): void;\n\tcommitOwnAnswer(): void;\n\temitProgress(): void;\n\tupdateAll(): void;\n}\n\nexport function handleAskUserKeyInput(ctx: AskUserKeyHandlerContext, data: string): void {\n\tconst kb = getKeybindings();\n\tif (ctx.state.focus === \"own-answer\") {\n\t\thandleOwnAnswerKey(ctx, data, kb);\n\t\treturn;\n\t}\n\tif (ctx.state.focus === \"comment\") {\n\t\thandleCommentKey(ctx, data, kb);\n\t\treturn;\n\t}\n\thandleOptionsKey(ctx, data, kb);\n}\n\nfunction handleOwnAnswerKey(ctx: AskUserKeyHandlerContext, data: string, kb: ReturnType<typeof getKeybindings>): void {\n\tif (matchesKey(data, \"ctrl+enter\")) {\n\t\tctx.commitOwnAnswer();\n\t\tctx.attemptSubmit();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.confirm\") || data === \"\\n\") {\n\t\tctx.commitOwnAnswer();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.cancel\")) {\n\t\tctx.state.focus = \"options\";\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tctx.ownAnswerInput.handleInput(data);\n\tctx.emitProgress();\n}\n\nfunction handleCommentKey(ctx: AskUserKeyHandlerContext, data: string, kb: ReturnType<typeof getKeybindings>): void {\n\tif (matchesKey(data, \"ctrl+enter\") || kb.matches(data, \"tui.input.submit\") || data === \"\\n\") {\n\t\tctx.attemptSubmit();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.cancel\")) {\n\t\tctx.state.focus = \"options\";\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tctx.commentInput.handleInput(data);\n\tctx.state.comment = ctx.commentInput.getValue();\n\tctx.emitProgress();\n}\n\nfunction handleOptionsKey(ctx: AskUserKeyHandlerContext, data: string, kb: ReturnType<typeof getKeybindings>): void {\n\tconst state = ctx.state;\n\tif (matchesKey(data, \"ctrl+enter\")) {\n\t\tctx.attemptSubmit();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.cancel\")) {\n\t\tctx.finish(\"cancelled\");\n\t\treturn;\n\t}\n\tif (matchesKey(data, \"tab\") || matchesKey(data, \"right\")) {\n\t\tstate.switchQuestion(1);\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (matchesKey(data, \"shift+tab\") || matchesKey(data, \"left\")) {\n\t\tstate.switchQuestion(-1);\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.up\") || data === \"k\") {\n\t\tstate.highlightIndex = Math.max(0, state.highlightIndex - 1);\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.down\") || data === \"j\") {\n\t\tif (state.highlightIndex >= state.ownAnswerRowIndex) state.focus = \"comment\";\n\t\telse state.highlightIndex += 1;\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (data.length === 1 && data >= \"1\" && data <= \"9\") {\n\t\tconst option = state.activeQuestion.options[Number(data) - 1];\n\t\tif (option) {\n\t\t\tstate.activateOption(state.activeQuestion.id, option.label);\n\t\t\tctx.emitProgress();\n\t\t\tctx.updateAll();\n\t\t}\n\t\treturn;\n\t}\n\tif (matchesKey(data, \"space\") || kb.matches(data, \"tui.select.confirm\") || data === \"\\n\") {\n\t\tactivateHighlighted(ctx);\n\t\treturn;\n\t}\n\tif (data === \"c\") {\n\t\tstate.focus = \"comment\";\n\t\tctx.updateAll();\n\t}\n}\n\nfunction activateHighlighted(ctx: AskUserKeyHandlerContext): void {\n\tconst state = ctx.state;\n\tif (state.highlightIndex === state.ownAnswerRowIndex) {\n\t\tctx.openOwnAnswer();\n\t\treturn;\n\t}\n\tconst option = state.activeQuestion.options[state.highlightIndex];\n\tif (!option) return;\n\tstate.activateOption(state.activeQuestion.id, option.label);\n\tctx.emitProgress();\n\tctx.updateAll();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ask-user-question-keys.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-question-keys.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAc,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAgBhF,MAAM,UAAU,qBAAqB,CAAC,GAA6B,EAAE,IAAY;IAChF,MAAM,EAAE,GAAG,cAAc,EAAE,CAAC;IAC5B,IAAI,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC;QAChC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACxB,OAAO;IACR,CAAC;IACD,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;QACtC,kBAAkB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAClC,OAAO;IACR,CAAC;IACD,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QAClC,eAAe,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC/B,OAAO;IACR,CAAC;IACD,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,kBAAkB,CAAC,GAA6B,EAAE,IAAY,EAAE,EAAqC;IAC7G,IAAI,UAAU,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC;QACpC,GAAG,CAAC,eAAe,EAAE,CAAC;QACtB,GAAG,CAAC,aAAa,EAAE,CAAC;QACpB,OAAO;IACR,CAAC;IACD,IAAI,EAAE,CAAC,OAA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;IAClE,IAAI,CAAC,MAAM;QAAE,OAAO;IACpB,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;QACnD,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7D,CAAC;IACD,GAAG,CAAC,YAAY,EAAE,CAAC;IACnB,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,IAAI,OAAO,EAAE,CAAC;QACb,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9G,GAAG,CAAC,aAAa,EAAE,CAAC;QACrB,CAAC;aAAM,CAAC;YACP,KAAK,CAAC,OAAO,EAAE,CAAC;YAChB,GAAG,CAAC,SAAS,EAAE,CAAC;QACjB,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["/**\n * Key dispatch for the ask-user question overlay. Split from the component to\n * keep every sibling under 250 LOC; handlers operate on the shared state and\n * the component's Inputs via an explicit context.\n */\n\nimport { getKeybindings, type Input, matchesKey } from \"@earendil-works/pi-tui\";\nimport type { QuestionResponse } from \"../../../core/extensions/types.ts\";\nimport type { AskUserQuestionState } from \"./ask-user-question-state.ts\";\n\nexport interface AskUserKeyHandlerContext {\n\tstate: AskUserQuestionState;\n\townAnswerInput: Input;\n\tcommentInput: Input;\n\tfinish(status: QuestionResponse[\"status\"], autoResolvedAfterMs?: number): void;\n\tattemptSubmit(): void;\n\topenOwnAnswer(initialText?: string): void;\n\tcommitOwnAnswer(): void;\n\temitProgress(): void;\n\tupdateAll(): void;\n}\n\nexport function handleAskUserKeyInput(ctx: AskUserKeyHandlerContext, data: string): void {\n\tconst kb = getKeybindings();\n\tif (matchesKey(data, \"ctrl+c\")) {\n\t\tctx.finish(\"cancelled\");\n\t\treturn;\n\t}\n\tif (ctx.state.focus === \"own-answer\") {\n\t\thandleOwnAnswerKey(ctx, data, kb);\n\t\treturn;\n\t}\n\tif (ctx.state.focus === \"submit\") {\n\t\thandleSubmitKey(ctx, data, kb);\n\t\treturn;\n\t}\n\thandleOptionsKey(ctx, data, kb);\n}\n\nfunction handleOwnAnswerKey(ctx: AskUserKeyHandlerContext, data: string, kb: ReturnType<typeof getKeybindings>): void {\n\tif (matchesKey(data, \"ctrl+enter\")) {\n\t\tctx.commitOwnAnswer();\n\t\tctx.attemptSubmit();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.confirm\") || data === \"\\n\") {\n\t\tctx.commitOwnAnswer();\n\t\tctx.state.advance();\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.cancel\")) {\n\t\tif (ctx.state.request.waitForAnswer) ctx.state.returnToOptions();\n\t\telse ctx.finish(\"cancelled\");\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tctx.ownAnswerInput.handleInput(data);\n\tctx.emitProgress();\n}\n\nfunction handleSubmitKey(ctx: AskUserKeyHandlerContext, data: string, kb: ReturnType<typeof getKeybindings>): void {\n\tif (matchesKey(data, \"ctrl+enter\") || kb.matches(data, \"tui.input.submit\") || data === \"\\n\") {\n\t\tctx.attemptSubmit();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.cancel\")) {\n\t\tif (ctx.state.request.waitForAnswer) ctx.state.returnToOptions();\n\t\telse ctx.finish(\"cancelled\");\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (matchesKey(data, \"shift+tab\") || matchesKey(data, \"left\")) {\n\t\tctx.state.switchTab(-1);\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (matchesKey(data, \"tab\") || matchesKey(data, \"right\")) {\n\t\tctx.state.switchTab(1);\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tctx.commentInput.handleInput(data);\n\tctx.state.comment = ctx.commentInput.getValue();\n\tctx.emitProgress();\n}\n\nfunction handleOptionsKey(ctx: AskUserKeyHandlerContext, data: string, kb: ReturnType<typeof getKeybindings>): void {\n\tconst state = ctx.state;\n\tif (matchesKey(data, \"ctrl+enter\")) {\n\t\tctx.attemptSubmit();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.cancel\")) {\n\t\tif (!state.request.waitForAnswer || state.requestDismiss() === \"cancel\") ctx.finish(\"cancelled\");\n\t\telse ctx.updateAll();\n\t\treturn;\n\t}\n\tif (matchesKey(data, \"tab\") || matchesKey(data, \"right\")) {\n\t\tstate.switchTab(1);\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (matchesKey(data, \"shift+tab\") || matchesKey(data, \"left\")) {\n\t\tstate.switchTab(-1);\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.up\") || data === \"k\") {\n\t\tstate.highlightIndex = Math.max(0, state.highlightIndex - 1);\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.down\") || data === \"j\") {\n\t\tstate.highlightIndex = Math.min(state.ownAnswerRowIndex, state.highlightIndex + 1);\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (data.length === 1 && data >= \"1\" && data <= \"9\") {\n\t\tconst option = state.activeQuestion.options[Number(data) - 1];\n\t\tif (option) {\n\t\t\tstate.activateOption(state.activeQuestion.id, option.label);\n\t\t\tctx.emitProgress();\n\t\t\tif (!state.activeQuestion.multiSelect) {\n\t\t\t\tif (state.request.waitForAnswer && state.request.questions.length === 1) ctx.attemptSubmit();\n\t\t\t\telse state.advance();\n\t\t\t}\n\t\t\tctx.updateAll();\n\t\t}\n\t\treturn;\n\t}\n\tif (matchesKey(data, \"space\")) {\n\t\tactivateHighlighted(ctx, false);\n\t\treturn;\n\t}\n\tif (kb.matches(data, \"tui.select.confirm\") || data === \"\\n\") {\n\t\tactivateHighlighted(ctx, true);\n\t\treturn;\n\t}\n\tif (data === \"c\") {\n\t\tstate.focus = \"submit\";\n\t\tctx.updateAll();\n\t\treturn;\n\t}\n\tif (data.length === 1 && data >= \" \" && data !== \"c\") {\n\t\tctx.openOwnAnswer(data);\n\t\tctx.updateAll();\n\t}\n}\n\nfunction activateHighlighted(ctx: AskUserKeyHandlerContext, confirm: boolean): void {\n\tconst state = ctx.state;\n\tif (state.highlightIndex === state.ownAnswerRowIndex) {\n\t\tctx.openOwnAnswer();\n\t\treturn;\n\t}\n\tconst option = state.activeQuestion.options[state.highlightIndex];\n\tif (!option) return;\n\tif (!confirm || !state.activeQuestion.multiSelect) {\n\t\tstate.activateOption(state.activeQuestion.id, option.label);\n\t}\n\tctx.emitProgress();\n\tctx.updateAll();\n\tif (confirm) {\n\t\tif (!state.activeQuestion.multiSelect && state.request.waitForAnswer && state.request.questions.length === 1) {\n\t\t\tctx.attemptSubmit();\n\t\t} else {\n\t\t\tstate.advance();\n\t\t\tctx.updateAll();\n\t\t}\n\t}\n}\n"]}
|
|
@@ -9,9 +9,10 @@ export declare function renderTitle(countdownLabel: string): string;
|
|
|
9
9
|
export declare function renderTabBar(state: AskUserQuestionState): string;
|
|
10
10
|
export declare function renderQuestionLine(question: QuestionRequest["questions"][number]): string;
|
|
11
11
|
export declare function renderQuestionList(state: AskUserQuestionState): string[];
|
|
12
|
+
export declare function renderSubmitSummary(state: AskUserQuestionState): string[];
|
|
12
13
|
export declare function renderOwnAnswerLabel(): string;
|
|
13
14
|
export declare function renderCommentLabel(): string;
|
|
14
15
|
export declare function renderNotice(notice: string | undefined): string;
|
|
15
16
|
export declare function renderSubmitLine(state: AskUserQuestionState): string;
|
|
16
|
-
export declare function renderHintsLine(): string;
|
|
17
|
+
export declare function renderHintsLine(state: AskUserQuestionState): string;
|
|
17
18
|
//# sourceMappingURL=ask-user-question-render.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-user-question-render.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-question-render.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EAAE,KAAK,oBAAoB,EAAmC,MAAM,8BAA8B,CAAC;AAG1G,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"ask-user-question-render.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/ask-user-question-render.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EAAE,KAAK,oBAAoB,EAAmC,MAAM,8BAA8B,CAAC;AAG1G,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAahE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAEzF;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAkBxE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAOzE;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CASpE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAoCnE"}
|