super-dsh 0.1.3 → 0.1.5-a
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/README.md +3 -3
- package/agent-agy/cordis.patch.yml +8 -4
- package/agent-agy/dist/agent-preset-agy.d.ts +23 -43
- package/agent-agy/dist/agent-preset-agy.js +29 -166
- package/agent-agy/dist/agent.d.ts +2 -1
- package/agent-agy/dist/agent.js +3 -2
- package/agent-agy/dist/agy-sessions.d.ts +2 -1
- package/agent-agy/dist/agy-sessions.js +2 -11
- package/agent-agy/dist/index.js +13 -12
- package/agent-agy/dist/world-plugin.d.ts +2 -1
- package/agent-agy/dist/world-plugin.js +31 -51
- package/agent-agy/package.json +6 -6
- package/agent-claude/cordis.patch.yml +8 -4
- package/agent-claude/dist/agent-preset-claude.js +29 -166
- package/agent-claude/dist/agent.js +10 -10
- package/agent-claude/dist/claude-client.js +22 -3
- package/agent-claude/dist/claude-home.js +0 -8
- package/agent-claude/dist/index.js +12 -15
- package/agent-claude/dist/session-map.js +2 -5
- package/agent-claude/dist/world-plugin.js +3 -3
- package/agent-claude/package.json +9 -9
- package/agent-codex/README.md +8 -8
- package/agent-codex/cordis.patch.yml +9 -5
- package/agent-codex/dist/agent-preset-codex.js +29 -168
- package/agent-codex/dist/agent.js +17 -12
- package/agent-codex/dist/codex-store.js +0 -9
- package/agent-codex/dist/index.js +13 -16
- package/agent-codex/dist/session-map.js +2 -5
- package/agent-codex/dist/world-plugin.js +31 -51
- package/agent-codex/package.json +14 -11
- package/agent-hermes/README.md +9 -8
- package/agent-hermes/cordis.patch.yml +8 -4
- package/agent-hermes/dist/agent-preset-hermes.js +29 -168
- package/agent-hermes/dist/agent.js +33 -19
- package/agent-hermes/dist/hermes-client.js +5 -5
- package/agent-hermes/dist/hermes-store.js +2 -11
- package/agent-hermes/dist/index.js +13 -12
- package/agent-hermes/dist/world-plugin.js +31 -52
- package/agent-hermes/package.json +14 -11
- package/agent-omp/README.md +2 -2
- package/agent-omp/cordis.patch.yml +12 -7
- package/agent-omp/dist/agent-preset-omp.js +30 -169
- package/agent-omp/dist/agent.js +13 -5
- package/agent-omp/dist/index.js +12 -22
- package/agent-omp/dist/mobile/gesture.js +2 -2
- package/agent-omp/dist/mobile/zoom-guard.js +4 -4
- package/agent-omp/dist/mobile-boot.js +2 -2
- package/agent-omp/dist/omp-cli.js +1 -1
- package/agent-omp/dist/omp-disk-discovery.js +1 -1
- package/agent-omp/dist/protocol.js +1 -1
- package/agent-omp/dist/sidecar-client.js +1 -1
- package/agent-omp/dist/world-plugin.js +37 -50
- package/agent-omp/package.json +18 -14
- package/agent-omp/sidecar/main.ts +2 -2
- package/agent-pi/README.md +5 -5
- package/agent-pi/cordis.patch.yml +8 -4
- package/agent-pi/dist/agent-preset-pi.js +29 -166
- package/agent-pi/dist/agent.js +18 -12
- package/agent-pi/dist/index.js +14 -16
- package/agent-pi/dist/pi-home.js +2 -12
- package/agent-pi/dist/world-plugin.js +31 -51
- package/agent-pi/package.json +14 -11
- package/client/index.js +1994 -150
- package/cordis.patch.yml +39 -15
- package/package.json +32 -30
- package/{agent-hub → superd-hub}/cordis.patch.yml +3 -3
- package/{agent-hub → superd-hub}/dist/agent-roster.d.ts +3 -1
- package/{agent-hub → superd-hub}/dist/agent-roster.js +4 -2
- package/superd-hub/dist/carrier.d.ts +62 -0
- package/superd-hub/dist/carrier.js +213 -0
- package/superd-hub/dist/fusion-transport.d.ts +150 -0
- package/superd-hub/dist/fusion-transport.js +369 -0
- package/{agent-hub → superd-hub}/dist/gateway.d.ts +9 -4
- package/superd-hub/dist/gateway.js +44 -0
- package/superd-hub/dist/hub-route.d.ts +74 -0
- package/superd-hub/dist/hub-route.js +188 -0
- package/{agent-hub → superd-hub}/dist/index.d.ts +14 -6
- package/{agent-hub → superd-hub}/dist/index.js +14 -6
- package/{agent-hub → superd-hub}/dist/roster.d.ts +2 -2
- package/{agent-hub → superd-hub}/dist/rpc.js +1 -1
- package/{agent-hub → superd-hub}/dist/spawn-world.d.ts +27 -6
- package/superd-hub/dist/spawn-world.js +279 -0
- package/superd-hub/dist/switch-core.d.ts +630 -0
- package/superd-hub/dist/switch-core.js +734 -0
- package/superd-hub/dist/system-head.d.ts +69 -0
- package/superd-hub/dist/system-head.js +194 -0
- package/superd-hub/dist/web-trust.d.ts +112 -0
- package/superd-hub/dist/web-trust.js +126 -0
- package/superd-hub/dist/world-entry.d.ts +38 -0
- package/superd-hub/dist/world-entry.js +47 -0
- package/{agent-hub → superd-hub}/dist/world-host.d.ts +15 -20
- package/superd-hub/dist/world-host.js +65 -0
- package/{agent-hub → superd-hub}/dist/world-join.d.ts +2 -1
- package/{agent-hub → superd-hub}/dist/world-join.js +30 -50
- package/superd-hub/dist/world-mount.d.ts +82 -0
- package/superd-hub/dist/world-mount.js +105 -0
- package/{agent-hub → superd-hub}/dist/world-mux.d.ts +21 -6
- package/superd-hub/dist/world-mux.js +392 -0
- package/{agent-hub → superd-hub}/dist/world-provision.d.ts +20 -4
- package/superd-hub/dist/world-provision.js +203 -0
- package/superd-hub/dist/world-web-server.d.ts +113 -0
- package/superd-hub/dist/world-web-server.js +99 -0
- package/superd-hub/lib/client/index.js +2086 -0
- package/{agent-hub → superd-hub}/package.json +12 -7
- package/agent-hub/dist/carrier.d.ts +0 -43
- package/agent-hub/dist/carrier.js +0 -241
- package/agent-hub/dist/gateway.js +0 -18
- package/agent-hub/dist/spawn-world.js +0 -72
- package/agent-hub/dist/world-entry.d.ts +0 -31
- package/agent-hub/dist/world-entry.js +0 -51
- package/agent-hub/dist/world-host.js +0 -44
- package/agent-hub/dist/world-mount.d.ts +0 -52
- package/agent-hub/dist/world-mount.js +0 -52
- package/agent-hub/dist/world-mux.js +0 -224
- package/agent-hub/dist/world-provision.js +0 -122
- package/agent-hub/dist/world-web-server.d.ts +0 -162
- package/agent-hub/dist/world-web-server.js +0 -248
- package/agent-hub/lib/client/index.js +0 -242
- /package/{agent-hub → superd-hub}/dist/client-shim.d.ts +0 -0
- /package/{agent-hub → superd-hub}/dist/client-shim.js +0 -0
- /package/{agent-hub → superd-hub}/dist/envelope.d.ts +0 -0
- /package/{agent-hub → superd-hub}/dist/envelope.js +0 -0
- /package/{agent-hub → superd-hub}/dist/index-pass.d.ts +0 -0
- /package/{agent-hub → superd-hub}/dist/index-pass.js +0 -0
- /package/{agent-hub → superd-hub}/dist/labels.d.ts +0 -0
- /package/{agent-hub → superd-hub}/dist/labels.js +0 -0
- /package/{agent-hub → superd-hub}/dist/ownership.d.ts +0 -0
- /package/{agent-hub → superd-hub}/dist/ownership.js +0 -0
- /package/{agent-hub → superd-hub}/dist/roster.js +0 -0
- /package/{agent-hub → superd-hub}/dist/rpc.d.ts +0 -0
- /package/{agent-hub → superd-hub}/dist/targets.d.ts +0 -0
- /package/{agent-hub → superd-hub}/dist/targets.js +0 -0
package/agent-omp/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @pgmi-builds/agent-omp(OMP adapter,SDK 线)
|
|
2
2
|
|
|
3
3
|
OMP Web 的 SDK 线:**衔接层(DSH 契约/术语/类形状)沿用 `apps/omp-web` 现行源码,内核从 `omp --mode rpc` 子进程换成 `@oh-my-pi/pi-coding-agent` SDK**。数据面目标 = `docs/plans/sdk-data-surface-assessment.md` 的 A1–A8 / S1–S10。
|
|
4
4
|
|
|
@@ -34,7 +34,7 @@ dsh 宿主 (Node 22, 本包 dist/) Bun sidecar (本包 sidecar/)
|
|
|
34
34
|
- `sidecar/main.ts`(bun 入口):ready 握手 + JSON-lines 请求/响应/事件三帧协议;app 级共享单例 `authStorage`/`modelRegistry`;session 池(create/dispose/事件转发)。
|
|
35
35
|
- `src/protocol.ts`:协议与方法表类型(sys.ping / models.list / settings.get / session.create|info|prompt|steer|followUp|abort|dispose / sessions.list)。
|
|
36
36
|
- `src/sidecar-client.ts`:Node 侧 spawn/关联/事件分发/优雅关停;`src/index.ts` 暂导出 client。
|
|
37
|
-
-
|
|
37
|
+
- ~~冒烟 `test/sidecar-smoke.test.mjs`~~(2026-09-24 场景退役删除;整包验证走 superd 的 4999 pack 线 + dev3)。
|
|
38
38
|
- 坑已修:`ModelRegistry.refreshInBackground()` 此版本返回 void(非 Promise),可选链后接 `.catch` 会炸;ready-timeout 定时器必须 clear 否则 Node 进程挂 60s。
|
|
39
39
|
|
|
40
40
|
## As-built:衔接层移植(2026-09-09,已完成 ✅)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# @pgmi-builds/omp
|
|
1
|
+
# @pgmi-builds/agent-omp bundle patch. This file is the `dsh.bundle.patch` layer
|
|
2
2
|
# of the published npm package: when installed via
|
|
3
3
|
#
|
|
4
|
-
# dsh plugin --profile <name> add @pgmi-builds/omp
|
|
4
|
+
# dsh plugin --profile <name> add @pgmi-builds/agent-omp
|
|
5
5
|
#
|
|
6
6
|
# the profile boot merges THIS patch — mount the OMP provider plus disable the
|
|
7
7
|
# native components OMP replaces — exactly like a manual cordis.patch.yml.
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
# served by an OMP-backed LlmAdapter.
|
|
19
19
|
- insert:
|
|
20
20
|
- id: omp-provider
|
|
21
|
-
name: '@pgmi-builds/agent-
|
|
21
|
+
name: '@pgmi-builds/agent-omp'
|
|
22
22
|
|
|
23
23
|
# OMP owns the live agent transcript; disable the built-in loop so it does not
|
|
24
24
|
# double-run alongside the OMP RPC process.
|
|
@@ -34,9 +34,14 @@
|
|
|
34
34
|
disabled: true
|
|
35
35
|
|
|
36
36
|
# OMP is single-mode: its own RPC process drives tools, so no Dash preset
|
|
37
|
-
# composition is needed.
|
|
38
|
-
-
|
|
39
|
-
|
|
37
|
+
# composition is needed. 0.1.7: the host AgentPresetRegistry row (renamed
|
|
38
|
+
# `agent-presets` → `agent-preset-registry`) stays MOUNTED — the bridge
|
|
39
|
+
# registers its one fixed preset into it (src/agent-preset-omp.ts) and the
|
|
40
|
+
# registry owns roster/selection/document RPC + the agentPreset projection.
|
|
41
|
+
# Pin only the default; modeSelectionEnabled already defaults to true.
|
|
42
|
+
- id: agent-preset-registry
|
|
43
|
+
config:
|
|
44
|
+
default: omp
|
|
40
45
|
|
|
41
46
|
# Titles come from OMP, not from Dash. The stock `session-title-first-prompt-llm`
|
|
42
47
|
# row would run a Dash-side LLM call (through whatever adapter serves ctx.llm)
|
|
@@ -50,7 +55,7 @@
|
|
|
50
55
|
disabled: true
|
|
51
56
|
|
|
52
57
|
# dsh-shape-session-log: the native jsonl backend is the ONLY sessionPersistence.
|
|
53
|
-
# omp
|
|
58
|
+
# agent-omp feeds it (producer role); native components serve list/page/replay.
|
|
54
59
|
# The plugin no longer provides a union persistence (OmpUnionSessionPersistence
|
|
55
60
|
# is retired) — keep the stock row mounted.
|
|
56
61
|
#
|
|
@@ -1,171 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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: "",
|
|
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,
|
|
40
5
|
name: "OMP",
|
|
41
|
-
description: "OMP agent via the omp
|
|
6
|
+
description: "OMP agent via the agent-omp bridge",
|
|
7
|
+
plugins: Object.freeze([]),
|
|
42
8
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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 };
|
|
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
|
+
}
|
package/agent-omp/dist/agent.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Inbox } from "./inbox.js";
|
|
|
3
3
|
import { LlmAttemptId, ToolCallId, QUOTA_EXCEEDED_CODE, createAssistantMessage, createSystemMessage, createToolResultMessage, createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
4
4
|
import { createScope } from "@deepseek-ai/dsh-scope";
|
|
5
5
|
import { getBridgeStore } from "./store/index.js";
|
|
6
|
+
import { withSystemHead } from "../../superd-hub/dist/index.js";
|
|
6
7
|
/**
|
|
7
8
|
* v2 live assistant-stream publication for the OMP bridge — the same frame
|
|
8
9
|
* protocol the reference loop's AssistantStreamAttempt speaks (start marker,
|
|
@@ -153,8 +154,10 @@ function userMessageText(message) {
|
|
|
153
154
|
* echo it into history as a fake user prompt. Detect and drop it.
|
|
154
155
|
*/
|
|
155
156
|
function isApprovalNarration(message) {
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
// 0.1.7: the shared `plugin` source kind is gone (MessageSourceMap is
|
|
158
|
+
// merge-extensible; each producer declares its own kind) — user-approval
|
|
159
|
+
// now carries the dedicated `user-approval` kind.
|
|
160
|
+
return message.source.kind === "user-approval";
|
|
158
161
|
}
|
|
159
162
|
/**
|
|
160
163
|
* Reconstruct a Dash user message from an OMP `message_start(role=user)`
|
|
@@ -290,7 +293,7 @@ export class OmpAgent {
|
|
|
290
293
|
this.#loopCtx = loopCtx;
|
|
291
294
|
this.id = id;
|
|
292
295
|
this.options = options;
|
|
293
|
-
this.session = session;
|
|
296
|
+
this.session = withSystemHead(session, () => createSystemMessage(""));
|
|
294
297
|
this.#rpc = rpc;
|
|
295
298
|
this.#onIdleExit = onIdleExit;
|
|
296
299
|
this.#dispatch = agentEvents(loopCtx, this);
|
|
@@ -503,14 +506,19 @@ export class OmpAgent {
|
|
|
503
506
|
if (!this.session.snapshotEvents().some((event) => event.type === "agent-preset/selected" && event.data?.agentPreset === "omp")) {
|
|
504
507
|
this.session.append("agent-preset/selected", { agentPreset: "omp" });
|
|
505
508
|
}
|
|
506
|
-
|
|
509
|
+
{
|
|
507
510
|
const systemPrompt = await this.#rpc.getSystemPrompt();
|
|
508
511
|
if (systemPrompt !== undefined && systemPrompt !== "") {
|
|
509
512
|
// dsh session v3 requires positive turn/step coordinates on surface
|
|
510
513
|
// events (`turn must be positive`); native fresh sessions use 1/1 for the
|
|
511
514
|
// node-0 system prompt. 0/0 made the native jsonl writer reject the whole
|
|
512
515
|
// live batch, stalling every append before turn/start.
|
|
513
|
-
|
|
516
|
+
// 0.1.7: createSystemMessage dropped its origin parameter (the source
|
|
517
|
+
// kind is fixed at `system-prompt`).
|
|
518
|
+
// v4 protected-head posture: node-0 on a fresh surface (append), or a
|
|
519
|
+
// replacement of the placeholder when a user message raced the async
|
|
520
|
+
// prompt fetch — both shapes the 0.1.7 reader accepts.
|
|
521
|
+
this.session.stampSystemPrompt(1, 1, createSystemMessage(systemPrompt));
|
|
514
522
|
}
|
|
515
523
|
}
|
|
516
524
|
}
|
package/agent-omp/dist/index.js
CHANGED
|
@@ -23,13 +23,11 @@ import { realpathSync, statSync } from "node:fs";
|
|
|
23
23
|
import { Service } from "@deepseek-ai/cordis";
|
|
24
24
|
import { homedir } from "node:os";
|
|
25
25
|
import { join } from "node:path";
|
|
26
|
-
import { emitAgentEvent } from "@deepseek-ai/dsh-agent";
|
|
27
26
|
import { SessionPreparation, SessionLogOffset } from "@deepseek-ai/dsh-session";
|
|
28
27
|
import { LazyOmpRpc } from "./lazy-rpc.js";
|
|
29
28
|
import { OmpAgent } from "./agent.js";
|
|
30
29
|
import { OmpLlmAdapter } from "./adapter.js";
|
|
31
|
-
import {
|
|
32
|
-
import { ompAgentPresetProjection } from "./agent-preset-projection.js";
|
|
30
|
+
import { registerOmpPreset } from "./agent-preset-omp.js";
|
|
33
31
|
import { resolveEntryById } from "./pairing.js";
|
|
34
32
|
import { readOmpDefaultModelFromConfig, sessionHeaderId } from "./omp-store.js";
|
|
35
33
|
import { ompModelRoles, ompSetModelRoles } from "./omp-cli.js";
|
|
@@ -111,26 +109,17 @@ export class OmpProvider extends Service {
|
|
|
111
109
|
void this.#syncModelDefaultTick();
|
|
112
110
|
// dsh-shape-session-log: the native jsonl backend (re-enabled in the patch)
|
|
113
111
|
// is the sole `sessionPersistence` — the plugin no longer provides a union
|
|
114
|
-
// persistence. Session list/page/replay come from native components; omp
|
|
112
|
+
// persistence. Session list/page/replay come from native components; agent-omp
|
|
115
113
|
// is only the producer (writes the dsh session log on live turns).
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
new SingleOmpPresetRoster(ctx);
|
|
123
|
-
// Drive the `agentPreset` session projection ourselves: the upstream
|
|
124
|
-
// registrant lives in the (disabled) dsh-agent-presets package, but the
|
|
125
|
-
// Web UI gates the preset chip and header label on
|
|
126
|
-
// `projectionValues.agentPreset`. Deferred via inject so the registry's
|
|
127
|
-
// service contract is honored (registers only once it exists).
|
|
128
|
-
ctx.inject(["sessionProjections"], (scoped) => {
|
|
129
|
-
scoped.sessionProjections.register(ompAgentPresetProjection);
|
|
130
|
-
});
|
|
114
|
+
// 0.1.7: roster/selection/document RPC + the `agentPreset` session
|
|
115
|
+
// projection all live in the host AgentPresetRegistry (mounted by the
|
|
116
|
+
// dsh-web-app bundle's `agent-preset-registry` row; the adapter patch pins
|
|
117
|
+
// its `default` to the OMP preset). The bridge only registers its one
|
|
118
|
+
// fixed preset into the registry — no service of its own anymore.
|
|
119
|
+
registerOmpPreset(ctx);
|
|
131
120
|
ctx.effect(() => () => closeBridgeStore(), "ompProvider.storeClose()");
|
|
132
121
|
this.#reconcileWorkspaces();
|
|
133
|
-
// Mobile page-config boot script (host half): sets `window.
|
|
122
|
+
// Mobile page-config boot script (host half): sets `window.__AGENT_OMP_MOBILE__`
|
|
134
123
|
// + the iOS zoom-guard section. Fail-open — a missing webServer leaves the
|
|
135
124
|
// feature dormant, and an injection failure is logged, never thrown.
|
|
136
125
|
installMobileBootScript(ctx);
|
|
@@ -529,8 +518,9 @@ async function setupAndPublish(loopCtx, ownerCtx, id, agentOptions, setup, sessi
|
|
|
529
518
|
agent.ctx.sessions.announce(session);
|
|
530
519
|
}
|
|
531
520
|
detachAgent = loopCtx.agents.enter(agent, parentAgent);
|
|
532
|
-
|
|
533
|
-
|
|
521
|
+
// 0.1.6: announce(agent, source) is required, async, and emits agent/created
|
|
522
|
+
// itself — the manual agent/session-start emission is gone upstream.
|
|
523
|
+
await loopCtx.agents.announce(agent, source);
|
|
534
524
|
let disposed = false;
|
|
535
525
|
let unfollowOwner;
|
|
536
526
|
const dispose = async () => {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* No DOM here: these are pure predicates over gesture facts plus the
|
|
47
47
|
* panel state the caller reads off live DOM.
|
|
48
48
|
*
|
|
49
|
-
* @module omp
|
|
49
|
+
* @module agent-omp/mobile/gesture
|
|
50
50
|
*/
|
|
51
51
|
/** Resolved defaults — the `1706b81` constants (120 / viewport÷4 / 40 / 1.3)
|
|
52
52
|
* plus the one addition, the velocity gate. A slow text-selection drag runs
|
|
@@ -127,7 +127,7 @@ export function classifySwipeProgress(progress, panels, sessionLive, thresholds)
|
|
|
127
127
|
* (host feature off, or an old cached page) resolves to enabled=false — the
|
|
128
128
|
* client half is inert unless the host opted the page in.
|
|
129
129
|
*
|
|
130
|
-
* @param pageConfig - `window.
|
|
130
|
+
* @param pageConfig - `window.__AGENT_OMP_MOBILE__` as left by the boot script.
|
|
131
131
|
* @returns resolved thresholds plus the enable flag.
|
|
132
132
|
*/
|
|
133
133
|
export function resolveMobileConfig(pageConfig) {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* eval-style tests in `test/web-trust.spec.ts` execute the real generated
|
|
35
35
|
* script against a stub DOM, so any such leak fails the suite.
|
|
36
36
|
*
|
|
37
|
-
* @module omp
|
|
37
|
+
* @module agent-omp/mobile/zoom-guard
|
|
38
38
|
*/
|
|
39
39
|
/** The two zoom tokens the guard merges into the stock viewport content. */
|
|
40
40
|
export const ZOOM_GUARD_TOKENS = {
|
|
@@ -113,7 +113,7 @@ export function mergeViewportTokens(content, tokens) {
|
|
|
113
113
|
* `'off'` disarms the guard. Unknown non-`off` values read as `'meta'`
|
|
114
114
|
* (schema validation makes them unreachable in production; benign here).
|
|
115
115
|
*
|
|
116
|
-
* @param config - the `
|
|
116
|
+
* @param config - the `__AGENT_OMP_MOBILE__` payload (only `zoomGuard` is read).
|
|
117
117
|
* @param isIOS - {@link isIOSClassUA} verdict for this page load.
|
|
118
118
|
* @param isNarrow - `matchMedia('(max-width: breakpoint-0.02px)')` verdict.
|
|
119
119
|
* @returns `true` when the viewport rewrite should be applied.
|
|
@@ -236,13 +236,13 @@ export function buildZoomGuardSection() {
|
|
|
236
236
|
`var ZD=${isStandaloneDisplay.toString()};`,
|
|
237
237
|
`var ZF=${buildFontFloorCss.toString()};`,
|
|
238
238
|
'(function(){',
|
|
239
|
-
'var m=window.
|
|
239
|
+
'var m=window.__AGENT_OMP_MOBILE__;',
|
|
240
240
|
'var ios=ZI(navigator.userAgent,(navigator.maxTouchPoints||0));',
|
|
241
241
|
'if(!ios)return;',
|
|
242
242
|
"var bpx=(m&&typeof m.breakpoint==='number'&&m.breakpoint>0)?m.breakpoint:768;",
|
|
243
243
|
'var bp=bpx-0.02;',
|
|
244
244
|
"var sa=ZD((window.matchMedia&&window.matchMedia('(display-mode: standalone)').matches),(navigator.standalone===true));",
|
|
245
|
-
"if(sa){var f=document.createElement('style');f.setAttribute('id','ios-zoom-font-floor');f.setAttribute('data-plugin','omp
|
|
245
|
+
"if(sa){var f=document.createElement('style');f.setAttribute('id','ios-zoom-font-floor');f.setAttribute('data-plugin','agent-omp');f.setAttribute('data-plugin-css','agent-omp/zoom-font-floor');f.textContent=ZF(bpx);headEl().appendChild(f);return}",
|
|
246
246
|
"var mq=(typeof window.matchMedia==='function')?window.matchMedia('(max-width:'+bp+'px)'):null;",
|
|
247
247
|
"var T={'maximum-scale':'1','user-scalable':'no'};",
|
|
248
248
|
'var meta=null,stock=null,mine=false,applied=false,obs=null,lad=null,lN=0;',
|
|
@@ -10,7 +10,7 @@ export function buildMobileBootScript() {
|
|
|
10
10
|
const parts = ['(function(){try{'];
|
|
11
11
|
// Ship default ON: a bare page carries the mobile global (the client's
|
|
12
12
|
// `resolveMobileConfig` merges the threshold defaults over `enabled: true`).
|
|
13
|
-
parts.push(`window.
|
|
13
|
+
parts.push(`window.__AGENT_OMP_MOBILE__=${JSON.stringify({ enabled: true })};`);
|
|
14
14
|
// The zoom guard rides the mobile leg (default 'meta' mode): emitted always.
|
|
15
15
|
parts.push(buildZoomGuardSection());
|
|
16
16
|
parts.push('}catch(e){}})();');
|
|
@@ -31,7 +31,7 @@ export function installMobileBootScript(ctx) {
|
|
|
31
31
|
table.push({ kind: 'script', placement: 'head', text: buildMobileBootScript() });
|
|
32
32
|
}
|
|
33
33
|
catch (error) {
|
|
34
|
-
ctx.logger.warn(`omp
|
|
34
|
+
ctx.logger.warn(`agent-omp: mobile boot script injection failed: ${String(error)}`);
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
});
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* (reads) or `false` (write), so the provider never fails to boot on a down
|
|
28
28
|
* sidecar.
|
|
29
29
|
*
|
|
30
|
-
* @module omp
|
|
30
|
+
* @module agent-omp/omp-cli
|
|
31
31
|
*/
|
|
32
32
|
import { callShared, callSharedIfLive } from "./sdk-client.js";
|
|
33
33
|
// ---------------------------------------------------------------------------
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* omp project → claude project. All readers are fail-soft: missing roots or
|
|
22
22
|
* unreadable files are skipped, never thrown.
|
|
23
23
|
*
|
|
24
|
-
* @module omp
|
|
24
|
+
* @module agent-omp/omp-disk-discovery
|
|
25
25
|
*/
|
|
26
26
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
27
27
|
import { homedir } from "node:os";
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* agent-omp — the adapter's world plugin (spec S2): activation IS
|
|
3
3
|
* roster membership.
|
|
4
4
|
*
|
|
5
|
-
* AW-B (DL1–DL5): the world is spawned as a sibling
|
|
6
|
-
*
|
|
7
|
-
* the hub:
|
|
5
|
+
* AW-B (DL1–DL5) → path-separation T-D: the world is spawned as a sibling
|
|
6
|
+
* ROOT context with NO listener and NO webui composition (see
|
|
7
|
+
* `worldMountPatches`) — a pure data plane behind the hub's `/hub` family:
|
|
8
8
|
*
|
|
9
|
-
* 1. ctx0 publishes the host mount (
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* 1. ctx0 publishes the host mount record (the world's addressability
|
|
10
|
+
* entry — no webServer, no fence: those legs retired with the world
|
|
11
|
+
* pages) before spawn.
|
|
12
|
+
* 2. the world's entry row provides the virtual `webServer` (a silent
|
|
13
|
+
* sink) plus the neutral `webRuntime` facts its connection row injects.
|
|
14
|
+
* 3. the hub's `/hub` family answers `?agent=omp` traffic in ctx0's auth
|
|
15
|
+
* domain and dispatches into this world's gateway instance (the
|
|
16
|
+
* per-label `/<label>/api` + `/<label>/api/remote.mux` mounts retired
|
|
17
|
+
* in T-C, `mountWorld` deleted in T-D).
|
|
14
18
|
*/
|
|
15
19
|
import { mkdirSync } from 'node:fs';
|
|
16
20
|
import { resolveDshHome } from '@deepseek-ai/dsh-home-paths';
|
|
17
21
|
import { join } from 'node:path';
|
|
18
|
-
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount,
|
|
19
|
-
export const name = '
|
|
22
|
+
import { spawnWorld, registerAgent, setReady, registerForeignTarget, registerHostMount, worldMountPatches, provisionWorldProfile, resolveInstallAnchor, } from '../../superd-hub/dist/index.js';
|
|
23
|
+
export const name = 'agent-omp';
|
|
20
24
|
/** Runtime key — also the mount label. */
|
|
21
25
|
const KEY = 'omp';
|
|
22
|
-
const ANCHOR = process.env.SUPERD_DSH_ANCHOR
|
|
23
|
-
?? '/home/u1/.local/lib/node_modules/@deepseek-ai/dsh/package.json';
|
|
24
26
|
export function apply(ctx) {
|
|
25
27
|
registerAgent({ key: KEY, label: 'OMP', ready: false });
|
|
26
28
|
// Harness resolver (env → ~/.dsh): a consumer install has no DSH_HOME and
|
|
@@ -34,63 +36,48 @@ export function apply(ctx) {
|
|
|
34
36
|
const worldHome = join(root, 'agents', KEY);
|
|
35
37
|
mkdirSync(join(worldHome, 'profiles'), { recursive: true });
|
|
36
38
|
// Publish story: a foreign install has no line bootstrap, so the nested
|
|
37
|
-
// profile + @pgmi-builds links are provisioned HERE (idempotent
|
|
38
|
-
|
|
39
|
-
// overrides the resolved base).
|
|
40
|
-
const bareBase = provisionWorldProfile({
|
|
39
|
+
// profile + @pgmi-builds links are provisioned HERE (idempotent).
|
|
40
|
+
provisionWorldProfile({
|
|
41
41
|
key: KEY,
|
|
42
|
-
adapterPkg: '@pgmi-builds/agent-
|
|
42
|
+
adapterPkg: '@pgmi-builds/agent-omp',
|
|
43
43
|
worldHome,
|
|
44
44
|
});
|
|
45
45
|
const world = (async () => {
|
|
46
|
-
//
|
|
47
|
-
// the
|
|
48
|
-
const
|
|
49
|
-
ctx.inject(['webServer', 'connection'], (hostCtx) => { resolve(hostCtx); });
|
|
50
|
-
});
|
|
51
|
-
const real = host['webServer'];
|
|
52
|
-
const connection = host['connection'];
|
|
53
|
-
const dropHostMount = registerHostMount({
|
|
54
|
-
key: KEY,
|
|
55
|
-
labelPath: `/${KEY}`,
|
|
56
|
-
real,
|
|
57
|
-
// ctx0's index gate, applied by the mount to this world's pages and assets:
|
|
58
|
-
// the world is reached in-ctx and owns no listener, so ctx0 decides auth.
|
|
59
|
-
authorize: (req, res) => connection.authorizeIndex(req, res),
|
|
60
|
-
});
|
|
46
|
+
// T-D: no ctx0 listening-stack wait — the mount record is addressability
|
|
47
|
+
// only and the /hub family wires its own gate in ctx0 (gateway.ts).
|
|
48
|
+
const dropHostMount = registerHostMount({ key: KEY, labelPath: `/${KEY}` });
|
|
61
49
|
const ctxW = await spawnWorld({
|
|
62
|
-
appName: `
|
|
50
|
+
appName: `superd-${KEY}`,
|
|
63
51
|
profileName: 'web',
|
|
64
|
-
installAnchor:
|
|
52
|
+
installAnchor: resolveInstallAnchor(ctx), // lazy: never at module scope — import must stay side-effect-free
|
|
65
53
|
home: worldHome,
|
|
66
54
|
dataHome: worldHome,
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
//
|
|
70
|
-
|
|
71
|
-
bareModuleBaseUrl: process.env.AW_BARE_BASE ?? bareBase ?? undefined,
|
|
55
|
+
// The host's live table carries this world: spawnWorld republishes a
|
|
56
|
+
// widened successor before boot imports anything (spec §2.1), and
|
|
57
|
+
// @pgmi-builds rows resolve from the profile-local links written above.
|
|
58
|
+
host: ctx,
|
|
72
59
|
extraPatches: worldMountPatches(KEY),
|
|
73
60
|
});
|
|
74
61
|
const gateway = ctxW.get('typertGateway');
|
|
75
62
|
registerForeignTarget({ key: KEY, gateway });
|
|
76
|
-
const mounted = mountWorld({
|
|
77
|
-
real,
|
|
78
|
-
label: KEY,
|
|
79
|
-
gateway,
|
|
80
|
-
requestRejection: (request) => connection
|
|
81
|
-
.requestRejection(request),
|
|
82
|
-
});
|
|
83
63
|
setReady(KEY, true);
|
|
84
64
|
ctx.effect?.(() => () => {
|
|
85
|
-
mounted.dispose();
|
|
86
65
|
dropHostMount();
|
|
87
|
-
}, `
|
|
66
|
+
}, `agent-${KEY}: mount`);
|
|
88
67
|
return ctxW;
|
|
89
68
|
})().catch((cause) => {
|
|
90
69
|
// A failed world degrades to a not-ready roster row; a rejected provided
|
|
91
70
|
// promise would fail the entire host boot (loader entry apply).
|
|
92
71
|
console.error(`[super-dsh] ${KEY} world failed:`, cause);
|
|
72
|
+
// Startup diagnostics: the collector's warn/error records include the
|
|
73
|
+
// loader's own patch/import diagnostics for this world's include.
|
|
74
|
+
const startup = cause.startup;
|
|
75
|
+
if (startup?.messages !== undefined) {
|
|
76
|
+
for (const message of startup.messages) {
|
|
77
|
+
console.error(`[super-dsh] ${KEY} startup:`, JSON.stringify(message));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
93
80
|
return null;
|
|
94
81
|
});
|
|
95
|
-
ctx.provide(`
|
|
82
|
+
ctx.provide(`superd.world.${KEY}`, world);
|
|
96
83
|
}
|