dsh-loop-engine-allinone 0.0.0-stage → 0.4.1
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/CHANGELOG.md +119 -0
- package/CONTRIBUTING.md +78 -0
- package/LICENSE +23 -0
- package/NOTICE +45 -0
- package/README.md +223 -2
- package/README.zh.md +179 -0
- package/SECURITY.md +39 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +2166 -0
- package/lib/index.js +11621 -0
- package/lib/invariant.js +453 -0
- package/lib/types/agent-preset-ids.d.ts +276 -0
- package/lib/types/client/LoopEngineBadge.d.ts +71 -0
- package/lib/types/client/LoopEngineComposerSelect.d.ts +126 -0
- package/lib/types/client/LoopEngineSection.d.ts +35 -0
- package/lib/types/client/engine-marks.d.ts +87 -0
- package/lib/types/client/index.d.ts +39 -0
- package/lib/types/client/locales.d.ts +182 -0
- package/lib/types/client/reload.d.ts +135 -0
- package/lib/types/client/session-engine.d.ts +508 -0
- package/lib/types/client/store.d.ts +103 -0
- package/lib/types/client/turn-status.d.ts +234 -0
- package/lib/types/client/use-session-engine.d.ts +74 -0
- package/lib/types/commands.d.ts +77 -0
- package/lib/types/compat.d.ts +25 -0
- package/lib/types/driver-acp/agent.d.ts +289 -0
- package/lib/types/driver-acp/approval.d.ts +27 -0
- package/lib/types/driver-acp/capabilities.d.ts +200 -0
- package/lib/types/driver-acp/client.d.ts +297 -0
- package/lib/types/driver-acp/executable.d.ts +53 -0
- package/lib/types/driver-acp/mapping.d.ts +76 -0
- package/lib/types/driver-acp/profile.d.ts +126 -0
- package/lib/types/driver-acp/runtime.d.ts +45 -0
- package/lib/types/driver-acp/subprocess.d.ts +19 -0
- package/lib/types/driver-acp/terminal.d.ts +98 -0
- package/lib/types/driver-acp/transport.d.ts +43 -0
- package/lib/types/driver-acp/types.d.ts +152 -0
- package/lib/types/driver-cli/capability.d.ts +42 -0
- package/lib/types/driver-cli/cli-agent.d.ts +258 -0
- package/lib/types/driver-cli/cli-loop.d.ts +46 -0
- package/lib/types/driver-cli/flatten.d.ts +35 -0
- package/lib/types/driver-cli/frames.d.ts +128 -0
- package/lib/types/driver-cli/ndjson.d.ts +106 -0
- package/lib/types/driver-cli/session-sink.d.ts +333 -0
- package/lib/types/driver-cli/stream-json.d.ts +61 -0
- package/lib/types/driver-cli/text.d.ts +66 -0
- package/lib/types/driver-cli/transport.d.ts +84 -0
- package/lib/types/driver-core/agents-md-skill-provider.d.ts +72 -0
- package/lib/types/driver-core/assistant-stream.d.ts +68 -0
- package/lib/types/driver-core/context-files.d.ts +62 -0
- package/lib/types/driver-core/host-servers.d.ts +119 -0
- package/lib/types/driver-core/hosted-engine-runtime.d.ts +190 -0
- package/lib/types/driver-core/hosted-tool-vocabulary.d.ts +78 -0
- package/lib/types/driver-core/idle-child.d.ts +57 -0
- package/lib/types/driver-core/image-access.d.ts +25 -0
- package/lib/types/driver-core/inbox.d.ts +104 -0
- package/lib/types/driver-core/model-handover.d.ts +134 -0
- package/lib/types/driver-core/ownership.d.ts +41 -0
- package/lib/types/driver-core/permission-knobs.d.ts +26 -0
- package/lib/types/driver-core/prompt.d.ts +64 -0
- package/lib/types/driver-core/session-lifetime.d.ts +62 -0
- package/lib/types/driver-core/session-model.d.ts +128 -0
- package/lib/types/driver-core/skill-inject.d.ts +59 -0
- package/lib/types/driver-core/step-close.d.ts +49 -0
- package/lib/types/driver-core/step-images.d.ts +62 -0
- package/lib/types/driver-core/step-tools.d.ts +43 -0
- package/lib/types/driver-core/system-head.d.ts +43 -0
- package/lib/types/engine-agy/agent.d.ts +67 -0
- package/lib/types/engine-agy/frames.d.ts +90 -0
- package/lib/types/engine-agy/loop.d.ts +64 -0
- package/lib/types/engine-agy/process.d.ts +173 -0
- package/lib/types/engine-claude/agent.d.ts +186 -0
- package/lib/types/engine-claude/loop.d.ts +73 -0
- package/lib/types/engine-claude/mapping.d.ts +108 -0
- package/lib/types/engine-claude/permission.d.ts +41 -0
- package/lib/types/engine-claude/process.d.ts +59 -0
- package/lib/types/engine-claude/sdk.d.ts +67 -0
- package/lib/types/engine-claude/types.d.ts +28 -0
- package/lib/types/engine-codex/agent.d.ts +216 -0
- package/lib/types/engine-codex/appserver/client.d.ts +80 -0
- package/lib/types/engine-codex/appserver/mapping.d.ts +67 -0
- package/lib/types/engine-codex/appserver/thread.d.ts +66 -0
- package/lib/types/engine-codex/appserver/types.d.ts +225 -0
- package/lib/types/engine-codex/loop.d.ts +75 -0
- package/lib/types/engine-codex/model-handover.d.ts +56 -0
- package/lib/types/engine-codex/permission.d.ts +126 -0
- package/lib/types/engine-codex/skills.d.ts +28 -0
- package/lib/types/engine-codex/types.d.ts +36 -0
- package/lib/types/engine-drivers.d.ts +132 -0
- package/lib/types/engine-grok/agent.d.ts +24 -0
- package/lib/types/engine-grok/loop.d.ts +61 -0
- package/lib/types/engine-grok/process.d.ts +46 -0
- package/lib/types/engine-grok/profile.d.ts +82 -0
- package/lib/types/engine-hermes/agent.d.ts +47 -0
- package/lib/types/engine-hermes/loop.d.ts +56 -0
- package/lib/types/engine-hermes/process.d.ts +92 -0
- package/lib/types/engine-kimi/acp/client.d.ts +123 -0
- package/lib/types/engine-kimi/acp/mapping.d.ts +73 -0
- package/lib/types/engine-kimi/acp/types.d.ts +143 -0
- package/lib/types/engine-kimi/agent.d.ts +24 -0
- package/lib/types/engine-kimi/commands.d.ts +44 -0
- package/lib/types/engine-kimi/loop.d.ts +62 -0
- package/lib/types/engine-kimi/model-handover.d.ts +32 -0
- package/lib/types/engine-kimi/permission.d.ts +28 -0
- package/lib/types/engine-kimi/process.d.ts +47 -0
- package/lib/types/engine-kimi/profile.d.ts +19 -0
- package/lib/types/engine-kimi/skills.d.ts +52 -0
- package/lib/types/engine-kimi/types.d.ts +25 -0
- package/lib/types/engine-minimaxcode/agent.d.ts +24 -0
- package/lib/types/engine-minimaxcode/loop.d.ts +83 -0
- package/lib/types/engine-minimaxcode/process.d.ts +53 -0
- package/lib/types/engine-minimaxcode/profile.d.ts +72 -0
- package/lib/types/engine-of-session.d.ts +97 -0
- package/lib/types/engine-pi/agent.d.ts +230 -0
- package/lib/types/engine-pi/loop.d.ts +72 -0
- package/lib/types/engine-pi/model-handover.d.ts +84 -0
- package/lib/types/engine-pi/permission.d.ts +47 -0
- package/lib/types/engine-pi/rpc/client.d.ts +107 -0
- package/lib/types/engine-pi/rpc/mapping.d.ts +37 -0
- package/lib/types/engine-pi/rpc/types.d.ts +249 -0
- package/lib/types/engine-pi/skills.d.ts +47 -0
- package/lib/types/engine-pi/types.d.ts +36 -0
- package/lib/types/engine-qoderclicn/agent.d.ts +59 -0
- package/lib/types/engine-qoderclicn/loop.d.ts +51 -0
- package/lib/types/engine-qoderclicn/process.d.ts +113 -0
- package/lib/types/engine-registry.d.ts +584 -0
- package/lib/types/engine-remote.d.ts +192 -0
- package/lib/types/engine-surface.d.ts +36 -0
- package/lib/types/engine-zcode/agent.d.ts +50 -0
- package/lib/types/engine-zcode/loop.d.ts +47 -0
- package/lib/types/engine-zcode/process.d.ts +111 -0
- package/lib/types/index.d.ts +205 -0
- package/lib/types/invariant.d.ts +26 -0
- package/lib/types/model-selection-reset.d.ts +271 -0
- package/lib/types/namespace.d.ts +25 -0
- package/lib/types/patch-manager.d.ts +104 -0
- package/lib/types/preset.d.ts +254 -0
- package/lib/types/provider-route.d.ts +245 -0
- package/lib/types/router-loop.d.ts +458 -0
- package/lib/types/session-engine-store.d.ts +138 -0
- package/lib/types/settings.d.ts +60 -0
- package/lib/types/skills.d.ts +85 -0
- package/package.json +152 -6
|
@@ -0,0 +1,584 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The engine registry: the ONE data table every engine-shaped decision derives
|
|
3
|
+
* from.
|
|
4
|
+
*
|
|
5
|
+
* Before this module the engine roster lived in five places that had to be kept
|
|
6
|
+
* in step by hand — the `LOOP_ENGINE_IDS` array, the `buildEngine` switch, the
|
|
7
|
+
* settings schema's engine union, the preset display-name map, and the browser
|
|
8
|
+
* half's option list and glyph table. Adding an engine meant finding all of
|
|
9
|
+
* them, and a miss showed up as an engine that mounts but cannot be selected, or
|
|
10
|
+
* one the settings schema rejects. Now the roster is declared ONCE here and
|
|
11
|
+
* everything else is derived:
|
|
12
|
+
*
|
|
13
|
+
* - {@link HOSTED_ENGINE_IDS} / {@link LOOP_ENGINE_IDS} (this module)
|
|
14
|
+
* - the settings schema's union (`./settings.ts` maps the ids to `z.const`)
|
|
15
|
+
* - the preset id prefix arithmetic (`./agent-preset-ids.ts`)
|
|
16
|
+
* - the browser half's option list, glyph and copy key (`./client/**`)
|
|
17
|
+
* - the driver dispatch (`./engine-drivers.ts`, which is the one node-side
|
|
18
|
+
* table that must import the engine modules — it cannot live here)
|
|
19
|
+
*
|
|
20
|
+
* ## Why this module imports NOTHING
|
|
21
|
+
*
|
|
22
|
+
* It is read by the browser bundle (the settings page renders the option list
|
|
23
|
+
* from it), and the client artifact must never pull a host package
|
|
24
|
+
* (`dsh-settings`, `schemastery`, `node:fs`) into the browser. So this file is
|
|
25
|
+
* plain data and pure functions — no imports at all, not even type-only ones
|
|
26
|
+
* from a host package. `tests/agent-preset-ids.spec.ts` pins that property.
|
|
27
|
+
*
|
|
28
|
+
* Anything that needs the host (probing a binary, reading an auth file, spawning
|
|
29
|
+
* a child) lives in `./engine-probe.ts` on the node side and is keyed by
|
|
30
|
+
* {@link EngineDescriptor.id}. The split is the reason a descriptor can declare
|
|
31
|
+
* `authPaths` — a fact the settings page renders — while the *probe* that reads
|
|
32
|
+
* them stays out of the browser bundle.
|
|
33
|
+
*
|
|
34
|
+
* ## Adding an engine
|
|
35
|
+
*
|
|
36
|
+
* 1. add its id to {@link HOSTED_ENGINE_IDS};
|
|
37
|
+
* 2. add its {@link EngineDescriptor} row to {@link ENGINE_REGISTRY} (TypeScript
|
|
38
|
+
* refuses the build until the record is exhaustive again);
|
|
39
|
+
* 3. add its driver to `./engine-drivers.ts` (same exhaustiveness rule);
|
|
40
|
+
* 4. add its copy to `./client/locales.ts` under the descriptor's
|
|
41
|
+
* {@link EngineDescriptor.localeKey}.
|
|
42
|
+
*
|
|
43
|
+
* Nothing else: the settings schema, the preset ids, the option lists and the
|
|
44
|
+
* glyph table all read this table.
|
|
45
|
+
*
|
|
46
|
+
* @module dsh-loop-engine-allinone/engine-registry
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* The wire shape an engine speaks, as a coarse family.
|
|
50
|
+
*
|
|
51
|
+
* The four families are the ones the drivers' protocol skeletons implement
|
|
52
|
+
* (`./driver-cli/`): line-delimited JSON frames, JSON-RPC 2.0, the Agent Client
|
|
53
|
+
* Protocol (JSON-RPC with ACP's method names), and plain text. The value is
|
|
54
|
+
* declared rather than inferred so the settings page can say what an engine can
|
|
55
|
+
* do without importing the driver.
|
|
56
|
+
*/
|
|
57
|
+
export declare const ENGINE_PROTOCOLS: readonly ["ndjson", "jsonrpc", "acp", "text"];
|
|
58
|
+
/** One engine's wire-protocol family. */
|
|
59
|
+
export type EngineProtocol = (typeof ENGINE_PROTOCOLS)[number];
|
|
60
|
+
/**
|
|
61
|
+
* What one engine can do, declared rather than discovered.
|
|
62
|
+
*
|
|
63
|
+
* Every surface that would otherwise hardcode "engine X supports Y" reads this
|
|
64
|
+
* instead: the settings page hides a control an engine cannot honour, and a
|
|
65
|
+
* driver asked for something outside its declaration fails loud rather than
|
|
66
|
+
* pretending. A capability that is genuinely unknown is declared `false` — the
|
|
67
|
+
* rule is that a surface must never claim more than the engine was verified to
|
|
68
|
+
* do (`docs/engine-registry.md` records what was verified and how).
|
|
69
|
+
*/
|
|
70
|
+
export interface EngineCapabilities {
|
|
71
|
+
/** Whether the engine streams partial output, rather than answering in one block at the end. */
|
|
72
|
+
readonly streaming: boolean;
|
|
73
|
+
/** The wire-protocol family the driver speaks. */
|
|
74
|
+
readonly protocol: EngineProtocol;
|
|
75
|
+
/** Whether a session can be continued by id across separate process launches. */
|
|
76
|
+
readonly sessionResume: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* The engine's own permission/approval mode names, when it has a mode switch
|
|
79
|
+
* the driver can map dsh's sandbox/approval knobs onto. Absent means the
|
|
80
|
+
* engine has no such switch — the driver then relies on the subprocess
|
|
81
|
+
* sandbox alone, and the settings page shows no mode control.
|
|
82
|
+
*/
|
|
83
|
+
readonly permissionModes?: readonly string[];
|
|
84
|
+
/** Whether the engine accepts image input natively. */
|
|
85
|
+
readonly images: boolean;
|
|
86
|
+
/** Whether the engine exposes a reasoning-effort/thinking level. */
|
|
87
|
+
readonly reasoningLevels: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The ACP protocol version this engine's client announces at `initialize`.
|
|
90
|
+
*
|
|
91
|
+
* Declared rather than hardcoded because three engines now share ONE ACP
|
|
92
|
+
* skeleton (`driver-acp/`): before it, the announced version was a constant
|
|
93
|
+
* inside that client, so an engine that moved to a different protocol version
|
|
94
|
+
* would have been advanced — or silently frozen — for all of them at once. The
|
|
95
|
+
* value is per engine and optional; an engine that omits it (or that does not
|
|
96
|
+
* speak ACP at all) is announced as {@link DEFAULT_ACP_PROTOCOL_VERSION}.
|
|
97
|
+
*/
|
|
98
|
+
readonly acpProtocolVersion?: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The ACP protocol version a client announces when its engine's row declares
|
|
102
|
+
* none.
|
|
103
|
+
*
|
|
104
|
+
* `1` is what every ACP engine on this fork's reference host answered to a client
|
|
105
|
+
* that announced `1` (measured: kimi, grok and MiniMax Code all reply
|
|
106
|
+
* `protocolVersion: 1`), and it is also the value the shared client sent before
|
|
107
|
+
* this became registry data — so an engine that declares nothing keeps the
|
|
108
|
+
* behavior it had.
|
|
109
|
+
*/
|
|
110
|
+
export declare const DEFAULT_ACP_PROTOCOL_VERSION = 1;
|
|
111
|
+
/**
|
|
112
|
+
* One engine's account REGION, when its CLI makes the account's region a
|
|
113
|
+
* first-class deployment fact.
|
|
114
|
+
*
|
|
115
|
+
* MiniMax Code is the case: its login endpoint is region-scoped
|
|
116
|
+
* (`mcode login --region cn|global`), its credentials are stored per region
|
|
117
|
+
* (`~/.minimax/auth/prod/<region>/…`) and its own environment variable
|
|
118
|
+
* (`MCODE_REGION`) selects one. The descriptor declares the knob so the driver
|
|
119
|
+
* can set it on the child WITHOUT naming the engine's variable in shared code,
|
|
120
|
+
* and a deployment can override the default.
|
|
121
|
+
*/
|
|
122
|
+
export interface EngineRegion {
|
|
123
|
+
/** The composition-entry key a deployment sets to override {@link default}. */
|
|
124
|
+
readonly configKey: string;
|
|
125
|
+
/** The environment variable the CLI reads. */
|
|
126
|
+
readonly envVar: string;
|
|
127
|
+
/** The region used when a deployment pins none. */
|
|
128
|
+
readonly default: string;
|
|
129
|
+
/** Every region value the CLI accepts. */
|
|
130
|
+
readonly values: readonly string[];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* One model an engine offers from its OWN subscription.
|
|
134
|
+
*
|
|
135
|
+
* Distinct from a dsh model: a hosted engine answers with its own account, so
|
|
136
|
+
* these ids are the engine's vocabulary, not something any dsh adapter serves.
|
|
137
|
+
* Picking one in the model menu hands that id to the engine (`--model <id>`),
|
|
138
|
+
* which is how a user chooses among the models their subscription includes
|
|
139
|
+
* instead of accepting "the engine decides".
|
|
140
|
+
*
|
|
141
|
+
* The list is DECLARED rather than discovered, for the same reason the
|
|
142
|
+
* capabilities are: probing an engine's catalog means spawning it, and this
|
|
143
|
+
* plugin's contract is that booting the harness starts **no** external process.
|
|
144
|
+
* A deployment whose subscription changed refreshes the list by editing it —
|
|
145
|
+
* and a stale id fails loudly at the engine, which is the honest outcome.
|
|
146
|
+
*/
|
|
147
|
+
export interface EngineModel {
|
|
148
|
+
/** The engine's own model id, passed verbatim to the engine. */
|
|
149
|
+
readonly id: string;
|
|
150
|
+
/** Human-readable name shown in the model menu. */
|
|
151
|
+
readonly label: string;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Everything the rest of the plugin needs to know about one engine, as data.
|
|
155
|
+
*
|
|
156
|
+
* The two groups are deliberately different in kind: the fields above
|
|
157
|
+
* {@link capabilities} are deployment facts (where the binary is, how to
|
|
158
|
+
* upgrade it, whether it ships with the plugin), and `capabilities` is what the
|
|
159
|
+
* engine can do. A surface that renders an engine reads the second; the settings
|
|
160
|
+
* page's engine-management area reads the first.
|
|
161
|
+
*/
|
|
162
|
+
export interface EngineDescriptor {
|
|
163
|
+
/** Stable engine id: the value stored in settings, records and preset ids. */
|
|
164
|
+
readonly id: string;
|
|
165
|
+
/** Human-readable name, used for the authored preset's metadata and as the fallback label. */
|
|
166
|
+
readonly label: string;
|
|
167
|
+
/** Where the engine comes from, shown as a link in the settings page's engine-management area. */
|
|
168
|
+
readonly repo?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Whether the engine ships as an npm dependency of this plugin.
|
|
171
|
+
*
|
|
172
|
+
* The distinction is load-bearing rather than cosmetic: a bundled engine's
|
|
173
|
+
* version is pinned by this package's `package.json`, so it is upgraded by
|
|
174
|
+
* changing the dependency and reinstalling — never by running the CLI's own
|
|
175
|
+
* updater at runtime. Only an external CLI gets an upgrade button.
|
|
176
|
+
*/
|
|
177
|
+
readonly bundled: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* The composition-entry key that pins this engine's executable, when the
|
|
180
|
+
* deployment may point it at its own build. External CLIs and the bundled
|
|
181
|
+
* engines that can be unbound (`claude`'s SDK option, codex's and pi's own
|
|
182
|
+
* binaries) both carry one; an engine that can only ever run the bundled copy
|
|
183
|
+
* omits it.
|
|
184
|
+
*/
|
|
185
|
+
readonly binConfigKey?: string;
|
|
186
|
+
/** argv (after the executable) that prints the engine's version. */
|
|
187
|
+
readonly versionArgv?: readonly string[];
|
|
188
|
+
/**
|
|
189
|
+
* argv (after the executable) that updates an EXTERNAL CLI in place.
|
|
190
|
+
*
|
|
191
|
+
* Absent for a bundled engine on purpose: its version is this package's
|
|
192
|
+
* dependency pin, and rewriting a dependency at runtime is an anti-pattern
|
|
193
|
+
* (`docs/engine-registry.md` §4).
|
|
194
|
+
*/
|
|
195
|
+
readonly updateArgv?: readonly string[];
|
|
196
|
+
/** What to tell a user whose engine is installed but not signed in. */
|
|
197
|
+
readonly loginHint?: string;
|
|
198
|
+
/**
|
|
199
|
+
* The engine's account region, when its CLI scopes accounts by region.
|
|
200
|
+
*
|
|
201
|
+
* Absent for every engine whose account is region-independent. See
|
|
202
|
+
* {@link EngineRegion} for what the deployment can do with it.
|
|
203
|
+
*/
|
|
204
|
+
readonly region?: EngineRegion;
|
|
205
|
+
/**
|
|
206
|
+
* Home-relative paths whose existence means "this engine has been signed in
|
|
207
|
+
* at least once", for the settings page's diagnostic.
|
|
208
|
+
*
|
|
209
|
+
* A hint, never a gate: engines own their credentials, and the plugin never
|
|
210
|
+
* reads, writes or refreshes them. The probe only reports whether the path
|
|
211
|
+
* exists (`./engine-probe.ts`).
|
|
212
|
+
*/
|
|
213
|
+
readonly authPaths?: readonly string[];
|
|
214
|
+
/** The copy key naming this engine in the browser half's dictionary. */
|
|
215
|
+
readonly localeKey: string;
|
|
216
|
+
/**
|
|
217
|
+
* The models this engine offers from its own subscription, when the plugin
|
|
218
|
+
* knows them.
|
|
219
|
+
*
|
|
220
|
+
* An engine that omits this keeps the shared `external` route with its single
|
|
221
|
+
* `default` entry ("the engine decides") — which is the right answer for an
|
|
222
|
+
* engine whose catalog this build has no verified list for. An engine that
|
|
223
|
+
* declares one gets its OWN provider group in the model menu, holding
|
|
224
|
+
* `default` plus these entries, and selecting one passes its id to the engine.
|
|
225
|
+
*/
|
|
226
|
+
readonly models?: readonly EngineModel[];
|
|
227
|
+
/** What the engine can do. */
|
|
228
|
+
readonly capabilities: EngineCapabilities;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Every engine this plugin hosts, in selection order.
|
|
232
|
+
*
|
|
233
|
+
* The order is the settings dropdown's order and the order the authored presets
|
|
234
|
+
* are written in. New engines are APPENDED: the ids are persisted in session
|
|
235
|
+
* logs, sidecar records and preset ids, so an existing id may never be removed
|
|
236
|
+
* or reordered without a migration (`docs/engine-registry.md` §5).
|
|
237
|
+
*/
|
|
238
|
+
export declare const HOSTED_ENGINE_IDS: readonly ["claude-code", "codex", "pi", "kimi", "agy", "zcode", "qoderclicn", "hermes", "grok", "minimaxcode"];
|
|
239
|
+
/** An engine this plugin hosts itself; `in-process` is the harness's own loop. */
|
|
240
|
+
export type HostedEngineId = (typeof HOSTED_ENGINE_IDS)[number];
|
|
241
|
+
/**
|
|
242
|
+
* Every selectable engine, the harness's own loop first.
|
|
243
|
+
*
|
|
244
|
+
* `in-process` is not a descriptor: it is the harness's loop, not something this
|
|
245
|
+
* plugin hosts, so it has no binary, no protocol and no capabilities to declare.
|
|
246
|
+
* Keeping it out of {@link ENGINE_REGISTRY} is what makes the record exhaustive
|
|
247
|
+
* over {@link HostedEngineId} alone.
|
|
248
|
+
*/
|
|
249
|
+
export declare const LOOP_ENGINE_IDS: readonly ["in-process", "claude-code", "codex", "pi", "kimi", "agy", "zcode", "qoderclicn", "hermes", "grok", "minimaxcode"];
|
|
250
|
+
/** Installed agent loop engine id. */
|
|
251
|
+
export type LoopEngineId = (typeof LOOP_ENGINE_IDS)[number];
|
|
252
|
+
/**
|
|
253
|
+
* The registry itself: one row per hosted engine.
|
|
254
|
+
*
|
|
255
|
+
* `satisfies` rather than a plain annotation, for two reasons at once. The
|
|
256
|
+
* `Record` half is the exhaustiveness check: TypeScript refuses to build when an
|
|
257
|
+
* id in {@link HOSTED_ENGINE_IDS} has no row, so "add an engine" cannot
|
|
258
|
+
* half-land. The `as const` half keeps every field's LITERAL type, which is what
|
|
259
|
+
* lets the browser half derive its copy keys from this table
|
|
260
|
+
* (`EngineLocaleKey` in `./client/locales.ts`) instead of restating the roster —
|
|
261
|
+
* an annotation would widen `localeKey` to `string` and destroy that.
|
|
262
|
+
*/
|
|
263
|
+
export declare const ENGINE_REGISTRY: {
|
|
264
|
+
readonly 'claude-code': {
|
|
265
|
+
readonly id: "claude-code";
|
|
266
|
+
readonly label: "Claude Code";
|
|
267
|
+
readonly repo: "https://github.com/anthropics/claude-code";
|
|
268
|
+
readonly bundled: true;
|
|
269
|
+
readonly binConfigKey: "claudeBin";
|
|
270
|
+
readonly versionArgv: readonly ["--version"];
|
|
271
|
+
readonly loginHint: "run `claude` once and sign in, or point `claudeBin` at a signed-in install";
|
|
272
|
+
readonly authPaths: readonly [".claude/.credentials.json", ".claude.json"];
|
|
273
|
+
readonly localeKey: "engineClaudeCode";
|
|
274
|
+
readonly capabilities: {
|
|
275
|
+
readonly streaming: true;
|
|
276
|
+
readonly protocol: "ndjson";
|
|
277
|
+
readonly sessionResume: true;
|
|
278
|
+
readonly permissionModes: readonly ["default", "acceptEdits", "bypassPermissions", "plan"];
|
|
279
|
+
readonly images: true;
|
|
280
|
+
readonly reasoningLevels: false;
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
readonly codex: {
|
|
284
|
+
readonly id: "codex";
|
|
285
|
+
readonly label: "Codex";
|
|
286
|
+
readonly repo: "https://github.com/openai/codex";
|
|
287
|
+
readonly bundled: true;
|
|
288
|
+
readonly binConfigKey: "codexBin";
|
|
289
|
+
readonly versionArgv: readonly ["--version"];
|
|
290
|
+
readonly loginHint: "run `codex login`, or set CODEX_API_KEY, or point `codexBin` at a signed-in install";
|
|
291
|
+
readonly authPaths: readonly [".codex/auth.json"];
|
|
292
|
+
readonly localeKey: "engineCodex";
|
|
293
|
+
readonly capabilities: {
|
|
294
|
+
readonly streaming: true;
|
|
295
|
+
readonly protocol: "jsonrpc";
|
|
296
|
+
readonly sessionResume: true;
|
|
297
|
+
readonly permissionModes: readonly ["read-only", "workspace-write", "danger-full-access"];
|
|
298
|
+
readonly images: true;
|
|
299
|
+
readonly reasoningLevels: true;
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
readonly pi: {
|
|
303
|
+
readonly id: "pi";
|
|
304
|
+
readonly label: "Pi";
|
|
305
|
+
readonly repo: "https://github.com/earendil-works/pi";
|
|
306
|
+
readonly bundled: true;
|
|
307
|
+
readonly binConfigKey: "piBin";
|
|
308
|
+
readonly versionArgv: readonly ["--version"];
|
|
309
|
+
readonly loginHint: "run `pi` once and sign in, or set the provider API-key variable pi expects";
|
|
310
|
+
readonly authPaths: readonly [".pi/agent/auth.json"];
|
|
311
|
+
readonly localeKey: "enginePi";
|
|
312
|
+
readonly capabilities: {
|
|
313
|
+
readonly streaming: true;
|
|
314
|
+
readonly protocol: "jsonrpc";
|
|
315
|
+
readonly sessionResume: false;
|
|
316
|
+
readonly permissionModes: readonly ["read-only", "workspace-write", "danger-full-access"];
|
|
317
|
+
readonly images: true;
|
|
318
|
+
readonly reasoningLevels: true;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
readonly kimi: {
|
|
322
|
+
readonly id: "kimi";
|
|
323
|
+
readonly label: "Kimi Code";
|
|
324
|
+
readonly repo: "https://github.com/MoonshotAI/kimi-cli";
|
|
325
|
+
readonly bundled: false;
|
|
326
|
+
readonly binConfigKey: "kimiBin";
|
|
327
|
+
readonly versionArgv: readonly ["--version"];
|
|
328
|
+
readonly updateArgv: readonly ["update"];
|
|
329
|
+
readonly loginHint: "run `kimi` once and sign in (or `kimi login`)";
|
|
330
|
+
readonly authPaths: readonly [".kimi-code/credentials.json", ".kimi-code/auth.json"];
|
|
331
|
+
readonly localeKey: "engineKimi";
|
|
332
|
+
readonly capabilities: {
|
|
333
|
+
readonly streaming: true;
|
|
334
|
+
readonly protocol: "acp";
|
|
335
|
+
readonly sessionResume: true;
|
|
336
|
+
readonly permissionModes: readonly ["ask", "allow", "deny"];
|
|
337
|
+
readonly images: true;
|
|
338
|
+
readonly reasoningLevels: false;
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
readonly agy: {
|
|
342
|
+
readonly id: "agy";
|
|
343
|
+
readonly label: "Antigravity";
|
|
344
|
+
readonly repo: "https://antigravity.google";
|
|
345
|
+
readonly bundled: false;
|
|
346
|
+
readonly binConfigKey: "agyBin";
|
|
347
|
+
readonly versionArgv: readonly ["--version"];
|
|
348
|
+
readonly updateArgv: readonly ["update"];
|
|
349
|
+
readonly loginHint: "run `agy` once and complete the Google sign-in it opens";
|
|
350
|
+
readonly authPaths: readonly [".gemini/oauth_creds.json"];
|
|
351
|
+
readonly localeKey: "engineAgy";
|
|
352
|
+
readonly models: readonly [{
|
|
353
|
+
readonly id: "gemini-3.8-flash-high";
|
|
354
|
+
readonly label: "Gemini 3.8 Flash (High)";
|
|
355
|
+
}, {
|
|
356
|
+
readonly id: "gemini-3.8-flash-medium";
|
|
357
|
+
readonly label: "Gemini 3.8 Flash (Medium)";
|
|
358
|
+
}, {
|
|
359
|
+
readonly id: "gemini-3.8-flash-low";
|
|
360
|
+
readonly label: "Gemini 3.8 Flash (Low)";
|
|
361
|
+
}, {
|
|
362
|
+
readonly id: "claude-sonnet-4-6";
|
|
363
|
+
readonly label: "Claude Sonnet 4.6 (Thinking)";
|
|
364
|
+
}, {
|
|
365
|
+
readonly id: "claude-opus-4-6-thinking";
|
|
366
|
+
readonly label: "Claude Opus 4.6 (Thinking)";
|
|
367
|
+
}, {
|
|
368
|
+
readonly id: "gpt-oss-120b-medium";
|
|
369
|
+
readonly label: "GPT-OSS 120B (Medium)";
|
|
370
|
+
}];
|
|
371
|
+
readonly capabilities: {
|
|
372
|
+
readonly streaming: true;
|
|
373
|
+
readonly protocol: "ndjson";
|
|
374
|
+
readonly sessionResume: true;
|
|
375
|
+
readonly permissionModes: readonly ["accept-edits", "auto", "plan"];
|
|
376
|
+
readonly images: false;
|
|
377
|
+
readonly reasoningLevels: true;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
readonly zcode: {
|
|
381
|
+
readonly id: "zcode";
|
|
382
|
+
readonly label: "ZCode";
|
|
383
|
+
readonly repo: "https://z.ai";
|
|
384
|
+
readonly bundled: false;
|
|
385
|
+
readonly binConfigKey: "zcodeBin";
|
|
386
|
+
readonly versionArgv: readonly ["version"];
|
|
387
|
+
readonly updateArgv: readonly ["plugins", "update"];
|
|
388
|
+
readonly loginHint: "run `zcode login` to sign in with Z.AI";
|
|
389
|
+
readonly authPaths: readonly [".zcode/v2", ".zcode/cli"];
|
|
390
|
+
readonly localeKey: "engineZcode";
|
|
391
|
+
readonly capabilities: {
|
|
392
|
+
readonly streaming: true;
|
|
393
|
+
readonly protocol: "jsonrpc";
|
|
394
|
+
readonly sessionResume: true;
|
|
395
|
+
readonly permissionModes: readonly ["build", "edit", "plan", "yolo"];
|
|
396
|
+
readonly images: false;
|
|
397
|
+
readonly reasoningLevels: false;
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
readonly qoderclicn: {
|
|
401
|
+
readonly id: "qoderclicn";
|
|
402
|
+
readonly label: "Qoder CN";
|
|
403
|
+
readonly repo: "https://qoder.com";
|
|
404
|
+
readonly bundled: false;
|
|
405
|
+
readonly binConfigKey: "qoderclicnBin";
|
|
406
|
+
readonly versionArgv: readonly ["--version"];
|
|
407
|
+
readonly updateArgv: readonly ["update"];
|
|
408
|
+
readonly loginHint: "run `qoderclicn login` to sign in to Qoder CN";
|
|
409
|
+
readonly authPaths: readonly [".qoder-cn/.auth/user"];
|
|
410
|
+
readonly localeKey: "engineQoderclicn";
|
|
411
|
+
readonly capabilities: {
|
|
412
|
+
readonly streaming: true;
|
|
413
|
+
readonly protocol: "ndjson";
|
|
414
|
+
readonly sessionResume: true;
|
|
415
|
+
readonly permissionModes: readonly ["default", "accept_edits", "bypass_permissions", "dont_ask", "auto"];
|
|
416
|
+
readonly images: false;
|
|
417
|
+
readonly reasoningLevels: true;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
readonly hermes: {
|
|
421
|
+
readonly id: "hermes";
|
|
422
|
+
readonly label: "Hermes Agent";
|
|
423
|
+
readonly repo: "https://github.com/NousResearch/hermes";
|
|
424
|
+
readonly bundled: false;
|
|
425
|
+
readonly binConfigKey: "hermesBin";
|
|
426
|
+
readonly versionArgv: readonly ["--version"];
|
|
427
|
+
readonly updateArgv: readonly ["update"];
|
|
428
|
+
readonly loginHint: "run `hermes setup` (or `hermes auth`) to sign in to an inference provider";
|
|
429
|
+
readonly authPaths: readonly ["auth.json"];
|
|
430
|
+
readonly localeKey: "engineHermes";
|
|
431
|
+
readonly capabilities: {
|
|
432
|
+
readonly streaming: false;
|
|
433
|
+
readonly protocol: "text";
|
|
434
|
+
readonly sessionResume: true;
|
|
435
|
+
readonly permissionModes: readonly ["safe-mode", "yolo"];
|
|
436
|
+
readonly images: false;
|
|
437
|
+
readonly reasoningLevels: true;
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
readonly grok: {
|
|
441
|
+
readonly id: "grok";
|
|
442
|
+
readonly label: "Grok Build";
|
|
443
|
+
readonly repo: "https://github.com/xai-org/grok-build";
|
|
444
|
+
readonly bundled: false;
|
|
445
|
+
readonly binConfigKey: "grokBin";
|
|
446
|
+
readonly versionArgv: readonly ["--version"];
|
|
447
|
+
readonly updateArgv: readonly ["update"];
|
|
448
|
+
readonly loginHint: "run `grok` once and complete the sign-in it opens (or `grok login`), then retry";
|
|
449
|
+
readonly authPaths: readonly [".grok/auth.json"];
|
|
450
|
+
readonly localeKey: "engineGrok";
|
|
451
|
+
readonly models: readonly [{
|
|
452
|
+
readonly id: "grok-4.7";
|
|
453
|
+
readonly label: "Grok 4.7";
|
|
454
|
+
}];
|
|
455
|
+
readonly capabilities: {
|
|
456
|
+
readonly streaming: true;
|
|
457
|
+
readonly protocol: "acp";
|
|
458
|
+
readonly sessionResume: true;
|
|
459
|
+
readonly permissionModes: readonly ["ask", "always-approve"];
|
|
460
|
+
readonly images: false;
|
|
461
|
+
readonly reasoningLevels: true;
|
|
462
|
+
readonly acpProtocolVersion: 1;
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
readonly minimaxcode: {
|
|
466
|
+
readonly id: "minimaxcode";
|
|
467
|
+
readonly label: "MiniMax Code";
|
|
468
|
+
readonly repo: "https://agent.minimax.io/docs/cli/quick-start";
|
|
469
|
+
readonly bundled: false;
|
|
470
|
+
readonly binConfigKey: "minimaxcodeBin";
|
|
471
|
+
readonly versionArgv: readonly ["--version"];
|
|
472
|
+
readonly updateArgv: readonly ["update"];
|
|
473
|
+
readonly loginHint: "run `mcode login --region cn|global`, then `mcode provider use token-plan` to spend your M Plan subscription";
|
|
474
|
+
readonly authPaths: readonly [".minimax/auth/prod"];
|
|
475
|
+
readonly region: {
|
|
476
|
+
readonly configKey: "mcodeRegion";
|
|
477
|
+
readonly envVar: "MAVIS_REGION";
|
|
478
|
+
readonly default: "cn";
|
|
479
|
+
readonly values: readonly ["cn", "en"];
|
|
480
|
+
};
|
|
481
|
+
readonly localeKey: "engineMinimaxcode";
|
|
482
|
+
readonly models: readonly [{
|
|
483
|
+
readonly id: "m:minimax:MiniMax-M3:v:thinking";
|
|
484
|
+
readonly label: "M3 · thinking";
|
|
485
|
+
}, {
|
|
486
|
+
readonly id: "m:minimax:MiniMax-M3:v:";
|
|
487
|
+
readonly label: "M3";
|
|
488
|
+
}, {
|
|
489
|
+
readonly id: "m:minimax:MiniMax-M3.1-Flash-Preview:v:thinking";
|
|
490
|
+
readonly label: "M3.1-Flash-Preview · thinking";
|
|
491
|
+
}, {
|
|
492
|
+
readonly id: "m:minimax:MiniMax-M3.1-Flash-Preview:v:";
|
|
493
|
+
readonly label: "M3.1-Flash-Preview";
|
|
494
|
+
}, {
|
|
495
|
+
readonly id: "m:minimax:MiniMax-M2.7-highspeed:v:thinking";
|
|
496
|
+
readonly label: "M2.7-highspeed · thinking";
|
|
497
|
+
}, {
|
|
498
|
+
readonly id: "m:minimax:MiniMax-M2.7:v:thinking";
|
|
499
|
+
readonly label: "M2.7 · thinking";
|
|
500
|
+
}];
|
|
501
|
+
readonly capabilities: {
|
|
502
|
+
readonly streaming: true;
|
|
503
|
+
readonly protocol: "acp";
|
|
504
|
+
readonly sessionResume: true;
|
|
505
|
+
readonly permissionModes: readonly ["default", "auto", "bypassPermissions"];
|
|
506
|
+
readonly images: true;
|
|
507
|
+
readonly reasoningLevels: true;
|
|
508
|
+
readonly acpProtocolVersion: 1;
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
};
|
|
512
|
+
/** Every hosted engine descriptor, in selection order. */
|
|
513
|
+
export declare const ENGINE_DESCRIPTORS: readonly EngineDescriptor[];
|
|
514
|
+
/**
|
|
515
|
+
* Whether an engine is one this plugin hosts — an external CLI some other
|
|
516
|
+
* vendor runs, which owns its own model — rather than the harness's own loop.
|
|
517
|
+
*
|
|
518
|
+
* The judgement a surface needs to say "the model is the engine's own business"
|
|
519
|
+
* without hardcoding one engine's name: every hosted engine behaves the same
|
|
520
|
+
* way here, and naming one of them would make a general fact read as a property
|
|
521
|
+
* of that engine. An engine nobody has answered for yet is not hosted: a surface
|
|
522
|
+
* that does not know says nothing rather than claiming the wrong half.
|
|
523
|
+
* @param engine - an engine id, or undefined while one is still being read.
|
|
524
|
+
* @returns whether that engine is hosted by this plugin.
|
|
525
|
+
*/
|
|
526
|
+
export declare function isHostedEngine(engine: LoopEngineId | undefined): engine is HostedEngineId;
|
|
527
|
+
/**
|
|
528
|
+
* Whether an untyped value is one of {@link LOOP_ENGINE_IDS}.
|
|
529
|
+
*
|
|
530
|
+
* The boundary test both halves need: a value crossing the wire, the sidecar
|
|
531
|
+
* file, or a projection read is only an engine when it is one of these.
|
|
532
|
+
* @param value - the value to classify.
|
|
533
|
+
* @returns whether `value` is an installed engine id.
|
|
534
|
+
*/
|
|
535
|
+
export declare function isLoopEngineId(value: unknown): value is LoopEngineId;
|
|
536
|
+
/**
|
|
537
|
+
* The descriptor of one hosted engine.
|
|
538
|
+
*
|
|
539
|
+
* Total rather than partial by construction: the parameter is
|
|
540
|
+
* {@link HostedEngineId}, so there is no unknown-id case to answer for. Callers
|
|
541
|
+
* holding an untyped id narrow it with {@link isHostedEngine} first.
|
|
542
|
+
* @param engine - the hosted engine to describe.
|
|
543
|
+
* @returns that engine's descriptor.
|
|
544
|
+
*/
|
|
545
|
+
export declare function descriptorOf(engine: HostedEngineId): EngineDescriptor;
|
|
546
|
+
/**
|
|
547
|
+
* The copy key naming one engine in the browser half's dictionary.
|
|
548
|
+
*
|
|
549
|
+
* Derived from the table rather than declared, so the union of valid keys grows
|
|
550
|
+
* with the registry: adding an engine makes its `localeKey` a required entry in
|
|
551
|
+
* both dictionaries (`./client/locales.ts`), and a typo in a registry row is a
|
|
552
|
+
* compile error rather than a blank label at runtime.
|
|
553
|
+
*/
|
|
554
|
+
export type EngineLocaleKey = (typeof ENGINE_REGISTRY)[HostedEngineId]['localeKey'];
|
|
555
|
+
/**
|
|
556
|
+
* The descriptor of one engine, or undefined for `in-process` and for anything
|
|
557
|
+
* this build does not know.
|
|
558
|
+
* @param engine - an engine id from any source.
|
|
559
|
+
* @returns that engine's descriptor, or undefined when it is not hosted.
|
|
560
|
+
*/
|
|
561
|
+
export declare function descriptorOfOptional(engine: LoopEngineId | undefined): EngineDescriptor | undefined;
|
|
562
|
+
/**
|
|
563
|
+
* The ACP protocol version to announce on behalf of one engine.
|
|
564
|
+
*
|
|
565
|
+
* The ONE reader of {@link EngineCapabilities.acpProtocolVersion}: every ACP
|
|
566
|
+
* driver goes through here, so the fallback to
|
|
567
|
+
* {@link DEFAULT_ACP_PROTOCOL_VERSION} is applied in one place and an engine that
|
|
568
|
+
* declares a different version cannot be missed by a driver that forgot to ask.
|
|
569
|
+
* @param engine - the hosted engine whose version is being announced.
|
|
570
|
+
* @returns the declared version, or the default when the engine declares none.
|
|
571
|
+
*/
|
|
572
|
+
export declare function acpProtocolVersionOf(engine: HostedEngineId): number;
|
|
573
|
+
/**
|
|
574
|
+
* The region one engine's child should run under, or undefined when the engine
|
|
575
|
+
* declares no region.
|
|
576
|
+
* @param engine - the hosted engine.
|
|
577
|
+
* @param override - the deployment's own value from the descriptor's `configKey`.
|
|
578
|
+
* @returns the region to use, the engine's default when the deployment pins none.
|
|
579
|
+
* @throws when the deployment pins a value the engine's CLI does not accept —
|
|
580
|
+
* fail loud at resolve time rather than spelling an invalid region into the
|
|
581
|
+
* child's environment, where the CLI would silently fall back to its own.
|
|
582
|
+
*/
|
|
583
|
+
export declare function regionOf(engine: HostedEngineId, override?: string): string | undefined;
|
|
584
|
+
//# sourceMappingURL=engine-registry.d.ts.map
|