dsh-plugin-dshm 0.0.0-stage → 0.1.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +228 -2
  4. package/README.zh-CN.md +190 -0
  5. package/cordis.patch.yml +7 -0
  6. package/lib/auth/signature.d.ts +4 -0
  7. package/lib/auth/signature.js +24 -0
  8. package/lib/cli/index.d.ts +4 -0
  9. package/lib/cli/index.js +41 -0
  10. package/lib/client.js +419 -0
  11. package/lib/config.d.ts +10 -0
  12. package/lib/config.js +27 -0
  13. package/lib/discovery/advertiser.d.ts +45 -0
  14. package/lib/discovery/advertiser.js +141 -0
  15. package/lib/discovery/interfaces.d.ts +5 -0
  16. package/lib/discovery/interfaces.js +24 -0
  17. package/lib/errors.d.ts +5 -0
  18. package/lib/errors.js +10 -0
  19. package/lib/host/local.d.ts +5 -0
  20. package/lib/host/local.js +122 -0
  21. package/lib/host/tailscale.d.ts +43 -0
  22. package/lib/host/tailscale.js +137 -0
  23. package/lib/host/types.d.ts +40 -0
  24. package/lib/host/types.js +1 -0
  25. package/lib/index.d.ts +30 -0
  26. package/lib/index.js +98 -0
  27. package/lib/methods/index.d.ts +9 -0
  28. package/lib/methods/index.js +206 -0
  29. package/lib/pairing/state.d.ts +26 -0
  30. package/lib/pairing/state.js +89 -0
  31. package/lib/pairing/window.d.ts +18 -0
  32. package/lib/pairing/window.js +57 -0
  33. package/lib/projection/client.d.mts +2 -0
  34. package/lib/projection/client.mjs +11 -0
  35. package/lib/projection/files.d.ts +33 -0
  36. package/lib/projection/files.js +278 -0
  37. package/lib/projection/fold-recording.d.mts +50 -0
  38. package/lib/projection/fold-recording.mjs +440 -0
  39. package/lib/projection/host.d.ts +6 -0
  40. package/lib/projection/host.js +86 -0
  41. package/lib/projection/ids.d.mts +1 -0
  42. package/lib/projection/ids.mjs +1 -0
  43. package/lib/projection/index.d.ts +2 -0
  44. package/lib/projection/index.js +2 -0
  45. package/lib/projection/interactions.d.ts +10 -0
  46. package/lib/projection/interactions.js +73 -0
  47. package/lib/projection/native.d.ts +114 -0
  48. package/lib/projection/native.js +903 -0
  49. package/lib/protocol/THIRD_PARTY_LICENSES.txt +135 -0
  50. package/lib/protocol/dmp.d.ts +402 -0
  51. package/lib/protocol/dmp.js +1 -0
  52. package/lib/protocol/schema/dmp-v1/common.schema.json +88 -0
  53. package/lib/protocol/schema/dmp-v1/events.schema.json +107 -0
  54. package/lib/protocol/schema/dmp-v1/frames.schema.json +280 -0
  55. package/lib/protocol/schema/dmp-v1/methods.schema.json +584 -0
  56. package/lib/protocol/schema/dmp-v1/models.schema.json +674 -0
  57. package/lib/protocol/scripts/contract.mjs +8106 -0
  58. package/lib/push/controller.d.ts +64 -0
  59. package/lib/push/controller.js +290 -0
  60. package/lib/push/observer.d.ts +51 -0
  61. package/lib/push/observer.js +266 -0
  62. package/lib/push/payload.d.ts +15 -0
  63. package/lib/push/payload.js +18 -0
  64. package/lib/push/store.d.ts +17 -0
  65. package/lib/push/store.js +75 -0
  66. package/lib/server/index.d.ts +30 -0
  67. package/lib/server/index.js +500 -0
  68. package/lib/server/rate-limit.d.ts +7 -0
  69. package/lib/server/rate-limit.js +19 -0
  70. package/lib/server/uploads.d.ts +21 -0
  71. package/lib/server/uploads.js +74 -0
  72. package/lib/types.d.ts +92 -0
  73. package/lib/types.js +1 -0
  74. package/lib/ui/card.d.mts +3 -0
  75. package/lib/ui/card.mjs +59 -0
  76. package/lib/ui/copy.d.mts +146 -0
  77. package/lib/ui/copy.mjs +106 -0
  78. package/lib/ui/remote-setup.d.mts +81 -0
  79. package/lib/ui/remote-setup.mjs +75 -0
  80. package/package.json +67 -4
@@ -0,0 +1,75 @@
1
+ import { copies } from './copy.mjs';
2
+ const install = { macos: 'https://tailscale.com/docs/install/mac', windows: 'https://tailscale.com/docs/install/windows', other: 'https://tailscale.com/docs/install' };
3
+ export function setupPresentation(status, copy = copies.en) {
4
+ if (!status)
5
+ return { title: copy.checkingTailscale, detail: '', ready: false };
6
+ const ready = status.state === 'running' && Boolean(status.bridgeListening);
7
+ const state = status.state !== 'running' ? status.state : !ready ? 'bridge-not-ready' : status.connectedDevices > 0 ? 'connected' : 'ready';
8
+ const [title, detail] = Object.hasOwn(copy.states, state) ? copy.states[state] : copy.states.unavailable;
9
+ return { title, detail, ready };
10
+ }
11
+ export function createRemoteSetup(React, { Button }) {
12
+ const h = React.createElement;
13
+ const link = (href, label) => h('a', { className: 'dshm-link-button', href, target: '_blank', rel: 'noopener noreferrer' }, label, ' ↗');
14
+ return function RemoteSetup({ api, onPair, pairingBusy, copy }) {
15
+ const [status, setStatus] = React.useState(null), [error, setError] = React.useState('');
16
+ const [busy, setBusy] = React.useState(false), [opened, setOpened] = React.useState(false), [checking, setChecking] = React.useState(false);
17
+ const live = React.useRef(true), pending = React.useRef(false);
18
+ const check = async (manual = false) => {
19
+ if (pending.current)
20
+ return;
21
+ pending.current = true;
22
+ if (manual)
23
+ setChecking(true);
24
+ try {
25
+ const value = await api('remoteSetup');
26
+ if (live.current) {
27
+ setStatus(value);
28
+ setError('');
29
+ }
30
+ }
31
+ catch {
32
+ if (live.current) {
33
+ setStatus(null);
34
+ setError('setupError');
35
+ }
36
+ }
37
+ finally {
38
+ pending.current = false;
39
+ if (live.current)
40
+ setChecking(false);
41
+ }
42
+ };
43
+ React.useEffect(() => {
44
+ live.current = true;
45
+ void check();
46
+ const timer = setInterval(() => { void check(); }, 5000);
47
+ return () => { live.current = false; clearInterval(timer); };
48
+ }, []);
49
+ const open = async () => {
50
+ if (busy)
51
+ return;
52
+ setBusy(true);
53
+ setError('');
54
+ setOpened(false);
55
+ try {
56
+ await api('openTailscale', {});
57
+ if (live.current)
58
+ setOpened(true);
59
+ }
60
+ catch {
61
+ if (live.current)
62
+ setError('openError');
63
+ }
64
+ finally {
65
+ if (live.current)
66
+ setBusy(false);
67
+ }
68
+ };
69
+ const view = setupPresentation(status, copy);
70
+ return h('div', { className: 'dshm-panel', id: 'dshm-remote-setup' }, h('p', null, copy.intro), h('ol', { className: 'dshm-setup-steps' }, h('li', null, h('h3', null, copy.step1), h('p', { role: 'status', 'aria-live': 'polite', 'aria-atomic': true }, error && !status ? copy.unavailableStatus : view.title), view.detail ? h('p', null, view.detail) : null, h('div', { className: 'dshm-actions' }, status?.state === 'not-installed' || status?.state === 'unsupported' ? link(install[status.platform] ?? install.other, copy.getComputer) : null,
71
+ // Keep keyboard focus during short requests; handlers prevent repeats.
72
+ status?.canOpenApp ? h(Button, { variant: 'outline', 'aria-disabled': busy, 'aria-busy': busy, onClick: open }, busy ? copy.opening : copy['button.open']) : null, h(Button, { variant: 'outline', 'aria-disabled': busy || checking, 'aria-busy': checking, onClick: () => { if (!busy)
73
+ void check(true); } }, checking ? copy.checking : copy['button.check'])), status?.state === 'not-installed' ? h('p', null, copy.installDetail) : null, opened ? h('p', { role: 'status' }, copy.opened) : null), h('li', null, h('h3', null, copy.step2), h('p', null, copy['step2.detail']), link('https://tailscale.com/docs/install/ios', copy.getPhone)), h('li', null, h('h3', null, copy.step3), h('p', null, copy['step3.detail']), h(Button, { variant: 'primary', disabled: !view.ready || pairingBusy, onClick: onPair }, copy['button.pairRemote']), h('p', null, copy['step3.check']))), error ? h('p', { className: 'dshm-error', role: 'alert' }, copy[error]) : null);
74
+ };
75
+ }
package/package.json CHANGED
@@ -1,6 +1,69 @@
1
1
  {
2
2
  "name": "dsh-plugin-dshm",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Pair your iPhone or iPad with DeepSeek Harness over a private, authenticated connection",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/JeremyCruzFang/dsh-plugin-dshm.git",
9
+ "directory": "bridge"
10
+ },
11
+ "homepage": "https://github.com/JeremyCruzFang/dsh-plugin-dshm/tree/main/bridge#readme",
12
+ "bugs": { "url": "https://github.com/JeremyCruzFang/dsh-plugin-dshm/issues" },
13
+ "keywords": ["dsh-plugin", "deepseek-harness", "dshm", "ios", "remote-control"],
14
+ "packageManager": "pnpm@11.13.1",
15
+ "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
16
+ "private": false,
17
+ "type": "module",
18
+ "exports": {
19
+ ".": "./lib/index.js",
20
+ "./package.json": "./package.json",
21
+ "./client": "./lib/client.js",
22
+ "./cli": "./lib/cli/index.js"
23
+ },
24
+ "files": [
25
+ "lib",
26
+ "cordis.patch.yml",
27
+ "README.md",
28
+ "README.zh-CN.md",
29
+ "LICENSE",
30
+ "CHANGELOG.md"
31
+ ],
32
+ "engines": {
33
+ "node": ">=24",
34
+ "dsh": "0.2.1-rc.3"
35
+ },
36
+ "dsh": {
37
+ "bundle": {
38
+ "patch": "./cordis.patch.yml"
39
+ },
40
+ "client": {
41
+ "platform": "web",
42
+ "inject": [
43
+ "@deepseek-ai/dsh-client-ui-settings"
44
+ ]
45
+ }
46
+ },
47
+ "scripts": {
48
+ "build": "node scripts/clean.mjs && tsc -p tsconfig.json && node scripts/build-client.mjs && node scripts/pack-protocol.mjs",
49
+ "test": "pnpm build && node --test --test-timeout=30000 test/*.test.mjs src/projection/*.test.mjs",
50
+ "test:integration": "node ../tools/bridge-integration/run.mjs",
51
+ "prepack": "pnpm build",
52
+ "test:host": "node ../tools/bridge-integration/run-host-ux.mjs",
53
+ "test:discovery": "node --test test/discovery-live.mjs"
54
+ },
55
+ "dependencies": {
56
+ "multicast-dns": "7.2.5",
57
+ "qrcode": "1.5.4",
58
+ "ws": "8.18.3"
59
+ },
60
+ "devDependencies": {
61
+ "@types/multicast-dns": "7.2.4",
62
+ "@types/node": "24.0.0",
63
+ "@types/qrcode": "1.5.6",
64
+ "@types/ws": "8.18.1",
65
+ "esbuild": "0.28.2",
66
+ "typescript": "5.9.3",
67
+ "dshm-protocol": "file:../protocol"
68
+ }
69
+ }