super-dsh 0.1.6 → 0.1.10
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-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 +1794 -287
- package/cordis.patch.yml +80 -0
- package/package.json +23 -8
- 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 +156 -0
- package/superd-hub/dist/client/agent-settings.js +229 -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 +1794 -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,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OMP model catalog for the Dash model selector.
|
|
3
|
+
*
|
|
4
|
+
* The browser model selector is a pure RPC round-trip through the apiproxy:
|
|
5
|
+
* `session.models` reads `ctx.llm.listProviders/listModels/resolveModelInfo`,
|
|
6
|
+
* so the OMP provider registers an `LlmAdapter` whose catalog is OMP's real
|
|
7
|
+
* AVAILABLE model set. This module owns the source of that catalog.
|
|
8
|
+
*
|
|
9
|
+
* Source: `omp models --json` (first-party CLI, `omp-cli.ts`) — OMP's own
|
|
10
|
+
* credential-resolved availability verdict. The documented selectability
|
|
11
|
+
* rule (provider not in `disabledProviders` and keyless or with a
|
|
12
|
+
* resolvable credential) runs through a 7-level credential precedence that
|
|
13
|
+
* includes OAuth/login keys stored in agent.db — a state NO config file
|
|
14
|
+
* reveals, which is why the catalog must come from OMP itself.
|
|
15
|
+
*
|
|
16
|
+
* The authoritative RPC `get_available_models` would serve the same set but
|
|
17
|
+
* exceeds the 1 MiB transport frame limit for this install; the CLI returns
|
|
18
|
+
* the compact form (~50 models / 5 providers, 15 KB, ~1.7s). The on-disk
|
|
19
|
+
* `models.db` ∪ `models.yml` pair remains ONLY as the subprocess-failure
|
|
20
|
+
* fallback (registry-cache noise included) — never the primary.
|
|
21
|
+
*/
|
|
22
|
+
import { readFileSync } from "node:fs";
|
|
23
|
+
import { join } from "node:path";
|
|
24
|
+
import { DatabaseSync } from "node:sqlite";
|
|
25
|
+
import { ompAvailableModels, ompAvailableModelsSync, ompModelRolesSync } from "./omp-cli.js";
|
|
26
|
+
import { OMP_NATIVE_HOME } from "./knobs.js";
|
|
27
|
+
import { readOmpModelRolesFromConfig } from "./omp-store.js";
|
|
28
|
+
import { ReasoningEffortId } from "@deepseek-ai/dsh-llm";
|
|
29
|
+
const OMP_AGENT_DIR = join(OMP_NATIVE_HOME, "agent");
|
|
30
|
+
/**
|
|
31
|
+
* Providers named by config.yml `modelRoles` lead the selector: they are the
|
|
32
|
+
* roles the operator actually wired (the TUI default-model semantics).
|
|
33
|
+
*/
|
|
34
|
+
let cached = null;
|
|
35
|
+
/**
|
|
36
|
+
* Read the AVAILABLE OMP model catalog, memoized. First call prefers the CLI
|
|
37
|
+
* (`omp models --json`, synchronous — the boot route list must be known
|
|
38
|
+
* before `registerAdapter` returns); a CLI failure falls back to the on-disk
|
|
39
|
+
* registry cache with a stderr note. Later refreshes go through
|
|
40
|
+
* `refreshOmpModelsCli` (async, per reconcile tick).
|
|
41
|
+
*/
|
|
42
|
+
export function loadOmpModels() {
|
|
43
|
+
if (cached === null) {
|
|
44
|
+
const cli = ompAvailableModelsSync();
|
|
45
|
+
if (cli !== undefined) {
|
|
46
|
+
cached = cli.map((model) => normalizeModel(model)).filter((model) => model !== null);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
process.stderr.write("[omp-provider] omp models --json unavailable; falling back to the on-disk model cache\n");
|
|
50
|
+
cached = mergeModels(loadModelsDb(), loadModelsYml());
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return cached;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Re-run the CLI catalog and swap the memo on success.
|
|
57
|
+
* @returns whether the refresh produced a fresh catalog.
|
|
58
|
+
*/
|
|
59
|
+
export async function refreshOmpModelsCli() {
|
|
60
|
+
const cli = await ompAvailableModels();
|
|
61
|
+
if (cli === undefined)
|
|
62
|
+
return false;
|
|
63
|
+
cached = cli.map((model) => normalizeModel(model)).filter((model) => model !== null);
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
/** The distinct provider ids across the catalog, modelRoles roles first. */
|
|
67
|
+
export function ompProviderIds(models = loadOmpModels()) {
|
|
68
|
+
const seen = new Set();
|
|
69
|
+
for (const model of models)
|
|
70
|
+
seen.add(model.provider);
|
|
71
|
+
const ordered = [];
|
|
72
|
+
// Providers the operator wired into modelRoles lead the selector (TUI
|
|
73
|
+
// semantics: the roles actually in use); everything else follows
|
|
74
|
+
// alphabetically. Roles come from config.yml ON DISK — never a sidecar
|
|
75
|
+
// warm (sidecar-decoupling); the memo is only a fallback for a sidecar
|
|
76
|
+
// that is already live.
|
|
77
|
+
const roles = readOmpModelRolesFromConfig() ?? ompModelRolesSync();
|
|
78
|
+
for (const selector of Object.values(roles ?? {})) {
|
|
79
|
+
const slash = selector.indexOf("/");
|
|
80
|
+
const provider = slash > 0 ? selector.slice(0, slash) : "";
|
|
81
|
+
if (provider !== "" && seen.has(provider) && !ordered.includes(provider))
|
|
82
|
+
ordered.push(provider);
|
|
83
|
+
}
|
|
84
|
+
for (const provider of [...seen].sort((a, b) => a.localeCompare(b))) {
|
|
85
|
+
if (!ordered.includes(provider))
|
|
86
|
+
ordered.push(provider);
|
|
87
|
+
}
|
|
88
|
+
return ordered;
|
|
89
|
+
}
|
|
90
|
+
/** Human-readable provider name for `LlmProviderInfo.name`. */
|
|
91
|
+
export function providerDisplayName(provider) {
|
|
92
|
+
const titles = { zai: "Z.AI", xai: "xAI", openrouter: "OpenRouter" };
|
|
93
|
+
return titles[provider] ?? (provider.charAt(0).toUpperCase() + provider.slice(1));
|
|
94
|
+
}
|
|
95
|
+
/** Merge the registry cache under the user overlay (later models win per provider+id). */
|
|
96
|
+
function mergeModels(cache, overlay) {
|
|
97
|
+
if (overlay.length === 0)
|
|
98
|
+
return cache;
|
|
99
|
+
const byKey = new Map();
|
|
100
|
+
for (const model of cache)
|
|
101
|
+
byKey.set(model.provider + "/" + model.id, model);
|
|
102
|
+
for (const model of overlay)
|
|
103
|
+
byKey.set(model.provider + "/" + model.id, model);
|
|
104
|
+
return [...byKey.values()];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Read `~/.omp/agent/models.db` (`model_cache.models` JSON column). This is
|
|
108
|
+
* the on-disk form of the registry `get_available_models` serves. Read-only
|
|
109
|
+
* and tolerant of a missing/empty file (OMP may not have refreshed it yet).
|
|
110
|
+
*/
|
|
111
|
+
function loadModelsDb() {
|
|
112
|
+
const out = [];
|
|
113
|
+
try {
|
|
114
|
+
const db = new DatabaseSync(join(OMP_AGENT_DIR, "models.db"), { readOnly: true });
|
|
115
|
+
try {
|
|
116
|
+
const rows = db.prepare("SELECT models FROM model_cache").all();
|
|
117
|
+
for (const row of rows) {
|
|
118
|
+
try {
|
|
119
|
+
const models = JSON.parse(row.models);
|
|
120
|
+
if (!Array.isArray(models))
|
|
121
|
+
continue;
|
|
122
|
+
for (const model of models) {
|
|
123
|
+
const parsed = normalizeModel(model);
|
|
124
|
+
if (parsed !== null)
|
|
125
|
+
out.push(parsed);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// one malformed provider row must not sink the whole catalog
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
finally {
|
|
134
|
+
db.close();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
// absent db / schema drift → fall through to the overlay alone
|
|
139
|
+
}
|
|
140
|
+
return out;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Parse `~/.omp/agent/models.yml` — a `providers: <id>: { models: [ ... ] }`
|
|
144
|
+
* overlay OMP writes. A focused indentation scan is enough for this fixed
|
|
145
|
+
* shape and avoids pulling `js-yaml` into the provider's dependency surface.
|
|
146
|
+
* Any parse failure degrades to an empty overlay.
|
|
147
|
+
*/
|
|
148
|
+
function loadModelsYml() {
|
|
149
|
+
const out = [];
|
|
150
|
+
let text;
|
|
151
|
+
try {
|
|
152
|
+
text = readFileSync(join(OMP_AGENT_DIR, "models.yml"), "utf8");
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
let provider = "";
|
|
158
|
+
let inModels = false;
|
|
159
|
+
let model = null;
|
|
160
|
+
const push = () => {
|
|
161
|
+
if (model !== null) {
|
|
162
|
+
const parsed = normalizeModel({ ...model, provider });
|
|
163
|
+
if (parsed !== null)
|
|
164
|
+
out.push(parsed);
|
|
165
|
+
model = null;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
for (const raw of text.split("\n")) {
|
|
169
|
+
const line = raw.replace(/\r$/, "");
|
|
170
|
+
if (line.trim() === "" || line.trimStart().startsWith("#"))
|
|
171
|
+
continue;
|
|
172
|
+
const indent = line.length - line.trimStart().length;
|
|
173
|
+
const trimmed = line.trim();
|
|
174
|
+
if (indent === 0) {
|
|
175
|
+
if (trimmed === "providers:") {
|
|
176
|
+
provider = "";
|
|
177
|
+
inModels = false;
|
|
178
|
+
model = null;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
provider = "";
|
|
182
|
+
inModels = false;
|
|
183
|
+
model = null;
|
|
184
|
+
}
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (indent === 2 && trimmed.endsWith(":")) {
|
|
188
|
+
push();
|
|
189
|
+
provider = trimmed.slice(0, -1).trim();
|
|
190
|
+
inModels = false;
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if (indent === 4 && trimmed === "models:") {
|
|
194
|
+
inModels = true;
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
if (inModels && indent >= 6 && trimmed.startsWith("- ")) {
|
|
198
|
+
push();
|
|
199
|
+
model = {};
|
|
200
|
+
const entry = trimmed.slice(2).trim();
|
|
201
|
+
const colon = entry.indexOf(":");
|
|
202
|
+
if (colon > 0)
|
|
203
|
+
model[entry.slice(0, colon).trim()] = entry.slice(colon + 1).trim();
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
if (inModels && model !== null && indent >= 8) {
|
|
207
|
+
const colon = trimmed.indexOf(":");
|
|
208
|
+
if (colon > 0) {
|
|
209
|
+
const key = trimmed.slice(0, colon).trim();
|
|
210
|
+
model[key] = trimmed.slice(colon + 1).trim();
|
|
211
|
+
}
|
|
212
|
+
continue;
|
|
213
|
+
}
|
|
214
|
+
// Any other shape is outside the models list we care about.
|
|
215
|
+
}
|
|
216
|
+
push();
|
|
217
|
+
return out;
|
|
218
|
+
}
|
|
219
|
+
/** Coerce one raw model record into an {@link OmpModel}, or null when unusable. */
|
|
220
|
+
function normalizeModel(raw) {
|
|
221
|
+
if (raw === null || typeof raw !== "object")
|
|
222
|
+
return null;
|
|
223
|
+
const record = raw;
|
|
224
|
+
const id = typeof record.id === "string" ? record.id : "";
|
|
225
|
+
const provider = typeof record.provider === "string" ? record.provider : "";
|
|
226
|
+
const name = typeof record.name === "string" && record.name !== "" ? record.name : id;
|
|
227
|
+
if (id === "" || provider === "" || name === "")
|
|
228
|
+
return null;
|
|
229
|
+
const thinking = normalizeThinking(record.thinking);
|
|
230
|
+
return {
|
|
231
|
+
id,
|
|
232
|
+
provider,
|
|
233
|
+
name,
|
|
234
|
+
...(typeof record.api === "string" ? { api: record.api } : {}),
|
|
235
|
+
...(typeof record.baseUrl === "string" ? { baseUrl: record.baseUrl } : {}),
|
|
236
|
+
...(typeof record.reasoning === "boolean" ? { reasoning: record.reasoning } : {}),
|
|
237
|
+
...(Array.isArray(record.input) ? { input: record.input.filter((m) => typeof m === "string") } : {}),
|
|
238
|
+
...(typeof record.contextWindow === "number" ? { contextWindow: record.contextWindow } : {}),
|
|
239
|
+
...(typeof record.maxTokens === "number" ? { maxTokens: record.maxTokens } : {}),
|
|
240
|
+
...(thinking === undefined ? {} : { thinking }),
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/** Map OMP's declared input modalities to the harness vocabulary. */
|
|
244
|
+
function inputModalities(model) {
|
|
245
|
+
if (model.input === undefined)
|
|
246
|
+
return undefined;
|
|
247
|
+
const modalities = model.input.filter((m) => m === "text" || m === "image");
|
|
248
|
+
return modalities.length === 0 ? undefined : modalities;
|
|
249
|
+
}
|
|
250
|
+
/** Extract OMP's `thinking` sub-object, checking each field at the boundary. */
|
|
251
|
+
function normalizeThinking(raw) {
|
|
252
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
253
|
+
return undefined;
|
|
254
|
+
const t = raw;
|
|
255
|
+
return {
|
|
256
|
+
...(typeof t.mode === "string" ? { mode: t.mode } : {}),
|
|
257
|
+
...(Array.isArray(t.efforts) ? { efforts: t.efforts.filter((e) => typeof e === "string") } : {}),
|
|
258
|
+
...(typeof t.defaultLevel === "string" ? { defaultLevel: t.defaultLevel } : {}),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
/** Map OMP `thinking.efforts` into the adapter reasoning-effort vocabulary. */
|
|
262
|
+
function reasoningInfo(model) {
|
|
263
|
+
const efforts = model.thinking?.efforts ?? [];
|
|
264
|
+
if (efforts.length === 0)
|
|
265
|
+
return undefined;
|
|
266
|
+
const ids = new Set();
|
|
267
|
+
const mapped = efforts
|
|
268
|
+
.filter((effort) => effort !== "" && !ids.has(effort) && (ids.add(effort), true))
|
|
269
|
+
.map((effort) => ({ id: ReasoningEffortId(effort), name: effort }));
|
|
270
|
+
if (mapped.length === 0)
|
|
271
|
+
return undefined;
|
|
272
|
+
const defaultEffort = model.thinking?.defaultLevel;
|
|
273
|
+
return {
|
|
274
|
+
efforts: mapped,
|
|
275
|
+
...(defaultEffort !== undefined && ids.has(defaultEffort) ? { defaultEffort: ReasoningEffortId(defaultEffort) } : {}),
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
/** One catalog row: {@link LlmModelInfo} for `listModels`. */
|
|
279
|
+
export function toModelInfo(model) {
|
|
280
|
+
return {
|
|
281
|
+
provider: model.provider,
|
|
282
|
+
id: model.id,
|
|
283
|
+
name: model.name,
|
|
284
|
+
...(inputModalities(model) === undefined ? {} : { inputModalities: inputModalities(model) }),
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
/** One exact-model resolution: {@link LlmResolvedModelInfo} for `resolveModel`. */
|
|
288
|
+
export function toResolvedModelInfo(model) {
|
|
289
|
+
const info = toModelInfo(model);
|
|
290
|
+
const contextWindow = typeof model.contextWindow === "number" && model.contextWindow > 0 ? model.contextWindow : undefined;
|
|
291
|
+
const defaultMaxTokens = typeof model.maxTokens === "number" && model.maxTokens > 0 ? model.maxTokens : undefined;
|
|
292
|
+
const reasoning = reasoningInfo(model);
|
|
293
|
+
return {
|
|
294
|
+
...info,
|
|
295
|
+
...(contextWindow === undefined ? {} : { context: { contextWindow } }),
|
|
296
|
+
...(defaultMaxTokens === undefined ? {} : { defaultMaxTokens }),
|
|
297
|
+
...(reasoning === undefined ? {} : { reasoning }),
|
|
298
|
+
};
|
|
299
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OMP CLI subprocess data plane — the model catalog and the `modelRoles` map
|
|
3
|
+
* are read from (and written through) the operator's own `omp` binary, the
|
|
4
|
+
* first-party entries the bridge uses instead of parsing OMP's files or
|
|
5
|
+
* hitting frame-limited RPC:
|
|
6
|
+
*
|
|
7
|
+
* - `omp models --json` → the credential-resolved AVAILABLE model catalog
|
|
8
|
+
* (documented selectability rule: provider not in `disabledProviders` and
|
|
9
|
+
* keyless or with a resolvable credential — 7-level precedence, including
|
|
10
|
+
* OAuth/login keys stored in agent.db that no config file reveals).
|
|
11
|
+
* - `omp config get modelRoles --json` → the role→"provider/model[:effort]"
|
|
12
|
+
* map, including the persisted `default` selector (TUI semantics: the
|
|
13
|
+
* default model IS config state, surviving sessions).
|
|
14
|
+
* - `omp config set modelRoles --json <obj>` → whole-object roundtrip write
|
|
15
|
+
* (dotted keys are rejected; the entire modelRoles object is the unit).
|
|
16
|
+
*
|
|
17
|
+
* All calls run with cwd = `OMP_HOME` (omp writes its own state db next to
|
|
18
|
+
* the agent dir) and inherit the daemon environment. The binary is resolved
|
|
19
|
+
* per call ({@link resolveOmpExecutable}), so `$OMP_EXECUTABLE` and PATH
|
|
20
|
+
* changes take effect without a reload.
|
|
21
|
+
*
|
|
22
|
+
* Fail-soft: a missing, broken or unresponsive `omp` yields `undefined`
|
|
23
|
+
* (reads) or `false` (write) — the provider never fails to boot because the
|
|
24
|
+
* CLI is down.
|
|
25
|
+
*
|
|
26
|
+
* @module agent-omp/omp-cli
|
|
27
|
+
*/
|
|
28
|
+
/** One raw model record as OMP's catalog describes it. */
|
|
29
|
+
export interface OmpCliModel {
|
|
30
|
+
provider: string;
|
|
31
|
+
id: string;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
/** role → "provider/model[:effort]" selectors, from the live config. */
|
|
35
|
+
export interface OmpModelRoles {
|
|
36
|
+
[role: string]: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Synchronous `omp models --json` — the boot-time variant (the adapter's
|
|
40
|
+
* provider route list must be known before `registerAdapter` returns).
|
|
41
|
+
* Blocks up to the timeout; prefer the async variant everywhere else.
|
|
42
|
+
*/
|
|
43
|
+
export declare function ompAvailableModelsSync(): OmpCliModel[] | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* `omp models --json` — the AVAILABLE model catalog (credential-resolved,
|
|
46
|
+
* `disabledProviders`-aware). `undefined` when the CLI fails; callers fall
|
|
47
|
+
* back to the on-disk sources.
|
|
48
|
+
*/
|
|
49
|
+
export declare function ompAvailableModels(): Promise<OmpCliModel[] | undefined>;
|
|
50
|
+
/**
|
|
51
|
+
* Synchronous `omp config get modelRoles --json` — boot-time variant of
|
|
52
|
+
* {@link ompModelRoles}.
|
|
53
|
+
*/
|
|
54
|
+
export declare function ompModelRolesSync(): OmpModelRoles | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* `omp config get modelRoles --json` — the current modelRoles object, read
|
|
57
|
+
* fresh on every call (the OMP TUI may have rewritten config.yml). `undefined`
|
|
58
|
+
* when unset or the CLI fails.
|
|
59
|
+
*/
|
|
60
|
+
export declare function ompModelRoles(): Promise<OmpModelRoles | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* `omp config set modelRoles --json <obj>` — the TUI-grade default-model
|
|
63
|
+
* write: OMP persists `modelRoles.default` itself, so every new session
|
|
64
|
+
* (TUI or Web) inherits the selection. Whole-object roundtrip: dotted keys
|
|
65
|
+
* are rejected by the CLI. `false` on any failure (fail-soft).
|
|
66
|
+
*/
|
|
67
|
+
export declare function ompSetModelRoles(roles: OmpModelRoles): Promise<boolean>;
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OMP CLI subprocess data plane — the model catalog and the `modelRoles` map
|
|
3
|
+
* are read from (and written through) the operator's own `omp` binary, the
|
|
4
|
+
* first-party entries the bridge uses instead of parsing OMP's files or
|
|
5
|
+
* hitting frame-limited RPC:
|
|
6
|
+
*
|
|
7
|
+
* - `omp models --json` → the credential-resolved AVAILABLE model catalog
|
|
8
|
+
* (documented selectability rule: provider not in `disabledProviders` and
|
|
9
|
+
* keyless or with a resolvable credential — 7-level precedence, including
|
|
10
|
+
* OAuth/login keys stored in agent.db that no config file reveals).
|
|
11
|
+
* - `omp config get modelRoles --json` → the role→"provider/model[:effort]"
|
|
12
|
+
* map, including the persisted `default` selector (TUI semantics: the
|
|
13
|
+
* default model IS config state, surviving sessions).
|
|
14
|
+
* - `omp config set modelRoles --json <obj>` → whole-object roundtrip write
|
|
15
|
+
* (dotted keys are rejected; the entire modelRoles object is the unit).
|
|
16
|
+
*
|
|
17
|
+
* All calls run with cwd = `OMP_HOME` (omp writes its own state db next to
|
|
18
|
+
* the agent dir) and inherit the daemon environment. The binary is resolved
|
|
19
|
+
* per call ({@link resolveOmpExecutable}), so `$OMP_EXECUTABLE` and PATH
|
|
20
|
+
* changes take effect without a reload.
|
|
21
|
+
*
|
|
22
|
+
* Fail-soft: a missing, broken or unresponsive `omp` yields `undefined`
|
|
23
|
+
* (reads) or `false` (write) — the provider never fails to boot because the
|
|
24
|
+
* CLI is down.
|
|
25
|
+
*
|
|
26
|
+
* @module agent-omp/omp-cli
|
|
27
|
+
*/
|
|
28
|
+
import { execFile, execFileSync } from "node:child_process";
|
|
29
|
+
import { promisify } from "node:util";
|
|
30
|
+
import { OMP_HOME } from "./knobs.js";
|
|
31
|
+
import { resolveOmpExecutable } from "./omp-executable.js";
|
|
32
|
+
const execFileAsync = promisify(execFile);
|
|
33
|
+
const TIMEOUT_MS = 15_000;
|
|
34
|
+
const MAX_BUFFER = 64 * 1024 * 1024;
|
|
35
|
+
// ---------------------------------------------------------------------------
|
|
36
|
+
// Subprocess plumbing (fail-soft: any failure → undefined/false)
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
/** One `omp <args>` invocation parsed as JSON; undefined on any failure. */
|
|
39
|
+
async function ompCliJson(args) {
|
|
40
|
+
try {
|
|
41
|
+
const { stdout } = await execFileAsync(resolveOmpExecutable(), args, {
|
|
42
|
+
cwd: OMP_HOME,
|
|
43
|
+
timeout: TIMEOUT_MS,
|
|
44
|
+
maxBuffer: MAX_BUFFER,
|
|
45
|
+
});
|
|
46
|
+
return JSON.parse(stdout);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Synchronous variant of {@link ompCliJson} — the boot-time path. */
|
|
53
|
+
function ompCliJsonSync(args) {
|
|
54
|
+
try {
|
|
55
|
+
const stdout = execFileSync(resolveOmpExecutable(), args, {
|
|
56
|
+
cwd: OMP_HOME,
|
|
57
|
+
timeout: TIMEOUT_MS,
|
|
58
|
+
encoding: "utf8",
|
|
59
|
+
maxBuffer: MAX_BUFFER,
|
|
60
|
+
});
|
|
61
|
+
return JSON.parse(stdout);
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/** Validate an `omp models --json` payload; undefined when empty or invalid. */
|
|
68
|
+
function parseModels(json) {
|
|
69
|
+
if (json === null || typeof json !== "object")
|
|
70
|
+
return undefined;
|
|
71
|
+
const models = json.models;
|
|
72
|
+
if (!Array.isArray(models))
|
|
73
|
+
return undefined;
|
|
74
|
+
const out = [];
|
|
75
|
+
for (const model of models) {
|
|
76
|
+
if (model !== null && typeof model === "object" && typeof model.provider === "string") {
|
|
77
|
+
out.push(model);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return out.length > 0 ? out : undefined;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Validate a `modelRoles` payload; undefined when unset, empty or invalid.
|
|
84
|
+
*
|
|
85
|
+
* `omp config get <key> --json` prints `{key, value, type, description}`, but
|
|
86
|
+
* the bare value map appears in older builds, so both shapes are accepted. A
|
|
87
|
+
* wrapped payload for a different key is rejected rather than misread as a
|
|
88
|
+
* role map.
|
|
89
|
+
*/
|
|
90
|
+
function parseModelRoles(json) {
|
|
91
|
+
if (json === null || typeof json !== "object" || Array.isArray(json))
|
|
92
|
+
return undefined;
|
|
93
|
+
const record = json;
|
|
94
|
+
let value = record;
|
|
95
|
+
if ("key" in record || "value" in record) {
|
|
96
|
+
if (typeof record.key === "string" && record.key !== "modelRoles")
|
|
97
|
+
return undefined;
|
|
98
|
+
value = record.value;
|
|
99
|
+
}
|
|
100
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
101
|
+
return undefined;
|
|
102
|
+
const out = {};
|
|
103
|
+
for (const [role, selector] of Object.entries(value)) {
|
|
104
|
+
if (typeof selector === "string" && selector !== "")
|
|
105
|
+
out[role] = selector;
|
|
106
|
+
}
|
|
107
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
108
|
+
}
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
// Model catalog
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
/**
|
|
113
|
+
* Synchronous `omp models --json` — the boot-time variant (the adapter's
|
|
114
|
+
* provider route list must be known before `registerAdapter` returns).
|
|
115
|
+
* Blocks up to the timeout; prefer the async variant everywhere else.
|
|
116
|
+
*/
|
|
117
|
+
export function ompAvailableModelsSync() {
|
|
118
|
+
return parseModels(ompCliJsonSync(["models", "--json"]));
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* `omp models --json` — the AVAILABLE model catalog (credential-resolved,
|
|
122
|
+
* `disabledProviders`-aware). `undefined` when the CLI fails; callers fall
|
|
123
|
+
* back to the on-disk sources.
|
|
124
|
+
*/
|
|
125
|
+
export async function ompAvailableModels() {
|
|
126
|
+
return parseModels(await ompCliJson(["models", "--json"]));
|
|
127
|
+
}
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
// modelRoles
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
/**
|
|
132
|
+
* Synchronous `omp config get modelRoles --json` — boot-time variant of
|
|
133
|
+
* {@link ompModelRoles}.
|
|
134
|
+
*/
|
|
135
|
+
export function ompModelRolesSync() {
|
|
136
|
+
return parseModelRoles(ompCliJsonSync(["config", "get", "modelRoles", "--json"]));
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* `omp config get modelRoles --json` — the current modelRoles object, read
|
|
140
|
+
* fresh on every call (the OMP TUI may have rewritten config.yml). `undefined`
|
|
141
|
+
* when unset or the CLI fails.
|
|
142
|
+
*/
|
|
143
|
+
export async function ompModelRoles() {
|
|
144
|
+
return parseModelRoles(await ompCliJson(["config", "get", "modelRoles", "--json"]));
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* `omp config set modelRoles --json <obj>` — the TUI-grade default-model
|
|
148
|
+
* write: OMP persists `modelRoles.default` itself, so every new session
|
|
149
|
+
* (TUI or Web) inherits the selection. Whole-object roundtrip: dotted keys
|
|
150
|
+
* are rejected by the CLI. `false` on any failure (fail-soft).
|
|
151
|
+
*/
|
|
152
|
+
export async function ompSetModelRoles(roles) {
|
|
153
|
+
try {
|
|
154
|
+
await execFileAsync(resolveOmpExecutable(), ["config", "set", "modelRoles", "--json", JSON.stringify(roles)], {
|
|
155
|
+
cwd: OMP_HOME,
|
|
156
|
+
timeout: TIMEOUT_MS,
|
|
157
|
+
maxBuffer: MAX_BUFFER,
|
|
158
|
+
});
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** One file-based slash command, shape-compatible with the old sidecar frame. */
|
|
2
|
+
export interface OmpDiskSlashCommand {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
content: string;
|
|
6
|
+
source: string;
|
|
7
|
+
filePath: string;
|
|
8
|
+
}
|
|
9
|
+
/** One discovered skill, shape-compatible with the old sidecar frame. */
|
|
10
|
+
export interface OmpDiskSkill {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
filePath: string;
|
|
14
|
+
baseDir: string;
|
|
15
|
+
source: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Read every file-based slash command from the discovery roots.
|
|
19
|
+
* Deterministic output: deduped by name (scan order, first wins), then sorted.
|
|
20
|
+
*/
|
|
21
|
+
export declare function readSlashCommands(cwd?: string): OmpDiskSlashCommand[];
|
|
22
|
+
/**
|
|
23
|
+
* Read every discovered skill from the discovery roots: the Agent Skills
|
|
24
|
+
* standard `<root>/<name>/SKILL.md` layout, plus a lenient flat `<root>/*.md`.
|
|
25
|
+
* Deterministic output: deduped by name (scan order, first wins), then sorted.
|
|
26
|
+
*/
|
|
27
|
+
export declare function readSkills(cwd?: string): OmpDiskSkill[];
|