super-dsh 0.1.0 → 0.1.2
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/agent-agy/bridge/agy_bridge.py +250 -0
- package/agent-agy/bridge/gemini_openai_server.mjs +98 -0
- package/agent-agy/cordis.patch.yml +49 -0
- package/agent-agy/dist/adapter.d.ts +15 -0
- package/agent-agy/dist/adapter.js +42 -0
- package/agent-agy/dist/agent-preset-agy.d.ts +47 -0
- package/agent-agy/dist/agent-preset-agy.js +169 -0
- package/agent-agy/dist/agent-preset-projection.d.ts +31 -0
- package/agent-agy/dist/agent-preset-projection.js +33 -0
- package/agent-agy/dist/agent.d.ts +137 -0
- package/agent-agy/dist/agent.js +493 -0
- package/agent-agy/dist/agy-cli-client.d.ts +137 -0
- package/agent-agy/dist/agy-cli-client.js +301 -0
- package/agent-agy/dist/agy-client.d.ts +160 -0
- package/agent-agy/dist/agy-client.js +252 -0
- package/agent-agy/dist/agy-sessions.d.ts +24 -0
- package/agent-agy/dist/agy-sessions.js +116 -0
- package/agent-agy/dist/agy-store.d.ts +39 -0
- package/agent-agy/dist/agy-store.js +83 -0
- package/agent-agy/dist/inbox.d.ts +26 -0
- package/agent-agy/dist/inbox.js +53 -0
- package/agent-agy/dist/index.d.ts +80 -0
- package/agent-agy/dist/index.js +505 -0
- package/agent-agy/dist/models.d.ts +41 -0
- package/agent-agy/dist/models.js +74 -0
- package/agent-agy/dist/world-plugin.d.ts +9 -0
- package/agent-agy/dist/world-plugin.js +97 -0
- package/agent-agy/package.json +64 -0
- package/agent-claude/cordis.patch.yml +42 -0
- package/agent-claude/dist/adapter.js +62 -0
- package/agent-claude/dist/agent-preset-claude.js +169 -0
- package/agent-claude/dist/agent-preset-projection.js +30 -0
- package/agent-claude/dist/agent.js +1271 -0
- package/agent-claude/dist/claude-client.js +357 -0
- package/agent-claude/dist/claude-events.js +223 -0
- package/agent-claude/dist/claude-home.js +29 -0
- package/agent-claude/dist/commands.js +182 -0
- package/agent-claude/dist/content.js +134 -0
- package/agent-claude/dist/inbox.js +53 -0
- package/agent-claude/dist/index.js +555 -0
- package/agent-claude/dist/input-queue.js +64 -0
- package/agent-claude/dist/interaction.js +271 -0
- package/agent-claude/dist/models.js +158 -0
- package/agent-claude/dist/permission.js +120 -0
- package/agent-claude/dist/session-id.js +20 -0
- package/agent-claude/dist/session-map.js +165 -0
- package/agent-claude/dist/world-plugin.js +14 -0
- package/agent-claude/package.json +74 -0
- package/agent-codex/README.md +74 -0
- package/agent-codex/cordis.patch.yml +77 -0
- package/agent-codex/dist/adapter.js +55 -0
- package/agent-codex/dist/agent-preset-codex.js +171 -0
- package/agent-codex/dist/agent-preset-projection.js +37 -0
- package/agent-codex/dist/agent.js +1056 -0
- package/agent-codex/dist/app-home.js +65 -0
- package/agent-codex/dist/codex-client.js +469 -0
- package/agent-codex/dist/codex-events.js +297 -0
- package/agent-codex/dist/codex-store.js +190 -0
- package/agent-codex/dist/inbox.js +53 -0
- package/agent-codex/dist/index.js +605 -0
- package/agent-codex/dist/models.js +152 -0
- package/agent-codex/dist/permission.js +71 -0
- package/agent-codex/dist/session-map.js +170 -0
- package/agent-codex/dist/spike.js +46 -0
- package/agent-codex/dist/world-plugin.js +96 -0
- package/agent-codex/package.json +78 -0
- package/agent-hermes/README.md +144 -0
- package/agent-hermes/cordis.patch.yml +83 -0
- package/agent-hermes/dist/adapter.js +83 -0
- package/agent-hermes/dist/agent-preset-hermes.js +171 -0
- package/agent-hermes/dist/agent-preset-projection.js +34 -0
- package/agent-hermes/dist/agent.js +1068 -0
- package/agent-hermes/dist/hermes-client.js +953 -0
- package/agent-hermes/dist/hermes-events.js +289 -0
- package/agent-hermes/dist/hermes-store.js +158 -0
- package/agent-hermes/dist/inbox.js +53 -0
- package/agent-hermes/dist/index.js +541 -0
- package/agent-hermes/dist/models.js +324 -0
- package/agent-hermes/dist/permission.js +60 -0
- package/agent-hermes/dist/world-plugin.js +101 -0
- package/agent-hermes/package.json +76 -0
- package/agent-hub/cordis.patch.yml +12 -0
- package/agent-hub/dist/agent-roster.d.ts +34 -0
- package/agent-hub/dist/agent-roster.js +27 -0
- package/agent-hub/dist/carrier.d.ts +43 -0
- package/agent-hub/dist/carrier.js +241 -0
- package/agent-hub/dist/client-shim.d.ts +28 -0
- package/agent-hub/dist/client-shim.js +251 -0
- package/agent-hub/dist/envelope.d.ts +54 -0
- package/agent-hub/dist/envelope.js +92 -0
- package/agent-hub/dist/gateway.d.ts +28 -0
- package/agent-hub/dist/gateway.js +18 -0
- package/agent-hub/dist/index-pass.d.ts +22 -0
- package/agent-hub/dist/index-pass.js +47 -0
- package/agent-hub/dist/index.d.ts +29 -0
- package/agent-hub/dist/index.js +29 -0
- package/agent-hub/dist/labels.d.ts +45 -0
- package/agent-hub/dist/labels.js +83 -0
- package/agent-hub/dist/ownership.d.ts +37 -0
- package/agent-hub/dist/ownership.js +54 -0
- package/agent-hub/dist/roster.d.ts +28 -0
- package/agent-hub/dist/roster.js +38 -0
- package/agent-hub/dist/rpc.d.ts +38 -0
- package/agent-hub/dist/rpc.js +52 -0
- package/agent-hub/dist/spawn-world.d.ts +46 -0
- package/agent-hub/dist/spawn-world.js +72 -0
- package/agent-hub/dist/targets.d.ts +33 -0
- package/agent-hub/dist/targets.js +30 -0
- package/agent-hub/dist/world-entry.d.ts +31 -0
- package/agent-hub/dist/world-entry.js +51 -0
- package/agent-hub/dist/world-host.d.ts +69 -0
- package/agent-hub/dist/world-host.js +44 -0
- package/agent-hub/dist/world-join.d.ts +16 -0
- package/agent-hub/dist/world-join.js +122 -0
- package/agent-hub/dist/world-mount.d.ts +52 -0
- package/agent-hub/dist/world-mount.js +52 -0
- package/agent-hub/dist/world-mux.d.ts +72 -0
- package/agent-hub/dist/world-mux.js +224 -0
- package/agent-hub/dist/world-provision.d.ts +20 -0
- package/agent-hub/dist/world-provision.js +122 -0
- package/agent-hub/dist/world-web-server.d.ts +162 -0
- package/agent-hub/dist/world-web-server.js +248 -0
- package/agent-hub/lib/client/index.js +242 -0
- package/agent-hub/package.json +65 -0
- package/agent-omp/README.md +77 -0
- package/agent-omp/cordis.patch.yml +92 -0
- package/agent-omp/dist/adapter.js +36 -0
- package/agent-omp/dist/agent-preset-omp.js +171 -0
- package/agent-omp/dist/agent-preset-projection.js +36 -0
- package/agent-omp/dist/agent.js +1145 -0
- package/agent-omp/dist/app-home.js +86 -0
- package/agent-omp/dist/discovery.js +116 -0
- package/agent-omp/dist/inbox.js +53 -0
- package/agent-omp/dist/index.js +574 -0
- package/agent-omp/dist/knobs.js +50 -0
- package/agent-omp/dist/lazy-rpc.js +161 -0
- package/agent-omp/dist/mobile/gesture.js +148 -0
- package/agent-omp/dist/mobile/zoom-guard.js +294 -0
- package/agent-omp/dist/mobile-boot.js +38 -0
- package/agent-omp/dist/models.js +299 -0
- package/agent-omp/dist/omp-cli.js +147 -0
- package/agent-omp/dist/omp-disk-discovery.js +178 -0
- package/agent-omp/dist/omp-store.js +518 -0
- package/agent-omp/dist/pairing.js +45 -0
- package/agent-omp/dist/permission.js +96 -0
- package/agent-omp/dist/protocol.js +13 -0
- package/agent-omp/dist/rpc-types.js +1 -0
- package/agent-omp/dist/sdk-client.js +378 -0
- package/agent-omp/dist/sidecar-client.js +195 -0
- package/agent-omp/dist/store/adapter.js +47 -0
- package/agent-omp/dist/store/db.js +210 -0
- package/agent-omp/dist/store/index.js +59 -0
- package/agent-omp/dist/store/reconcile.js +51 -0
- package/agent-omp/dist/store/schema.js +40 -0
- package/agent-omp/dist/world-plugin.js +96 -0
- package/agent-omp/package.json +97 -0
- package/agent-omp/sidecar/main.ts +481 -0
- package/agent-pi/README.md +67 -0
- package/agent-pi/cordis.patch.yml +80 -0
- package/agent-pi/dist/adapter.js +53 -0
- package/agent-pi/dist/agent-preset-pi.js +169 -0
- package/agent-pi/dist/agent-preset-projection.js +29 -0
- package/agent-pi/dist/agent.js +949 -0
- package/agent-pi/dist/inbox.js +53 -0
- package/agent-pi/dist/index.js +595 -0
- package/agent-pi/dist/knobs.js +24 -0
- package/agent-pi/dist/models.js +200 -0
- package/agent-pi/dist/permission.js +66 -0
- package/agent-pi/dist/pi-client.js +224 -0
- package/agent-pi/dist/pi-events.js +155 -0
- package/agent-pi/dist/pi-home.js +55 -0
- package/agent-pi/dist/safe-json.js +25 -0
- package/agent-pi/dist/session-map.js +119 -0
- package/agent-pi/dist/world-plugin.js +97 -0
- package/agent-pi/package.json +77 -0
- package/cordis.patch.yml +22 -19
- package/package.json +88 -25
- package/client.js +0 -4
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# @pgmi-builds/omp-web bundle patch. This file is the `dsh.bundle.patch` layer
|
|
2
|
+
# of the published npm package: when installed via
|
|
3
|
+
#
|
|
4
|
+
# dsh plugin --profile <name> add @pgmi-builds/omp-web
|
|
5
|
+
#
|
|
6
|
+
# the profile boot merges THIS patch — mount the OMP provider plus disable the
|
|
7
|
+
# native components OMP replaces — exactly like a manual cordis.patch.yml.
|
|
8
|
+
# No profile file edits needed: one command installs and mounts.
|
|
9
|
+
#
|
|
10
|
+
# Profile-specific values are deliberately NOT here: `webserver.port` (port
|
|
11
|
+
# choice) and `settings.path` (settings-under-profile) belong to the user's
|
|
12
|
+
# profile patch layer; `agent-default-model` is tracked dynamically by the
|
|
13
|
+
# bridge from OMP's config.yml (`modelRoles.default`).
|
|
14
|
+
|
|
15
|
+
# Mount the OMP provider: a Cordis Service that registers an AgentFactory on
|
|
16
|
+
# ctx.agents. The provider bridges the full RPC surface (prompt/follow_up/steer/
|
|
17
|
+
# abort/get_state/get_messages/set_model) plus resume; the model selector is
|
|
18
|
+
# served by an OMP-backed LlmAdapter.
|
|
19
|
+
- insert:
|
|
20
|
+
- id: omp-provider
|
|
21
|
+
name: '@pgmi-builds/agent-adapter-omp'
|
|
22
|
+
|
|
23
|
+
# OMP owns the live agent transcript; disable the built-in loop so it does not
|
|
24
|
+
# double-run alongside the OMP RPC process.
|
|
25
|
+
- id: agent-loop
|
|
26
|
+
disabled: true
|
|
27
|
+
|
|
28
|
+
# The native routes register deepseek-official / pi-ai providers; the OMP
|
|
29
|
+
# provider registers its own adapter (one route per OMP provider) on ctx.llm.
|
|
30
|
+
# Leaving them mounted would advertise native models alongside OMP's.
|
|
31
|
+
- id: llm-deepseek
|
|
32
|
+
disabled: true
|
|
33
|
+
- id: llm-pi-ai
|
|
34
|
+
disabled: true
|
|
35
|
+
|
|
36
|
+
# OMP is single-mode: its own RPC process drives tools, so no Dash preset
|
|
37
|
+
# composition is needed.
|
|
38
|
+
- id: agent-presets
|
|
39
|
+
disabled: true
|
|
40
|
+
|
|
41
|
+
# Titles come from OMP, not from Dash. The stock `session-title-first-prompt-llm`
|
|
42
|
+
# row would run a Dash-side LLM call (through whatever adapter serves ctx.llm)
|
|
43
|
+
# after the first prompt — that is Dash inventing functionality OMP does not
|
|
44
|
+
# have. OMP's own session file carries a `title` entry (empty unless OMP
|
|
45
|
+
# generates one) exposed via the SDK (`SessionManager.getSessionName()` /
|
|
46
|
+
# `titleSource: 'user' | 'auto'`); the bridge is the only place that may mirror
|
|
47
|
+
# it into a `session/title` event. Until that mirror is wired, leave the title
|
|
48
|
+
# at its creation value (the cwd) — do not let Dash generate one.
|
|
49
|
+
- id: session-title-llm
|
|
50
|
+
disabled: true
|
|
51
|
+
|
|
52
|
+
# dsh-shape-session-log: the native jsonl backend is the ONLY sessionPersistence.
|
|
53
|
+
# omp-web feeds it (producer role); native components serve list/page/replay.
|
|
54
|
+
# The plugin no longer provides a union persistence (OmpUnionSessionPersistence
|
|
55
|
+
# is retired) — keep the stock row mounted.
|
|
56
|
+
#
|
|
57
|
+
# Directory picker: the stock `directory-picker-auto` is never a simple alias —
|
|
58
|
+
# it RESOLVES the interaction once per boot and mounts BOTH faces through the
|
|
59
|
+
# loader: the host backend package AND the matching CLIENT SURFACE package
|
|
60
|
+
# (`dsh-client-ui-directory-picker-<kind>`). The client surface is what
|
|
61
|
+
# occupies the workspace picker's directory-flow hole; with the hole empty the
|
|
62
|
+
# client hides the "add workspace" entry entirely (WorkspacePicker: `flowAvailable
|
|
63
|
+
# ? [ADD_WORKSPACE] : []`). NEVER just `disabled: true` this row — that removed
|
|
64
|
+
# the button. Pin the in-app browser by mounting both faces of `browse`
|
|
65
|
+
# ourselves (backend first: the surface's browser half drives the capability the
|
|
66
|
+
# backend registers) and unmounting the auto row.
|
|
67
|
+
- insert:
|
|
68
|
+
- id: directory-picker-browse
|
|
69
|
+
name: '@deepseek-ai/dsh-host-directory-picker-browse'
|
|
70
|
+
- id: directory-picker-browse-surface
|
|
71
|
+
name: '@deepseek-ai/dsh-client-ui-directory-picker-browse'
|
|
72
|
+
- id: directory-picker
|
|
73
|
+
disabled: true
|
|
74
|
+
|
|
75
|
+
# OMP has no runtime approval control — the bridge maps the preset onto omp's
|
|
76
|
+
# launch-only --approval-mode flag. Default to danger-full-access (OMP's own
|
|
77
|
+
# native yolo default). Restate the full 3-preset table: a patch with only
|
|
78
|
+
# defaultPreset silently drops the bundle's 3-preset table to the plugin's
|
|
79
|
+
# built-in 2, breaking the 3:3 Dash<->OMP pairing.
|
|
80
|
+
- id: permission
|
|
81
|
+
config:
|
|
82
|
+
presets:
|
|
83
|
+
read-only:
|
|
84
|
+
sandbox: read-only
|
|
85
|
+
approval: ask
|
|
86
|
+
workspace-write:
|
|
87
|
+
sandbox: workspace-write
|
|
88
|
+
approval: ask
|
|
89
|
+
danger-full-access:
|
|
90
|
+
sandbox: danger-full-access
|
|
91
|
+
approval: never
|
|
92
|
+
defaultPreset: danger-full-access
|
|
@@ -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,171 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
35
|
+
import { Remote, RemoteError, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
36
|
+
const OMP_PRESET = Object.freeze({
|
|
37
|
+
id: "omp",
|
|
38
|
+
trust: "system",
|
|
39
|
+
path: "",
|
|
40
|
+
name: "OMP",
|
|
41
|
+
description: "OMP agent via the omp-web bridge",
|
|
42
|
+
});
|
|
43
|
+
const COMPOSITION_TEXT = [
|
|
44
|
+
"# OMP (fixed roster)",
|
|
45
|
+
"",
|
|
46
|
+
"This deployment runs exactly one agent mode: the OMP provider bridges Dash",
|
|
47
|
+
"sessions to a native OMP agent over RPC. There is no per-session plugin",
|
|
48
|
+
"composition to configure, so this preset mounts nothing.",
|
|
49
|
+
"",
|
|
50
|
+
"rows: []",
|
|
51
|
+
"",
|
|
52
|
+
].join("\n");
|
|
53
|
+
/** The standing scope key every `omp` session reads presenters through. */
|
|
54
|
+
const STANDING_KEY = {};
|
|
55
|
+
let SingleOmpPresetRoster = (() => {
|
|
56
|
+
let _classSuper = TypertRemoteService;
|
|
57
|
+
let _instanceExtraInitializers = [];
|
|
58
|
+
let _remoteList_decorators;
|
|
59
|
+
let _remoteRead_decorators;
|
|
60
|
+
let _remoteCopy_decorators;
|
|
61
|
+
let _remoteDelete_decorators;
|
|
62
|
+
let _remoteSelect_decorators;
|
|
63
|
+
return class SingleOmpPresetRoster extends _classSuper {
|
|
64
|
+
static {
|
|
65
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
66
|
+
_remoteList_decorators = [Remote("list")];
|
|
67
|
+
_remoteRead_decorators = [Remote("read")];
|
|
68
|
+
_remoteCopy_decorators = [Remote("copy")];
|
|
69
|
+
_remoteDelete_decorators = [Remote("deletePreset")];
|
|
70
|
+
_remoteSelect_decorators = [Remote("select")];
|
|
71
|
+
__esDecorate(this, null, _remoteList_decorators, { kind: "method", name: "remoteList", static: false, private: false, access: { has: obj => "remoteList" in obj, get: obj => obj.remoteList }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
72
|
+
__esDecorate(this, null, _remoteRead_decorators, { kind: "method", name: "remoteRead", static: false, private: false, access: { has: obj => "remoteRead" in obj, get: obj => obj.remoteRead }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
73
|
+
__esDecorate(this, null, _remoteCopy_decorators, { kind: "method", name: "remoteCopy", static: false, private: false, access: { has: obj => "remoteCopy" in obj, get: obj => obj.remoteCopy }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
74
|
+
__esDecorate(this, null, _remoteDelete_decorators, { kind: "method", name: "remoteDelete", static: false, private: false, access: { has: obj => "remoteDelete" in obj, get: obj => obj.remoteDelete }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
75
|
+
__esDecorate(this, null, _remoteSelect_decorators, { kind: "method", name: "remoteSelect", static: false, private: false, access: { has: obj => "remoteSelect" in obj, get: obj => obj.remoteSelect }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
76
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
77
|
+
}
|
|
78
|
+
constructor(ctx) {
|
|
79
|
+
super(ctx, "agentPresets");
|
|
80
|
+
__runInitializers(this, _instanceExtraInitializers);
|
|
81
|
+
}
|
|
82
|
+
get defaultId() {
|
|
83
|
+
return OMP_PRESET.id;
|
|
84
|
+
}
|
|
85
|
+
get roots() {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
get authorable() {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
async list() {
|
|
92
|
+
return [OMP_PRESET];
|
|
93
|
+
}
|
|
94
|
+
async resolve(id) {
|
|
95
|
+
if (id === undefined || id === OMP_PRESET.id)
|
|
96
|
+
return OMP_PRESET;
|
|
97
|
+
throw new RemoteError("agent-preset/not-found", `agent-presets: preset "${id}" not found (available: omp)`, { agentPreset: id, available: [OMP_PRESET.id] });
|
|
98
|
+
}
|
|
99
|
+
async mount(_agentCtx, id) {
|
|
100
|
+
return this.resolve(id);
|
|
101
|
+
}
|
|
102
|
+
async recompose(_agentCtx, id) {
|
|
103
|
+
return this.resolve(id);
|
|
104
|
+
}
|
|
105
|
+
async read(id) {
|
|
106
|
+
await this.resolve(id);
|
|
107
|
+
return COMPOSITION_TEXT;
|
|
108
|
+
}
|
|
109
|
+
// ── Remote RPC surface (alpha: agentPresets routes come from @Remote) ────
|
|
110
|
+
// The stock dsh-host-apiproxy mapped cordis methods to routes; alpha serves
|
|
111
|
+
// them from @Remote decorators on a TypertRemoteService. A plain Service
|
|
112
|
+
// registers no routes, which is why Settings → Agent Preset 404'd.
|
|
113
|
+
async remoteList() {
|
|
114
|
+
if (process.env.OMP_TRACE === "1")
|
|
115
|
+
process.stderr.write("[omp-roster] remoteList INVOKED\n");
|
|
116
|
+
return {
|
|
117
|
+
presets: [
|
|
118
|
+
{
|
|
119
|
+
id: OMP_PRESET.id,
|
|
120
|
+
trust: OMP_PRESET.trust,
|
|
121
|
+
isDefault: true,
|
|
122
|
+
name: OMP_PRESET.name,
|
|
123
|
+
description: OMP_PRESET.description,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
authorable: this.authorable,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
async remoteRead(agentPreset) {
|
|
130
|
+
const preset = await this.resolve(agentPreset);
|
|
131
|
+
return {
|
|
132
|
+
agentPreset: preset.id,
|
|
133
|
+
trust: preset.trust,
|
|
134
|
+
content: await this.read(preset.id),
|
|
135
|
+
name: preset.name,
|
|
136
|
+
description: preset.description,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
async remoteCopy(from, id, name) {
|
|
140
|
+
await this.copy(from, id, name);
|
|
141
|
+
}
|
|
142
|
+
async remoteDelete(id) {
|
|
143
|
+
await this.remove(id);
|
|
144
|
+
}
|
|
145
|
+
/** Fixed roster: one preset, so selecting it is a no-op ack; anything else is unknown. */
|
|
146
|
+
async remoteSelect(agent, agentPreset) {
|
|
147
|
+
const preset = await this.resolve(agentPreset);
|
|
148
|
+
return preset.id;
|
|
149
|
+
}
|
|
150
|
+
async copy(_from, id, _name) {
|
|
151
|
+
throw new RemoteError("agent-preset/read-only", `agent-presets: preset "${id}" cannot be written: the OMP roster is fixed and ships exactly one preset`, { agentPreset: id, reason: "the OMP roster is fixed and ships exactly one preset" });
|
|
152
|
+
}
|
|
153
|
+
async remove(id) {
|
|
154
|
+
throw new RemoteError("agent-preset/read-only", `agent-presets: preset "${id}" cannot be written: the OMP roster is fixed and ships exactly one preset`, { agentPreset: id, reason: "the OMP roster is fixed and ships exactly one preset" });
|
|
155
|
+
}
|
|
156
|
+
serviceFor(_agent, _name) {
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
159
|
+
composeFrom(_agentCtx, _parentCtx) {
|
|
160
|
+
return undefined;
|
|
161
|
+
}
|
|
162
|
+
composedPreset(_agentCtx) {
|
|
163
|
+
return OMP_PRESET.id;
|
|
164
|
+
}
|
|
165
|
+
async standingKeyFor(id) {
|
|
166
|
+
await this.resolve(id);
|
|
167
|
+
return STANDING_KEY;
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
})();
|
|
171
|
+
export { SingleOmpPresetRoster };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `agentPreset` session projection, owned by the bridge.
|
|
3
|
+
*
|
|
4
|
+
* Upstream registers this fold from the `dsh-agent-presets` package, which our
|
|
5
|
+
* patch disables (OMP replaces preset composition wholesale). But the Web UI
|
|
6
|
+
* depends on the projection regardless: the preset hero chip renders only when
|
|
7
|
+
* `session.projectionValues.agentPreset` resolves (`presetOf` in
|
|
8
|
+
* ui-agent-preset/seat-store.ts), and the session-header label reads it too.
|
|
9
|
+
* Without a registrant the projection is absent for every bridge session and
|
|
10
|
+
* both surfaces stay blank — roster or no roster (that was the "no omp mode"
|
|
11
|
+
* bug: the roster service answered `agentPresets/list` 200, yet nothing drove
|
|
12
|
+
* the per-session projection the chip gates on).
|
|
13
|
+
*
|
|
14
|
+
* Same fold as upstream (packages/preset/agent-presets/src/session.ts):
|
|
15
|
+
* initialized from the creation header, advanced by `agent-preset/selected`
|
|
16
|
+
* events, which this bridge already synthesizes (`"omp"`) on every session it
|
|
17
|
+
* prepares. Registered under the provider's own fiber via
|
|
18
|
+
* `ctx.inject(['sessionProjections'])`, so the key lives exactly as long as
|
|
19
|
+
* the provider is mounted.
|
|
20
|
+
*/
|
|
21
|
+
import { z } from "zod";
|
|
22
|
+
const agentPresetSchema = z.union([z.string(), z.null()]);
|
|
23
|
+
/** Current Session preset, initialized from its header and advanced by selection events. */
|
|
24
|
+
export const ompAgentPresetProjection = {
|
|
25
|
+
key: "agentPreset",
|
|
26
|
+
stateSchema: agentPresetSchema,
|
|
27
|
+
// omp-web is single-preset: default every session to "omp" so the header
|
|
28
|
+
// chip resolves for scan-native (never-resumed) sessions too, instead of
|
|
29
|
+
// only those whose log carries an `agent-preset/selected` event.
|
|
30
|
+
init: (header) => header.agentPreset ?? "omp",
|
|
31
|
+
apply: (state, event) => event.type === "agent-preset/selected"
|
|
32
|
+
? event.data.agentPreset
|
|
33
|
+
: state,
|
|
34
|
+
wire: { viewSchema: agentPresetSchema, view: (state) => state },
|
|
35
|
+
stateVersion: 1,
|
|
36
|
+
};
|