@deepseek-harness-tui/dsh-tui 0.11.1 → 0.12.0
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/README.md +70 -24
- package/assets/whale-girl/whale-girl-dark.png +0 -0
- package/assets/whale-girl/whale-girl-happy.png +0 -0
- package/assets/whale-girl/whale-girl.png +0 -0
- package/bin/dsh-tui.js +93 -6
- package/cordis.patch.yml +63 -22
- package/cordis.yml +3 -2
- package/guide/dsh-tui-guide/SKILL.md +37 -0
- package/guide/dsh-tui-guide/configuration.en.md +410 -0
- package/guide/dsh-tui-guide/configuration.md +349 -0
- package/guide/dsh-tui-guide/getting-started.en.md +398 -0
- package/guide/dsh-tui-guide/getting-started.md +397 -0
- package/guide/dsh-tui-guide/interaction.en.md +674 -0
- package/guide/dsh-tui-guide/interaction.md +747 -0
- package/guide/dsh-tui-guide/migrate.en.md +166 -0
- package/guide/dsh-tui-guide/migrate.md +132 -0
- package/guide/dsh-tui-guide/plugins.en.md +68 -0
- package/guide/dsh-tui-guide/plugins.md +56 -0
- package/guide/dsh-tui-guide/themes.en.md +192 -0
- package/guide/dsh-tui-guide/themes.md +185 -0
- package/guide/dsh-tui-guide/user-guide.en.md +608 -0
- package/guide/dsh-tui-guide/user-guide.md +586 -0
- package/guide/dsh-tui-guide/vscode.en.md +301 -0
- package/guide/dsh-tui-guide/vscode.md +272 -0
- package/lib/settings.json +1272 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +10 -2
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +17 -0
- package/lib/types/adapter/kernel/replay.d.ts.map +1 -1
- package/lib/types/adapter/kernel/replay.js +2 -0
- package/lib/types/adapter/ports/channel-display.d.ts +12 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +38 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +14 -1
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +75 -6
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +86 -9
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +2 -0
- package/lib/types/components/BalanceReportRow.d.ts +10 -2
- package/lib/types/components/BalanceReportRow.d.ts.map +1 -1
- package/lib/types/components/BalanceReportRow.js +18 -4
- package/lib/types/components/Chat/JobCard.d.ts +9 -0
- package/lib/types/components/Chat/JobCard.d.ts.map +1 -1
- package/lib/types/components/Chat/JobCard.js +42 -15
- package/lib/types/components/Chat/SubagentMessage.js +6 -6
- package/lib/types/components/CompactionStatusRow.d.ts +24 -0
- package/lib/types/components/CompactionStatusRow.d.ts.map +1 -0
- package/lib/types/components/CompactionStatusRow.js +72 -0
- package/lib/types/components/GoalTodoPanel.js +2 -2
- package/lib/types/components/HelpMenu.d.ts +2 -2
- package/lib/types/components/HelpMenu.d.ts.map +1 -1
- package/lib/types/components/HelpMenu.js +5 -4
- package/lib/types/components/InlineMathParagraph.d.ts +22 -0
- package/lib/types/components/InlineMathParagraph.d.ts.map +1 -0
- package/lib/types/components/InlineMathParagraph.js +178 -0
- package/lib/types/components/JobsPanel.d.ts.map +1 -1
- package/lib/types/components/JobsPanel.js +80 -33
- package/lib/types/components/LogoV2.d.ts +41 -3
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +148 -24
- package/lib/types/components/Markdown.d.ts +10 -3
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +47 -14
- package/lib/types/components/MathBlock.d.ts +13 -0
- package/lib/types/components/MathBlock.d.ts.map +1 -0
- package/lib/types/components/MathBlock.js +136 -0
- package/lib/types/components/MessageList.d.ts +10 -1
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +16 -7
- package/lib/types/components/MigratePicker.d.ts +30 -0
- package/lib/types/components/MigratePicker.d.ts.map +1 -0
- package/lib/types/components/MigratePicker.js +38 -0
- package/lib/types/components/PresetPicker.d.ts +4 -0
- package/lib/types/components/PresetPicker.d.ts.map +1 -1
- package/lib/types/components/PresetPicker.js +5 -1
- package/lib/types/components/PromptInput.d.ts +17 -0
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +60 -8
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +2 -1
- package/lib/types/components/StarPrompt.d.ts +59 -0
- package/lib/types/components/StarPrompt.d.ts.map +1 -0
- package/lib/types/components/StarPrompt.js +326 -0
- package/lib/types/components/StreamingMarkdown.d.ts.map +1 -1
- package/lib/types/components/StreamingMarkdown.js +20 -3
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +8 -8
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +108 -10
- package/lib/types/components/TimelineRail.d.ts.map +1 -1
- package/lib/types/components/TimelineRail.js +9 -1
- package/lib/types/components/Whale.d.ts +17 -8
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +25 -15
- package/lib/types/components/WhaleGirl.d.ts +35 -0
- package/lib/types/components/WhaleGirl.d.ts.map +1 -0
- package/lib/types/components/WhaleGirl.js +50 -0
- package/lib/types/components/WorkingSpinner.d.ts +4 -1
- package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
- package/lib/types/components/WorkingSpinner.js +2 -2
- package/lib/types/components/bigfont.d.ts +47 -18
- package/lib/types/components/bigfont.d.ts.map +1 -1
- package/lib/types/components/bigfont.js +55 -40
- package/lib/types/components/design-system/ThemeProvider.d.ts +6 -0
- package/lib/types/components/design-system/ThemeProvider.d.ts.map +1 -1
- package/lib/types/components/design-system/ThemeProvider.js +40 -1
- package/lib/types/components/maidPortrait.d.ts +44 -0
- package/lib/types/components/maidPortrait.d.ts.map +1 -0
- package/lib/types/components/maidPortrait.js +178 -0
- package/lib/types/components/mathPreview.d.ts +25 -0
- package/lib/types/components/mathPreview.d.ts.map +1 -0
- package/lib/types/components/mathPreview.js +48 -0
- package/lib/types/components/messages/AssistantThinkingMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantThinkingMessage.js +6 -5
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +3 -2
- package/lib/types/components/messages/TranscriptImages.d.ts.map +1 -1
- package/lib/types/components/messages/TranscriptImages.js +11 -1
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts +14 -2
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +80 -38
- package/lib/types/components/questions/PlanReviewPanel.d.ts.map +1 -1
- package/lib/types/components/questions/PlanReviewPanel.js +3 -3
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +34 -0
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -0
- package/lib/types/components/sessions/ForeignSessionRow.js +43 -0
- package/lib/types/components/sessions/SourceTabs.d.ts +52 -0
- package/lib/types/components/sessions/SourceTabs.d.ts.map +1 -0
- package/lib/types/components/sessions/SourceTabs.js +70 -0
- package/lib/types/components/splashEggs.d.ts +56 -0
- package/lib/types/components/splashEggs.d.ts.map +1 -0
- package/lib/types/components/splashEggs.js +67 -0
- package/lib/types/components/splashFonts.d.ts +119 -0
- package/lib/types/components/splashFonts.d.ts.map +1 -0
- package/lib/types/components/splashFonts.js +267 -0
- package/lib/types/components/splashLayout.d.ts +41 -0
- package/lib/types/components/splashLayout.d.ts.map +1 -0
- package/lib/types/components/splashLayout.js +40 -0
- package/lib/types/components/trajectory/MiniWake.d.ts +11 -1
- package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
- package/lib/types/components/trajectory/MiniWake.js +9 -3
- package/lib/types/components/whaleGirlSprite.d.ts +17 -0
- package/lib/types/components/whaleGirlSprite.d.ts.map +1 -0
- package/lib/types/components/whaleGirlSprite.js +47 -0
- package/lib/types/deepseekPricing.d.ts +74 -0
- package/lib/types/deepseekPricing.d.ts.map +1 -1
- package/lib/types/deepseekPricing.js +110 -11
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/action-readiness.js +6 -1
- package/lib/types/dsh-adapter/channel/background-action.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/background-action.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/background-action.js +1 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +8 -9
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +69 -21
- package/lib/types/dsh-adapter/channel/compaction.d.ts +2 -1
- package/lib/types/dsh-adapter/channel/compaction.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/compaction.js +35 -2
- package/lib/types/dsh-adapter/channel/external-commands.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/external-commands.js +8 -2
- package/lib/types/dsh-adapter/channel/job-projection.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/job-projection.js +88 -3
- package/lib/types/dsh-adapter/channel/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/local-actions.js +6 -1
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts +13 -0
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-actions.js +48 -7
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.js +25 -9
- package/lib/types/dsh-adapter/channel/model-switch.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-switch.js +5 -1
- package/lib/types/dsh-adapter/channel/paths.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/paths.js +7 -1
- package/lib/types/dsh-adapter/channel/preferences.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/preferences.js +31 -5
- package/lib/types/dsh-adapter/channel/projection.d.ts +1 -2
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +127 -17
- package/lib/types/dsh-adapter/channel/question-record.d.ts +76 -0
- package/lib/types/dsh-adapter/channel/question-record.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/question-record.js +107 -0
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts +42 -0
- package/lib/types/dsh-adapter/channel/session-lineage.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/session-lineage.js +51 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts +2 -0
- package/lib/types/dsh-adapter/channel/session-live-adoption.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-live-adoption.js +9 -3
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts +2 -1
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +39 -7
- package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +7 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +4 -2
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +8 -0
- package/lib/types/dsh-adapter/channel/state.d.ts +17 -2
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +6 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts +30 -35
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +143 -4
- package/lib/types/dsh-adapter/channel/types.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +35 -5
- package/lib/types/dsh-adapter/compat/messages.d.ts +6 -0
- package/lib/types/dsh-adapter/compat/messages.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/messages.js +9 -0
- package/lib/types/dsh-adapter/contract.d.ts +6 -5
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +14 -6
- package/lib/types/dsh-adapter/index.d.ts +36 -1
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +22 -6
- package/lib/types/dsh-adapter/jobs.d.ts +82 -16
- package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/jobs.js +104 -9
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.js +131 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.d.ts +17 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/claude-code.parse.js +329 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.js +102 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.parse.d.ts +16 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/codex.parse.js +289 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.js +117 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.d.ts +13 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/grok-build.parse.js +178 -0
- package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/omp.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/omp.js +133 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan-fs.d.ts +60 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan-fs.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan-fs.js +178 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts +8 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/scan.js +40 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts +3 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.js +93 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.d.ts +9 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/adapters/zcode.parse.js +89 -0
- package/lib/types/dsh-adapter/migrate/bin-path.d.ts +6 -0
- package/lib/types/dsh-adapter/migrate/bin-path.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/bin-path.js +30 -0
- package/lib/types/dsh-adapter/migrate/browse.d.ts +42 -0
- package/lib/types/dsh-adapter/migrate/browse.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/browse.js +90 -0
- package/lib/types/dsh-adapter/migrate/cli.d.ts +9 -0
- package/lib/types/dsh-adapter/migrate/cli.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/cli.js +106 -0
- package/lib/types/dsh-adapter/migrate/import-one.d.ts +89 -0
- package/lib/types/dsh-adapter/migrate/import-one.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/import-one.js +133 -0
- package/lib/types/dsh-adapter/migrate/index.d.ts +35 -0
- package/lib/types/dsh-adapter/migrate/index.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/index.js +107 -0
- package/lib/types/dsh-adapter/migrate/parse/injection.d.ts +40 -0
- package/lib/types/dsh-adapter/migrate/parse/injection.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/injection.js +127 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts +28 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/jsonl.js +40 -0
- package/lib/types/dsh-adapter/migrate/parse/role-turns.d.ts +28 -0
- package/lib/types/dsh-adapter/migrate/parse/role-turns.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/role-turns.js +50 -0
- package/lib/types/dsh-adapter/migrate/parse/title.d.ts +18 -0
- package/lib/types/dsh-adapter/migrate/parse/title.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/title.js +29 -0
- package/lib/types/dsh-adapter/migrate/parse/tools.d.ts +62 -0
- package/lib/types/dsh-adapter/migrate/parse/tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/parse/tools.js +110 -0
- package/lib/types/dsh-adapter/migrate/picker.d.ts +64 -0
- package/lib/types/dsh-adapter/migrate/picker.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/picker.js +86 -0
- package/lib/types/dsh-adapter/migrate/recent-agents.d.ts +40 -0
- package/lib/types/dsh-adapter/migrate/recent-agents.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/recent-agents.js +100 -0
- package/lib/types/dsh-adapter/migrate/sessionize.d.ts +39 -0
- package/lib/types/dsh-adapter/migrate/sessionize.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/sessionize.js +271 -0
- package/lib/types/dsh-adapter/migrate/types.d.ts +176 -0
- package/lib/types/dsh-adapter/migrate/types.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/types.js +11 -0
- package/lib/types/dsh-adapter/migrate/uuid.d.ts +7 -0
- package/lib/types/dsh-adapter/migrate/uuid.d.ts.map +1 -0
- package/lib/types/dsh-adapter/migrate/uuid.js +25 -0
- package/lib/types/dsh-adapter/oauth/bonus.d.ts +27 -0
- package/lib/types/dsh-adapter/oauth/bonus.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth/bonus.js +69 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/command.d.ts +2 -1
- package/lib/types/dsh-adapter/oauth/command.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/command.js +7 -4
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/credentials.d.ts +13 -10
- package/lib/types/dsh-adapter/oauth/credentials.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/credentials.js +61 -23
- package/lib/types/dsh-adapter/oauth/deepseek.d.ts +39 -0
- package/lib/types/dsh-adapter/oauth/deepseek.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth/deepseek.js +189 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/index.d.ts +24 -16
- package/lib/types/dsh-adapter/oauth/index.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/index.js +34 -20
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/interaction.d.ts +14 -12
- package/lib/types/dsh-adapter/oauth/interaction.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth/interaction.js +283 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/opener.d.ts +2 -1
- package/lib/types/dsh-adapter/oauth/opener.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/opener.js +1 -1
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/pi-ai.d.ts +10 -3
- package/lib/types/dsh-adapter/oauth/pi-ai.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/pi-ai.js +8 -3
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/profiles.d.ts +6 -3
- package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/profiles.js +11 -3
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/service.d.ts +14 -7
- package/lib/types/dsh-adapter/oauth/service.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/service.js +82 -17
- package/lib/types/dsh-adapter/plugin.d.ts +12 -3
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +215 -376
- package/lib/types/dsh-adapter/presets.d.ts +6 -4
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +6 -4
- package/lib/types/dsh-adapter/providerWizard.d.ts +17 -0
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +260 -68
- package/lib/types/dsh-adapter/questions.d.ts +22 -15
- package/lib/types/dsh-adapter/questions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/questions.js +47 -45
- package/lib/types/dsh-adapter/sessions/digest.d.ts +11 -6
- package/lib/types/dsh-adapter/sessions/digest.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/digest.js +20 -13
- package/lib/types/dsh-adapter/sessions/frames.d.ts +3 -1
- package/lib/types/dsh-adapter/sessions/frames.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/frames.js +5 -4
- package/lib/types/dsh-adapter/sessions/list.d.ts +6 -1
- package/lib/types/dsh-adapter/sessions/list.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/list.js +188 -164
- package/lib/types/dsh-adapter/sessions/recovery.d.ts +16 -0
- package/lib/types/dsh-adapter/sessions/recovery.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/recovery.js +108 -0
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts +7 -0
- package/lib/types/dsh-adapter/sessions/snapshot.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sessions/snapshot.js +90 -0
- package/lib/types/dsh-adapter/sessions/store.d.ts +10 -4
- package/lib/types/dsh-adapter/sessions/store.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sessions/store.js +62 -25
- package/lib/types/dsh-adapter/sideQuestion.d.ts +41 -2
- package/lib/types/dsh-adapter/sideQuestion.d.ts.map +1 -1
- package/lib/types/dsh-adapter/sideQuestion.js +98 -2
- package/lib/types/dsh-adapter/subagents.d.ts +29 -3
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +87 -3
- package/lib/types/herdr.d.ts +2 -0
- package/lib/types/herdr.d.ts.map +1 -1
- package/lib/types/herdr.js +9 -3
- package/lib/types/i18n.d.ts +598 -60
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +198 -31
- package/lib/types/ink/components/App.d.ts +2 -2
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +15 -2
- package/lib/types/ink/components/Image.d.ts +14 -1
- package/lib/types/ink/components/Image.d.ts.map +1 -1
- package/lib/types/ink/components/Image.js +2 -2
- package/lib/types/ink/events/input-event.js +3 -3
- package/lib/types/ink/hooks/use-terminal-images.d.ts +12 -0
- package/lib/types/ink/hooks/use-terminal-images.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-terminal-images.js +13 -0
- package/lib/types/ink/ink.d.ts +6 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +16 -1
- package/lib/types/ink/kitty-graphics.d.ts +44 -3
- package/lib/types/ink/kitty-graphics.d.ts.map +1 -1
- package/lib/types/ink/kitty-graphics.js +184 -23
- package/lib/types/ink/output.d.ts +24 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +83 -5
- package/lib/types/ink/parse-keypress.d.ts +61 -1
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +764 -93
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +8 -1
- package/lib/types/ink/screen.d.ts +24 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +89 -0
- package/lib/types/ink/selection.d.ts +40 -18
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +142 -30
- package/lib/types/ink/sixel-codec.d.ts +12 -1
- package/lib/types/ink/sixel-codec.d.ts.map +1 -1
- package/lib/types/ink/sixel-codec.js +29 -5
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +5 -3
- package/lib/types/ink/styles.d.ts +9 -0
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-image.d.ts +8 -0
- package/lib/types/ink/terminal-image.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.d.ts +32 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +54 -2
- package/lib/types/ink/timeline-rail.d.ts +5 -0
- package/lib/types/ink/timeline-rail.d.ts.map +1 -1
- package/lib/types/ink/update-overflow-guard.d.ts +24 -0
- package/lib/types/ink/update-overflow-guard.d.ts.map +1 -1
- package/lib/types/ink/update-overflow-guard.js +25 -3
- package/lib/types/math/inline-layout.d.ts +29 -0
- package/lib/types/math/inline-layout.d.ts.map +1 -0
- package/lib/types/math/inline-layout.js +106 -0
- package/lib/types/math/layout.d.ts +58 -0
- package/lib/types/math/layout.d.ts.map +1 -0
- package/lib/types/math/layout.js +59 -0
- package/lib/types/math/renderer.d.ts +64 -0
- package/lib/types/math/renderer.d.ts.map +1 -0
- package/lib/types/math/renderer.js +256 -0
- package/lib/types/minimalUiMode.d.ts +19 -0
- package/lib/types/minimalUiMode.d.ts.map +1 -0
- package/lib/types/minimalUiMode.js +23 -0
- package/lib/types/oauth.d.ts +5 -10
- package/lib/types/oauth.d.ts.map +1 -1
- package/lib/types/oauth.js +5 -10
- package/lib/types/screens/Chat.d.ts +17 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +627 -54
- package/lib/types/screens/SessionSupervisor.d.ts +2 -1
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +156 -19
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +49 -11
- package/lib/types/screens/StatusLine.d.ts +4 -0
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +57 -27
- package/lib/types/screens/chatOverlay.d.ts +5 -0
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +1 -0
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts +47 -0
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +65 -0
- package/lib/types/screens/sessionSupervisor/model.d.ts +12 -0
- package/lib/types/screens/sessionSupervisor/model.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/model.js +26 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts +107 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.d.ts.map +1 -0
- package/lib/types/screens/sessionSupervisor/useForeignSessions.js +312 -0
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +4 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +97 -14
- package/lib/types/sessionHistory.d.ts +2 -2
- package/lib/types/sessionHistory.d.ts.map +1 -1
- package/lib/types/sessionHistory.js +31 -5
- package/lib/types/settings/definitions.d.ts +681 -0
- package/lib/types/settings/definitions.d.ts.map +1 -0
- package/lib/types/settings/definitions.js +511 -0
- package/lib/types/starAction.d.ts +44 -0
- package/lib/types/starAction.d.ts.map +1 -0
- package/lib/types/starAction.js +52 -0
- package/lib/types/terminal-utils/latex.d.ts +10 -0
- package/lib/types/terminal-utils/latex.d.ts.map +1 -0
- package/lib/types/terminal-utils/latex.js +1417 -0
- package/lib/types/terminal-utils/markdown.d.ts +3 -1
- package/lib/types/terminal-utils/markdown.d.ts.map +1 -1
- package/lib/types/terminal-utils/markdown.js +26 -1
- package/lib/types/terminal-utils/math.d.ts +66 -0
- package/lib/types/terminal-utils/math.d.ts.map +1 -0
- package/lib/types/terminal-utils/math.js +337 -0
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +16 -4
- package/lib/types/tuiDisplayPrefs.d.ts +67 -0
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +59 -0
- package/lib/types/ui.d.ts +1 -1
- package/lib/types/ui.d.ts.map +1 -1
- package/lib/types/ui.js +1 -1
- package/lib/types/update.js +2 -2
- package/lib/types/usageStats.d.ts +98 -0
- package/lib/types/usageStats.d.ts.map +1 -0
- package/lib/types/usageStats.js +169 -0
- package/lib/types/utils/bmp.d.ts +17 -0
- package/lib/types/utils/bmp.d.ts.map +1 -0
- package/lib/types/utils/bmp.js +154 -0
- package/lib/types/utils/clipboard.d.ts +14 -2
- package/lib/types/utils/clipboard.d.ts.map +1 -1
- package/lib/types/utils/clipboard.js +143 -8
- package/lib/types/utils/fold-long-lines.d.ts.map +1 -1
- package/lib/types/utils/fold-long-lines.js +2 -1
- package/lib/types/utils/keymap.d.ts +4 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +8 -0
- package/lib/types/utils/modifiers.d.ts +4 -3
- package/lib/types/utils/modifiers.d.ts.map +1 -1
- package/lib/types/utils/modifiers.js +4 -3
- package/lib/types/utils/pastedImagePath.d.ts +8 -0
- package/lib/types/utils/pastedImagePath.d.ts.map +1 -1
- package/lib/types/utils/pastedImagePath.js +29 -5
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/LICENSE +202 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/NOTICE +20 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/index.d.ts +16 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/bundled-packages.json +4 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/index.mjs +20 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/lib/index.mjs.LEGAL.txt +35 -0
- package/node_modules/@dsh-tui-vendor/mathjax-tex-svg/package.json +29 -0
- package/package.json +127 -102
- package/presets/liangshen/agent.cordis.yml +4 -1
- package/presets/liangshen/preset.yml +1 -1
- package/lib/types/minimalMode.d.ts +0 -13
- package/lib/types/minimalMode.d.ts.map +0 -1
- package/lib/types/minimalMode.js +0 -17
- package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +0 -21
- package/node_modules/@deepseek-harness-tui/dsh-auth/README.md +0 -143
- package/node_modules/@deepseek-harness-tui/dsh-auth/cordis.patch.yml +0 -11
- package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +0 -44
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.js +0 -193
- package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +0 -69
package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/index.js
RENAMED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Built-in subscription OAuth sign-in as LLM provider routes.
|
|
3
3
|
*
|
|
4
|
-
* One
|
|
5
|
-
* (ChatGPT/Codex, Claude
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* One internal Cordis module mounts supported subscription routes from the
|
|
5
|
+
* installed pi-ai catalog (ChatGPT/Codex, Claude, Grok, and newer flows when
|
|
6
|
+
* available) as `llm` registry routes. Signed-in models appear in model
|
|
7
|
+
* pickers; unsigned routes remain addressable for saved sessions. When the
|
|
8
|
+
* Host supplies `deepseekAccount`, the same sign-in surface also delegates
|
|
9
|
+
* DeepSeek browser authorization to that service; the Host owns its model
|
|
10
|
+
* route, callback, and credential store.
|
|
11
|
+
* `PiAiAdapter` runs with this
|
|
12
|
+
* module's file-backed pi-ai `CredentialStore` injected
|
|
9
13
|
* (`PiAiAuthInjection`): requests resolve the stored OAuth credential through
|
|
10
14
|
* the provider's own auth and rotate refresh tokens under the store's lock.
|
|
11
15
|
* Login/logout run over the `userQuestions` seam, so they work on any
|
|
12
16
|
* interactive surface and refuse cleanly where none exists (TUI-RUN-001).
|
|
13
17
|
*
|
|
14
18
|
* ```yaml
|
|
15
|
-
* - id: dsh-auth
|
|
16
|
-
* name: 'dsh-
|
|
19
|
+
* - id: dsh-tui-auth
|
|
20
|
+
* name: '@deepseek-harness-tui/dsh-tui/oauth'
|
|
21
|
+
* inject: [llm, commands]
|
|
17
22
|
* config:
|
|
18
|
-
* providers: [openai-codex, anthropic, xai]
|
|
23
|
+
* # providers: [openai-codex, anthropic, xai] # optional catalog subset;
|
|
24
|
+
* # newer pi-ai also offers openai and meta
|
|
19
25
|
* # credentialsFile: /secure/path/credentials.json # default $DSH_HOME/dsh-auth/
|
|
20
26
|
* # Per-provider catalog overrides, keyed by provider id then model id:
|
|
21
27
|
* # any optional field keeps the installed catalog's value. The example
|
|
@@ -30,7 +36,7 @@
|
|
|
30
36
|
* (an llm-pi-ai settings profile for the same provider) is refused by the
|
|
31
37
|
* registry — that refusal is logged and the remaining routes still mount.
|
|
32
38
|
*
|
|
33
|
-
* @module dsh-
|
|
39
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth
|
|
34
40
|
*/
|
|
35
41
|
import { existsSync } from 'node:fs';
|
|
36
42
|
import { homedir } from 'node:os';
|
|
@@ -38,18 +44,18 @@ import { join } from 'node:path';
|
|
|
38
44
|
import z from '@deepseek-ai/schemastery';
|
|
39
45
|
import { PiAiAdapter } from '@deepseek-ai/dsh-llm-pi-ai';
|
|
40
46
|
import { CredentialFile, defaultCredentialsFile } from './credentials.js';
|
|
41
|
-
import { buildOAuthProfile, OAUTH_PROVIDER_IDS } from './profiles.js';
|
|
47
|
+
import { availableOAuthProviderIds, buildOAuthProfile, OAUTH_PROVIDER_IDS } from './profiles.js';
|
|
42
48
|
import { createDshAuthApi, DshAuthService } from './service.js';
|
|
43
49
|
import { createAuthCommandHandler } from './command.js';
|
|
50
|
+
import { createDeepSeekCallbackOriginResolver, deepSeekAccountFrom } from './deepseek.js';
|
|
44
51
|
export const name = 'dsh-auth';
|
|
45
52
|
/**
|
|
46
53
|
* Deliberately empty. A hard code-level inject would deadlock any
|
|
47
54
|
* composition lacking the `llm`/`commands` services at boot ("pending
|
|
48
55
|
* (waiting for service: …)") — the failure mode dsh-tui documented for its
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* *entry* level, where a stale patch cannot deadlock a newer boot.
|
|
56
|
+
* optional rows (#183). Both services resolve per call through `ctx.get` in
|
|
57
|
+
* {@link apply}; the profile patch declares the inject at the *entry* level,
|
|
58
|
+
* where a stale patch cannot deadlock a newer boot.
|
|
53
59
|
*/
|
|
54
60
|
export const inject = [];
|
|
55
61
|
const modelOverride = z.object({
|
|
@@ -57,7 +63,7 @@ const modelOverride = z.object({
|
|
|
57
63
|
maxTokens: z.number().step(1).min(1),
|
|
58
64
|
});
|
|
59
65
|
export const Config = z.object({
|
|
60
|
-
providers: z.array(z.string()).default(
|
|
66
|
+
providers: z.array(z.string()).default(availableOAuthProviderIds()),
|
|
61
67
|
credentialsFile: z.string(),
|
|
62
68
|
modelOverrides: z.dict(z.dict(modelOverride)),
|
|
63
69
|
});
|
|
@@ -65,7 +71,9 @@ export { createDshAuthApi } from './service.js';
|
|
|
65
71
|
export { QuestionBridge, describeEvent } from './interaction.js';
|
|
66
72
|
export { copyToClipboard, openInBrowser, openerFor } from './opener.js';
|
|
67
73
|
export { CredentialFile, defaultCredentialsFile } from './credentials.js';
|
|
68
|
-
export { OAUTH_PROVIDER_IDS, buildOAuthProfile } from './profiles.js';
|
|
74
|
+
export { OAUTH_PROVIDER_IDS, availableOAuthProviderIds, buildOAuthProfile } from './profiles.js';
|
|
75
|
+
export { DEEPSEEK_ACCOUNT_PROVIDER, deepSeekAccountFrom, deepSeekCallbackOrigin, deepSeekClientMetadata, loginDeepSeekAccount } from './deepseek.js';
|
|
76
|
+
export { WhaleCouponStore } from './bonus.js';
|
|
69
77
|
/**
|
|
70
78
|
* The ambient auth context providers may consult while resolving their own
|
|
71
79
|
* auth. `env()` answers from the process environment; `fileExists()` answers
|
|
@@ -107,7 +115,7 @@ export class CredentialGatedAdapter extends PiAiAdapter {
|
|
|
107
115
|
}
|
|
108
116
|
/** Mount the routes, the service, and the command. */
|
|
109
117
|
export function apply(ctx, config) {
|
|
110
|
-
const configured = config.providers ??
|
|
118
|
+
const configured = config.providers ?? availableOAuthProviderIds();
|
|
111
119
|
const unknown = configured.filter(id => !OAUTH_PROVIDER_IDS.includes(id));
|
|
112
120
|
if (unknown.length > 0 || configured.length === 0) {
|
|
113
121
|
throw new Error(`dsh-auth: providers must be a non-empty subset of [${OAUTH_PROVIDER_IDS.join(', ')}]; got [${configured.join(', ')}]`);
|
|
@@ -156,17 +164,23 @@ export function apply(ctx, config) {
|
|
|
156
164
|
// the plugin module; the defensive get-then-create matches how the TUI
|
|
157
165
|
// mounts userQuestions.
|
|
158
166
|
const service = ctx.get('dshAuth') ?? new DshAuthService(ctx);
|
|
167
|
+
const callbackOrigin = createDeepSeekCallbackOriginResolver(ctx);
|
|
159
168
|
const api = createDshAuthApi({
|
|
160
169
|
profiles,
|
|
161
170
|
store,
|
|
171
|
+
resolveDeepSeekAccount: () => deepSeekAccountFrom(ctx),
|
|
172
|
+
coupons: service.coupons,
|
|
173
|
+
resolveCallbackOrigin: callbackOrigin.resolve,
|
|
162
174
|
resolveAsk: () => {
|
|
163
175
|
const questions = ctx.get('userQuestions');
|
|
164
176
|
return questions === undefined ? undefined : request => questions.ask(request);
|
|
165
177
|
},
|
|
166
|
-
logger: ctx.logger,
|
|
167
178
|
});
|
|
168
179
|
service.api = api;
|
|
169
180
|
ctx.effect(function* () {
|
|
181
|
+
// LIFO disposal: release command registration, drain started logins, then
|
|
182
|
+
// close a fallback callback listener only this module mounted.
|
|
183
|
+
yield () => callbackOrigin.dispose();
|
|
170
184
|
const releases = [];
|
|
171
185
|
// Runtime service resolution (never a code-level inject — see `inject`):
|
|
172
186
|
// absent services keep this plugin inert and logged, not the whole boot
|
|
@@ -197,7 +211,7 @@ export function apply(ctx, config) {
|
|
|
197
211
|
const handler = createAuthCommandHandler(api);
|
|
198
212
|
releases.push(commands.register({
|
|
199
213
|
name: 'auth',
|
|
200
|
-
description: 'Provider
|
|
214
|
+
description: 'Provider account sign-in (OAuth): status, login, logout',
|
|
201
215
|
handler: invocation => {
|
|
202
216
|
const operation = handler(invocation);
|
|
203
217
|
active.add(operation);
|
|
@@ -6,19 +6,17 @@
|
|
|
6
6
|
* their options, text/secret/manual-code prompts expect the custom-answer
|
|
7
7
|
* input row.
|
|
8
8
|
*
|
|
9
|
-
* `notify()`
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* path gets the same treatment: its short code is the thing to copy, and
|
|
17
|
-
* the verification page is auto-opened too.
|
|
9
|
+
* `notify()` opens browser/device URLs for pi-ai. Browser flows immediately
|
|
10
|
+
* race a callback server against a `manual_code` prompt; the URL and
|
|
11
|
+
* copy/reopen/cancel actions therefore share that SAME question with the
|
|
12
|
+
* paste field. A separate waiting question would claim the FIFO question
|
|
13
|
+
* surface first and make remote/headless callback fallback unreachable.
|
|
14
|
+
* Browser flows without a manual prompt still get a waiting panel. Device
|
|
15
|
+
* flows use that panel to show/copy the short code until polling settles.
|
|
18
16
|
*
|
|
19
17
|
* One `AbortController` owns the whole run: pi-ai reads `interaction.signal`
|
|
20
|
-
* to abort the flow,
|
|
21
|
-
*
|
|
18
|
+
* to abort the flow, ask requests compose it with per-prompt cancellation,
|
|
19
|
+
* and the waiting panel's cancel action fires it.
|
|
22
20
|
*
|
|
23
21
|
* Nothing here assumes a browser or GUI *exists* (TUI-RUN-001): when no
|
|
24
22
|
* opener or clipboard helper is available the panel degrades to showing the
|
|
@@ -26,7 +24,7 @@
|
|
|
26
24
|
* registered at all, `ask` rejects and the login command turns that into a
|
|
27
25
|
* clear refusal.
|
|
28
26
|
*
|
|
29
|
-
* @module dsh-
|
|
27
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth/interaction
|
|
30
28
|
*/
|
|
31
29
|
import type { AskUserQuestionItem, AskUserQuestionAnswer } from '@deepseek-ai/dsh-user-questions';
|
|
32
30
|
import type { PiAiAuthEvent, PiAiAuthInteraction, PiAiAuthPrompt } from './pi-ai.js';
|
|
@@ -54,15 +52,19 @@ export declare class QuestionBridge implements PiAiAuthInteraction {
|
|
|
54
52
|
private readonly openUrl;
|
|
55
53
|
private readonly copy;
|
|
56
54
|
private waiting;
|
|
55
|
+
private pendingBrowserView;
|
|
56
|
+
private notice;
|
|
57
57
|
private waitingClosed;
|
|
58
58
|
constructor(ask: AskFn, runAbort: AbortController, helpers?: QuestionBridgeHelpers);
|
|
59
59
|
prompt(prompt: PiAiAuthPrompt): Promise<string>;
|
|
60
60
|
notify(event: PiAiAuthEvent): void;
|
|
61
61
|
/** Close the waiting panel (if any) and stop answering for this run. */
|
|
62
62
|
settle(): Promise<void>;
|
|
63
|
+
private retireWaiting;
|
|
63
64
|
/**
|
|
64
65
|
* Show the waiting panel until the flow settles or the user cancels,
|
|
65
66
|
* re-asking after a copy/reopen action with a one-line status prefix.
|
|
66
67
|
*/
|
|
67
68
|
private runWaitingPanel;
|
|
68
69
|
}
|
|
70
|
+
//# sourceMappingURL=interaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/oauth/interaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAGjG,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEpF,4EAA4E;AAC5E,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE;IAC5B,SAAS,EAAE,mBAAmB,EAAE,CAAA;IAChC,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAEpC,iEAAiE;AACjE,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAA;IAClC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC9C;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAU1D;AA6CD;;;;GAIG;AACH,qBAAa,cAAe,YAAW,mBAAmB;IAatD,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAb3B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA0B;IAClD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoC;IACzD,OAAO,CAAC,OAAO,CAGF;IACb,OAAO,CAAC,kBAAkB,CAAyB;IACnD,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,aAAa,CAAQ;gBAGV,GAAG,EAAE,KAAK,EACV,QAAQ,EAAE,eAAe,EAC1C,OAAO,GAAE,qBAA0B;IAO/B,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAqFrD,MAAM,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAgClC,wEAAwE;IAClE,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;YAOf,aAAa;IAM3B;;;OAGG;YACW,eAAe;CAgD9B"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `AuthInteraction` bridge: pi-ai OAuth flows speak prompts and events;
|
|
3
|
+
* every interactive surface in this ecosystem speaks `ctx.userQuestions`.
|
|
4
|
+
*
|
|
5
|
+
* `prompt()` maps one pi-ai prompt onto one question — `select` prompts carry
|
|
6
|
+
* their options, text/secret/manual-code prompts expect the custom-answer
|
|
7
|
+
* input row.
|
|
8
|
+
*
|
|
9
|
+
* `notify()` opens browser/device URLs for pi-ai. Browser flows immediately
|
|
10
|
+
* race a callback server against a `manual_code` prompt; the URL and
|
|
11
|
+
* copy/reopen/cancel actions therefore share that SAME question with the
|
|
12
|
+
* paste field. A separate waiting question would claim the FIFO question
|
|
13
|
+
* surface first and make remote/headless callback fallback unreachable.
|
|
14
|
+
* Browser flows without a manual prompt still get a waiting panel. Device
|
|
15
|
+
* flows use that panel to show/copy the short code until polling settles.
|
|
16
|
+
*
|
|
17
|
+
* One `AbortController` owns the whole run: pi-ai reads `interaction.signal`
|
|
18
|
+
* to abort the flow, ask requests compose it with per-prompt cancellation,
|
|
19
|
+
* and the waiting panel's cancel action fires it.
|
|
20
|
+
*
|
|
21
|
+
* Nothing here assumes a browser or GUI *exists* (TUI-RUN-001): when no
|
|
22
|
+
* opener or clipboard helper is available the panel degrades to showing the
|
|
23
|
+
* URL / code verbatim with a clear note, and where no question provider is
|
|
24
|
+
* registered at all, `ask` rejects and the login command turns that into a
|
|
25
|
+
* clear refusal.
|
|
26
|
+
*
|
|
27
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth/interaction
|
|
28
|
+
*/
|
|
29
|
+
import { t } from '../../i18n.js';
|
|
30
|
+
import { copyToClipboard, openInBrowser } from './opener.js';
|
|
31
|
+
/** Human-readable copy for one notify event. */
|
|
32
|
+
export function describeEvent(event) {
|
|
33
|
+
switch (event.type) {
|
|
34
|
+
case 'auth_url':
|
|
35
|
+
return t('oauth-event-auth-url', { url: event.url });
|
|
36
|
+
case 'device_code':
|
|
37
|
+
return t('oauth-event-device-code', { uri: event.verificationUri, code: event.userCode });
|
|
38
|
+
case 'info':
|
|
39
|
+
case 'progress':
|
|
40
|
+
return event.message;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** One answer row, or a thrown error when the surface returned nothing usable. */
|
|
44
|
+
function singleAnswer(answer) {
|
|
45
|
+
const row = answer.answers[0];
|
|
46
|
+
if (row === undefined)
|
|
47
|
+
throw new Error('dsh-auth: the question surface returned no answer');
|
|
48
|
+
return { selected: row.selected[0], custom: row.custom };
|
|
49
|
+
}
|
|
50
|
+
function authUrlView(url, instructions, opened, notice) {
|
|
51
|
+
const lead = opened
|
|
52
|
+
? `${t('oauth-auth-url-opened')}\n${t('oauth-auth-url-opened-fallback')}`
|
|
53
|
+
: `${t('oauth-auth-url-manual')}\n${t('oauth-auth-url-copy-hint')}`;
|
|
54
|
+
const body = [notice, lead, instructions, url].filter(part => part !== undefined && part !== '').join('\n');
|
|
55
|
+
return {
|
|
56
|
+
kind: 'auth_url', body, copyLabel: t('oauth-copy-link'), copyText: url,
|
|
57
|
+
reopenLabel: t('oauth-open-again'), cancelLabel: t('oauth-cancel'), reopenUrl: url,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function deviceCodeView(userCode, verificationUri, opened) {
|
|
61
|
+
const lead = opened
|
|
62
|
+
? t('oauth-device-opened', { uri: verificationUri })
|
|
63
|
+
: t('oauth-device-manual', { uri: verificationUri });
|
|
64
|
+
return {
|
|
65
|
+
kind: 'device_code', body: `${lead}\n ${userCode}`,
|
|
66
|
+
copyLabel: t('oauth-copy-code'), copyText: userCode,
|
|
67
|
+
reopenLabel: t('oauth-open-again'), cancelLabel: t('oauth-cancel'), reopenUrl: verificationUri,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The bridge for one login run. At most one waiting panel exists at a time;
|
|
72
|
+
* `settle()` retires it when the flow ends (any outcome), so a completed or
|
|
73
|
+
* failed login never leaves an interactive dead end on screen.
|
|
74
|
+
*/
|
|
75
|
+
export class QuestionBridge {
|
|
76
|
+
ask;
|
|
77
|
+
runAbort;
|
|
78
|
+
signal;
|
|
79
|
+
openUrl;
|
|
80
|
+
copy;
|
|
81
|
+
waiting;
|
|
82
|
+
pendingBrowserView;
|
|
83
|
+
notice;
|
|
84
|
+
waitingClosed = false;
|
|
85
|
+
constructor(ask, runAbort, helpers = {}) {
|
|
86
|
+
this.ask = ask;
|
|
87
|
+
this.runAbort = runAbort;
|
|
88
|
+
this.signal = runAbort.signal;
|
|
89
|
+
this.openUrl = helpers.openUrl ?? openInBrowser;
|
|
90
|
+
this.copy = helpers.copyText ?? copyToClipboard;
|
|
91
|
+
}
|
|
92
|
+
async prompt(prompt) {
|
|
93
|
+
if (this.waitingClosed)
|
|
94
|
+
throw new Error('Login cancelled');
|
|
95
|
+
const browserView = prompt.type === 'manual_code' ? this.pendingBrowserView : undefined;
|
|
96
|
+
if (browserView !== undefined) {
|
|
97
|
+
this.pendingBrowserView = undefined;
|
|
98
|
+
await this.retireWaiting();
|
|
99
|
+
}
|
|
100
|
+
// pi-ai's callback race supplies a per-prompt abort signal. It must not
|
|
101
|
+
// replace the login-wide signal: cancelling either one closes the ask.
|
|
102
|
+
const signal = prompt.signal === undefined ? this.signal : AbortSignal.any([prompt.signal, this.signal]);
|
|
103
|
+
const secretNote = prompt.type === 'secret' ? t('oauth-secret-unmasked') : '';
|
|
104
|
+
let actionNote;
|
|
105
|
+
while (true) {
|
|
106
|
+
if (this.waitingClosed)
|
|
107
|
+
throw new Error('Login cancelled');
|
|
108
|
+
signal.throwIfAborted();
|
|
109
|
+
const question = prompt.type === 'select'
|
|
110
|
+
? {
|
|
111
|
+
id: 'dsh-auth-prompt',
|
|
112
|
+
header: 'dsh-auth',
|
|
113
|
+
question: prompt.message,
|
|
114
|
+
options: prompt.options.map(option => ({
|
|
115
|
+
label: option.label,
|
|
116
|
+
...(option.description === undefined ? {} : { description: option.description }),
|
|
117
|
+
})),
|
|
118
|
+
}
|
|
119
|
+
: {
|
|
120
|
+
id: 'dsh-auth-prompt',
|
|
121
|
+
header: 'dsh-auth',
|
|
122
|
+
question: prompt.message,
|
|
123
|
+
...(browserView === undefined
|
|
124
|
+
? (prompt.placeholder === undefined
|
|
125
|
+
? (secretNote === '' ? {} : { detail: secretNote })
|
|
126
|
+
: { detail: [prompt.placeholder, secretNote].filter(part => part !== '').join('\n') })
|
|
127
|
+
: {
|
|
128
|
+
detail: [actionNote, browserView.body].filter(part => part !== undefined).join('\n'),
|
|
129
|
+
options: [
|
|
130
|
+
{ label: browserView.copyLabel },
|
|
131
|
+
{ label: browserView.reopenLabel },
|
|
132
|
+
{ label: browserView.cancelLabel },
|
|
133
|
+
],
|
|
134
|
+
}),
|
|
135
|
+
};
|
|
136
|
+
let answer;
|
|
137
|
+
try {
|
|
138
|
+
answer = singleAnswer(await this.ask({ questions: [question], signal }));
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
if (typeof error === 'object' && error !== null
|
|
142
|
+
&& error.code === 'ASK_CANCELLED') {
|
|
143
|
+
this.runAbort.abort('user cancelled sign-in');
|
|
144
|
+
}
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
signal.throwIfAborted();
|
|
148
|
+
if (prompt.type === 'select') {
|
|
149
|
+
const label = answer.selected;
|
|
150
|
+
const option = label === undefined ? undefined : prompt.options.find(candidate => candidate.label === label);
|
|
151
|
+
if (option === undefined) {
|
|
152
|
+
if (answer.custom !== undefined && answer.custom !== '')
|
|
153
|
+
return answer.custom;
|
|
154
|
+
throw new Error('dsh-auth: the selection answer did not match an offered option');
|
|
155
|
+
}
|
|
156
|
+
return option.id;
|
|
157
|
+
}
|
|
158
|
+
// The TUI may attach the focused option label while typing on it;
|
|
159
|
+
// entered callback text takes precedence over a copy/reopen action.
|
|
160
|
+
const custom = answer.custom?.trim();
|
|
161
|
+
if (custom !== undefined && custom !== '')
|
|
162
|
+
return custom;
|
|
163
|
+
if (browserView === undefined)
|
|
164
|
+
throw new Error('dsh-auth: the text answer was empty');
|
|
165
|
+
if (answer.selected === browserView.copyLabel) {
|
|
166
|
+
const copied = await this.copy(browserView.copyText).catch(() => false);
|
|
167
|
+
actionNote = t(copied ? 'oauth-copied' : 'oauth-copy-failed');
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
if (answer.selected === browserView.reopenLabel) {
|
|
171
|
+
const opened = this.openUrl(browserView.reopenUrl);
|
|
172
|
+
actionNote = t(opened ? 'oauth-reopened' : 'oauth-open-failed');
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (answer.selected === browserView.cancelLabel) {
|
|
176
|
+
this.runAbort.abort('user cancelled sign-in');
|
|
177
|
+
throw new Error('Login cancelled');
|
|
178
|
+
}
|
|
179
|
+
throw new Error('dsh-auth: the authorization question returned no action or code');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
notify(event) {
|
|
183
|
+
if (this.waitingClosed || this.signal.aborted)
|
|
184
|
+
return;
|
|
185
|
+
if (event.type === 'info') {
|
|
186
|
+
this.notice = event.message;
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (event.type === 'auth_url') {
|
|
190
|
+
if (this.pendingBrowserView !== undefined)
|
|
191
|
+
return;
|
|
192
|
+
const opened = this.openUrl(event.url);
|
|
193
|
+
const view = authUrlView(event.url, event.instructions, opened, this.notice);
|
|
194
|
+
this.notice = undefined;
|
|
195
|
+
this.pendingBrowserView = view;
|
|
196
|
+
// Current pi-ai browser flows call manual_code synchronously after
|
|
197
|
+
// notify. Defer the fallback panel one microtask so that prompt can
|
|
198
|
+
// consume this view without placing a second ask in the FIFO queue.
|
|
199
|
+
queueMicrotask(() => {
|
|
200
|
+
if (this.pendingBrowserView === view && !this.waitingClosed) {
|
|
201
|
+
void this.runWaitingPanel(view).catch(() => this.runAbort.abort('authorization panel failed'));
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (event.type === 'device_code') {
|
|
207
|
+
if (this.waiting !== undefined)
|
|
208
|
+
return;
|
|
209
|
+
const opened = this.openUrl(event.verificationUri);
|
|
210
|
+
void this.runWaitingPanel(deviceCodeView(event.userCode, event.verificationUri, opened))
|
|
211
|
+
.catch(() => this.runAbort.abort('authorization panel failed'));
|
|
212
|
+
}
|
|
213
|
+
// Progress lines are transient; the flow's next prompt or waiting panel
|
|
214
|
+
// carries the actionable state.
|
|
215
|
+
}
|
|
216
|
+
/** Close the waiting panel (if any) and stop answering for this run. */
|
|
217
|
+
async settle() {
|
|
218
|
+
this.waitingClosed = true;
|
|
219
|
+
this.pendingBrowserView = undefined;
|
|
220
|
+
await this.retireWaiting();
|
|
221
|
+
this.waiting = undefined;
|
|
222
|
+
}
|
|
223
|
+
async retireWaiting() {
|
|
224
|
+
const waiting = this.waiting;
|
|
225
|
+
waiting?.controller.abort();
|
|
226
|
+
await waiting?.answer;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Show the waiting panel until the flow settles or the user cancels,
|
|
230
|
+
* re-asking after a copy/reopen action with a one-line status prefix.
|
|
231
|
+
*/
|
|
232
|
+
async runWaitingPanel(view) {
|
|
233
|
+
let body = view.body;
|
|
234
|
+
const active = () => !this.waitingClosed && !this.signal.aborted
|
|
235
|
+
&& (view.kind === 'device_code' || this.pendingBrowserView === view);
|
|
236
|
+
while (active()) {
|
|
237
|
+
const controller = new AbortController();
|
|
238
|
+
const answer = this.ask({
|
|
239
|
+
questions: [{
|
|
240
|
+
id: 'dsh-auth-waiting',
|
|
241
|
+
header: 'dsh-auth',
|
|
242
|
+
question: t('oauth-waiting'),
|
|
243
|
+
detail: body,
|
|
244
|
+
options: [
|
|
245
|
+
{ label: view.copyLabel },
|
|
246
|
+
{ label: view.reopenLabel },
|
|
247
|
+
{ label: view.cancelLabel },
|
|
248
|
+
],
|
|
249
|
+
}],
|
|
250
|
+
signal: AbortSignal.any([controller.signal, this.signal]),
|
|
251
|
+
})
|
|
252
|
+
.then(singleAnswer)
|
|
253
|
+
.catch(() => {
|
|
254
|
+
if (!controller.signal.aborted && active())
|
|
255
|
+
this.runAbort.abort('authorization panel was dismissed');
|
|
256
|
+
return undefined;
|
|
257
|
+
});
|
|
258
|
+
this.waiting = { controller, answer };
|
|
259
|
+
const response = await answer;
|
|
260
|
+
if (this.waiting?.controller === controller)
|
|
261
|
+
this.waiting = undefined;
|
|
262
|
+
if (response === undefined || !active())
|
|
263
|
+
return;
|
|
264
|
+
if (response.selected === undefined) {
|
|
265
|
+
body = `${t('oauth-choose-action')}\n${view.body}`;
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
if (response.selected === view.cancelLabel) {
|
|
269
|
+
this.runAbort.abort('user cancelled sign-in');
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (response.selected === view.copyLabel) {
|
|
273
|
+
const copied = await this.copy(view.copyText).catch(() => false);
|
|
274
|
+
body = `${t(copied ? 'oauth-copied' : 'oauth-copy-failed')}\n${view.body}`;
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
if (response.selected === view.reopenLabel) {
|
|
278
|
+
const opened = this.openUrl(view.reopenUrl);
|
|
279
|
+
body = `${t(opened ? 'oauth-reopened' : 'oauth-open-failed')}\n${view.body}`;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/opener.d.ts
RENAMED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Every path is best-effort and never throws: a missing opener or clipboard
|
|
12
12
|
* degrades to the URL staying on screen with a copy action.
|
|
13
13
|
*
|
|
14
|
-
* @module dsh-
|
|
14
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth/opener
|
|
15
15
|
*/
|
|
16
16
|
/** The browser-opening command for this platform, or undefined when unknown. */
|
|
17
17
|
export declare function openerFor(url: string): {
|
|
@@ -30,3 +30,4 @@ export declare function openInBrowser(url: string): boolean;
|
|
|
30
30
|
* order. Resolves whether one succeeded; never rejects.
|
|
31
31
|
*/
|
|
32
32
|
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
33
|
+
//# sourceMappingURL=opener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opener.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/oauth/opener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAkBlH;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAgBlD;AA8BD;;;GAGG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAKpE"}
|
package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/opener.js
RENAMED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Every path is best-effort and never throws: a missing opener or clipboard
|
|
12
12
|
* degrades to the URL staying on screen with a copy action.
|
|
13
13
|
*
|
|
14
|
-
* @module dsh-
|
|
14
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth/opener
|
|
15
15
|
*/
|
|
16
16
|
import { spawn } from 'node:child_process';
|
|
17
17
|
/** The browser-opening command for this platform, or undefined when unknown. */
|
package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/pi-ai.d.ts
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The pi-ai instance owned by the installed dsh-llm-pi-ai adapter.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Different host prereleases can depend on different pi-ai versions. Loading
|
|
5
|
+
* a second catalog in this module and handing its Provider objects to the
|
|
6
|
+
* adapter crosses package instances and is neither type- nor runtime-safe.
|
|
7
7
|
* Resolve the adapter's own dependency instead, and derive every public type
|
|
8
8
|
* from the adapter contract so this package owns no pi-ai version.
|
|
9
9
|
*/
|
|
@@ -18,6 +18,13 @@ type PiAiOAuth = NonNullable<PiAiProvider['auth']['oauth']>;
|
|
|
18
18
|
export type PiAiAuthInteraction = Parameters<PiAiOAuth['login']>[0];
|
|
19
19
|
export type PiAiAuthPrompt = Parameters<PiAiAuthInteraction['prompt']>[0];
|
|
20
20
|
export type PiAiAuthEvent = Parameters<PiAiAuthInteraction['notify']>[0];
|
|
21
|
+
/** pi-ai 0.87.1 added this optional login context; older flows ignore it. */
|
|
22
|
+
export interface PiAiLoginOptions {
|
|
23
|
+
getDeviceId?: () => string;
|
|
24
|
+
}
|
|
25
|
+
/** Keep the optional second argument compatible with older adapter typings. */
|
|
26
|
+
export declare function loginOAuth(oauth: PiAiOAuth, interaction: PiAiAuthInteraction, options: PiAiLoginOptions): ReturnType<PiAiOAuth['login']>;
|
|
21
27
|
/** Fresh Provider objects from the exact pi-ai module used by dsh-llm-pi-ai. */
|
|
22
28
|
export declare const adapterBuiltinProviders: () => readonly PiAiProvider[];
|
|
23
29
|
export {};
|
|
30
|
+
//# sourceMappingURL=pi-ai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pi-ai.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/oauth/pi-ai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAMjG,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,2BAA2B,CAAC,YAAY,CAAC,CAAC,CAAA;AAEjF,KAAK,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAA;AAC1C,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;AACrD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAA;AACzD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AAC1F,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzF,KAAK,SAAS,GAAG,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;AAC3D,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACnE,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACzE,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAExE,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,MAAM,CAAA;CAC3B;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CACxB,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,mBAAmB,EAChC,OAAO,EAAE,gBAAgB,GACxB,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAKhC;AAmBD,gFAAgF;AAChF,eAAO,MAAM,uBAAuB,QAjBd,SAAS,YAAY,EAiBoB,CAAA"}
|
package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/pi-ai.js
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The pi-ai instance owned by the installed dsh-llm-pi-ai adapter.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Different host prereleases can depend on different pi-ai versions. Loading
|
|
5
|
+
* a second catalog in this module and handing its Provider objects to the
|
|
6
|
+
* adapter crosses package instances and is neither type- nor runtime-safe.
|
|
7
7
|
* Resolve the adapter's own dependency instead, and derive every public type
|
|
8
8
|
* from the adapter contract so this package owns no pi-ai version.
|
|
9
9
|
*/
|
|
@@ -11,6 +11,11 @@ import { existsSync } from 'node:fs';
|
|
|
11
11
|
import { createRequire } from 'node:module';
|
|
12
12
|
import { join } from 'node:path';
|
|
13
13
|
import { pathToFileURL } from 'node:url';
|
|
14
|
+
/** Keep the optional second argument compatible with older adapter typings. */
|
|
15
|
+
export function loginOAuth(oauth, interaction, options) {
|
|
16
|
+
const compatible = oauth;
|
|
17
|
+
return compatible.login(interaction, options);
|
|
18
|
+
}
|
|
14
19
|
/** Locate the first pi-ai catalog Node would resolve from dsh-llm-pi-ai. */
|
|
15
20
|
function adapterCatalogUrl() {
|
|
16
21
|
const adapterManifest = import.meta.resolve('@deepseek-ai/dsh-llm-pi-ai/package.json');
|
|
@@ -11,14 +11,16 @@
|
|
|
11
11
|
* (llm-pi-ai's own `DEFAULT_*` constants are not exported; the values below
|
|
12
12
|
* are those constants, and the comment on each says so).
|
|
13
13
|
*
|
|
14
|
-
* @module dsh-
|
|
14
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth/profiles
|
|
15
15
|
*/
|
|
16
16
|
import type { ResolvedPiAiProviderProfile } from '@deepseek-ai/dsh-llm-pi-ai';
|
|
17
17
|
import { type PiAiProvider } from './pi-ai.js';
|
|
18
|
-
/**
|
|
19
|
-
export declare const OAUTH_PROVIDER_IDS: readonly ["openai-codex", "anthropic", "xai"];
|
|
18
|
+
/** Subscription routes this build can mount, in picker order. */
|
|
19
|
+
export declare const OAUTH_PROVIDER_IDS: readonly ["openai", "openai-codex", "anthropic", "xai", "meta"];
|
|
20
20
|
/** One routable provider id. */
|
|
21
21
|
export type OAuthProviderId = (typeof OAUTH_PROVIDER_IDS)[number];
|
|
22
|
+
/** Mount only flows actually shipped by the adapter's pi-ai instance. */
|
|
23
|
+
export declare function availableOAuthProviderIds(): OAuthProviderId[];
|
|
22
24
|
/**
|
|
23
25
|
* One per-model catalog override a deployment may name, keyed by model id.
|
|
24
26
|
* Every field is optional; an absent field keeps the installed catalog's
|
|
@@ -43,3 +45,4 @@ export declare function oauthOf(route: PiAiProvider): NonNullable<PiAiProvider['
|
|
|
43
45
|
* {@link ModelOverride}); `undefined` serves the installed catalog unchanged.
|
|
44
46
|
*/
|
|
45
47
|
export declare function buildOAuthProfile(id: string, modelOverrides?: Readonly<Record<string, ModelOverride>>): ResolvedPiAiProviderProfile;
|
|
48
|
+
//# sourceMappingURL=profiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/oauth/profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAEvE,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,iEAAkE,CAAA;AAEjG,gCAAgC;AAChC,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjE,yEAAyE;AACzE,wBAAgB,yBAAyB,IAAI,eAAe,EAAE,CAG7D;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAuBD,oFAAoF;AACpF,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAMvF;AAmCD;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,MAAM,EACV,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,GACvD,2BAA2B,CAuB7B"}
|
package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/profiles.js
RENAMED
|
@@ -11,12 +11,17 @@
|
|
|
11
11
|
* (llm-pi-ai's own `DEFAULT_*` constants are not exported; the values below
|
|
12
12
|
* are those constants, and the comment on each says so).
|
|
13
13
|
*
|
|
14
|
-
* @module dsh-
|
|
14
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth/profiles
|
|
15
15
|
*/
|
|
16
16
|
import { resolveRetryPolicy } from '@deepseek-ai/dsh-llm';
|
|
17
17
|
import { adapterBuiltinProviders } from './pi-ai.js';
|
|
18
|
-
/**
|
|
19
|
-
export const OAUTH_PROVIDER_IDS = ['openai-codex', 'anthropic', 'xai'];
|
|
18
|
+
/** Subscription routes this build can mount, in picker order. */
|
|
19
|
+
export const OAUTH_PROVIDER_IDS = ['openai', 'openai-codex', 'anthropic', 'xai', 'meta'];
|
|
20
|
+
/** Mount only flows actually shipped by the adapter's pi-ai instance. */
|
|
21
|
+
export function availableOAuthProviderIds() {
|
|
22
|
+
const catalog = new Map(adapterBuiltinProviders().map(provider => [provider.id, provider]));
|
|
23
|
+
return OAUTH_PROVIDER_IDS.filter(id => catalog.get(id)?.auth.oauth !== undefined);
|
|
24
|
+
}
|
|
20
25
|
/** llm-pi-ai `DEFAULT_MAX_REQUEST_IMAGE_BYTES` (20 MiB, base64 payload bound). */
|
|
21
26
|
const MAX_REQUEST_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
22
27
|
/** llm-pi-ai `DEFAULT_REQUEST_IMAGE_PIXEL_BUDGET` (2048×2048 pixels). */
|
|
@@ -86,6 +91,9 @@ export function buildOAuthProfile(id, modelOverrides) {
|
|
|
86
91
|
throw new Error(`dsh-auth: "${id}" is not an OAuth provider this build mounts (${OAUTH_PROVIDER_IDS.join(', ')})`);
|
|
87
92
|
}
|
|
88
93
|
const catalog = withModelOverrides(catalogProviderOf(id), modelOverrides);
|
|
94
|
+
// An older pi-ai catalog can know the route but not its newer OAuth flow
|
|
95
|
+
// (notably `openai`). Explicit requests must fail at boot, not at /auth.
|
|
96
|
+
oauthOf(catalog);
|
|
89
97
|
return {
|
|
90
98
|
provider: id,
|
|
91
99
|
displayName: catalog.name,
|