dsh-cherry-bridge 0.1.11 → 0.2.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/README.en.md +11 -4
- package/README.md +10 -4
- package/dist/index.d.mts +31 -3
- package/dist/index.mjs +906 -144
- package/docs/e2e-checklist.md +2 -2
- package/lib/client.js +47 -0
- package/package.json +4 -3
- package/src/AGENTS.md +860 -0
- package/src/connection.ts +114 -10
- package/src/deviceStore.ts +204 -5
- package/src/diagnostics.ts +30 -0
- package/src/httpApi.ts +129 -8
- package/src/index.ts +190 -8
- package/src/pairing.ts +504 -112
- package/src/rpc/jsonRpcClient.ts +19 -1
- package/src/subscriptions.ts +10 -2
- package/src/text.ts +158 -0
- package/src/tools.ts +181 -14
- package/ui/AGENTS.md +23 -0
- package/ui/src/DeviceCard.tsx +35 -0
- package/ui/src/i18n.ts +10 -0
- package/ui/src/types.ts +9 -1
- package/src/urlHost.ts +0 -15
package/src/urlHost.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Renders a host as a URL authority component. The device archive and pairing
|
|
3
|
-
* flow store BARE hosts (plan-mandated normalization), so a bare IPv6 literal
|
|
4
|
-
* must be bracketed before it is spliced into a URL — `ws://::1:35543/...`
|
|
5
|
-
* is not a valid URL and `new WebSocket(...)` throws synchronously on it.
|
|
6
|
-
*
|
|
7
|
-
* Shared home for the dial sites: both `connection.ts` (per-device dial) and
|
|
8
|
-
* `pairing.ts` (candidate dial) splice hosts into URLs and must bracket the
|
|
9
|
-
* same way.
|
|
10
|
-
*/
|
|
11
|
-
export function urlHost(host: string): string {
|
|
12
|
-
// A colon can only mean IPv6 here: a `host:port` pair never reaches this
|
|
13
|
-
// layer (the port travels separately).
|
|
14
|
-
return host.includes(':') ? `[${host}]` : host
|
|
15
|
-
}
|