@opencode/client 2.0.23 → 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-version-1y4a697q.js → pty-handoff-1y4a697q.js} +1 -1
- package/dist/chunks/{service-version-7yt87z36.js → pty-handoff-5yf5aaev.js} +10 -10
- package/dist/chunks/{service-version-02j88w0z.js → pty-handoff-71wkqa80.js} +1 -1
- package/dist/chunks/{service-version-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-version-frbwqjmf.js → pty-handoff-frbwqjmf.js} +1 -1
- package/dist/chunks/{service-version-nwcpakzx.js → pty-handoff-js54wxgp.js} +2 -2
- package/dist/chunks/{service-version-21favj1f.js → pty-handoff-myyn5x39.js} +17 -17
- package/dist/chunks/{service-version-nyqggzs9.js → pty-handoff-qzsnm4q8.js} +19 -19
- package/dist/chunks/{service-version-e5ea35j7.js → pty-handoff-src6by76.js} +10 -1
- package/dist/chunks/{service-version-t1xa31vm.js → pty-handoff-t1xa31vm.js} +1 -1
- package/dist/chunks/{service-version-6f43cgzz.js → pty-handoff-ve4aws36.js} +47 -2
- package/dist/chunks/{service-version-z6qdwcsf.js → pty-handoff-w1w809zr.js} +5 -5
- package/dist/contract.js +1 -1
- package/dist/effect/client.js +12 -12
- package/dist/effect/generated/client-error.js +3 -3
- 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 +39 -122
- package/dist/promise/client.js +11 -11
- package/dist/promise/generated/client-error.js +3 -3
- package/dist/promise/generated/client.js +4 -4
- package/dist/promise/generated/index.js +8 -8
- package/dist/promise/generated/types.js +1 -1
- package/dist/promise/index.js +12 -12
- package/dist/promise/rpc.js +2 -2
- package/dist/promise/service.d.ts +2 -4
- package/dist/promise/service.js +36 -122
- 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-version-gah0fg5v.js +0 -30
- /package/dist/chunks/{service-version-6mptkzbc.js → pty-handoff-6mptkzbc.js} +0 -0
- /package/dist/chunks/{service-version-9rqn6x4v.js → pty-handoff-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{service-version-gne7h7mq.js → pty-handoff-gne7h7mq.js} +0 -0
- /package/dist/chunks/{service-version-m2eywc8w.js → pty-handoff-m2eywc8w.js} +0 -0
- /package/dist/chunks/{service-version-qav6mfdz.js → pty-handoff-qav6mfdz.js} +0 -0
- /package/dist/chunks/{service-version-sxt88q69.js → pty-handoff-sxt88q69.js} +0 -0
- /package/dist/chunks/{service-version-vmytr4q8.js → pty-handoff-vmytr4q8.js} +0 -0
- /package/dist/chunks/{service-version-vt9jbch8.js → pty-handoff-vt9jbch8.js} +0 -0
- /package/dist/chunks/{service-version-vyas3vgt.js → pty-handoff-vyas3vgt.js} +0 -0
- /package/dist/chunks/{service-version-xgnj2w4v.js → pty-handoff-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{service-version-ydhz1zrh.js → pty-handoff-ydhz1zrh.js} +0 -0
package/dist/effect/rpc.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
make6,
|
|
3
3
|
aborted2,
|
|
4
4
|
exports_rpc
|
|
5
|
-
} from "../chunks/
|
|
6
|
-
import"../chunks/
|
|
5
|
+
} from "../chunks/pty-handoff-w1w809zr.js";
|
|
6
|
+
import"../chunks/pty-handoff-t1xa31vm.js";
|
|
7
7
|
export {
|
|
8
8
|
exports_rpc as RpcClientRuntime,
|
|
9
9
|
aborted2 as aborted,
|
|
10
|
-
|
|
10
|
+
make6 as make
|
|
11
11
|
};
|
package/dist/effect/service.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Effect, FileSystem, Schema } from "effect";
|
|
2
|
-
import type { DiscoverOptions,
|
|
2
|
+
import type { DiscoverOptions, EnsureOptions, StopOptions } from "../service.js";
|
|
3
|
+
import { headers } from "../service-probe.js";
|
|
3
4
|
export * from "../service.js";
|
|
5
|
+
export { headers };
|
|
4
6
|
/** Contents of the local service registration file. */
|
|
5
7
|
export type Info = import("../service.js").Info;
|
|
6
8
|
/** Discover a healthy, compatible local service without starting one. */
|
|
@@ -27,13 +29,9 @@ export declare const incumbent: (options: DiscoverOptions & {
|
|
|
27
29
|
state: "failed" | "ready" | "waiting";
|
|
28
30
|
} | undefined, never, FileSystem.FileSystem>;
|
|
29
31
|
/** Ensure a healthy, compatible local service is running. */
|
|
30
|
-
export declare const ensure: (options?: EnsureOptions | undefined) => Effect.Effect<Endpoint, Error, FileSystem.FileSystem>;
|
|
32
|
+
export declare const ensure: (options?: EnsureOptions | undefined) => Effect.Effect<import("./service.js").Endpoint, Error, FileSystem.FileSystem>;
|
|
31
33
|
/** Stop the registered local service. */
|
|
32
34
|
export declare const stop: (options?: StopOptions | undefined) => Effect.Effect<void, Error, FileSystem.FileSystem>;
|
|
33
|
-
/** Create HTTP authentication headers for a service endpoint. */
|
|
34
|
-
export declare function headers(endpoint: Endpoint): {
|
|
35
|
-
authorization: string;
|
|
36
|
-
} | undefined;
|
|
37
35
|
/** Schema for the local service registration file. */
|
|
38
36
|
export declare const Info: Schema.Struct<{
|
|
39
37
|
readonly id: Schema.optional<Schema.String>;
|
|
@@ -65,7 +63,7 @@ export declare const Service: {
|
|
|
65
63
|
};
|
|
66
64
|
state: "failed" | "ready" | "waiting";
|
|
67
65
|
} | undefined, never, FileSystem.FileSystem>;
|
|
68
|
-
ensure: (options?: EnsureOptions | undefined) => Effect.Effect<Endpoint, Error, FileSystem.FileSystem>;
|
|
66
|
+
ensure: (options?: EnsureOptions | undefined) => Effect.Effect<import("./service.js").Endpoint, Error, FileSystem.FileSystem>;
|
|
69
67
|
stop: (options?: StopOptions | undefined) => Effect.Effect<void, Error, FileSystem.FileSystem>;
|
|
70
68
|
headers: typeof headers;
|
|
71
69
|
Info: Schema.Struct<{
|
package/dist/effect/service.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
spawnServiceContender2,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "../chunks/service-version-6f43cgzz.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/effect/service.ts
|
|
22
27
|
import { Effect, FileSystem, Option, Schedule, Schema } from "effect";
|
|
23
|
-
import { homedir } from "node:os";
|
|
24
|
-
import { join } from "node:path";
|
|
25
28
|
var discover = Effect.fn("service.discover")(function* (options = {}) {
|
|
26
29
|
const found = (yield* registered(options.file)).service;
|
|
27
30
|
if (found?.state !== "ready")
|
|
@@ -34,10 +37,10 @@ var discover = Effect.fn("service.discover")(function* (options = {}) {
|
|
|
34
37
|
});
|
|
35
38
|
var incumbent = Effect.fn("service.incumbent")(function* (options) {
|
|
36
39
|
const info = yield* read(options.file);
|
|
37
|
-
|
|
38
|
-
if (found === undefined)
|
|
40
|
+
if (info === undefined)
|
|
39
41
|
return;
|
|
40
|
-
|
|
42
|
+
const found = (yield* Effect.promise(() => probeResult2({ ...info, url: options.url }))).service;
|
|
43
|
+
if (!found?.compatible)
|
|
41
44
|
return;
|
|
42
45
|
if (!matchesVersion2(found.version, options))
|
|
43
46
|
return;
|
|
@@ -45,12 +48,9 @@ var incumbent = Effect.fn("service.incumbent")(function* (options) {
|
|
|
45
48
|
});
|
|
46
49
|
var ensure = Effect.fn("service.ensure")(function* (options = {}) {
|
|
47
50
|
const timing = ensureTiming2(options);
|
|
48
|
-
const
|
|
51
|
+
const pool = contenderPool2(timing);
|
|
49
52
|
let timeouts;
|
|
50
53
|
let announced = false;
|
|
51
|
-
let lastSpawn = 0;
|
|
52
|
-
let spawnDelay = timing.spawnDelay;
|
|
53
|
-
let failure;
|
|
54
54
|
const announce = (reason, previousVersion) => Effect.sync(() => {
|
|
55
55
|
if (announced)
|
|
56
56
|
return;
|
|
@@ -61,7 +61,7 @@ var ensure = Effect.fn("service.ensure")(function* (options = {}) {
|
|
|
61
61
|
const [command, ...args] = options.command ?? ["opencode", "serve", "--service"];
|
|
62
62
|
if (command === undefined)
|
|
63
63
|
return yield* Effect.fail(new Error("Missing service command"));
|
|
64
|
-
const env = yield* Effect.tryPromise(() => environment2(options.file ??
|
|
64
|
+
const env = yield* Effect.tryPromise(() => environment2(options.file ?? fallback2(), options.env));
|
|
65
65
|
return yield* Effect.try({
|
|
66
66
|
try: () => {
|
|
67
67
|
return spawnServiceContender2(command, args, env);
|
|
@@ -76,33 +76,27 @@ var ensure = Effect.fn("service.ensure")(function* (options = {}) {
|
|
|
76
76
|
if (registration.timedOut && info !== undefined) {
|
|
77
77
|
timeouts = {
|
|
78
78
|
info,
|
|
79
|
-
count: timeouts !== undefined &&
|
|
79
|
+
count: timeouts !== undefined && same2(timeouts.info, info) ? timeouts.count + 1 : 1
|
|
80
80
|
};
|
|
81
81
|
if (timeouts.count >= 3) {
|
|
82
82
|
yield* announce("missing");
|
|
83
83
|
yield* Effect.logWarning("Background service is unresponsive; recovery cannot preserve persistent terminals");
|
|
84
|
-
yield* Effect.tryPromise(() => clear2(options.file ??
|
|
84
|
+
yield* Effect.tryPromise(() => clear2(options.file ?? fallback2()));
|
|
85
85
|
yield* terminate(info, options, timing);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
item.release();
|
|
89
|
-
contenders.delete(item);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
failure = undefined;
|
|
86
|
+
pool.evict(info.pid);
|
|
87
|
+
pool.recruitNow();
|
|
93
88
|
timeouts = undefined;
|
|
94
|
-
lastSpawn = Date.now() - spawnDelay;
|
|
95
89
|
}
|
|
96
90
|
} else
|
|
97
91
|
timeouts = undefined;
|
|
98
92
|
if (service2 !== undefined) {
|
|
99
|
-
|
|
93
|
+
pool.serviceAnswered();
|
|
100
94
|
const versionMatches = matchesVersion2(service2.version, options);
|
|
101
95
|
const compatible = service2.compatible && versionMatches;
|
|
102
96
|
if (!service2.compatible && versionMatches)
|
|
103
97
|
return yield* Effect.fail(new Error("Background service uses an incompatible health protocol. Update this client or explicitly restart the service."));
|
|
104
98
|
if (compatible && service2.state === "ready") {
|
|
105
|
-
yield* Effect.tryPromise(() => complete2(options.file ??
|
|
99
|
+
yield* Effect.tryPromise(() => complete2(options.file ?? fallback2(), service2.info));
|
|
106
100
|
return Option.some(service2);
|
|
107
101
|
}
|
|
108
102
|
if (compatible && service2.state === "failed")
|
|
@@ -116,54 +110,31 @@ var ensure = Effect.fn("service.ensure")(function* (options = {}) {
|
|
|
116
110
|
file: options.file,
|
|
117
111
|
pty: service2.state === "ready" ? "handoff" : "clear"
|
|
118
112
|
}).pipe(Effect.ignore);
|
|
119
|
-
|
|
120
|
-
if (item.child.pid === service2.info.pid || contenderFinished2(item)) {
|
|
121
|
-
item.release();
|
|
122
|
-
contenders.delete(item);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
failure = undefined;
|
|
126
|
-
lastSpawn = 0;
|
|
113
|
+
pool.evict(service2.info.pid);
|
|
127
114
|
return Option.none();
|
|
128
|
-
} else if (lastSpawn === 0 && info !== undefined)
|
|
129
|
-
lastSpawn = Date.now();
|
|
130
|
-
const finished = [...contenders].filter(contenderFinished2);
|
|
131
|
-
failure ??= finished.map(contenderFailure2).find((error) => error !== undefined);
|
|
132
|
-
if (finished.some((item) => item.child.exitCode === 0)) {
|
|
133
|
-
spawnDelay = Math.min(spawnDelay * 2, timing.maxSpawnDelay);
|
|
134
115
|
}
|
|
135
|
-
|
|
136
|
-
if (
|
|
137
|
-
return yield* Effect.fail(
|
|
138
|
-
if (
|
|
116
|
+
const failed = pool.reap();
|
|
117
|
+
if (failed !== undefined)
|
|
118
|
+
return yield* Effect.fail(failed);
|
|
119
|
+
if (pool.shouldRecruit(info !== undefined)) {
|
|
139
120
|
yield* announce("missing");
|
|
140
|
-
|
|
141
|
-
lastSpawn = Date.now();
|
|
121
|
+
pool.add(yield* spawnContender);
|
|
142
122
|
}
|
|
143
123
|
return Option.none();
|
|
144
124
|
}).pipe(Effect.repeat({
|
|
145
125
|
until: Option.isSome,
|
|
146
126
|
schedule: Schedule.spaced(timing.pollInterval).pipe(Schedule.upTo({ duration: timing.promiseTimeout }))
|
|
147
|
-
}), Effect.ensuring(Effect.sync(() =>
|
|
127
|
+
}), Effect.ensuring(Effect.sync(() => pool.releaseAll())));
|
|
148
128
|
if (Option.isNone(found))
|
|
149
|
-
return yield* Effect.fail(failure ?? new Error("Timed out waiting for the background service to start"));
|
|
129
|
+
return yield* Effect.fail(pool.failure() ?? new Error("Timed out waiting for the background service to start"));
|
|
150
130
|
return found.value.endpoint;
|
|
151
131
|
});
|
|
152
132
|
var stop = Effect.fn("service.stop")(function* (options = {}) {
|
|
153
133
|
const info = yield* read(options.file);
|
|
154
|
-
yield* Effect.tryPromise(() => options.pty === "handoff" && info !== undefined ? prepare2(options.file ??
|
|
134
|
+
yield* Effect.tryPromise(() => options.pty === "handoff" && info !== undefined ? prepare2(options.file ?? fallback2(), info, defaultEnsureTiming2.requestTimeout) : clear2(options.file ?? fallback2())).pipe(Effect.catch((cause) => Effect.logWarning("Failed to prepare persistent terminals for replacement", cause)));
|
|
155
135
|
if (info !== undefined)
|
|
156
136
|
yield* terminate(info, options, ensureTiming2(options));
|
|
157
137
|
});
|
|
158
|
-
function fallback() {
|
|
159
|
-
const state = process.env["XDG_STATE_HOME"] ?? join(homedir(), ".local", "state");
|
|
160
|
-
return join(state, "opencode", "service.json");
|
|
161
|
-
}
|
|
162
|
-
function headers(endpoint) {
|
|
163
|
-
if (endpoint.auth === undefined)
|
|
164
|
-
return;
|
|
165
|
-
return { authorization: "Basic " + btoa(endpoint.auth.username + ":" + endpoint.auth.password) };
|
|
166
|
-
}
|
|
167
138
|
var Info = Schema.Struct({
|
|
168
139
|
id: Schema.optional(Schema.String),
|
|
169
140
|
version: Schema.optional(Schema.String),
|
|
@@ -172,69 +143,18 @@ var Info = Schema.Struct({
|
|
|
172
143
|
password: Schema.optional(Schema.String)
|
|
173
144
|
});
|
|
174
145
|
var decode = Schema.decodeUnknownEffect(Schema.fromJsonString(Info));
|
|
175
|
-
var decodeInfo = Schema.decodeUnknownOption(Schema.Struct({
|
|
176
|
-
version: Schema.String,
|
|
177
|
-
pid: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))
|
|
178
|
-
}));
|
|
179
146
|
var read = Effect.fnUntraced(function* (file) {
|
|
180
147
|
const fs = yield* FileSystem.FileSystem;
|
|
181
|
-
const text = yield* fs.readFileString(file ??
|
|
148
|
+
const text = yield* fs.readFileString(file ?? fallback2()).pipe(Effect.option);
|
|
182
149
|
if (Option.isNone(text))
|
|
183
150
|
return;
|
|
184
151
|
return yield* decode(text.value).pipe(Effect.option, Effect.map(Option.getOrUndefined));
|
|
185
152
|
});
|
|
186
|
-
var probe = Effect.fnUntraced(function* (info) {
|
|
187
|
-
return (yield* probeResult(info)).service;
|
|
188
|
-
});
|
|
189
|
-
var probeResult = Effect.fnUntraced(function* (info, timeout = defaultEnsureTiming2.requestTimeout) {
|
|
190
|
-
const endpoint = {
|
|
191
|
-
url: info.url,
|
|
192
|
-
auth: info.password === undefined ? undefined : { type: "basic", username: "opencode", password: info.password }
|
|
193
|
-
};
|
|
194
|
-
const signal = AbortSignal.timeout(timeout);
|
|
195
|
-
const result = yield* Effect.promise(() => fetch(new URL("/api/info", info.url), { headers: headers(endpoint), signal }).then(async (response) => ({
|
|
196
|
-
response,
|
|
197
|
-
body: response.status === 404 ? undefined : await response.json()
|
|
198
|
-
})).then((value) => ({ value }), (cause) => ({ cause })));
|
|
199
|
-
if ("cause" in result)
|
|
200
|
-
return { service: undefined, timedOut: signal.aborted };
|
|
201
|
-
const response = result.value.response;
|
|
202
|
-
if (response.status === 404)
|
|
203
|
-
return {
|
|
204
|
-
service: {
|
|
205
|
-
info,
|
|
206
|
-
endpoint,
|
|
207
|
-
version: info.version,
|
|
208
|
-
state: "ready",
|
|
209
|
-
compatible: false
|
|
210
|
-
},
|
|
211
|
-
timedOut: false
|
|
212
|
-
};
|
|
213
|
-
const body = result.value.body;
|
|
214
|
-
const serverInfo = decodeInfo(body);
|
|
215
|
-
if (Option.isSome(serverInfo)) {
|
|
216
|
-
if (serverInfo.value.pid !== info.pid)
|
|
217
|
-
return { service: undefined, timedOut: false };
|
|
218
|
-
if (info.version !== undefined && serverInfo.value.version !== info.version)
|
|
219
|
-
return { service: undefined, timedOut: false };
|
|
220
|
-
return {
|
|
221
|
-
service: {
|
|
222
|
-
info,
|
|
223
|
-
endpoint,
|
|
224
|
-
version: serverInfo.value.version,
|
|
225
|
-
state: response.ok ? "ready" : response.status === 500 ? "failed" : "waiting",
|
|
226
|
-
compatible: true
|
|
227
|
-
},
|
|
228
|
-
timedOut: false
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
return { service: undefined, timedOut: false };
|
|
232
|
-
});
|
|
233
153
|
var registered = Effect.fnUntraced(function* (file, timeout) {
|
|
234
154
|
const info = yield* read(file);
|
|
235
155
|
if (info === undefined)
|
|
236
156
|
return { info: undefined, service: undefined, timedOut: false };
|
|
237
|
-
return { info, ...yield*
|
|
157
|
+
return { info, ...yield* Effect.promise(() => probeResult2(info, timeout)) };
|
|
238
158
|
});
|
|
239
159
|
var poll = (timing) => Schedule.max([Schedule.spaced(timing.stopPollInterval), Schedule.recurs(timing.stopPollAttempts)]);
|
|
240
160
|
var signal = (pid, name) => Effect.try({ try: () => process.kill(pid, name), catch: (cause) => cause }).pipe(Effect.ignore);
|
|
@@ -244,12 +164,9 @@ var stopped = Effect.fnUntraced(function* (pid) {
|
|
|
244
164
|
return true;
|
|
245
165
|
return yield* Effect.fail(new Error(`Server process ${pid} is still running`));
|
|
246
166
|
});
|
|
247
|
-
function same(left, right) {
|
|
248
|
-
return left.id === right.id && left.version === right.version && left.url === right.url && left.pid === right.pid;
|
|
249
|
-
}
|
|
250
167
|
var terminate = Effect.fnUntraced(function* (info, options, timing) {
|
|
251
168
|
const current = yield* read(options.file);
|
|
252
|
-
if (current === undefined || !
|
|
169
|
+
if (current === undefined || !same2(current, info))
|
|
253
170
|
return;
|
|
254
171
|
yield* signal(info.pid, "SIGTERM");
|
|
255
172
|
const done = yield* stopped(info.pid).pipe(Effect.retry(poll(timing)), Effect.option);
|
|
@@ -258,18 +175,18 @@ var terminate = Effect.fnUntraced(function* (info, options, timing) {
|
|
|
258
175
|
yield* stopped(info.pid).pipe(Effect.retry(poll(timing)));
|
|
259
176
|
}
|
|
260
177
|
const latest = yield* read(options.file);
|
|
261
|
-
if (latest === undefined || !
|
|
178
|
+
if (latest === undefined || !same2(latest, info))
|
|
262
179
|
return;
|
|
263
180
|
const fs = yield* FileSystem.FileSystem;
|
|
264
|
-
yield* fs.remove(options.file ??
|
|
181
|
+
yield* fs.remove(options.file ?? fallback2()).pipe(Effect.ignore);
|
|
265
182
|
});
|
|
266
|
-
var Service = { discover, incumbent, ensure, stop, headers, Info };
|
|
183
|
+
var Service = { discover, incumbent, ensure, stop, headers: headers2, Info };
|
|
267
184
|
export {
|
|
268
185
|
Info,
|
|
269
186
|
Service,
|
|
270
187
|
discover,
|
|
271
188
|
ensure,
|
|
272
|
-
headers,
|
|
189
|
+
headers2 as headers,
|
|
273
190
|
incumbent,
|
|
274
191
|
stop
|
|
275
192
|
};
|
package/dist/promise/client.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../chunks/
|
|
5
|
-
import"../chunks/
|
|
6
|
-
import"../chunks/
|
|
7
|
-
import"../chunks/
|
|
8
|
-
import"../chunks/
|
|
9
|
-
import"../chunks/
|
|
10
|
-
import"../chunks/
|
|
2
|
+
make2,
|
|
3
|
+
exports_client
|
|
4
|
+
} from "../chunks/pty-handoff-cqfz2qxq.js";
|
|
5
|
+
import"../chunks/pty-handoff-vyas3vgt.js";
|
|
6
|
+
import"../chunks/pty-handoff-qzsnm4q8.js";
|
|
7
|
+
import"../chunks/pty-handoff-js54wxgp.js";
|
|
8
|
+
import"../chunks/pty-handoff-1y4a697q.js";
|
|
9
|
+
import"../chunks/pty-handoff-vt9jbch8.js";
|
|
10
|
+
import"../chunks/pty-handoff-frbwqjmf.js";
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
exports_client as OpenCode,
|
|
13
|
+
make2 as make
|
|
14
14
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunks/
|
|
4
|
-
import"../../chunks/
|
|
2
|
+
make3
|
|
3
|
+
} from "../../chunks/pty-handoff-qzsnm4q8.js";
|
|
4
|
+
import"../../chunks/pty-handoff-js54wxgp.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
make3 as make
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import"../../chunks/
|
|
1
|
+
import"../../chunks/pty-handoff-vyas3vgt.js";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "../../chunks/
|
|
3
|
+
exports_client2
|
|
4
|
+
} from "../../chunks/pty-handoff-qzsnm4q8.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../chunks/
|
|
6
|
+
ClientError2
|
|
7
|
+
} from "../../chunks/pty-handoff-js54wxgp.js";
|
|
8
8
|
import {
|
|
9
9
|
isInvalidRequestError2,
|
|
10
10
|
isUnauthorizedError2,
|
|
@@ -39,10 +39,10 @@ import {
|
|
|
39
39
|
isShellNotFoundError2,
|
|
40
40
|
isWorktreeError2,
|
|
41
41
|
isVcsInitNotSupportedError2
|
|
42
|
-
} from "../../chunks/
|
|
42
|
+
} from "../../chunks/pty-handoff-vt9jbch8.js";
|
|
43
43
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
ClientError2 as ClientError,
|
|
45
|
+
exports_client2 as OpenCode,
|
|
46
46
|
isAgentNotFoundError2 as isAgentNotFoundError,
|
|
47
47
|
isCommandExecutionError2 as isCommandExecutionError,
|
|
48
48
|
isCommandNotFoundError2 as isCommandNotFoundError,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
isShellNotFoundError2,
|
|
33
33
|
isWorktreeError2,
|
|
34
34
|
isVcsInitNotSupportedError2
|
|
35
|
-
} from "../../chunks/
|
|
35
|
+
} from "../../chunks/pty-handoff-vt9jbch8.js";
|
|
36
36
|
export {
|
|
37
37
|
isAgentNotFoundError2 as isAgentNotFoundError,
|
|
38
38
|
isCommandExecutionError2 as isCommandExecutionError,
|
package/dist/promise/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import"../chunks/
|
|
1
|
+
import"../chunks/pty-handoff-m2eywc8w.js";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "../chunks/
|
|
5
|
-
import"../chunks/
|
|
6
|
-
import"../chunks/
|
|
3
|
+
exports_client
|
|
4
|
+
} from "../chunks/pty-handoff-cqfz2qxq.js";
|
|
5
|
+
import"../chunks/pty-handoff-vyas3vgt.js";
|
|
6
|
+
import"../chunks/pty-handoff-qzsnm4q8.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "../chunks/
|
|
10
|
-
import"../chunks/
|
|
8
|
+
ClientError2
|
|
9
|
+
} from "../chunks/pty-handoff-js54wxgp.js";
|
|
10
|
+
import"../chunks/pty-handoff-1y4a697q.js";
|
|
11
11
|
import {
|
|
12
12
|
isInvalidRequestError2,
|
|
13
13
|
isUnauthorizedError2,
|
|
@@ -42,11 +42,11 @@ import {
|
|
|
42
42
|
isShellNotFoundError2,
|
|
43
43
|
isWorktreeError2,
|
|
44
44
|
isVcsInitNotSupportedError2
|
|
45
|
-
} from "../chunks/
|
|
46
|
-
import"../chunks/
|
|
45
|
+
} from "../chunks/pty-handoff-vt9jbch8.js";
|
|
46
|
+
import"../chunks/pty-handoff-frbwqjmf.js";
|
|
47
47
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
ClientError2 as ClientError,
|
|
49
|
+
exports_client as OpenCode,
|
|
50
50
|
isAgentNotFoundError2 as isAgentNotFoundError,
|
|
51
51
|
isCommandExecutionError2 as isCommandExecutionError,
|
|
52
52
|
isCommandNotFoundError2 as isCommandNotFoundError,
|
package/dist/promise/rpc.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { DiscoverOptions, Endpoint, EnsureOptions, StopOptions } from "../service.js";
|
|
2
|
+
import { headers } from "../service-probe.js";
|
|
2
3
|
export * from "../service.js";
|
|
4
|
+
export { headers };
|
|
3
5
|
/** Discover a healthy, compatible local service without starting one. */
|
|
4
6
|
export declare function discover(options?: DiscoverOptions): Promise<{
|
|
5
7
|
url: string;
|
|
@@ -13,10 +15,6 @@ export declare function discover(options?: DiscoverOptions): Promise<{
|
|
|
13
15
|
export declare function ensure(options?: EnsureOptions): Promise<Endpoint>;
|
|
14
16
|
/** Stop the registered local service. */
|
|
15
17
|
export declare function stop(options?: StopOptions): Promise<void>;
|
|
16
|
-
/** Create HTTP authentication headers for a service endpoint. */
|
|
17
|
-
export declare function headers(endpoint: Endpoint): {
|
|
18
|
-
authorization: string;
|
|
19
|
-
} | undefined;
|
|
20
18
|
/** Promise-based local service lifecycle operations. */
|
|
21
19
|
export declare const Service: {
|
|
22
20
|
discover: typeof discover;
|