@opencode/client 2.0.24 → 2.0.25
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/{pty-handoff-71wkqa80.js → service-probe-1thtawyv.js} +1 -1
- package/dist/chunks/{pty-handoff-1y4a697q.js → service-probe-1y4a697q.js} +1 -1
- package/dist/chunks/{pty-handoff-ank0d71z.js → service-probe-2ny4vxct.js} +19 -2
- package/dist/chunks/{pty-handoff-w1w809zr.js → service-probe-65kht65h.js} +5 -5
- package/dist/chunks/{pty-handoff-qzsnm4q8.js → service-probe-9h52wrcy.js} +28 -19
- package/dist/chunks/{pty-handoff-frbwqjmf.js → service-probe-frbwqjmf.js} +1 -1
- package/dist/chunks/{pty-handoff-js54wxgp.js → service-probe-nwcpakzx.js} +2 -2
- package/dist/chunks/{pty-handoff-t1xa31vm.js → service-probe-t1xa31vm.js} +1 -1
- package/dist/chunks/{pty-handoff-src6by76.js → service-probe-trz7kcxd.js} +14 -1
- package/dist/chunks/{pty-handoff-5yf5aaev.js → service-probe-vnspkrex.js} +16 -11
- package/dist/chunks/{pty-handoff-7f0py9js.js → service-probe-y2etg5bs.js} +2 -2
- package/dist/chunks/{pty-handoff-myyn5x39.js → service-probe-y99g37y2.js} +17 -17
- package/dist/chunks/service-probe-z1hcmzxa.js +30 -0
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +12 -0
- package/dist/effect/client.d.ts +1 -0
- package/dist/effect/client.js +12 -12
- package/dist/effect/generated/client-error.js +3 -3
- package/dist/effect/generated/client.d.ts +2 -1
- 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 +16 -2
- package/dist/effect/service.js +18 -23
- 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 +10 -10
- package/dist/promise/generated/types.d.ts +81 -4
- package/dist/promise/generated/types.js +1 -1
- package/dist/promise/index.js +13 -13
- package/dist/promise/rpc.js +2 -2
- package/dist/promise/service.js +13 -18
- package/dist/pty-handoff.js +1 -1
- package/dist/rpc-runtime.js +1 -1
- package/dist/service-contender.js +1 -1
- package/dist/service-probe.d.ts +18 -1
- package/dist/service-probe.js +5 -2
- 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 +7 -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 +5 -6
- package/dist/chunks/pty-handoff-cqfz2qxq.js +0 -30
- /package/dist/chunks/{pty-handoff-6mptkzbc.js → service-probe-6mptkzbc.js} +0 -0
- /package/dist/chunks/{pty-handoff-9rqn6x4v.js → service-probe-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{pty-handoff-gne7h7mq.js → service-probe-gne7h7mq.js} +0 -0
- /package/dist/chunks/{pty-handoff-m2eywc8w.js → service-probe-m2eywc8w.js} +0 -0
- /package/dist/chunks/{pty-handoff-qav6mfdz.js → service-probe-qav6mfdz.js} +0 -0
- /package/dist/chunks/{pty-handoff-sxt88q69.js → service-probe-sxt88q69.js} +0 -0
- /package/dist/chunks/{pty-handoff-ve4aws36.js → service-probe-ve4aws36.js} +0 -0
- /package/dist/chunks/{pty-handoff-vmytr4q8.js → service-probe-vmytr4q8.js} +0 -0
- /package/dist/chunks/{pty-handoff-vt9jbch8.js → service-probe-vt9jbch8.js} +0 -0
- /package/dist/chunks/{pty-handoff-vyas3vgt.js → service-probe-vyas3vgt.js} +0 -0
- /package/dist/chunks/{pty-handoff-xgnj2w4v.js → service-probe-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{pty-handoff-ydhz1zrh.js → service-probe-ydhz1zrh.js} +0 -0
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultEnsureTiming2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-probe-xgnj2w4v.js";
|
|
4
|
+
import {
|
|
5
|
+
matchesVersion2
|
|
6
|
+
} from "./service-probe-sxt88q69.js";
|
|
4
7
|
|
|
5
8
|
// src/service-probe.ts
|
|
6
9
|
import { homedir } from "node:os";
|
|
7
10
|
import { join } from "node:path";
|
|
11
|
+
function decide2(service, options) {
|
|
12
|
+
if (!matchesVersion2(service.version, options))
|
|
13
|
+
return { _tag: "replace", pty: service.state === "ready" ? "handoff" : "clear" };
|
|
14
|
+
if (!service.compatible)
|
|
15
|
+
return fail("Background service uses an incompatible health protocol. Update this client or explicitly restart the service.");
|
|
16
|
+
if (service.state === "ready")
|
|
17
|
+
return { _tag: "reuse" };
|
|
18
|
+
if (service.state === "failed")
|
|
19
|
+
return fail("Background service failed to start");
|
|
20
|
+
return { _tag: "wait" };
|
|
21
|
+
}
|
|
22
|
+
function fail(message) {
|
|
23
|
+
return { _tag: "fail", error: new Error(message) };
|
|
24
|
+
}
|
|
8
25
|
function fallback2() {
|
|
9
26
|
return join(process.env["XDG_STATE_HOME"] ?? join(homedir(), ".local", "state"), "opencode", "service.json");
|
|
10
27
|
}
|
|
@@ -72,4 +89,4 @@ function decodeInfo(input) {
|
|
|
72
89
|
return { version: input.version, pid: input.pid };
|
|
73
90
|
}
|
|
74
91
|
|
|
75
|
-
export { fallback2, same2, probeResult2, headers2 };
|
|
92
|
+
export { decide2, fallback2, same2, probeResult2, headers2 };
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
readError2,
|
|
4
4
|
event2,
|
|
5
5
|
eventType2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-probe-t1xa31vm.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./service-probe-9rqn6x4v.js";
|
|
10
10
|
|
|
11
11
|
// src/effect/rpc.ts
|
|
12
12
|
var exports_rpc = {};
|
|
13
13
|
__export(exports_rpc, {
|
|
14
14
|
RpcClientRuntime: () => exports_rpc,
|
|
15
15
|
aborted: () => aborted2,
|
|
16
|
-
make: () =>
|
|
16
|
+
make: () => make3
|
|
17
17
|
});
|
|
18
18
|
import { Effect, Stream } from "effect";
|
|
19
|
-
function
|
|
19
|
+
function make3(call, subscribe) {
|
|
20
20
|
return (definition) => {
|
|
21
21
|
const methods = Object.fromEntries(Object.entries(definition.methods).map(([name, method]) => [
|
|
22
22
|
name,
|
|
@@ -59,4 +59,4 @@ function aborted2(signal) {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export {
|
|
62
|
+
export { make3, aborted2, exports_rpc };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
ClientError3
|
|
3
|
+
} from "./service-probe-nwcpakzx.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./service-probe-9rqn6x4v.js";
|
|
7
7
|
|
|
8
8
|
// src/promise/generated/client.ts
|
|
9
|
-
var
|
|
10
|
-
__export(
|
|
11
|
-
make: () =>
|
|
9
|
+
var exports_client4 = {};
|
|
10
|
+
__export(exports_client4, {
|
|
11
|
+
make: () => make6
|
|
12
12
|
});
|
|
13
13
|
var maxSseEventBytes = 16 * 1024 * 1024;
|
|
14
|
-
function
|
|
14
|
+
function make6(options) {
|
|
15
15
|
const fetch = options.fetch ?? globalThis.fetch;
|
|
16
16
|
const prepare = (descriptor, requestOptions) => {
|
|
17
17
|
const baseUrl = new URL(options.baseUrl);
|
|
@@ -44,7 +44,7 @@ function make3(options) {
|
|
|
44
44
|
const prepared = prepare(descriptor, requestOptions);
|
|
45
45
|
return await fetch(prepared.url, prepared.init);
|
|
46
46
|
} catch (cause) {
|
|
47
|
-
throw new
|
|
47
|
+
throw new ClientError3("Transport", { cause });
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
const responseError = async (response, descriptor) => {
|
|
@@ -53,7 +53,7 @@ function make3(options) {
|
|
|
53
53
|
try {
|
|
54
54
|
await response.body?.cancel();
|
|
55
55
|
} catch {}
|
|
56
|
-
throw new
|
|
56
|
+
throw new ClientError3("UnexpectedStatus", { cause: { status: response.status }, detail: String(response.status) });
|
|
57
57
|
};
|
|
58
58
|
const request = async (descriptor, requestOptions) => {
|
|
59
59
|
const response = await execute(descriptor, requestOptions);
|
|
@@ -78,10 +78,10 @@ function make3(options) {
|
|
|
78
78
|
try {
|
|
79
79
|
await response.body?.cancel();
|
|
80
80
|
} catch {}
|
|
81
|
-
throw new
|
|
81
|
+
throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
|
|
82
82
|
}
|
|
83
83
|
if (response.body === null)
|
|
84
|
-
throw new
|
|
84
|
+
throw new ClientError3("MalformedResponse");
|
|
85
85
|
const reader = response.body.getReader();
|
|
86
86
|
const decoder = new TextDecoder;
|
|
87
87
|
let buffer = "";
|
|
@@ -91,13 +91,13 @@ function make3(options) {
|
|
|
91
91
|
try {
|
|
92
92
|
next = await reader.read();
|
|
93
93
|
} catch (cause) {
|
|
94
|
-
throw new
|
|
94
|
+
throw new ClientError3("Transport", { cause });
|
|
95
95
|
}
|
|
96
96
|
if (!next.done)
|
|
97
97
|
requestOptions?.onActivity?.();
|
|
98
98
|
buffer += decoder.decode(next.value, { stream: !next.done });
|
|
99
99
|
if (buffer.length > maxSseEventBytes)
|
|
100
|
-
throw new
|
|
100
|
+
throw new ClientError3("SseEventTooLarge");
|
|
101
101
|
const trailingCarriageReturn = !next.done && buffer.endsWith("\r");
|
|
102
102
|
if (trailingCarriageReturn)
|
|
103
103
|
buffer = buffer.slice(0, -1);
|
|
@@ -124,7 +124,7 @@ function make3(options) {
|
|
|
124
124
|
try {
|
|
125
125
|
yield JSON.parse(data);
|
|
126
126
|
} catch (cause) {
|
|
127
|
-
throw new
|
|
127
|
+
throw new ClientError3("MalformedResponse", { cause });
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
boundary = buffer.indexOf(`
|
|
@@ -700,6 +700,15 @@ function make3(options) {
|
|
|
700
700
|
successStatus: 204,
|
|
701
701
|
declaredStatuses: [400, 401, 404],
|
|
702
702
|
empty: true
|
|
703
|
+
}, requestOptions),
|
|
704
|
+
external: (input, requestOptions) => request({
|
|
705
|
+
method: "POST",
|
|
706
|
+
path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/external`,
|
|
707
|
+
query: { location: input["location"] },
|
|
708
|
+
body: { methodID: input["methodID"], answer: input["answer"], label: input["label"] },
|
|
709
|
+
successStatus: 204,
|
|
710
|
+
declaredStatuses: [400, 401, 404],
|
|
711
|
+
empty: true
|
|
703
712
|
}, requestOptions)
|
|
704
713
|
},
|
|
705
714
|
oauth: {
|
|
@@ -1421,20 +1430,20 @@ async function json(response) {
|
|
|
1421
1430
|
try {
|
|
1422
1431
|
await response.body?.cancel();
|
|
1423
1432
|
} catch {}
|
|
1424
|
-
throw new
|
|
1433
|
+
throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
|
|
1425
1434
|
}
|
|
1426
1435
|
let text;
|
|
1427
1436
|
try {
|
|
1428
1437
|
text = await response.text();
|
|
1429
1438
|
} catch (cause) {
|
|
1430
|
-
throw new
|
|
1439
|
+
throw new ClientError3("Transport", { cause });
|
|
1431
1440
|
}
|
|
1432
1441
|
if (text === "")
|
|
1433
|
-
throw new
|
|
1442
|
+
throw new ClientError3("MalformedResponse");
|
|
1434
1443
|
try {
|
|
1435
1444
|
return JSON.parse(text);
|
|
1436
1445
|
} catch (cause) {
|
|
1437
|
-
throw new
|
|
1446
|
+
throw new ClientError3("MalformedResponse", { cause });
|
|
1438
1447
|
}
|
|
1439
1448
|
}
|
|
1440
1449
|
function declared(body) {
|
|
@@ -1447,4 +1456,4 @@ function isContentType(response, expected) {
|
|
|
1447
1456
|
return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
|
|
1448
1457
|
}
|
|
1449
1458
|
|
|
1450
|
-
export {
|
|
1459
|
+
export { make6, exports_client4 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/promise/generated/client-error.ts
|
|
2
|
-
class
|
|
2
|
+
class ClientError3 extends Error {
|
|
3
3
|
reason;
|
|
4
4
|
name = "ClientError";
|
|
5
5
|
constructor(reason, options) {
|
|
@@ -9,4 +9,4 @@ class ClientError2 extends Error {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export {
|
|
12
|
+
export { ClientError3 };
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
isFormNotFoundError2,
|
|
3
3
|
isFormAlreadySettledError2,
|
|
4
4
|
isPermissionNotFoundError2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./service-probe-vt9jbch8.js";
|
|
6
6
|
|
|
7
7
|
// src/solid/data.ts
|
|
8
8
|
import { Worktree } from "@opencode/schema/worktree";
|
|
@@ -1177,6 +1177,19 @@ function createData2(config) {
|
|
|
1177
1177
|
list(sessionID) {
|
|
1178
1178
|
return store.session.pending[sessionID] ?? [];
|
|
1179
1179
|
},
|
|
1180
|
+
status(sessionID, inboxID) {
|
|
1181
|
+
const pending = store.session.pending[sessionID] ?? [];
|
|
1182
|
+
const item = pending.find((entry) => entry.id === inboxID && entry.type === "user");
|
|
1183
|
+
if (!item)
|
|
1184
|
+
return;
|
|
1185
|
+
if (item.delivery === "queue")
|
|
1186
|
+
return "queued";
|
|
1187
|
+
const messages = store.session.message[sessionID] ?? [];
|
|
1188
|
+
const boundary = messages.findLastIndex((entry) => entry.type === "idle");
|
|
1189
|
+
if ((store.session.active[sessionID] ?? "idle") === "idle")
|
|
1190
|
+
return boundary >= 0 && item.time.created <= messages[boundary].time.created ? "stranded" : "starting";
|
|
1191
|
+
return messages.slice(boundary + 1).some((entry) => entry.type === "user" && !pending.some((other) => other.id === entry.id)) ? "steering" : "starting";
|
|
1192
|
+
},
|
|
1180
1193
|
sync(sessionID) {
|
|
1181
1194
|
return sync.run(`session.pending:${sessionID}`, async () => {
|
|
1182
1195
|
const updates = new Map;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientApi2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-probe-vmytr4q8.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./
|
|
5
|
+
ClientError2
|
|
6
|
+
} from "./service-probe-y2etg5bs.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./service-probe-9rqn6x4v.js";
|
|
10
10
|
|
|
11
11
|
// src/effect/generated/client.ts
|
|
12
|
-
var
|
|
13
|
-
__export(
|
|
14
|
-
make: () =>
|
|
12
|
+
var exports_client2 = {};
|
|
13
|
+
__export(exports_client2, {
|
|
14
|
+
make: () => make4
|
|
15
15
|
});
|
|
16
16
|
import { Effect, Stream, Schema } from "effect";
|
|
17
17
|
import { Sse } from "effect/unstable/encoding";
|
|
18
18
|
import { HttpClientError } from "effect/unstable/http";
|
|
19
19
|
import { HttpApiClient } from "effect/unstable/httpapi";
|
|
20
|
-
var mapClientError = (error) => HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error) ? new
|
|
20
|
+
var mapClientError = (error) => HttpClientError.isHttpClientError(error) || Schema.isSchemaError(error) || Sse.Retry.is(error) ? new ClientError2({ cause: error }) : error;
|
|
21
21
|
var preserveEffect = () => (effect) => effect;
|
|
22
22
|
var preserveStream = () => (stream) => stream;
|
|
23
23
|
var EndpointServerInfo = (raw) => () => preserveEffect()(raw["server.info"]({}).pipe(Effect.mapError(mapClientError)));
|
|
@@ -282,6 +282,11 @@ var EndpointIntegrationConnectKey = (raw) => (input) => preserveEffect()(raw["in
|
|
|
282
282
|
query: { location: input["location"] },
|
|
283
283
|
payload: { key: input["key"], answer: input["answer"], label: input["label"] }
|
|
284
284
|
}).pipe(Effect.mapError(mapClientError)));
|
|
285
|
+
var EndpointIntegrationConnectExternal = (raw) => (input) => preserveEffect()(raw["integration.connect.external"]({
|
|
286
|
+
params: { integrationID: input["integrationID"] },
|
|
287
|
+
query: { location: input["location"] },
|
|
288
|
+
payload: { methodID: input["methodID"], answer: input["answer"], label: input["label"] }
|
|
289
|
+
}).pipe(Effect.mapError(mapClientError)));
|
|
285
290
|
var EndpointIntegrationOauthConnect = (raw) => (input) => preserveEffect()(raw["integration.oauth.connect"]({
|
|
286
291
|
params: { integrationID: input["integrationID"] },
|
|
287
292
|
query: { location: input["location"] },
|
|
@@ -317,7 +322,7 @@ var adaptGroupIntegration = (raw) => ({
|
|
|
317
322
|
list: EndpointIntegrationList(raw),
|
|
318
323
|
get: EndpointIntegrationGet(raw),
|
|
319
324
|
wellknown: { add: EndpointIntegrationWellknownAdd(raw) },
|
|
320
|
-
connect: { key: EndpointIntegrationConnectKey(raw) },
|
|
325
|
+
connect: { key: EndpointIntegrationConnectKey(raw), external: EndpointIntegrationConnectExternal(raw) },
|
|
321
326
|
oauth: {
|
|
322
327
|
connect: EndpointIntegrationOauthConnect(raw),
|
|
323
328
|
status: EndpointIntegrationOauthStatus(raw),
|
|
@@ -613,6 +618,6 @@ var adaptClient = (raw) => ({
|
|
|
613
618
|
websearch: adaptGroupWebsearch(raw["server.websearch"]),
|
|
614
619
|
config: adaptGroupConfig(raw["server.config"])
|
|
615
620
|
});
|
|
616
|
-
var
|
|
621
|
+
var make4 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
|
|
617
622
|
|
|
618
|
-
export {
|
|
623
|
+
export { make4, exports_client2 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// src/effect/generated/client-error.ts
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class ClientError2 extends Schema.TaggedError()("ClientError", {
|
|
5
5
|
cause: Schema.Defect()
|
|
6
6
|
}) {
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { ClientError2 };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
make7
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./service-probe-frbwqjmf.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./
|
|
5
|
+
ClientError2
|
|
6
|
+
} from "./service-probe-y2etg5bs.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./
|
|
8
|
+
make4
|
|
9
|
+
} from "./service-probe-vnspkrex.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
make3,
|
|
12
12
|
aborted2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./service-probe-65kht65h.js";
|
|
14
14
|
import {
|
|
15
15
|
__export
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./service-probe-9rqn6x4v.js";
|
|
17
17
|
|
|
18
18
|
// src/effect/client.ts
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
OpenCode: () =>
|
|
22
|
-
make: () =>
|
|
19
|
+
var exports_client = {};
|
|
20
|
+
__export(exports_client, {
|
|
21
|
+
OpenCode: () => exports_client,
|
|
22
|
+
make: () => make2
|
|
23
23
|
});
|
|
24
24
|
import { Cause, Context, Effect, Stream } from "effect";
|
|
25
25
|
import { HttpClient, HttpClientRequest } from "effect/unstable/http";
|
|
@@ -28,9 +28,9 @@ var CurrentHeaders = Context.Reference("@opencode/client/effect/rpc/headers", {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
var
|
|
31
|
+
var make2 = Effect.fn("OpenCode.make")(function* (options) {
|
|
32
32
|
const httpClient = yield* HttpClient.HttpClient;
|
|
33
|
-
const raw = yield*
|
|
33
|
+
const raw = yield* make4(options).pipe(Effect.provideService(HttpClient.HttpClient, HttpClient.mapRequestEffect(httpClient, (request) => Effect.map(CurrentHeaders, (headers) => headers ? HttpClientRequest.setHeaders(request, new Headers(headers)) : request))));
|
|
34
34
|
const context = yield* Effect.context();
|
|
35
35
|
const native = raw.event.subscribe();
|
|
36
36
|
|
|
@@ -41,12 +41,12 @@ var make4 = Effect.fn("OpenCode.make")(function* (options) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
const shared = make7((signal) => Stream.toAsyncIterableWith(native.pipe(Stream.interruptWhen(aborted2(signal)), Stream.catchCause((cause) => Stream.fail(new EventFailure(cause)))), context));
|
|
44
|
-
const subscribe = () => Stream.fromAsyncIterable(shared.subscribe(), (error) => error).pipe(Stream.catch((error) => Stream.failCause(error instanceof EventFailure ? error.cause : Cause.fail(new
|
|
44
|
+
const subscribe = () => Stream.fromAsyncIterable(shared.subscribe(), (error) => error).pipe(Stream.catch((error) => Stream.failCause(error instanceof EventFailure ? error.cause : Cause.fail(new ClientError2({ cause: error })))));
|
|
45
45
|
return {
|
|
46
46
|
...raw,
|
|
47
47
|
event: { ...raw.event, subscribe },
|
|
48
|
-
rpc: Object.assign(
|
|
48
|
+
rpc: Object.assign(make3((input, options) => raw.rpc.call(input).pipe(Effect.provideService(CurrentHeaders, options?.headers)), subscribe), raw.rpc)
|
|
49
49
|
};
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
export {
|
|
52
|
+
export { make2, exports_client };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
make7
|
|
3
|
+
} from "./service-probe-frbwqjmf.js";
|
|
4
|
+
import {
|
|
5
|
+
make6
|
|
6
|
+
} from "./service-probe-9h52wrcy.js";
|
|
7
|
+
import {
|
|
8
|
+
makeRpc2
|
|
9
|
+
} from "./service-probe-1y4a697q.js";
|
|
10
|
+
import {
|
|
11
|
+
__export
|
|
12
|
+
} from "./service-probe-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 };
|
package/dist/contract.js
CHANGED
package/dist/effect/api/api.d.ts
CHANGED
|
@@ -1830,6 +1830,17 @@ export type IntegrationConnectKeyInput = {
|
|
|
1830
1830
|
};
|
|
1831
1831
|
export type IntegrationConnectKeyOutput = void;
|
|
1832
1832
|
export type IntegrationConnectKeyOperation<E = never> = (input: IntegrationConnectKeyInput) => Effect.Effect<IntegrationConnectKeyOutput, E>;
|
|
1833
|
+
export type IntegrationConnectExternalInput = {
|
|
1834
|
+
readonly integrationID: Integration.ID;
|
|
1835
|
+
readonly location?: {
|
|
1836
|
+
readonly directory?: string | undefined;
|
|
1837
|
+
} | undefined;
|
|
1838
|
+
readonly methodID: Integration.MethodID;
|
|
1839
|
+
readonly answer?: Form.Answer | undefined;
|
|
1840
|
+
readonly label?: string | undefined;
|
|
1841
|
+
};
|
|
1842
|
+
export type IntegrationConnectExternalOutput = void;
|
|
1843
|
+
export type IntegrationConnectExternalOperation<E = never> = (input: IntegrationConnectExternalInput) => Effect.Effect<IntegrationConnectExternalOutput, E>;
|
|
1833
1844
|
export type IntegrationOauthConnectInput = {
|
|
1834
1845
|
readonly integrationID: Integration.ID;
|
|
1835
1846
|
readonly location?: {
|
|
@@ -1917,6 +1928,7 @@ export interface IntegrationApi<E = never> {
|
|
|
1917
1928
|
};
|
|
1918
1929
|
readonly connect: {
|
|
1919
1930
|
readonly key: IntegrationConnectKeyOperation<E>;
|
|
1931
|
+
readonly external: IntegrationConnectExternalOperation<E>;
|
|
1920
1932
|
};
|
|
1921
1933
|
readonly oauth: {
|
|
1922
1934
|
readonly connect: IntegrationOauthConnectOperation<E>;
|
package/dist/effect/client.d.ts
CHANGED
|
@@ -2392,6 +2392,7 @@ export declare const make: (options?: {
|
|
|
2392
2392
|
};
|
|
2393
2393
|
connect: {
|
|
2394
2394
|
key: (input: import("./api.js").IntegrationConnectKeyInput) => Effect.Effect<void, import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").IntegrationNotFoundError | import("effect/Schema").SchemaError | ClientError | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
|
2395
|
+
external: (input: import("./api.js").IntegrationConnectExternalInput) => Effect.Effect<void, import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").IntegrationNotFoundError | import("effect/Schema").SchemaError | ClientError | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
|
2395
2396
|
};
|
|
2396
2397
|
oauth: {
|
|
2397
2398
|
connect: (input: import("./api.js").IntegrationOauthConnectInput) => Effect.Effect<import("./api.js").IntegrationOauthConnectOutput, import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("effect/Schema").SchemaError | ClientError | import("effect/unstable/http/HttpClientError").HttpClientError, never>;
|
package/dist/effect/client.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
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/
|
|
11
|
-
import"../chunks/
|
|
2
|
+
make2,
|
|
3
|
+
exports_client
|
|
4
|
+
} from "../chunks/service-probe-y99g37y2.js";
|
|
5
|
+
import"../chunks/service-probe-65kht65h.js";
|
|
6
|
+
import"../chunks/service-probe-6mptkzbc.js";
|
|
7
|
+
import"../chunks/service-probe-vnspkrex.js";
|
|
8
|
+
import"../chunks/service-probe-y2etg5bs.js";
|
|
9
|
+
import"../chunks/service-probe-t1xa31vm.js";
|
|
10
|
+
import"../chunks/service-probe-vmytr4q8.js";
|
|
11
|
+
import"../chunks/service-probe-frbwqjmf.js";
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
exports_client as OpenCode,
|
|
14
|
+
make2 as make
|
|
15
15
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect, Stream, Schema } from "effect";
|
|
2
2
|
import { Sse } from "effect/unstable/encoding";
|
|
3
3
|
import { HttpClientError } from "effect/unstable/http";
|
|
4
|
-
import type { ServerInfoOutput, ServerPairOutput, ServerConnectInput, ServerConnectOutput, LocationGetInput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionListOutput, SessionStatsInput, SessionStatsOutput, SessionCreateInput, SessionImportInput, SessionExportInput, SessionExportOutput, SessionActiveOutput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionUpdateInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSkillInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionWaitInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionContextOutput, SessionDiffInput, SessionDiffOutput, SessionInboxListInput, SessionInboxListOutput, SessionInboxCancelInput, SessionInboxUpdateInput, SessionInstructionsEntryListInput, SessionInstructionsEntryListOutput, SessionInstructionsEntryPutInput, SessionInstructionsEntryRemoveInput, SessionGenerateInput, SessionGenerateOutput, SessionLogInput, SessionLogOutput, SessionInterruptInput, SessionInterruptOutput, SessionBackgroundInput, SessionMessageGetInput, SessionFormListInput, SessionFormListOutput, SessionFormCreateInput, SessionFormGetInput, SessionFormReplyInput, SessionFormCancelInput, SessionEnvironmentInput, SessionViewInput, MessageListInput, MessageListOutput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, GenerateTextInput, GenerateTextOutput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationConnectKeyInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, McpListInput, McpListOutput, McpAddInput, McpRemoveInput, McpConnectInput, McpDisconnectInput, McpResourceCatalogInput, McpResourceCatalogOutput, CredentialListOutput, CredentialCreateInput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListOutput, ProjectUpdateInput, FormListInput, FormListOutput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedListOutput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionCreateOutput, PermissionListInput, PermissionListOutput, PermissionGetInput, PermissionReplyInput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, RpcCallOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyReadOutput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyListOutput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyCreateOutput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyGetOutput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtyUpdateOutput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtySnapshotOutput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, VcsInitInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchListInput, VcsBranchListOutput, VcsDiffInput, VcsDiffOutput, DebugLocationListOutput, DebugLocationEvictInput, MigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ConfigGetInput, ConfigGetOutput, ConfigShellsOutput, ConfigUpdateInput } from "../api/api.js";
|
|
4
|
+
import type { ServerInfoOutput, ServerPairOutput, ServerConnectInput, ServerConnectOutput, LocationGetInput, AgentListInput, AgentListOutput, AgentGetInput, AgentGetOutput, PluginListInput, PluginListOutput, PluginCheckInput, PluginCheckOutput, PluginUpdateInput, SessionListInput, SessionListOutput, SessionStatsInput, SessionStatsOutput, SessionCreateInput, SessionImportInput, SessionExportInput, SessionExportOutput, SessionActiveOutput, SessionGetInput, SessionRemoveInput, SessionForkInput, SessionSwitchAgentInput, SessionSwitchModelInput, SessionUpdateInput, SessionMoveInput, SessionPromptInput, SessionCommandInput, SessionSkillInput, SessionSyntheticInput, SessionShellInput, SessionCompactInput, SessionWaitInput, SessionRevertStageInput, SessionRevertClearInput, SessionRevertCommitInput, SessionContextInput, SessionContextOutput, SessionDiffInput, SessionDiffOutput, SessionInboxListInput, SessionInboxListOutput, SessionInboxCancelInput, SessionInboxUpdateInput, SessionInstructionsEntryListInput, SessionInstructionsEntryListOutput, SessionInstructionsEntryPutInput, SessionInstructionsEntryRemoveInput, SessionGenerateInput, SessionGenerateOutput, SessionLogInput, SessionLogOutput, SessionInterruptInput, SessionInterruptOutput, SessionBackgroundInput, SessionMessageGetInput, SessionFormListInput, SessionFormListOutput, SessionFormCreateInput, SessionFormGetInput, SessionFormReplyInput, SessionFormCancelInput, SessionEnvironmentInput, SessionViewInput, MessageListInput, MessageListOutput, ModelListInput, ModelListOutput, ModelDefaultInput, ModelDefaultOutput, GenerateTextInput, GenerateTextOutput, ProviderListInput, ProviderListOutput, ProviderGetInput, ProviderGetOutput, IntegrationListInput, IntegrationListOutput, IntegrationGetInput, IntegrationGetOutput, IntegrationWellknownAddInput, IntegrationConnectKeyInput, IntegrationConnectExternalInput, IntegrationOauthConnectInput, IntegrationOauthConnectOutput, IntegrationOauthStatusInput, IntegrationOauthStatusOutput, IntegrationOauthCompleteInput, IntegrationOauthCancelInput, IntegrationCommandConnectInput, IntegrationCommandConnectOutput, IntegrationCommandStatusInput, IntegrationCommandStatusOutput, IntegrationCommandCancelInput, McpListInput, McpListOutput, McpAddInput, McpRemoveInput, McpConnectInput, McpDisconnectInput, McpResourceCatalogInput, McpResourceCatalogOutput, CredentialListOutput, CredentialCreateInput, CredentialUpdateInput, CredentialActivateInput, CredentialRemoveInput, ProjectListOutput, ProjectUpdateInput, FormListInput, FormListOutput, PermissionRequestListInput, PermissionRequestListOutput, PermissionSavedListInput, PermissionSavedListOutput, PermissionSavedRemoveInput, PermissionCreateInput, PermissionCreateOutput, PermissionListInput, PermissionListOutput, PermissionGetInput, PermissionReplyInput, FileListInput, FileListOutput, FileFindInput, FileFindOutput, CommandListInput, CommandListOutput, SkillListInput, SkillListOutput, RpcCallInput, RpcCallOutput, PtyListInput, PtyListOutput, PtyCreateInput, PtyCreateOutput, PtyGetInput, PtyGetOutput, PtyUpdateInput, PtyUpdateOutput, PtyRemoveInput, PtyConnectTokenInput, PtyConnectTokenOutput, ExperimentalPersistentPtyReadInput, ExperimentalPersistentPtyReadOutput, ExperimentalPersistentPtyListInput, ExperimentalPersistentPtyListOutput, ExperimentalPersistentPtyCreateInput, ExperimentalPersistentPtyCreateOutput, ExperimentalPersistentPtyHandoffOutput, ExperimentalPersistentPtyGetInput, ExperimentalPersistentPtyGetOutput, ExperimentalPersistentPtyUpdateInput, ExperimentalPersistentPtyUpdateOutput, ExperimentalPersistentPtySnapshotInput, ExperimentalPersistentPtySnapshotOutput, ExperimentalPersistentPtyRemoveInput, ExperimentalPersistentPtyConnectTokenInput, ShellListInput, ShellListOutput, ShellCreateInput, ShellCreateOutput, ShellGetInput, ShellGetOutput, ShellOutputInput, ShellOutputOutput, ShellRemoveInput, ReferenceListInput, ReferenceListOutput, WorktreeListInput, WorktreeCreateInput, WorktreeRemoveInput, WorktreeRefreshInput, VcsInitInput, VcsGetInput, VcsGetOutput, VcsBaseInput, VcsBaseOutput, VcsStatusInput, VcsStatusOutput, VcsBranchListInput, VcsBranchListOutput, VcsDiffInput, VcsDiffOutput, DebugLocationListOutput, DebugLocationEvictInput, MigrationV1StatusOutput, WebsearchProvidersInput, WebsearchProvidersOutput, WebsearchQueryInput, WebsearchQueryOutput, ConfigGetInput, ConfigGetOutput, ConfigShellsOutput, ConfigUpdateInput } from "../api/api.js";
|
|
5
5
|
import { ClientError } from "./client-error.js";
|
|
6
6
|
export declare const make: (options?: {
|
|
7
7
|
readonly baseUrl?: URL | string;
|
|
@@ -103,6 +103,7 @@ export declare const make: (options?: {
|
|
|
103
103
|
};
|
|
104
104
|
connect: {
|
|
105
105
|
key: (input: IntegrationConnectKeyInput) => Effect.Effect<void, import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").IntegrationNotFoundError | Schema.SchemaError | ClientError | HttpClientError.HttpClientError, never>;
|
|
106
|
+
external: (input: IntegrationConnectExternalInput) => Effect.Effect<void, import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").IntegrationNotFoundError | Schema.SchemaError | ClientError | HttpClientError.HttpClientError, never>;
|
|
106
107
|
};
|
|
107
108
|
oauth: {
|
|
108
109
|
connect: (input: IntegrationOauthConnectInput) => Effect.Effect<IntegrationOauthConnectOutput, import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").UnauthorizedError | Schema.SchemaError | ClientError | HttpClientError.HttpClientError, never>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../chunks/
|
|
4
|
-
import"../../chunks/
|
|
5
|
-
import"../../chunks/
|
|
2
|
+
make4
|
|
3
|
+
} from "../../chunks/service-probe-vnspkrex.js";
|
|
4
|
+
import"../../chunks/service-probe-y2etg5bs.js";
|
|
5
|
+
import"../../chunks/service-probe-vmytr4q8.js";
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
make4 as make
|
|
8
8
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import"../../chunks/
|
|
1
|
+
import"../../chunks/service-probe-6mptkzbc.js";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "../../chunks/
|
|
3
|
+
exports_client2
|
|
4
|
+
} from "../../chunks/service-probe-vnspkrex.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
} from "../../chunks/
|
|
8
|
-
import"../../chunks/
|
|
6
|
+
ClientError2
|
|
7
|
+
} from "../../chunks/service-probe-y2etg5bs.js";
|
|
8
|
+
import"../../chunks/service-probe-vmytr4q8.js";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
ClientError2 as ClientError,
|
|
11
|
+
exports_client2 as OpenCode
|
|
12
12
|
};
|