@deepseek-ai/dsh-deepseek-account 0.1.7-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.
- package/LICENSE +21 -0
- package/README.i18n.yaml +6 -0
- package/README.md +63 -0
- package/README.zh.md +63 -0
- package/lib/index.js +35 -0
- package/lib/types/index.d.ts +88 -0
- package/lib/types/index.js +36 -0
- package/lib/types/types.d.ts +57 -0
- package/lib/types/types.js +2 -0
- package/package.json +42 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/credentials/deepseek-account/README.md
|
|
5
|
+
README.md: 72b42ee996b809992e48ea4c124f0793d756526a
|
|
6
|
+
README.zh.md: b30813e24adc2afc9e8245b839432dd195093c63
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Account consumers read stored login state, start or cancel a browser login, and sign out without editing API keys. Host model consumers resolve account credentials only for the provider-configured inference origin."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @deepseek-ai/dsh-deepseek-account
|
|
7
|
+
|
|
8
|
+
English | [中文](README.zh.md)
|
|
9
|
+
|
|
10
|
+
getPlatformSession returns a Host-only origin/token snapshot for native Platform embedding, or null when signed out. It is absent from account-controller RPC and Client state. Consumers destroy documents holding a snapshot when the account changes.
|
|
11
|
+
|
|
12
|
+
`desktopClientHeaders` maps the native `darwin` and `win32` platforms to the shared Desktop account and update-policy request header; `null` adds no header.
|
|
13
|
+
|
|
14
|
+
## Summary
|
|
15
|
+
|
|
16
|
+
Account consumers read stored login state, start or cancel a browser login, and sign out without editing API keys. Host model consumers resolve account credentials only for the provider-configured inference origin.
|
|
17
|
+
|
|
18
|
+
## Table of Contents
|
|
19
|
+
|
|
20
|
+
- [Use this package](#use-this-package)
|
|
21
|
+
- [Model Experience](#model-experience)
|
|
22
|
+
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
|
|
23
|
+
|
|
24
|
+
<a id="use-this-package"></a>
|
|
25
|
+
## Use this package
|
|
26
|
+
|
|
27
|
+
`AccountProfile.avatarUrl` is an optional profile image URL; null or absence means no avatar.
|
|
28
|
+
|
|
29
|
+
The service defines account operations and reconnectable state snapshots. The platform provider owns the protocol and stored grant. Credentials are Host-only; the API controller exports state and commands without resolveToken.
|
|
30
|
+
|
|
31
|
+
<a id="understand-the-implementation"></a>
|
|
32
|
+
## Understand the implementation
|
|
33
|
+
|
|
34
|
+
The service defines account operations without maintaining a second credential index; no invariant companion is published. The provider owns persistence and login lifecycle checks.
|
|
35
|
+
|
|
36
|
+
<a id="further-exploration"></a>
|
|
37
|
+
## Further Exploration
|
|
38
|
+
|
|
39
|
+
The [credentials subsystem](../../../docs/subsystems/credentials.md) owns storage APIs; the [architecture](../../../docs/architecture.md) explains application composition.
|
|
40
|
+
|
|
41
|
+
A ready AccountDetails.balance keeps recharge wallets in value and bonus wallets in bonusWallets; both arrays preserve decimal strings and currency. Query failure supplies neither amount.
|
|
42
|
+
|
|
43
|
+
<a id="model-experience"></a>
|
|
44
|
+
## Model Experience
|
|
45
|
+
|
|
46
|
+
None, as account credentials affect HTTP authentication and never enter model prompts, Session logs, or tool results.
|
|
47
|
+
|
|
48
|
+
#### KV Cache effect
|
|
49
|
+
|
|
50
|
+
No model request prefix changes.
|
|
51
|
+
|
|
52
|
+
## Known Limitations and Deferred Work
|
|
53
|
+
|
|
54
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
55
|
+
|
|
56
|
+
- Account tokens have no expiry or refresh flow. Sign-out removes the local grant before background provider revocation; remote logout failures never restore local login. Profile and balance query failures retain the stored grant. getProfile / getBalance reports profile and balance query outcomes independently.
|
|
57
|
+
|
|
58
|
+
<a id="dev-note"></a>
|
|
59
|
+
### Dev Note
|
|
60
|
+
|
|
61
|
+
The [desktop login decision](../../../.agents/notes/implemented/architecture/2026-09-14-deepseek-account-login.md) records cancellation and storage ownership.
|
|
62
|
+
|
|
63
|
+
PlatformSession may carry private deployment requestHeaders from Host to Electron main. Consumers must exclude those headers from renderer bootstrap and restrict them to the configured origin. mergePlatformCookies preserves unrelated cookie pairs while replacing matching names.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "账号使用方可读取本地登录状态、发起或取消浏览器登录,并在保留 API Key 的情况下退出。Host 模型使用方仅能为提供者配置的推理来源解析账号凭证。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @deepseek-ai/dsh-deepseek-account
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
getPlatformSession 为原生 Platform 内嵌提供仅限 Host 的 origin/token 快照,退登时返回 null。账号控制器 RPC 和 Client 状态不包含此方法及快照。账号变化时,使用方销毁持有旧快照的文档。
|
|
11
|
+
|
|
12
|
+
`desktopClientHeaders` 将原生平台 `darwin` 和 `win32` 映射为 Desktop 账号与更新策略请求共用的请求头;`null` 不添加请求头。
|
|
13
|
+
|
|
14
|
+
## 概述
|
|
15
|
+
|
|
16
|
+
账号使用方可读取本地登录状态、发起或取消浏览器登录,并在保留 API Key 的情况下退出。Host 模型使用方仅能为提供者配置的推理来源解析账号凭证。
|
|
17
|
+
|
|
18
|
+
## 目录
|
|
19
|
+
|
|
20
|
+
- [使用此包](#use-this-package)
|
|
21
|
+
- [模型体验](#model-experience)
|
|
22
|
+
- [已知限制与后续工作](#known-limitations-and-deferred-work)
|
|
23
|
+
|
|
24
|
+
<a id="use-this-package"></a>
|
|
25
|
+
## 使用此包
|
|
26
|
+
|
|
27
|
+
`AccountProfile.avatarUrl` 是可选的账号头像 URL;为空或缺失时表示没有头像。
|
|
28
|
+
|
|
29
|
+
该服务定义账号操作和可重连的状态快照。平台提供者负责协议和授权记录。凭证仅限 Host;API 控制器只导出状态与操作,不导出 resolveToken。
|
|
30
|
+
|
|
31
|
+
<a id="understand-the-implementation"></a>
|
|
32
|
+
## 理解实现
|
|
33
|
+
|
|
34
|
+
服务只定义账号操作,不维护第二份凭证索引,因此不发布 invariant。提供者负责持久化和登录生命周期检查。
|
|
35
|
+
|
|
36
|
+
<a id="further-exploration"></a>
|
|
37
|
+
## 深入探索
|
|
38
|
+
|
|
39
|
+
[凭证子系统](../../../docs/subsystems/credentials.zh.md)定义存储接口;[架构](../../../docs/architecture.zh.md)说明应用组合。
|
|
40
|
+
|
|
41
|
+
AccountDetails.balance 就绪时,value 保存充值钱包,bonusWallets 保存赠送钱包;两个数组均保留十进制金额字符串和币种。查询失败不提供金额。
|
|
42
|
+
|
|
43
|
+
<a id="model-experience"></a>
|
|
44
|
+
## 模型体验
|
|
45
|
+
|
|
46
|
+
无,因为账号凭证只影响 HTTP 认证,不进入模型提示、Session 日志或工具结果。
|
|
47
|
+
|
|
48
|
+
#### KV Cache effect
|
|
49
|
+
|
|
50
|
+
不改变模型请求前缀。
|
|
51
|
+
|
|
52
|
+
## 已知限制与后续工作
|
|
53
|
+
|
|
54
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
55
|
+
|
|
56
|
+
- 账号 token 没有过期或刷新流程。退出时先移除本地授权,再由提供者在后台撤销;远程退登失败不会恢复本地登录态。资料和余额查询失败保留已存储授权。getProfile / getBalance 分别报告资料和余额的查询结果。
|
|
57
|
+
|
|
58
|
+
<a id="dev-note"></a>
|
|
59
|
+
### 开发备注
|
|
60
|
+
|
|
61
|
+
[桌面登录决策](../../../.agents/notes/implemented/architecture/2026-09-14-deepseek-account-login.zh.md)记录取消和存储的职责。
|
|
62
|
+
|
|
63
|
+
PlatformSession 可将私有部署 requestHeaders 从 Host 传至 Electron 主进程。消费者必须从渲染层 bootstrap 排除这些请求头,并将其限定于配置来源。mergePlatformCookies 替换同名 Cookie,同时保留其他 Cookie。
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Service } from "@deepseek-ai/cordis";
|
|
2
|
+
//#region lib/types/index.js
|
|
3
|
+
/** Account Service Definition shared by platform, API, and model consumers. */
|
|
4
|
+
/** Account operations; only Host consumers can obtain a request credential. */
|
|
5
|
+
var DeepSeekAccount = class extends Service {
|
|
6
|
+
/** @param ctx - context owning this account implementation. */
|
|
7
|
+
constructor(ctx) {
|
|
8
|
+
super(ctx, "deepseekAccount");
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
/** Merge Cookie header pairs by case-sensitive name, retaining unrelated cookies.
|
|
12
|
+
* @param base - existing request cookies.
|
|
13
|
+
* @param override - deployment cookies whose values take precedence.
|
|
14
|
+
* @returns one Cookie header with at most one pair per name.
|
|
15
|
+
*/
|
|
16
|
+
function mergePlatformCookies(base, override) {
|
|
17
|
+
const cookies = /* @__PURE__ */ new Map();
|
|
18
|
+
for (const header of [base, override]) for (const pair of header.split(";")) {
|
|
19
|
+
const separator = pair.indexOf("=");
|
|
20
|
+
if (separator < 1) continue;
|
|
21
|
+
cookies.set(pair.slice(0, separator).trim(), pair.slice(separator + 1).trim());
|
|
22
|
+
}
|
|
23
|
+
return [...cookies].map(([name, value]) => `${name}=${value}`).join("; ");
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Identify native desktop API requests; null leaves non-desktop requests unchanged.
|
|
27
|
+
* @param platform - Operating system supplied by the desktop composition.
|
|
28
|
+
* @returns Platform request headers shared by account and update-policy clients.
|
|
29
|
+
*/
|
|
30
|
+
function desktopClientHeaders(platform) {
|
|
31
|
+
if (platform === null) return {};
|
|
32
|
+
return { "x-client-platform": platform === "win32" ? "desktop-win" : "desktop-mac" };
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { DeepSeekAccount, DeepSeekAccount as default, desktopClientHeaders, mergePlatformCookies };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/** Account Service Definition shared by platform, API, and model consumers. */
|
|
2
|
+
import { Context, Service } from '@deepseek-ai/cordis';
|
|
3
|
+
import type { AccountDetails, AccountView, SignInAttemptId } from './types.ts';
|
|
4
|
+
export type { AccountDetails, AccountProfile, AccountWallet, AccountLinks, AccountView, SignInAttemptId, SignInAttemptView, SignInErrorCode } from './types.ts';
|
|
5
|
+
declare module '@deepseek-ai/cordis' {
|
|
6
|
+
interface Context {
|
|
7
|
+
deepseekAccount: DeepSeekAccount;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/** Host-only credentials for an embedded Platform document; never expose through account RPC. */
|
|
11
|
+
export interface PlatformSession {
|
|
12
|
+
readonly origin: string;
|
|
13
|
+
readonly token: string;
|
|
14
|
+
/** Optional dist query value selecting the embedded frontend deployment. */
|
|
15
|
+
readonly embeddedPageDist?: string;
|
|
16
|
+
/** Private deployment headers for native requests; excluded from renderer bootstrap. */
|
|
17
|
+
readonly requestHeaders?: Readonly<Record<string, string>>;
|
|
18
|
+
}
|
|
19
|
+
/** Account operations; only Host consumers can obtain a request credential. */
|
|
20
|
+
export declare abstract class DeepSeekAccount extends Service {
|
|
21
|
+
/** @param ctx - context owning this account implementation. */
|
|
22
|
+
constructor(ctx: Context);
|
|
23
|
+
/**
|
|
24
|
+
* Read stored-account presence and the latest login attempt.
|
|
25
|
+
* @returns a snapshot without credentials or PKCE secrets.
|
|
26
|
+
*/
|
|
27
|
+
abstract getState(): Promise<AccountView>;
|
|
28
|
+
/**
|
|
29
|
+
* Query Platform profile independently of wallet balances.
|
|
30
|
+
* @returns profile outcome, or null if signed out or the grant changed during the query.
|
|
31
|
+
*/
|
|
32
|
+
abstract getProfile(): Promise<AccountDetails['profile'] | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Query Platform recharge and bonus wallet balances independently of profile data.
|
|
35
|
+
* @returns balance outcome, or null if signed out or the grant changed during the query.
|
|
36
|
+
*/
|
|
37
|
+
abstract getBalance(): Promise<AccountDetails['balance'] | null>;
|
|
38
|
+
/**
|
|
39
|
+
* Join an active attempt or start browser authorization.
|
|
40
|
+
* @param locale - active UI language for a new attempt; joining retains its original language.
|
|
41
|
+
* @param callbackOrigin - browser-accessible loopback HTTP origin, including any SSH local port.
|
|
42
|
+
* @param loginSource - initiating UI, used to return from a failed exchange.
|
|
43
|
+
* @returns the initial snapshot without waiting for browser approval.
|
|
44
|
+
*/
|
|
45
|
+
abstract startSignIn(locale: string, callbackOrigin: string, loginSource: 'web' | 'desktop'): Promise<AccountView>;
|
|
46
|
+
/**
|
|
47
|
+
* Cancel only the named attempt; committing attempts settle before returning.
|
|
48
|
+
* @param id - attempt identity from this Host.
|
|
49
|
+
* @returns state after cancellation or an already-started commit.
|
|
50
|
+
*/
|
|
51
|
+
abstract cancelSignIn(id: SignInAttemptId): Promise<AccountView>;
|
|
52
|
+
/**
|
|
53
|
+
* Remove the local grant while retaining API keys and tasks; the provider revokes it in the background.
|
|
54
|
+
* @returns the signed-out state after local removal; remote failures never restore the grant.
|
|
55
|
+
*/
|
|
56
|
+
abstract signOut(): Promise<AccountView>;
|
|
57
|
+
/**
|
|
58
|
+
* Subscribe to snapshots including a complete initial state.
|
|
59
|
+
* @param signal - subscription lifetime; ending it never cancels login.
|
|
60
|
+
* @returns complete snapshots as account state changes.
|
|
61
|
+
*/
|
|
62
|
+
abstract watch(signal: AbortSignal): AsyncIterable<AccountView>;
|
|
63
|
+
/**
|
|
64
|
+
* Resolve a credential only for the inference origin allowed by the provider.
|
|
65
|
+
* @param url - actual request destination or API base URL.
|
|
66
|
+
* @returns stored token, or undefined for other origins or a signed-out account.
|
|
67
|
+
*/
|
|
68
|
+
abstract resolveToken(url: string): Promise<string | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* Read credentials for the configured Platform origin, bound to their issuing environment.
|
|
71
|
+
* @returns a Host-only snapshot, or null while signed out.
|
|
72
|
+
*/
|
|
73
|
+
abstract getPlatformSession(): Promise<PlatformSession | null>;
|
|
74
|
+
}
|
|
75
|
+
export default DeepSeekAccount;
|
|
76
|
+
/** Merge Cookie header pairs by case-sensitive name, retaining unrelated cookies.
|
|
77
|
+
* @param base - existing request cookies.
|
|
78
|
+
* @param override - deployment cookies whose values take precedence.
|
|
79
|
+
* @returns one Cookie header with at most one pair per name.
|
|
80
|
+
*/
|
|
81
|
+
export declare function mergePlatformCookies(base: string, override: string): string;
|
|
82
|
+
/**
|
|
83
|
+
* Identify native desktop API requests; null leaves non-desktop requests unchanged.
|
|
84
|
+
* @param platform - Operating system supplied by the desktop composition.
|
|
85
|
+
* @returns Platform request headers shared by account and update-policy clients.
|
|
86
|
+
*/
|
|
87
|
+
export declare function desktopClientHeaders(platform: 'darwin' | 'win32' | null): Record<string, string>;
|
|
88
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Account Service Definition shared by platform, API, and model consumers. */
|
|
2
|
+
import { Service } from '@deepseek-ai/cordis';
|
|
3
|
+
/** Account operations; only Host consumers can obtain a request credential. */
|
|
4
|
+
export class DeepSeekAccount extends Service {
|
|
5
|
+
/** @param ctx - context owning this account implementation. */
|
|
6
|
+
constructor(ctx) { super(ctx, 'deepseekAccount'); }
|
|
7
|
+
}
|
|
8
|
+
export default DeepSeekAccount;
|
|
9
|
+
/** Merge Cookie header pairs by case-sensitive name, retaining unrelated cookies.
|
|
10
|
+
* @param base - existing request cookies.
|
|
11
|
+
* @param override - deployment cookies whose values take precedence.
|
|
12
|
+
* @returns one Cookie header with at most one pair per name.
|
|
13
|
+
*/
|
|
14
|
+
export function mergePlatformCookies(base, override) {
|
|
15
|
+
const cookies = new Map();
|
|
16
|
+
for (const header of [base, override]) {
|
|
17
|
+
for (const pair of header.split(';')) {
|
|
18
|
+
const separator = pair.indexOf('=');
|
|
19
|
+
if (separator < 1)
|
|
20
|
+
continue;
|
|
21
|
+
cookies.set(pair.slice(0, separator).trim(), pair.slice(separator + 1).trim());
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return [...cookies].map(([name, value]) => `${name}=${value}`).join('; ');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Identify native desktop API requests; null leaves non-desktop requests unchanged.
|
|
28
|
+
* @param platform - Operating system supplied by the desktop composition.
|
|
29
|
+
* @returns Platform request headers shared by account and update-policy clients.
|
|
30
|
+
*/
|
|
31
|
+
export function desktopClientHeaders(platform) {
|
|
32
|
+
if (platform === null)
|
|
33
|
+
return {};
|
|
34
|
+
return { 'x-client-platform': platform === 'win32' ? 'desktop-win' : 'desktop-mac' };
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** Client-safe account state; credentials never cross this projection. */
|
|
2
|
+
import type { Branded } from '@deepseek-ai/dsh-brand';
|
|
3
|
+
/** Identity of one local login attempt, unrelated to the platform request ID. */
|
|
4
|
+
export type SignInAttemptId = Branded<'SignInAttemptId'>;
|
|
5
|
+
/** Safe failure codes rendered through the caller's locale dictionary. */
|
|
6
|
+
export type SignInErrorCode = 'network' | 'protocol' | 'expired' | 'storage';
|
|
7
|
+
/** Latest login attempt, including terminal outcomes until the next attempt. */
|
|
8
|
+
export interface SignInAttemptView {
|
|
9
|
+
readonly id: SignInAttemptId;
|
|
10
|
+
readonly phase: 'initializing' | 'waiting-browser' | 'exchanging' | 'committing' | 'succeeded' | 'cancelled' | 'expired' | 'failed';
|
|
11
|
+
readonly authorizeUrl?: string;
|
|
12
|
+
readonly expiresAt?: number;
|
|
13
|
+
readonly errorCode?: SignInErrorCode;
|
|
14
|
+
}
|
|
15
|
+
/** Browser destinations derived from the Host's platform configuration; never carry tokens. */
|
|
16
|
+
export interface AccountLinks {
|
|
17
|
+
readonly usageUrl: string;
|
|
18
|
+
readonly topUpUrl: string;
|
|
19
|
+
}
|
|
20
|
+
/** Stored-account presence is not a claim that the server has validated its token. */
|
|
21
|
+
export interface AccountView {
|
|
22
|
+
readonly status: 'signed-out' | 'credential-stored';
|
|
23
|
+
readonly links: AccountLinks;
|
|
24
|
+
readonly attempt: SignInAttemptView | null;
|
|
25
|
+
}
|
|
26
|
+
/** Platform account identifier supplied by the current-user endpoint. */
|
|
27
|
+
export type AccountUserId = Branded<'AccountUserId'>;
|
|
28
|
+
/** Display identity and support UID; contacts retain Platform masking. */
|
|
29
|
+
export interface AccountProfile {
|
|
30
|
+
readonly id: AccountUserId | null;
|
|
31
|
+
readonly name: string | null;
|
|
32
|
+
readonly contact: string | null;
|
|
33
|
+
/** Profile image URL supplied by Platform, absent when no picture is configured. */
|
|
34
|
+
readonly avatarUrl?: string | null;
|
|
35
|
+
}
|
|
36
|
+
/** Platform recharge or bonus wallet balance; decimal strings retain server precision. */
|
|
37
|
+
export interface AccountWallet {
|
|
38
|
+
readonly currency: 'CNY' | 'USD';
|
|
39
|
+
readonly balance: string;
|
|
40
|
+
}
|
|
41
|
+
/** Independent query outcomes allow profile and balance failures to render separately. */
|
|
42
|
+
export interface AccountDetails {
|
|
43
|
+
readonly profile: {
|
|
44
|
+
readonly status: 'ready';
|
|
45
|
+
readonly value: AccountProfile;
|
|
46
|
+
} | {
|
|
47
|
+
readonly status: 'failed';
|
|
48
|
+
};
|
|
49
|
+
readonly balance: {
|
|
50
|
+
readonly status: 'ready';
|
|
51
|
+
readonly value: readonly AccountWallet[];
|
|
52
|
+
readonly bonusWallets: readonly AccountWallet[];
|
|
53
|
+
} | {
|
|
54
|
+
readonly status: 'failed';
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/dsh-deepseek-account",
|
|
3
|
+
"description": "Read account state and resolve official API credentials",
|
|
4
|
+
"version": "0.1.7-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/credentials/deepseek-account"
|
|
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
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"lib/index.js",
|
|
30
|
+
"lib/types/**/*.js",
|
|
31
|
+
"lib/types/**/*.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@deepseek-ai/cordis": "^4.0.3",
|
|
36
|
+
"@deepseek-ai/dsh-brand": "^0.1.7-alpha.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@deepseek-ai/cordis": "^4.0.3",
|
|
40
|
+
"@deepseek-ai/dsh-brand": "^0.1.7-alpha.1"
|
|
41
|
+
}
|
|
42
|
+
}
|