@deepseek-ai/dsh-deepseek-auth 0.0.0-stage → 0.2.3-alpha.1

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.
@@ -0,0 +1,94 @@
1
+ /**
2
+ * DeepSeek request authentication (`ctx.deepseekAuth`). DeepSeek APIs accept two kinds of credential, the API key and
3
+ * the account sign-in, and each API accepts one or both. A consumer names the kinds its API accepts and the billing
4
+ * its settings choose; this service orders the kinds, binds each to the deployment its credential belongs to, and
5
+ * releases the request headers of the first kind that has a credential. Model route plugins connect the deployment
6
+ * their settings name; without a connection the API key is `DEEPSEEK_API_KEY` at the official API and the account
7
+ * sign-in goes to the deployment `DEEPSEEK_BASE_URL` names.
8
+ *
9
+ * ```ts
10
+ * const authorization = await ctx.deepseekAuth.authorize({
11
+ * consumer: name, accepts: ['account', 'api-key'], billing: 'auto', route, destination: { path: '/v1/tools/search' },
12
+ * }, signal)
13
+ * ```
14
+ *
15
+ * @module @deepseek-ai/dsh-deepseek-auth
16
+ */
17
+ import { Context, Service } from '@deepseek-ai/cordis';
18
+ import { HarnessError } from '@deepseek-ai/dsh-error';
19
+ import type { DeepSeekAuthCandidate, DeepSeekAuthConnection, DeepSeekAuthKind, DeepSeekAuthRequest, DeepSeekAuthUnresolved, DeepSeekAuthorization } from './types.ts';
20
+ export type * from './types.ts';
21
+ declare module '@deepseek-ai/cordis' {
22
+ interface Context {
23
+ deepseekAuth: DeepSeekAuth;
24
+ }
25
+ }
26
+ /** Failure codes of {@link DeepSeekAuthError}. */
27
+ export type DeepSeekAuthErrorCode =
28
+ /** A second connection of one kind; one model route plugin owns each kind's deployment. */
29
+ 'DUPLICATE_CONNECTION'
30
+ /** The configured API key is blank or cannot travel in an HTTP header. */
31
+ | 'INVALID_CREDENTIAL'
32
+ /** The connection of the kind an operation reached does not resolve. */
33
+ | 'UNRESOLVED_CONNECTION';
34
+ /** A DeepSeek authentication failure; `message` never contains a credential. */
35
+ export declare class DeepSeekAuthError extends HarnessError {
36
+ readonly code: DeepSeekAuthErrorCode;
37
+ /**
38
+ * @param message - what failed and what to change.
39
+ * @param code - the failure class.
40
+ * @param options - the underlying failure.
41
+ */
42
+ constructor(message: string, code: DeepSeekAuthErrorCode, options?: ErrorOptions);
43
+ }
44
+ /** `ctx.deepseekAuth`: the two DeepSeek credential kinds behind one request-authorization operation. */
45
+ export declare class DeepSeekAuth extends Service {
46
+ private readonly connections;
47
+ /** @param ctx - Host context; the credentials service and the account service are read when mounted. */
48
+ constructor(ctx: Context);
49
+ /**
50
+ * Connect the deployment a model route plugin's settings name for one kind. Call it from within `ctx.effect()`.
51
+ * @param kind - the kind the plugin's route bills.
52
+ * @param route - provider route the plugin registers; {@link routeKind} answers `kind` for it while connected.
53
+ * @param connection - reads the plugin's current settings; a throw marks the kind unresolved for that operation.
54
+ * @returns the disposer removing the connection.
55
+ * @throws {DeepSeekAuthError} code `DUPLICATE_CONNECTION` when the kind is already connected.
56
+ */
57
+ connect(kind: DeepSeekAuthKind, route: string, connection: () => DeepSeekAuthConnection): () => void;
58
+ /**
59
+ * The kind that bills a conversation on one model route.
60
+ * @param route - provider route of a model request; undefined names none.
61
+ * @returns the kind connected under that route, or undefined for a route no plugin connected.
62
+ */
63
+ routeKind(route: string | undefined): DeepSeekAuthKind | undefined;
64
+ /**
65
+ * The kinds one request can authenticate with, in the order its billing tries them, each bound to its destination.
66
+ * Nothing is read from a credential store.
67
+ * @param request - the request.
68
+ * @returns candidates and unresolved kinds, first preferred; empty when the destination accepts no kind the
69
+ * billing allows or no allowed kind serves an absolute destination.
70
+ */
71
+ candidates(request: DeepSeekAuthRequest): (DeepSeekAuthCandidate | DeepSeekAuthUnresolved)[];
72
+ /**
73
+ * Release the credential of the first candidate that has one. A later candidate is not read once an earlier one
74
+ * has a credential, fails to read, or does not resolve.
75
+ * @param request - the request.
76
+ * @param signal - cancellation for the lookups.
77
+ * @returns the authorization, or undefined when no candidate has a credential.
78
+ * @throws {DeepSeekAuthError} code `UNRESOLVED_CONNECTION` at an unresolved kind, `INVALID_CREDENTIAL` for an
79
+ * unusable API key; store failures propagate.
80
+ */
81
+ authorize(request: DeepSeekAuthRequest, signal?: AbortSignal): Promise<DeepSeekAuthorization | undefined>;
82
+ /** The kinds the billing tries, in order, before the destination's accepted kinds narrow them. */
83
+ private order;
84
+ /** Bind one kind to the request's destination; empty when the kind does not serve an absolute destination. */
85
+ private candidate;
86
+ /** The connection of a kind no model route plugin connected. */
87
+ private unconnected;
88
+ /** The API key read under the connection's reference, sent in the headers the request names. */
89
+ private apiKey;
90
+ /** The account sign-in the account service releases for the endpoint; absent without that service. */
91
+ private account;
92
+ }
93
+ export default DeepSeekAuth;
94
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAItD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EACV,qBAAqB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,sBAAsB,EAC5G,qBAAqB,EACtB,MAAM,YAAY,CAAA;AAEnB,mBAAmB,YAAY,CAAA;AAE/B,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QAAG,YAAY,EAAE,YAAY,CAAA;KAAE;CACjD;AAcD,kDAAkD;AAClD,MAAM,MAAM,qBAAqB;AAC/B,2FAA2F;AACzF,sBAAsB;AACxB,0EAA0E;GACxE,oBAAoB;AACtB,wEAAwE;GACtE,uBAAuB,CAAA;AAE3B,gFAAgF;AAChF,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,SAAiB,IAAI,EAAE,qBAAqB,CAAA;IAE5C;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,YAAY;CAKjF;AA2BD,wGAAwG;AACxG,qBAAa,YAAa,SAAQ,OAAO;IACvC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA2F;IAEvH,wGAAwG;gBAC5F,GAAG,EAAE,OAAO;IAIxB;;;;;;;OAOG;IACH,OAAO,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,sBAAsB,GAAG,MAAM,IAAI;IAQpG;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS;IAOlE;;;;;;OAMG;IACH,UAAU,CAAC,OAAO,EAAE,mBAAmB,GAAG,CAAC,qBAAqB,GAAG,sBAAsB,CAAC,EAAE;IAI5F;;;;;;;;OAQG;IACG,SAAS,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAc/G,kGAAkG;IAClG,OAAO,CAAC,KAAK;IAYb,8GAA8G;IAC9G,OAAO,CAAC,SAAS;IAoBjB,gEAAgE;IAChE,OAAO,CAAC,WAAW;IAanB,gGAAgG;IAChG,OAAO,CAAC,MAAM;IAsBd,sGAAsG;IACtG,OAAO,CAAC,OAAO;CAgBhB;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,232 @@
1
+ /**
2
+ * DeepSeek request authentication (`ctx.deepseekAuth`). DeepSeek APIs accept two kinds of credential, the API key and
3
+ * the account sign-in, and each API accepts one or both. A consumer names the kinds its API accepts and the billing
4
+ * its settings choose; this service orders the kinds, binds each to the deployment its credential belongs to, and
5
+ * releases the request headers of the first kind that has a credential. Model route plugins connect the deployment
6
+ * their settings name; without a connection the API key is `DEEPSEEK_API_KEY` at the official API and the account
7
+ * sign-in goes to the deployment `DEEPSEEK_BASE_URL` names.
8
+ *
9
+ * ```ts
10
+ * const authorization = await ctx.deepseekAuth.authorize({
11
+ * consumer: name, accepts: ['account', 'api-key'], billing: 'auto', route, destination: { path: '/v1/tools/search' },
12
+ * }, signal)
13
+ * ```
14
+ *
15
+ * @module @deepseek-ai/dsh-deepseek-auth
16
+ */
17
+ import { Service } from '@deepseek-ai/cordis';
18
+ import { credentialRef, credentialRefConfigured, normalizeApiKey, resolveCredentialRef } from '@deepseek-ai/dsh-credentials';
19
+ import { HarnessError } from '@deepseek-ai/dsh-error';
20
+ import { launchEnvironmentOf } from '@deepseek-ai/dsh-launch-environment';
21
+ /** Base URL of the official DeepSeek API, where `DEEPSEEK_API_KEY` is sent without a connected API-key route. */
22
+ const OFFICIAL_BASE_URL = 'https://api.deepseek.com';
23
+ /** Credential reference of the official DeepSeek API key. */
24
+ const DEEPSEEK_API_KEY = credentialRef('DEEPSEEK_API_KEY');
25
+ /**
26
+ * Launch-environment variable naming the DeepSeek deployment the model routes default to. Without a connected account
27
+ * route, its origin receives the account sign-in.
28
+ */
29
+ const DEEPSEEK_BASE_URL_ENV = 'DEEPSEEK_BASE_URL';
30
+ /** A DeepSeek authentication failure; `message` never contains a credential. */
31
+ export class DeepSeekAuthError extends HarnessError {
32
+ /**
33
+ * @param message - what failed and what to change.
34
+ * @param code - the failure class.
35
+ * @param options - the underlying failure.
36
+ */
37
+ constructor(message, code, options) {
38
+ super(message, code, options);
39
+ // Consumers quote this name in their own diagnostics, so it does not follow a bundler's class renaming.
40
+ this.name = 'DeepSeekAuthError';
41
+ }
42
+ }
43
+ /**
44
+ * The diagnostic for a configured API key that cannot be sent. The key never enters the text: `reference` names where to
45
+ * fix it. The Models page is named as the writer it usually is, not as the only one, because the same value can arrive
46
+ * from a hand-edited `.env` or a shell export in a composition that mounts no credentials service.
47
+ * @param reason - why the key cannot be sent.
48
+ * @param owner - settings namespace or plugin name prefixed to the text.
49
+ * @param reference - the credential reference the key was read under.
50
+ * @returns the message of the `INVALID_CREDENTIAL` failure.
51
+ */
52
+ function unusableKey(reason, owner, reference) {
53
+ const defect = {
54
+ empty: `is blank; set ${reference} to the raw key (the web Models page writes it) or export it in the launching`
55
+ + ' environment',
56
+ illegalCharacters: `contains characters no HTTP header can carry; set ${reference} to the raw key alone (the web Models`
57
+ + ' page writes it)',
58
+ };
59
+ return `${owner}: the API key resolved from ${reference} ${defect[reason]}`;
60
+ }
61
+ /** Marks a failure of the launch-environment deployment, apart from a failure of a connected route's settings. */
62
+ class DeploymentError extends Error {
63
+ /** @param cause - why the variable's value is no deployment URL. */
64
+ constructor(cause) { super('unresolved deployment', { cause }); }
65
+ }
66
+ /** `ctx.deepseekAuth`: the two DeepSeek credential kinds behind one request-authorization operation. */
67
+ export class DeepSeekAuth extends Service {
68
+ connections = new Map();
69
+ /** @param ctx - Host context; the credentials service and the account service are read when mounted. */
70
+ constructor(ctx) {
71
+ super(ctx, 'deepseekAuth');
72
+ }
73
+ /**
74
+ * Connect the deployment a model route plugin's settings name for one kind. Call it from within `ctx.effect()`.
75
+ * @param kind - the kind the plugin's route bills.
76
+ * @param route - provider route the plugin registers; {@link routeKind} answers `kind` for it while connected.
77
+ * @param connection - reads the plugin's current settings; a throw marks the kind unresolved for that operation.
78
+ * @returns the disposer removing the connection.
79
+ * @throws {DeepSeekAuthError} code `DUPLICATE_CONNECTION` when the kind is already connected.
80
+ */
81
+ connect(kind, route, connection) {
82
+ if (this.connections.has(kind)) {
83
+ throw new DeepSeekAuthError(`deepseek-auth: the ${kind} deployment is already connected`, 'DUPLICATE_CONNECTION');
84
+ }
85
+ this.connections.set(kind, { route, connection });
86
+ return () => { this.connections.delete(kind); };
87
+ }
88
+ /**
89
+ * The kind that bills a conversation on one model route.
90
+ * @param route - provider route of a model request; undefined names none.
91
+ * @returns the kind connected under that route, or undefined for a route no plugin connected.
92
+ */
93
+ routeKind(route) {
94
+ for (const [kind, connected] of this.connections) {
95
+ if (connected.route === route)
96
+ return kind;
97
+ }
98
+ return undefined;
99
+ }
100
+ /**
101
+ * The kinds one request can authenticate with, in the order its billing tries them, each bound to its destination.
102
+ * Nothing is read from a credential store.
103
+ * @param request - the request.
104
+ * @returns candidates and unresolved kinds, first preferred; empty when the destination accepts no kind the
105
+ * billing allows or no allowed kind serves an absolute destination.
106
+ */
107
+ candidates(request) {
108
+ return this.order(request).filter(kind => request.accepts.includes(kind)).flatMap(kind => this.candidate(kind, request));
109
+ }
110
+ /**
111
+ * Release the credential of the first candidate that has one. A later candidate is not read once an earlier one
112
+ * has a credential, fails to read, or does not resolve.
113
+ * @param request - the request.
114
+ * @param signal - cancellation for the lookups.
115
+ * @returns the authorization, or undefined when no candidate has a credential.
116
+ * @throws {DeepSeekAuthError} code `UNRESOLVED_CONNECTION` at an unresolved kind, `INVALID_CREDENTIAL` for an
117
+ * unusable API key; store failures propagate.
118
+ */
119
+ async authorize(request, signal) {
120
+ for (const candidate of this.candidates(request)) {
121
+ if ('unresolved' in candidate) {
122
+ throw new DeepSeekAuthError(`deepseek-auth: the ${candidate.kind} ${candidate.unresolved} does not resolve: ${String(candidate.error)}`, 'UNRESOLVED_CONNECTION', { cause: candidate.error });
123
+ }
124
+ const authorization = await candidate.resolve(signal);
125
+ if (authorization !== undefined)
126
+ return authorization;
127
+ }
128
+ return undefined;
129
+ }
130
+ /** The kinds the billing tries, in order, before the destination's accepted kinds narrow them. */
131
+ order(request) {
132
+ const billing = request.billing ?? 'auto';
133
+ if (billing !== 'auto')
134
+ return [billing];
135
+ switch (this.routeKind(request.route)) {
136
+ // A conversation on the account route falls back to the API key.
137
+ case 'account': return ['account', 'api-key'];
138
+ case 'api-key': return ['api-key'];
139
+ // Every route no plugin connected, whatever its id, and an operation outside a conversation.
140
+ default: return ['api-key', 'account'];
141
+ }
142
+ }
143
+ /** Bind one kind to the request's destination; empty when the kind does not serve an absolute destination. */
144
+ candidate(kind, request) {
145
+ let connection;
146
+ try {
147
+ connection = request.connections?.[kind] ?? this.connections.get(kind)?.connection() ?? this.unconnected(kind);
148
+ }
149
+ catch (error) {
150
+ const unresolved = error instanceof DeploymentError ? 'deployment' : 'connection';
151
+ return [{ kind, unresolved, error: error instanceof DeploymentError ? error.cause : error }];
152
+ }
153
+ let endpoint;
154
+ try {
155
+ const deployment = new URL(connection.baseURL);
156
+ if ('path' in request.destination)
157
+ endpoint = `${deployment.origin}${request.destination.path}`;
158
+ else {
159
+ const destination = new URL(request.destination.url);
160
+ if (destination.origin !== deployment.origin || destination.username !== '' || destination.password !== '')
161
+ return [];
162
+ endpoint = request.destination.url;
163
+ }
164
+ }
165
+ catch (error) {
166
+ return [{ kind, unresolved: 'connection', error }];
167
+ }
168
+ return [kind === 'api-key' ? this.apiKey(connection, endpoint, request) : this.account(endpoint)];
169
+ }
170
+ /** The connection of a kind no model route plugin connected. */
171
+ unconnected(kind) {
172
+ if (kind === 'api-key')
173
+ return { baseURL: OFFICIAL_BASE_URL };
174
+ const configured = launchEnvironmentOf(this.ctx).get(DEEPSEEK_BASE_URL_ENV)?.value;
175
+ if (configured === undefined || configured.length === 0)
176
+ return { baseURL: OFFICIAL_BASE_URL };
177
+ try {
178
+ const url = new URL(configured);
179
+ if (!/^https?:$/u.test(url.protocol) || url.username.length > 0 || url.password.length > 0) {
180
+ throw new Error(`${DEEPSEEK_BASE_URL_ENV} must be an HTTP(S) URL without credentials`);
181
+ }
182
+ }
183
+ catch (error) {
184
+ throw new DeploymentError(error);
185
+ }
186
+ return { baseURL: configured };
187
+ }
188
+ /** The API key read under the connection's reference, sent in the headers the request names. */
189
+ apiKey(connection, endpoint, request) {
190
+ const { ctx } = this;
191
+ const reference = connection.reference ?? DEEPSEEK_API_KEY;
192
+ const owner = connection.owner ?? request.consumer;
193
+ return {
194
+ kind: 'api-key', endpoint, reference,
195
+ configured: () => credentialRefConfigured(ctx, reference),
196
+ resolve: async (signal) => {
197
+ signal?.throwIfAborted();
198
+ const raw = await resolveCredentialRef(ctx, reference);
199
+ if (raw === undefined)
200
+ return undefined;
201
+ const checked = normalizeApiKey(raw);
202
+ if (!checked.ok)
203
+ throw new DeepSeekAuthError(unusableKey(checked.reason, owner, reference), 'INVALID_CREDENTIAL');
204
+ const headers = {};
205
+ for (const header of request.apiKeyHeaders ?? ['authorization']) {
206
+ headers[header] = header === 'authorization' ? `Bearer ${checked.value}` : checked.value;
207
+ }
208
+ return { kind: 'api-key', endpoint, reference, headers };
209
+ },
210
+ };
211
+ }
212
+ /** The account sign-in the account service releases for the endpoint; absent without that service. */
213
+ account(endpoint) {
214
+ const { ctx } = this;
215
+ return {
216
+ kind: 'account', endpoint,
217
+ configured: async () => (await ctx.get('deepseekAccount')?.resolveRequestCredential(endpoint)) !== undefined,
218
+ resolve: async (signal) => {
219
+ signal?.throwIfAborted();
220
+ const credential = await ctx.get('deepseekAccount')?.resolveRequestCredential(endpoint);
221
+ if (credential === undefined)
222
+ return undefined;
223
+ return {
224
+ kind: 'account', endpoint, headers: credential.headers, revoked: credential.revoked,
225
+ reject: () => credential.reject(),
226
+ };
227
+ },
228
+ };
229
+ }
230
+ }
231
+ export default DeepSeekAuth;
232
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAG5H,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AAYzE,iHAAiH;AACjH,MAAM,iBAAiB,GAAG,0BAA0B,CAAA;AAEpD,6DAA6D;AAC7D,MAAM,gBAAgB,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAA;AAE1D;;;GAGG;AACH,MAAM,qBAAqB,GAAG,mBAAmB,CAAA;AAWjD,gFAAgF;AAChF,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IAGjD;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AAa,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;oBAChE,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,KAAK,eAAe,CAAC,CAAC,CAAC,UAAU,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAA;gBAC1F,CAAC;gBACD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;YAC1D,CAAC;SACF,CAAA;IACH,CAAC;IAED,sGAAsG;IAC9F,OAAO,CAAC,QAAgB;QAC9B,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;QACpB,OAAO;YACL,IAAI,EAAE,SAAS,EAAE,QAAQ;YACzB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC,KAAK,SAAS;YAC5G,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;gBACxB,MAAM,EAAE,cAAc,EAAE,CAAA;gBACxB,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAA;gBACvF,IAAI,UAAU,KAAK,SAAS;oBAAE,OAAO,SAAS,CAAA;gBAC9C,OAAO;oBACL,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO;oBACnF,MAAM,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE;iBAClC,CAAA;YACH,CAAC;SACF,CAAA;IACH,CAAC;CACF;AAED,eAAe,YAAY,CAAA"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Types of DeepSeek request authentication. Host-only: an authorization carries a secret, so none of these values
3
+ * crosses a Remote boundary or enters a log.
4
+ * @module @deepseek-ai/dsh-deepseek-auth/types
5
+ */
6
+ import type { CredentialRef } from '@deepseek-ai/dsh-credentials';
7
+ /** A way to authenticate a DeepSeek API request: the API key, or the account sign-in. */
8
+ export type DeepSeekAuthKind = 'api-key' | 'account';
9
+ /** Which credential pays for an operation: one kind only, or `auto`, which follows the conversation's model route. */
10
+ export type DeepSeekAuthBilling = 'auto' | DeepSeekAuthKind;
11
+ /** Request header an API key is sent in: `authorization` as `Bearer <key>`, `x-api-key` as the bare key. */
12
+ export type DeepSeekApiKeyHeader = 'authorization' | 'x-api-key';
13
+ /** The deployment the credential of one kind belongs to and, for the API key, where the key is read. */
14
+ export interface DeepSeekAuthConnection {
15
+ /** Base URL of the deployment; the credential is sent only to destinations under its origin. */
16
+ readonly baseURL: string;
17
+ /** API key only: the credential reference the key is read under; `DEEPSEEK_API_KEY` when omitted. */
18
+ readonly reference?: CredentialRef;
19
+ /**
20
+ * API key only: the settings namespace or package name prefixed to the diagnostic of an unusable key; the
21
+ * request's `consumer` when omitted.
22
+ */
23
+ readonly owner?: string;
24
+ }
25
+ /**
26
+ * Where one request goes: a path appended to the origin of the chosen kind's deployment, or one absolute URL, which a
27
+ * kind serves only when the URL is under the origin of that kind's deployment and embeds no credentials.
28
+ */
29
+ export type DeepSeekAuthDestination = {
30
+ readonly path: string;
31
+ } | {
32
+ readonly url: string;
33
+ };
34
+ /** One DeepSeek API request that needs authentication. */
35
+ export interface DeepSeekAuthRequest {
36
+ /** Name of the requesting plugin, prefixed to the diagnostic of an unusable key whose connection names no owner. */
37
+ readonly consumer: string;
38
+ /** Kinds the destination API accepts; a kind outside this list is never a candidate. */
39
+ readonly accepts: readonly DeepSeekAuthKind[];
40
+ /** Which credential pays; `auto` when omitted. */
41
+ readonly billing?: DeepSeekAuthBilling;
42
+ /** Provider route of the model request this operation serves; only `auto` billing reads it. */
43
+ readonly route?: string | undefined;
44
+ /** Where the request goes. */
45
+ readonly destination: DeepSeekAuthDestination;
46
+ /**
47
+ * The caller's own connection of a kind, used in place of the connected or default one: the configuration
48
+ * generation a model route captured for one request, or a consumer's own endpoint and key.
49
+ */
50
+ readonly connections?: Readonly<Partial<Record<DeepSeekAuthKind, DeepSeekAuthConnection>>>;
51
+ /** Headers an API key is sent in; `authorization` when omitted. The account sign-in chooses its own header. */
52
+ readonly apiKeyHeaders?: readonly DeepSeekApiKeyHeader[];
53
+ }
54
+ /** The credential of one kind released for one request, ready to send. */
55
+ export interface DeepSeekAuthorization {
56
+ /** Kind of the credential. */
57
+ readonly kind: DeepSeekAuthKind;
58
+ /** Absolute URL the request is sent to. */
59
+ readonly endpoint: string;
60
+ /** Request headers carrying the credential. */
61
+ readonly headers: Readonly<Record<string, string>>;
62
+ /** API key only: the reference the key was read under, for diagnostics that tell the user where to configure it. */
63
+ readonly reference?: CredentialRef;
64
+ /**
65
+ * Invalidate this exact credential after the destination rejected it with HTTP 401, so no later request resends
66
+ * it. Absent for kinds without invalidation. The owner contains storage failures: the caller reports the
67
+ * destination's rejection, never a failure of this call.
68
+ * @returns settlement after the invalidation attempt.
69
+ */
70
+ reject?(): Promise<void>;
71
+ /**
72
+ * Aborts when the owner withdraws the credential while requests may carry it, as an account sign-out does. A
73
+ * consumer ends each request it authenticated with this authorization and reports that end as its own failure,
74
+ * not as the caller's cancellation. Absent for kinds that are never withdrawn.
75
+ */
76
+ readonly revoked?: AbortSignal;
77
+ }
78
+ /** One kind a request can authenticate with, in the order the billing chose. Nothing is read until asked. */
79
+ export interface DeepSeekAuthCandidate {
80
+ /** Kind of the credential. */
81
+ readonly kind: DeepSeekAuthKind;
82
+ /** Absolute URL a request authenticated with this kind is sent to. */
83
+ readonly endpoint: string;
84
+ /** API key only: the reference the key is read under. */
85
+ readonly reference?: CredentialRef;
86
+ /**
87
+ * Whether {@link resolve} would release a credential, checked without validating it or contacting the
88
+ * destination. Store failures reject.
89
+ * @returns whether a credential of this kind is configured for the endpoint.
90
+ */
91
+ configured(): Promise<boolean>;
92
+ /**
93
+ * Release the credential, or `undefined` when none is configured. Store failures and an unusable key reject.
94
+ * @param signal - cancellation for the lookup.
95
+ * @returns the authorization, or `undefined`.
96
+ */
97
+ resolve(signal?: AbortSignal): Promise<DeepSeekAuthorization | undefined>;
98
+ }
99
+ /** A kind the billing chose whose connection does not resolve; an operation that reaches it stops there. */
100
+ export interface DeepSeekAuthUnresolved {
101
+ /** Kind of the credential. */
102
+ readonly kind: DeepSeekAuthKind;
103
+ /**
104
+ * What did not resolve: the `connection` a model route plugin connected or the caller supplied, or the `deployment`
105
+ * the launch environment names for the account sign-in without a connected account route.
106
+ */
107
+ readonly unresolved: 'connection' | 'deployment';
108
+ /** The failure. */
109
+ readonly error: unknown;
110
+ }
111
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAEjE,yFAAyF;AACzF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAA;AAEpD,sHAAsH;AACtH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,gBAAgB,CAAA;AAE3D,4GAA4G;AAC5G,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG,WAAW,CAAA;AAEhE,wGAAwG;AACxG,MAAM,WAAW,sBAAsB;IACrC,gGAAgG;IAChG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,qGAAqG;IACrG,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAA;IAClC;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAE1F,0DAA0D;A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DAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAA;IAClC;;;;OAIG;IACH,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9B;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAA;CAC1E;AAED,4GAA4G;AAC5G,MAAM,WAAW,sBAAsB;IACrC,8BAA8B;IAC9B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;IAC/B;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,YAAY,GAAG,YAAY,CAAA;IAChD,mBAAmB;IACnB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
package/locale/de.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek-Anfrageauthentifizierung",
4
+ "description": "Wählt für jede Anfrage an DeepSeek den API-Schlüssel oder die Kontoanmeldung aus und stellt die Anfrage-Header bereit."
5
+ }
6
+ }
package/locale/en.json ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek request authentication"
4
+ }
5
+ }
package/locale/es.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Autenticación de solicitudes de DeepSeek",
4
+ "description": "Elige la clave de API o el inicio de sesión de la cuenta para cada solicitud a DeepSeek y proporciona los encabezados de la solicitud."
5
+ }
6
+ }
package/locale/fr.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Authentification des requêtes DeepSeek",
4
+ "description": "Choisit la clé API ou la connexion au compte pour chaque requête envoyée à DeepSeek et fournit les en-têtes de la requête."
5
+ }
6
+ }
package/locale/ja.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek リクエスト認証",
4
+ "description": "DeepSeek へのリクエストごとに API キーまたはアカウントログインを選び、リクエストヘッダーを提供します。"
5
+ }
6
+ }
package/locale/pt.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Autenticação de solicitações DeepSeek",
4
+ "description": "Escolhe a chave de API ou o login da conta para cada solicitação ao DeepSeek e fornece os cabeçalhos da solicitação."
5
+ }
6
+ }
package/locale/ru.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Аутентификация запросов DeepSeek",
4
+ "description": "Выбирает ключ API или вход в учётную запись для каждого запроса к DeepSeek и предоставляет заголовки запроса."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "DeepSeek 请求鉴权",
4
+ "description": "为发往 DeepSeek 的每个请求选择 API 密钥或账号登录,并提供请求头。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-deepseek-auth",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "DeepSeek request authentication (ctx.deepseekAuth): choose between the API key and the account sign-in for one DeepSeek API request and release its headers",
4
+ "version": "0.2.3-alpha.1",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
11
+ "directory": "packages/account/deepseek-auth"
12
+ },
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./lib/types/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "./types": {
22
+ "types": "./lib/types/types.d.ts",
23
+ "default": "./lib/types/types.js"
24
+ },
25
+ "./src/*": "./src/*",
26
+ "./package.json": "./package.json",
27
+ "./locale/*.json": "./locale/*.json"
28
+ },
29
+ "files": [
30
+ "locale/*.json",
31
+ "lib/index.js",
32
+ "lib/types/**/*.js",
33
+ "lib/types/**/*.d.ts",
34
+ "lib/types/**/*.d.ts.map",
35
+ "lib/**/*.js.map",
36
+ "src"
37
+ ],
38
+ "license": "MIT",
39
+ "peerDependencies": {
40
+ "@deepseek-ai/cordis": "~4.1.0",
41
+ "@deepseek-ai/dsh-credentials": "0.2.3-alpha.1",
42
+ "@deepseek-ai/dsh-deepseek-account": "0.2.3-alpha.1",
43
+ "@deepseek-ai/dsh-error": "0.2.3-alpha.1",
44
+ "@deepseek-ai/dsh-launch-environment": "0.2.3-alpha.1"
45
+ },
46
+ "peerDependenciesMeta": {
47
+ "@deepseek-ai/dsh-deepseek-account": {
48
+ "optional": true
49
+ }
50
+ },
51
+ "devDependencies": {
52
+ "@deepseek-ai/cordis": "~4.1.0",
53
+ "@deepseek-ai/dsh-credentials": "0.2.3-alpha.1",
54
+ "@deepseek-ai/dsh-deepseek-account": "0.2.3-alpha.1",
55
+ "@deepseek-ai/dsh-error": "0.2.3-alpha.1",
56
+ "@deepseek-ai/dsh-launch-environment": "0.2.3-alpha.1"
57
+ }
6
58
  }