super-dsh 0.1.6 → 0.1.10-e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -3
- package/agent-agy/cordis.patch.yml +7 -4
- package/agent-agy/dist/agent.d.ts +12 -11
- package/agent-agy/dist/agy-auth-gateway.d.ts +124 -0
- package/agent-agy/dist/agy-auth-gateway.js +233 -0
- package/agent-agy/dist/agy-auth.d.ts +153 -0
- package/agent-agy/dist/agy-auth.js +179 -0
- package/agent-agy/dist/agy-cli-client.d.ts +39 -9
- package/agent-agy/dist/agy-cli-client.js +82 -18
- package/agent-agy/dist/agy-store.d.ts +8 -0
- package/agent-agy/dist/index.d.ts +46 -16
- package/agent-agy/dist/index.js +82 -56
- package/agent-agy/dist/models.d.ts +70 -0
- package/agent-agy/dist/models.js +102 -3
- package/agent-agy/package.json +7 -5
- package/agent-agy-sdk/cordis.patch.yml +58 -0
- package/agent-agy-sdk/dist/adapter.d.ts +15 -0
- package/agent-agy-sdk/dist/adapter.js +42 -0
- package/agent-agy-sdk/dist/agent-preset-agy.d.ts +27 -0
- package/agent-agy-sdk/dist/agent-preset-agy.js +32 -0
- package/agent-agy-sdk/dist/agent.d.ts +138 -0
- package/agent-agy-sdk/dist/agent.js +494 -0
- package/{agent-agy → agent-agy-sdk}/dist/agy-client.d.ts +26 -6
- package/{agent-agy → agent-agy-sdk}/dist/agy-client.js +43 -25
- package/agent-agy-sdk/dist/agy-sessions.d.ts +25 -0
- package/agent-agy-sdk/dist/agy-sessions.js +107 -0
- package/agent-agy-sdk/dist/agy-store.d.ts +39 -0
- package/agent-agy-sdk/dist/agy-store.js +83 -0
- package/agent-agy-sdk/dist/inbox.d.ts +26 -0
- package/agent-agy-sdk/dist/inbox.js +53 -0
- package/agent-agy-sdk/dist/index.d.ts +93 -0
- package/agent-agy-sdk/dist/index.js +476 -0
- package/agent-agy-sdk/dist/models.d.ts +41 -0
- package/agent-agy-sdk/dist/models.js +74 -0
- package/agent-agy-sdk/dist/sdk-venv.d.ts +76 -0
- package/agent-agy-sdk/dist/sdk-venv.js +173 -0
- package/agent-agy-sdk/dist/world-plugin.d.ts +10 -0
- package/agent-agy-sdk/dist/world-plugin.js +82 -0
- package/agent-agy-sdk/package.json +64 -0
- package/agent-claude/dist/adapter.js +106 -31
- package/agent-claude/dist/agent.js +154 -17
- package/agent-claude/dist/claude-client.js +84 -43
- package/agent-claude/dist/claude-launch.js +101 -0
- package/agent-claude/dist/claude-native-config.js +169 -0
- package/agent-claude/dist/claude-provider-gateway.js +340 -0
- package/agent-claude/dist/claude-providers.js +391 -0
- package/agent-claude/dist/claude-route.js +152 -0
- package/agent-claude/dist/index.js +214 -37
- package/agent-claude/dist/models.js +14 -0
- package/agent-claude/dist/sdk-runtime.js +320 -0
- package/agent-claude/package.json +6 -4
- package/agent-codex/README.md +141 -36
- package/agent-codex/cordis.patch.yml +14 -10
- package/agent-codex/dist/adapter.js +64 -28
- package/agent-codex/dist/agent.js +255 -81
- package/agent-codex/dist/app-server-approvals.js +165 -0
- package/agent-codex/dist/app-server-client.js +723 -0
- package/agent-codex/dist/app-server-events.js +432 -0
- package/agent-codex/dist/app-server-protocol.js +95 -0
- package/agent-codex/dist/app-server-wire.js +299 -0
- package/agent-codex/dist/codex-launch.js +78 -0
- package/agent-codex/dist/codex-native-config.js +392 -0
- package/agent-codex/dist/codex-provider-gateway.js +402 -0
- package/agent-codex/dist/codex-providers.js +376 -0
- package/agent-codex/dist/codex-route.js +86 -0
- package/agent-codex/dist/index.js +256 -115
- package/agent-codex/dist/permission.js +75 -1
- package/agent-codex/package.json +1 -2
- package/agent-codex-sdk/README.md +79 -0
- package/agent-codex-sdk/cordis.patch.yml +81 -0
- package/agent-codex-sdk/dist/adapter.js +91 -0
- package/agent-codex-sdk/dist/agent-preset-codex.js +32 -0
- package/agent-codex-sdk/dist/agent.js +1085 -0
- package/agent-codex-sdk/dist/codex-native-config.js +392 -0
- package/agent-codex-sdk/dist/codex-provider-gateway.js +402 -0
- package/agent-codex-sdk/dist/codex-providers.js +376 -0
- package/agent-codex-sdk/dist/codex-route.js +86 -0
- package/{agent-codex/dist/codex-client.js → agent-codex-sdk/dist/codex-sdk-client.js} +253 -32
- package/agent-codex-sdk/dist/codex-sdk-launch.js +92 -0
- package/agent-codex-sdk/dist/codex-store.js +180 -0
- package/agent-codex-sdk/dist/inbox.js +53 -0
- package/agent-codex-sdk/dist/index.js +739 -0
- package/agent-codex-sdk/dist/permission.js +71 -0
- package/agent-codex-sdk/dist/sdk-runtime.js +307 -0
- package/agent-codex-sdk/dist/session-map.js +167 -0
- package/agent-codex-sdk/dist/world-plugin.js +93 -0
- package/agent-codex-sdk/package.json +79 -0
- package/agent-codex-sdk/scripts/fetch-sdk-runtime.mjs +57 -0
- package/agent-omp/README.md +72 -55
- package/agent-omp/dist/agent.js +36 -11
- package/agent-omp/dist/index.js +92 -52
- package/agent-omp/dist/lazy-rpc.js +11 -4
- package/agent-omp/dist/omp-cli.js +114 -97
- package/agent-omp/dist/omp-store.js +12 -4
- package/agent-omp/dist/permission.js +70 -5
- package/agent-omp/dist/rpc-client.js +409 -0
- package/agent-omp/dist/world-plugin.js +36 -3
- package/agent-omp/package.json +2 -6
- package/agent-omp-sdk/README.md +103 -0
- package/agent-omp-sdk/cordis.patch.yml +108 -0
- package/agent-omp-sdk/dist/adapter.d.ts +21 -0
- package/agent-omp-sdk/dist/adapter.js +36 -0
- package/agent-omp-sdk/dist/agent-preset-omp.d.ts +31 -0
- package/agent-omp-sdk/dist/agent-preset-omp.js +32 -0
- package/agent-omp-sdk/dist/agent.d.ts +64 -0
- package/agent-omp-sdk/dist/agent.js +1178 -0
- package/agent-omp-sdk/dist/discovery.d.ts +57 -0
- package/agent-omp-sdk/dist/discovery.js +116 -0
- package/agent-omp-sdk/dist/inbox.d.ts +28 -0
- package/agent-omp-sdk/dist/inbox.js +53 -0
- package/agent-omp-sdk/dist/index.d.ts +60 -0
- package/agent-omp-sdk/dist/index.js +632 -0
- package/agent-omp-sdk/dist/knobs.d.ts +34 -0
- package/agent-omp-sdk/dist/knobs.js +50 -0
- package/agent-omp-sdk/dist/lazy-rpc.d.ts +98 -0
- package/agent-omp-sdk/dist/lazy-rpc.js +178 -0
- package/agent-omp-sdk/dist/mobile/zoom-guard.d.ts +187 -0
- package/agent-omp-sdk/dist/mobile/zoom-guard.js +294 -0
- package/agent-omp-sdk/dist/mobile-boot.d.ts +49 -0
- package/agent-omp-sdk/dist/mobile-boot.js +38 -0
- package/agent-omp-sdk/dist/models.d.ts +39 -0
- package/agent-omp-sdk/dist/models.js +299 -0
- package/agent-omp-sdk/dist/omp-cli.d.ts +67 -0
- package/agent-omp-sdk/dist/omp-cli.js +164 -0
- package/agent-omp-sdk/dist/omp-disk-discovery.d.ts +27 -0
- package/agent-omp-sdk/dist/omp-disk-discovery.js +178 -0
- package/agent-omp-sdk/dist/omp-executable.d.ts +2 -0
- package/agent-omp-sdk/dist/omp-executable.js +30 -0
- package/agent-omp-sdk/dist/omp-store.d.ts +134 -0
- package/agent-omp-sdk/dist/omp-store.js +526 -0
- package/agent-omp-sdk/dist/pairing.d.ts +7 -0
- package/agent-omp-sdk/dist/pairing.js +45 -0
- package/agent-omp-sdk/dist/permission.d.ts +138 -0
- package/agent-omp-sdk/dist/permission.js +161 -0
- package/agent-omp-sdk/dist/protocol.d.ts +189 -0
- package/agent-omp-sdk/dist/rpc-types.d.ts +77 -0
- package/agent-omp-sdk/dist/rpc-types.js +1 -0
- package/agent-omp-sdk/dist/sdk-client.d.ts +160 -0
- package/{agent-omp → agent-omp-sdk}/dist/sdk-client.js +108 -56
- package/agent-omp-sdk/dist/sdk-runtime.d.ts +211 -0
- package/agent-omp-sdk/dist/sdk-runtime.js +418 -0
- package/agent-omp-sdk/dist/sidecar-client.d.ts +87 -0
- package/agent-omp-sdk/dist/sidecar-client.js +197 -0
- package/agent-omp-sdk/dist/store/adapter.d.ts +17 -0
- package/agent-omp-sdk/dist/store/adapter.js +47 -0
- package/agent-omp-sdk/dist/store/db.d.ts +70 -0
- package/agent-omp-sdk/dist/store/db.js +210 -0
- package/agent-omp-sdk/dist/store/index.d.ts +23 -0
- package/agent-omp-sdk/dist/store/index.js +59 -0
- package/agent-omp-sdk/dist/store/reconcile.d.ts +15 -0
- package/agent-omp-sdk/dist/store/reconcile.js +51 -0
- package/agent-omp-sdk/dist/store/schema.d.ts +8 -0
- package/agent-omp-sdk/dist/store/schema.js +40 -0
- package/agent-omp-sdk/dist/transport.d.ts +49 -0
- package/agent-omp-sdk/dist/transport.js +35 -0
- package/agent-omp-sdk/dist/world-home.d.ts +4 -0
- package/agent-omp-sdk/dist/world-home.js +23 -0
- package/agent-omp-sdk/dist/world-plugin.d.ts +10 -0
- package/agent-omp-sdk/dist/world-plugin.js +137 -0
- package/agent-omp-sdk/package.json +87 -0
- package/client/index.js +1883 -287
- package/cordis.patch.yml +80 -0
- package/package.json +23 -9
- package/superd-hub/dist/a2a-delivery.d.ts +189 -0
- package/superd-hub/dist/a2a-delivery.js +240 -0
- package/superd-hub/dist/a2a-host.d.ts +76 -0
- package/superd-hub/dist/a2a-host.js +145 -0
- package/superd-hub/dist/a2a-ingest.d.ts +31 -0
- package/superd-hub/dist/a2a-ingest.js +636 -0
- package/superd-hub/dist/a2a-log.d.ts +17 -0
- package/superd-hub/dist/a2a-log.js +42 -0
- package/superd-hub/dist/a2a-row.d.ts +65 -0
- package/superd-hub/dist/a2a-row.js +162 -0
- package/superd-hub/dist/a2a-service.d.ts +357 -0
- package/superd-hub/dist/a2a-service.js +980 -0
- package/superd-hub/dist/a2a-wire.d.ts +220 -0
- package/superd-hub/dist/a2a-wire.js +305 -0
- package/superd-hub/dist/agent-ids.d.ts +10 -0
- package/superd-hub/dist/agent-ids.js +68 -0
- package/superd-hub/dist/agent-roster.d.ts +29 -18
- package/superd-hub/dist/agent-roster.js +54 -15
- package/superd-hub/dist/agent-status.d.ts +119 -0
- package/superd-hub/dist/agent-status.js +386 -0
- package/superd-hub/dist/client/agent-settings.d.ts +210 -0
- package/superd-hub/dist/client/agent-settings.js +300 -0
- package/superd-hub/dist/client/mesh-api.d.ts +134 -0
- package/superd-hub/dist/client/mesh-api.js +219 -0
- package/superd-hub/dist/client/mesh-groups.d.ts +63 -0
- package/superd-hub/dist/client/mesh-groups.js +66 -0
- package/superd-hub/dist/client/roster.d.ts +48 -0
- package/superd-hub/dist/client/roster.js +102 -0
- package/superd-hub/dist/client/runtime-settings-api.d.ts +76 -0
- package/superd-hub/dist/client/runtime-settings-api.js +137 -0
- package/superd-hub/dist/client/switch.d.ts +165 -0
- package/superd-hub/dist/client/switch.js +295 -0
- package/superd-hub/dist/exec-pty-channel.d.ts +58 -0
- package/superd-hub/dist/exec-pty-channel.js +162 -0
- package/superd-hub/dist/exec-pty-framing.d.ts +32 -0
- package/superd-hub/dist/exec-pty-framing.js +81 -0
- package/superd-hub/dist/exec-pty-rpc.d.ts +21 -0
- package/superd-hub/dist/exec-pty-rpc.js +128 -0
- package/superd-hub/dist/exec-pty-session.d.ts +76 -0
- package/superd-hub/dist/exec-pty-session.js +234 -0
- package/superd-hub/dist/exec.d.ts +56 -0
- package/superd-hub/dist/exec.js +225 -0
- package/superd-hub/dist/gateway.d.ts +39 -2
- package/superd-hub/dist/gateway.js +62 -3
- package/superd-hub/dist/hub-tool.d.ts +174 -0
- package/superd-hub/dist/hub-tool.js +464 -0
- package/superd-hub/dist/index.d.ts +15 -1
- package/superd-hub/dist/index.js +16 -0
- package/superd-hub/dist/machines.d.ts +45 -0
- package/superd-hub/dist/machines.js +125 -0
- package/superd-hub/dist/mesh-federate.d.ts +138 -0
- package/superd-hub/dist/mesh-federate.js +223 -0
- package/superd-hub/dist/mesh-gateway.d.ts +67 -0
- package/superd-hub/dist/mesh-gateway.js +408 -0
- package/superd-hub/dist/mesh-link.d.ts +274 -0
- package/superd-hub/dist/mesh-link.js +441 -0
- package/superd-hub/dist/mesh-rpc.d.ts +123 -0
- package/superd-hub/dist/mesh-rpc.js +250 -0
- package/superd-hub/dist/mux-client.d.ts +71 -0
- package/superd-hub/dist/mux-client.js +281 -0
- package/superd-hub/dist/pack-version.d.ts +2 -0
- package/superd-hub/dist/pack-version.js +30 -0
- package/superd-hub/dist/roster.d.ts +6 -0
- package/superd-hub/dist/rpc.d.ts +18 -2
- package/superd-hub/dist/rpc.js +34 -4
- package/superd-hub/dist/spawn-world.js +3 -1
- package/superd-hub/dist/switch-core.d.ts +62 -25
- package/superd-hub/dist/switch-core.js +53 -30
- package/superd-hub/dist/system-head.d.ts +22 -12
- package/superd-hub/dist/system-head.js +100 -84
- package/superd-hub/dist/wire-endpoints.d.ts +264 -0
- package/superd-hub/dist/wire-endpoints.js +180 -0
- package/superd-hub/lib/client/index.js +1883 -287
- package/superd-hub/package.json +11 -2
- package/agent-agy/dist/agent-preset-projection.d.ts +0 -31
- package/agent-agy/dist/agent-preset-projection.js +0 -33
- package/agent-claude/dist/agent-preset-projection.js +0 -30
- package/agent-codex/dist/agent-preset-projection.js +0 -37
- package/agent-codex/dist/app-home.js +0 -65
- package/agent-codex/dist/models.js +0 -152
- package/agent-codex/dist/spike.js +0 -46
- package/agent-hermes/dist/agent-preset-projection.js +0 -34
- package/agent-omp/dist/agent-preset-projection.js +0 -36
- package/agent-omp/dist/app-home.js +0 -86
- package/agent-omp/dist/sidecar-client.js +0 -195
- package/agent-pi/dist/agent-preset-projection.js +0 -29
- package/superd-hub/dist/client-shim.d.ts +0 -28
- package/superd-hub/dist/client-shim.js +0 -251
- package/superd-hub/dist/index-pass.d.ts +0 -22
- package/superd-hub/dist/index-pass.js +0 -47
- package/superd-hub/dist/labels.d.ts +0 -45
- package/superd-hub/dist/labels.js +0 -83
- /package/{agent-agy → agent-agy-sdk}/bridge/agy_bridge.py +0 -0
- /package/{agent-agy → agent-agy-sdk}/bridge/gemini_openai_server.mjs +0 -0
- /package/{agent-codex/dist/codex-events.js → agent-codex-sdk/dist/codex-sdk-events.js} +0 -0
- /package/{agent-omp → agent-omp-sdk}/dist/protocol.js +0 -0
- /package/{agent-omp → agent-omp-sdk}/sidecar/main.ts +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OMP skills + slash-command discovery, bridged into the host's capability
|
|
3
|
+
* seams (`ctx.skills` + `ctx.commands`). Both services stay mounted by
|
|
4
|
+
* dsh-base/dsh-web-app; the bridge only supplies data/registrations — the
|
|
5
|
+
* UI (SkillRow, the composer `/` menu) already reads them.
|
|
6
|
+
*
|
|
7
|
+
* Sidecar-free since the sidecar-decoupling change (plan
|
|
8
|
+
* 2026-09-16-omp-adapter-sidecar-decoupling): both catalogs are read straight
|
|
9
|
+
* from disk (omp + claude user/project roots, see omp-disk-discovery). Slash
|
|
10
|
+
* commands mount once at boot and re-mount on the hourly discovery refresh —
|
|
11
|
+
* never a sidecar spawn.
|
|
12
|
+
*
|
|
13
|
+
* @module agent-omp/discovery
|
|
14
|
+
*/
|
|
15
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
16
|
+
import { type OmpDiskSlashCommand } from "./omp-disk-discovery.js";
|
|
17
|
+
interface CommandRuntimeSlice {
|
|
18
|
+
register(definition: {
|
|
19
|
+
name: string;
|
|
20
|
+
description: string;
|
|
21
|
+
input?: {
|
|
22
|
+
hint?: string;
|
|
23
|
+
attachments?: boolean;
|
|
24
|
+
};
|
|
25
|
+
handler(): {
|
|
26
|
+
kind: "success";
|
|
27
|
+
text?: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: "error";
|
|
30
|
+
text: string;
|
|
31
|
+
};
|
|
32
|
+
}): () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Register one set of disk-scanned OMP slash commands on the host runtime.
|
|
36
|
+
* The handler echoes the command body as the result text — a first-pass
|
|
37
|
+
* surface; a deeper integration would route execution through the bridged
|
|
38
|
+
* Agent. Returns a disposer for the whole set.
|
|
39
|
+
*/
|
|
40
|
+
export declare function mountSlashCommands(commands: CommandRuntimeSlice, found: OmpDiskSlashCommand[]): () => void;
|
|
41
|
+
/**
|
|
42
|
+
* A refreshable slash-command mount: registers the boot scan immediately,
|
|
43
|
+
* then `refresh()` swaps the live set for a fresh disk scan (dispose-then-
|
|
44
|
+
* register, so a removed command file disappears from the `/` menu).
|
|
45
|
+
*/
|
|
46
|
+
export declare function createSlashCommandMount(commands: CommandRuntimeSlice, cwd?: string): {
|
|
47
|
+
refresh: () => void;
|
|
48
|
+
disposeAll: () => void;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Mount OMP discovery on the host seams. Fail-open: a missing `skills` or
|
|
52
|
+
* `commands` service leaves the feature dormant, never blocks host boot.
|
|
53
|
+
*
|
|
54
|
+
* @param ctx - host plugin context.
|
|
55
|
+
*/
|
|
56
|
+
export declare function installOmpDiscovery(ctx: Context): void;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { OMP_DISCOVERY_REFRESH_INTERVAL_MS } from "./knobs.js";
|
|
3
|
+
import { readSkills, readSlashCommands, } from "./omp-disk-discovery.js";
|
|
4
|
+
/** Strip a slash-command name to the host's `/^[a-z][a-z0-9_-]*$/` shape. */
|
|
5
|
+
function sanitizeCommandName(name) {
|
|
6
|
+
const cleaned = name.toLowerCase().replace(/[^a-z0-9_-]+/g, "-").replace(/^-+/, "").slice(0, 64);
|
|
7
|
+
return cleaned === "" ? "omp-command" : cleaned;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Register one set of disk-scanned OMP slash commands on the host runtime.
|
|
11
|
+
* The handler echoes the command body as the result text — a first-pass
|
|
12
|
+
* surface; a deeper integration would route execution through the bridged
|
|
13
|
+
* Agent. Returns a disposer for the whole set.
|
|
14
|
+
*/
|
|
15
|
+
export function mountSlashCommands(commands, found) {
|
|
16
|
+
const disposers = found.map((command) => commands.register({
|
|
17
|
+
name: sanitizeCommandName(command.name),
|
|
18
|
+
description: command.description,
|
|
19
|
+
handler: () => ({ kind: "success", text: command.content }),
|
|
20
|
+
}));
|
|
21
|
+
return () => {
|
|
22
|
+
for (const dispose of disposers) {
|
|
23
|
+
try {
|
|
24
|
+
dispose();
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
// A host-side double-dispose must not break the refresh cycle.
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A refreshable slash-command mount: registers the boot scan immediately,
|
|
34
|
+
* then `refresh()` swaps the live set for a fresh disk scan (dispose-then-
|
|
35
|
+
* register, so a removed command file disappears from the `/` menu).
|
|
36
|
+
*/
|
|
37
|
+
export function createSlashCommandMount(commands, cwd) {
|
|
38
|
+
let dispose = () => { };
|
|
39
|
+
const refresh = () => {
|
|
40
|
+
dispose();
|
|
41
|
+
dispose = mountSlashCommands(commands, readSlashCommands(cwd));
|
|
42
|
+
};
|
|
43
|
+
refresh();
|
|
44
|
+
return {
|
|
45
|
+
refresh,
|
|
46
|
+
disposeAll: () => dispose(),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Mount OMP discovery on the host seams. Fail-open: a missing `skills` or
|
|
51
|
+
* `commands` service leaves the feature dormant, never blocks host boot.
|
|
52
|
+
*
|
|
53
|
+
* @param ctx - host plugin context.
|
|
54
|
+
*/
|
|
55
|
+
export function installOmpDiscovery(ctx) {
|
|
56
|
+
// Skills: a discovery provider whose `list(cwd)` scans OMP's disk roots for
|
|
57
|
+
// the caller's workspace; the body is read lazily from SKILL.md in `get`.
|
|
58
|
+
ctx.inject(["skills"], (scoped) => {
|
|
59
|
+
const skills = scoped.get("skills");
|
|
60
|
+
if (skills === undefined)
|
|
61
|
+
return;
|
|
62
|
+
skills.registerProvider(() => ({
|
|
63
|
+
name: "omp",
|
|
64
|
+
list: async (options) => {
|
|
65
|
+
const found = readSkills(options.cwd);
|
|
66
|
+
return found.map((skill, rank) => ({
|
|
67
|
+
name: skill.name,
|
|
68
|
+
description: skill.description,
|
|
69
|
+
rank,
|
|
70
|
+
locator: skill.filePath,
|
|
71
|
+
path: skill.filePath,
|
|
72
|
+
invocation: { modelInvocable: true, userInvocable: true },
|
|
73
|
+
source: "custom",
|
|
74
|
+
provider: "omp",
|
|
75
|
+
}));
|
|
76
|
+
},
|
|
77
|
+
get: async (candidate) => {
|
|
78
|
+
const content = await readFile(String(candidate.locator), "utf8").catch(() => "");
|
|
79
|
+
return {
|
|
80
|
+
name: candidate.name,
|
|
81
|
+
description: candidate.description,
|
|
82
|
+
content,
|
|
83
|
+
invocation: { modelInvocable: true, userInvocable: true },
|
|
84
|
+
source: "custom",
|
|
85
|
+
provider: "omp",
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
}));
|
|
89
|
+
});
|
|
90
|
+
// Slash commands: mount the boot scan, then re-scan on the hourly discovery
|
|
91
|
+
// cadence (pure disk reads; `0` disables). The interval + live registrations
|
|
92
|
+
// are fiber-owned: torn down with the plugin context.
|
|
93
|
+
ctx.inject(["commands"], (scoped) => {
|
|
94
|
+
const commands = scoped.get("commands");
|
|
95
|
+
if (commands === undefined)
|
|
96
|
+
return;
|
|
97
|
+
const mount = createSlashCommandMount(commands);
|
|
98
|
+
let timer;
|
|
99
|
+
if (OMP_DISCOVERY_REFRESH_INTERVAL_MS > 0) {
|
|
100
|
+
timer = setInterval(() => {
|
|
101
|
+
try {
|
|
102
|
+
mount.refresh();
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// A bad refresh must never kill the interval or the host.
|
|
106
|
+
}
|
|
107
|
+
}, OMP_DISCOVERY_REFRESH_INTERVAL_MS);
|
|
108
|
+
timer.unref?.();
|
|
109
|
+
}
|
|
110
|
+
ctx.effect(() => () => {
|
|
111
|
+
if (timer !== undefined)
|
|
112
|
+
clearInterval(timer);
|
|
113
|
+
mount.disposeAll();
|
|
114
|
+
}, "ompDiscovery.slashCommands");
|
|
115
|
+
});
|
|
116
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal in-memory inbox for the OMP agent shim.
|
|
3
|
+
*
|
|
4
|
+
* The 0.1.5 `dsh-agent` contract exposes the inbox as an interface
|
|
5
|
+
* (`Inbox` in `runtime-types`); the durable projection-backed implementation
|
|
6
|
+
* (`ReactLoopInbox`) lives inside the (disabled) `dsh-agent-loop`. OMP owns
|
|
7
|
+
* its own transcript and the bridge delivers messages directly to the OMP
|
|
8
|
+
* process (`OmpAgent.#deliver`), so this inbox is never queued into — it
|
|
9
|
+
* exists to satisfy the `Agent` interface's `inbox` surface with correct
|
|
10
|
+
* (empty) semantics: `nextTurn`/`nextStep` stay empty and every mutation is
|
|
11
|
+
* a faithful in-memory splice.
|
|
12
|
+
*
|
|
13
|
+
* @module agent-omp/inbox
|
|
14
|
+
*/
|
|
15
|
+
import type { Inbox as InboxContract, InboxTarget } from "@deepseek-ai/dsh-agent";
|
|
16
|
+
import type { UserMessage } from "@deepseek-ai/dsh-session";
|
|
17
|
+
import type { MessageId } from "@deepseek-ai/dsh-llm";
|
|
18
|
+
export declare class Inbox implements InboxContract {
|
|
19
|
+
#private;
|
|
20
|
+
get nextTurn(): readonly UserMessage[];
|
|
21
|
+
get nextStep(): readonly UserMessage[];
|
|
22
|
+
clear(): void;
|
|
23
|
+
append(target: InboxTarget, message: UserMessage): void;
|
|
24
|
+
prepend(target: InboxTarget, message: UserMessage): void;
|
|
25
|
+
replace(messageId: MessageId, newMessage: UserMessage): boolean;
|
|
26
|
+
remove(messageId: MessageId): boolean;
|
|
27
|
+
splice(target: InboxTarget, start: number, deleteCount: number, inserted: UserMessage[]): UserMessage[];
|
|
28
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export class Inbox {
|
|
2
|
+
#nextTurn = [];
|
|
3
|
+
#nextStep = [];
|
|
4
|
+
get nextTurn() {
|
|
5
|
+
return this.#nextTurn;
|
|
6
|
+
}
|
|
7
|
+
get nextStep() {
|
|
8
|
+
return this.#nextStep;
|
|
9
|
+
}
|
|
10
|
+
clear() {
|
|
11
|
+
this.#nextTurn = [];
|
|
12
|
+
this.#nextStep = [];
|
|
13
|
+
}
|
|
14
|
+
append(target, message) {
|
|
15
|
+
this.#list(target).push(message);
|
|
16
|
+
}
|
|
17
|
+
prepend(target, message) {
|
|
18
|
+
this.#list(target).unshift(message);
|
|
19
|
+
}
|
|
20
|
+
replace(messageId, newMessage) {
|
|
21
|
+
const list = this.#find(messageId);
|
|
22
|
+
if (list === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
const index = list.findIndex((message) => message.id === messageId);
|
|
25
|
+
if (index < 0)
|
|
26
|
+
return false;
|
|
27
|
+
list.splice(index, 1, newMessage);
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
remove(messageId) {
|
|
31
|
+
const list = this.#find(messageId);
|
|
32
|
+
if (list === undefined)
|
|
33
|
+
return false;
|
|
34
|
+
const index = list.findIndex((message) => message.id === messageId);
|
|
35
|
+
if (index < 0)
|
|
36
|
+
return false;
|
|
37
|
+
list.splice(index, 1);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
splice(target, start, deleteCount, inserted) {
|
|
41
|
+
return this.#list(target).splice(start, deleteCount, ...inserted);
|
|
42
|
+
}
|
|
43
|
+
#list(target) {
|
|
44
|
+
return target === "next-turn" ? this.#nextTurn : this.#nextStep;
|
|
45
|
+
}
|
|
46
|
+
#find(messageId) {
|
|
47
|
+
if (this.#nextTurn.some((message) => message.id === messageId))
|
|
48
|
+
return this.#nextTurn;
|
|
49
|
+
if (this.#nextStep.some((message) => message.id === messageId))
|
|
50
|
+
return this.#nextStep;
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Context, Service } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { AgentFactory, AgentHandle, CreateAgentOptions, ResumeAgentOptions } from "@deepseek-ai/dsh-agent";
|
|
3
|
+
import { type OmpAgentRpc } from "./lazy-rpc.js";
|
|
4
|
+
/**
|
|
5
|
+
* Whether any live OMP session currently holds the SDK transport's child.
|
|
6
|
+
*
|
|
7
|
+
* The reconcile tick's catalog read is a real `omp models --json` subprocess,
|
|
8
|
+
* so this gate is load-bearing (AGENTS.md §五·五: the periodic tick never
|
|
9
|
+
* materializes a runtime). For this line the periodic path does NOT touch the
|
|
10
|
+
* sidecar at all — the data plane is the CLI — but the tick must still pull
|
|
11
|
+
* zero children, and the SDK wrapper's `spawned` is the honest fact to gate on.
|
|
12
|
+
* Sessions count only once they actually spawned: a draft session holds a
|
|
13
|
+
* `LazyOmpRpc` with no child (and no fetched runtime) yet.
|
|
14
|
+
* Exported beside the plugin (the cordis surface itself is unchanged) so the
|
|
15
|
+
* no-sidecar guard can pin this gate's truth table behaviourally — a shape
|
|
16
|
+
* regex alone cannot see an empty input set.
|
|
17
|
+
*/
|
|
18
|
+
export declare function liveOmpSessionExists(sessions: Iterable<OmpAgentRpc>): boolean;
|
|
19
|
+
export declare class OmpProvider extends Service implements AgentFactory {
|
|
20
|
+
#private;
|
|
21
|
+
/**
|
|
22
|
+
* `agentDefaultModel` is load-bearing, not decorative: the harness owns the
|
|
23
|
+
* "default for new sessions" selection there (`@deepseek-ai/dsh-agent-default-model`,
|
|
24
|
+
* mounted by dsh-base with a hard-coded `deepseek-official/deepseek-flash`),
|
|
25
|
+
* and this bridge is the only thing that feeds it OMP's configured default.
|
|
26
|
+
* Without the inject the context cannot resolve the service, every
|
|
27
|
+
* `saveSelection` in #syncModelDefaultTick silently no-ops, and a fresh
|
|
28
|
+
* session inherits the unserved native default → `session/model-unavailable`.
|
|
29
|
+
*/
|
|
30
|
+
static inject: string[];
|
|
31
|
+
/** Plain holder — prevents Cordis re-tracing the factory's ctx through a caller shadow. */
|
|
32
|
+
private readonly runtime;
|
|
33
|
+
/**
|
|
34
|
+
* The SDK transport (one sidecar pool per provider = per dsh process). Built
|
|
35
|
+
* here, but CONSTRUCTION-FREE: the pool is inert until the first session's
|
|
36
|
+
* first prompt reaches `OmpSdkSidecar#start()`.
|
|
37
|
+
*/
|
|
38
|
+
private readonly transport;
|
|
39
|
+
/** Live SDK-backed agents by dash id, for avoidance hand-off. */
|
|
40
|
+
private readonly heldAgents;
|
|
41
|
+
/**
|
|
42
|
+
* Live transport wrappers by dash id — the reconcile tick's liveness gate
|
|
43
|
+
* (AGENTS.md §五·五): a draft session counts as live only once its
|
|
44
|
+
* `spawned` flips, which is exactly when the runtime fetch + sidecar start
|
|
45
|
+
* have happened. Entries are dropped with the handle.
|
|
46
|
+
*/
|
|
47
|
+
private readonly liveSessions;
|
|
48
|
+
constructor(ctx: Context);
|
|
49
|
+
createAgent(ownerCtx: Context, options: CreateAgentOptions): Promise<AgentHandle>;
|
|
50
|
+
resume(ownerCtx: Context, options: ResumeAgentOptions): Promise<AgentHandle>;
|
|
51
|
+
/**
|
|
52
|
+
* Track a published RPC-backed agent, register its transport wrapper with the
|
|
53
|
+
* tick's liveness gate, and hand the session to the supervisor as held. Arrow
|
|
54
|
+
* FIELD (not a `#` method): the provider is exposed through a Cordis tracing
|
|
55
|
+
* proxy, and hard-private methods fail their brand check on the proxy receiver
|
|
56
|
+
* (the same reason setupAndPublish is module-level).
|
|
57
|
+
*/
|
|
58
|
+
private readonly registerHeld;
|
|
59
|
+
}
|
|
60
|
+
export default OmpProvider;
|