super-dsh 0.3.2 → 0.3.3-c

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 (61) hide show
  1. package/README.md +15 -14
  2. package/agent-agy/dist/agent.d.ts +4 -1
  3. package/agent-agy/dist/agent.js +15 -1
  4. package/agent-agy/dist/index.js +5 -8
  5. package/agent-agy/package.json +6 -6
  6. package/agent-agy-sdk/dist/agent.d.ts +4 -1
  7. package/agent-agy-sdk/dist/agent.js +15 -1
  8. package/agent-agy-sdk/dist/index.js +5 -8
  9. package/agent-agy-sdk/package.json +5 -5
  10. package/agent-claude/dist/agent.js +15 -1
  11. package/agent-claude/package.json +8 -8
  12. package/agent-codex/dist/agent.js +15 -1
  13. package/agent-codex/package.json +7 -7
  14. package/agent-codex-sdk/dist/agent.js +15 -1
  15. package/agent-codex-sdk/dist/index.js +5 -11
  16. package/agent-codex-sdk/package.json +7 -7
  17. package/agent-hermes/dist/agent.js +15 -1
  18. package/agent-hermes/dist/index.js +5 -8
  19. package/agent-hermes/package.json +7 -7
  20. package/agent-omp/dist/agent.js +26 -2
  21. package/agent-omp/package.json +8 -8
  22. package/agent-omp-sdk/dist/agent.d.ts +4 -1
  23. package/agent-omp-sdk/dist/agent.js +15 -1
  24. package/agent-omp-sdk/package.json +8 -8
  25. package/agent-pi/dist/agent.js +20 -2
  26. package/agent-pi/dist/index.js +5 -11
  27. package/agent-pi/package.json +7 -7
  28. package/client/index.js +106 -249
  29. package/cordis.patch.yml +0 -6
  30. package/package.json +22 -27
  31. package/remote/hub-pty-pump.mjs +97 -0
  32. package/remote/plugin.d.ts +476 -200
  33. package/remote/plugin.js +1448 -667
  34. package/remote/provenance.json +22 -17
  35. package/superd-hub/dist/agent-model-face.d.ts +93 -0
  36. package/superd-hub/dist/agent-model-face.js +113 -0
  37. package/superd-hub/dist/exec.d.ts +3 -2
  38. package/superd-hub/dist/exec.js +6 -5
  39. package/superd-hub/dist/fusion-transport.js +0 -1
  40. package/superd-hub/dist/hub-tool.d.ts +1 -1
  41. package/superd-hub/dist/hub-tool.js +6 -6
  42. package/superd-hub/dist/index.d.ts +1 -0
  43. package/superd-hub/dist/index.js +1 -0
  44. package/superd-hub/dist/remote-provider.js +70 -36
  45. package/superd-hub/dist/world-entry.js +30 -0
  46. package/superd-hub/lib/client/index.js +106 -249
  47. package/superd-hub/package.json +14 -10
  48. package/superd-hub/dist/bundle-setup.d.ts +0 -27
  49. package/superd-hub/dist/bundle-setup.js +0 -94
  50. package/superd-hub/dist/client/companion-api.d.ts +0 -5
  51. package/superd-hub/dist/client/companion-api.js +0 -30
  52. package/superd-hub/dist/companion-contract.d.ts +0 -9
  53. package/superd-hub/dist/companion-contract.js +0 -1
  54. package/superd-hub/dist/companions.d.ts +0 -30
  55. package/superd-hub/dist/companions.js +0 -211
  56. package/superd-hub/dist/exec-pty-channel.d.ts +0 -58
  57. package/superd-hub/dist/exec-pty-channel.js +0 -162
  58. package/superd-hub/dist/exec-pty-framing.d.ts +0 -34
  59. package/superd-hub/dist/exec-pty-framing.js +0 -89
  60. package/superd-hub/dist/exec-pty-session.d.ts +0 -78
  61. package/superd-hub/dist/exec-pty-session.js +0 -228
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-dsh",
3
- "version": "0.3.2",
3
+ "version": "0.3.3-c",
4
4
  "description": "Super D for the DeepSeek Harness (DSH) — one dsh plugin that mounts the superd hub (runtime selector, roster, per-runtime agents) and joins local foreign-agent runtimes (OMP, Codex, Claude, Pi, Hermes, Antigravity) into the DSH Web UI. Each runtime keeps its native home and session store; the hub only bridges.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -26,12 +26,7 @@
26
26
  "./cordis.patch.yml": "./cordis.patch.yml",
27
27
  "./package.json": "./package.json",
28
28
  "./fusion-transport": "./superd-hub/dist/fusion-transport.js",
29
- "./a2a": "./superd-hub/dist/a2a-row.js",
30
- "./setup": "./superd-hub/dist/bundle-setup.js",
31
- "./remote": {
32
- "types": "./remote/plugin.d.ts",
33
- "default": "./remote/plugin.js"
34
- }
29
+ "./a2a": "./superd-hub/dist/a2a-row.js"
35
30
  },
36
31
  "files": [
37
32
  "cordis.patch.yml",
@@ -93,26 +88,26 @@
93
88
  },
94
89
  "peerDependencies": {
95
90
  "@deepseek-ai/cordis": "^4.0.1",
96
- "@deepseek-ai/dsh-agent": ">=0.1.5-0 <0.3.0-0",
97
- "@deepseek-ai/dsh-agent-presets": ">=0.1.5-0 <0.3.0-0",
98
- "@deepseek-ai/dsh-api-gateway": ">=0.1.5-0 <0.3.0-0",
99
- "@deepseek-ai/dsh-commands": ">=0.1.5-0 <0.3.0-0",
100
- "@deepseek-ai/dsh-home-paths": ">=0.1.5-0 <0.3.0-0",
101
- "@deepseek-ai/dsh-host-webserver": ">=0.1.5-0 <0.3.0-0",
102
- "@deepseek-ai/dsh-llm": ">=0.1.5-0 <0.3.0-0",
103
- "@deepseek-ai/dsh-scope": ">=0.1.5-0 <0.3.0-0",
104
- "@deepseek-ai/dsh-session": ">=0.1.5-0 <0.3.0-0",
105
- "@deepseek-ai/dsh-session-persistence": ">=0.1.5-0 <0.3.0-0",
106
- "@deepseek-ai/dsh-tools": ">=0.1.5-0 <0.3.0-0",
107
- "@deepseek-ai/dsh-typert-protocol": ">=0.1.5-0 <0.3.0-0",
108
- "@deepseek-ai/dsh-user-approval": ">=0.1.5-0 <0.3.0-0",
109
- "@deepseek-ai/dsh-user-questions": ">=0.1.5-0 <0.3.0-0",
110
- "@deepseek-ai/dsh-client-connection": ">=0.1.5-0 <0.3.0-0",
111
- "@deepseek-ai/dsh-app-boot": ">=0.1.5-0 <0.3.0-0",
112
- "@deepseek-ai/dsh-atomic-write": ">=0.1.5-0 <0.3.0-0",
113
- "@deepseek-ai/dsh-cmdline": ">=0.1.5-0 <0.3.0-0",
114
- "@deepseek-ai/dsh-plugin-manager": ">=0.1.5-0 <0.3.0-0",
115
- "@deepseek-ai/dsh-jobs": ">=0.1.5-0 <0.3.0-0"
91
+ "@deepseek-ai/dsh-agent": ">=0.2.0-0 <1.0.0-0",
92
+ "@deepseek-ai/dsh-agent-presets": ">=0.2.0-0 <1.0.0-0",
93
+ "@deepseek-ai/dsh-api-gateway": ">=0.2.0-0 <1.0.0-0",
94
+ "@deepseek-ai/dsh-commands": ">=0.2.0-0 <1.0.0-0",
95
+ "@deepseek-ai/dsh-home-paths": ">=0.2.0-0 <1.0.0-0",
96
+ "@deepseek-ai/dsh-host-webserver": ">=0.2.0-0 <1.0.0-0",
97
+ "@deepseek-ai/dsh-llm": ">=0.2.0-0 <1.0.0-0",
98
+ "@deepseek-ai/dsh-scope": ">=0.2.0-0 <1.0.0-0",
99
+ "@deepseek-ai/dsh-session": ">=0.2.0-0 <1.0.0-0",
100
+ "@deepseek-ai/dsh-session-persistence": ">=0.2.0-0 <1.0.0-0",
101
+ "@deepseek-ai/dsh-tools": ">=0.2.0-0 <1.0.0-0",
102
+ "@deepseek-ai/dsh-typert-protocol": ">=0.2.0-0 <1.0.0-0",
103
+ "@deepseek-ai/dsh-user-approval": ">=0.2.0-0 <1.0.0-0",
104
+ "@deepseek-ai/dsh-user-questions": ">=0.2.0-0 <1.0.0-0",
105
+ "@deepseek-ai/dsh-client-connection": ">=0.2.0-0 <1.0.0-0",
106
+ "@deepseek-ai/dsh-app-boot": ">=0.2.0-0 <1.0.0-0",
107
+ "@deepseek-ai/dsh-atomic-write": ">=0.2.0-0 <1.0.0-0",
108
+ "@deepseek-ai/dsh-cmdline": ">=0.2.0-0 <1.0.0-0",
109
+ "@deepseek-ai/dsh-plugin-manager": ">=0.2.0-0 <1.0.0-0",
110
+ "@deepseek-ai/dsh-jobs": ">=0.2.0-0 <1.0.0-0"
116
111
  },
117
112
  "peerDependenciesMeta": {
118
113
  "@deepseek-ai/cordis": {
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env node
2
+ // Hub PTY pump — the DUMB child of the canonical PTY session over a Hub
3
+ // machine (0.3.2-c). The session (better-dsh/src/remote/pty-session.ts)
4
+ // spawns `script -qfec 'stty -echo; … exec node <this file>' /dev/null`, so
5
+ // this process's stdin/stdout ride a host-side PTY; we forward those bytes
6
+ // over one WebSocket to the peer hub's dumb PTY executor
7
+ // (/api/superd/exec/pty: one WS = one `script -qfec bash /dev/null`, text
8
+ // frames = stream bytes, {"op":…} JSON frames = transport control, WS close
9
+ // = peer group-kill). All session intelligence (nonce framing, init
10
+ // handshake, env E-frames, two-stage interrupt, idle TTL) is in-band bytes
11
+ // produced by the SESSION — this pump never parses the stream, only the
12
+ // peer's control frames.
13
+ //
14
+ // Connection facts arrive via environment (never argv — credentials must not
15
+ // show up in `ps`):
16
+ // SUPERD_HUB_PTY_URL wss://…/api/superd/exec/pty (peer executor)
17
+ // SUPERD_HUB_PTY_COOKIE pairing cookie for the upgrade request
18
+ // SUPERD_HUB_PTY_WS ABSOLUTE path to a usable `ws` module (resolved by
19
+ // the caller before spawning; no resolution gamble
20
+ // here — a missing module is a creation-time error)
21
+ //
22
+ // Verbatim-asset discipline (helper-bin precedent): this file is copied
23
+ // byte-for-byte into lib/remote/ and the Super closure; no build step
24
+ // transforms it. Crash-proof by construction (mesh-gateway lesson): the
25
+ // 'error' listener is registered before anything can reject, and post-close
26
+ // sends are swallowed — the session's death path owns the teardown.
27
+ const PUMP_ENV_PREFIX = 'SUPERD_HUB_PTY_'
28
+ const [url, cookie, wsPath] = ['URL', 'COOKIE', 'WS'].map((k) => process.env[`SUPERD_HUB_PTY_${k}`])
29
+
30
+ // cookie may be legitimately empty (an unauthenticated test lane sends no header);
31
+ // the endpoint URL and the ws module path are the hard requirements.
32
+ if (url === undefined || url === '' || wsPath === undefined || wsPath === '') {
33
+ process.stderr.write(`hub-pty-pump: missing environment (${PUMP_ENV_PREFIX}URL/WS)\n`)
34
+ process.exit(1)
35
+ }
36
+
37
+ let WebSocket
38
+ try {
39
+ const require = (await import('node:module')).createRequire(import.meta.url)
40
+ const mod = require(wsPath)
41
+ WebSocket = typeof mod === 'function' ? mod : mod.default
42
+ } catch (err) {
43
+ process.stderr.write(`hub-pty-pump: cannot load ws module at ${wsPath} — ${err instanceof Error ? err.message : String(err)}\n`)
44
+ process.exit(1)
45
+ }
46
+ if (typeof WebSocket !== 'function') {
47
+ process.stderr.write('hub-pty-pump: the ws module did not yield a WebSocket constructor\n')
48
+ process.exit(1)
49
+ }
50
+
51
+ const socket = new WebSocket(url, { headers: cookie ? { cookie } : {} })
52
+ let opened = false
53
+ let forward = true
54
+
55
+ socket.on('error', (err) => {
56
+ // Always-on listener: an ECONNREFUSED or a rejected 401 upgrade must be a
57
+ // reported death, never an uncaught exception.
58
+ process.stderr.write(`hub-pty-pump: ${opened ? 'socket error' : 'connect failed'} — ${err instanceof Error ? err.message : String(err)}\n`)
59
+ })
60
+ socket.on('open', () => { opened = true; pumpStdin() })
61
+ socket.on('message', (data) => {
62
+ if (!forward) return
63
+ const text = typeof data === 'string' ? data : Array.isArray(data) ? Buffer.concat(data).toString('utf8') : Buffer.from(data).toString('utf8')
64
+ // Transport control frames (peer: {"op":"exit"} / {"op":"spawn-error"}) are
65
+ // addressed to THIS pump, not to the shell stream — the exit frame is
66
+ // followed by a socket close, which settles us below.
67
+ if (text.startsWith('{"op":')) {
68
+ try {
69
+ const parsed = JSON.parse(text)
70
+ if (typeof parsed.op === 'string') {
71
+ if (parsed.op === 'spawn-error' && typeof parsed.error === 'string') process.stderr.write(`hub-pty-pump: peer could not spawn the terminal — ${parsed.error}\n`)
72
+ return
73
+ }
74
+ } catch { /* not JSON after all: fall through and forward */ }
75
+ }
76
+ process.stdout.write(text)
77
+ })
78
+ socket.on('close', () => {
79
+ forward = false
80
+ // Before open this is a failed connection (diag already on stderr); after
81
+ // open it is the peer session ending — either way the child exiting is the
82
+ // session's dead signal.
83
+ process.exit(opened ? 0 : 1)
84
+ })
85
+
86
+ function pumpStdin() {
87
+ process.stdin.setEncoding('utf8')
88
+ process.stdin.on('data', (chunk) => {
89
+ if (!opened) return
90
+ try { socket.send(chunk) } catch { /* closing: the close handler exits us */ }
91
+ })
92
+ // The session's kill path tears down the process group; a plain stdin end
93
+ // (no kill) still means nobody will type more — close politely so the peer
94
+ // reaps its side.
95
+ process.stdin.on('end', () => { try { socket.close() } catch { /* already closing */ } })
96
+ process.stdin.on('error', () => { /* EPIPE on teardown: the close path owns the exit */ })
97
+ }