dsh-cherry-bridge 0.1.7 → 0.1.9
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/README.en.md +31 -17
- package/README.md +20 -12
- package/dist/index.mjs +201 -43
- package/docs/e2e-checklist.md +1 -1
- package/lib/client.js +2 -2
- package/locale/en.json +1 -1
- package/locale/zh.json +1 -1
- package/package.json +1 -1
- package/src/connection.ts +61 -0
- package/src/defaults.ts +23 -0
- package/src/tools.ts +264 -78
- package/ui/index.html +1 -1
- package/ui/src/i18n.ts +2 -2
package/src/defaults.ts
CHANGED
|
@@ -81,6 +81,24 @@ export const DEFAULT_CONTENT_READ_BUDGET_PER_SECOND = 256
|
|
|
81
81
|
*/
|
|
82
82
|
export const DEFAULT_TRANSPORT_RETRY_WAIT_MS = 5_000
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* How long a DEVICE TOOL waits for an establishment attempt that is already in
|
|
86
|
+
* flight (`state === 'connecting'`) before judging the device.
|
|
87
|
+
*
|
|
88
|
+
* WHY THIS EXISTS: the connection pool builds a `DeviceConnection` on FIRST
|
|
89
|
+
* TOUCH and that constructor dials immediately, so every tool called in the
|
|
90
|
+
* same tick as the first touch — and every tool called during a reconnect —
|
|
91
|
+
* observed `connecting` and answered `device-unavailable` about a connection
|
|
92
|
+
* that comes up a moment later. The state is a transient, not a verdict.
|
|
93
|
+
*
|
|
94
|
+
* It is deliberately NOT a reconnect budget: an `offline` device is parked in
|
|
95
|
+
* its backoff, where waiting cannot change anything, so the tools answer at
|
|
96
|
+
* once. Five seconds is ~15x a LAN dial plus handshake; a bound longer than
|
|
97
|
+
* that only delays the unavoidable answer, and the tool call is the caller's
|
|
98
|
+
* unit of patience.
|
|
99
|
+
*/
|
|
100
|
+
export const DEVICE_SETTLE_WAIT_MS = 5_000
|
|
101
|
+
|
|
84
102
|
/** 2 MiB of event text cached per session (spec §3.5). */
|
|
85
103
|
export const DEFAULT_PER_SESSION_CACHE_BYTES = 2 * 1024 * 1024
|
|
86
104
|
|
|
@@ -151,5 +169,10 @@ export const LIST_PAGE_CLAMP = 16
|
|
|
151
169
|
* BOUND instead of being split, hashed and carried to the peer, and so both
|
|
152
170
|
* parameters can declare `maxLength` honestly. ONE number for both faces: it
|
|
153
171
|
* bounds caller INPUT, not what a token means.
|
|
172
|
+
*
|
|
173
|
+
* The emit side enforces it too (#76): a stop point whose token would exceed
|
|
174
|
+
* this is not named at all, because a token this tool refuses to replay is
|
|
175
|
+
* worse than no token — `truncated` still says the walk was cut. One number,
|
|
176
|
+
* judged in both directions.
|
|
154
177
|
*/
|
|
155
178
|
export const MAX_RESUME_TOKEN_CHARS = 4_096
|