super-dsh 0.1.6 → 0.1.10-e

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 (260) hide show
  1. package/README.md +25 -3
  2. package/agent-agy/cordis.patch.yml +7 -4
  3. package/agent-agy/dist/agent.d.ts +12 -11
  4. package/agent-agy/dist/agy-auth-gateway.d.ts +124 -0
  5. package/agent-agy/dist/agy-auth-gateway.js +233 -0
  6. package/agent-agy/dist/agy-auth.d.ts +153 -0
  7. package/agent-agy/dist/agy-auth.js +179 -0
  8. package/agent-agy/dist/agy-cli-client.d.ts +39 -9
  9. package/agent-agy/dist/agy-cli-client.js +82 -18
  10. package/agent-agy/dist/agy-store.d.ts +8 -0
  11. package/agent-agy/dist/index.d.ts +46 -16
  12. package/agent-agy/dist/index.js +82 -56
  13. package/agent-agy/dist/models.d.ts +70 -0
  14. package/agent-agy/dist/models.js +102 -3
  15. package/agent-agy/package.json +7 -5
  16. package/agent-agy-sdk/cordis.patch.yml +58 -0
  17. package/agent-agy-sdk/dist/adapter.d.ts +15 -0
  18. package/agent-agy-sdk/dist/adapter.js +42 -0
  19. package/agent-agy-sdk/dist/agent-preset-agy.d.ts +27 -0
  20. package/agent-agy-sdk/dist/agent-preset-agy.js +32 -0
  21. package/agent-agy-sdk/dist/agent.d.ts +138 -0
  22. package/agent-agy-sdk/dist/agent.js +494 -0
  23. package/{agent-agy → agent-agy-sdk}/dist/agy-client.d.ts +26 -6
  24. package/{agent-agy → agent-agy-sdk}/dist/agy-client.js +43 -25
  25. package/agent-agy-sdk/dist/agy-sessions.d.ts +25 -0
  26. package/agent-agy-sdk/dist/agy-sessions.js +107 -0
  27. package/agent-agy-sdk/dist/agy-store.d.ts +39 -0
  28. package/agent-agy-sdk/dist/agy-store.js +83 -0
  29. package/agent-agy-sdk/dist/inbox.d.ts +26 -0
  30. package/agent-agy-sdk/dist/inbox.js +53 -0
  31. package/agent-agy-sdk/dist/index.d.ts +93 -0
  32. package/agent-agy-sdk/dist/index.js +476 -0
  33. package/agent-agy-sdk/dist/models.d.ts +41 -0
  34. package/agent-agy-sdk/dist/models.js +74 -0
  35. package/agent-agy-sdk/dist/sdk-venv.d.ts +76 -0
  36. package/agent-agy-sdk/dist/sdk-venv.js +173 -0
  37. package/agent-agy-sdk/dist/world-plugin.d.ts +10 -0
  38. package/agent-agy-sdk/dist/world-plugin.js +82 -0
  39. package/agent-agy-sdk/package.json +64 -0
  40. package/agent-claude/dist/adapter.js +106 -31
  41. package/agent-claude/dist/agent.js +154 -17
  42. package/agent-claude/dist/claude-client.js +84 -43
  43. package/agent-claude/dist/claude-launch.js +101 -0
  44. package/agent-claude/dist/claude-native-config.js +169 -0
  45. package/agent-claude/dist/claude-provider-gateway.js +340 -0
  46. package/agent-claude/dist/claude-providers.js +391 -0
  47. package/agent-claude/dist/claude-route.js +152 -0
  48. package/agent-claude/dist/index.js +214 -37
  49. package/agent-claude/dist/models.js +14 -0
  50. package/agent-claude/dist/sdk-runtime.js +320 -0
  51. package/agent-claude/package.json +6 -4
  52. package/agent-codex/README.md +141 -36
  53. package/agent-codex/cordis.patch.yml +14 -10
  54. package/agent-codex/dist/adapter.js +64 -28
  55. package/agent-codex/dist/agent.js +255 -81
  56. package/agent-codex/dist/app-server-approvals.js +165 -0
  57. package/agent-codex/dist/app-server-client.js +723 -0
  58. package/agent-codex/dist/app-server-events.js +432 -0
  59. package/agent-codex/dist/app-server-protocol.js +95 -0
  60. package/agent-codex/dist/app-server-wire.js +299 -0
  61. package/agent-codex/dist/codex-launch.js +78 -0
  62. package/agent-codex/dist/codex-native-config.js +392 -0
  63. package/agent-codex/dist/codex-provider-gateway.js +402 -0
  64. package/agent-codex/dist/codex-providers.js +376 -0
  65. package/agent-codex/dist/codex-route.js +86 -0
  66. package/agent-codex/dist/index.js +256 -115
  67. package/agent-codex/dist/permission.js +75 -1
  68. package/agent-codex/package.json +1 -2
  69. package/agent-codex-sdk/README.md +79 -0
  70. package/agent-codex-sdk/cordis.patch.yml +81 -0
  71. package/agent-codex-sdk/dist/adapter.js +91 -0
  72. package/agent-codex-sdk/dist/agent-preset-codex.js +32 -0
  73. package/agent-codex-sdk/dist/agent.js +1085 -0
  74. package/agent-codex-sdk/dist/codex-native-config.js +392 -0
  75. package/agent-codex-sdk/dist/codex-provider-gateway.js +402 -0
  76. package/agent-codex-sdk/dist/codex-providers.js +376 -0
  77. package/agent-codex-sdk/dist/codex-route.js +86 -0
  78. package/{agent-codex/dist/codex-client.js → agent-codex-sdk/dist/codex-sdk-client.js} +253 -32
  79. package/agent-codex-sdk/dist/codex-sdk-launch.js +92 -0
  80. package/agent-codex-sdk/dist/codex-store.js +180 -0
  81. package/agent-codex-sdk/dist/inbox.js +53 -0
  82. package/agent-codex-sdk/dist/index.js +739 -0
  83. package/agent-codex-sdk/dist/permission.js +71 -0
  84. package/agent-codex-sdk/dist/sdk-runtime.js +307 -0
  85. package/agent-codex-sdk/dist/session-map.js +167 -0
  86. package/agent-codex-sdk/dist/world-plugin.js +93 -0
  87. package/agent-codex-sdk/package.json +79 -0
  88. package/agent-codex-sdk/scripts/fetch-sdk-runtime.mjs +57 -0
  89. package/agent-omp/README.md +72 -55
  90. package/agent-omp/dist/agent.js +36 -11
  91. package/agent-omp/dist/index.js +92 -52
  92. package/agent-omp/dist/lazy-rpc.js +11 -4
  93. package/agent-omp/dist/omp-cli.js +114 -97
  94. package/agent-omp/dist/omp-store.js +12 -4
  95. package/agent-omp/dist/permission.js +70 -5
  96. package/agent-omp/dist/rpc-client.js +409 -0
  97. package/agent-omp/dist/world-plugin.js +36 -3
  98. package/agent-omp/package.json +2 -6
  99. package/agent-omp-sdk/README.md +103 -0
  100. package/agent-omp-sdk/cordis.patch.yml +108 -0
  101. package/agent-omp-sdk/dist/adapter.d.ts +21 -0
  102. package/agent-omp-sdk/dist/adapter.js +36 -0
  103. package/agent-omp-sdk/dist/agent-preset-omp.d.ts +31 -0
  104. package/agent-omp-sdk/dist/agent-preset-omp.js +32 -0
  105. package/agent-omp-sdk/dist/agent.d.ts +64 -0
  106. package/agent-omp-sdk/dist/agent.js +1178 -0
  107. package/agent-omp-sdk/dist/discovery.d.ts +57 -0
  108. package/agent-omp-sdk/dist/discovery.js +116 -0
  109. package/agent-omp-sdk/dist/inbox.d.ts +28 -0
  110. package/agent-omp-sdk/dist/inbox.js +53 -0
  111. package/agent-omp-sdk/dist/index.d.ts +60 -0
  112. package/agent-omp-sdk/dist/index.js +632 -0
  113. package/agent-omp-sdk/dist/knobs.d.ts +34 -0
  114. package/agent-omp-sdk/dist/knobs.js +50 -0
  115. package/agent-omp-sdk/dist/lazy-rpc.d.ts +98 -0
  116. package/agent-omp-sdk/dist/lazy-rpc.js +178 -0
  117. package/agent-omp-sdk/dist/mobile/zoom-guard.d.ts +187 -0
  118. package/agent-omp-sdk/dist/mobile/zoom-guard.js +294 -0
  119. package/agent-omp-sdk/dist/mobile-boot.d.ts +49 -0
  120. package/agent-omp-sdk/dist/mobile-boot.js +38 -0
  121. package/agent-omp-sdk/dist/models.d.ts +39 -0
  122. package/agent-omp-sdk/dist/models.js +299 -0
  123. package/agent-omp-sdk/dist/omp-cli.d.ts +67 -0
  124. package/agent-omp-sdk/dist/omp-cli.js +164 -0
  125. package/agent-omp-sdk/dist/omp-disk-discovery.d.ts +27 -0
  126. package/agent-omp-sdk/dist/omp-disk-discovery.js +178 -0
  127. package/agent-omp-sdk/dist/omp-executable.d.ts +2 -0
  128. package/agent-omp-sdk/dist/omp-executable.js +30 -0
  129. package/agent-omp-sdk/dist/omp-store.d.ts +134 -0
  130. package/agent-omp-sdk/dist/omp-store.js +526 -0
  131. package/agent-omp-sdk/dist/pairing.d.ts +7 -0
  132. package/agent-omp-sdk/dist/pairing.js +45 -0
  133. package/agent-omp-sdk/dist/permission.d.ts +138 -0
  134. package/agent-omp-sdk/dist/permission.js +161 -0
  135. package/agent-omp-sdk/dist/protocol.d.ts +189 -0
  136. package/agent-omp-sdk/dist/rpc-types.d.ts +77 -0
  137. package/agent-omp-sdk/dist/rpc-types.js +1 -0
  138. package/agent-omp-sdk/dist/sdk-client.d.ts +160 -0
  139. package/{agent-omp → agent-omp-sdk}/dist/sdk-client.js +108 -56
  140. package/agent-omp-sdk/dist/sdk-runtime.d.ts +211 -0
  141. package/agent-omp-sdk/dist/sdk-runtime.js +418 -0
  142. package/agent-omp-sdk/dist/sidecar-client.d.ts +87 -0
  143. package/agent-omp-sdk/dist/sidecar-client.js +197 -0
  144. package/agent-omp-sdk/dist/store/adapter.d.ts +17 -0
  145. package/agent-omp-sdk/dist/store/adapter.js +47 -0
  146. package/agent-omp-sdk/dist/store/db.d.ts +70 -0
  147. package/agent-omp-sdk/dist/store/db.js +210 -0
  148. package/agent-omp-sdk/dist/store/index.d.ts +23 -0
  149. package/agent-omp-sdk/dist/store/index.js +59 -0
  150. package/agent-omp-sdk/dist/store/reconcile.d.ts +15 -0
  151. package/agent-omp-sdk/dist/store/reconcile.js +51 -0
  152. package/agent-omp-sdk/dist/store/schema.d.ts +8 -0
  153. package/agent-omp-sdk/dist/store/schema.js +40 -0
  154. package/agent-omp-sdk/dist/transport.d.ts +49 -0
  155. package/agent-omp-sdk/dist/transport.js +35 -0
  156. package/agent-omp-sdk/dist/world-home.d.ts +4 -0
  157. package/agent-omp-sdk/dist/world-home.js +23 -0
  158. package/agent-omp-sdk/dist/world-plugin.d.ts +10 -0
  159. package/agent-omp-sdk/dist/world-plugin.js +137 -0
  160. package/agent-omp-sdk/package.json +87 -0
  161. package/client/index.js +1883 -287
  162. package/cordis.patch.yml +80 -0
  163. package/package.json +23 -9
  164. package/superd-hub/dist/a2a-delivery.d.ts +189 -0
  165. package/superd-hub/dist/a2a-delivery.js +240 -0
  166. package/superd-hub/dist/a2a-host.d.ts +76 -0
  167. package/superd-hub/dist/a2a-host.js +145 -0
  168. package/superd-hub/dist/a2a-ingest.d.ts +31 -0
  169. package/superd-hub/dist/a2a-ingest.js +636 -0
  170. package/superd-hub/dist/a2a-log.d.ts +17 -0
  171. package/superd-hub/dist/a2a-log.js +42 -0
  172. package/superd-hub/dist/a2a-row.d.ts +65 -0
  173. package/superd-hub/dist/a2a-row.js +162 -0
  174. package/superd-hub/dist/a2a-service.d.ts +357 -0
  175. package/superd-hub/dist/a2a-service.js +980 -0
  176. package/superd-hub/dist/a2a-wire.d.ts +220 -0
  177. package/superd-hub/dist/a2a-wire.js +305 -0
  178. package/superd-hub/dist/agent-ids.d.ts +10 -0
  179. package/superd-hub/dist/agent-ids.js +68 -0
  180. package/superd-hub/dist/agent-roster.d.ts +29 -18
  181. package/superd-hub/dist/agent-roster.js +54 -15
  182. package/superd-hub/dist/agent-status.d.ts +119 -0
  183. package/superd-hub/dist/agent-status.js +386 -0
  184. package/superd-hub/dist/client/agent-settings.d.ts +210 -0
  185. package/superd-hub/dist/client/agent-settings.js +300 -0
  186. package/superd-hub/dist/client/mesh-api.d.ts +134 -0
  187. package/superd-hub/dist/client/mesh-api.js +219 -0
  188. package/superd-hub/dist/client/mesh-groups.d.ts +63 -0
  189. package/superd-hub/dist/client/mesh-groups.js +66 -0
  190. package/superd-hub/dist/client/roster.d.ts +48 -0
  191. package/superd-hub/dist/client/roster.js +102 -0
  192. package/superd-hub/dist/client/runtime-settings-api.d.ts +76 -0
  193. package/superd-hub/dist/client/runtime-settings-api.js +137 -0
  194. package/superd-hub/dist/client/switch.d.ts +165 -0
  195. package/superd-hub/dist/client/switch.js +295 -0
  196. package/superd-hub/dist/exec-pty-channel.d.ts +58 -0
  197. package/superd-hub/dist/exec-pty-channel.js +162 -0
  198. package/superd-hub/dist/exec-pty-framing.d.ts +32 -0
  199. package/superd-hub/dist/exec-pty-framing.js +81 -0
  200. package/superd-hub/dist/exec-pty-rpc.d.ts +21 -0
  201. package/superd-hub/dist/exec-pty-rpc.js +128 -0
  202. package/superd-hub/dist/exec-pty-session.d.ts +76 -0
  203. package/superd-hub/dist/exec-pty-session.js +234 -0
  204. package/superd-hub/dist/exec.d.ts +56 -0
  205. package/superd-hub/dist/exec.js +225 -0
  206. package/superd-hub/dist/gateway.d.ts +39 -2
  207. package/superd-hub/dist/gateway.js +62 -3
  208. package/superd-hub/dist/hub-tool.d.ts +174 -0
  209. package/superd-hub/dist/hub-tool.js +464 -0
  210. package/superd-hub/dist/index.d.ts +15 -1
  211. package/superd-hub/dist/index.js +16 -0
  212. package/superd-hub/dist/machines.d.ts +45 -0
  213. package/superd-hub/dist/machines.js +125 -0
  214. package/superd-hub/dist/mesh-federate.d.ts +138 -0
  215. package/superd-hub/dist/mesh-federate.js +223 -0
  216. package/superd-hub/dist/mesh-gateway.d.ts +67 -0
  217. package/superd-hub/dist/mesh-gateway.js +408 -0
  218. package/superd-hub/dist/mesh-link.d.ts +274 -0
  219. package/superd-hub/dist/mesh-link.js +441 -0
  220. package/superd-hub/dist/mesh-rpc.d.ts +123 -0
  221. package/superd-hub/dist/mesh-rpc.js +250 -0
  222. package/superd-hub/dist/mux-client.d.ts +71 -0
  223. package/superd-hub/dist/mux-client.js +281 -0
  224. package/superd-hub/dist/pack-version.d.ts +2 -0
  225. package/superd-hub/dist/pack-version.js +30 -0
  226. package/superd-hub/dist/roster.d.ts +6 -0
  227. package/superd-hub/dist/rpc.d.ts +18 -2
  228. package/superd-hub/dist/rpc.js +34 -4
  229. package/superd-hub/dist/spawn-world.js +3 -1
  230. package/superd-hub/dist/switch-core.d.ts +62 -25
  231. package/superd-hub/dist/switch-core.js +53 -30
  232. package/superd-hub/dist/system-head.d.ts +22 -12
  233. package/superd-hub/dist/system-head.js +100 -84
  234. package/superd-hub/dist/wire-endpoints.d.ts +264 -0
  235. package/superd-hub/dist/wire-endpoints.js +180 -0
  236. package/superd-hub/lib/client/index.js +1883 -287
  237. package/superd-hub/package.json +11 -2
  238. package/agent-agy/dist/agent-preset-projection.d.ts +0 -31
  239. package/agent-agy/dist/agent-preset-projection.js +0 -33
  240. package/agent-claude/dist/agent-preset-projection.js +0 -30
  241. package/agent-codex/dist/agent-preset-projection.js +0 -37
  242. package/agent-codex/dist/app-home.js +0 -65
  243. package/agent-codex/dist/models.js +0 -152
  244. package/agent-codex/dist/spike.js +0 -46
  245. package/agent-hermes/dist/agent-preset-projection.js +0 -34
  246. package/agent-omp/dist/agent-preset-projection.js +0 -36
  247. package/agent-omp/dist/app-home.js +0 -86
  248. package/agent-omp/dist/sidecar-client.js +0 -195
  249. package/agent-pi/dist/agent-preset-projection.js +0 -29
  250. package/superd-hub/dist/client-shim.d.ts +0 -28
  251. package/superd-hub/dist/client-shim.js +0 -251
  252. package/superd-hub/dist/index-pass.d.ts +0 -22
  253. package/superd-hub/dist/index-pass.js +0 -47
  254. package/superd-hub/dist/labels.d.ts +0 -45
  255. package/superd-hub/dist/labels.js +0 -83
  256. /package/{agent-agy → agent-agy-sdk}/bridge/agy_bridge.py +0 -0
  257. /package/{agent-agy → agent-agy-sdk}/bridge/gemini_openai_server.mjs +0 -0
  258. /package/{agent-codex/dist/codex-events.js → agent-codex-sdk/dist/codex-sdk-events.js} +0 -0
  259. /package/{agent-omp → agent-omp-sdk}/dist/protocol.js +0 -0
  260. /package/{agent-omp → agent-omp-sdk}/sidecar/main.ts +0 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Bridge session index — dsh↔omp identity mapping only.
3
+ *
4
+ * dsh-shape-session-log: the index is no longer a mirror of OMP's native
5
+ * store. The dsh session log is of record, and this index holds ONLY the
6
+ * `dsh_session_id ↔ omp_session_id ↔ session_file` mapping written at first
7
+ * spawn (plus the workspace-attach source for the UI). The union-era OMP-store
8
+ * scan, stat reconcile, prune, and the webui.json migration are all retired:
9
+ * pruning by an OMP-store scan deleted these mappings and broke resume.
10
+ */
11
+ import { statSync } from "node:fs";
12
+ /**
13
+ * Boot the index before anything reads session state: ensure the ungrouped
14
+ * fallback workspace exists. Idempotent.
15
+ */
16
+ export function prepareIndex(store) {
17
+ store.ensureUngroupedWorkspace();
18
+ }
19
+ /** Event-driven INSERT at first spawn: record the identity mapping + preset. */
20
+ export function upsertCreated(store, input) {
21
+ let size = 0;
22
+ let mtimeMs = Date.now();
23
+ try {
24
+ const stat = statSync(input.sessionFile);
25
+ size = stat.size;
26
+ mtimeMs = stat.mtimeMs;
27
+ }
28
+ catch {
29
+ // File not yet flushable — the next boot pass fills stat lazily.
30
+ }
31
+ store.upsert({
32
+ omp_session_id: input.ompSessionId,
33
+ dsh_session_id: input.dshSessionId,
34
+ session_file: input.sessionFile,
35
+ cwd: input.cwd ?? null,
36
+ title: null,
37
+ // v2 header identity: the row's created_at MUST equal the live session
38
+ // header's createdAt, or session-query's cross-observation header check
39
+ // (assertSessionHeadersCompatible) throws SOURCE_CONFLICT for the id.
40
+ created_at: input.createdAt ?? Date.now(),
41
+ last_modified_at: mtimeMs,
42
+ transcript_size: size,
43
+ model_provider: null,
44
+ model_id: null,
45
+ agent_preset: "omp",
46
+ permission_preset: input.preset ?? null,
47
+ forked_from: null,
48
+ archived: 0,
49
+ last_visited_at: null,
50
+ });
51
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * SQLite schema for the bridge's centralized session index.
3
+ *
4
+ * One `sessions` table carries mapping + metadata + UI fields 1:1 (D2); two
5
+ * aux tables carry workspace grouping/ordering and singleton UI state. The
6
+ * schema is idempotent (`IF NOT EXISTS`), applied on every open.
7
+ */
8
+ export declare const SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS sessions (\n omp_session_id TEXT PRIMARY KEY, -- OMP uuidv7 (session header id)\n dsh_session_id TEXT NOT NULL UNIQUE, -- DSH-facing id (real or derived)\n session_file TEXT NOT NULL UNIQUE, -- transcript absolute path\n cwd TEXT, -- working directory (NULL \u2192 ungrouped)\n title TEXT, -- display title (latest wins)\n created_at INTEGER NOT NULL, -- epoch ms\n last_modified_at INTEGER NOT NULL, -- transcript mtime (default sort key)\n transcript_size INTEGER NOT NULL, -- bytes (reconcile change detection)\n model_provider TEXT, -- last model provider (complete, D6)\n model_id TEXT, -- last model id\n agent_preset TEXT, -- DSH composition id (always \"omp\")\n permission_preset TEXT, -- approval preset (danger-full-access/workspace-write/read-only)\n forked_from TEXT, -- fork source dsh_session_id (NULL = not a fork)\n archived INTEGER NOT NULL DEFAULT 0, -- archive flag (default list excludes)\n last_visited_at INTEGER -- last view epoch ms (refresh priority, D10)\n);\nCREATE INDEX IF NOT EXISTS sessions_cwd ON sessions(cwd);\nCREATE INDEX IF NOT EXISTS sessions_mtime ON sessions(last_modified_at DESC);\nCREATE INDEX IF NOT EXISTS sessions_visit ON sessions(last_visited_at DESC);\n\nCREATE TABLE IF NOT EXISTS workspaces (\n workspace_id TEXT PRIMARY KEY, -- = cwd path; 'ungrouped' sentinel (D8)\n title TEXT,\n manual_order TEXT -- JSON array of dsh_session_id (manual mode, D9)\n);\n\nCREATE TABLE IF NOT EXISTS ui_state (\n key TEXT PRIMARY KEY,\n value TEXT -- e.g. sort_mode = 'last_updated' | 'manual'\n);\n";
@@ -0,0 +1,40 @@
1
+ /**
2
+ * SQLite schema for the bridge's centralized session index.
3
+ *
4
+ * One `sessions` table carries mapping + metadata + UI fields 1:1 (D2); two
5
+ * aux tables carry workspace grouping/ordering and singleton UI state. The
6
+ * schema is idempotent (`IF NOT EXISTS`), applied on every open.
7
+ */
8
+ export const SCHEMA_SQL = `
9
+ CREATE TABLE IF NOT EXISTS sessions (
10
+ omp_session_id TEXT PRIMARY KEY, -- OMP uuidv7 (session header id)
11
+ dsh_session_id TEXT NOT NULL UNIQUE, -- DSH-facing id (real or derived)
12
+ session_file TEXT NOT NULL UNIQUE, -- transcript absolute path
13
+ cwd TEXT, -- working directory (NULL → ungrouped)
14
+ title TEXT, -- display title (latest wins)
15
+ created_at INTEGER NOT NULL, -- epoch ms
16
+ last_modified_at INTEGER NOT NULL, -- transcript mtime (default sort key)
17
+ transcript_size INTEGER NOT NULL, -- bytes (reconcile change detection)
18
+ model_provider TEXT, -- last model provider (complete, D6)
19
+ model_id TEXT, -- last model id
20
+ agent_preset TEXT, -- DSH composition id (always "omp")
21
+ permission_preset TEXT, -- approval preset (danger-full-access/workspace-write/read-only)
22
+ forked_from TEXT, -- fork source dsh_session_id (NULL = not a fork)
23
+ archived INTEGER NOT NULL DEFAULT 0, -- archive flag (default list excludes)
24
+ last_visited_at INTEGER -- last view epoch ms (refresh priority, D10)
25
+ );
26
+ CREATE INDEX IF NOT EXISTS sessions_cwd ON sessions(cwd);
27
+ CREATE INDEX IF NOT EXISTS sessions_mtime ON sessions(last_modified_at DESC);
28
+ CREATE INDEX IF NOT EXISTS sessions_visit ON sessions(last_visited_at DESC);
29
+
30
+ CREATE TABLE IF NOT EXISTS workspaces (
31
+ workspace_id TEXT PRIMARY KEY, -- = cwd path; 'ungrouped' sentinel (D8)
32
+ title TEXT,
33
+ manual_order TEXT -- JSON array of dsh_session_id (manual mode, D9)
34
+ );
35
+
36
+ CREATE TABLE IF NOT EXISTS ui_state (
37
+ key TEXT PRIMARY KEY,
38
+ value TEXT -- e.g. sort_mode = 'last_updated' | 'manual'
39
+ );
40
+ `;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * omp-sdk transport — the opt-in SDK face of the OMP adapter.
3
+ *
4
+ * One `createOmpSdkTransport()` = the RPC line's `LazyOmpRpc`/`OmpSdkClient`
5
+ * pair, specialized for the bun-sidecar SDK: sessions multiplex ONE sidecar
6
+ * (shared `authStorage`/`modelRegistry`) instead of one `omp --mode rpc` child
7
+ * per session.
8
+ *
9
+ * The transport is CONSTRUCTION-FREE by contract: creating a wrapper spawns
10
+ * nothing. The sidecar — and with it the lazily fetched SDK runtime
11
+ * (`ensureSdkRuntime`, `sidecar-client.ts#start`) — materializes on the first
12
+ * real dispatch (`prompt`/`followUp`/`steer`/`ensureStarted`). The same zero
13
+ * spawn window the RPC line holds, extended to cover the ~900 MB fetch.
14
+ */
15
+ import { LazyOmpRpc } from "./lazy-rpc.js";
16
+ import { type OmpSdkSidecarPool } from "./sdk-client.js";
17
+ /** What a session needs to build its transport wrapper (no side effects). */
18
+ export interface OmpSdkTransportSpec {
19
+ /**
20
+ * The session's argv (`--approval-mode <mode>`, optional `--resume <file>`),
21
+ * or a thunk resolved at SPAWN — the new-chat permission pick lands after
22
+ * the wrapper exists, so both lines resolve it at the same moment.
23
+ */
24
+ spawnArgs: string[] | (() => string[]);
25
+ /** The session cwd. */
26
+ cwd?: string;
27
+ }
28
+ /** One OMP transport instance (the SDK line). */
29
+ export interface OmpSdkTransport {
30
+ /**
31
+ * Build the session's wrapper. `LazyOmpRpc` (not the narrowed
32
+ * `OmpAgentRpc`) is the return type because the caller must be able to
33
+ * register the first-spawn adoption hook (`onSpawned`).
34
+ */
35
+ create(spec: OmpSdkTransportSpec): LazyOmpRpc;
36
+ /** The sidecar pool every session of this transport shares. */
37
+ readonly pool: OmpSdkSidecarPool;
38
+ }
39
+ /**
40
+ * Build the SDK transport.
41
+ *
42
+ * @param options.worldHome - the world home whose `sdk-runtime/` the sidecar
43
+ * runs from (default: the world plugin's `<dshHome>/agents/omp-sdk`). Passing
44
+ * it explicitly is what lets a test drive a scratch home.
45
+ * @returns the transport; nothing is fetched or spawned here.
46
+ */
47
+ export declare function createOmpSdkTransport(options?: {
48
+ worldHome?: string;
49
+ }): OmpSdkTransport;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * omp-sdk transport — the opt-in SDK face of the OMP adapter.
3
+ *
4
+ * One `createOmpSdkTransport()` = the RPC line's `LazyOmpRpc`/`OmpSdkClient`
5
+ * pair, specialized for the bun-sidecar SDK: sessions multiplex ONE sidecar
6
+ * (shared `authStorage`/`modelRegistry`) instead of one `omp --mode rpc` child
7
+ * per session.
8
+ *
9
+ * The transport is CONSTRUCTION-FREE by contract: creating a wrapper spawns
10
+ * nothing. The sidecar — and with it the lazily fetched SDK runtime
11
+ * (`ensureSdkRuntime`, `sidecar-client.ts#start`) — materializes on the first
12
+ * real dispatch (`prompt`/`followUp`/`steer`/`ensureStarted`). The same zero
13
+ * spawn window the RPC line holds, extended to cover the ~900 MB fetch.
14
+ */
15
+ import { LazyOmpRpc } from "./lazy-rpc.js";
16
+ import { createOmpSdkSidecarPool, defaultOmpSdkSidecarPool, } from "./sdk-client.js";
17
+ /**
18
+ * Build the SDK transport.
19
+ *
20
+ * @param options.worldHome - the world home whose `sdk-runtime/` the sidecar
21
+ * runs from (default: the world plugin's `<dshHome>/agents/omp-sdk`). Passing
22
+ * it explicitly is what lets a test drive a scratch home.
23
+ * @returns the transport; nothing is fetched or spawned here.
24
+ */
25
+ export function createOmpSdkTransport(options = {}) {
26
+ const pool = options.worldHome === undefined
27
+ ? defaultOmpSdkSidecarPool()
28
+ : createOmpSdkSidecarPool({ worldHome: options.worldHome });
29
+ return {
30
+ pool,
31
+ create(spec) {
32
+ return new LazyOmpRpc(spec.spawnArgs, spec.cwd, pool);
33
+ },
34
+ };
35
+ }
@@ -0,0 +1,4 @@
1
+ /** The roster/world key — also the directory name under `agents/`. */
2
+ export declare const OMP_SDK_WORLD_KEY = "omp-sdk";
3
+ /** `<dshHome>/agents/omp-sdk`. */
4
+ export declare function resolveOmpSdkWorldHome(dshHome?: string): string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Where the omp-sdk world lives on disk.
3
+ *
4
+ * The world home is `<dshHome>/agents/omp-sdk` — the SAME derivation the world
5
+ * plugin (`world-plugin.ts`) uses, kept in one pure function so the adapter's
6
+ * lazy runtime fetch lands exactly where `provisionWorldProfile` provisioned
7
+ * the world.
8
+ *
9
+ * `resolveDshHome()` (the harness resolver: `$DSH_HOME` → `~/.dsh`) is used
10
+ * rather than a bare `process.env.DSH_HOME` read — a consumer install has no
11
+ * DSH_HOME exported, and the bare read resolves to the wrong tree (recorded
12
+ * pit in the RPC line's AGENTS.md §五). Nothing here touches the filesystem:
13
+ * the caller only ever writes through the runtime bootstrap, which is reached
14
+ * from the first real prompt.
15
+ */
16
+ import { resolveDshHome } from "@deepseek-ai/dsh-home-paths";
17
+ import { join } from "node:path";
18
+ /** The roster/world key — also the directory name under `agents/`. */
19
+ export const OMP_SDK_WORLD_KEY = "omp-sdk";
20
+ /** `<dshHome>/agents/omp-sdk`. */
21
+ export function resolveOmpSdkWorldHome(dshHome = resolveDshHome()) {
22
+ return join(dshHome, "agents", OMP_SDK_WORLD_KEY);
23
+ }
@@ -0,0 +1,10 @@
1
+ export declare const name = "agent-omp-sdk";
2
+ /** Structural slice of the ctx0 services the mount needs. */
3
+ interface HostContext {
4
+ provide(name: string, value: unknown): void;
5
+ inject(deps: string[], callback: (ctx: unknown) => void): unknown;
6
+ effect?(callback: () => () => void, label?: string): unknown;
7
+ get(name: string): unknown;
8
+ }
9
+ export declare function apply(ctx: HostContext): void;
10
+ export {};
@@ -0,0 +1,137 @@
1
+ /**
2
+ * agent-omp-sdk — the adapter's world plugin (spec S2): activation IS
3
+ * roster membership.
4
+ *
5
+ * This is the OPT-IN sibling of `@pgmi-builds/agent-omp` (the RPC line). It
6
+ * mounts the SAME provider shape under its own world key (`omp-sdk`), which is
7
+ * what keeps the two independently toggleable: the hub's `registerAgent`
8
+ * hard-throws on a duplicate key, and `provisionWorldProfile` derives the
9
+ * adapter directory from `agent-<key>`.
10
+ *
11
+ * AW-B (DL1–DL5) → path-separation T-D: the world is spawned as a sibling
12
+ * ROOT context with NO listener and NO webui composition (see
13
+ * `worldMountPatches`) — a pure data plane behind the hub's `/hub` family:
14
+ *
15
+ * 1. ctx0 publishes the host mount record (the world's addressability
16
+ * entry — no webServer, no fence: those legs retired with the world
17
+ * pages) before spawn.
18
+ * 2. the world's entry row provides the virtual `webServer` (a silent
19
+ * sink) plus the neutral `webRuntime` facts its connection row injects.
20
+ * 3. the hub's `/hub` family answers `?agent=omp-sdk` traffic in ctx0's auth
21
+ * domain and dispatches into this world's gateway instance (the
22
+ * per-label `/<label>/api` + `/<label>/api/mux` mounts retired in T-C,
23
+ * `mountWorld` deleted in T-D).
24
+ *
25
+ * SDK runtime discipline: mounting this row (or booting the world) fetches
26
+ * NOTHING. The durable runtime (bun + the pinned coding-agent package + this
27
+ * package's sidecar) is fetched into `<worldHome>/sdk-runtime/` on the first
28
+ * real prompt; {@link diagnoseSdkRuntime} only REPORTS the current state.
29
+ */
30
+ import { existsSync, mkdirSync } from 'node:fs';
31
+ import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
32
+ import { join } from 'node:path';
33
+ import { spawnWorld, registerAgent, unregisterAgent, setReady, registerForeignTarget, registerHostMount, worldMountPatches, provisionWorldProfile, resolveInstallAnchor, } from '../../superd-hub/dist/index.js';
34
+ import { sdkRuntimeLayout } from './sdk-runtime.js';
35
+ export const name = 'agent-omp-sdk';
36
+ /**
37
+ * Runtime key — also the mount label and the `agents/<key>` directory. NOT
38
+ * `omp`: this row ships alongside the RPC line in the same composite, and the
39
+ * two are separately toggleable.
40
+ */
41
+ const KEY = 'omp-sdk';
42
+ /**
43
+ * Startup diagnostic (spec §2.4/§2.5): the SDK runtime is NOT a delivery
44
+ * artifact — it is fetched into the world home when the row is first used.
45
+ * Probe the marker once and say which state we are in; readiness semantics stay
46
+ * "mount success ≠ runtime present" (a missing runtime fails the FIRST PROMPT
47
+ * loudly, it does not unship the row).
48
+ *
49
+ * Deliberately non-fetching, non-spawning and non-importing of the runtime.
50
+ */
51
+ function diagnoseSdkRuntime(worldHome) {
52
+ const layout = sdkRuntimeLayout(worldHome);
53
+ // Presence, not identity: the adapter version is part of the marker's
54
+ // identity and is re-checked inside `ensureSdkRuntime` at fetch time. Here we
55
+ // only answer "is a complete-looking runtime on disk?".
56
+ if (existsSync(layout.marker) && existsSync(layout.bun))
57
+ return;
58
+ console.log(`[super-dsh] omp-sdk runtime not fetched yet (${layout.dir}) — the first real prompt will download bun + ` +
59
+ `the pinned coding-agent package there (~900 MB). ` +
60
+ `Pre-warm it with \`npm run fetch-sdk-runtime\` (OMP_SDK_PACKAGE_VERSION overrides the pin).`);
61
+ }
62
+ export function apply(ctx) {
63
+ // Roster membership is FIBER-SCOPED (2026-10-03 acceptance finding):
64
+ // disabling this row from the plugin manager disposes the fiber, and the
65
+ // entry must go with it. The `/api/agent-runtime` view hides a row whose
66
+ // host mount is gone, but the raw roster map is never pruned — so without
67
+ // this disposer a later re-enable dies on `roster: duplicate agent key
68
+ // omp-sdk` (reproduced live on 4997).
69
+ ctx.effect?.(() => {
70
+ registerAgent({ key: KEY, label: 'OMP (SDK)', ready: false });
71
+ return () => unregisterAgent(KEY);
72
+ }, `agent-${KEY}: roster`);
73
+ // Harness resolver (env → ~/.dsh): a consumer install has no DSH_HOME and
74
+ // no cwd contract — deriving the world root from cwd spawns worlds into a
75
+ // garbage tree or throws inside apply() and kills the whole host boot.
76
+ const root = resolveDshHome();
77
+ // S7 nested home: every runtime owns one root under `agents/<label>`, and the
78
+ // world's DSH data lives INSIDE it (sessions / settings / workspaces), so no
79
+ // two runtimes ever share a session list. This world's own durable SDK
80
+ // runtime lives in the same root (`<worldHome>/sdk-runtime/`).
81
+ const worldHome = join(root, 'agents', KEY);
82
+ mkdirSync(join(worldHome, 'profiles'), { recursive: true });
83
+ // Report-only: never fetches (see the function doc).
84
+ diagnoseSdkRuntime(worldHome);
85
+ // Publish story: a foreign install has no line bootstrap, so the nested
86
+ // profile + @pgmi-builds links are provisioned HERE (idempotent).
87
+ provisionWorldProfile({
88
+ key: KEY,
89
+ adapterPkg: '@pgmi-builds/agent-omp-sdk',
90
+ worldHome,
91
+ });
92
+ const world = (async () => {
93
+ // T-D: no ctx0 listening-stack wait — the mount record is addressability
94
+ // only and the /hub family wires its own gate in ctx0 (gateway.ts).
95
+ const dropHostMount = registerHostMount({ key: KEY, labelPath: `/${KEY}` });
96
+ const ctxW = await spawnWorld({
97
+ appName: `superd-${KEY}`,
98
+ profileName: 'web',
99
+ installAnchor: resolveInstallAnchor(ctx), // lazy: never at module scope — import must stay side-effect-free
100
+ home: worldHome,
101
+ dataHome: worldHome,
102
+ // The host's live table carries this world: spawnWorld republishes a
103
+ // widened successor before boot imports anything (spec §2.1), and
104
+ // @pgmi-builds rows resolve from the profile-local links written above.
105
+ host: ctx,
106
+ extraPatches: worldMountPatches(KEY),
107
+ });
108
+ const gateway = ctxW.get('typertGateway');
109
+ registerForeignTarget({ key: KEY, gateway });
110
+ setReady(KEY, true);
111
+ ctx.effect?.(() => () => {
112
+ dropHostMount();
113
+ }, `agent-${KEY}: mount`);
114
+ // Toggling the row off must really UNLOAD the world (2026-10-03 acceptance
115
+ // finding): disposing the world's own fiber disposes its provider, which
116
+ // releases every held transport, which releases the refcounted sidecar —
117
+ // without this the bun sidecar (hundreds of MB) outlives its own row.
118
+ ctx.effect?.(() => () => {
119
+ void ctxW.fiber?.dispose();
120
+ }, `agent-${KEY}: world teardown`);
121
+ return ctxW;
122
+ })().catch((cause) => {
123
+ // A failed world degrades to a not-ready roster row; a rejected provided
124
+ // promise would fail the entire host boot (loader entry apply).
125
+ console.error(`[super-dsh] ${KEY} world failed:`, cause);
126
+ // Startup diagnostics: the collector's warn/error records include the
127
+ // loader's own patch/import diagnostics for this world's include.
128
+ const startup = cause.startup;
129
+ if (startup?.messages !== undefined) {
130
+ for (const message of startup.messages) {
131
+ console.error(`[super-dsh] ${KEY} startup:`, JSON.stringify(message));
132
+ }
133
+ }
134
+ return null;
135
+ });
136
+ ctx.provide(`superd.world.${KEY}`, world);
137
+ }
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "@pgmi-builds/agent-omp-sdk",
3
+ "version": "0.1.0",
4
+ "description": "OMP (SDK) provider for DeepSeek Harness (dsh) — the OPT-IN in-process SDK transport for the OMP coding agent: one bun sidecar hosts N Dash sessions and reuses a single authStorage/modelRegistry. Delivered DISABLED by default (roster key `omp-sdk`); the RPC line (@pgmi-builds/agent-omp) is the primary path because it drives the operator's own `omp` binary with zero bundled runtime. This package declares NO SDK/bun dependency and ships NO postinstall: the durable runtime (bun + the pinned coding-agent package + this package's sidecar) is fetched into the world home on the first real prompt (src/sdk-runtime.ts, `npm run fetch-sdk-runtime`).",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": "./dist/index.js",
8
+ "./world": "./dist/world-plugin.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "sidecar",
13
+ "cordis.patch.yml",
14
+ "README.md"
15
+ ],
16
+ "dsh": {
17
+ "bundle": {
18
+ "patch": "./cordis.patch.yml"
19
+ }
20
+ },
21
+ "scripts": {
22
+ "build": "tsc -p tsconfig.json",
23
+ "test": "node --test test/*.test.mjs",
24
+ "fetch-sdk-runtime": "node scripts/fetch-sdk-runtime.mjs"
25
+ },
26
+ "dependencies": {},
27
+ "peerDependencies": {
28
+ "@deepseek-ai/cordis": "^4.0.1",
29
+ "@deepseek-ai/dsh-agent": ">=0.1.5-0 <0.3.0-0",
30
+ "@deepseek-ai/dsh-agent-presets": ">=0.1.5-0 <0.3.0-0",
31
+ "@deepseek-ai/dsh-llm": ">=0.1.5-0 <0.3.0-0",
32
+ "@deepseek-ai/dsh-scope": ">=0.1.5-0 <0.3.0-0",
33
+ "@deepseek-ai/dsh-session": ">=0.1.5-0 <0.3.0-0",
34
+ "@deepseek-ai/dsh-session-persistence": ">=0.1.5-0 <0.3.0-0",
35
+ "@deepseek-ai/dsh-typert-protocol": ">=0.1.5-0 <0.3.0-0",
36
+ "@deepseek-ai/dsh-home-paths": ">=0.1.5-0 <0.3.0-0",
37
+ "@pgmi-builds/superd-hub": "*"
38
+ },
39
+ "peerDependenciesMeta": {
40
+ "@deepseek-ai/cordis": {
41
+ "optional": true
42
+ },
43
+ "@deepseek-ai/dsh-agent": {
44
+ "optional": true
45
+ },
46
+ "@deepseek-ai/dsh-agent-presets": {
47
+ "optional": true
48
+ },
49
+ "@deepseek-ai/dsh-llm": {
50
+ "optional": true
51
+ },
52
+ "@deepseek-ai/dsh-scope": {
53
+ "optional": true
54
+ },
55
+ "@deepseek-ai/dsh-session": {
56
+ "optional": true
57
+ },
58
+ "@deepseek-ai/dsh-session-persistence": {
59
+ "optional": true
60
+ },
61
+ "@deepseek-ai/dsh-typert-protocol": {
62
+ "optional": true
63
+ },
64
+ "@deepseek-ai/dsh-home-paths": {
65
+ "optional": true
66
+ },
67
+ "@pgmi-builds/superd-hub": {
68
+ "optional": true
69
+ }
70
+ },
71
+ "devDependencies": {
72
+ "@types/node": "^26.2.0",
73
+ "typescript": "^5.6.0"
74
+ },
75
+ "publishConfig": {
76
+ "access": "public"
77
+ },
78
+ "license": "MIT",
79
+ "main": "dist/index.js",
80
+ "repository": {
81
+ "type": "git",
82
+ "url": "git+https://github.com/pgmi-builds/superd.git"
83
+ },
84
+ "engines": {
85
+ "node": ">=22.18"
86
+ }
87
+ }