@dsh-mobile/mobile-remote 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FAQ.md +2 -2
- package/LICENSE +0 -0
- package/README.md +13 -8
- package/docs/PRIVACY-POLICY.en.md +26 -18
- package/docs/PRIVACY-POLICY.md +26 -18
- package/docs/SUPPORT.md +1 -1
- package/docs/TERMS-OF-SERVICE.en.md +5 -3
- package/docs/TERMS-OF-SERVICE.md +5 -3
- package/docs/USER-GUIDE.zh-CN.md +7 -6
- package/lib/account-usage-query.js +60 -60
- package/lib/account-usage.js +10 -10
- package/lib/api-helpers.js +114 -110
- package/lib/assistant-prefs.js +119 -76
- package/lib/auto-config.js +65 -65
- package/lib/backup.js +159 -123
- package/lib/break-reminder.js +45 -45
- package/lib/client.js +336 -138
- package/lib/config.js +234 -218
- package/lib/git-read-bundled-provider.js +27 -7
- package/lib/git-read-service.js +5 -5
- package/lib/host-compat.js +84 -84
- package/lib/http-util.js +17 -17
- package/lib/index.js +1670 -1511
- package/lib/memory/context.js +45 -40
- package/lib/memory/decay.js +93 -93
- package/lib/memory/extract.js +77 -77
- package/lib/memory/routes.js +33 -33
- package/lib/memory/store.js +239 -192
- package/lib/notify-copy.js +93 -93
- package/lib/permission-guide.js +86 -86
- package/lib/persona-cards.js +73 -61
- package/lib/phone-action-args.js +175 -0
- package/lib/phone-actions.js +227 -0
- package/lib/phone-announce.js +58 -0
- package/lib/proactive-material.js +42 -42
- package/lib/proactive.js +122 -119
- package/lib/protected-paths.js +205 -45
- package/lib/protocol.js +62 -23
- package/lib/push.js +29 -29
- package/lib/rate-limit.js +16 -16
- package/lib/relay/connector.js +334 -81
- package/lib/relay/crypto.js +15 -15
- package/lib/relay/devices.js +64 -32
- package/lib/relay/fingerprint.js +34 -34
- package/lib/relay/identity.js +26 -26
- package/lib/relay/mux.js +60 -46
- package/lib/relay/noise.js +40 -40
- package/lib/relay/on-demand.js +36 -31
- package/lib/relay/p2p.js +239 -0
- package/lib/relay/pairing.js +54 -15
- package/lib/relay/phone.js +63 -39
- package/lib/relay/serve.js +21 -21
- package/lib/relay/signal.js +69 -0
- package/lib/relay/ws-server.js +245 -0
- package/lib/reminders.js +15 -15
- package/lib/rpc-adapter.js +43 -43
- package/lib/session-list.js +31 -31
- package/lib/session-rotation.js +95 -95
- package/lib/session-title-cache.js +35 -35
- package/lib/session-title-refresh.js +51 -51
- package/lib/timeline.js +140 -140
- package/lib/turn-outline.js +104 -104
- package/package.json +11 -18
package/lib/turn-outline.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
9
|
export const EVENT_DETAIL_MAX_BYTES = 8 * 1024 * 1024;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
14
|
export const SEEDED_PREFIX_ERROR_MESSAGE = "seeded session constructor seed must equal its inherited prefix";
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
export function classifyEventDetailReadError(err) {
|
|
18
18
|
const chain = [];
|
|
19
19
|
for (let current = err, depth = 0; current && depth < 6; current = current.cause, depth++) chain.push(current);
|
|
20
20
|
const codes = new Set(chain.map((item) => item?.code).filter((code) => typeof code === "string"));
|
|
21
21
|
const messages = chain.map((item) => String(item?.message ?? item ?? ""));
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
25
|
if (codes.has("ABORT_ERR") || chain.some((item) => item?.name === "TimeoutError" || item?.name === "AbortError")) {
|
|
26
26
|
return { timeout: true };
|
|
27
27
|
}
|
|
@@ -37,52 +37,52 @@ export function classifyEventDetailReadError(err) {
|
|
|
37
37
|
return { status: 500, code: "event-read-failed", detail: "事件详情读取失败" };
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
44
|
const TURN_OUTLINE_CAPABILITIES = {
|
|
45
45
|
version: 1,
|
|
46
46
|
supported: true,
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
unloaded: true,
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
truncated: true,
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
const TURN_OUTLINE_CAPABILITY_MISSING = { version: 1, supported: false };
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
61
|
export const TURN_OUTLINE_TIMEOUT_MS = 5000;
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
67
|
const TURN_OUTLINE_MAX_BYTES = 256 * 1024;
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
74
|
const TURN_OUTLINE_QUEUE_MAX = 8;
|
|
75
75
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
86
|
export function createTurnOutlineQueue({ maxQueue = TURN_OUTLINE_QUEUE_MAX } = {}) {
|
|
87
87
|
const waiting = [];
|
|
88
88
|
let running = false;
|
|
@@ -105,8 +105,8 @@ export function createTurnOutlineQueue({ maxQueue = TURN_OUTLINE_QUEUE_MAX } = {
|
|
|
105
105
|
return {
|
|
106
106
|
run(task, options = {}) {
|
|
107
107
|
return new Promise((resolve, reject) => {
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
|
|
109
|
+
|
|
110
110
|
if (options.signal?.aborted) {
|
|
111
111
|
reject(options.signal.reason ?? Object.assign(new Error("aborted before queueing"), { name: "AbortError" }));
|
|
112
112
|
return;
|
|
@@ -116,8 +116,8 @@ export function createTurnOutlineQueue({ maxQueue = TURN_OUTLINE_QUEUE_MAX } = {
|
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
const entry = { task, resolve, reject, signal: options.signal };
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
|
|
120
|
+
|
|
121
121
|
const onAbort = () => {
|
|
122
122
|
const index = waiting.indexOf(entry);
|
|
123
123
|
if (index < 0) return;
|
|
@@ -138,25 +138,25 @@ export function createTurnOutlineQueue({ maxQueue = TURN_OUTLINE_QUEUE_MAX } = {
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
153
|
export function raceWithDeadline(work, { deadlineMs, signal, onLate }) {
|
|
154
154
|
let late = false;
|
|
155
|
-
|
|
155
|
+
|
|
156
156
|
let timer = null;
|
|
157
|
-
|
|
157
|
+
|
|
158
158
|
let fire = null;
|
|
159
|
-
|
|
159
|
+
|
|
160
160
|
const onAbort = () => {
|
|
161
161
|
fire?.();
|
|
162
162
|
};
|
|
@@ -166,7 +166,7 @@ export function raceWithDeadline(work, { deadlineMs, signal, onLate }) {
|
|
|
166
166
|
try {
|
|
167
167
|
onLate?.(value);
|
|
168
168
|
} catch {
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
}
|
|
171
171
|
return null;
|
|
172
172
|
}
|
|
@@ -175,8 +175,8 @@ export function raceWithDeadline(work, { deadlineMs, signal, onLate }) {
|
|
|
175
175
|
(error) => (late ? null : { status: "failed", error }),
|
|
176
176
|
);
|
|
177
177
|
const deadline = new Promise((resolve) => {
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
|
|
179
|
+
|
|
180
180
|
fire = () => {
|
|
181
181
|
if (late) return;
|
|
182
182
|
late = true;
|
|
@@ -189,9 +189,9 @@ export function raceWithDeadline(work, { deadlineMs, signal, onLate }) {
|
|
|
189
189
|
}
|
|
190
190
|
signal?.addEventListener?.("abort", onAbort, { once: true });
|
|
191
191
|
});
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
195
|
return Promise.race([settled, deadline]).finally(() => {
|
|
196
196
|
if (timer !== null) {
|
|
197
197
|
clearTimeout(timer);
|
|
@@ -200,20 +200,20 @@ export function raceWithDeadline(work, { deadlineMs, signal, onLate }) {
|
|
|
200
200
|
try {
|
|
201
201
|
signal?.removeEventListener?.("abort", onAbort);
|
|
202
202
|
} catch {
|
|
203
|
-
|
|
203
|
+
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
217
|
export function turnOutlineCapabilityOf(ctx) {
|
|
218
218
|
const registry = ctx.get("sessionProjections");
|
|
219
219
|
const query = ctx.get("sessionQuery");
|
|
@@ -222,14 +222,14 @@ export function turnOutlineCapabilityOf(ctx) {
|
|
|
222
222
|
return registered && observable ? TURN_OUTLINE_CAPABILITIES : TURN_OUTLINE_CAPABILITY_MISSING;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
233
|
export function classifyTurnOutlineReadError(err) {
|
|
234
234
|
const classified = classifyEventDetailReadError(err);
|
|
235
235
|
if (classified.timeout === true || classified.seeded === true) return classified;
|
|
@@ -240,16 +240,16 @@ export function classifyTurnOutlineReadError(err) {
|
|
|
240
240
|
return classified;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
250
|
export function clampTurnOutline(turns, maxBytes = TURN_OUTLINE_MAX_BYTES) {
|
|
251
251
|
const rows = Array.isArray(turns) ? turns : [];
|
|
252
|
-
let total = 2;
|
|
252
|
+
let total = 2;
|
|
253
253
|
let keep = 0;
|
|
254
254
|
for (let index = rows.length - 1; index >= 0; index--) {
|
|
255
255
|
let size;
|
|
@@ -266,17 +266,17 @@ export function clampTurnOutline(turns, maxBytes = TURN_OUTLINE_MAX_BYTES) {
|
|
|
266
266
|
return { turns: sliced, truncated: keep < rows.length, dropped: rows.length - keep };
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
275
|
export function turnOutlineStateOf(snapshot) {
|
|
276
276
|
const values = snapshot?.values;
|
|
277
277
|
const present = typeof values === "object" && values !== null && Object.prototype.hasOwnProperty.call(values, "turnOutline");
|
|
278
278
|
if (!present) {
|
|
279
|
-
|
|
279
|
+
|
|
280
280
|
return { state: "capability-missing", asOfSeq: null, turns: [], truncated: false, dropped: 0 };
|
|
281
281
|
}
|
|
282
282
|
const raw = Array.isArray(values.turnOutline) ? values.turnOutline : [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-mobile/mobile-remote",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "DSH Mobile:把 DeepSeek Harness 变成随身控制台——手机远程发消息派活、看进度、收通知、审批决策、管理会话;配套 Flutter App(Android、iPhone / iPad)",
|
|
5
5
|
"homepage": "https://dsh.claud.ing/",
|
|
6
6
|
"repository": {
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"url": "https://dsh.claud.ing/support/"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
|
-
"scripts": {
|
|
16
|
-
"test": "node --test test/*.js test/*.mjs",
|
|
17
|
-
"check": "node --check lib/index.js && node --check lib/client.js",
|
|
18
|
-
"verify:deploy": "node tools/verify-deployment.mjs",
|
|
19
|
-
"gate": "bash scripts/gate.sh",
|
|
20
|
-
"gate:release": "bash scripts/gate.sh --release",
|
|
21
|
-
"compat:weekly": "bash scripts/compat-weekly.sh"
|
|
22
|
-
},
|
|
23
15
|
"main": "lib/index.js",
|
|
24
16
|
"exports": {
|
|
25
17
|
".": "./lib/index.js",
|
|
@@ -60,25 +52,26 @@
|
|
|
60
52
|
"license": "MIT",
|
|
61
53
|
"engines": {
|
|
62
54
|
"node": ">=24.9.0",
|
|
63
|
-
"dsh": ">=0.1
|
|
55
|
+
"dsh": ">=0.2.1-rc.2 <0.4.0-0"
|
|
64
56
|
},
|
|
65
57
|
"dependencies": {
|
|
66
58
|
"qrcode": "^1.5.4"
|
|
67
59
|
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"ws": "^8.18.0"
|
|
70
|
-
},
|
|
71
60
|
"peerDependencies": {
|
|
72
|
-
"@deepseek-ai/dsh-credentials": ">=0.1
|
|
73
|
-
"@deepseek-ai/dsh-llm": ">=0.1
|
|
74
|
-
"@deepseek-ai/dsh-sandbox-policy": ">=0.1
|
|
75
|
-
"@deepseek-ai/dsh-scope": ">=0.1
|
|
61
|
+
"@deepseek-ai/dsh-credentials": ">=0.2.1-rc.2 <0.4.0",
|
|
62
|
+
"@deepseek-ai/dsh-llm": ">=0.2.1-rc.2 <0.4.0",
|
|
63
|
+
"@deepseek-ai/dsh-sandbox-policy": ">=0.2.1-rc.2 <0.4.0",
|
|
64
|
+
"@deepseek-ai/dsh-scope": ">=0.2.1-rc.2 <0.4.0",
|
|
76
65
|
"@deepseek-ai/schemastery": ">=3.18.1",
|
|
77
|
-
"dsh-codex-connect": ">=0.1.0-alpha.4.5"
|
|
66
|
+
"dsh-codex-connect": ">=0.1.0-alpha.4.5",
|
|
67
|
+
"werift": "0.27.0"
|
|
78
68
|
},
|
|
79
69
|
"peerDependenciesMeta": {
|
|
80
70
|
"dsh-codex-connect": {
|
|
81
71
|
"optional": true
|
|
72
|
+
},
|
|
73
|
+
"werift": {
|
|
74
|
+
"optional": true
|
|
82
75
|
}
|
|
83
76
|
},
|
|
84
77
|
"publishConfig": {
|