super-dsh 0.1.9 → 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 (178) 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 +1204 -93
  162. package/cordis.patch.yml +64 -0
  163. package/package.json +17 -8
  164. package/superd-hub/dist/client/agent-settings.d.ts +210 -0
  165. package/superd-hub/dist/client/agent-settings.js +300 -0
  166. package/superd-hub/dist/client/roster.js +6 -0
  167. package/superd-hub/dist/client/runtime-settings-api.d.ts +76 -0
  168. package/superd-hub/dist/client/runtime-settings-api.js +137 -0
  169. package/superd-hub/dist/client/switch.d.ts +165 -0
  170. package/superd-hub/dist/client/switch.js +295 -0
  171. package/superd-hub/lib/client/index.js +1204 -93
  172. package/agent-codex/dist/models.js +0 -152
  173. package/agent-omp/dist/sidecar-client.js +0 -195
  174. /package/{agent-agy → agent-agy-sdk}/bridge/agy_bridge.py +0 -0
  175. /package/{agent-agy → agent-agy-sdk}/bridge/gemini_openai_server.mjs +0 -0
  176. /package/{agent-codex/dist/codex-events.js → agent-codex-sdk/dist/codex-sdk-events.js} +0 -0
  177. /package/{agent-omp → agent-omp-sdk}/dist/protocol.js +0 -0
  178. /package/{agent-omp → agent-omp-sdk}/sidecar/main.ts +0 -0
@@ -0,0 +1,103 @@
1
+ # @pgmi-builds/agent-omp-sdk — OMP (SDK) adapter (opt-in)
2
+
3
+ The **second** OMP adapter package, alongside `@pgmi-builds/agent-omp` (the RPC
4
+ line). It is a complete, standalone copy of the pre-RPC-era OMP bridge — no
5
+ shared code with the RPC package.
6
+
7
+ - **World key** `omp-sdk`, roster label `OMP (SDK)`, world home
8
+ `<dshHome>/agents/omp-sdk` (deliberately not `agents/omp`).
9
+ - **Off by default**: the `agent-omp-sdk` row in the super-dsh composite carries
10
+ `disabled: true`, so while the row is off not one byte of this package is
11
+ imported and nothing is fetched. Turning the row on (plugin manager
12
+ `setPluginEnabled` / `dsh plugin`) IS the switch — no env var, no config key.
13
+ - **Why it exists**: the RPC shape is one `omp` child per Dash session
14
+ (~240 MB private each). This shape hosts **N sessions in one bun sidecar**
15
+ and shares `authStorage` / `modelRegistry` across them, so the marginal cost
16
+ per extra session is far lower.
17
+
18
+ ## No dependency is declared, and nothing is fetched at install time
19
+
20
+ `package.json` declares an **empty `dependencies`** — no coding-agent package,
21
+ no `bun`, no `optionalDependencies`, no `postinstall`. `dsh plugin add` only
22
+ unpacks this package; `npm pack` contains no SDK bytes (only our own
23
+ `sidecar/main.ts` source, which imports the package *inside the fetched
24
+ runtime*).
25
+
26
+ The durable runtime is fetched **lazily**, on the first real prompt of an
27
+ `omp-sdk` session (draft / browse / passive queries stay at zero action, the
28
+ same zero-spawn window the RPC line holds):
29
+
30
+ ```
31
+ <worldHome>/sdk-runtime/
32
+ bin/bun bun release (linux-x64) unzipped into place
33
+ package.json / node_modules/ the pinned coding-agent package, installed with that bun
34
+ sidecar/main.ts this package's sidecar (bun resolves node_modules from here)
35
+ dist/protocol.js the compiled protocol module the sidecar imports
36
+ <worldHome>/sdk-runtime.json marker: {pluginVersion, packageVersion, bunVersion, bunPath, installedAt}
37
+ <worldHome>/sdk-runtime.lock atomic (mkdir) bootstrap lock
38
+ <worldHome>/sdk-runtime.error.log written only by a failed fetch
39
+ ```
40
+
41
+ The marker is written **last**; a marker whose identity (`pluginVersion`,
42
+ `packageVersion`, `bunVersion`) does not match the running adapter is treated as
43
+ absent and refetched. The install is deliberately **slim**: `bun add --exact
44
+ --ignore-scripts --omit=optional @oh-my-pi/pi-coding-agent@<pin>
45
+ @oh-my-pi/pi-natives-<platform>@<pin>` — `--ignore-scripts` blocks package build
46
+ scripts, `--omit=optional` drops the ~234 MB `@huggingface/transformers` +
47
+ `onnxruntime-*` weight whose native postinstall is blocked anyway, and the
48
+ platform binding package is re-added explicitly because `@oh-my-pi/pi-natives`
49
+ needs it to load (`OMP_SDK_KEEP_OPTIONAL=1` reinstates the full tree). After the
50
+ install the fetcher copies the sidecar and the compiled protocol module in, then
51
+ runs a **post-install smoke import** (`<bun> -e 'await import("@oh-my-pi/pi-coding-agent")'`,
52
+ agent dir redirected inside the runtime tree) and only then writes the marker —
53
+ a pin that cannot be imported (18.4.9 is such a pin) fails loud here instead of
54
+ at the first prompt.
55
+
56
+ A failed fetch writes the error log and throws a single actionable error naming
57
+ `OMP_SDK_PACKAGE_VERSION`; it never degrades silently into a confusing sidecar
58
+ crash, and it never falls back to the RPC line (that is another row the user did
59
+ not enable).
60
+
61
+ ## Wiring (where the fetch is triggered, and where it is not)
62
+
63
+ - `world-plugin.ts` mounts the world and prints ONE report-only diagnostic when
64
+ the runtime is not on disk yet. It never fetches, spawns or imports the
65
+ runtime.
66
+ - `index.ts` (`OmpProvider`) builds its transport in the constructor — that
67
+ builds a pool object, nothing else.
68
+ - `transport.ts` / `lazy-rpc.ts` (`LazyOmpRpc`) construct per-session wrappers
69
+ with **zero** side effects; a new-chat draft leaves nothing server-side.
70
+ - `sidecar-client.ts` (`OmpSdkSidecar#start`) is the ONE place `ensureSdkRuntime`
71
+ is awaited. `start()` is reached only from `LazyOmpRpc#ensure()`, i.e. from the
72
+ first `prompt` / `followUp` / `steer` / `ensureStarted`.
73
+ - `sdk-client.ts` (`createOmpSdkSidecarPool`) holds the refcounted singleton:
74
+ two sessions of one dsh process share one bun child, and the pool releases
75
+ (and stops) it when the last client closes.
76
+
77
+ ## Manual warm-up
78
+
79
+ ```sh
80
+ node scripts/fetch-sdk-runtime.mjs <dsh-home> # world home = <dsh-home>/agents/omp-sdk
81
+ # or, with the home in the environment:
82
+ DSH_HOME=<dsh-home> npm run fetch-sdk-runtime
83
+ ```
84
+
85
+ The script is a dev/test tool: it refuses any home outside this repository's
86
+ `.tests` tree (the launcher red line) and has no `~/.dsh` default. It shares
87
+ `createSdkRuntimeDeps` with the adapter's first-prompt fetch, so the two paths
88
+ cannot drift.
89
+
90
+ Pins: `OMP_SDK_PACKAGE_VERSION` (default `18.5.0` — do not use 18.4.9, whose
91
+ source-level import is broken; `18.2.11` is the last known-good fallback) and
92
+ `OMP_SDK_BUN_VERSION` (default `1.4.2`).
93
+
94
+ ## Build & test
95
+
96
+ ```sh
97
+ npm run build # tsc -p tsconfig.json
98
+ npm test # node --test test/*.test.mjs (imports dist/, zero network, zero real bun)
99
+ ```
100
+
101
+ The suite is fakes-only: the runtime bootstrap is driven through its injected
102
+ `SdkRuntimeDeps`, and the sidecar spawn path through an injected `runtimeFetch`.
103
+ No test downloads, spawns bun or touches a real home.
@@ -0,0 +1,108 @@
1
+ # @pgmi-builds/agent-omp-sdk bundle patch. This file is the `dsh.bundle.patch`
2
+ # layer of the published npm package: when this bundle is composed, the profile
3
+ # boot merges THIS patch — mount the OMP (SDK) provider plus disable the native
4
+ # components OMP replaces — exactly like a manual cordis.patch.yml.
5
+ #
6
+ # OPT-IN row (2026-10-03 user ruling): the super-dsh composite mounts this id
7
+ # with `disabled: true`. The RPC line (@pgmi-builds/agent-omp) is the PRIMARY
8
+ # path — it drives the operator's own `omp` binary over `--mode rpc`, so the
9
+ # plugin bundles no runtime. Turning this row on (plugin manager
10
+ # `setPluginEnabled`, or `dsh plugin`) IS the switch: presence of the row IS
11
+ # roster membership, and there is no env var / config key to keep in sync.
12
+ #
13
+ # Nothing is installed and nothing is fetched while the row is off: this package
14
+ # declares NO coding-agent/bun dependency and ships NO postinstall. The durable
15
+ # runtime (bun + the pinned @oh-my-pi/pi-coding-agent + this package's sidecar)
16
+ # is fetched into `<dshHome>/agents/omp-sdk/sdk-runtime/` on the FIRST real
17
+ # prompt of an `omp-sdk` session (src/sdk-runtime.ts; pre-warm with
18
+ # `npm run fetch-sdk-runtime`). Zero-spawn window before that prompt: no child,
19
+ # no download, no session event.
20
+ #
21
+ # Profile-specific values are deliberately NOT here: `webserver.port` (port
22
+ # choice) and `settings.path` (settings-under-profile) belong to the user's
23
+ # profile patch layer; `agent-default-model` is tracked dynamically from OMP's
24
+ # config.yml (`modelRoles.default`).
25
+
26
+ # Mount the OMP (SDK) provider: the same Cordis AgentFactory as the RPC line,
27
+ # driven through the SDK transport (one bun sidecar, N sessions, shared
28
+ # authStorage/modelRegistry). The provider instance is this package's own
29
+ # (`@pgmi-builds/agent-omp-sdk`): the two OMP lines are complete standalone
30
+ # copies, each shipping its own provider.
31
+ - insert:
32
+ - id: omp-sdk-provider
33
+ name: '@pgmi-builds/agent-omp-sdk'
34
+
35
+ # OMP owns the live agent transcript; disable the built-in loop so it does not
36
+ # double-run alongside the OMP sidecar.
37
+ - id: agent-loop
38
+ disabled: true
39
+
40
+ # The native routes register deepseek-official / pi-ai providers; the OMP
41
+ # provider registers its own adapter (one route per OMP provider) on ctx.llm.
42
+ # Leaving them mounted would advertise native models alongside OMP's.
43
+ - id: llm-deepseek
44
+ disabled: true
45
+ - id: llm-pi-ai
46
+ disabled: true
47
+
48
+ # OMP is single-mode: its own runtime drives tools, so no Dash preset
49
+ # composition is needed. 0.1.7: the host AgentPresetRegistry row (renamed
50
+ # `agent-presets` → `agent-preset-registry`) stays MOUNTED — the bridge
51
+ # registers its one fixed preset into it (src/agent-preset-omp.ts, id `omp`:
52
+ # the capability IS OMP; the WORLD key is what differs) and the registry owns
53
+ # roster/selection/document RPC + the agentPreset projection.
54
+ # Pin only the default; modeSelectionEnabled already defaults to true.
55
+ - id: agent-preset-registry
56
+ config:
57
+ default: omp
58
+
59
+ # Titles come from OMP, not from Dash. The stock `session-title-first-prompt-llm`
60
+ # row would run a Dash-side LLM call (through whatever adapter serves ctx.llm)
61
+ # after the first prompt — that is Dash inventing functionality OMP does not
62
+ # have. OMP's own session file carries a `title` entry exposed through the
63
+ # sidecar; the transport is the only place that may mirror it into a
64
+ # `session/title` event.
65
+ - id: session-title-llm
66
+ disabled: true
67
+
68
+ # dsh-shape-session-log: the native jsonl backend is the ONLY sessionPersistence.
69
+ # This adapter feeds it (producer role); native components serve list/page/replay.
70
+ # The plugin provides no persistence of its own — keep the stock row mounted.
71
+ #
72
+ # Directory picker: the stock `directory-picker-auto` is never a simple alias —
73
+ # it RESOLVES the interaction once per boot and mounts BOTH faces through the
74
+ # loader: the host backend package AND the matching CLIENT SURFACE package
75
+ # (`dsh-client-ui-directory-picker-<kind>`). The client surface is what
76
+ # occupies the workspace picker's directory-flow hole; with the hole empty the
77
+ # client hides the "add workspace" entry entirely (WorkspacePicker:
78
+ # `flowAvailable ? [ADD_WORKSPACE] : []`). NEVER just `disabled: true` this
79
+ # row — that removed the button. Pin the in-app browser by mounting both faces
80
+ # of `browse` ourselves (backend first: the surface's browser half drives the
81
+ # capability the backend registers) and unmounting the auto row.
82
+ - insert:
83
+ - id: directory-picker-browse
84
+ name: '@deepseek-ai/dsh-host-directory-picker-browse'
85
+ - id: directory-picker-browse-surface
86
+ name: '@deepseek-ai/dsh-client-ui-directory-picker-browse'
87
+ - id: directory-picker
88
+ disabled: true
89
+
90
+ # OMP has no runtime approval control — the transport maps the preset onto omp's
91
+ # launch-only `--approval-mode` flag, resolved AT SPAWN on both OMP lines from
92
+ # the session's own last `permission/preset`. Default to danger-full-access
93
+ # (OMP's own native yolo default). Restate the full 3-preset table: a patch with
94
+ # only defaultPreset silently drops the bundle's 3-preset table to the plugin's
95
+ # built-in 2, breaking the 3:3 Dash<->OMP pairing.
96
+ - id: permission
97
+ config:
98
+ presets:
99
+ read-only:
100
+ sandbox: read-only
101
+ approval: ask
102
+ workspace-write:
103
+ sandbox: workspace-write
104
+ approval: ask
105
+ danger-full-access:
106
+ sandbox: danger-full-access
107
+ approval: never
108
+ defaultPreset: danger-full-access
@@ -0,0 +1,21 @@
1
+ /**
2
+ * OMP-backed `LlmAdapter` registered on `ctx.llm` by the OMP provider.
3
+ *
4
+ * The browser model selector never touches the OMP agent directly: it is an
5
+ * RPC round-trip through the apiproxy, which reads `ctx.llm.listProviders /
6
+ * listModels / resolveModelInfo` to build the catalog. This adapter answers
7
+ * those queries from OMP's real model registry (`models.ts`) so the selector
8
+ * shows OMP's providers and models — never the native deepseek-official /
9
+ * pi-ai routes, which the profile disables.
10
+ *
11
+ * `stream` is never dispatched: OMP owns generation inside its SDK sidecar
12
+ * (`OmpAgent`), so the adapter only serves catalog/metadata queries. It
13
+ * throws rather than fabricating a wire route the harness would misuse.
14
+ */
15
+ import { LlmAdapter, type GenerateOptions, type LlmModelInfo, type LlmProviderInfo, type LlmResolvedModelInfo, type StreamChunk } from "@deepseek-ai/dsh-llm";
16
+ export declare class OmpLlmAdapter extends LlmAdapter {
17
+ providerInfo(provider: string): LlmProviderInfo;
18
+ listModels(provider: string): Promise<readonly LlmModelInfo[]>;
19
+ resolveModel(provider: string, model: string): Promise<LlmResolvedModelInfo>;
20
+ stream(_options: GenerateOptions): AsyncIterable<StreamChunk>;
21
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * OMP-backed `LlmAdapter` registered on `ctx.llm` by the OMP provider.
3
+ *
4
+ * The browser model selector never touches the OMP agent directly: it is an
5
+ * RPC round-trip through the apiproxy, which reads `ctx.llm.listProviders /
6
+ * listModels / resolveModelInfo` to build the catalog. This adapter answers
7
+ * those queries from OMP's real model registry (`models.ts`) so the selector
8
+ * shows OMP's providers and models — never the native deepseek-official /
9
+ * pi-ai routes, which the profile disables.
10
+ *
11
+ * `stream` is never dispatched: OMP owns generation inside its SDK sidecar
12
+ * (`OmpAgent`), so the adapter only serves catalog/metadata queries. It
13
+ * throws rather than fabricating a wire route the harness would misuse.
14
+ */
15
+ import { LlmAdapter, LlmError, } from "@deepseek-ai/dsh-llm";
16
+ import { loadOmpModels, providerDisplayName, toModelInfo, toResolvedModelInfo } from "./models.js";
17
+ export class OmpLlmAdapter extends LlmAdapter {
18
+ providerInfo(provider) {
19
+ return { id: provider, name: providerDisplayName(provider) };
20
+ }
21
+ async listModels(provider) {
22
+ return loadOmpModels()
23
+ .filter((model) => model.provider === provider)
24
+ .map(toModelInfo);
25
+ }
26
+ async resolveModel(provider, model) {
27
+ const found = loadOmpModels().find((candidate) => candidate.provider === provider && candidate.id === model);
28
+ if (found === undefined) {
29
+ throw new LlmError(`OMP provider "${provider}" does not serve model "${model}"`, "MODEL_NOT_FOUND");
30
+ }
31
+ return toResolvedModelInfo(found);
32
+ }
33
+ stream(_options) {
34
+ throw new LlmError("the OMP adapter does not stream: OMP owns generation through its rpc agent", "UNSUPPORTED_STREAM");
35
+ }
36
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * OMP preset registration — the profile's one fixed Agent preset.
3
+ *
4
+ * 0.1.7 alignment (upstream split `dsh-agent-presets` into `dsh-agent-preset`
5
+ * + `dsh-agent-preset-registry` and moved roster, selection, document RPC and
6
+ * the `agentPreset` session projection into the host `AgentPresetRegistry`,
7
+ * mounted by the dsh-web-app bundle's `agent-preset-registry` row): the
8
+ * bridge no longer implements the `agentPresets` service — the 0.1.6
9
+ * SingleOmpPresetRoster and its own projection fold are retired. It only
10
+ * REGISTERS the single fixed preset into the host registry.
11
+ *
12
+ * OMP is single-mode: the OMP agent drives its own tools through its RPC
13
+ * process, so no Dash-side preset composition exists to choose from. The
14
+ * preset's composition deliberately mounts nothing — mounting it composes
15
+ * nothing, exactly the rosterless behavior the provider runs on. Side benefit
16
+ * over the 0.1.6 disabled-row posture: `pluginInventory/list` works again
17
+ * (the registry provides `compositionInventory`, which the stock plugin
18
+ * inventory page calls unconditionally).
19
+ */
20
+ import type { Context } from "@deepseek-ai/cordis";
21
+ import type { PresetDefinition } from "@deepseek-ai/dsh-agent-preset-registry";
22
+ export declare const OMP_PRESET_ID = "omp";
23
+ /** The single fixed OMP preset: mounting it composes nothing. */
24
+ export declare const OMP_PRESET: PresetDefinition;
25
+ /**
26
+ * Register the fixed preset into the host `AgentPresetRegistry` once the
27
+ * service is up. Registration failure keeps the roster row visible as
28
+ * `broken` inside the registry (upstream owns that lifecycle) — the bridge
29
+ * only owns the disposer.
30
+ */
31
+ export declare function registerOmpPreset(ctx: Context): void;
@@ -0,0 +1,32 @@
1
+ export const OMP_PRESET_ID = "omp";
2
+ /** The single fixed OMP preset: mounting it composes nothing. */
3
+ export const OMP_PRESET = Object.freeze({
4
+ id: OMP_PRESET_ID,
5
+ name: "OMP",
6
+ description: "OMP agent via the agent-omp bridge",
7
+ plugins: Object.freeze([]),
8
+ });
9
+ /**
10
+ * Register the fixed preset into the host `AgentPresetRegistry` once the
11
+ * service is up. Registration failure keeps the roster row visible as
12
+ * `broken` inside the registry (upstream owns that lifecycle) — the bridge
13
+ * only owns the disposer.
14
+ */
15
+ export function registerOmpPreset(ctx) {
16
+ ctx.inject(["agentPresets"], (scoped) => {
17
+ let dispose;
18
+ let settled = false;
19
+ void scoped.agentPresets.register(OMP_PRESET).then((unregister) => {
20
+ if (settled) {
21
+ void unregister();
22
+ }
23
+ else {
24
+ dispose = unregister;
25
+ }
26
+ });
27
+ ctx.effect(() => async () => {
28
+ settled = true;
29
+ await dispose?.();
30
+ }, "ompProvider.preset");
31
+ });
32
+ }
@@ -0,0 +1,64 @@
1
+ /**
2
+ * OmpAgent — the Dash `Agent` shim over one live OMP SDK sidecar session.
3
+ *
4
+ * Bridges OMP's RPC event stream into the Dash `SessionEventMap`:
5
+ *
6
+ * OMP RPC → Dash session event
7
+ * ─────────────────────────────────────────────────────────────
8
+ * (send/followup delivers) → turn/start + user/message
9
+ * turn_start → step/start
10
+ * message_update(text_delta) → assistant/chunk
11
+ * message_end(assistant) → assistant/message (+ usage, reasoning)
12
+ * message_end(toolResult) → tool/result (deduped vs tool_execution_end)
13
+ * tool_execution_start → tool/call
14
+ * tool_execution_end → tool/result
15
+ * turn_end → step/end
16
+ * agent_end → turn/end + status idle
17
+ *
18
+ * One Dash turn (user prompt → final answer) spans multiple OMP turns (one
19
+ * assistant response + its tool executions each), so Dash turn/step boundaries
20
+ * are synthesized around the OMP stream.
21
+ */
22
+ import type { Context } from "@deepseek-ai/cordis";
23
+ import type { Agent, AgentOptions, AgentStatus, CancelOptions, InboxTarget } from "@deepseek-ai/dsh-agent";
24
+ import { Inbox } from "./inbox.js";
25
+ import type { AgentCancelCause, Session, SessionId, UserMessage } from "@deepseek-ai/dsh-session";
26
+ import type { ContentBlock, TokenUsage } from "@deepseek-ai/dsh-llm";
27
+ import type { OmpContentBlock, OmpMessage } from "./rpc-types.js";
28
+ import type { OmpAgentRpc } from "./lazy-rpc.js";
29
+ import { type WithSystemHead } from "../../superd-hub/dist/index.js";
30
+ export declare function convertContent(blocks: OmpContentBlock[] | undefined): ContentBlock[];
31
+ /**
32
+ * Classify OMP's `stopReason: "error"` assistant message into a Dash `failure`
33
+ * (`{ message, code }`). This is the same taxonomy the harness adapters use for
34
+ * `turn/end` reasons — `AUTH`, `RATE_LIMIT`, `QUOTA`, `SERVER` — so the Web UI
35
+ * renders it through its own error path (the red "API key is invalid" alert,
36
+ * turn-positioned failure feedback) instead of an empty assistant bubble.
37
+ * Quota/usage wording is checked before the generic 403→AUTH because OMP's
38
+ * providers (e.g. kimi) report an exhausted billing quota as HTTP 403.
39
+ */
40
+ export declare function ompFailure(message: OmpMessage): {
41
+ message: string;
42
+ code: string;
43
+ } | undefined;
44
+ /** Map OMP's usage accounting into Dash `TokenUsage` (disjoint field names). */
45
+ export declare function convertUsage(usage: unknown): TokenUsage | undefined;
46
+ export declare class OmpAgent implements Agent {
47
+ #private;
48
+ readonly id: SessionId;
49
+ readonly options: AgentOptions;
50
+ readonly session: WithSystemHead<Session>;
51
+ readonly inbox: Inbox;
52
+ readonly ctx: Context;
53
+ constructor(loopCtx: Context, id: SessionId, options: AgentOptions, session: Session, rpc: OmpAgentRpc, onIdleExit?: () => void);
54
+ get status(): AgentStatus;
55
+ send(message: UserMessage, target: InboxTarget, wakeup: boolean): void;
56
+ followup(message: UserMessage): void;
57
+ steer(message: UserMessage): void;
58
+ inject(message: UserMessage): void;
59
+ cancel(cause: AgentCancelCause, _options?: CancelOptions): void;
60
+ whenIdle(): Promise<void>;
61
+ runMaintenance<T>(task: (signal: AbortSignal) => Promise<T>): Promise<T>;
62
+ /** Stop OMP and unwind the scoped world. Idempotent. */
63
+ dispose(): Promise<void>;
64
+ }