@botiverse/oar 0.78.0 → 0.80.0
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 +32 -5
- package/dist/contracts/install.d.ts +16 -10
- package/dist/contracts/install.d.ts.map +1 -1
- package/dist/contracts/placement.d.ts +6 -3
- package/dist/contracts/placement.d.ts.map +1 -1
- package/dist/contracts/placement.js +1 -1
- package/dist/contracts/placement.js.map +1 -1
- package/dist/contracts/runtime.d.ts +4 -2
- package/dist/contracts/runtime.d.ts.map +1 -1
- package/dist/contracts/runtime.js +5 -0
- package/dist/contracts/runtime.js.map +1 -1
- package/dist/contracts/session-unavailable-error.d.ts +6 -4
- package/dist/contracts/session-unavailable-error.d.ts.map +1 -1
- package/dist/contracts/session-unavailable-error.js +4 -2
- package/dist/contracts/session-unavailable-error.js.map +1 -1
- package/dist/runtimes/antigravity/index.d.ts +1 -1
- package/dist/runtimes/antigravity/index.d.ts.map +1 -1
- package/dist/runtimes/claude/index.d.ts +1 -1
- package/dist/runtimes/claude/index.d.ts.map +1 -1
- package/dist/runtimes/codebuddy/index.d.ts +3 -1
- package/dist/runtimes/codebuddy/index.d.ts.map +1 -1
- package/dist/runtimes/codebuddy/index.js +2 -1
- package/dist/runtimes/codebuddy/index.js.map +1 -1
- package/dist/runtimes/codebuddy/install.d.ts +6 -0
- package/dist/runtimes/codebuddy/install.d.ts.map +1 -0
- package/dist/runtimes/codebuddy/install.js +11 -0
- package/dist/runtimes/codebuddy/install.js.map +1 -0
- package/dist/runtimes/codebuddy/installation.d.ts +3 -1
- package/dist/runtimes/codebuddy/installation.d.ts.map +1 -1
- package/dist/runtimes/codebuddy/installation.js +23 -1
- package/dist/runtimes/codebuddy/installation.js.map +1 -1
- package/dist/runtimes/codex/app-server-client.d.ts +1 -1
- package/dist/runtimes/codex/app-server-client.d.ts.map +1 -1
- package/dist/runtimes/codex/index.d.ts +1 -1
- package/dist/runtimes/codex/index.d.ts.map +1 -1
- package/dist/runtimes/codex/session.d.ts.map +1 -1
- package/dist/runtimes/codex/session.js +11 -10
- package/dist/runtimes/codex/session.js.map +1 -1
- package/dist/runtimes/grok/index.d.ts +1 -1
- package/dist/runtimes/grok/index.d.ts.map +1 -1
- package/dist/runtimes/kimi/index.d.ts +1 -1
- package/dist/runtimes/kimi/index.d.ts.map +1 -1
- package/dist/runtimes/opencode/index.d.ts +1 -1
- package/dist/runtimes/opencode/index.d.ts.map +1 -1
- package/dist/runtimes/pi/rpc/open.d.ts.map +1 -1
- package/dist/runtimes/pi/rpc/open.js +3 -1
- package/dist/runtimes/pi/rpc/open.js.map +1 -1
- package/dist/runtimes/pi/rpc/session.js +2 -2
- package/dist/runtimes/pi/rpc/session.js.map +1 -1
- package/dist/runtimes/qoder/index.d.ts +1 -1
- package/dist/runtimes/qoder/index.d.ts.map +1 -1
- package/dist/runtimes/qoder/session.d.ts.map +1 -1
- package/dist/runtimes/qoder/session.js +2 -1
- package/dist/runtimes/qoder/session.js.map +1 -1
- package/dist/runtimes/qwen/index.d.ts +1 -1
- package/dist/runtimes/qwen/index.d.ts.map +1 -1
- package/dist/runtimes/qwen/session.d.ts.map +1 -1
- package/dist/runtimes/qwen/session.js +3 -1
- package/dist/runtimes/qwen/session.js.map +1 -1
- package/dist/shared/acp/client-app.d.ts +17 -4
- package/dist/shared/acp/client-app.d.ts.map +1 -1
- package/dist/shared/acp/client-app.js +35 -12
- package/dist/shared/acp/client-app.js.map +1 -1
- package/dist/shared/acp/errors.d.ts +3 -1
- package/dist/shared/acp/errors.d.ts.map +1 -1
- package/dist/shared/acp/errors.js +13 -3
- package/dist/shared/acp/errors.js.map +1 -1
- package/dist/shared/acp/initialize.d.ts +6 -0
- package/dist/shared/acp/initialize.d.ts.map +1 -0
- package/dist/shared/acp/initialize.js +30 -0
- package/dist/shared/acp/initialize.js.map +1 -0
- package/dist/shared/acp/process.d.ts +3 -0
- package/dist/shared/acp/process.d.ts.map +1 -1
- package/dist/shared/acp/process.js +1 -0
- package/dist/shared/acp/process.js.map +1 -1
- package/dist/shared/acp/profile.d.ts +2 -0
- package/dist/shared/acp/profile.d.ts.map +1 -1
- package/dist/shared/acp/profile.js +8 -24
- package/dist/shared/acp/profile.js.map +1 -1
- package/dist/shared/acp/protocol-error.d.ts +5 -0
- package/dist/shared/acp/protocol-error.d.ts.map +1 -0
- package/dist/shared/acp/protocol-error.js +6 -0
- package/dist/shared/acp/protocol-error.js.map +1 -0
- package/dist/shared/acp/records.d.ts +10 -8
- package/dist/shared/acp/records.d.ts.map +1 -1
- package/dist/shared/acp/records.js +24 -11
- package/dist/shared/acp/records.js.map +1 -1
- package/dist/shared/acp/routing.d.ts +59 -0
- package/dist/shared/acp/routing.d.ts.map +1 -0
- package/dist/shared/acp/routing.js +374 -0
- package/dist/shared/acp/routing.js.map +1 -0
- package/dist/shared/acp/session.d.ts +28 -2
- package/dist/shared/acp/session.d.ts.map +1 -1
- package/dist/shared/acp/session.js +164 -104
- package/dist/shared/acp/session.js.map +1 -1
- package/dist/shared/acp/shared-session.d.ts +27 -0
- package/dist/shared/acp/shared-session.d.ts.map +1 -0
- package/dist/shared/acp/shared-session.js +171 -0
- package/dist/shared/acp/shared-session.js.map +1 -0
- package/dist/shared/acp/shared-wire.d.ts +9 -0
- package/dist/shared/acp/shared-wire.d.ts.map +1 -0
- package/dist/shared/acp/shared-wire.js +113 -0
- package/dist/shared/acp/shared-wire.js.map +1 -0
- package/dist/shared/acp/turns.d.ts +4 -3
- package/dist/shared/acp/turns.d.ts.map +1 -1
- package/dist/shared/acp/turns.js +11 -4
- package/dist/shared/acp/turns.js.map +1 -1
- package/dist/shared/credential-redactor.d.ts +2 -0
- package/dist/shared/credential-redactor.d.ts.map +1 -1
- package/dist/shared/credential-redactor.js +1 -0
- package/dist/shared/credential-redactor.js.map +1 -1
- package/dist/shared/executable/diagnostics.d.ts +17 -0
- package/dist/shared/executable/diagnostics.d.ts.map +1 -1
- package/dist/shared/executable/diagnostics.js +11 -0
- package/dist/shared/executable/diagnostics.js.map +1 -1
- package/dist/shared/executable/ownership.d.ts.map +1 -1
- package/dist/shared/executable/ownership.js +22 -5
- package/dist/shared/executable/ownership.js.map +1 -1
- package/dist/shared/executable/process-cleanup.d.ts +29 -0
- package/dist/shared/executable/process-cleanup.d.ts.map +1 -0
- package/dist/shared/executable/process-cleanup.js +84 -0
- package/dist/shared/executable/process-cleanup.js.map +1 -0
- package/dist/shared/executable/process-tree.d.ts +29 -2
- package/dist/shared/executable/process-tree.d.ts.map +1 -1
- package/dist/shared/executable/process-tree.js +110 -21
- package/dist/shared/executable/process-tree.js.map +1 -1
- package/dist/shared/executable/process.d.ts +1 -1
- package/dist/shared/executable/process.d.ts.map +1 -1
- package/dist/shared/executable/process.js +20 -24
- package/dist/shared/executable/process.js.map +1 -1
- package/dist/shared/executable/run.d.ts.map +1 -1
- package/dist/shared/executable/run.js +16 -2
- package/dist/shared/executable/run.js.map +1 -1
- package/dist/shared/install-npm.d.ts +14 -0
- package/dist/shared/install-npm.d.ts.map +1 -0
- package/dist/shared/install-npm.js +81 -0
- package/dist/shared/install-npm.js.map +1 -0
- package/dist/shared/install.d.ts +2 -1
- package/dist/shared/install.d.ts.map +1 -1
- package/dist/shared/install.js +4 -4
- package/dist/shared/install.js.map +1 -1
- package/dist/shared/login.d.ts.map +1 -1
- package/dist/shared/login.js +2 -7
- package/dist/shared/login.js.map +1 -1
- package/dist/shared/process-pool.d.ts +5 -1
- package/dist/shared/process-pool.d.ts.map +1 -1
- package/dist/shared/process-pool.js +11 -8
- package/dist/shared/process-pool.js.map +1 -1
- package/dist/shared/process-session.d.ts.map +1 -1
- package/dist/shared/process-session.js +2 -1
- package/dist/shared/process-session.js.map +1 -1
- package/dist/shared/session-credentials.d.ts +2 -2
- package/dist/shared/session-credentials.d.ts.map +1 -1
- package/dist/shared/session-credentials.js +21 -18
- package/dist/shared/session-credentials.js.map +1 -1
- package/dist/shared/session-kernel.d.ts +2 -0
- package/dist/shared/session-kernel.d.ts.map +1 -1
- package/dist/shared/session-kernel.js +1 -1
- package/dist/shared/session-kernel.js.map +1 -1
- package/dist/shared/stream-json/session.d.ts.map +1 -1
- package/dist/shared/stream-json/session.js +10 -3
- package/dist/shared/stream-json/session.js.map +1 -1
- package/dist/shared/token-redaction.d.ts +3 -0
- package/dist/shared/token-redaction.d.ts.map +1 -0
- package/dist/shared/token-redaction.js +10 -0
- package/dist/shared/token-redaction.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -143,6 +143,22 @@ dependency range includes this upstream update. See the
|
|
|
143
143
|
|
|
144
144
|
The command-line interface is a separate package: `@botiverse/oar-cli`.
|
|
145
145
|
|
|
146
|
+
`Runtime.execution` is a readonly declaration available before installation or
|
|
147
|
+
session open: `"process"`, `"in_process"` or `null` when undeclared (including
|
|
148
|
+
Morph). It is independent of the installed version and stays the same after
|
|
149
|
+
`withPlacement()`. Pi's subprocess mode declares `"process"`; Pi's SDK, Cursor
|
|
150
|
+
and Pi Durable declare `"in_process"`. A host that wants no process sharing uses:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
const selected = runtime.execution === "process" ? runtime.withPlacement("isolated") : runtime;
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
This preserves SDK and undeclared runtime instances. `null` does not promise
|
|
157
|
+
isolation; explicit process placement is still refused for those adapters.
|
|
158
|
+
`Runtime.placement` is the requested policy, while `Session.placement` reports
|
|
159
|
+
the opened session's actual placement. See the
|
|
160
|
+
[placement contract](https://github.com/botiverse/oar/blob/main/docs/spec/record-stream.md#placement-and-release).
|
|
161
|
+
|
|
146
162
|
What a runtime cannot honor is refused, never dropped: `runtime.session()`
|
|
147
163
|
rejects with an `UnsupportedOptionError` (`option` names the refused
|
|
148
164
|
`SessionOptions` key, the message is the reason), so a host can try and fall
|
|
@@ -300,14 +316,21 @@ See [runtime updates](https://github.com/botiverse/oar/blob/main/docs/spec/updat
|
|
|
300
316
|
|
|
301
317
|
`runtime.installPlan()` reports what installing a runtime would run on this
|
|
302
318
|
machine (the vendor's documented installer and the page that documents it)
|
|
303
|
-
or why it would run
|
|
304
|
-
`requires_gui`, `missing_tool`; `requires_privileges` and `
|
|
319
|
+
or why it would run no installer (`platform`, `requires_privileges`,
|
|
320
|
+
`requires_gui`, `missing_tool`, `location_unknown`; `requires_privileges`, `missing_tool` and `location_unknown`
|
|
305
321
|
still carry the vendor's `steps` and `source`, for the person to run
|
|
306
|
-
themselves once they have the rights or the tool
|
|
322
|
+
themselves once they have the rights or the tool, or have checked the installer's
|
|
323
|
+
location configuration); `runtime.install()` runs
|
|
307
324
|
it, without a terminal and never with sudo, when `installation()` finds no
|
|
308
325
|
copy, and judges the result by `installation()` afterwards, never by the
|
|
309
326
|
installer's exit code. oar never installs on its own. Claude, Codex, Grok,
|
|
310
327
|
Kimi and OpenCode install through their vendors' macOS and Linux scripts;
|
|
328
|
+
CodeBuddy uses its official npm package on Linux, macOS and Windows, checks
|
|
329
|
+
the configured global prefix, and discovers its launcher even off PATH.
|
|
330
|
+
Planning may run bounded local read-only queries with private temporary files
|
|
331
|
+
removed afterwards; it never installs, downloads packages or changes user files.
|
|
332
|
+
An unreadable prefix returns `location_unknown` with the failure category in
|
|
333
|
+
`detail`, without npm's raw output.
|
|
311
334
|
OpenCode declares two release lines in `runtime.installLines` (`v1`, `v2`)
|
|
312
335
|
and takes the host's choice as `line` (oar picks none), and a copy of either
|
|
313
336
|
line is `already_installed`, never replaced. Antigravity's plan is
|
|
@@ -416,8 +439,12 @@ This is discovery, not execution or a live session's command state.
|
|
|
416
439
|
[Command scope and limits](https://github.com/botiverse/oar/blob/main/docs/spec/inventory.md#commands).
|
|
417
440
|
|
|
418
441
|
Custom runtimes should use `defineRuntime`, which fills missing inventory
|
|
419
|
-
methods with explicit unsupported results
|
|
420
|
-
|
|
442
|
+
methods with explicit unsupported results and supplies `execution`, `placement`
|
|
443
|
+
and `withPlacement`. Its second argument's `execution` controls both the public
|
|
444
|
+
declaration and placement selection; omission gives `null`. Supplying `shared`
|
|
445
|
+
hooks requires `execution: "process"`, checked by the type and at runtime.
|
|
446
|
+
A manually constructed `Runtime` must implement the four inventory methods, including
|
|
447
|
+
`commands`, and these placement members.
|
|
421
448
|
|
|
422
449
|
### Orientation
|
|
423
450
|
|
|
@@ -2,20 +2,21 @@ import type { AvailableInstallation } from "./installation.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* Why oar will not run a runtime's installer on this machine. The same
|
|
4
4
|
* answer comes from `installPlan()` and from `install()`, which then runs
|
|
5
|
-
*
|
|
5
|
+
* no installer. Planning may still run bounded local read-only queries.
|
|
6
6
|
*/
|
|
7
|
-
export type InstallUnsupportedReason = "platform" | "requires_privileges" | "requires_gui" | "missing_tool" | "bundled" | "line_required" | "unknown_line";
|
|
7
|
+
export type InstallUnsupportedReason = "platform" | "requires_privileges" | "requires_gui" | "missing_tool" | "location_unknown" | "bundled" | "line_required" | "unknown_line";
|
|
8
8
|
export interface InstallUnsupported {
|
|
9
9
|
readonly kind: "unsupported";
|
|
10
10
|
readonly reason: InstallUnsupportedReason;
|
|
11
|
-
/** Plain words for a person:
|
|
11
|
+
/** Plain words for a person: why oar cannot run the installer, or how the vendor installs it instead. */
|
|
12
12
|
readonly detail?: string;
|
|
13
13
|
/**
|
|
14
14
|
* The steps the plan would have had, for a person to run themselves once
|
|
15
15
|
* they have what is missing; oar runs none of them. Present only where oar
|
|
16
16
|
* knows the vendor's step but will not run it here: `requires_privileges`
|
|
17
|
-
* (the person runs it with the rights it needs)
|
|
18
|
-
* installing the tool)
|
|
17
|
+
* (the person runs it with the rights it needs), `missing_tool` (after
|
|
18
|
+
* installing the tool) and `location_unknown` (after checking the installer's
|
|
19
|
+
* location configuration). Absent for every other reason.
|
|
19
20
|
*/
|
|
20
21
|
readonly steps?: readonly InstallStep[];
|
|
21
22
|
/** The vendor's page that documents `steps` (the plan's `source`); present with `steps`. */
|
|
@@ -44,9 +45,11 @@ export interface InstallStep {
|
|
|
44
45
|
readonly display: string;
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
47
|
-
* What `install()` would run on this machine, read without running
|
|
48
|
-
* downloading
|
|
49
|
-
*
|
|
48
|
+
* What `install()` would run on this machine, read without running an
|
|
49
|
+
* installer, downloading packages or changing user files. Bounded local
|
|
50
|
+
* read-only queries may run, with private temporary files removed afterwards.
|
|
51
|
+
* `source` is the vendor's page that documents the method. Executing a plan
|
|
52
|
+
* downloads (`network`) and needs no elevated rights
|
|
50
53
|
* (`privileges`): an installer that would is `requires_privileges` instead.
|
|
51
54
|
*/
|
|
52
55
|
export type InstallPlan = {
|
|
@@ -71,7 +74,7 @@ export type InstallResult =
|
|
|
71
74
|
readonly output: string;
|
|
72
75
|
}
|
|
73
76
|
/**
|
|
74
|
-
* The probe found one before
|
|
77
|
+
* The probe found one before any installer ran, whichever
|
|
75
78
|
* `line` was asked for: an install never replaces a copy of another line.
|
|
76
79
|
*/
|
|
77
80
|
| {
|
|
@@ -95,7 +98,10 @@ export interface InstallOptions {
|
|
|
95
98
|
*/
|
|
96
99
|
readonly line?: string;
|
|
97
100
|
}
|
|
98
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Never installs, downloads packages or changes user files. May run bounded
|
|
103
|
+
* local read-only queries, removing any private temporary files afterwards.
|
|
104
|
+
*/
|
|
99
105
|
export type InstallPlanner = (options?: InstallOptions) => Promise<InstallPlan>;
|
|
100
106
|
/**
|
|
101
107
|
* Runs the runtime's own installer, non-interactively, when the runtime's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sources":["../../src/contracts/install.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAChC,UAAU,GACV,qBAAqB,GACrB,cAAc,GACd,cAAc,GACd,SAAS,GACT,eAAe,GACf,cAAc,CAAC;AAEnB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,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EAAE,IAAI,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;CAC5B,GACD,kBAAkB,CAAC;AAEvB;;;;;GAKG;AACH,MAAM,MAAM,aAAa;AACvB,0IAA0I;AACxI;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE;AAC/H;;;GAGG;GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,qBAAqB,CAAC;IAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;AAC9G,uIAAuI;GACrI;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACtF,kBAAkB,CAAC;AAEvB,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -10,14 +10,17 @@ export interface SessionOpenContext {
|
|
|
10
10
|
readonly placement: SessionPlacement;
|
|
11
11
|
}
|
|
12
12
|
/** Runtime-author evidence and construction hooks. Every shared factory owns a fresh pool. */
|
|
13
|
-
export
|
|
14
|
-
readonly execution
|
|
13
|
+
export type RuntimePlacementOptions = {
|
|
14
|
+
readonly execution: "process";
|
|
15
15
|
readonly shared?: {
|
|
16
16
|
/** Null only for versions/platforms whose complete sharing gate was observed. */
|
|
17
17
|
refusal(installation: AvailableInstallation): string | null;
|
|
18
18
|
session(): StartSession;
|
|
19
19
|
};
|
|
20
|
-
}
|
|
20
|
+
} | {
|
|
21
|
+
readonly execution?: "in_process";
|
|
22
|
+
readonly shared?: never;
|
|
23
|
+
};
|
|
21
24
|
/** One bounded native cleanup attempt; completed does not promise against future work. */
|
|
22
25
|
export type SessionCleanup = {
|
|
23
26
|
readonly kind: "completed";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placement.d.ts","sources":["../../src/contracts/placement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAC9D,+EAA+E;AAC/E,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC;AAEpE,uEAAuE;AACvE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;CACtC;AAED,8FAA8F;AAC9F,MAAM,
|
|
1
|
+
{"version":3,"file":"placement.d.ts","sources":["../../src/contracts/placement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AA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|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
function selectPlacement(installation, requested, options) {
|
|
21
|
-
if (options.execution === undefined
|
|
21
|
+
if (options.execution === undefined) {
|
|
22
22
|
return fixedPlacement(requested, null, "This adapter does not declare process placement");
|
|
23
23
|
}
|
|
24
24
|
if (options.execution === "in_process") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placement.js","sources":["../../src/contracts/placement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAmCrD,4FAA4F;AAC5F,MAAM,UAAU,gBAAgB,CAAC,QAAsB,EAAE,SAA2B,EAAE,OAAgC;IACpH,IAAI,MAAM,GAA6B,SAAS,CAAC;IACjD,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE;QAC5C,MAAM,SAAS,GAAG,eAAe,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACpE,IAAI,IAAI,GAAG,QAAQ,CAAC;QACpB,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;YAC3B,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;YACrC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBAAC,MAAM,IAAI,sBAAsB,CAAC,WAAW,EAAE,gDAAgD,CAAC,CAAC;YAAC,CAAC;YAC9H,IAAI,GAAG,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,OAAO,GAAG,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;QAC1E,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;QAClE,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,YAAmC,EAAE,SAA2B,EAAE,OAAgC;IACzH,IAAI,O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AC,SAAS,EAAE,YAAY,EAAE,uCAAuC,CAAC,CAAC;IAC1F,CAAC;IACD,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;QAAC,OAAO,UAAU,CAAC;IAAC,CAAC;IACpD,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,8EAA8E,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACrK,IAAI,SAAS,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAAC,MAAM,IAAI,sBAAsB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAAC,CAAC;IAC3G,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC;AAClD,CAAC;AAED,SAAS,cAAc,CAAC,SAA2B,EAAE,SAAkC,EAAE,MAAc;IACrG,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QAAC,MAAM,IAAI,sBAAsB,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAAC,CAAC;IACpF,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -37,6 +37,8 @@ export type RefusedSessionOptions = Readonly<Partial<Record<RefusableSessionOpti
|
|
|
37
37
|
export type McpToolsListChanged = "full" | "additions" | "none";
|
|
38
38
|
/** One provider-independent runtime adoption unit. */
|
|
39
39
|
export interface Runtime extends RuntimeInventories {
|
|
40
|
+
/** Static adapter declaration, independent of installation version. Null means undeclared. */
|
|
41
|
+
readonly execution: "process" | "in_process" | null;
|
|
40
42
|
/** Requested policy. The opened Session reports what actually ran. */
|
|
41
43
|
readonly placement: PlacementRequest;
|
|
42
44
|
/** A new runtime instance, with its own pool. Refusals are checked at session open. */
|
|
@@ -92,10 +94,10 @@ export interface Runtime extends RuntimeInventories {
|
|
|
92
94
|
/** Provider-level credential observations for runtimes with multiple accounts. */
|
|
93
95
|
readonly providers?: ProviderAuthReader;
|
|
94
96
|
}
|
|
95
|
-
type RuntimeDefinition = Omit<Runtime, keyof RuntimeInventories | "brand" | "placement" | "withPlacement"> & Partial<RuntimeInventories> & {
|
|
97
|
+
type RuntimeDefinition = Omit<Runtime, keyof RuntimeInventories | "brand" | "execution" | "placement" | "withPlacement"> & Partial<RuntimeInventories> & {
|
|
96
98
|
readonly brand?: RuntimeBrand;
|
|
97
99
|
};
|
|
98
|
-
type DefinedRuntime<T> = Omit<T, "session" | "placement" | "withPlacement"> & Runtime;
|
|
100
|
+
type DefinedRuntime<T> = Omit<T, "session" | "execution" | "placement" | "withPlacement"> & Runtime;
|
|
99
101
|
export declare function defineRuntime<const T extends RuntimeDefinition>(runtime: T, options?: RuntimePlacementOptions): DefinedRuntime<T>;
|
|
100
102
|
export {};
|
|
101
103
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sources":["../../src/contracts/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAmB,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,uBAAuB,EAAoB,MAAM,gBAAgB,CAAC;AACvG,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAo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,iBAAiB,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAE,uBAA4B,GAAG,cAAc,CAAC,CAAC,CAAC,CAarI"}
|
|
@@ -9,9 +9,14 @@ async function unsupported() {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export function defineRuntime(runtime, options = {}) {
|
|
12
|
+
// oxlint-disable-next-line typescript/no-unnecessary-condition -- JavaScript callers can bypass the discriminated options.
|
|
13
|
+
if (options.shared !== undefined && options.execution !== "process") {
|
|
14
|
+
throw new Error("Shared placement requires execution: process");
|
|
15
|
+
}
|
|
12
16
|
const create = (requested) => ({
|
|
13
17
|
skills: unsupported, commands: unsupported, mcpServers: unsupported, tools: unsupported,
|
|
14
18
|
...runtime, brand: runtime.brand ?? { name: runtime.id, icon: null }, placement: requested,
|
|
19
|
+
execution: options.execution ?? null,
|
|
15
20
|
withPlacement: create,
|
|
16
21
|
session: placementSession(runtime.session, requested, options),
|
|
17
22
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sources":["../../src/contracts/runtime.ts"],"names":[],"mappings":"AAIA,yIAAyI;AACzI,OAAO,EAAuD,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.js","sources":["../../src/contracts/runtime.ts"],"names":[],"mappings":"AAIA,yIAAyI;AACzI,OAAO,EAAuD,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAkGvG,KAAK,UAAU,WAAW;IACxB,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IACxB,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,uBAAuB;QAC7B,MAAM,EAAE,+DAA+D;KACxE,CAAC;AACJ,CAAC;AAKD,MAAM,UAAU,aAAa,CAAoC,OAAU,EAAE,OAAO,GAA4B,EAAE;IAChH,2HAA2H;IAC3H,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAAC,CAAC;IACzI,MAAM,MAAM,GAAG,CAAC,SAA2B,EAAqB,EAAE,CAAC,CACjE;QACE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW;QACvF,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS;QAC1F,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI;QACpC,aAAa,EAAE,MAAM;QACrB,OAAO,EAAE,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC;KAC/D,CACF,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
* - `archived`: the user archived it in the runtime's own app; the host
|
|
4
4
|
* decides whether to unarchive it (OAR never does, since that reverses the
|
|
5
5
|
* user's own action).
|
|
6
|
-
* - `in_use`: another
|
|
7
|
-
* once
|
|
6
|
+
* - `in_use`: another controller (for example the user's app or another
|
|
7
|
+
* OAR session on a shared connection) holds it; retry once it lets go.
|
|
8
8
|
*/
|
|
9
9
|
export type SessionUnavailableReason = "archived" | "in_use";
|
|
10
10
|
/**
|
|
11
11
|
* `session({ resume })` found the native conversation but the runtime will
|
|
12
|
-
* not open it now.
|
|
13
|
-
*
|
|
12
|
+
* not open it now. Documented runtime signals keep the runtime's own words.
|
|
13
|
+
* An OAR shared-connection ownership conflict instead identifies `oar/open`
|
|
14
|
+
* as its cause method and carries only the observed native session id.
|
|
15
|
+
* No turn exists yet: this is not a
|
|
14
16
|
* FailureClass. See docs/spec/runtime-matrix.md#unavailable-resume-targets.
|
|
15
17
|
*/
|
|
16
18
|
export declare class SessionUnavailableError extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-unavailable-error.d.ts","sources":["../../src/contracts/session-unavailable-error.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"session-unavailable-error.d.ts","sources":["../../src/contracts/session-unavailable-error.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE7D;;;;;;;GAOG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,SAAkB,IAAI,6BAA6B;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC;IAC1C,SAAiB,KAAK,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;KAAE,CAAC;IAExG,YAAY,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,wBAAwB,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;KAAE,EAIlL;CACF"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `session({ resume })` found the native conversation but the runtime will
|
|
3
|
-
* not open it now.
|
|
4
|
-
*
|
|
3
|
+
* not open it now. Documented runtime signals keep the runtime's own words.
|
|
4
|
+
* An OAR shared-connection ownership conflict instead identifies `oar/open`
|
|
5
|
+
* as its cause method and carries only the observed native session id.
|
|
6
|
+
* No turn exists yet: this is not a
|
|
5
7
|
* FailureClass. See docs/spec/runtime-matrix.md#unavailable-resume-targets.
|
|
6
8
|
*/
|
|
7
9
|
export class SessionUnavailableError extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-unavailable-error.js","sources":["../../src/contracts/session-unavailable-error.ts"],"names":[],"mappings":"AAWA
|
|
1
|
+
{"version":3,"file":"session-unavailable-error.js","sources":["../../src/contracts/session-unavailable-error.ts"],"names":[],"mappings":"AAWA;;;;;;;GAOG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAC9B,IAAI,GAAG,yBAAyB,CAAC;IAC1C,SAAS,CAAS;IAClB,MAAM,CAA2B;IAG1C,YAAY,SAAiB,EAAE,OAAe,EAAE,OAAmI;QACjL,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9E,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -12,5 +12,5 @@ export declare const antigravityRuntime: Omit<{
|
|
|
12
12
|
readonly checkUpdate: import("../../browser.js").UpdateChecker;
|
|
13
13
|
readonly refusedSessionOptions: Readonly<Partial<Record<import("../../contracts/runtime.js").RefusableSessionOption, string>>>;
|
|
14
14
|
readonly mcpToolsListChanged: "full";
|
|
15
|
-
}, "placement" | "session" | "withPlacement"> & import("../../contracts/runtime.js").Runtime;
|
|
15
|
+
}, "execution" | "placement" | "session" | "withPlacement"> & import("../../contracts/runtime.js").Runtime;
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/antigravity/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/antigravity/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;0GAiBH,CAAC"}
|
|
@@ -24,7 +24,7 @@ export declare const claudeRuntime: Omit<{
|
|
|
24
24
|
readonly logout: typeof claudeLogout;
|
|
25
25
|
readonly authStatus: typeof claudeAuthStatus;
|
|
26
26
|
readonly session: import("../../browser.js").StartSession;
|
|
27
|
-
}, "placement" | "session" | "withPlacement"> & import("../../contracts/runtime.js").Runtime;
|
|
27
|
+
}, "execution" | "placement" | "session" | "withPlacement"> & import("../../contracts/runtime.js").Runtime;
|
|
28
28
|
export { claudeAccountUsage } from "./account-usage.js";
|
|
29
29
|
export { claudeListModels, projectClaudeModels } from "./list-models.js";
|
|
30
30
|
export { claudeSession } from "./session.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/claude/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,EAAqB,aAAa,EAAE,MAAM,aAAa,CAAC;AAG/D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/claude/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK3C,OAAO,EAAqB,aAAa,EAAE,MAAM,aAAa,CAAC;AAG/D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;0GAqBE,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -10,9 +10,11 @@ export declare const codebuddyRuntime: Omit<{
|
|
|
10
10
|
};
|
|
11
11
|
readonly refusedSessionOptions: Readonly<Partial<Record<import("../../contracts/runtime.js").RefusableSessionOption, string>>>;
|
|
12
12
|
readonly installation: import("../../browser.js").InstallationProbe;
|
|
13
|
+
readonly install: import("../../browser.js").Installer;
|
|
14
|
+
readonly installPlan: import("../../browser.js").InstallPlanner;
|
|
13
15
|
readonly listModels: (installation: import("../../browser.js").AvailableInstallation, options?: import("../../browser.js").ListModelsOptions | undefined) => Promise<import("../../browser.js").ListModelsResult>;
|
|
14
16
|
readonly login: (installation: import("../../browser.js").AvailableInstallation, interaction: import("../../browser.js").ProviderLoginInteraction, options?: import("../../contracts/login.js").LoginOptions | undefined) => Promise<import("../../contracts/login.js").LoginResult>;
|
|
15
17
|
readonly authStatus: (installation: import("../../browser.js").AvailableInstallation, options?: import("../../contracts/login.js").AuthStatusOptions | undefined) => Promise<import("../../contracts/login.js").AuthStatus>;
|
|
16
18
|
readonly session: (installation: import("../../browser.js").AvailableInstallation, options: import("../../browser.js").SessionOptions, context?: import("../../browser.js").SessionOpenContext | undefined) => Promise<import("../../browser.js").Session>;
|
|
17
|
-
}, "placement" | "session" | "withPlacement"> & import("../../contracts/runtime.js").Runtime;
|
|
19
|
+
}, "execution" | "placement" | "session" | "withPlacement"> & import("../../contracts/runtime.js").Runtime;
|
|
18
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/codebuddy/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/codebuddy/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;0GAQD,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { runtimeBrands } from "../../brands.js";
|
|
2
2
|
import { defineRuntime } from "../../contracts/runtime.js";
|
|
3
3
|
import { onFirstCall } from "../../shared/lazy.js";
|
|
4
|
+
import { codebuddyInstall, codebuddyInstallPlan } from "./install.js";
|
|
4
5
|
import { codebuddyInstallation } from "./installation.js";
|
|
5
6
|
import { codebuddyRefusedSessionOptions } from "./options.js";
|
|
6
7
|
export const codebuddyRuntime = defineRuntime({
|
|
7
8
|
id: "codebuddy", brand: runtimeBrands.codebuddy,
|
|
8
9
|
refusedSessionOptions: codebuddyRefusedSessionOptions,
|
|
9
|
-
installation: codebuddyInstallation,
|
|
10
|
+
installation: codebuddyInstallation, install: codebuddyInstall, installPlan: codebuddyInstallPlan,
|
|
10
11
|
listModels: onFirstCall(async () => { const { codebuddyListModels } = await import("./list-models.js"); return codebuddyListModels; }),
|
|
11
12
|
login: onFirstCall(async () => { const { codebuddyLogin } = await import("./login.js"); return codebuddyLogin; }),
|
|
12
13
|
authStatus: onFirstCall(async () => { const { codebuddyAuthStatus } = await import("./auth-status.js"); return codebuddyAuthStatus; }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/runtimes/codebuddy/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;IAC5C,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,aAAa,CAAC,SAAS;IAC/C,qBAAqB,EA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B,EAAE,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC;CAC1H,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type NpmInstallMethod } from "../../shared/install-npm.js";
|
|
2
|
+
/** The documented stable method; the native script remains a vendor Beta. */
|
|
3
|
+
export declare const codebuddyInstallMethod: NpmInstallMethod;
|
|
4
|
+
export declare const codebuddyInstallPlan: import("../../browser.js").InstallPlanner;
|
|
5
|
+
export declare const codebuddyInstall: import("../../browser.js").Installer;
|
|
6
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sources":["../../../src/runtimes/codebuddy/install.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAGpF,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,EAAE,gBAGpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,2CAAyC,CAAC;AAC3E,eAAO,MAAM,gBAAgB,sCAA6D,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { planInstaller } from "../../shared/install.js";
|
|
2
|
+
import { npmInstallPlan } from "../../shared/install-npm.js";
|
|
3
|
+
import { codebuddyInstallation } from "./installation.js";
|
|
4
|
+
/** The documented stable method; the native script remains a vendor Beta. */
|
|
5
|
+
export const codebuddyInstallMethod = {
|
|
6
|
+
packageName: "@tencent-ai/codebuddy-code",
|
|
7
|
+
source: "https://www.codebuddy.ai/docs/cli/installation",
|
|
8
|
+
};
|
|
9
|
+
export const codebuddyInstallPlan = npmInstallPlan(codebuddyInstallMethod);
|
|
10
|
+
export const codebuddyInstall = planInstaller(codebuddyInstallation, codebuddyInstallPlan);
|
|
11
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.js","sources":["../../../src/runtimes/codebuddy/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAyB,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,6EAA6E;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAqB;IACtD,WAAW,EAAE,4BAA4B;IACzC,MAAM,EAAE,gDAAgD;CACzD,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAC,sBAAsB,CAAC,CAAC;AAC3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { InstallationProbe } from "../../contracts/installation.js";
|
|
2
|
+
/** A configured override remains exclusive. Only an otherwise missing copy triggers npm's local prefix lookup. */
|
|
3
|
+
export declare const codebuddyInstallation: InstallationProbe;
|
|
2
4
|
//# sourceMappingURL=installation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.d.ts","sources":["../../../src/runtimes/codebuddy/installation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"installation.d.ts","sources":["../../../src/runtimes/codebuddy/installation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAUzE,kHAAkH;AAClH,eAAO,MAAM,qBAAqB,EAAE,iBAWnC,CAAC"}
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import { environmentHome } from "../../shared/environment-home.js";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { environmentValue, sessionEnvironment } from "../../shared/environment.js";
|
|
4
|
+
import { resolveExecutable } from "../../shared/executable/index.js";
|
|
5
|
+
import { npmGlobalBin, npmGlobalPrefix } from "../../shared/install-npm.js";
|
|
3
6
|
import { executableInstallation } from "../../shared/installation.js";
|
|
4
|
-
|
|
7
|
+
const directInstallation = executableInstallation("OAR_CODEBUDDY_BIN", "codebuddy", (env) => [
|
|
5
8
|
path.join(environmentHome(env), ".local", "bin", process.platform === "win32" ? "codebuddy.exe" : "codebuddy"),
|
|
6
9
|
], ["--help"]);
|
|
10
|
+
/** A configured override remains exclusive. Only an otherwise missing copy triggers npm's local prefix lookup. */
|
|
11
|
+
export const codebuddyInstallation = async (options = {}) => {
|
|
12
|
+
const direct = await directInstallation(options);
|
|
13
|
+
const env = sessionEnvironment(options.env);
|
|
14
|
+
const pinned = environmentValue(env, "OAR_CODEBUDDY_BIN");
|
|
15
|
+
if (direct.kind !== "not_found" || (pinned !== undefined && pinned !== "")) {
|
|
16
|
+
return direct;
|
|
17
|
+
}
|
|
18
|
+
const npm = resolveExecutable("npm", env);
|
|
19
|
+
if (npm === null) {
|
|
20
|
+
return direct;
|
|
21
|
+
}
|
|
22
|
+
const prefix = await npmGlobalPrefix(npm, env).catch(() => null);
|
|
23
|
+
if (prefix === null) {
|
|
24
|
+
return direct;
|
|
25
|
+
}
|
|
26
|
+
const command = path.join(npmGlobalBin(prefix), process.platform === "win32" ? "codebuddy.cmd" : "codebuddy");
|
|
27
|
+
return executableInstallation("OAR_CODEBUDDY_BIN", "codebuddy", [command], ["--help"])(options);
|
|
28
|
+
};
|
|
7
29
|
//# sourceMappingURL=installation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installation.js","sources":["../../../src/runtimes/codebuddy/installation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"installation.js","sources":["../../../src/runtimes/codebuddy/installation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kC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,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,GAAS,EAAE,CAAC,IAAI,CAAC,CAAC;IACvE,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAAC,OAAO,MAAM,CAAC;IAAC,CAAC;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;IAC9G,OAAO,sBAAsB,CAAC,mBAAmB,EAAE,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAClG,CAAC,CAAC"}
|
|
@@ -51,7 +51,7 @@ export interface AppServerClient {
|
|
|
51
51
|
* record exactly where the reply sat on the wire.
|
|
52
52
|
*/
|
|
53
53
|
mark(callback: () => void): void;
|
|
54
|
-
onExit(handler: (code: number | null) => void): void;
|
|
54
|
+
onExit(handler: (code: number | null, reason?: string) => void): void;
|
|
55
55
|
kill(): void;
|
|
56
56
|
/** The app-server's memory with everything it started (`LineProcess.resources`). */
|
|
57
57
|
readonly resources: () => Promise<SessionResources | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-server-client.d.ts","sources":["../../../src/runtimes/codex/app-server-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAE7F,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG5E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;;;GAIG;AACH,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAClB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;CAAE,GACxD;IA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M,EAAE,UAAU,GAAG,IAAI,CAAC;IACjD;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC1C;;;;;;OAMG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACjC,MAAM,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;IACtE,IAAI,IAAI,IAAI,CAAC;IACb,oFAAoF;IACpF,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;CAC5D;AASD,yIAAyI;AACzI,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,eAAe,GAAG,UAAU,CAAC;IACrG,+JAA+J;IAC/J,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,sIAAsI;IACtI,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,EAC7C,eAAe,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM,EACtD,GAAG,CAAC,EAAE,MAAM,EACZ,cAAc,GAAE,uBAA4B,GAC3C,eAAe,CAIjB"}
|
|
@@ -27,7 +27,7 @@ export declare const codexRuntime: Omit<{
|
|
|
27
27
|
readonly logout: typeof codexLogout;
|
|
28
28
|
readonly authStatus: import("../../browser.js").AuthStatusReader;
|
|
29
29
|
readonly session: import("../../browser.js").StartSession;
|
|
30
|
-
}, "placement" | "session" | "withPlacement"> & import("../../contracts/runtime.js").Runtime;
|
|
30
|
+
}, "execution" | "placement" | "session" | "withPlacement"> & import("../../contracts/runtime.js").Runtime;
|
|
31
31
|
export { codexAccountUsage, projectCodexUsage } from "./account-usage.js";
|
|
32
32
|
export { codexListModels, projectCodexModels } from "./list-models.js";
|
|
33
33
|
export { codexSession } from "./session.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/codex/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI7D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sources":["../../../src/runtimes/codex/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,UAAU,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK1C,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI7D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;0GAmBG,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sources":["../../../src/runtimes/codex/session.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"session.d.ts","sources":["../../../src/runtimes/codex/session.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAuD,YAAY,EAAE,MAAM,4BAA4B,CAAC;AA8BpH,eAAO,MAAM,YAAY,EAAE,YAwQzB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { appendCleanupFailure } from "../../shared/executable/process-cleanup.js";
|
|
1
2
|
import { codexGoalControl, confirmCodexGoals } from "./goal.js";
|
|
2
3
|
/* oxlint-disable import/max-dependencies -- The adapter composes protocol, input and process-lifetime mechanisms. */
|
|
3
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -27,9 +28,12 @@ export const codexSession = withSessionCredentials(async (installation, options,
|
|
|
27
28
|
// skip the override entirely.
|
|
28
29
|
const sandboxMode = process.env.OAR_CODEX_SANDBOX ?? "danger-full-access";
|
|
29
30
|
const configOverrides = { ...(sandboxMode === "inherit" ? {} : { sandbox_mode: `"${sandboxMode}"` }), ...(options.goals === true ? { "features.goals": "true" } : {}) };
|
|
30
|
-
//
|
|
31
|
-
// open's config carries the session's MCP credentials to codex.
|
|
31
|
+
// Client errors redact the MCP credentials carried by the open config.
|
|
32
32
|
const client = startAppServerClient(installation.command, options.env, configOverrides, undefined, { redact, ...(options.launchArgs === undefined ? {} : { launchArgs: options.launchArgs }) });
|
|
33
|
+
const cleanup = {};
|
|
34
|
+
client.onExit((_code, reason) => { if (reason !== undefined) {
|
|
35
|
+
cleanup.reason = reason;
|
|
36
|
+
} });
|
|
33
37
|
try {
|
|
34
38
|
await client.request("initialize", {
|
|
35
39
|
clientInfo: { name: "oar", version: "0.0.0" },
|
|
@@ -124,9 +128,7 @@ export const codexSession = withSessionCredentials(async (installation, options,
|
|
|
124
128
|
settingsWaiter?.(params);
|
|
125
129
|
}
|
|
126
130
|
};
|
|
127
|
-
// Approvals, user input
|
|
128
|
-
// (approvalPolicy never means none are expected; a dangling request is
|
|
129
|
-
// the honest record when one arrives anyway).
|
|
131
|
+
// Approvals, user input and dynamic tools remain verbatim unanswered requests.
|
|
130
132
|
const onServerRequest = (id, method, params) => {
|
|
131
133
|
kernel.request("toApp", { kind: "native", type: method, native: params }, { id });
|
|
132
134
|
};
|
|
@@ -134,11 +136,11 @@ export const codexSession = withSessionCredentials(async (installation, options,
|
|
|
134
136
|
// from before the thread existed, then the open event (the mark placed at
|
|
135
137
|
// the reply), then whatever codex wrote after the reply.
|
|
136
138
|
client.handle({ onNotification, onServerRequest });
|
|
137
|
-
client.onExit((code) => {
|
|
139
|
+
client.onExit((code, reason) => {
|
|
138
140
|
abortFallback.clear();
|
|
139
141
|
// The exit is an outcome only oar observes: it answers our dispose when
|
|
140
142
|
// we caused it, and stands alone when the app-server died on its own.
|
|
141
|
-
kernel.respond(disposeRequest?.id ?? "", { kind: "exited", code });
|
|
143
|
+
kernel.respond(disposeRequest?.id ?? "", { kind: "exited", code, ...(reason === undefined ? {} : { reason }) });
|
|
142
144
|
state.active = null;
|
|
143
145
|
state.spontaneous = false;
|
|
144
146
|
state.codexTurnId = null;
|
|
@@ -276,11 +278,10 @@ export const codexSession = withSessionCredentials(async (installation, options,
|
|
|
276
278
|
return session;
|
|
277
279
|
}
|
|
278
280
|
catch (error) {
|
|
279
|
-
//
|
|
280
|
-
// Release it before rejecting, including on an already initialized home.
|
|
281
|
+
// No Session can dispose a failed open; wait for its process before rejecting.
|
|
281
282
|
client.kill();
|
|
282
283
|
await client.exited;
|
|
283
|
-
throw error;
|
|
284
|
+
throw appendCleanupFailure(error, cleanup.reason);
|
|
284
285
|
}
|
|
285
286
|
});
|
|
286
287
|
//# sourceMappingURL=session.js.map
|