@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
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* one JSON document, one credential per provider id.
|
|
4
4
|
*
|
|
5
5
|
* Writes are atomic (temp file + rename) with 0700 directory / 0600 file
|
|
6
|
-
* permissions best-effort on every platform.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* permissions best-effort on every platform. Mutations share an in-process
|
|
7
|
+
* queue and a cross-process file lock; pi-ai runs its OAuth refresh *inside*
|
|
8
|
+
* {@link CredentialFile.modify}, so the exclusion also keeps concurrent
|
|
9
|
+
* requests from double-refreshing a rotated token. The file is the single
|
|
10
|
+
* source of truth;
|
|
11
11
|
* nothing here ever logs token material, and {@link CredentialFile.describe}
|
|
12
12
|
* reports only non-secret metadata for status surfaces.
|
|
13
13
|
*
|
|
14
|
-
* @module dsh-
|
|
14
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth/credentials
|
|
15
15
|
*/
|
|
16
16
|
import type { PiAiCredential, PiAiCredentialInfo, PiAiCredentialStore } from './pi-ai.js';
|
|
17
17
|
/** The stored credential shape: a pi-ai `OAuthCredential`. */
|
|
@@ -30,10 +30,12 @@ export declare function defaultCredentialsFile(): string;
|
|
|
30
30
|
*/
|
|
31
31
|
export declare class CredentialFile implements PiAiCredentialStore {
|
|
32
32
|
readonly path: string;
|
|
33
|
-
/**
|
|
34
|
-
private
|
|
35
|
-
private
|
|
33
|
+
/** One document needs one read-modify-write queue, regardless of provider. */
|
|
34
|
+
private pending;
|
|
35
|
+
private deviceId;
|
|
36
36
|
constructor(path: string);
|
|
37
|
+
/** Stable per-store UUID for pi-ai's OpenAI ChatGPT agent-host identity. */
|
|
38
|
+
getOrCreateDeviceId(): string;
|
|
37
39
|
/** The stored credential for one provider, possibly expired. */
|
|
38
40
|
read(providerId: string): Promise<PiAiCredential | undefined>;
|
|
39
41
|
/** Stored credential metadata without resolving or exposing secrets. */
|
|
@@ -53,8 +55,9 @@ export declare class CredentialFile implements PiAiCredentialStore {
|
|
|
53
55
|
expiresAt: number;
|
|
54
56
|
expired: boolean;
|
|
55
57
|
}[]>;
|
|
56
|
-
/**
|
|
58
|
+
/** Keep the entire read-modify-rename cycle exclusive across processes. */
|
|
57
59
|
private chain;
|
|
58
60
|
private load;
|
|
59
61
|
private save;
|
|
60
62
|
}
|
|
63
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/oauth/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEzF,8DAA8D;AAC9D,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAA;AAQ9E,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,GAAG,SAAS,CAOpF;AAED,+FAA+F;AAC/F,wBAAgB,sBAAsB,IAAI,MAAM,CAK/C;AAKD;;;;;GAKG;AACH,qBAAa,cAAe,YAAW,mBAAmB;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,8EAA8E;IAC9E,OAAO,CAAC,OAAO,CAAmC;IAClD,OAAO,CAAC,QAAQ,CAAoB;gBAExB,IAAI,EAAE,MAAM;IAIxB,4EAA4E;IAC5E,mBAAmB,IAAI,MAAM;IAiC7B,gEAAgE;IAC1D,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAInE,wEAAwE;IAClE,IAAI,IAAI,OAAO,CAAC,SAAS,kBAAkB,EAAE,CAAC;IAQpD;;;;;OAKG;IACG,MAAM,CACV,UAAU,EAAE,MAAM,EAClB,EAAE,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,SAAS,KAAK,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,GAC/E,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IActC,iDAAiD;IAC3C,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU/C,4EAA4E;IACtE,QAAQ,IAAI,OAAO,CAAC,SAAS;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAY/F,2EAA2E;IAC3E,OAAO,CAAC,KAAK;YAUC,IAAI;YAuCJ,IAAI;CAWnB"}
|
|
@@ -3,19 +3,21 @@
|
|
|
3
3
|
* one JSON document, one credential per provider id.
|
|
4
4
|
*
|
|
5
5
|
* Writes are atomic (temp file + rename) with 0700 directory / 0600 file
|
|
6
|
-
* permissions best-effort on every platform.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* permissions best-effort on every platform. Mutations share an in-process
|
|
7
|
+
* queue and a cross-process file lock; pi-ai runs its OAuth refresh *inside*
|
|
8
|
+
* {@link CredentialFile.modify}, so the exclusion also keeps concurrent
|
|
9
|
+
* requests from double-refreshing a rotated token. The file is the single
|
|
10
|
+
* source of truth;
|
|
11
11
|
* nothing here ever logs token material, and {@link CredentialFile.describe}
|
|
12
12
|
* reports only non-secret metadata for status surfaces.
|
|
13
13
|
*
|
|
14
|
-
* @module dsh-
|
|
14
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth/credentials
|
|
15
15
|
*/
|
|
16
|
+
import { randomUUID } from 'node:crypto';
|
|
16
17
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
17
18
|
import { dirname, join } from 'node:path';
|
|
18
19
|
import { homedir } from 'node:os';
|
|
20
|
+
import { withFileLock } from '@deepseek-ai/dsh-atomic-write';
|
|
19
21
|
/** Narrow an unknown parsed value into a stored credential, or reject it. */
|
|
20
22
|
export function asStoredCredential(value) {
|
|
21
23
|
if (typeof value !== 'object' || value === null)
|
|
@@ -38,6 +40,7 @@ export function defaultCredentialsFile() {
|
|
|
38
40
|
return join(root, 'dsh-auth', 'credentials.json');
|
|
39
41
|
}
|
|
40
42
|
const EMPTY_DOCUMENT = { version: 1, providers: {} };
|
|
43
|
+
const DEVICE_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iu;
|
|
41
44
|
/**
|
|
42
45
|
* The credential file. IO failures throw (loud, naming the path) rather than
|
|
43
46
|
* degrading to an empty store: silently treating a corrupt or unreadable
|
|
@@ -46,12 +49,49 @@ const EMPTY_DOCUMENT = { version: 1, providers: {} };
|
|
|
46
49
|
*/
|
|
47
50
|
export class CredentialFile {
|
|
48
51
|
path;
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
/** One document needs one read-modify-write queue, regardless of provider. */
|
|
53
|
+
pending = Promise.resolve();
|
|
54
|
+
deviceId;
|
|
52
55
|
constructor(path) {
|
|
53
56
|
this.path = path;
|
|
54
57
|
}
|
|
58
|
+
/** Stable per-store UUID for pi-ai's OpenAI ChatGPT agent-host identity. */
|
|
59
|
+
getOrCreateDeviceId() {
|
|
60
|
+
if (this.deviceId !== undefined)
|
|
61
|
+
return this.deviceId;
|
|
62
|
+
const path = join(dirname(this.path), 'device-id');
|
|
63
|
+
let value;
|
|
64
|
+
try {
|
|
65
|
+
value = readFileSync(path, 'utf8');
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (error?.code !== 'ENOENT') {
|
|
69
|
+
throw new Error(`dsh-auth: cannot read device ID file ${path}: ${String(error)}`);
|
|
70
|
+
}
|
|
71
|
+
mkdirSync(dirname(path), { recursive: true, mode: 0o700 });
|
|
72
|
+
try {
|
|
73
|
+
writeFileSync(path, `${randomUUID()}\n`, { flag: 'wx', mode: 0o600 });
|
|
74
|
+
}
|
|
75
|
+
catch (writeError) {
|
|
76
|
+
// A second process may have created the same installation ID first.
|
|
77
|
+
if (writeError?.code !== 'EEXIST') {
|
|
78
|
+
throw new Error(`dsh-auth: cannot write device ID file ${path}: ${String(writeError)}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
value = readFileSync(path, 'utf8');
|
|
83
|
+
}
|
|
84
|
+
catch (readError) {
|
|
85
|
+
throw new Error(`dsh-auth: cannot read device ID file ${path}: ${String(readError)}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const id = value.trim();
|
|
89
|
+
if (!DEVICE_ID_PATTERN.test(id)) {
|
|
90
|
+
throw new Error(`dsh-auth: device ID file ${path} is not a UUID; fix or remove it by hand`);
|
|
91
|
+
}
|
|
92
|
+
this.deviceId = id;
|
|
93
|
+
return id;
|
|
94
|
+
}
|
|
55
95
|
/** The stored credential for one provider, possibly expired. */
|
|
56
96
|
async read(providerId) {
|
|
57
97
|
return (await this.load()).providers[providerId];
|
|
@@ -71,7 +111,7 @@ export class CredentialFile {
|
|
|
71
111
|
* credential. Rejections from `fn` propagate without touching the file.
|
|
72
112
|
*/
|
|
73
113
|
async modify(providerId, fn) {
|
|
74
|
-
return this.chain(
|
|
114
|
+
return this.chain(async () => {
|
|
75
115
|
const document = await this.load();
|
|
76
116
|
const current = document.providers[providerId];
|
|
77
117
|
const replacement = await fn(current);
|
|
@@ -86,7 +126,7 @@ export class CredentialFile {
|
|
|
86
126
|
}
|
|
87
127
|
/** Remove one provider's credential (logout). */
|
|
88
128
|
async delete(providerId) {
|
|
89
|
-
await this.chain(
|
|
129
|
+
await this.chain(async () => {
|
|
90
130
|
const document = await this.load();
|
|
91
131
|
if (!(providerId in document.providers))
|
|
92
132
|
return;
|
|
@@ -107,23 +147,24 @@ export class CredentialFile {
|
|
|
107
147
|
expired: credential.expires <= now,
|
|
108
148
|
}));
|
|
109
149
|
}
|
|
110
|
-
/**
|
|
111
|
-
chain(
|
|
112
|
-
const run =
|
|
113
|
-
|
|
150
|
+
/** Keep the entire read-modify-rename cycle exclusive across processes. */
|
|
151
|
+
chain(operation) {
|
|
152
|
+
const run = this.pending.then(() => {
|
|
153
|
+
mkdirSync(dirname(this.path), { recursive: true, mode: 0o700 });
|
|
154
|
+
// pi-ai may refresh a token over the network while holding this lock.
|
|
155
|
+
return withFileLock(this.path, operation, { waitMs: 120_000 });
|
|
156
|
+
});
|
|
157
|
+
this.pending = run.then(() => undefined, () => undefined);
|
|
114
158
|
return run;
|
|
115
159
|
}
|
|
116
160
|
async load() {
|
|
117
|
-
if (this.cache !== undefined)
|
|
118
|
-
return this.cache;
|
|
119
161
|
let text;
|
|
120
162
|
try {
|
|
121
163
|
text = readFileSync(this.path, 'utf8');
|
|
122
164
|
}
|
|
123
165
|
catch (error) {
|
|
124
166
|
if (error?.code === 'ENOENT') {
|
|
125
|
-
|
|
126
|
-
return this.cache;
|
|
167
|
+
return EMPTY_DOCUMENT;
|
|
127
168
|
}
|
|
128
169
|
throw new Error(`dsh-auth: cannot read credential file ${this.path}: ${String(error)}`);
|
|
129
170
|
}
|
|
@@ -150,13 +191,11 @@ export class CredentialFile {
|
|
|
150
191
|
}
|
|
151
192
|
providers[provider] = credential;
|
|
152
193
|
}
|
|
153
|
-
|
|
154
|
-
return this.cache;
|
|
194
|
+
return { version: 1, providers };
|
|
155
195
|
}
|
|
156
196
|
async save(document) {
|
|
157
197
|
const text = JSON.stringify(document, null, 2) + '\n';
|
|
158
198
|
const directory = dirname(this.path);
|
|
159
|
-
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
160
199
|
const temporary = join(directory, `.${Math.random().toString(36).slice(2)}.tmp`);
|
|
161
200
|
try {
|
|
162
201
|
writeFileSync(temporary, text, { mode: 0o600 });
|
|
@@ -165,6 +204,5 @@ export class CredentialFile {
|
|
|
165
204
|
catch (error) {
|
|
166
205
|
throw new Error(`dsh-auth: cannot write credential file ${this.path}: ${String(error)}`);
|
|
167
206
|
}
|
|
168
|
-
this.cache = document;
|
|
169
207
|
}
|
|
170
208
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI interaction for the Host-owned DeepSeek account authorization flow.
|
|
3
|
+
*
|
|
4
|
+
* The Host owns PKCE, its callback route, credential persistence, and the
|
|
5
|
+
* `deepseek-account` LLM route. This module supplies a loopback callback
|
|
6
|
+
* origin, mounts the official Host listener when an older bundle patch omits
|
|
7
|
+
* it, and displays the Host's safe attempt state through the existing question
|
|
8
|
+
* panel. It never reads or writes the account grant.
|
|
9
|
+
*/
|
|
10
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
11
|
+
import type { AccountClientMetadata, DeepSeekAccount } from '@deepseek-ai/dsh-deepseek-account';
|
|
12
|
+
import { type AskFn, type QuestionBridgeHelpers } from './interaction.js';
|
|
13
|
+
export declare const DEEPSEEK_ACCOUNT_PROVIDER = "deepseek-account";
|
|
14
|
+
/** Only the account operations this interaction surface consumes. */
|
|
15
|
+
export type DeepSeekAccountAuth = Pick<DeepSeekAccount, 'getState' | 'startSignIn' | 'cancelSignIn' | 'signOut' | 'watch'> & Partial<Pick<DeepSeekAccount, 'getUnnotifiedBonuses' | 'ackBonusNotified'>>;
|
|
16
|
+
/** Resolve late: the account provider is absent on older DSH hosts. */
|
|
17
|
+
export declare function deepSeekAccountFrom(ctx: Context): DeepSeekAccountAuth | undefined;
|
|
18
|
+
/** The Host webServer may be shared, supplied by the TUI row, or mounted as a fallback. */
|
|
19
|
+
export declare function deepSeekCallbackOrigin(ctx: Context): string;
|
|
20
|
+
/**
|
|
21
|
+
* Keep DeepSeek login usable after a profile-only update from a global TUI
|
|
22
|
+
* whose older bundle patch still mounts `dsh-tui-auth` but has no webserver
|
|
23
|
+
* row. The official Host listener is mounted only on the first login that
|
|
24
|
+
* needs it; an existing Web or user-owned listener is never replaced.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createDeepSeekCallbackOriginResolver(ctx: Context): {
|
|
27
|
+
resolve(): Promise<string>;
|
|
28
|
+
dispose(): Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
/** Platform request identity is supplied by the current TUI, not cached by the Host. */
|
|
31
|
+
export declare function deepSeekClientMetadata(): AccountClientMetadata;
|
|
32
|
+
/**
|
|
33
|
+
* Start (or join) the upstream browser attempt, display its URL, and wait for
|
|
34
|
+
* the upstream state stream. Esc/external abort cancels the exact attempt;
|
|
35
|
+
* a commit that won that race is reported as success instead of a false
|
|
36
|
+
* cancellation. The question panel is always retired before returning.
|
|
37
|
+
*/
|
|
38
|
+
export declare function loginDeepSeekAccount(account: DeepSeekAccountAuth, callbackOrigin: string, ask: AskFn, signal?: AbortSignal, helpers?: QuestionBridgeHelpers): Promise<void>;
|
|
39
|
+
//# sourceMappingURL=deepseek.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deepseek.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/oauth/deepseek.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAe,eAAe,EAAmB,MAAM,mCAAmC,CAAA;AAG7H,OAAO,EAAkB,KAAK,KAAK,EAAE,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAEzF,eAAO,MAAM,yBAAyB,qBAAqB,CAAA;AAE3D,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,GAAG,aAAa,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAAC,GACtH,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,sBAAsB,GAAG,kBAAkB,CAAC,CAAC,CAAA;AAE/E,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,GAAG,SAAS,CAEjF;AAED,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAO3D;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAAC,GAAG,EAAE,OAAO,GAAG;IAClE,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IAC1B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACzB,CA0DA;AAWD,wFAAwF;AACxF,wBAAgB,sBAAsB,IAAI,qBAAqB,CAM9D;AAMD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,mBAAmB,EAC5B,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,KAAK,EACV,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CAyDf"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI interaction for the Host-owned DeepSeek account authorization flow.
|
|
3
|
+
*
|
|
4
|
+
* The Host owns PKCE, its callback route, credential persistence, and the
|
|
5
|
+
* `deepseek-account` LLM route. This module supplies a loopback callback
|
|
6
|
+
* origin, mounts the official Host listener when an older bundle patch omits
|
|
7
|
+
* it, and displays the Host's safe attempt state through the existing question
|
|
8
|
+
* panel. It never reads or writes the account grant.
|
|
9
|
+
*/
|
|
10
|
+
import { readFileSync } from 'node:fs';
|
|
11
|
+
import { getLang } from '../../i18n.js';
|
|
12
|
+
import { QuestionBridge } from './interaction.js';
|
|
13
|
+
export const DEEPSEEK_ACCOUNT_PROVIDER = 'deepseek-account';
|
|
14
|
+
/** Resolve late: the account provider is absent on older DSH hosts. */
|
|
15
|
+
export function deepSeekAccountFrom(ctx) {
|
|
16
|
+
return ctx.get('deepseekAccount');
|
|
17
|
+
}
|
|
18
|
+
/** The Host webServer may be shared, supplied by the TUI row, or mounted as a fallback. */
|
|
19
|
+
export function deepSeekCallbackOrigin(ctx) {
|
|
20
|
+
const server = ctx.get('webServer');
|
|
21
|
+
const port = server?.port;
|
|
22
|
+
if (port === undefined || !Number.isInteger(port) || port < 1 || port > 65535) {
|
|
23
|
+
throw new Error('DeepSeek sign-in needs an active Host webServer for the browser callback');
|
|
24
|
+
}
|
|
25
|
+
return `http://127.0.0.1:${port}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Keep DeepSeek login usable after a profile-only update from a global TUI
|
|
29
|
+
* whose older bundle patch still mounts `dsh-tui-auth` but has no webserver
|
|
30
|
+
* row. The official Host listener is mounted only on the first login that
|
|
31
|
+
* needs it; an existing Web or user-owned listener is never replaced.
|
|
32
|
+
*/
|
|
33
|
+
export function createDeepSeekCallbackOriginResolver(ctx) {
|
|
34
|
+
let fallback;
|
|
35
|
+
let mounting;
|
|
36
|
+
let disposed = false;
|
|
37
|
+
const mountFallback = async () => {
|
|
38
|
+
const { WebServer } = await import('@deepseek-ai/dsh-host-webserver');
|
|
39
|
+
if (disposed)
|
|
40
|
+
throw new Error('dsh-auth: callback listener owner was disposed');
|
|
41
|
+
// Another Host row may have become available while the import resolved.
|
|
42
|
+
if (ctx.get('webServer') !== undefined)
|
|
43
|
+
return;
|
|
44
|
+
const fiber = ctx.root.plugin(WebServer, { host: '127.0.0.1', port: 0 });
|
|
45
|
+
fallback = fiber;
|
|
46
|
+
try {
|
|
47
|
+
await fiber;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
fallback = undefined;
|
|
51
|
+
try {
|
|
52
|
+
await fiber.dispose();
|
|
53
|
+
}
|
|
54
|
+
catch (disposeError) {
|
|
55
|
+
throw new AggregateError([error, disposeError], 'DeepSeek callback listener failed to start and dispose');
|
|
56
|
+
}
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return {
|
|
61
|
+
resolve: async () => {
|
|
62
|
+
if (disposed)
|
|
63
|
+
throw new Error('dsh-auth: callback listener owner was disposed');
|
|
64
|
+
if (ctx.get('webServer') === undefined) {
|
|
65
|
+
// A declared but unavailable listener is a composition decision or
|
|
66
|
+
// failure, not the missing row of an older global TUI patch.
|
|
67
|
+
const loader = ctx.get('loader');
|
|
68
|
+
for (const entry of loader?.entries() ?? []) {
|
|
69
|
+
if (entry.options.id === 'dsh-tui-webserver'
|
|
70
|
+
|| entry.options.name === '@deepseek-ai/dsh-host-webserver') {
|
|
71
|
+
return deepSeekCallbackOrigin(ctx);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
mounting ??= mountFallback().finally(() => { mounting = undefined; });
|
|
75
|
+
try {
|
|
76
|
+
await mounting;
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
80
|
+
throw new Error(`DeepSeek sign-in could not start a Host webServer callback listener: ${message}`, { cause: error });
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (disposed)
|
|
84
|
+
throw new Error('dsh-auth: callback listener owner was disposed');
|
|
85
|
+
return deepSeekCallbackOrigin(ctx);
|
|
86
|
+
},
|
|
87
|
+
dispose: async () => {
|
|
88
|
+
disposed = true;
|
|
89
|
+
await mounting?.catch(() => undefined);
|
|
90
|
+
await fallback?.dispose();
|
|
91
|
+
fallback = undefined;
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const tuiVersion = (() => {
|
|
96
|
+
try {
|
|
97
|
+
const manifest = JSON.parse(readFileSync(new URL(import.meta.resolve('@deepseek-harness-tui/dsh-tui/package.json')), 'utf8'));
|
|
98
|
+
return typeof manifest.version === 'string' ? manifest.version : '0.0.0';
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return '0.0.0';
|
|
102
|
+
}
|
|
103
|
+
})();
|
|
104
|
+
/** Platform request identity is supplied by the current TUI, not cached by the Host. */
|
|
105
|
+
export function deepSeekClientMetadata() {
|
|
106
|
+
return {
|
|
107
|
+
version: tuiVersion,
|
|
108
|
+
locale: getLang() === 'zh' ? 'zh-CN' : 'en-US',
|
|
109
|
+
timezoneOffsetSeconds: -new Date().getTimezoneOffset() * 60,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function succeeded(state, id) {
|
|
113
|
+
return state.attempt?.id === id && state.attempt.phase === 'succeeded' && state.status === 'credential-stored';
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Start (or join) the upstream browser attempt, display its URL, and wait for
|
|
117
|
+
* the upstream state stream. Esc/external abort cancels the exact attempt;
|
|
118
|
+
* a commit that won that race is reported as success instead of a false
|
|
119
|
+
* cancellation. The question panel is always retired before returning.
|
|
120
|
+
*/
|
|
121
|
+
export async function loginDeepSeekAccount(account, callbackOrigin, ask, signal, helpers = {}) {
|
|
122
|
+
const runAbort = new AbortController();
|
|
123
|
+
const forwardAbort = () => runAbort.abort(signal?.reason);
|
|
124
|
+
if (signal !== undefined) {
|
|
125
|
+
if (signal.aborted)
|
|
126
|
+
forwardAbort();
|
|
127
|
+
else
|
|
128
|
+
signal.addEventListener('abort', forwardAbort, { once: true });
|
|
129
|
+
}
|
|
130
|
+
const bridge = new QuestionBridge(ask, runAbort, helpers);
|
|
131
|
+
let id;
|
|
132
|
+
let active = false;
|
|
133
|
+
try {
|
|
134
|
+
runAbort.signal.throwIfAborted();
|
|
135
|
+
// Match Desktop's login_source for Platform-side promotion eligibility.
|
|
136
|
+
const initial = await account.startSignIn(deepSeekClientMetadata(), callbackOrigin, 'desktop');
|
|
137
|
+
id = initial.attempt?.id;
|
|
138
|
+
if (id === undefined)
|
|
139
|
+
throw new Error('DeepSeek sign-in returned no attempt');
|
|
140
|
+
active = true;
|
|
141
|
+
runAbort.signal.throwIfAborted();
|
|
142
|
+
let shownUrl;
|
|
143
|
+
try {
|
|
144
|
+
for await (const state of account.watch(runAbort.signal)) {
|
|
145
|
+
const attempt = state.attempt;
|
|
146
|
+
if (attempt?.id !== id)
|
|
147
|
+
throw new Error('DeepSeek sign-in attempt was replaced');
|
|
148
|
+
if (attempt.phase === 'waiting-browser' && attempt.authorizeUrl !== undefined
|
|
149
|
+
&& attempt.authorizeUrl !== shownUrl) {
|
|
150
|
+
shownUrl = attempt.authorizeUrl;
|
|
151
|
+
bridge.notify({ type: 'auth_url', url: shownUrl });
|
|
152
|
+
}
|
|
153
|
+
if (attempt.phase === 'succeeded') {
|
|
154
|
+
active = false;
|
|
155
|
+
if (!succeeded(state, id))
|
|
156
|
+
throw new Error('DeepSeek sign-in succeeded without a stored credential');
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (attempt.phase === 'failed' || attempt.phase === 'expired' || attempt.phase === 'cancelled') {
|
|
160
|
+
active = false;
|
|
161
|
+
throw new Error(`DeepSeek sign-in ${attempt.phase}${attempt.errorCode === undefined ? '' : ` (${attempt.errorCode})`}`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
if (!runAbort.signal.aborted)
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
if (runAbort.signal.aborted) {
|
|
170
|
+
const afterCancel = await account.cancelSignIn(id);
|
|
171
|
+
active = false;
|
|
172
|
+
if (succeeded(afterCancel, id))
|
|
173
|
+
return;
|
|
174
|
+
throw new Error('DeepSeek sign-in cancelled');
|
|
175
|
+
}
|
|
176
|
+
throw new Error('DeepSeek sign-in state stream ended before completion');
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
179
|
+
signal?.removeEventListener('abort', forwardAbort);
|
|
180
|
+
runAbort.abort();
|
|
181
|
+
try {
|
|
182
|
+
if (active && id !== undefined)
|
|
183
|
+
await account.cancelSignIn(id);
|
|
184
|
+
}
|
|
185
|
+
finally {
|
|
186
|
+
await bridge.settle();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/index.d.ts
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 type { Context } from '@deepseek-ai/cordis';
|
|
36
42
|
import z from '@deepseek-ai/schemastery';
|
|
@@ -43,15 +49,14 @@ export declare const name = "dsh-auth";
|
|
|
43
49
|
* Deliberately empty. A hard code-level inject would deadlock any
|
|
44
50
|
* composition lacking the `llm`/`commands` services at boot ("pending
|
|
45
51
|
* (waiting for service: …)") — the failure mode dsh-tui documented for its
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* *entry* level, where a stale patch cannot deadlock a newer boot.
|
|
52
|
+
* optional rows (#183). Both services resolve per call through `ctx.get` in
|
|
53
|
+
* {@link apply}; the profile patch declares the inject at the *entry* level,
|
|
54
|
+
* where a stale patch cannot deadlock a newer boot.
|
|
50
55
|
*/
|
|
51
56
|
export declare const inject: readonly string[];
|
|
52
57
|
/** Plugin configuration. */
|
|
53
58
|
export interface Config {
|
|
54
|
-
/** Provider routes to mount;
|
|
59
|
+
/** Provider routes to mount; omitted means every supported flow in the installed pi-ai catalog. */
|
|
55
60
|
providers?: string[];
|
|
56
61
|
/** Credential file override; default `$DSH_HOME/dsh-auth/credentials.json`. */
|
|
57
62
|
credentialsFile?: string;
|
|
@@ -70,7 +75,9 @@ export { QuestionBridge, describeEvent } from './interaction.js';
|
|
|
70
75
|
export type { AskFn, QuestionBridgeHelpers } from './interaction.js';
|
|
71
76
|
export { copyToClipboard, openInBrowser, openerFor } from './opener.js';
|
|
72
77
|
export { CredentialFile, defaultCredentialsFile } from './credentials.js';
|
|
73
|
-
export { OAUTH_PROVIDER_IDS, buildOAuthProfile, type ModelOverride } from './profiles.js';
|
|
78
|
+
export { OAUTH_PROVIDER_IDS, availableOAuthProviderIds, buildOAuthProfile, type ModelOverride } from './profiles.js';
|
|
79
|
+
export { DEEPSEEK_ACCOUNT_PROVIDER, deepSeekAccountFrom, deepSeekCallbackOrigin, deepSeekClientMetadata, loginDeepSeekAccount } from './deepseek.js';
|
|
80
|
+
export { WhaleCouponStore } from './bonus.js';
|
|
74
81
|
/**
|
|
75
82
|
* The adapter the plugin registers: a {@link PiAiAdapter} whose *advisory
|
|
76
83
|
* catalog* is credential-gated. A provider with no stored OAuth credential
|
|
@@ -92,3 +99,4 @@ export declare class CredentialGatedAdapter extends PiAiAdapter {
|
|
|
92
99
|
}
|
|
93
100
|
/** Mount the routes, the service, and the command. */
|
|
94
101
|
export declare function apply(ctx: Context, config: Config): void;
|
|
102
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/oauth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEpE,OAAO,EAAoE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAOpH,eAAO,MAAM,IAAI,aAAa,CAAA;AAC9B;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,MAAM,EAAO,CAAA;AAgB3C,4BAA4B;AAC5B,MAAM,WAAW,MAAM;IACrB,mGAAmG;IACnG,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAA;CAC/D;AAOD,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAI3B,CAAA;AAEF,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChE,YAAY,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AACpE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzE,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AACpH,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACpJ,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAkB7C;;;;;;;;;;;;;GAaG;AACH,qBAAa,sBAAuB,SAAQ,WAAW;IAGnD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAD9B,OAAO,EAAE,kBAAkB,EACV,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC;IAKzD,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;CAI9E;AAED,sDAAsD;AACtD,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAuHxD"}
|