@opencode/client 2.1.1 → 2.1.3
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-f93mzqah.js → service-probe-5r97ebd4.js} +20 -11
- package/dist/chunks/{service-version-61wt4y9h.js → service-probe-61wt4y9h.js} +1 -1
- package/dist/chunks/{service-version-6vp15eh6.js → service-probe-6vp15eh6.js} +1 -1
- package/dist/chunks/{service-version-frbwqjmf.js → service-probe-8bbb028w.js} +1 -1
- package/dist/chunks/{service-version-2ny4vxct.js → service-probe-8ye1ye6f.js} +2 -2
- package/dist/chunks/{service-version-mnyft54j.js → service-probe-9j12j8xw.js} +5 -5
- package/dist/chunks/service-probe-9p0yrv34.js +30 -0
- package/dist/chunks/{service-version-nv358xrg.js → service-probe-g22sa7qz.js} +35 -20
- package/dist/chunks/{service-version-js54wxgp.js → service-probe-nwcpakzx.js} +2 -2
- package/dist/chunks/{service-version-t1xa31vm.js → service-probe-ryy6kscr.js} +1 -1
- package/dist/chunks/{service-version-yqfhh888.js → service-probe-v1n69e13.js} +1 -1
- package/dist/chunks/{service-version-bah0qqxw.js → service-probe-xwk4fryp.js} +17 -17
- package/dist/chunks/{service-version-7f0py9js.js → service-probe-y2etg5bs.js} +2 -2
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +28 -0
- package/dist/effect/client.d.ts +7 -0
- package/dist/effect/client.js +12 -12
- package/dist/effect/generated/client-error.js +3 -3
- package/dist/effect/generated/client.d.ts +8 -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.js +6 -6
- package/dist/promise/client.d.ts +8 -0
- package/dist/promise/client.js +11 -11
- package/dist/promise/generated/client-error.js +3 -3
- package/dist/promise/generated/client.d.ts +9 -1
- package/dist/promise/generated/client.js +4 -4
- package/dist/promise/generated/index.js +10 -10
- package/dist/promise/generated/types.d.ts +30 -0
- 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 +6 -6
- 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.js +3 -3
- 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.js +9 -9
- package/dist/solid/index.js +12 -12
- package/dist/solid/pty.js +1 -1
- package/dist/solid/usage.js +1 -1
- package/package.json +5 -5
- package/dist/chunks/service-version-x61gkv37.js +0 -30
- /package/dist/chunks/{service-version-6mptkzbc.js → service-probe-6mptkzbc.js} +0 -0
- /package/dist/chunks/{service-version-8s2anffy.js → service-probe-8s2anffy.js} +0 -0
- /package/dist/chunks/{service-version-9rqn6x4v.js → service-probe-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{service-version-ezt8t3fk.js → service-probe-ezt8t3fk.js} +0 -0
- /package/dist/chunks/{service-version-gne7h7mq.js → service-probe-gne7h7mq.js} +0 -0
- /package/dist/chunks/{service-version-m2eywc8w.js → service-probe-m2eywc8w.js} +0 -0
- /package/dist/chunks/{service-version-qav6mfdz.js → service-probe-qav6mfdz.js} +0 -0
- /package/dist/chunks/{service-version-sxt88q69.js → service-probe-sxt88q69.js} +0 -0
- /package/dist/chunks/{service-version-ve4aws36.js → service-probe-ve4aws36.js} +0 -0
- /package/dist/chunks/{service-version-vmytr4q8.js → service-probe-vmytr4q8.js} +0 -0
- /package/dist/chunks/{service-version-vyas3vgt.js → service-probe-vyas3vgt.js} +0 -0
- /package/dist/chunks/{service-version-xgnj2w4v.js → service-probe-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{service-version-ydhz1zrh.js → service-probe-ydhz1zrh.js} +0 -0
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientApi2
|
|
3
|
-
} from "./service-
|
|
3
|
+
} from "./service-probe-vmytr4q8.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./service-
|
|
5
|
+
ClientError2
|
|
6
|
+
} from "./service-probe-y2etg5bs.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./service-
|
|
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: () => make3
|
|
15
15
|
});
|
|
16
16
|
import { Effect, Stream, Schema } from "effect";
|
|
17
17
|
import { Sse } from "effect/encoding";
|
|
18
18
|
import { HttpClientError } from "effect/http";
|
|
19
19
|
import { HttpApiClient } from "effect/http-api";
|
|
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)));
|
|
@@ -271,10 +271,19 @@ var adaptGroupModel = (raw) => ({
|
|
|
271
271
|
});
|
|
272
272
|
var EndpointGenerateText = (raw) => (input) => preserveEffect()(raw["generate.text"]({ payload: { prompt: input["prompt"], model: input["model"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
273
273
|
var adaptGroupGenerate = (raw) => ({ text: EndpointGenerateText(raw) });
|
|
274
|
+
var EndpointVoiceModels = (raw) => () => preserveEffect()(raw["voice.models"]({}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
274
275
|
var EndpointVoiceSession = (raw) => (input) => preserveEffect()(raw["voice.session"]({
|
|
275
276
|
payload: { model: input["model"], session: input["session"], transport: input["transport"] }
|
|
276
277
|
}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
277
|
-
var
|
|
278
|
+
var EndpointVoiceInstructions = (raw) => (input) => preserveEffect()(raw["voice.instructions"]({
|
|
279
|
+
params: { sessionID: input["sessionID"] },
|
|
280
|
+
payload: { instructions: input["instructions"] }
|
|
281
|
+
}).pipe(Effect.mapError(mapClientError)));
|
|
282
|
+
var adaptGroupVoice = (raw) => ({
|
|
283
|
+
models: EndpointVoiceModels(raw),
|
|
284
|
+
session: EndpointVoiceSession(raw),
|
|
285
|
+
instructions: EndpointVoiceInstructions(raw)
|
|
286
|
+
});
|
|
278
287
|
var EndpointProviderList = (raw) => (input) => preserveEffect()(raw["provider.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
279
288
|
var EndpointProviderGet = (raw) => (input) => preserveEffect()(raw["provider.get"]({ params: { providerID: input["providerID"] }, query: { location: input["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
280
289
|
var adaptGroupProvider = (raw) => ({
|
|
@@ -637,6 +646,6 @@ var adaptClient = (raw) => ({
|
|
|
637
646
|
websearch: adaptGroupWebsearch(raw["server.websearch"]),
|
|
638
647
|
config: adaptGroupConfig(raw["server.config"])
|
|
639
648
|
});
|
|
640
|
-
var
|
|
649
|
+
var make3 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
|
|
641
650
|
|
|
642
|
-
export {
|
|
651
|
+
export { make3, exports_client2 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultEnsureTiming2
|
|
3
|
-
} from "./service-
|
|
3
|
+
} from "./service-probe-xgnj2w4v.js";
|
|
4
4
|
import {
|
|
5
5
|
matchesVersion2
|
|
6
|
-
} from "./service-
|
|
6
|
+
} from "./service-probe-sxt88q69.js";
|
|
7
7
|
|
|
8
8
|
// src/service-probe.ts
|
|
9
9
|
import { homedir } from "node:os";
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
readError2,
|
|
4
4
|
event2,
|
|
5
5
|
eventType2
|
|
6
|
-
} from "./service-
|
|
6
|
+
} from "./service-probe-ryy6kscr.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./service-
|
|
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: () => make4
|
|
17
17
|
});
|
|
18
18
|
import { Effect, Stream } from "effect";
|
|
19
|
-
function
|
|
19
|
+
function make4(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 { make4, aborted2, exports_rpc };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
make7
|
|
3
|
+
} from "./service-probe-8bbb028w.js";
|
|
4
|
+
import {
|
|
5
|
+
make6
|
|
6
|
+
} from "./service-probe-g22sa7qz.js";
|
|
7
|
+
import {
|
|
8
|
+
makeRpc2
|
|
9
|
+
} from "./service-probe-6vp15eh6.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 };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./service-
|
|
2
|
+
ClientError3
|
|
3
|
+
} from "./service-probe-nwcpakzx.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./service-
|
|
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(`
|
|
@@ -652,6 +652,13 @@ function make3(options) {
|
|
|
652
652
|
}, requestOptions).then((value) => value.data)
|
|
653
653
|
},
|
|
654
654
|
voice: {
|
|
655
|
+
models: (requestOptions) => request({
|
|
656
|
+
method: "GET",
|
|
657
|
+
path: `/api/experimental/voice/models`,
|
|
658
|
+
successStatus: 200,
|
|
659
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
660
|
+
empty: false
|
|
661
|
+
}, requestOptions).then((value) => value.data),
|
|
655
662
|
session: (input, requestOptions) => request({
|
|
656
663
|
method: "POST",
|
|
657
664
|
path: `/api/experimental/voice/session`,
|
|
@@ -659,7 +666,15 @@ function make3(options) {
|
|
|
659
666
|
successStatus: 200,
|
|
660
667
|
declaredStatuses: [400, 401, 404, 503],
|
|
661
668
|
empty: false
|
|
662
|
-
}, requestOptions).then((value) => value.data)
|
|
669
|
+
}, requestOptions).then((value) => value.data),
|
|
670
|
+
instructions: (input, requestOptions) => request({
|
|
671
|
+
method: "POST",
|
|
672
|
+
path: `/api/experimental/voice/session/${encodeURIComponent(input.sessionID)}/instructions`,
|
|
673
|
+
body: { instructions: input["instructions"] },
|
|
674
|
+
successStatus: 204,
|
|
675
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
676
|
+
empty: true
|
|
677
|
+
}, requestOptions)
|
|
663
678
|
},
|
|
664
679
|
provider: {
|
|
665
680
|
list: (input, requestOptions) => request({
|
|
@@ -1461,20 +1476,20 @@ async function json(response) {
|
|
|
1461
1476
|
try {
|
|
1462
1477
|
await response.body?.cancel();
|
|
1463
1478
|
} catch {}
|
|
1464
|
-
throw new
|
|
1479
|
+
throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
|
|
1465
1480
|
}
|
|
1466
1481
|
let text;
|
|
1467
1482
|
try {
|
|
1468
1483
|
text = await response.text();
|
|
1469
1484
|
} catch (cause) {
|
|
1470
|
-
throw new
|
|
1485
|
+
throw new ClientError3("Transport", { cause });
|
|
1471
1486
|
}
|
|
1472
1487
|
if (text === "")
|
|
1473
|
-
throw new
|
|
1488
|
+
throw new ClientError3("MalformedResponse");
|
|
1474
1489
|
try {
|
|
1475
1490
|
return JSON.parse(text);
|
|
1476
1491
|
} catch (cause) {
|
|
1477
|
-
throw new
|
|
1492
|
+
throw new ClientError3("MalformedResponse", { cause });
|
|
1478
1493
|
}
|
|
1479
1494
|
}
|
|
1480
1495
|
function declared(body) {
|
|
@@ -1487,4 +1502,4 @@ function isContentType(response, expected) {
|
|
|
1487
1502
|
return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
|
|
1488
1503
|
}
|
|
1489
1504
|
|
|
1490
|
-
export {
|
|
1505
|
+
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 };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
make7
|
|
3
|
-
} from "./service-
|
|
3
|
+
} from "./service-probe-8bbb028w.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./service-
|
|
5
|
+
ClientError2
|
|
6
|
+
} from "./service-probe-y2etg5bs.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./service-
|
|
8
|
+
make3
|
|
9
|
+
} from "./service-probe-5r97ebd4.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
make4,
|
|
12
12
|
aborted2
|
|
13
|
-
} from "./service-
|
|
13
|
+
} from "./service-probe-9j12j8xw.js";
|
|
14
14
|
import {
|
|
15
15
|
__export
|
|
16
|
-
} from "./service-
|
|
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/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* make3(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(make4((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 };
|
|
@@ -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 };
|
package/dist/contract.js
CHANGED
package/dist/effect/api/api.d.ts
CHANGED
|
@@ -864,6 +864,7 @@ export type SessionLogOutput = ({
|
|
|
864
864
|
readonly response?: {
|
|
865
865
|
readonly body: string;
|
|
866
866
|
} | undefined;
|
|
867
|
+
readonly retryAfterMs?: number | undefined;
|
|
867
868
|
};
|
|
868
869
|
};
|
|
869
870
|
} | {
|
|
@@ -1106,6 +1107,7 @@ export type SessionLogOutput = ({
|
|
|
1106
1107
|
readonly response?: {
|
|
1107
1108
|
readonly body: string;
|
|
1108
1109
|
} | undefined;
|
|
1110
|
+
readonly retryAfterMs?: number | undefined;
|
|
1109
1111
|
};
|
|
1110
1112
|
readonly finish?: "content-filter" | undefined;
|
|
1111
1113
|
readonly rawFinish?: string | undefined;
|
|
@@ -1355,6 +1357,7 @@ export type SessionLogOutput = ({
|
|
|
1355
1357
|
readonly response?: {
|
|
1356
1358
|
readonly body: string;
|
|
1357
1359
|
} | undefined;
|
|
1360
|
+
readonly retryAfterMs?: number | undefined;
|
|
1358
1361
|
};
|
|
1359
1362
|
readonly content?: readonly [
|
|
1360
1363
|
({
|
|
@@ -1410,6 +1413,7 @@ export type SessionLogOutput = ({
|
|
|
1410
1413
|
readonly response?: {
|
|
1411
1414
|
readonly body: string;
|
|
1412
1415
|
} | undefined;
|
|
1416
|
+
readonly retryAfterMs?: number | undefined;
|
|
1413
1417
|
};
|
|
1414
1418
|
};
|
|
1415
1419
|
} | {
|
|
@@ -1492,6 +1496,7 @@ export type SessionLogOutput = ({
|
|
|
1492
1496
|
readonly response?: {
|
|
1493
1497
|
readonly body: string;
|
|
1494
1498
|
} | undefined;
|
|
1499
|
+
readonly retryAfterMs?: number | undefined;
|
|
1495
1500
|
};
|
|
1496
1501
|
readonly inputID?: SessionMessage.ID | undefined;
|
|
1497
1502
|
readonly cost?: Money.USD | undefined;
|
|
@@ -1794,6 +1799,18 @@ export type GenerateTextOperation<E = never> = (input: GenerateTextInput) => Eff
|
|
|
1794
1799
|
export interface GenerateApi<E = never> {
|
|
1795
1800
|
readonly text: GenerateTextOperation<E>;
|
|
1796
1801
|
}
|
|
1802
|
+
export type VoiceModelsOutput = {
|
|
1803
|
+
readonly models: ReadonlyArray<{
|
|
1804
|
+
readonly model: string;
|
|
1805
|
+
readonly provider: string;
|
|
1806
|
+
readonly transports: ReadonlyArray<"webrtc" | "websocket">;
|
|
1807
|
+
readonly available: boolean;
|
|
1808
|
+
readonly integration?: string | undefined;
|
|
1809
|
+
readonly workspace?: string | undefined;
|
|
1810
|
+
}>;
|
|
1811
|
+
readonly default?: string | undefined;
|
|
1812
|
+
};
|
|
1813
|
+
export type VoiceModelsOperation<E = never> = () => Effect.Effect<VoiceModelsOutput, E>;
|
|
1797
1814
|
export type VoiceSessionInput = {
|
|
1798
1815
|
readonly model: string;
|
|
1799
1816
|
readonly session?: {
|
|
@@ -1817,10 +1834,21 @@ export type VoiceSessionOutput = {
|
|
|
1817
1834
|
readonly token: string;
|
|
1818
1835
|
readonly expiresAt: number;
|
|
1819
1836
|
};
|
|
1837
|
+
readonly session?: {
|
|
1838
|
+
readonly id: string;
|
|
1839
|
+
} | undefined;
|
|
1820
1840
|
};
|
|
1821
1841
|
export type VoiceSessionOperation<E = never> = (input: VoiceSessionInput) => Effect.Effect<VoiceSessionOutput, E>;
|
|
1842
|
+
export type VoiceInstructionsInput = {
|
|
1843
|
+
readonly sessionID: string;
|
|
1844
|
+
readonly instructions: string;
|
|
1845
|
+
};
|
|
1846
|
+
export type VoiceInstructionsOutput = void;
|
|
1847
|
+
export type VoiceInstructionsOperation<E = never> = (input: VoiceInstructionsInput) => Effect.Effect<VoiceInstructionsOutput, E>;
|
|
1822
1848
|
export interface VoiceApi<E = never> {
|
|
1849
|
+
readonly models: VoiceModelsOperation<E>;
|
|
1823
1850
|
readonly session: VoiceSessionOperation<E>;
|
|
1851
|
+
readonly instructions: VoiceInstructionsOperation<E>;
|
|
1824
1852
|
}
|
|
1825
1853
|
export type ProviderListInput = {
|
|
1826
1854
|
readonly location?: {
|
package/dist/effect/client.d.ts
CHANGED
|
@@ -93,7 +93,9 @@ export declare const make: (options?: {
|
|
|
93
93
|
text: (input: import("./api.js").GenerateTextInput) => Effect.Effect<import("./api.js").GenerateTextOutput, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
94
94
|
};
|
|
95
95
|
voice: {
|
|
96
|
+
models: () => Effect.Effect<import("./api.js").VoiceModelsOutput, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
96
97
|
session: (input: import("./api.js").VoiceSessionInput) => Effect.Effect<import("./api.js").VoiceSessionOutput, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
98
|
+
instructions: (input: import("./api.js").VoiceInstructionsInput) => Effect.Effect<void, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
97
99
|
};
|
|
98
100
|
provider: {
|
|
99
101
|
list: (input?: import("./api.js").ProviderListInput) => Effect.Effect<import("./api.js").ProviderListOutput, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
@@ -816,6 +818,7 @@ export declare const make: (options?: {
|
|
|
816
818
|
readonly response?: {
|
|
817
819
|
readonly body: string;
|
|
818
820
|
} | undefined;
|
|
821
|
+
readonly retryAfterMs?: number | undefined;
|
|
819
822
|
};
|
|
820
823
|
};
|
|
821
824
|
} | {
|
|
@@ -1098,6 +1101,7 @@ export declare const make: (options?: {
|
|
|
1098
1101
|
readonly response?: {
|
|
1099
1102
|
readonly body: string;
|
|
1100
1103
|
} | undefined;
|
|
1104
|
+
readonly retryAfterMs?: number | undefined;
|
|
1101
1105
|
};
|
|
1102
1106
|
readonly finish?: "content-filter" | undefined;
|
|
1103
1107
|
readonly rawFinish?: string | undefined;
|
|
@@ -1426,6 +1430,7 @@ export declare const make: (options?: {
|
|
|
1426
1430
|
readonly response?: {
|
|
1427
1431
|
readonly body: string;
|
|
1428
1432
|
} | undefined;
|
|
1433
|
+
readonly retryAfterMs?: number | undefined;
|
|
1429
1434
|
};
|
|
1430
1435
|
readonly content?: readonly [{
|
|
1431
1436
|
readonly type: "text";
|
|
@@ -1480,6 +1485,7 @@ export declare const make: (options?: {
|
|
|
1480
1485
|
readonly response?: {
|
|
1481
1486
|
readonly body: string;
|
|
1482
1487
|
} | undefined;
|
|
1488
|
+
readonly retryAfterMs?: number | undefined;
|
|
1483
1489
|
};
|
|
1484
1490
|
};
|
|
1485
1491
|
} | {
|
|
@@ -1583,6 +1589,7 @@ export declare const make: (options?: {
|
|
|
1583
1589
|
readonly response?: {
|
|
1584
1590
|
readonly body: string;
|
|
1585
1591
|
} | undefined;
|
|
1592
|
+
readonly retryAfterMs?: number | undefined;
|
|
1586
1593
|
};
|
|
1587
1594
|
readonly inputID?: (string & import("effect/Brand").Brand<"Session.Message.ID">) | undefined;
|
|
1588
1595
|
readonly cost?: (number & import("effect/Brand").Brand<"Money.USD">) | undefined;
|
package/dist/effect/client.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../chunks/service-
|
|
5
|
-
import"../chunks/service-
|
|
6
|
-
import"../chunks/service-
|
|
7
|
-
import"../chunks/service-
|
|
8
|
-
import"../chunks/service-
|
|
9
|
-
import"../chunks/service-
|
|
10
|
-
import"../chunks/service-
|
|
11
|
-
import"../chunks/service-
|
|
2
|
+
make2,
|
|
3
|
+
exports_client
|
|
4
|
+
} from "../chunks/service-probe-xwk4fryp.js";
|
|
5
|
+
import"../chunks/service-probe-6mptkzbc.js";
|
|
6
|
+
import"../chunks/service-probe-5r97ebd4.js";
|
|
7
|
+
import"../chunks/service-probe-y2etg5bs.js";
|
|
8
|
+
import"../chunks/service-probe-9j12j8xw.js";
|
|
9
|
+
import"../chunks/service-probe-ryy6kscr.js";
|
|
10
|
+
import"../chunks/service-probe-vmytr4q8.js";
|
|
11
|
+
import"../chunks/service-probe-8bbb028w.js";
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
exports_client as OpenCode,
|
|
14
|
+
make2 as make
|
|
15
15
|
};
|