@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/break-reminder.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
28
|
export function isUserActivityEvent(session, event) {
|
|
29
29
|
if (event?.type !== "user/message") return false;
|
|
30
30
|
if (session?.header?.origin === "subagent") return false;
|
|
@@ -35,19 +35,19 @@ export function isUserActivityEvent(session, event) {
|
|
|
35
35
|
export const BREAK_AFTER_MS = 2 * 60 * 60_000;
|
|
36
36
|
export const BREAK_IDLE_RESET_MS = 10 * 60_000;
|
|
37
37
|
export const BREAK_MIN_INTERVAL_MS = 2 * 60 * 60_000;
|
|
38
|
-
|
|
38
|
+
|
|
39
39
|
export const BREAK_CHECK_MS = 60_000;
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
51
|
export function createBreakReminder({
|
|
52
52
|
now = () => Date.now(),
|
|
53
53
|
isEnabled = () => true,
|
|
@@ -57,7 +57,7 @@ export function createBreakReminder({
|
|
|
57
57
|
idleResetMs = BREAK_IDLE_RESET_MS,
|
|
58
58
|
minIntervalMs = BREAK_MIN_INTERVAL_MS,
|
|
59
59
|
} = {}) {
|
|
60
|
-
|
|
60
|
+
|
|
61
61
|
let streakStart = null;
|
|
62
62
|
let lastActivityAt = null;
|
|
63
63
|
let lastRemindedAt = null;
|
|
@@ -69,14 +69,14 @@ export function createBreakReminder({
|
|
|
69
69
|
lastActivityAt = null;
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
function activity(at = now()) {
|
|
74
|
-
|
|
74
|
+
|
|
75
75
|
if (lastActivityAt === null || at < lastActivityAt || at - lastActivityAt >= idleResetMs) streakStart = at;
|
|
76
76
|
lastActivityAt = at;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
|
|
80
80
|
function check(at = now()) {
|
|
81
81
|
const result = (() => {
|
|
82
82
|
if (streakStart === null) return { fired: false, reason: "no-activity" };
|
|
@@ -88,7 +88,7 @@ export function createBreakReminder({
|
|
|
88
88
|
reset();
|
|
89
89
|
return { fired: false, reason: "idle-reset" };
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
|
|
92
92
|
if (!isEnabled()) return { fired: false, reason: "disabled" };
|
|
93
93
|
const workedMs = at - streakStart;
|
|
94
94
|
if (workedMs < afterMs) return { fired: false, reason: "not-yet" };
|
|
@@ -111,7 +111,7 @@ export function createBreakReminder({
|
|
|
111
111
|
try {
|
|
112
112
|
check();
|
|
113
113
|
} catch {
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
}
|
|
116
116
|
}, intervalMs);
|
|
117
117
|
timer.unref?.();
|
|
@@ -127,7 +127,7 @@ export function createBreakReminder({
|
|
|
127
127
|
check,
|
|
128
128
|
start,
|
|
129
129
|
stop,
|
|
130
|
-
|
|
130
|
+
|
|
131
131
|
snapshot: () => ({ streakStart, lastActivityAt, lastRemindedAt, lastReason, running: timer !== null }),
|
|
132
132
|
};
|
|
133
133
|
}
|