@deepseek-ai/dsh-api-account-controller 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 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.
@@ -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/api/account-controller/README.md
5
+ README.md: eb6ef47f91d372a5a7ff895f343ff4a3dcfceb8d
6
+ README.zh.md: 3ab666d576e8c1d10b7f439f818a45d8a4ae23b6
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: "Account screens use authenticated Remote commands and a snapshot stream. The controller exposes login state without returning tokens or PKCE secrets."
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-api-account-controller
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ Account screens use authenticated Remote commands and a snapshot stream. The controller exposes login state without returning tokens or PKCE secrets.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Model Experience](#model-experience)
18
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
19
+
20
+ <a id="use-this-package"></a>
21
+ ## Use this package
22
+
23
+ The account namespace exposes getState, getProfile / getBalance, startSignIn, cancelSignIn, signOut, and watch. watch emits an initial complete state and subsequent complete states; disconnecting stops observation, not the login attempt. Cancellation names the attempt ID so a stale screen cannot cancel a newer login.
24
+
25
+ <a id="understand-the-implementation"></a>
26
+ ## Understand the implementation
27
+
28
+ The controller forwards operations to the account service and maintains no independent account state; no invariant companion is published.
29
+
30
+ <a id="further-exploration"></a>
31
+ ## Further Exploration
32
+
33
+ The [credentials subsystem](../../../docs/subsystems/credentials.md) owns storage APIs; the [architecture](../../../docs/architecture.md) explains application composition.
34
+
35
+ <a id="model-experience"></a>
36
+ ## Model Experience
37
+
38
+ None, as account credentials affect HTTP authentication and never enter model prompts, Session logs, or tool results.
39
+
40
+ #### KV Cache effect
41
+
42
+ No model request prefix changes.
43
+
44
+ ## Known Limitations and Deferred Work
45
+
46
+ <a id="known-limitations-and-deferred-work"></a>
47
+
48
+ - A disconnected UI can recover account state through watch, but cannot resume an attempt after the Host exits. Credentials and request-token resolution are not Remote operations.
49
+
50
+ <a id="dev-note"></a>
51
+ ### Dev Note
52
+
53
+ The [desktop login decision](../../../.agents/notes/implemented/architecture/2026-09-14-deepseek-account-login.md) records cancellation and storage ownership.
package/README.zh.md ADDED
@@ -0,0 +1,53 @@
1
+ ---
2
+ description: "账号页面使用经过认证的 Remote 操作和快照流。控制器提供登录状态,不返回 token 或 PKCE 私密数据。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-api-account-controller
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ 账号页面使用经过认证的 Remote 操作和快照流。控制器提供登录状态,不返回 token 或 PKCE 私密数据。
13
+
14
+ ## 目录
15
+
16
+ - [使用此包](#use-this-package)
17
+ - [模型体验](#model-experience)
18
+ - [已知限制与后续工作](#known-limitations-and-deferred-work)
19
+
20
+ <a id="use-this-package"></a>
21
+ ## 使用此包
22
+
23
+ account 命名空间提供 getState、getProfile / getBalance、startSignIn、cancelSignIn、signOut 和 watch。watch 先发送完整初始状态,随后发送完整状态变化;断开连接只停止观察,不取消登录。取消操作必须指定尝试 ID,防止旧页面取消新登录。
24
+
25
+ <a id="understand-the-implementation"></a>
26
+ ## 理解实现
27
+
28
+ 控制器向账号服务转发操作,不维护独立的账号状态,因此不发布 invariant。
29
+
30
+ <a id="further-exploration"></a>
31
+ ## 深入探索
32
+
33
+ [凭证子系统](../../../docs/subsystems/credentials.zh.md)定义存储接口;[架构](../../../docs/architecture.zh.md)说明应用组合。
34
+
35
+ <a id="model-experience"></a>
36
+ ## 模型体验
37
+
38
+ 无,因为账号凭证只影响 HTTP 认证,不进入模型提示、Session 日志或工具结果。
39
+
40
+ #### KV Cache effect
41
+
42
+ 不改变模型请求前缀。
43
+
44
+ ## 已知限制与后续工作
45
+
46
+ <a id="known-limitations-and-deferred-work"></a>
47
+
48
+ - UI 断线后可通过 watch 恢复状态,但不能在 Host 退出后恢复登录尝试。凭证和请求 token 解析不对 Remote 暴露。
49
+
50
+ <a id="dev-note"></a>
51
+ ### 开发备注
52
+
53
+ [桌面登录决策](../../../.agents/notes/implemented/architecture/2026-09-14-deepseek-account-login.zh.md)记录取消和存储的职责。
package/lib/index.js ADDED
@@ -0,0 +1,209 @@
1
+ import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
2
+ //#region lib/types/index.js
3
+ var __runInitializers = function(thisArg, initializers, value) {
4
+ var useValue = arguments.length > 2;
5
+ for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) {
10
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
11
+ return f;
12
+ }
13
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
14
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
15
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
16
+ var _, done = false;
17
+ for (var i = decorators.length - 1; i >= 0; i--) {
18
+ var context = {};
19
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
20
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
21
+ context.addInitializer = function(f) {
22
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
23
+ extraInitializers.push(accept(f || null));
24
+ };
25
+ var result = (0, decorators[i])(kind === "accessor" ? {
26
+ get: descriptor.get,
27
+ set: descriptor.set
28
+ } : descriptor[key], context);
29
+ if (kind === "accessor") {
30
+ if (result === void 0) continue;
31
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
32
+ if (_ = accept(result.get)) descriptor.get = _;
33
+ if (_ = accept(result.set)) descriptor.set = _;
34
+ if (_ = accept(result.init)) initializers.unshift(_);
35
+ } else if (_ = accept(result)) if (kind === "field") initializers.unshift(_);
36
+ else descriptor[key] = _;
37
+ }
38
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
39
+ done = true;
40
+ };
41
+ /** Account commands and reconnect-safe state stream. */
42
+ let AccountController = (() => {
43
+ let _classSuper = TypertRemoteService;
44
+ let _instanceExtraInitializers = [];
45
+ let _getState_decorators;
46
+ let _getProfile_decorators;
47
+ let _getBalance_decorators;
48
+ let _startSignIn_decorators;
49
+ let _cancelSignIn_decorators;
50
+ let _signOut_decorators;
51
+ let _watch_decorators;
52
+ return class AccountController extends _classSuper {
53
+ static {
54
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
55
+ _getState_decorators = [Remote];
56
+ _getProfile_decorators = [Remote];
57
+ _getBalance_decorators = [Remote];
58
+ _startSignIn_decorators = [Remote];
59
+ _cancelSignIn_decorators = [Remote];
60
+ _signOut_decorators = [Remote];
61
+ _watch_decorators = [Remote({ mode: "stream" })];
62
+ __esDecorate(this, null, _getState_decorators, {
63
+ kind: "method",
64
+ name: "getState",
65
+ static: false,
66
+ private: false,
67
+ access: {
68
+ has: (obj) => "getState" in obj,
69
+ get: (obj) => obj.getState
70
+ },
71
+ metadata: _metadata
72
+ }, null, _instanceExtraInitializers);
73
+ __esDecorate(this, null, _getProfile_decorators, {
74
+ kind: "method",
75
+ name: "getProfile",
76
+ static: false,
77
+ private: false,
78
+ access: {
79
+ has: (obj) => "getProfile" in obj,
80
+ get: (obj) => obj.getProfile
81
+ },
82
+ metadata: _metadata
83
+ }, null, _instanceExtraInitializers);
84
+ __esDecorate(this, null, _getBalance_decorators, {
85
+ kind: "method",
86
+ name: "getBalance",
87
+ static: false,
88
+ private: false,
89
+ access: {
90
+ has: (obj) => "getBalance" in obj,
91
+ get: (obj) => obj.getBalance
92
+ },
93
+ metadata: _metadata
94
+ }, null, _instanceExtraInitializers);
95
+ __esDecorate(this, null, _startSignIn_decorators, {
96
+ kind: "method",
97
+ name: "startSignIn",
98
+ static: false,
99
+ private: false,
100
+ access: {
101
+ has: (obj) => "startSignIn" in obj,
102
+ get: (obj) => obj.startSignIn
103
+ },
104
+ metadata: _metadata
105
+ }, null, _instanceExtraInitializers);
106
+ __esDecorate(this, null, _cancelSignIn_decorators, {
107
+ kind: "method",
108
+ name: "cancelSignIn",
109
+ static: false,
110
+ private: false,
111
+ access: {
112
+ has: (obj) => "cancelSignIn" in obj,
113
+ get: (obj) => obj.cancelSignIn
114
+ },
115
+ metadata: _metadata
116
+ }, null, _instanceExtraInitializers);
117
+ __esDecorate(this, null, _signOut_decorators, {
118
+ kind: "method",
119
+ name: "signOut",
120
+ static: false,
121
+ private: false,
122
+ access: {
123
+ has: (obj) => "signOut" in obj,
124
+ get: (obj) => obj.signOut
125
+ },
126
+ metadata: _metadata
127
+ }, null, _instanceExtraInitializers);
128
+ __esDecorate(this, null, _watch_decorators, {
129
+ kind: "method",
130
+ name: "watch",
131
+ static: false,
132
+ private: false,
133
+ access: {
134
+ has: (obj) => "watch" in obj,
135
+ get: (obj) => obj.watch
136
+ },
137
+ metadata: _metadata
138
+ }, null, _instanceExtraInitializers);
139
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, {
140
+ enumerable: true,
141
+ configurable: true,
142
+ writable: true,
143
+ value: _metadata
144
+ });
145
+ }
146
+ static inject = ["deepseekAccount"];
147
+ /** @param ctx - Host with the account provider mounted. */
148
+ constructor(ctx) {
149
+ super(ctx, "accountController", { namespace: "account" });
150
+ __runInitializers(this, _instanceExtraInitializers);
151
+ }
152
+ /**
153
+ * Read the safe account projection.
154
+ * @returns current account and attempt state.
155
+ */
156
+ getState() {
157
+ return this.ctx.deepseekAccount.getState();
158
+ }
159
+ /**
160
+ * Query display-safe Platform profile data.
161
+ * @returns profile outcome, or null when the account grant is absent or changed.
162
+ */
163
+ getProfile() {
164
+ return this.ctx.deepseekAccount.getProfile();
165
+ }
166
+ /**
167
+ * Query Platform recharge-wallet balances.
168
+ * @returns balance outcome, or null when the account grant is absent or changed.
169
+ */
170
+ getBalance() {
171
+ return this.ctx.deepseekAccount.getBalance();
172
+ }
173
+ /**
174
+ * Begin browser sign-in.
175
+ * @param locale - active UI language for a new attempt.
176
+ * @param callbackOrigin - browser-accessible loopback HTTP origin.
177
+ * @param loginSource - initiating UI, used to return from a failed exchange.
178
+ * @returns a new or already-active login attempt.
179
+ */
180
+ startSignIn(locale, callbackOrigin, loginSource) {
181
+ return this.ctx.deepseekAccount.startSignIn(locale, callbackOrigin, loginSource);
182
+ }
183
+ /**
184
+ * Cancel the named local attempt.
185
+ * @param attemptId - attempt to cancel.
186
+ * @returns settled cancellation or commit state.
187
+ */
188
+ cancelSignIn(attemptId) {
189
+ return this.ctx.deepseekAccount.cancelSignIn(attemptId);
190
+ }
191
+ /**
192
+ * Remove the local account grant and revoke it through Platform in the background, without deleting API keys.
193
+ * @returns state after removing the local account grant.
194
+ */
195
+ signOut() {
196
+ return this.ctx.deepseekAccount.signOut();
197
+ }
198
+ /**
199
+ * Stream the safe account projection.
200
+ * @param signal - stream lifetime.
201
+ * @returns initial snapshot and subsequent changes.
202
+ */
203
+ watch(signal) {
204
+ return this.ctx.deepseekAccount.watch(signal);
205
+ }
206
+ };
207
+ })();
208
+ //#endregion
209
+ export { AccountController, AccountController as default };
@@ -0,0 +1,3 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+
3
+ export declare const TYPERT: unknown
@@ -0,0 +1,273 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ let _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_parameter_0$schema$value
5
+ const _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_parameter_0$schema = () => (_deepseek_ai_dsh_api_account_controller_account_cancelSignIn_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
6
+ let _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_result$schema$value
7
+ const _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_cancelSignIn_result$schema$value ??= z.object({
8
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
9
+ 'links': z.object({
10
+ 'usageUrl': z.string().readonly(),
11
+ 'topUpUrl': z.string().readonly(),
12
+ }).readonly(),
13
+ 'attempt': z.union([z.literal(null), z.object({
14
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
15
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
16
+ 'authorizeUrl': z.string().readonly().optional(),
17
+ 'expiresAt': z.number().readonly().optional(),
18
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
19
+ })]).readonly(),
20
+ }))
21
+ let _deepseek_ai_dsh_api_account_controller_account_getBalance_result$schema$value
22
+ const _deepseek_ai_dsh_api_account_controller_account_getBalance_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_getBalance_result$schema$value ??= z.union([z.literal(null), z.object({
23
+ 'status': z.literal("ready").readonly(),
24
+ 'value': z.array(z.object({
25
+ 'currency': z.union([z.literal("CNY"), z.literal("USD")]).readonly(),
26
+ 'balance': z.string().readonly(),
27
+ })).readonly(),
28
+ 'bonusWallets': z.array(z.object({
29
+ 'currency': z.union([z.literal("CNY"), z.literal("USD")]).readonly(),
30
+ 'balance': z.string().readonly(),
31
+ })).readonly(),
32
+ }), z.object({
33
+ 'status': z.literal("failed").readonly(),
34
+ })]))
35
+ let _deepseek_ai_dsh_api_account_controller_account_getProfile_result$schema$value
36
+ const _deepseek_ai_dsh_api_account_controller_account_getProfile_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_getProfile_result$schema$value ??= z.union([z.literal(null), z.object({
37
+ 'status': z.literal("ready").readonly(),
38
+ 'value': z.object({
39
+ 'id': z.union([z.literal(null), z.intersection(z.string(), z.unknown())]).readonly(),
40
+ 'name': z.union([z.literal(null), z.string()]).readonly(),
41
+ 'contact': z.union([z.literal(null), z.string()]).readonly(),
42
+ 'avatarUrl': z.union([z.literal(null), z.string()]).readonly().optional(),
43
+ }).readonly(),
44
+ }), z.object({
45
+ 'status': z.literal("failed").readonly(),
46
+ })]))
47
+ let _deepseek_ai_dsh_api_account_controller_account_getState_result$schema$value
48
+ const _deepseek_ai_dsh_api_account_controller_account_getState_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_getState_result$schema$value ??= z.object({
49
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
50
+ 'links': z.object({
51
+ 'usageUrl': z.string().readonly(),
52
+ 'topUpUrl': z.string().readonly(),
53
+ }).readonly(),
54
+ 'attempt': z.union([z.literal(null), z.object({
55
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
56
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
57
+ 'authorizeUrl': z.string().readonly().optional(),
58
+ 'expiresAt': z.number().readonly().optional(),
59
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
60
+ })]).readonly(),
61
+ }))
62
+ let _deepseek_ai_dsh_api_account_controller_account_signOut_result$schema$value
63
+ const _deepseek_ai_dsh_api_account_controller_account_signOut_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_signOut_result$schema$value ??= z.object({
64
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
65
+ 'links': z.object({
66
+ 'usageUrl': z.string().readonly(),
67
+ 'topUpUrl': z.string().readonly(),
68
+ }).readonly(),
69
+ 'attempt': z.union([z.literal(null), z.object({
70
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
71
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
72
+ 'authorizeUrl': z.string().readonly().optional(),
73
+ 'expiresAt': z.number().readonly().optional(),
74
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
75
+ })]).readonly(),
76
+ }))
77
+ let _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_0$schema$value
78
+ const _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_0$schema = () => (_deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_0$schema$value ??= z.string())
79
+ let _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_1$schema$value
80
+ const _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_1$schema = () => (_deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_1$schema$value ??= z.string())
81
+ let _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_2$schema$value
82
+ const _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_2$schema = () => (_deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_2$schema$value ??= z.union([z.literal("web"), z.literal("desktop")]))
83
+ let _deepseek_ai_dsh_api_account_controller_account_startSignIn_result$schema$value
84
+ const _deepseek_ai_dsh_api_account_controller_account_startSignIn_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_startSignIn_result$schema$value ??= z.object({
85
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
86
+ 'links': z.object({
87
+ 'usageUrl': z.string().readonly(),
88
+ 'topUpUrl': z.string().readonly(),
89
+ }).readonly(),
90
+ 'attempt': z.union([z.literal(null), z.object({
91
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
92
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
93
+ 'authorizeUrl': z.string().readonly().optional(),
94
+ 'expiresAt': z.number().readonly().optional(),
95
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
96
+ })]).readonly(),
97
+ }))
98
+ let _deepseek_ai_dsh_api_account_controller_account_watch_result$schema$value
99
+ const _deepseek_ai_dsh_api_account_controller_account_watch_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_watch_result$schema$value ??= z.object({
100
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
101
+ 'links': z.object({
102
+ 'usageUrl': z.string().readonly(),
103
+ 'topUpUrl': z.string().readonly(),
104
+ }).readonly(),
105
+ 'attempt': z.union([z.literal(null), z.object({
106
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
107
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
108
+ 'authorizeUrl': z.string().readonly().optional(),
109
+ 'expiresAt': z.number().readonly().optional(),
110
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
111
+ })]).readonly(),
112
+ }))
113
+
114
+ export const TYPERT = {
115
+ package: '@deepseek-ai/dsh-api-account-controller',
116
+ face: 'host',
117
+ schemas: [
118
+ ],
119
+ invocations: [
120
+ {
121
+ id: '@deepseek-ai/dsh-api-account-controller#account/cancelSignIn',
122
+ service: 'accountController',
123
+ namespace: 'account',
124
+ method: 'cancelSignIn',
125
+ invocation: { kind: 'direct' },
126
+ parameters: [
127
+ {
128
+ name: 'attemptId',
129
+ wire: 'attemptId',
130
+ source: 'json',
131
+ codec: {
132
+ mode: 'strict',
133
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#SignInAttemptId',
134
+ create: _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_parameter_0$schema,
135
+ },
136
+ },
137
+ ],
138
+ result: {
139
+ mode: 'strict',
140
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
141
+ create: _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_result$schema,
142
+ },
143
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":46,"column":3},
144
+ },
145
+ {
146
+ id: '@deepseek-ai/dsh-api-account-controller#account/getBalance',
147
+ service: 'accountController',
148
+ namespace: 'account',
149
+ method: 'getBalance',
150
+ invocation: { kind: 'direct' },
151
+ parameters: [
152
+ ],
153
+ result: {
154
+ mode: 'strict',
155
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/getBalance:result',
156
+ create: _deepseek_ai_dsh_api_account_controller_account_getBalance_result$schema,
157
+ },
158
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":30,"column":3},
159
+ },
160
+ {
161
+ id: '@deepseek-ai/dsh-api-account-controller#account/getProfile',
162
+ service: 'accountController',
163
+ namespace: 'account',
164
+ method: 'getProfile',
165
+ invocation: { kind: 'direct' },
166
+ parameters: [
167
+ ],
168
+ result: {
169
+ mode: 'strict',
170
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/getProfile:result',
171
+ create: _deepseek_ai_dsh_api_account_controller_account_getProfile_result$schema,
172
+ },
173
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":24,"column":3},
174
+ },
175
+ {
176
+ id: '@deepseek-ai/dsh-api-account-controller#account/getState',
177
+ service: 'accountController',
178
+ namespace: 'account',
179
+ method: 'getState',
180
+ invocation: { kind: 'direct' },
181
+ parameters: [
182
+ ],
183
+ result: {
184
+ mode: 'strict',
185
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
186
+ create: _deepseek_ai_dsh_api_account_controller_account_getState_result$schema,
187
+ },
188
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":18,"column":3},
189
+ },
190
+ {
191
+ id: '@deepseek-ai/dsh-api-account-controller#account/signOut',
192
+ service: 'accountController',
193
+ namespace: 'account',
194
+ method: 'signOut',
195
+ invocation: { kind: 'direct' },
196
+ parameters: [
197
+ ],
198
+ result: {
199
+ mode: 'strict',
200
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
201
+ create: _deepseek_ai_dsh_api_account_controller_account_signOut_result$schema,
202
+ },
203
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":52,"column":3},
204
+ },
205
+ {
206
+ id: '@deepseek-ai/dsh-api-account-controller#account/startSignIn',
207
+ service: 'accountController',
208
+ namespace: 'account',
209
+ method: 'startSignIn',
210
+ invocation: { kind: 'direct' },
211
+ parameters: [
212
+ {
213
+ name: 'locale',
214
+ wire: 'locale',
215
+ source: 'json',
216
+ codec: {
217
+ mode: 'strict',
218
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/startSignIn:locale',
219
+ create: _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_0$schema,
220
+ },
221
+ },
222
+ {
223
+ name: 'callbackOrigin',
224
+ wire: 'callbackOrigin',
225
+ source: 'json',
226
+ codec: {
227
+ mode: 'strict',
228
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/startSignIn:callbackOrigin',
229
+ create: _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_1$schema,
230
+ },
231
+ },
232
+ {
233
+ name: 'loginSource',
234
+ wire: 'loginSource',
235
+ source: 'json',
236
+ codec: {
237
+ mode: 'strict',
238
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/startSignIn:loginSource',
239
+ create: _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_2$schema,
240
+ },
241
+ },
242
+ ],
243
+ result: {
244
+ mode: 'strict',
245
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
246
+ create: _deepseek_ai_dsh_api_account_controller_account_startSignIn_result$schema,
247
+ },
248
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":39,"column":3},
249
+ },
250
+ {
251
+ id: '@deepseek-ai/dsh-api-account-controller#account/watch',
252
+ service: 'accountController',
253
+ namespace: 'account',
254
+ method: 'watch',
255
+ mode: 'stream',
256
+ invocation: { kind: 'direct' },
257
+ parameters: [
258
+ ],
259
+ cancellation: { parameter: 'signal' },
260
+ result: {
261
+ mode: 'strict',
262
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
263
+ create: _deepseek_ai_dsh_api_account_controller_account_watch_result$schema,
264
+ },
265
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":59,"column":3},
266
+ },
267
+ ],
268
+ model: {
269
+ "services": [],
270
+ "events": [],
271
+ "objects": []
272
+ },
273
+ }
@@ -0,0 +1,35 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import type {
3
+ RemoteResult,
4
+ RemoteStreamHandle,
5
+ TypertRemoteContribution,
6
+ } from '@deepseek-ai/dsh-typert-protocol'
7
+ import type { AccountDetails, AccountView, SignInAttemptId } from '@deepseek-ai/dsh-deepseek-account/types'
8
+
9
+ declare module '@deepseek-ai/dsh-typert-protocol' {
10
+ interface TypertRemoteNamespace$6163636f756e74 {
11
+ cancelSignIn: (attemptId: SignInAttemptId) => Promise<RemoteResult<AccountView>>
12
+ getBalance: () => Promise<RemoteResult<AccountDetails['balance'] | null>>
13
+ getProfile: () => Promise<RemoteResult<AccountDetails['profile'] | null>>
14
+ getState: () => Promise<RemoteResult<AccountView>>
15
+ signOut: () => Promise<RemoteResult<AccountView>>
16
+ startSignIn: (locale: string, callbackOrigin: string, loginSource: 'web' | 'desktop') => Promise<RemoteResult<AccountView>>
17
+ watch: (signal?: AbortSignal) => RemoteStreamHandle<AccountView, never>
18
+ }
19
+ interface TypertRemoteMap {
20
+ 'account/cancelSignIn': (attemptId: SignInAttemptId) => Promise<RemoteResult<AccountView>>
21
+ 'account/getBalance': () => Promise<RemoteResult<AccountDetails['balance'] | null>>
22
+ 'account/getProfile': () => Promise<RemoteResult<AccountDetails['profile'] | null>>
23
+ 'account/getState': () => Promise<RemoteResult<AccountView>>
24
+ 'account/signOut': () => Promise<RemoteResult<AccountView>>
25
+ 'account/startSignIn': (locale: string, callbackOrigin: string, loginSource: 'web' | 'desktop') => Promise<RemoteResult<AccountView>>
26
+ 'account/watch': (signal?: AbortSignal) => RemoteStreamHandle<AccountView, never>
27
+ }
28
+ interface TypertRemoteNamespaceMap {
29
+ 'account': TypertRemoteNamespace$6163636f756e74
30
+ }
31
+ }
32
+
33
+ export declare const TYPERT_REMOTE: TypertRemoteContribution
34
+ export default TYPERT_REMOTE
35
+ //# sourceMappingURL=typert.remote-client.d.ts.map
@@ -0,0 +1,267 @@
1
+ /* Generated by @deepseek-ai/dsh-typert-generator from the Host FaceModel — do not edit. */
2
+ import { z } from 'zod'
3
+
4
+ let _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_parameter_0$schema$value
5
+ const _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_parameter_0$schema = () => (_deepseek_ai_dsh_api_account_controller_account_cancelSignIn_parameter_0$schema$value ??= z.intersection(z.string(), z.unknown()))
6
+ let _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_result$schema$value
7
+ const _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_cancelSignIn_result$schema$value ??= z.object({
8
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
9
+ 'links': z.object({
10
+ 'usageUrl': z.string().readonly(),
11
+ 'topUpUrl': z.string().readonly(),
12
+ }).readonly(),
13
+ 'attempt': z.union([z.literal(null), z.object({
14
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
15
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
16
+ 'authorizeUrl': z.string().readonly().optional(),
17
+ 'expiresAt': z.number().readonly().optional(),
18
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
19
+ })]).readonly(),
20
+ }))
21
+ let _deepseek_ai_dsh_api_account_controller_account_getBalance_result$schema$value
22
+ const _deepseek_ai_dsh_api_account_controller_account_getBalance_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_getBalance_result$schema$value ??= z.union([z.literal(null), z.object({
23
+ 'status': z.literal("ready").readonly(),
24
+ 'value': z.array(z.object({
25
+ 'currency': z.union([z.literal("CNY"), z.literal("USD")]).readonly(),
26
+ 'balance': z.string().readonly(),
27
+ })).readonly(),
28
+ 'bonusWallets': z.array(z.object({
29
+ 'currency': z.union([z.literal("CNY"), z.literal("USD")]).readonly(),
30
+ 'balance': z.string().readonly(),
31
+ })).readonly(),
32
+ }), z.object({
33
+ 'status': z.literal("failed").readonly(),
34
+ })]))
35
+ let _deepseek_ai_dsh_api_account_controller_account_getProfile_result$schema$value
36
+ const _deepseek_ai_dsh_api_account_controller_account_getProfile_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_getProfile_result$schema$value ??= z.union([z.literal(null), z.object({
37
+ 'status': z.literal("ready").readonly(),
38
+ 'value': z.object({
39
+ 'id': z.union([z.literal(null), z.intersection(z.string(), z.unknown())]).readonly(),
40
+ 'name': z.union([z.literal(null), z.string()]).readonly(),
41
+ 'contact': z.union([z.literal(null), z.string()]).readonly(),
42
+ 'avatarUrl': z.union([z.literal(null), z.string()]).readonly().optional(),
43
+ }).readonly(),
44
+ }), z.object({
45
+ 'status': z.literal("failed").readonly(),
46
+ })]))
47
+ let _deepseek_ai_dsh_api_account_controller_account_getState_result$schema$value
48
+ const _deepseek_ai_dsh_api_account_controller_account_getState_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_getState_result$schema$value ??= z.object({
49
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
50
+ 'links': z.object({
51
+ 'usageUrl': z.string().readonly(),
52
+ 'topUpUrl': z.string().readonly(),
53
+ }).readonly(),
54
+ 'attempt': z.union([z.literal(null), z.object({
55
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
56
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
57
+ 'authorizeUrl': z.string().readonly().optional(),
58
+ 'expiresAt': z.number().readonly().optional(),
59
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
60
+ })]).readonly(),
61
+ }))
62
+ let _deepseek_ai_dsh_api_account_controller_account_signOut_result$schema$value
63
+ const _deepseek_ai_dsh_api_account_controller_account_signOut_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_signOut_result$schema$value ??= z.object({
64
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
65
+ 'links': z.object({
66
+ 'usageUrl': z.string().readonly(),
67
+ 'topUpUrl': z.string().readonly(),
68
+ }).readonly(),
69
+ 'attempt': z.union([z.literal(null), z.object({
70
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
71
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
72
+ 'authorizeUrl': z.string().readonly().optional(),
73
+ 'expiresAt': z.number().readonly().optional(),
74
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
75
+ })]).readonly(),
76
+ }))
77
+ let _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_0$schema$value
78
+ const _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_0$schema = () => (_deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_0$schema$value ??= z.string())
79
+ let _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_1$schema$value
80
+ const _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_1$schema = () => (_deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_1$schema$value ??= z.string())
81
+ let _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_2$schema$value
82
+ const _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_2$schema = () => (_deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_2$schema$value ??= z.union([z.literal("web"), z.literal("desktop")]))
83
+ let _deepseek_ai_dsh_api_account_controller_account_startSignIn_result$schema$value
84
+ const _deepseek_ai_dsh_api_account_controller_account_startSignIn_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_startSignIn_result$schema$value ??= z.object({
85
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
86
+ 'links': z.object({
87
+ 'usageUrl': z.string().readonly(),
88
+ 'topUpUrl': z.string().readonly(),
89
+ }).readonly(),
90
+ 'attempt': z.union([z.literal(null), z.object({
91
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
92
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
93
+ 'authorizeUrl': z.string().readonly().optional(),
94
+ 'expiresAt': z.number().readonly().optional(),
95
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
96
+ })]).readonly(),
97
+ }))
98
+ let _deepseek_ai_dsh_api_account_controller_account_watch_result$schema$value
99
+ const _deepseek_ai_dsh_api_account_controller_account_watch_result$schema = () => (_deepseek_ai_dsh_api_account_controller_account_watch_result$schema$value ??= z.object({
100
+ 'status': z.union([z.literal("signed-out"), z.literal("credential-stored")]).readonly(),
101
+ 'links': z.object({
102
+ 'usageUrl': z.string().readonly(),
103
+ 'topUpUrl': z.string().readonly(),
104
+ }).readonly(),
105
+ 'attempt': z.union([z.literal(null), z.object({
106
+ 'id': z.intersection(z.string(), z.unknown()).readonly(),
107
+ 'phase': z.union([z.literal("initializing"), z.literal("waiting-browser"), z.literal("exchanging"), z.literal("committing"), z.literal("succeeded"), z.literal("cancelled"), z.literal("expired"), z.literal("failed")]).readonly(),
108
+ 'authorizeUrl': z.string().readonly().optional(),
109
+ 'expiresAt': z.number().readonly().optional(),
110
+ 'errorCode': z.union([z.literal("expired"), z.literal("network"), z.literal("protocol"), z.literal("storage")]).readonly().optional(),
111
+ })]).readonly(),
112
+ }))
113
+
114
+ export const TYPERT_REMOTE = {
115
+ package: '@deepseek-ai/dsh-api-account-controller',
116
+ descriptors: [
117
+ {
118
+ id: '@deepseek-ai/dsh-api-account-controller#account/cancelSignIn',
119
+ service: 'accountController',
120
+ namespace: 'account',
121
+ method: 'cancelSignIn',
122
+ invocation: { kind: 'direct' },
123
+ parameters: [
124
+ {
125
+ name: 'attemptId',
126
+ wire: 'attemptId',
127
+ source: 'json',
128
+ codec: {
129
+ mode: 'strict',
130
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#SignInAttemptId',
131
+ create: _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_parameter_0$schema,
132
+ },
133
+ },
134
+ ],
135
+ result: {
136
+ mode: 'strict',
137
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
138
+ create: _deepseek_ai_dsh_api_account_controller_account_cancelSignIn_result$schema,
139
+ },
140
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":46,"column":3},
141
+ },
142
+ {
143
+ id: '@deepseek-ai/dsh-api-account-controller#account/getBalance',
144
+ service: 'accountController',
145
+ namespace: 'account',
146
+ method: 'getBalance',
147
+ invocation: { kind: 'direct' },
148
+ parameters: [
149
+ ],
150
+ result: {
151
+ mode: 'strict',
152
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/getBalance:result',
153
+ create: _deepseek_ai_dsh_api_account_controller_account_getBalance_result$schema,
154
+ },
155
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":30,"column":3},
156
+ },
157
+ {
158
+ id: '@deepseek-ai/dsh-api-account-controller#account/getProfile',
159
+ service: 'accountController',
160
+ namespace: 'account',
161
+ method: 'getProfile',
162
+ invocation: { kind: 'direct' },
163
+ parameters: [
164
+ ],
165
+ result: {
166
+ mode: 'strict',
167
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/getProfile:result',
168
+ create: _deepseek_ai_dsh_api_account_controller_account_getProfile_result$schema,
169
+ },
170
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":24,"column":3},
171
+ },
172
+ {
173
+ id: '@deepseek-ai/dsh-api-account-controller#account/getState',
174
+ service: 'accountController',
175
+ namespace: 'account',
176
+ method: 'getState',
177
+ invocation: { kind: 'direct' },
178
+ parameters: [
179
+ ],
180
+ result: {
181
+ mode: 'strict',
182
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
183
+ create: _deepseek_ai_dsh_api_account_controller_account_getState_result$schema,
184
+ },
185
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":18,"column":3},
186
+ },
187
+ {
188
+ id: '@deepseek-ai/dsh-api-account-controller#account/signOut',
189
+ service: 'accountController',
190
+ namespace: 'account',
191
+ method: 'signOut',
192
+ invocation: { kind: 'direct' },
193
+ parameters: [
194
+ ],
195
+ result: {
196
+ mode: 'strict',
197
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
198
+ create: _deepseek_ai_dsh_api_account_controller_account_signOut_result$schema,
199
+ },
200
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":52,"column":3},
201
+ },
202
+ {
203
+ id: '@deepseek-ai/dsh-api-account-controller#account/startSignIn',
204
+ service: 'accountController',
205
+ namespace: 'account',
206
+ method: 'startSignIn',
207
+ invocation: { kind: 'direct' },
208
+ parameters: [
209
+ {
210
+ name: 'locale',
211
+ wire: 'locale',
212
+ source: 'json',
213
+ codec: {
214
+ mode: 'strict',
215
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/startSignIn:locale',
216
+ create: _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_0$schema,
217
+ },
218
+ },
219
+ {
220
+ name: 'callbackOrigin',
221
+ wire: 'callbackOrigin',
222
+ source: 'json',
223
+ codec: {
224
+ mode: 'strict',
225
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/startSignIn:callbackOrigin',
226
+ create: _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_1$schema,
227
+ },
228
+ },
229
+ {
230
+ name: 'loginSource',
231
+ wire: 'loginSource',
232
+ source: 'json',
233
+ codec: {
234
+ mode: 'strict',
235
+ typeSymbol: '@deepseek-ai/dsh-api-account-controller#account/startSignIn:loginSource',
236
+ create: _deepseek_ai_dsh_api_account_controller_account_startSignIn_parameter_2$schema,
237
+ },
238
+ },
239
+ ],
240
+ result: {
241
+ mode: 'strict',
242
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
243
+ create: _deepseek_ai_dsh_api_account_controller_account_startSignIn_result$schema,
244
+ },
245
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":39,"column":3},
246
+ },
247
+ {
248
+ id: '@deepseek-ai/dsh-api-account-controller#account/watch',
249
+ service: 'accountController',
250
+ namespace: 'account',
251
+ method: 'watch',
252
+ mode: 'stream',
253
+ invocation: { kind: 'direct' },
254
+ parameters: [
255
+ ],
256
+ cancellation: { parameter: 'signal' },
257
+ result: {
258
+ mode: 'strict',
259
+ typeSymbol: '@deepseek-ai/dsh-deepseek-account/types#AccountView',
260
+ create: _deepseek_ai_dsh_api_account_controller_account_watch_result$schema,
261
+ },
262
+ sourceLocation: {"file":"packages/api/account-controller/src/index.ts","line":59,"column":3},
263
+ },
264
+ ],
265
+ }
266
+
267
+ export default TYPERT_REMOTE
@@ -0,0 +1,53 @@
1
+ /** Authenticated Remote operations for account UI consumers. */
2
+ import { Context } from '@deepseek-ai/cordis';
3
+ import { TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
4
+ import type { AccountDetails } from '@deepseek-ai/dsh-deepseek-account/types';
5
+ import type { AccountView, SignInAttemptId } from './types.ts';
6
+ /** Account commands and reconnect-safe state stream. */
7
+ export declare class AccountController extends TypertRemoteService {
8
+ static inject: string[];
9
+ /** @param ctx - Host with the account provider mounted. */
10
+ constructor(ctx: Context);
11
+ /**
12
+ * Read the safe account projection.
13
+ * @returns current account and attempt state.
14
+ */
15
+ getState(): Promise<AccountView>;
16
+ /**
17
+ * Query display-safe Platform profile data.
18
+ * @returns profile outcome, or null when the account grant is absent or changed.
19
+ */
20
+ getProfile(): Promise<AccountDetails['profile'] | null>;
21
+ /**
22
+ * Query Platform recharge-wallet balances.
23
+ * @returns balance outcome, or null when the account grant is absent or changed.
24
+ */
25
+ getBalance(): Promise<AccountDetails['balance'] | null>;
26
+ /**
27
+ * Begin browser sign-in.
28
+ * @param locale - active UI language for a new attempt.
29
+ * @param callbackOrigin - browser-accessible loopback HTTP origin.
30
+ * @param loginSource - initiating UI, used to return from a failed exchange.
31
+ * @returns a new or already-active login attempt.
32
+ */
33
+ startSignIn(locale: string, callbackOrigin: string, loginSource: 'web' | 'desktop'): Promise<AccountView>;
34
+ /**
35
+ * Cancel the named local attempt.
36
+ * @param attemptId - attempt to cancel.
37
+ * @returns settled cancellation or commit state.
38
+ */
39
+ cancelSignIn(attemptId: SignInAttemptId): Promise<AccountView>;
40
+ /**
41
+ * Remove the local account grant and revoke it through Platform in the background, without deleting API keys.
42
+ * @returns state after removing the local account grant.
43
+ */
44
+ signOut(): Promise<AccountView>;
45
+ /**
46
+ * Stream the safe account projection.
47
+ * @param signal - stream lifetime.
48
+ * @returns initial snapshot and subsequent changes.
49
+ */
50
+ watch(signal: AbortSignal): AsyncIterable<AccountView>;
51
+ }
52
+ export default AccountController;
53
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,116 @@
1
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
+ var useValue = arguments.length > 2;
3
+ for (var i = 0; i < initializers.length; i++) {
4
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
+ }
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
+ var _, done = false;
14
+ for (var i = decorators.length - 1; i >= 0; i--) {
15
+ var context = {};
16
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
+ if (kind === "accessor") {
21
+ if (result === void 0) continue;
22
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
+ if (_ = accept(result.get)) descriptor.get = _;
24
+ if (_ = accept(result.set)) descriptor.set = _;
25
+ if (_ = accept(result.init)) initializers.unshift(_);
26
+ }
27
+ else if (_ = accept(result)) {
28
+ if (kind === "field") initializers.unshift(_);
29
+ else descriptor[key] = _;
30
+ }
31
+ }
32
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
+ done = true;
34
+ };
35
+ import { Remote, TypertRemoteService } from '@deepseek-ai/dsh-typert-protocol';
36
+ /** Account commands and reconnect-safe state stream. */
37
+ let AccountController = (() => {
38
+ let _classSuper = TypertRemoteService;
39
+ let _instanceExtraInitializers = [];
40
+ let _getState_decorators;
41
+ let _getProfile_decorators;
42
+ let _getBalance_decorators;
43
+ let _startSignIn_decorators;
44
+ let _cancelSignIn_decorators;
45
+ let _signOut_decorators;
46
+ let _watch_decorators;
47
+ return class AccountController extends _classSuper {
48
+ static {
49
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
50
+ _getState_decorators = [Remote];
51
+ _getProfile_decorators = [Remote];
52
+ _getBalance_decorators = [Remote];
53
+ _startSignIn_decorators = [Remote];
54
+ _cancelSignIn_decorators = [Remote];
55
+ _signOut_decorators = [Remote];
56
+ _watch_decorators = [Remote({ mode: 'stream' })];
57
+ __esDecorate(this, null, _getState_decorators, { kind: "method", name: "getState", static: false, private: false, access: { has: obj => "getState" in obj, get: obj => obj.getState }, metadata: _metadata }, null, _instanceExtraInitializers);
58
+ __esDecorate(this, null, _getProfile_decorators, { kind: "method", name: "getProfile", static: false, private: false, access: { has: obj => "getProfile" in obj, get: obj => obj.getProfile }, metadata: _metadata }, null, _instanceExtraInitializers);
59
+ __esDecorate(this, null, _getBalance_decorators, { kind: "method", name: "getBalance", static: false, private: false, access: { has: obj => "getBalance" in obj, get: obj => obj.getBalance }, metadata: _metadata }, null, _instanceExtraInitializers);
60
+ __esDecorate(this, null, _startSignIn_decorators, { kind: "method", name: "startSignIn", static: false, private: false, access: { has: obj => "startSignIn" in obj, get: obj => obj.startSignIn }, metadata: _metadata }, null, _instanceExtraInitializers);
61
+ __esDecorate(this, null, _cancelSignIn_decorators, { kind: "method", name: "cancelSignIn", static: false, private: false, access: { has: obj => "cancelSignIn" in obj, get: obj => obj.cancelSignIn }, metadata: _metadata }, null, _instanceExtraInitializers);
62
+ __esDecorate(this, null, _signOut_decorators, { kind: "method", name: "signOut", static: false, private: false, access: { has: obj => "signOut" in obj, get: obj => obj.signOut }, metadata: _metadata }, null, _instanceExtraInitializers);
63
+ __esDecorate(this, null, _watch_decorators, { kind: "method", name: "watch", static: false, private: false, access: { has: obj => "watch" in obj, get: obj => obj.watch }, metadata: _metadata }, null, _instanceExtraInitializers);
64
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
65
+ }
66
+ static inject = ['deepseekAccount'];
67
+ /** @param ctx - Host with the account provider mounted. */
68
+ constructor(ctx) {
69
+ super(ctx, 'accountController', { namespace: 'account' });
70
+ __runInitializers(this, _instanceExtraInitializers);
71
+ }
72
+ /**
73
+ * Read the safe account projection.
74
+ * @returns current account and attempt state.
75
+ */
76
+ getState() { return this.ctx.deepseekAccount.getState(); }
77
+ /**
78
+ * Query display-safe Platform profile data.
79
+ * @returns profile outcome, or null when the account grant is absent or changed.
80
+ */
81
+ getProfile() { return this.ctx.deepseekAccount.getProfile(); }
82
+ /**
83
+ * Query Platform recharge-wallet balances.
84
+ * @returns balance outcome, or null when the account grant is absent or changed.
85
+ */
86
+ getBalance() { return this.ctx.deepseekAccount.getBalance(); }
87
+ /**
88
+ * Begin browser sign-in.
89
+ * @param locale - active UI language for a new attempt.
90
+ * @param callbackOrigin - browser-accessible loopback HTTP origin.
91
+ * @param loginSource - initiating UI, used to return from a failed exchange.
92
+ * @returns a new or already-active login attempt.
93
+ */
94
+ startSignIn(locale, callbackOrigin, loginSource) { return this.ctx.deepseekAccount.startSignIn(locale, callbackOrigin, loginSource); }
95
+ /**
96
+ * Cancel the named local attempt.
97
+ * @param attemptId - attempt to cancel.
98
+ * @returns settled cancellation or commit state.
99
+ */
100
+ cancelSignIn(attemptId) { return this.ctx.deepseekAccount.cancelSignIn(attemptId); }
101
+ /**
102
+ * Remove the local account grant and revoke it through Platform in the background, without deleting API keys.
103
+ * @returns state after removing the local account grant.
104
+ */
105
+ signOut() { return this.ctx.deepseekAccount.signOut(); }
106
+ /**
107
+ * Stream the safe account projection.
108
+ * @param signal - stream lifetime.
109
+ * @returns initial snapshot and subsequent changes.
110
+ */
111
+ watch(signal) { return this.ctx.deepseekAccount.watch(signal); }
112
+ };
113
+ })();
114
+ export { AccountController };
115
+ export default AccountController;
116
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,3 @@
1
+ /** Account Remote values contain no credential payloads. */
2
+ export type { AccountDetails, AccountView, SignInAttemptId } from '@deepseek-ai/dsh-deepseek-account/types';
3
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@deepseek-ai/dsh-api-account-controller",
3
+ "description": "Expose safe account operations over authenticated Remote",
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/api/account-controller"
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
+ "./typert": {
28
+ "types": "./lib/typert.host.d.ts",
29
+ "default": "./lib/typert.host.js"
30
+ },
31
+ "./remote": {
32
+ "types": "./lib/typert.remote-client.d.ts",
33
+ "default": "./lib/typert.remote-client.js"
34
+ }
35
+ },
36
+ "files": [
37
+ "lib/index.js",
38
+ "lib/types/**/*.js",
39
+ "lib/types/**/*.d.ts",
40
+ "lib/typert.host.js",
41
+ "lib/typert.host.d.ts",
42
+ "lib/typert.remote-client.js",
43
+ "lib/typert.remote-client.d.ts"
44
+ ],
45
+ "license": "MIT",
46
+ "dependencies": {
47
+ "zod": "^4.4.3"
48
+ },
49
+ "peerDependencies": {
50
+ "@deepseek-ai/cordis": "^4.0.3",
51
+ "@deepseek-ai/dsh-deepseek-account": "^0.1.7-alpha.1",
52
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.7-alpha.1"
53
+ },
54
+ "devDependencies": {
55
+ "@deepseek-ai/cordis": "^4.0.3",
56
+ "@deepseek-ai/dsh-deepseek-account": "^0.1.7-alpha.1",
57
+ "@deepseek-ai/dsh-typert-protocol": "^0.1.7-alpha.1"
58
+ }
59
+ }