@opencode/client 0.0.0-dev-1301 → 0.0.0-dev-1302
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-qdgaygb4.js → contract-10v1erad.js} +56 -19
- package/dist/chunks/{service-contender-9j12j8xw.js → contract-18xz77sd.js} +5 -5
- package/dist/chunks/{service-contender-2ny4vxct.js → contract-2ny4vxct.js} +2 -2
- package/dist/chunks/{service-contender-k38jn95v.js → contract-5a9sek8y.js} +25 -10
- package/dist/chunks/{service-contender-y2etg5bs.js → contract-7f0py9js.js} +2 -2
- package/dist/chunks/{service-contender-632qbcnw.js → contract-7fbxmab6.js} +2 -2
- package/dist/chunks/{service-contender-sdjh9vmn.js → contract-b6kzr061.js} +4 -2
- package/dist/chunks/{service-contender-tztyfz1b.js → contract-dvkthykg.js} +1 -1
- package/dist/chunks/{service-contender-xqwq6bgr.js → contract-j9cqx0dj.js} +1 -1
- package/dist/chunks/{service-contender-nwcpakzx.js → contract-js54wxgp.js} +2 -2
- package/dist/chunks/{service-contender-13tw61t2.js → contract-k08hsd4a.js} +19 -19
- package/dist/chunks/{service-contender-ryy6kscr.js → contract-ryy6kscr.js} +1 -1
- package/dist/chunks/{service-contender-gecjxyvt.js → contract-sqcsh66p.js} +4 -4
- package/dist/chunks/contract-xc262c29.js +30 -0
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +22 -0
- package/dist/effect/client.d.ts +4 -0
- package/dist/effect/client.js +12 -12
- package/dist/effect/generated/client-error.js +3 -3
- package/dist/effect/generated/client.d.ts +5 -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 +7 -0
- package/dist/promise/client.js +11 -11
- package/dist/promise/generated/client-error.js +3 -3
- package/dist/promise/generated/client.d.ts +8 -1
- package/dist/promise/generated/client.js +4 -4
- package/dist/promise/generated/index.js +15 -11
- package/dist/promise/generated/types.d.ts +89 -8
- package/dist/promise/generated/types.js +6 -2
- package/dist/promise/index.js +19 -15
- package/dist/promise/media.d.ts +7 -0
- package/dist/promise/media.js +1 -1
- package/dist/promise/rpc.js +2 -2
- package/dist/promise/service.js +6 -6
- package/dist/pty-handoff.js +4 -4
- 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 +3 -3
- package/dist/solid/connection.js +1 -1
- package/dist/solid/data.js +10 -10
- package/dist/solid/index.js +14 -14
- package/dist/solid/pty.js +1 -1
- package/dist/solid/retention.js +1 -1
- package/dist/solid/usage.js +1 -1
- package/package.json +4 -4
- package/dist/chunks/service-contender-r3e1mxfs.js +0 -30
- /package/dist/chunks/{service-contender-3eaz3m83.js → contract-3eaz3m83.js} +0 -0
- /package/dist/chunks/{service-contender-60xe5cbf.js → contract-60xe5cbf.js} +0 -0
- /package/dist/chunks/{service-contender-6mptkzbc.js → contract-6mptkzbc.js} +0 -0
- /package/dist/chunks/{service-contender-6mq2wh8y.js → contract-6mq2wh8y.js} +0 -0
- /package/dist/chunks/{service-contender-6r38tsk5.js → contract-6r38tsk5.js} +0 -0
- /package/dist/chunks/{service-contender-8s2anffy.js → contract-8s2anffy.js} +0 -0
- /package/dist/chunks/{service-contender-9rqn6x4v.js → contract-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{service-contender-mwrzahmf.js → contract-mwrzahmf.js} +0 -0
- /package/dist/chunks/{service-contender-qav6mfdz.js → contract-qav6mfdz.js} +0 -0
- /package/dist/chunks/{service-contender-sxt88q69.js → contract-sxt88q69.js} +0 -0
- /package/dist/chunks/{service-contender-ve4aws36.js → contract-ve4aws36.js} +0 -0
- /package/dist/chunks/{service-contender-vyas3vgt.js → contract-vyas3vgt.js} +0 -0
- /package/dist/chunks/{service-contender-xgnj2w4v.js → contract-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{service-contender-ydhz1zrh.js → contract-ydhz1zrh.js} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
ClientError2
|
|
3
|
+
} from "./contract-js54wxgp.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-9rqn6x4v.js";
|
|
7
7
|
|
|
8
8
|
// src/promise/generated/client.ts
|
|
9
|
-
var
|
|
10
|
-
__export(
|
|
11
|
-
make: () =>
|
|
9
|
+
var exports_client2 = {};
|
|
10
|
+
__export(exports_client2, {
|
|
11
|
+
make: () => make3
|
|
12
12
|
});
|
|
13
13
|
var maxSseEventBytes = 16 * 1024 * 1024;
|
|
14
|
-
function
|
|
14
|
+
function make3(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 make6(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 ClientError2("Transport", { cause });
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
const responseError = async (response, descriptor) => {
|
|
@@ -53,7 +53,7 @@ function make6(options) {
|
|
|
53
53
|
try {
|
|
54
54
|
await response.body?.cancel();
|
|
55
55
|
} catch {}
|
|
56
|
-
throw new
|
|
56
|
+
throw new ClientError2("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 make6(options) {
|
|
|
78
78
|
try {
|
|
79
79
|
await response.body?.cancel();
|
|
80
80
|
} catch {}
|
|
81
|
-
throw new
|
|
81
|
+
throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
|
|
82
82
|
}
|
|
83
83
|
if (response.body === null)
|
|
84
|
-
throw new
|
|
84
|
+
throw new ClientError2("MalformedResponse");
|
|
85
85
|
const reader = response.body.getReader();
|
|
86
86
|
const decoder = new TextDecoder;
|
|
87
87
|
let buffer = "";
|
|
@@ -91,13 +91,13 @@ function make6(options) {
|
|
|
91
91
|
try {
|
|
92
92
|
next = await reader.read();
|
|
93
93
|
} catch (cause) {
|
|
94
|
-
throw new
|
|
94
|
+
throw new ClientError2("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 ClientError2("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 make6(options) {
|
|
|
124
124
|
try {
|
|
125
125
|
yield JSON.parse(data);
|
|
126
126
|
} catch (cause) {
|
|
127
|
-
throw new
|
|
127
|
+
throw new ClientError2("MalformedResponse", { cause });
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
boundary = buffer.indexOf(`
|
|
@@ -648,6 +648,33 @@ function make6(options) {
|
|
|
648
648
|
declaredStatuses: [400, 401, 404, 422, 502, 503],
|
|
649
649
|
empty: false
|
|
650
650
|
}, requestOptions).then((value) => value.data),
|
|
651
|
+
video: {
|
|
652
|
+
create: (input, requestOptions) => request({
|
|
653
|
+
method: "POST",
|
|
654
|
+
path: `/api/experimental/generate/video`,
|
|
655
|
+
body: {
|
|
656
|
+
model: input["model"],
|
|
657
|
+
prompt: input["prompt"],
|
|
658
|
+
start: input["start"],
|
|
659
|
+
end: input["end"],
|
|
660
|
+
references: input["references"],
|
|
661
|
+
duration: input["duration"],
|
|
662
|
+
aspect: input["aspect"],
|
|
663
|
+
resolution: input["resolution"],
|
|
664
|
+
sound: input["sound"]
|
|
665
|
+
},
|
|
666
|
+
successStatus: 200,
|
|
667
|
+
declaredStatuses: [400, 401, 403, 404, 422, 502, 503],
|
|
668
|
+
empty: false
|
|
669
|
+
}, requestOptions).then((value) => value.data),
|
|
670
|
+
get: (input, requestOptions) => request({
|
|
671
|
+
method: "GET",
|
|
672
|
+
path: `/api/experimental/generate/video/${encodeURIComponent(input.id)}`,
|
|
673
|
+
successStatus: 200,
|
|
674
|
+
declaredStatuses: [400, 401, 403, 404],
|
|
675
|
+
empty: false
|
|
676
|
+
}, requestOptions).then((value) => value.data)
|
|
677
|
+
},
|
|
651
678
|
decisions: (input, requestOptions) => request({
|
|
652
679
|
method: "POST",
|
|
653
680
|
path: `/api/experimental/generate/decisions`,
|
|
@@ -856,6 +883,16 @@ function make6(options) {
|
|
|
856
883
|
binary: true
|
|
857
884
|
}, requestOptions)
|
|
858
885
|
},
|
|
886
|
+
blob: {
|
|
887
|
+
get: (input, requestOptions) => request({
|
|
888
|
+
method: "GET",
|
|
889
|
+
path: `/api/experimental/blob/${encodeURIComponent(input.id)}`,
|
|
890
|
+
successStatus: 200,
|
|
891
|
+
declaredStatuses: [400, 401, 404],
|
|
892
|
+
empty: false,
|
|
893
|
+
binary: true
|
|
894
|
+
}, requestOptions)
|
|
895
|
+
},
|
|
859
896
|
schedule: {
|
|
860
897
|
create: (input, requestOptions) => request({
|
|
861
898
|
method: "POST",
|
|
@@ -1782,20 +1819,20 @@ async function json(response) {
|
|
|
1782
1819
|
try {
|
|
1783
1820
|
await response.body?.cancel();
|
|
1784
1821
|
} catch {}
|
|
1785
|
-
throw new
|
|
1822
|
+
throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
|
|
1786
1823
|
}
|
|
1787
1824
|
let text;
|
|
1788
1825
|
try {
|
|
1789
1826
|
text = await response.text();
|
|
1790
1827
|
} catch (cause) {
|
|
1791
|
-
throw new
|
|
1828
|
+
throw new ClientError2("Transport", { cause });
|
|
1792
1829
|
}
|
|
1793
1830
|
if (text === "")
|
|
1794
|
-
throw new
|
|
1831
|
+
throw new ClientError2("MalformedResponse");
|
|
1795
1832
|
try {
|
|
1796
1833
|
return JSON.parse(text);
|
|
1797
1834
|
} catch (cause) {
|
|
1798
|
-
throw new
|
|
1835
|
+
throw new ClientError2("MalformedResponse", { cause });
|
|
1799
1836
|
}
|
|
1800
1837
|
}
|
|
1801
1838
|
function declared(body) {
|
|
@@ -1808,4 +1845,4 @@ function isContentType(response, expected) {
|
|
|
1808
1845
|
return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
|
|
1809
1846
|
}
|
|
1810
1847
|
|
|
1811
|
-
export {
|
|
1848
|
+
export { make3, exports_client2 };
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
readError2,
|
|
4
4
|
event2,
|
|
5
5
|
eventType2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-ryy6kscr.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./contract-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: () => make7
|
|
17
17
|
});
|
|
18
18
|
import { Effect, Stream } from "effect";
|
|
19
|
-
function
|
|
19
|
+
function make7(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 { make7, aborted2, exports_rpc };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultEnsureTiming2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./contract-xgnj2w4v.js";
|
|
4
4
|
import {
|
|
5
5
|
matchesVersion2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-sxt88q69.js";
|
|
7
7
|
|
|
8
8
|
// src/service-probe.ts
|
|
9
9
|
import { homedir } from "node:os";
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientApi2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./contract-60xe5cbf.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./
|
|
5
|
+
ClientError3
|
|
6
|
+
} from "./contract-7f0py9js.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./contract-9rqn6x4v.js";
|
|
10
10
|
|
|
11
11
|
// src/effect/generated/client.ts
|
|
12
|
-
var
|
|
13
|
-
__export(
|
|
14
|
-
make: () =>
|
|
12
|
+
var exports_client4 = {};
|
|
13
|
+
__export(exports_client4, {
|
|
14
|
+
make: () => make5
|
|
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 ClientError3({ 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)));
|
|
@@ -284,12 +284,27 @@ var EndpointExperimentalGenerateImage = (raw) => (input) => preserveEffect()(raw
|
|
|
284
284
|
resolution: input["resolution"]
|
|
285
285
|
}
|
|
286
286
|
}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
287
|
+
var EndpointExperimentalGenerateVideoCreate = (raw) => (input) => preserveEffect()(raw["generate.video.create"]({
|
|
288
|
+
payload: {
|
|
289
|
+
model: input["model"],
|
|
290
|
+
prompt: input["prompt"],
|
|
291
|
+
start: input["start"],
|
|
292
|
+
end: input["end"],
|
|
293
|
+
references: input["references"],
|
|
294
|
+
duration: input["duration"],
|
|
295
|
+
aspect: input["aspect"],
|
|
296
|
+
resolution: input["resolution"],
|
|
297
|
+
sound: input["sound"]
|
|
298
|
+
}
|
|
299
|
+
}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
300
|
+
var EndpointExperimentalGenerateVideoGet = (raw) => (input) => preserveEffect()(raw["generate.video.get"]({ params: { id: input["id"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
287
301
|
var EndpointExperimentalGenerateDecisions = (raw) => (input) => preserveEffect()(raw["generate.decisions"]({
|
|
288
302
|
payload: { model: input["model"], input: input["input"], questions: input["questions"] }
|
|
289
303
|
}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
290
304
|
var adaptGroupExperimentalGenerate = (raw) => ({
|
|
291
305
|
text: EndpointExperimentalGenerateText(raw),
|
|
292
306
|
image: EndpointExperimentalGenerateImage(raw),
|
|
307
|
+
video: { create: EndpointExperimentalGenerateVideoCreate(raw), get: EndpointExperimentalGenerateVideoGet(raw) },
|
|
293
308
|
decisions: EndpointExperimentalGenerateDecisions(raw)
|
|
294
309
|
});
|
|
295
310
|
var EndpointExperimentalVoiceModels = (raw) => () => preserveEffect()(raw["voice.models"]({}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
@@ -832,6 +847,6 @@ var adaptClient = (raw) => {
|
|
|
832
847
|
}
|
|
833
848
|
};
|
|
834
849
|
};
|
|
835
|
-
var
|
|
850
|
+
var make5 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
|
|
836
851
|
|
|
837
|
-
export {
|
|
852
|
+
export { make5, exports_client4 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// src/effect/generated/client-error.ts
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
|
|
4
|
-
class
|
|
4
|
+
class ClientError3 extends Schema.TaggedError()("ClientError", {
|
|
5
5
|
cause: Schema.Defect()
|
|
6
6
|
}) {
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { ClientError3 };
|
|
@@ -22,11 +22,12 @@ var isProviderNotFoundError2 = (value) => typeof value === "object" && value !==
|
|
|
22
22
|
var isModelNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ModelNotFoundError";
|
|
23
23
|
var isUnsupportedModelError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "UnsupportedModelError";
|
|
24
24
|
var isProviderRequestError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ProviderRequestError";
|
|
25
|
+
var isForbiddenError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ForbiddenError";
|
|
26
|
+
var isVideoNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VideoNotFoundError";
|
|
25
27
|
var isIntegrationNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationNotFoundError";
|
|
26
28
|
var isIntegrationAttemptNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationAttemptNotFoundError";
|
|
27
29
|
var isIntegrationMethodNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationMethodNotFoundError";
|
|
28
30
|
var isMcpServerNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "McpServerNotFoundError";
|
|
29
|
-
var isForbiddenError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ForbiddenError";
|
|
30
31
|
var isProjectNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ProjectNotFoundError";
|
|
31
32
|
var isPermissionSavedNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionSavedNotFoundError";
|
|
32
33
|
var isPermissionNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionNotFoundError";
|
|
@@ -35,10 +36,11 @@ var isRpcError2 = (value) => typeof value === "object" && value !== null && ("_t
|
|
|
35
36
|
var isRpcInternalError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "RpcInternalError";
|
|
36
37
|
var isPtyNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PtyNotFoundError";
|
|
37
38
|
var isPtyFeatureUnsupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PtyFeatureUnsupportedError";
|
|
39
|
+
var isBlobNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "BlobNotFoundError";
|
|
38
40
|
var isScheduleNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ScheduleNotFoundError";
|
|
39
41
|
var isArtifactNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ArtifactNotFoundError";
|
|
40
42
|
var isShellNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ShellNotFoundError";
|
|
41
43
|
var isWorktreeError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "WorktreeError";
|
|
42
44
|
var isVcsInitNotSupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VcsInitNotSupportedError";
|
|
43
45
|
|
|
44
|
-
export { isInvalidRequestError2, isUnauthorizedError2, isLocationNotFoundError2, isServiceUnavailableError2, isAgentNotFoundError2, isPluginNotFoundError2, isInvalidCursorError2, isSessionNotFoundError2, isMessageNotFoundError2, isConflictError2, isCommandNotFoundError2, isCommandExecutionError2, isSessionBusyError2, isUnknownError2, isFormNotFoundError2, isFormInvalidAnswerError2, isFormAlreadySettledError2, isSkillNotFoundError2, isInstructionEntryValueTooLargeError2, isProviderNotFoundError2, isModelNotFoundError2, isUnsupportedModelError2, isProviderRequestError2, isIntegrationNotFoundError2, isIntegrationAttemptNotFoundError2, isIntegrationMethodNotFoundError2, isMcpServerNotFoundError2,
|
|
46
|
+
export { isInvalidRequestError2, isUnauthorizedError2, isLocationNotFoundError2, isServiceUnavailableError2, isAgentNotFoundError2, isPluginNotFoundError2, isInvalidCursorError2, isSessionNotFoundError2, isMessageNotFoundError2, isConflictError2, isCommandNotFoundError2, isCommandExecutionError2, isSessionBusyError2, isUnknownError2, isFormNotFoundError2, isFormInvalidAnswerError2, isFormAlreadySettledError2, isSkillNotFoundError2, isInstructionEntryValueTooLargeError2, isProviderNotFoundError2, isModelNotFoundError2, isUnsupportedModelError2, isProviderRequestError2, isForbiddenError2, isVideoNotFoundError2, isIntegrationNotFoundError2, isIntegrationAttemptNotFoundError2, isIntegrationMethodNotFoundError2, isMcpServerNotFoundError2, isProjectNotFoundError2, isPermissionSavedNotFoundError2, isPermissionNotFoundError2, isFileNotFoundError2, isRpcError2, isRpcInternalError2, isPtyNotFoundError2, isPtyFeatureUnsupportedError2, isBlobNotFoundError2, isScheduleNotFoundError2, isArtifactNotFoundError2, isShellNotFoundError2, isWorktreeError2, isVcsInitNotSupportedError2 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/promise/generated/client-error.ts
|
|
2
|
-
class
|
|
2
|
+
class ClientError2 extends Error {
|
|
3
3
|
reason;
|
|
4
4
|
name = "ClientError";
|
|
5
5
|
constructor(reason, options) {
|
|
@@ -9,4 +9,4 @@ class ClientError3 extends Error {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export {
|
|
12
|
+
export { ClientError2 };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
make6
|
|
3
|
+
} from "./contract-sqcsh66p.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./
|
|
5
|
+
ClientError3
|
|
6
|
+
} from "./contract-7f0py9js.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./
|
|
8
|
+
make5
|
|
9
|
+
} from "./contract-5a9sek8y.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
make7,
|
|
12
12
|
aborted2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./contract-18xz77sd.js";
|
|
14
14
|
import {
|
|
15
15
|
__export
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./contract-9rqn6x4v.js";
|
|
17
17
|
|
|
18
18
|
// src/effect/client.ts
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
OpenCode: () =>
|
|
22
|
-
make: () =>
|
|
19
|
+
var exports_client3 = {};
|
|
20
|
+
__export(exports_client3, {
|
|
21
|
+
OpenCode: () => exports_client3,
|
|
22
|
+
make: () => make4
|
|
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 make4 = Effect.fn("OpenCode.make")(function* (options) {
|
|
32
32
|
const httpClient = yield* HttpClient.HttpClient;
|
|
33
|
-
const raw = yield*
|
|
33
|
+
const raw = yield* make5(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
|
|
|
@@ -40,13 +40,13 @@ var make2 = Effect.fn("OpenCode.make")(function* (options) {
|
|
|
40
40
|
this.cause = cause;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
const shared =
|
|
44
|
-
const subscribe = (input) => Stream.fromAsyncIterable(shared.subscribe({ types: input?.types }), (error) => error).pipe(Stream.catch((error) => Stream.failCause(error instanceof EventFailure ? error.cause : Cause.fail(new
|
|
43
|
+
const shared = make6((signal) => Stream.toAsyncIterableWith(native.pipe(Stream.interruptWhen(aborted2(signal)), Stream.catchCause((cause) => Stream.fail(new EventFailure(cause)))), context));
|
|
44
|
+
const subscribe = (input) => Stream.fromAsyncIterable(shared.subscribe({ types: input?.types }), (error) => error).pipe(Stream.catch((error) => Stream.failCause(error instanceof EventFailure ? error.cause : Cause.fail(new ClientError3({ cause: error })))));
|
|
45
45
|
return {
|
|
46
46
|
...raw,
|
|
47
47
|
event: { ...raw.event, subscribe },
|
|
48
|
-
rpc: Object.assign(
|
|
48
|
+
rpc: Object.assign(make7((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 { make4, exports_client3 };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__export
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./contract-9rqn6x4v.js";
|
|
4
4
|
|
|
5
5
|
// src/shared-events.ts
|
|
6
6
|
var exports_shared_events = {};
|
|
7
7
|
__export(exports_shared_events, {
|
|
8
8
|
SharedEvents: () => exports_shared_events,
|
|
9
|
-
make: () =>
|
|
9
|
+
make: () => make6
|
|
10
10
|
});
|
|
11
|
-
function
|
|
11
|
+
function make6(connect) {
|
|
12
12
|
let current;
|
|
13
13
|
const capacity = 4096;
|
|
14
14
|
function stop(connection) {
|
|
@@ -146,4 +146,4 @@ function make7(connect) {
|
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export {
|
|
149
|
+
export { make6, exports_shared_events };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
make6
|
|
3
|
+
} from "./contract-sqcsh66p.js";
|
|
4
|
+
import {
|
|
5
|
+
make3
|
|
6
|
+
} from "./contract-10v1erad.js";
|
|
7
|
+
import {
|
|
8
|
+
makeRpc2
|
|
9
|
+
} from "./contract-j9cqx0dj.js";
|
|
10
|
+
import {
|
|
11
|
+
__export
|
|
12
|
+
} from "./contract-9rqn6x4v.js";
|
|
13
|
+
|
|
14
|
+
// src/promise/client.ts
|
|
15
|
+
var exports_client = {};
|
|
16
|
+
__export(exports_client, {
|
|
17
|
+
OpenCode: () => exports_client,
|
|
18
|
+
make: () => make2
|
|
19
|
+
});
|
|
20
|
+
function make2(options) {
|
|
21
|
+
const raw = make3(options);
|
|
22
|
+
const events = make6((signal, onActivity) => raw.event.subscribe(undefined, { signal, onActivity }));
|
|
23
|
+
return {
|
|
24
|
+
...raw,
|
|
25
|
+
rpc: Object.assign(makeRpc2(raw, events), raw.rpc),
|
|
26
|
+
event: events
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { make2, exports_client };
|
package/dist/contract.js
CHANGED
package/dist/effect/api/api.d.ts
CHANGED
|
@@ -1881,6 +1881,24 @@ export type ExperimentalGenerateImageInput = {
|
|
|
1881
1881
|
};
|
|
1882
1882
|
export type ExperimentalGenerateImageOutput = Generate.ImageResult;
|
|
1883
1883
|
export type ExperimentalGenerateImageOperation<E = never> = (input: ExperimentalGenerateImageInput) => Effect.Effect<ExperimentalGenerateImageOutput, E>;
|
|
1884
|
+
export type ExperimentalGenerateVideoCreateInput = {
|
|
1885
|
+
readonly model: Model.Ref;
|
|
1886
|
+
readonly prompt: string;
|
|
1887
|
+
readonly start?: Generate.ImageFile | undefined;
|
|
1888
|
+
readonly end?: Generate.ImageFile | undefined;
|
|
1889
|
+
readonly references?: ReadonlyArray<Generate.File> | undefined;
|
|
1890
|
+
readonly duration?: number | undefined;
|
|
1891
|
+
readonly aspect?: Generate.VideoAspect | undefined;
|
|
1892
|
+
readonly resolution?: Generate.VideoResolution | undefined;
|
|
1893
|
+
readonly sound?: boolean | undefined;
|
|
1894
|
+
};
|
|
1895
|
+
export type ExperimentalGenerateVideoCreateOutput = Generate.VideoRunning;
|
|
1896
|
+
export type ExperimentalGenerateVideoCreateOperation<E = never> = (input: ExperimentalGenerateVideoCreateInput) => Effect.Effect<ExperimentalGenerateVideoCreateOutput, E>;
|
|
1897
|
+
export type ExperimentalGenerateVideoGetInput = {
|
|
1898
|
+
readonly id: Generate.VideoID;
|
|
1899
|
+
};
|
|
1900
|
+
export type ExperimentalGenerateVideoGetOutput = Generate.VideoJob;
|
|
1901
|
+
export type ExperimentalGenerateVideoGetOperation<E = never> = (input: ExperimentalGenerateVideoGetInput) => Effect.Effect<ExperimentalGenerateVideoGetOutput, E>;
|
|
1884
1902
|
export type ExperimentalGenerateDecisionsInput = {
|
|
1885
1903
|
readonly model: Model.Ref;
|
|
1886
1904
|
readonly input: ReadonlyArray<Generate.DecisionPart>;
|
|
@@ -1891,6 +1909,10 @@ export type ExperimentalGenerateDecisionsOperation<E = never> = (input: Experime
|
|
|
1891
1909
|
export interface ExperimentalGenerateApi<E = never> {
|
|
1892
1910
|
readonly text: ExperimentalGenerateTextOperation<E>;
|
|
1893
1911
|
readonly image: ExperimentalGenerateImageOperation<E>;
|
|
1912
|
+
readonly video: {
|
|
1913
|
+
readonly create: ExperimentalGenerateVideoCreateOperation<E>;
|
|
1914
|
+
readonly get: ExperimentalGenerateVideoGetOperation<E>;
|
|
1915
|
+
};
|
|
1894
1916
|
readonly decisions: ExperimentalGenerateDecisionsOperation<E>;
|
|
1895
1917
|
}
|
|
1896
1918
|
export type ExperimentalVoiceModelsOutput = {
|
package/dist/effect/client.d.ts
CHANGED
|
@@ -310,6 +310,10 @@ export declare const make: (options?: {
|
|
|
310
310
|
generate: {
|
|
311
311
|
text: (input: import("./api.js").ExperimentalGenerateTextInput) => Effect.Effect<import("./api.js").ExperimentalGenerateTextOutput, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").ModelNotFoundError | import("@opencode/protocol/errors").ProviderNotFoundError | import("@opencode/protocol/errors").ProviderRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").UnsupportedModelError, never>;
|
|
312
312
|
image: (input: import("./api.js").ExperimentalGenerateImageInput) => Effect.Effect<import("@opencode/schema/generate").ImageResult, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").ModelNotFoundError | import("@opencode/protocol/errors").ProviderNotFoundError | import("@opencode/protocol/errors").ProviderRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").UnsupportedModelError, never>;
|
|
313
|
+
video: {
|
|
314
|
+
create: (input: import("./api.js").ExperimentalGenerateVideoCreateInput) => Effect.Effect<import("@opencode/schema/generate").VideoRunning, ClientError | import("@opencode/protocol/errors").ForbiddenError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").ModelNotFoundError | import("@opencode/protocol/errors").ProviderNotFoundError | import("@opencode/protocol/errors").ProviderRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").UnsupportedModelError, never>;
|
|
315
|
+
get: (input: import("./api.js").ExperimentalGenerateVideoGetInput) => Effect.Effect<import("@opencode/schema/generate").VideoJob, ClientError | import("@opencode/protocol/errors").ForbiddenError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").VideoNotFoundError, never>;
|
|
316
|
+
};
|
|
313
317
|
decisions: (input: import("./api.js").ExperimentalGenerateDecisionsInput) => Effect.Effect<import("@opencode/schema/generate").DecisionResult, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").ModelNotFoundError | import("@opencode/protocol/errors").ProviderNotFoundError | import("@opencode/protocol/errors").ProviderRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").UnsupportedModelError, never>;
|
|
314
318
|
};
|
|
315
319
|
voice: {
|
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
|
+
make4,
|
|
3
|
+
exports_client3
|
|
4
|
+
} from "../chunks/contract-k08hsd4a.js";
|
|
5
|
+
import"../chunks/contract-6mptkzbc.js";
|
|
6
|
+
import"../chunks/contract-5a9sek8y.js";
|
|
7
|
+
import"../chunks/contract-7f0py9js.js";
|
|
8
|
+
import"../chunks/contract-sqcsh66p.js";
|
|
9
|
+
import"../chunks/contract-18xz77sd.js";
|
|
10
|
+
import"../chunks/contract-60xe5cbf.js";
|
|
11
|
+
import"../chunks/contract-ryy6kscr.js";
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
exports_client3 as OpenCode,
|
|
14
|
+
make4 as make
|
|
15
15
|
};
|