@opencode/client 2.0.22 → 2.0.24
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/dist/chunks/{service-contender-1tbj6z39.js → pty-handoff-1y4a697q.js} +1 -1
- package/dist/chunks/{service-contender-mxz277s4.js → pty-handoff-5yf5aaev.js} +12 -10
- package/dist/chunks/{service-contender-1kn39gq3.js → pty-handoff-71wkqa80.js} +14 -21
- package/dist/chunks/{service-contender-y2etg5bs.js → pty-handoff-7f0py9js.js} +2 -2
- package/dist/chunks/pty-handoff-ank0d71z.js +75 -0
- package/dist/chunks/pty-handoff-cqfz2qxq.js +30 -0
- package/dist/chunks/{service-contender-frbwqjmf.js → pty-handoff-frbwqjmf.js} +1 -1
- package/dist/chunks/{service-contender-nwcpakzx.js → pty-handoff-js54wxgp.js} +2 -2
- package/dist/chunks/{service-contender-krgmp8b6.js → pty-handoff-myyn5x39.js} +17 -17
- package/dist/chunks/{service-contender-50fct660.js → pty-handoff-qzsnm4q8.js} +77 -63
- package/dist/chunks/{service-contender-h11j9btw.js → pty-handoff-src6by76.js} +10 -1
- package/dist/chunks/{service-contender-t1xa31vm.js → pty-handoff-t1xa31vm.js} +1 -1
- package/dist/chunks/{service-contender-txckps9j.js → pty-handoff-ve4aws36.js} +48 -2
- package/dist/chunks/{service-contender-4tveyqeh.js → pty-handoff-vt9jbch8.js} +4 -2
- package/dist/chunks/{service-contender-z6qdwcsf.js → pty-handoff-w1w809zr.js} +5 -5
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +12 -0
- package/dist/effect/client.d.ts +93 -92
- package/dist/effect/client.js +12 -12
- package/dist/effect/generated/client-error.js +3 -3
- package/dist/effect/generated/client.d.ts +93 -92
- package/dist/effect/generated/client.js +5 -5
- package/dist/effect/generated/index.js +8 -8
- package/dist/effect/index.js +12 -12
- package/dist/effect/rpc.js +4 -4
- package/dist/effect/service.d.ts +5 -7
- package/dist/effect/service.js +44 -115
- package/dist/promise/client.d.ts +1 -0
- package/dist/promise/client.js +11 -11
- package/dist/promise/generated/client-error.js +3 -3
- package/dist/promise/generated/client.d.ts +2 -1
- package/dist/promise/generated/client.js +4 -4
- package/dist/promise/generated/index.js +13 -9
- package/dist/promise/generated/types.d.ts +33 -0
- package/dist/promise/generated/types.js +6 -2
- package/dist/promise/index.js +17 -13
- package/dist/promise/rpc.js +2 -2
- package/dist/promise/service.d.ts +2 -4
- package/dist/promise/service.js +41 -115
- package/dist/pty-handoff.d.ts +4 -1
- package/dist/pty-handoff.js +1 -1
- package/dist/rpc-runtime.js +1 -1
- package/dist/service-contender.d.ts +27 -1
- package/dist/service-contender.js +3 -3
- package/dist/service-probe.d.ts +53 -0
- package/dist/service-probe.js +13 -0
- package/dist/service-timing.js +1 -1
- package/dist/service-version.js +1 -1
- package/dist/service.js +1 -1
- package/dist/shared-events.js +1 -1
- package/dist/solid/connection.js +1 -1
- package/dist/solid/data.d.ts +3 -0
- package/dist/solid/data.js +9 -9
- package/dist/solid/index.js +11 -11
- package/dist/solid/pty.js +1 -1
- package/package.json +4 -4
- package/dist/chunks/service-contender-992ffpa9.js +0 -30
- /package/dist/chunks/{service-contender-6mptkzbc.js → pty-handoff-6mptkzbc.js} +0 -0
- /package/dist/chunks/{service-contender-9rqn6x4v.js → pty-handoff-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{service-contender-gne7h7mq.js → pty-handoff-gne7h7mq.js} +0 -0
- /package/dist/chunks/{service-contender-m2eywc8w.js → pty-handoff-m2eywc8w.js} +0 -0
- /package/dist/chunks/{service-contender-qav6mfdz.js → pty-handoff-qav6mfdz.js} +0 -0
- /package/dist/chunks/{service-contender-sxt88q69.js → pty-handoff-sxt88q69.js} +0 -0
- /package/dist/chunks/{service-contender-vmytr4q8.js → pty-handoff-vmytr4q8.js} +0 -0
- /package/dist/chunks/{service-contender-vyas3vgt.js → pty-handoff-vyas3vgt.js} +0 -0
- /package/dist/chunks/{service-contender-xgnj2w4v.js → pty-handoff-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{service-contender-ydhz1zrh.js → pty-handoff-ydhz1zrh.js} +0 -0
package/dist/promise/service.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
spawnServiceContender2,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "../chunks/service-contender-txckps9j.js";
|
|
3
|
+
contenderPool2
|
|
4
|
+
} from "../chunks/pty-handoff-ve4aws36.js";
|
|
6
5
|
import {
|
|
7
6
|
defaultEnsureTiming2,
|
|
8
7
|
ensureTiming2
|
|
9
|
-
} from "../chunks/
|
|
8
|
+
} from "../chunks/pty-handoff-xgnj2w4v.js";
|
|
10
9
|
import {
|
|
11
10
|
matchesVersion2
|
|
12
|
-
} from "../chunks/
|
|
11
|
+
} from "../chunks/pty-handoff-sxt88q69.js";
|
|
13
12
|
import {
|
|
14
13
|
prepare2,
|
|
15
14
|
environment2,
|
|
16
15
|
complete2,
|
|
17
16
|
clear2
|
|
18
|
-
} from "../chunks/
|
|
19
|
-
import
|
|
17
|
+
} from "../chunks/pty-handoff-71wkqa80.js";
|
|
18
|
+
import {
|
|
19
|
+
fallback2,
|
|
20
|
+
same2,
|
|
21
|
+
probeResult2,
|
|
22
|
+
headers2
|
|
23
|
+
} from "../chunks/pty-handoff-ank0d71z.js";
|
|
24
|
+
import"../chunks/pty-handoff-qav6mfdz.js";
|
|
20
25
|
|
|
21
26
|
// src/promise/service.ts
|
|
22
27
|
import { readFile, rm } from "node:fs/promises";
|
|
23
|
-
import { homedir } from "node:os";
|
|
24
|
-
import { join } from "node:path";
|
|
25
28
|
async function discover(options = {}) {
|
|
26
29
|
const found = (await registered(options.file)).service;
|
|
27
30
|
if (found?.state !== "ready")
|
|
@@ -35,11 +38,9 @@ async function discover(options = {}) {
|
|
|
35
38
|
async function ensure(options = {}) {
|
|
36
39
|
const timing = ensureTiming2(options);
|
|
37
40
|
const deadline = Date.now() + timing.promiseTimeout;
|
|
38
|
-
const
|
|
41
|
+
const pool = contenderPool2(timing);
|
|
39
42
|
let timeouts;
|
|
40
43
|
let announced = false;
|
|
41
|
-
let lastSpawn = 0;
|
|
42
|
-
let spawnDelay = timing.spawnDelay;
|
|
43
44
|
const announce = (reason, previousVersion) => {
|
|
44
45
|
if (announced)
|
|
45
46
|
return;
|
|
@@ -51,7 +52,7 @@ async function ensure(options = {}) {
|
|
|
51
52
|
if (command === undefined)
|
|
52
53
|
throw new Error("Missing service command");
|
|
53
54
|
try {
|
|
54
|
-
return spawnServiceContender2(command, args, await environment2(options.file ??
|
|
55
|
+
return spawnServiceContender2(command, args, await environment2(options.file ?? fallback2(), options.env));
|
|
55
56
|
} catch (cause) {
|
|
56
57
|
throw new Error("Failed to start server", { cause });
|
|
57
58
|
}
|
|
@@ -59,29 +60,33 @@ async function ensure(options = {}) {
|
|
|
59
60
|
try {
|
|
60
61
|
while (true) {
|
|
61
62
|
if (Date.now() >= deadline)
|
|
62
|
-
throw new Error("Timed out waiting for the background service to start");
|
|
63
|
+
throw pool.failure() ?? new Error("Timed out waiting for the background service to start");
|
|
63
64
|
const registration = await registered(options.file, timing.requestTimeout);
|
|
64
65
|
if (registration.timedOut && registration.info !== undefined) {
|
|
65
66
|
timeouts = {
|
|
66
67
|
info: registration.info,
|
|
67
|
-
count: timeouts !== undefined &&
|
|
68
|
+
count: timeouts !== undefined && same2(timeouts.info, registration.info) ? timeouts.count + 1 : 1
|
|
68
69
|
};
|
|
69
70
|
if (timeouts.count >= 3) {
|
|
70
71
|
announce("missing");
|
|
71
72
|
console.warn("Background service is unresponsive; recovery cannot preserve persistent terminals");
|
|
72
|
-
await clear2(options.file ??
|
|
73
|
+
await clear2(options.file ?? fallback2());
|
|
73
74
|
await terminate(registration.info, options, timing);
|
|
75
|
+
pool.evict(registration.info.pid);
|
|
76
|
+
pool.recruitNow();
|
|
74
77
|
timeouts = undefined;
|
|
75
|
-
lastSpawn = Date.now() - spawnDelay;
|
|
76
78
|
}
|
|
77
79
|
} else
|
|
78
80
|
timeouts = undefined;
|
|
79
81
|
if (registration.service !== undefined) {
|
|
80
|
-
|
|
82
|
+
pool.serviceAnswered();
|
|
81
83
|
const service2 = registration.service;
|
|
82
|
-
const
|
|
84
|
+
const versionMatches = matchesVersion2(service2.version, options);
|
|
85
|
+
const compatible = service2.compatible && versionMatches;
|
|
86
|
+
if (!service2.compatible && versionMatches)
|
|
87
|
+
throw new Error("Background service uses an incompatible health protocol. Update this client or explicitly restart the service.");
|
|
83
88
|
if (compatible && service2.state === "ready") {
|
|
84
|
-
await complete2(options.file ??
|
|
89
|
+
await complete2(options.file ?? fallback2(), service2.info);
|
|
85
90
|
return service2.endpoint;
|
|
86
91
|
}
|
|
87
92
|
if (compatible && service2.state === "failed")
|
|
@@ -96,52 +101,31 @@ async function ensure(options = {}) {
|
|
|
96
101
|
}).catch(() => {
|
|
97
102
|
return;
|
|
98
103
|
});
|
|
99
|
-
|
|
104
|
+
pool.evict(service2.info.pid);
|
|
100
105
|
}
|
|
101
106
|
} else {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (finished.some((item) => item.child.exitCode === 0)) {
|
|
107
|
-
spawnDelay = Math.min(spawnDelay * 2, timing.maxSpawnDelay);
|
|
108
|
-
}
|
|
109
|
-
finished.forEach((item) => contenders.delete(item));
|
|
110
|
-
if (failure !== undefined && contenders.size === 0)
|
|
111
|
-
throw failure;
|
|
112
|
-
if (contenders.size < 2 && Date.now() - lastSpawn >= spawnDelay) {
|
|
107
|
+
const failed = pool.reap();
|
|
108
|
+
if (failed !== undefined)
|
|
109
|
+
throw failed;
|
|
110
|
+
if (pool.shouldRecruit(registration.info !== undefined)) {
|
|
113
111
|
announce("missing");
|
|
114
|
-
|
|
115
|
-
lastSpawn = Date.now();
|
|
112
|
+
pool.add(await spawnContender());
|
|
116
113
|
}
|
|
117
114
|
}
|
|
118
115
|
await delay(timing.pollInterval);
|
|
119
116
|
}
|
|
120
117
|
} finally {
|
|
121
|
-
|
|
118
|
+
pool.releaseAll();
|
|
122
119
|
}
|
|
123
120
|
}
|
|
124
121
|
async function stop(options = {}) {
|
|
125
122
|
const info = await read(options.file);
|
|
126
|
-
|
|
127
|
-
await prepare2(options.file ?? fallback(), info, defaultEnsureTiming2.requestTimeout);
|
|
128
|
-
else
|
|
129
|
-
await clear2(options.file ?? fallback());
|
|
123
|
+
await (options.pty === "handoff" && info !== undefined ? prepare2(options.file ?? fallback2(), info, defaultEnsureTiming2.requestTimeout) : clear2(options.file ?? fallback2())).catch((cause) => console.warn("Failed to prepare persistent terminals for replacement", cause));
|
|
130
124
|
if (info !== undefined)
|
|
131
|
-
await terminate(info, options,
|
|
132
|
-
}
|
|
133
|
-
function fallback() {
|
|
134
|
-
return join(process.env["XDG_STATE_HOME"] ?? join(homedir(), ".local", "state"), "opencode", "service.json");
|
|
135
|
-
}
|
|
136
|
-
function headers(endpoint) {
|
|
137
|
-
if (endpoint.auth === undefined)
|
|
138
|
-
return;
|
|
139
|
-
return {
|
|
140
|
-
authorization: "Basic " + Buffer.from(endpoint.auth.username + ":" + endpoint.auth.password).toString("base64")
|
|
141
|
-
};
|
|
125
|
+
await terminate(info, options, ensureTiming2(options));
|
|
142
126
|
}
|
|
143
127
|
async function read(file) {
|
|
144
|
-
const text = await readFile(file ??
|
|
128
|
+
const text = await readFile(file ?? fallback2(), "utf8").catch(() => {
|
|
145
129
|
return;
|
|
146
130
|
});
|
|
147
131
|
if (text === undefined)
|
|
@@ -152,63 +136,11 @@ async function read(file) {
|
|
|
152
136
|
return;
|
|
153
137
|
}
|
|
154
138
|
}
|
|
155
|
-
async function probeResult(info, timeout = defaultEnsureTiming2.requestTimeout) {
|
|
156
|
-
const endpoint = {
|
|
157
|
-
url: info.url,
|
|
158
|
-
auth: info.password === undefined ? undefined : { type: "basic", username: "opencode", password: info.password }
|
|
159
|
-
};
|
|
160
|
-
const signal = AbortSignal.timeout(timeout);
|
|
161
|
-
const result = await fetch(new URL("/api/info", info.url), { headers: headers(endpoint), signal }).then(async (response) => ({
|
|
162
|
-
response,
|
|
163
|
-
body: response.status === 404 ? undefined : await response.json()
|
|
164
|
-
})).then((value) => ({ value }), (cause) => ({ cause }));
|
|
165
|
-
if ("cause" in result)
|
|
166
|
-
return { service: undefined, timedOut: signal.aborted };
|
|
167
|
-
const response = result.value.response;
|
|
168
|
-
if (response.status === 404)
|
|
169
|
-
return {
|
|
170
|
-
service: {
|
|
171
|
-
info,
|
|
172
|
-
endpoint,
|
|
173
|
-
version: info.version,
|
|
174
|
-
state: "ready",
|
|
175
|
-
compatible: false
|
|
176
|
-
},
|
|
177
|
-
timedOut: false
|
|
178
|
-
};
|
|
179
|
-
const serverInfo = decodeInfo(result.value.body);
|
|
180
|
-
if (serverInfo !== undefined) {
|
|
181
|
-
if (serverInfo.pid !== info.pid)
|
|
182
|
-
return { service: undefined, timedOut: false };
|
|
183
|
-
if (info.version !== undefined && serverInfo.version !== info.version)
|
|
184
|
-
return { service: undefined, timedOut: false };
|
|
185
|
-
return {
|
|
186
|
-
service: {
|
|
187
|
-
info,
|
|
188
|
-
endpoint,
|
|
189
|
-
version: serverInfo.version,
|
|
190
|
-
state: response.ok ? "ready" : response.status === 500 ? "failed" : "waiting",
|
|
191
|
-
compatible: true
|
|
192
|
-
},
|
|
193
|
-
timedOut: false
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
return { service: undefined, timedOut: false };
|
|
197
|
-
}
|
|
198
|
-
function decodeInfo(input) {
|
|
199
|
-
if (typeof input !== "object" || input === null)
|
|
200
|
-
return;
|
|
201
|
-
if (!("version" in input) || typeof input.version !== "string")
|
|
202
|
-
return;
|
|
203
|
-
if (!("pid" in input) || typeof input.pid !== "number" || !Number.isInteger(input.pid) || input.pid < 0)
|
|
204
|
-
return;
|
|
205
|
-
return { version: input.version, pid: input.pid };
|
|
206
|
-
}
|
|
207
139
|
async function registered(file, timeout) {
|
|
208
140
|
const info = await read(file);
|
|
209
141
|
if (info === undefined)
|
|
210
142
|
return { info: undefined, service: undefined, timedOut: false };
|
|
211
|
-
return { info, ...await
|
|
143
|
+
return { info, ...await probeResult2(info, timeout) };
|
|
212
144
|
}
|
|
213
145
|
function signal(pid, name) {
|
|
214
146
|
try {
|
|
@@ -232,35 +164,29 @@ async function waitUntilStopped(pid, timing) {
|
|
|
232
164
|
}
|
|
233
165
|
return false;
|
|
234
166
|
}
|
|
235
|
-
function same(left, right) {
|
|
236
|
-
return left.id === right.id && left.version === right.version && left.url === right.url && left.pid === right.pid;
|
|
237
|
-
}
|
|
238
167
|
async function terminate(info, options, timing) {
|
|
239
168
|
const current = await read(options.file);
|
|
240
|
-
if (current === undefined || !
|
|
169
|
+
if (current === undefined || !same2(current, info))
|
|
241
170
|
return;
|
|
242
171
|
signal(info.pid, "SIGTERM");
|
|
243
172
|
if (!await waitUntilStopped(info.pid, timing)) {
|
|
244
|
-
const latest = await read(options.file);
|
|
245
|
-
if (latest === undefined || !same(latest, info))
|
|
246
|
-
return;
|
|
247
173
|
signal(info.pid, "SIGKILL");
|
|
248
174
|
if (!await waitUntilStopped(info.pid, timing))
|
|
249
175
|
throw new Error(`Server process ${info.pid} is still running`);
|
|
250
176
|
}
|
|
251
177
|
const latest = await read(options.file);
|
|
252
|
-
if (latest === undefined || !
|
|
178
|
+
if (latest === undefined || !same2(latest, info))
|
|
253
179
|
return;
|
|
254
|
-
await rm(options.file ??
|
|
180
|
+
await rm(options.file ?? fallback2(), { force: true });
|
|
255
181
|
}
|
|
256
182
|
function delay(milliseconds) {
|
|
257
183
|
return new Promise((resolve) => setTimeout(resolve, milliseconds));
|
|
258
184
|
}
|
|
259
|
-
var Service = { discover, ensure, stop, headers };
|
|
185
|
+
var Service = { discover, ensure, stop, headers: headers2 };
|
|
260
186
|
export {
|
|
261
187
|
Service,
|
|
262
188
|
discover,
|
|
263
189
|
ensure,
|
|
264
|
-
headers,
|
|
190
|
+
headers2 as headers,
|
|
265
191
|
stop
|
|
266
192
|
};
|
package/dist/pty-handoff.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * as PtyHandoff from "./pty-handoff.js";
|
|
2
2
|
import type { Info } from "./service.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Publish the ticket before stopping its owner so every replacement contender can adopt it.
|
|
5
|
+
* Never throws: terminals are best-effort, so any failure replaces the service without a handoff.
|
|
6
|
+
*/
|
|
4
7
|
export declare function prepare(file: string, info: Info, timeout: number): Promise<void>;
|
|
5
8
|
export declare function environment(file: string, env?: Readonly<Record<string, string>>): Promise<{
|
|
6
9
|
OPENCODE_PTY_HANDOFF: string | undefined;
|
package/dist/pty-handoff.js
CHANGED
package/dist/rpc-runtime.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ChildProcess } from "node:child_process";
|
|
2
|
+
import type { EnsureTiming } from "./service-timing.js";
|
|
2
3
|
export type ServiceContender = {
|
|
3
4
|
readonly child: ChildProcess;
|
|
4
5
|
readonly error: () => Error | undefined;
|
|
@@ -7,5 +8,30 @@ export type ServiceContender = {
|
|
|
7
8
|
readonly release: () => void;
|
|
8
9
|
};
|
|
9
10
|
export declare function spawnServiceContender(command: string, args: ReadonlyArray<string>, env?: Readonly<Record<string, string | undefined>>): ServiceContender;
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The startup attempts of one `ensure()` call. It keeps at most two attempts alive, remembers
|
|
13
|
+
* the first startup failure, and backs off when attempts exit cleanly because another one won.
|
|
14
|
+
*/
|
|
15
|
+
export declare function contenderPool(timing: EnsureTiming): {
|
|
16
|
+
/** The first startup failure seen since the last eviction. */
|
|
17
|
+
failure: () => Error | undefined;
|
|
18
|
+
/** A registered service answered, so the next attempt waits the base delay again. */
|
|
19
|
+
serviceAnswered(): void;
|
|
20
|
+
/**
|
|
21
|
+
* The owner `pid` was replaced. Drop its attempt and any finished ones, forget their
|
|
22
|
+
* failure, and restart the spawn clock.
|
|
23
|
+
*/
|
|
24
|
+
evict(pid: number): void;
|
|
25
|
+
/** Let the next attempt start without waiting a spawn delay. */
|
|
26
|
+
recruitNow(): void;
|
|
27
|
+
/** Collect finished attempts. Returns the startup failure once no attempt is left alive. */
|
|
28
|
+
reap(): Error | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to start another attempt now. A registration that has not answered yet gets one
|
|
31
|
+
* spawn delay before an attempt competes with it.
|
|
32
|
+
*/
|
|
33
|
+
shouldRecruit(registered: boolean): boolean;
|
|
34
|
+
add(contender: ServiceContender): void;
|
|
35
|
+
releaseAll(): void;
|
|
36
|
+
};
|
|
11
37
|
export declare function contenderFinished(contender: ServiceContender): boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
spawnServiceContender2,
|
|
3
|
-
|
|
3
|
+
contenderPool2,
|
|
4
4
|
contenderFinished2
|
|
5
|
-
} from "./chunks/
|
|
5
|
+
} from "./chunks/pty-handoff-ve4aws36.js";
|
|
6
6
|
export {
|
|
7
|
-
contenderFailure2 as contenderFailure,
|
|
8
7
|
contenderFinished2 as contenderFinished,
|
|
8
|
+
contenderPool2 as contenderPool,
|
|
9
9
|
spawnServiceContender2 as spawnServiceContender
|
|
10
10
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Endpoint, Info } from "./service.js";
|
|
2
|
+
export type LocalService = {
|
|
3
|
+
readonly info: Info;
|
|
4
|
+
readonly endpoint: Endpoint;
|
|
5
|
+
readonly version?: string;
|
|
6
|
+
readonly state: "ready" | "waiting" | "failed";
|
|
7
|
+
readonly compatible: boolean;
|
|
8
|
+
};
|
|
9
|
+
/** The default registration file. */
|
|
10
|
+
export declare function fallback(): string;
|
|
11
|
+
/** Whether two registrations describe the same service instance. */
|
|
12
|
+
export declare function same(left: Info, right: Info): boolean;
|
|
13
|
+
/** Ask a registered owner for its health and classify the answer. */
|
|
14
|
+
export declare function probeResult(info: Info, timeout?: number): Promise<{
|
|
15
|
+
service: undefined;
|
|
16
|
+
timedOut: boolean;
|
|
17
|
+
} | {
|
|
18
|
+
service: {
|
|
19
|
+
info: Info;
|
|
20
|
+
endpoint: {
|
|
21
|
+
url: string;
|
|
22
|
+
auth: {
|
|
23
|
+
type: "basic";
|
|
24
|
+
username: string;
|
|
25
|
+
password: string;
|
|
26
|
+
} | undefined;
|
|
27
|
+
};
|
|
28
|
+
version: string | undefined;
|
|
29
|
+
state: "ready";
|
|
30
|
+
compatible: false;
|
|
31
|
+
};
|
|
32
|
+
timedOut: boolean;
|
|
33
|
+
} | {
|
|
34
|
+
service: {
|
|
35
|
+
info: Info;
|
|
36
|
+
endpoint: {
|
|
37
|
+
url: string;
|
|
38
|
+
auth: {
|
|
39
|
+
type: "basic";
|
|
40
|
+
username: string;
|
|
41
|
+
password: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
};
|
|
44
|
+
version: string;
|
|
45
|
+
state: "failed" | "ready" | "waiting";
|
|
46
|
+
compatible: true;
|
|
47
|
+
};
|
|
48
|
+
timedOut: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
/** Create HTTP authentication headers for a service endpoint. */
|
|
51
|
+
export declare function headers(endpoint: Endpoint): {
|
|
52
|
+
authorization: string;
|
|
53
|
+
} | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fallback2,
|
|
3
|
+
same2,
|
|
4
|
+
probeResult2,
|
|
5
|
+
headers2
|
|
6
|
+
} from "./chunks/pty-handoff-ank0d71z.js";
|
|
7
|
+
import"./chunks/pty-handoff-xgnj2w4v.js";
|
|
8
|
+
export {
|
|
9
|
+
fallback2 as fallback,
|
|
10
|
+
headers2 as headers,
|
|
11
|
+
probeResult2 as probeResult,
|
|
12
|
+
same2 as same
|
|
13
|
+
};
|
package/dist/service-timing.js
CHANGED
package/dist/service-version.js
CHANGED
package/dist/service.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunks/
|
|
1
|
+
import"./chunks/pty-handoff-qav6mfdz.js";
|
package/dist/shared-events.js
CHANGED
package/dist/solid/connection.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
defaultIdleTimeout2,
|
|
3
3
|
foregroundIdleThreshold2,
|
|
4
4
|
createClientConnection2
|
|
5
|
-
} from "../chunks/
|
|
5
|
+
} from "../chunks/pty-handoff-ydhz1zrh.js";
|
|
6
6
|
export {
|
|
7
7
|
createClientConnection2 as createClientConnection,
|
|
8
8
|
defaultIdleTimeout2 as defaultIdleTimeout,
|
package/dist/solid/data.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export declare function createData(config: CreateDataInput): {
|
|
|
50
50
|
evict(sessionID: string): void;
|
|
51
51
|
cost(sessionID: string): number;
|
|
52
52
|
status(sessionID: string): DataSessionStatus;
|
|
53
|
+
active(): string[];
|
|
53
54
|
input: {
|
|
54
55
|
list(sessionID: string): string[];
|
|
55
56
|
has(sessionID: string, inboxID: string): boolean;
|
|
@@ -98,12 +99,14 @@ export declare function createData(config: CreateDataInput): {
|
|
|
98
99
|
};
|
|
99
100
|
permission: {
|
|
100
101
|
list(sessionID: string): PermissionRequest[];
|
|
102
|
+
sessions(): string[];
|
|
101
103
|
sync(sessionID: string): Promise<void>;
|
|
102
104
|
invalidate(sessionID: string): void;
|
|
103
105
|
reply(input: PermissionReplyInput): Promise<void>;
|
|
104
106
|
};
|
|
105
107
|
form: {
|
|
106
108
|
list(sessionID: string, ref?: LocationRef): FormWithLocation[] | undefined;
|
|
109
|
+
sessions(): string[];
|
|
107
110
|
sync(sessionID: string, ref?: LocationRef): Promise<void>;
|
|
108
111
|
invalidate(sessionID: string, ref?: LocationRef): void;
|
|
109
112
|
reply(input: SessionFormReplyInput, ref?: LocationRef): Promise<void>;
|
package/dist/solid/data.js
CHANGED
|
@@ -2,15 +2,15 @@ import {
|
|
|
2
2
|
settleMs2,
|
|
3
3
|
locationKey2,
|
|
4
4
|
createData2
|
|
5
|
-
} from "../chunks/
|
|
6
|
-
import"../chunks/
|
|
7
|
-
import"../chunks/
|
|
8
|
-
import"../chunks/
|
|
9
|
-
import"../chunks/
|
|
10
|
-
import"../chunks/
|
|
11
|
-
import"../chunks/
|
|
12
|
-
import"../chunks/
|
|
13
|
-
import"../chunks/
|
|
5
|
+
} from "../chunks/pty-handoff-src6by76.js";
|
|
6
|
+
import"../chunks/pty-handoff-m2eywc8w.js";
|
|
7
|
+
import"../chunks/pty-handoff-cqfz2qxq.js";
|
|
8
|
+
import"../chunks/pty-handoff-vyas3vgt.js";
|
|
9
|
+
import"../chunks/pty-handoff-qzsnm4q8.js";
|
|
10
|
+
import"../chunks/pty-handoff-js54wxgp.js";
|
|
11
|
+
import"../chunks/pty-handoff-1y4a697q.js";
|
|
12
|
+
import"../chunks/pty-handoff-vt9jbch8.js";
|
|
13
|
+
import"../chunks/pty-handoff-frbwqjmf.js";
|
|
14
14
|
export {
|
|
15
15
|
createData2 as createData,
|
|
16
16
|
locationKey2 as locationKey,
|
package/dist/solid/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import"../chunks/
|
|
2
|
-
import"../chunks/
|
|
3
|
-
import"../chunks/
|
|
4
|
-
import"../chunks/
|
|
5
|
-
import"../chunks/
|
|
6
|
-
import"../chunks/
|
|
7
|
-
import"../chunks/
|
|
8
|
-
import"../chunks/
|
|
1
|
+
import"../chunks/pty-handoff-js54wxgp.js";
|
|
2
|
+
import"../chunks/pty-handoff-qzsnm4q8.js";
|
|
3
|
+
import"../chunks/pty-handoff-vt9jbch8.js";
|
|
4
|
+
import"../chunks/pty-handoff-vyas3vgt.js";
|
|
5
|
+
import"../chunks/pty-handoff-frbwqjmf.js";
|
|
6
|
+
import"../chunks/pty-handoff-1y4a697q.js";
|
|
7
|
+
import"../chunks/pty-handoff-cqfz2qxq.js";
|
|
8
|
+
import"../chunks/pty-handoff-m2eywc8w.js";
|
|
9
9
|
import {
|
|
10
10
|
settleMs2,
|
|
11
11
|
locationKey2,
|
|
12
12
|
createData2
|
|
13
|
-
} from "../chunks/
|
|
13
|
+
} from "../chunks/pty-handoff-src6by76.js";
|
|
14
14
|
import {
|
|
15
15
|
defaultIdleTimeout2,
|
|
16
16
|
foregroundIdleThreshold2,
|
|
17
17
|
createClientConnection2
|
|
18
|
-
} from "../chunks/
|
|
18
|
+
} from "../chunks/pty-handoff-ydhz1zrh.js";
|
|
19
19
|
import {
|
|
20
20
|
createPtyClient2,
|
|
21
21
|
createPersistentPtyClient2
|
|
22
|
-
} from "../chunks/
|
|
22
|
+
} from "../chunks/pty-handoff-gne7h7mq.js";
|
|
23
23
|
export {
|
|
24
24
|
createClientConnection2 as createClientConnection,
|
|
25
25
|
createData2 as createData,
|
package/dist/solid/pty.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/client",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.24",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"typecheck": "tsgo --noEmit"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@opencode/schema": "2.0.
|
|
61
|
-
"@opencode/protocol": "2.0.
|
|
60
|
+
"@opencode/schema": "2.0.24",
|
|
61
|
+
"@opencode/protocol": "2.0.24"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"effect": "4.0.0-rc.112",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
77
|
-
"@opencode/httpapi-codegen": "2.0.
|
|
77
|
+
"@opencode/httpapi-codegen": "2.0.24",
|
|
78
78
|
"@tsconfig/bun": "1.0.9",
|
|
79
79
|
"@types/bun": "1.4.0",
|
|
80
80
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
make7
|
|
3
|
-
} from "./service-contender-frbwqjmf.js";
|
|
4
|
-
import {
|
|
5
|
-
make6
|
|
6
|
-
} from "./service-contender-50fct660.js";
|
|
7
|
-
import {
|
|
8
|
-
makeRpc2
|
|
9
|
-
} from "./service-contender-1tbj6z39.js";
|
|
10
|
-
import {
|
|
11
|
-
__export
|
|
12
|
-
} from "./service-contender-9rqn6x4v.js";
|
|
13
|
-
|
|
14
|
-
// src/promise/client.ts
|
|
15
|
-
var exports_client3 = {};
|
|
16
|
-
__export(exports_client3, {
|
|
17
|
-
OpenCode: () => exports_client3,
|
|
18
|
-
make: () => make5
|
|
19
|
-
});
|
|
20
|
-
function make5(options) {
|
|
21
|
-
const raw = make6(options);
|
|
22
|
-
const events = make7((signal, onActivity) => raw.event.subscribe({ signal, onActivity }));
|
|
23
|
-
return {
|
|
24
|
-
...raw,
|
|
25
|
-
rpc: Object.assign(makeRpc2(raw, events), raw.rpc),
|
|
26
|
-
event: events
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { make5, exports_client3 };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|