@deepseek-harness-tui/dsh-tui 0.11.2 → 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 +21 -5
- package/bin/dsh-tui.js +30 -3
- package/cordis.patch.yml +24 -5
- 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 +5 -5
- package/lib/types/adapter/channel/ui-policy.d.ts +3 -2
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +4 -0
- package/lib/types/adapter/ports/channel-settings.d.ts +2 -1
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +29 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +43 -9
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- 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/JobsPanel.d.ts.map +1 -1
- package/lib/types/components/JobsPanel.js +80 -33
- package/lib/types/components/MessageList.js +3 -3
- 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.map +1 -1
- package/lib/types/components/PromptInput.js +12 -1
- package/lib/types/components/StarPrompt.d.ts +6 -0
- package/lib/types/components/StarPrompt.d.ts.map +1 -1
- package/lib/types/components/StarPrompt.js +45 -0
- 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/WhaleGirl.d.ts +6 -0
- package/lib/types/components/WhaleGirl.d.ts.map +1 -1
- package/lib/types/components/WhaleGirl.js +18 -0
- package/lib/types/components/messages/AssistantThinkingMessage.js +4 -4
- 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/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/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/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 +17 -7
- package/lib/types/dsh-adapter/channel/state.d.ts +4 -2
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +5 -0
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +16 -1
- package/lib/types/dsh-adapter/contract.d.ts +5 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +9 -3
- 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/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 +8 -1
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +72 -12
- 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.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +6 -2
- package/lib/types/dsh-adapter/subagents.d.ts +1 -0
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +10 -1
- package/lib/types/i18n.d.ts +174 -18
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +53 -11
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +10 -1
- package/lib/types/ink/parse-keypress.d.ts +35 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +611 -83
- package/lib/types/ink/terminal-querier.d.ts +25 -0
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +42 -0
- 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/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 +4 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +27 -7
- 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 +12 -12
- package/lib/types/settings/definitions.js +4 -4
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +10 -4
- package/lib/types/update.js +2 -2
- 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/package.json +111 -100
- 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
|
@@ -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,
|
package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/service.d.ts
RENAMED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `ctx.dshAuth` service: the programmatic surface over this
|
|
2
|
+
* The `ctx.dshAuth` service: the programmatic surface over this module's
|
|
3
3
|
* mounted OAuth routes. UIs (the dsh-tui /provider wizard, a web settings
|
|
4
4
|
* page) enumerate providers with masked sign-in state and drive login/logout
|
|
5
5
|
* without touching the credential file or the pi-ai flow objects; the `/auth`
|
|
6
6
|
* command in `command.ts` is a thin textual veneer over the same api.
|
|
7
7
|
*
|
|
8
|
-
* @module dsh-
|
|
8
|
+
* @module @deepseek-harness-tui/dsh-tui/oauth/service
|
|
9
9
|
*/
|
|
10
10
|
import { Service } from '@deepseek-ai/cordis';
|
|
11
11
|
import type { Context } from '@deepseek-ai/cordis';
|
|
12
12
|
import type { ResolvedPiAiProviderProfile } from '@deepseek-ai/dsh-llm-pi-ai';
|
|
13
13
|
import { CredentialFile } from './credentials.js';
|
|
14
14
|
import { type AskFn } from './interaction.js';
|
|
15
|
+
import { type DeepSeekAccountAuth } from './deepseek.js';
|
|
16
|
+
import { WhaleCouponStore } from './bonus.js';
|
|
15
17
|
/** One provider's sign-in state; never carries token material. */
|
|
16
18
|
export interface DshAuthSignInStatus {
|
|
17
19
|
provider: string;
|
|
@@ -30,7 +32,8 @@ export interface DshAuthSignInStatus {
|
|
|
30
32
|
export interface DshAuthLoginResult {
|
|
31
33
|
provider: string;
|
|
32
34
|
oauthLabel: string;
|
|
33
|
-
|
|
35
|
+
/** pi-ai tokens expire; the Host-owned DeepSeek account grant has no expiry. */
|
|
36
|
+
expiresAt: number | undefined;
|
|
34
37
|
}
|
|
35
38
|
/** The service api consumed by commands and UIs. */
|
|
36
39
|
export interface DshAuthApi {
|
|
@@ -43,12 +46,13 @@ export interface DshAuthApi {
|
|
|
43
46
|
* unknown, a login is already running, or the flow itself fails.
|
|
44
47
|
*/
|
|
45
48
|
login(provider?: string, signal?: AbortSignal): Promise<DshAuthLoginResult>;
|
|
46
|
-
/**
|
|
49
|
+
/** Cancel an active sign-in and remove the stored credential; resolves whether one existed. */
|
|
47
50
|
logout(provider: string): Promise<boolean>;
|
|
48
51
|
}
|
|
49
52
|
/** Cordis service holder; `api` is set by the plugin's apply. */
|
|
50
53
|
export declare class DshAuthService extends Service {
|
|
51
54
|
api: DshAuthApi | undefined;
|
|
55
|
+
readonly coupons: WhaleCouponStore;
|
|
52
56
|
constructor(ctx: Context);
|
|
53
57
|
}
|
|
54
58
|
/** Everything the api factory needs; all cordis surface is injected, so tests run without a host. */
|
|
@@ -57,9 +61,11 @@ export interface DshAuthApiDeps {
|
|
|
57
61
|
store: CredentialFile;
|
|
58
62
|
/** The interactive ask surface, resolved per call so mounting order never matters. */
|
|
59
63
|
resolveAsk: () => AskFn | undefined;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
/** Optional upstream account service; older hosts have only pi-ai routes. */
|
|
65
|
+
resolveDeepSeekAccount?: () => DeepSeekAccountAuth | undefined;
|
|
66
|
+
/** The active Host callback listener's browser-accessible loopback origin. */
|
|
67
|
+
resolveCallbackOrigin?: () => string | Promise<string>;
|
|
68
|
+
coupons?: WhaleCouponStore;
|
|
63
69
|
}
|
|
64
70
|
/**
|
|
65
71
|
* The api implementation. One login runs per provider at a time (an in-flight
|
|
@@ -67,3 +73,4 @@ export interface DshAuthApiDeps {
|
|
|
67
73
|
* attempt for the same provider fails fast instead of stacking two flows.
|
|
68
74
|
*/
|
|
69
75
|
export declare function createDshAuthApi(deps: DshAuthApiDeps): DshAuthApi;
|
|
76
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../src/dsh-adapter/oauth/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,EAAsB,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAErE,OAAO,EAAkB,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAE7D,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAgB7C,kEAAkE;AAClE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,UAAU,EAAE,MAAM,CAAA;IAClB,gEAAgE;IAChE,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,mFAAmF;IACnF,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,yCAAyC;AACzC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,gFAAgF;IAChF,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B;AAED,oDAAoD;AACpD,MAAM,WAAW,UAAU;IACzB,wDAAwD;IACxD,SAAS,IAAI,OAAO,CAAC,SAAS,mBAAmB,EAAE,CAAC,CAAA;IACpD;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAA;IAC3E,+FAA+F;IAC/F,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CAC3C;AAED,iEAAiE;AACjE,qBAAa,cAAe,SAAQ,OAAO;IACzC,GAAG,EAAE,UAAU,GAAG,SAAS,CAAA;IAC3B,QAAQ,CAAC,OAAO,mBAAyB;gBAE7B,GAAG,EAAE,OAAO;CAGzB;AAED,qGAAqG;AACrG,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAA;IAC1D,KAAK,EAAE,cAAc,CAAA;IACrB,sFAAsF;IACtF,UAAU,EAAE,MAAM,KAAK,GAAG,SAAS,CAAA;IACnC,6EAA6E;IAC7E,sBAAsB,CAAC,EAAE,MAAM,mBAAmB,GAAG,SAAS,CAAA;IAC9D,8EAA8E;IAC9E,qBAAqB,CAAC,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IACtD,OAAO,CAAC,EAAE,gBAAgB,CAAA;CAC3B;AAoBD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,UAAU,CAkJjE"}
|