@opencode/client 2.2.5 → 2.2.7
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/{rpc-runtime-anregfhs.js → shared-events-15p82y03.js} +5 -5
- package/dist/chunks/{rpc-runtime-8ye1ye6f.js → shared-events-2ny4vxct.js} +2 -2
- package/dist/chunks/{rpc-runtime-6ffmhce9.js → shared-events-2r38e168.js} +20 -11
- package/dist/chunks/{rpc-runtime-vrtmt90e.js → shared-events-c49mnkv6.js} +17 -17
- package/dist/chunks/shared-events-dqjrwhzg.js +30 -0
- package/dist/chunks/{rpc-runtime-gecjxyvt.js → shared-events-gecjxyvt.js} +1 -1
- package/dist/chunks/{rpc-runtime-js54wxgp.js → shared-events-nwcpakzx.js} +2 -2
- package/dist/chunks/{rpc-runtime-t2ajednw.js → shared-events-qdgaygb4.js} +35 -20
- package/dist/chunks/{rpc-runtime-ryy6kscr.js → shared-events-ryy6kscr.js} +1 -1
- package/dist/chunks/{rpc-runtime-tq7qack3.js → shared-events-xj1v5np5.js} +2 -2
- package/dist/chunks/{rpc-runtime-xqwq6bgr.js → shared-events-xqwq6bgr.js} +1 -1
- package/dist/chunks/{rpc-runtime-7f0py9js.js → shared-events-y2etg5bs.js} +2 -2
- package/dist/chunks/{rpc-runtime-sbaynanj.js → shared-events-yn39sb5p.js} +6 -1
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +24 -2
- package/dist/effect/client.d.ts +10 -4
- package/dist/effect/client.js +12 -12
- package/dist/effect/generated/client-error.js +3 -3
- package/dist/effect/generated/client.d.ts +11 -5
- 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 +5 -0
- package/dist/promise/client.js +11 -11
- package/dist/promise/generated/client-error.js +3 -3
- package/dist/promise/generated/client.d.ts +6 -1
- package/dist/promise/generated/client.js +4 -4
- package/dist/promise/generated/index.js +9 -9
- package/dist/promise/generated/types.d.ts +81 -12
- package/dist/promise/generated/types.js +1 -1
- package/dist/promise/index.js +17 -17
- package/dist/promise/media.d.ts +5 -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 +1 -1
- 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 +26 -26
- package/dist/chunks/rpc-runtime-wbnz2gjn.js +0 -30
- /package/dist/chunks/{rpc-runtime-3eaz3m83.js → shared-events-3eaz3m83.js} +0 -0
- /package/dist/chunks/{rpc-runtime-60xe5cbf.js → shared-events-60xe5cbf.js} +0 -0
- /package/dist/chunks/{rpc-runtime-6mptkzbc.js → shared-events-6mptkzbc.js} +0 -0
- /package/dist/chunks/{rpc-runtime-6mq2wh8y.js → shared-events-6mq2wh8y.js} +0 -0
- /package/dist/chunks/{rpc-runtime-6r38tsk5.js → shared-events-6r38tsk5.js} +0 -0
- /package/dist/chunks/{rpc-runtime-8s2anffy.js → shared-events-8s2anffy.js} +0 -0
- /package/dist/chunks/{rpc-runtime-9rqn6x4v.js → shared-events-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{rpc-runtime-mwrzahmf.js → shared-events-mwrzahmf.js} +0 -0
- /package/dist/chunks/{rpc-runtime-qav6mfdz.js → shared-events-qav6mfdz.js} +0 -0
- /package/dist/chunks/{rpc-runtime-sdjh9vmn.js → shared-events-sdjh9vmn.js} +0 -0
- /package/dist/chunks/{rpc-runtime-sxt88q69.js → shared-events-sxt88q69.js} +0 -0
- /package/dist/chunks/{rpc-runtime-ve4aws36.js → shared-events-ve4aws36.js} +0 -0
- /package/dist/chunks/{rpc-runtime-vyas3vgt.js → shared-events-vyas3vgt.js} +0 -0
- /package/dist/chunks/{rpc-runtime-xgnj2w4v.js → shared-events-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{rpc-runtime-ydhz1zrh.js → shared-events-ydhz1zrh.js} +0 -0
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
readError2,
|
|
4
4
|
event2,
|
|
5
5
|
eventType2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./shared-events-ryy6kscr.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./shared-events-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,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultEnsureTiming2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./shared-events-xgnj2w4v.js";
|
|
4
4
|
import {
|
|
5
5
|
matchesVersion2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./shared-events-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 "./shared-events-60xe5cbf.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./
|
|
5
|
+
ClientError2
|
|
6
|
+
} from "./shared-events-y2etg5bs.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./shared-events-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/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)));
|
|
@@ -591,6 +591,14 @@ var EndpointExperimentalArtifactsDelete = (raw) => (input) => preserveEffect()(r
|
|
|
591
591
|
params: { artifactID: input["artifactID"] },
|
|
592
592
|
query: { location: input["location"] }
|
|
593
593
|
}).pipe(Effect.mapError(mapClientError)));
|
|
594
|
+
var EndpointExperimentalJobList = (raw) => (input) => preserveEffect()(raw["job.list"]({
|
|
595
|
+
query: {
|
|
596
|
+
sessionID: input?.["sessionID"],
|
|
597
|
+
kind: input?.["kind"],
|
|
598
|
+
status: input?.["status"],
|
|
599
|
+
descendants: input?.["descendants"]
|
|
600
|
+
}
|
|
601
|
+
}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
594
602
|
var adaptGroupExperimental = (raw) => ({
|
|
595
603
|
persistentPty: {
|
|
596
604
|
read: EndpointExperimentalPersistentPtyRead(raw),
|
|
@@ -619,7 +627,8 @@ var adaptGroupExperimental = (raw) => ({
|
|
|
619
627
|
get: EndpointExperimentalArtifactsGet(raw),
|
|
620
628
|
update: EndpointExperimentalArtifactsUpdate(raw),
|
|
621
629
|
delete: EndpointExperimentalArtifactsDelete(raw)
|
|
622
|
-
}
|
|
630
|
+
},
|
|
631
|
+
job: { list: EndpointExperimentalJobList(raw) }
|
|
623
632
|
});
|
|
624
633
|
var EndpointShellList = (raw) => (input) => preserveEffect()(raw["shell.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
625
634
|
var EndpointShellCreate = (raw) => (input) => preserveEffect()(raw["shell.create"]({
|
|
@@ -823,6 +832,6 @@ var adaptClient = (raw) => {
|
|
|
823
832
|
}
|
|
824
833
|
};
|
|
825
834
|
};
|
|
826
|
-
var
|
|
835
|
+
var make4 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
|
|
827
836
|
|
|
828
|
-
export {
|
|
837
|
+
export { make4, exports_client2 };
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
make7
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./shared-events-gecjxyvt.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./
|
|
5
|
+
ClientError2
|
|
6
|
+
} from "./shared-events-y2etg5bs.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./
|
|
8
|
+
make4
|
|
9
|
+
} from "./shared-events-2r38e168.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
make3,
|
|
12
12
|
aborted2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./shared-events-15p82y03.js";
|
|
14
14
|
import {
|
|
15
15
|
__export
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./shared-events-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* 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 = (input) => Stream.fromAsyncIterable(shared.subscribe({ types: input?.types }), (error) => error).pipe(Stream.catch((error) => Stream.failCause(error instanceof EventFailure ? error.cause : Cause.fail(new
|
|
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 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 "./shared-events-gecjxyvt.js";
|
|
4
|
+
import {
|
|
5
|
+
make6
|
|
6
|
+
} from "./shared-events-qdgaygb4.js";
|
|
7
|
+
import {
|
|
8
|
+
makeRpc2
|
|
9
|
+
} from "./shared-events-xqwq6bgr.js";
|
|
10
|
+
import {
|
|
11
|
+
__export
|
|
12
|
+
} from "./shared-events-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(undefined, { 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,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,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
ClientError3
|
|
3
|
+
} from "./shared-events-nwcpakzx.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./shared-events-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(`
|
|
@@ -177,7 +177,7 @@ function make3(options) {
|
|
|
177
177
|
path: `/api/agent`,
|
|
178
178
|
query: { location: input?.["location"] },
|
|
179
179
|
successStatus: 200,
|
|
180
|
-
declaredStatuses: [400, 401, 404
|
|
180
|
+
declaredStatuses: [400, 401, 404],
|
|
181
181
|
empty: false
|
|
182
182
|
}, requestOptions),
|
|
183
183
|
get: (input, requestOptions) => request({
|
|
@@ -982,6 +982,21 @@ function make3(options) {
|
|
|
982
982
|
binary: true
|
|
983
983
|
}, requestOptions)
|
|
984
984
|
},
|
|
985
|
+
job: {
|
|
986
|
+
list: (input, requestOptions) => request({
|
|
987
|
+
method: "GET",
|
|
988
|
+
path: `/api/experimental/job`,
|
|
989
|
+
query: {
|
|
990
|
+
sessionID: input?.["sessionID"],
|
|
991
|
+
kind: input?.["kind"],
|
|
992
|
+
status: input?.["status"],
|
|
993
|
+
descendants: input?.["descendants"]
|
|
994
|
+
},
|
|
995
|
+
successStatus: 200,
|
|
996
|
+
declaredStatuses: [400, 401, 404],
|
|
997
|
+
empty: false
|
|
998
|
+
}, requestOptions).then((value) => value.data)
|
|
999
|
+
},
|
|
985
1000
|
migration: {
|
|
986
1001
|
v1: {
|
|
987
1002
|
status: (requestOptions) => request({
|
|
@@ -1767,20 +1782,20 @@ async function json(response) {
|
|
|
1767
1782
|
try {
|
|
1768
1783
|
await response.body?.cancel();
|
|
1769
1784
|
} catch {}
|
|
1770
|
-
throw new
|
|
1785
|
+
throw new ClientError3("UnsupportedContentType", { detail: response.headers.get("content-type") });
|
|
1771
1786
|
}
|
|
1772
1787
|
let text;
|
|
1773
1788
|
try {
|
|
1774
1789
|
text = await response.text();
|
|
1775
1790
|
} catch (cause) {
|
|
1776
|
-
throw new
|
|
1791
|
+
throw new ClientError3("Transport", { cause });
|
|
1777
1792
|
}
|
|
1778
1793
|
if (text === "")
|
|
1779
|
-
throw new
|
|
1794
|
+
throw new ClientError3("MalformedResponse");
|
|
1780
1795
|
try {
|
|
1781
1796
|
return JSON.parse(text);
|
|
1782
1797
|
} catch (cause) {
|
|
1783
|
-
throw new
|
|
1798
|
+
throw new ClientError3("MalformedResponse", { cause });
|
|
1784
1799
|
}
|
|
1785
1800
|
}
|
|
1786
1801
|
function declared(body) {
|
|
@@ -1793,4 +1808,4 @@ function isContentType(response, expected) {
|
|
|
1793
1808
|
return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
|
|
1794
1809
|
}
|
|
1795
1810
|
|
|
1796
|
-
export {
|
|
1811
|
+
export { make6, 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 ClientError2 extends Schema.TaggedError()("ClientError", {
|
|
5
5
|
cause: Schema.Defect()
|
|
6
6
|
}) {
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
export {
|
|
9
|
+
export { ClientError2 };
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
isFormNotFoundError2,
|
|
5
5
|
isFormAlreadySettledError2,
|
|
6
6
|
isPermissionNotFoundError2
|
|
7
|
-
} from "./
|
|
7
|
+
} from "./shared-events-sdjh9vmn.js";
|
|
8
8
|
|
|
9
9
|
// src/solid/data.ts
|
|
10
10
|
import { Worktree } from "@opencode/schema/worktree";
|
|
@@ -1520,7 +1520,12 @@ function createData2(config) {
|
|
|
1520
1520
|
const admitted = new Set((store.session.pending[sessionID] ?? []).flatMap((item) => item.type === "user" || item.type === "synthetic" ? [item.id] : []));
|
|
1521
1521
|
const local = (store.session.message[sessionID] ?? []).filter((item) => !ids.has(item.id) && (outbox.has(item.id) || admitted.has(item.id)));
|
|
1522
1522
|
const messages = local.length === 0 ? fetched : [...fetched, ...local];
|
|
1523
|
+
const delivered = [...admitted].filter((id) => ids.has(id));
|
|
1523
1524
|
batch(() => {
|
|
1525
|
+
delivered.forEach((id) => {
|
|
1526
|
+
outbox.delete(id);
|
|
1527
|
+
removePending(sessionID, id);
|
|
1528
|
+
});
|
|
1524
1529
|
messageIndex.set(sessionID, new Map(messages.map((message, index) => [message.id, index])));
|
|
1525
1530
|
setStore("session", "message", sessionID, reconcile(messages));
|
|
1526
1531
|
setStore("session", "messageCursor", sessionID, response.cursor.next ?? undefined);
|
package/dist/contract.js
CHANGED
package/dist/effect/api/api.d.ts
CHANGED
|
@@ -13,9 +13,9 @@ import type { SessionInbox } from "@opencode/schema/session-inbox";
|
|
|
13
13
|
import type { PromptInput } from "@opencode/schema/prompt-input";
|
|
14
14
|
import type { AgentAttachment } from "@opencode/schema/prompt";
|
|
15
15
|
import type { FileDiff } from "@opencode/schema/file-diff";
|
|
16
|
+
import type { Money } from "@opencode/schema/money";
|
|
16
17
|
import type { Form } from "@opencode/schema/form";
|
|
17
18
|
import type { DateTime } from "effect";
|
|
18
|
-
import type { Money } from "@opencode/schema/money";
|
|
19
19
|
import type { Skill } from "@opencode/schema/skill";
|
|
20
20
|
import type { InstructionEntry } from "@opencode/schema/instruction-entry";
|
|
21
21
|
import type { Schema } from "effect";
|
|
@@ -38,6 +38,7 @@ import type { OpenCodeEvent } from "@opencode/protocol/groups/event";
|
|
|
38
38
|
import type { Pty } from "@opencode/schema/pty";
|
|
39
39
|
import type { Schedule } from "@opencode/schema/schedule";
|
|
40
40
|
import type { Artifact } from "@opencode/schema/artifact";
|
|
41
|
+
import type { Job } from "@opencode/schema/job";
|
|
41
42
|
import type { Reference } from "@opencode/schema/reference";
|
|
42
43
|
import type { Worktree } from "@opencode/schema/worktree";
|
|
43
44
|
import type { Vcs } from "@opencode/schema/vcs";
|
|
@@ -346,6 +347,16 @@ export type SessionGenerateInput = {
|
|
|
346
347
|
};
|
|
347
348
|
export type SessionGenerateOutput = {
|
|
348
349
|
readonly text: string;
|
|
350
|
+
readonly tokens: {
|
|
351
|
+
readonly input: number;
|
|
352
|
+
readonly output: number;
|
|
353
|
+
readonly reasoning: number;
|
|
354
|
+
readonly cache: {
|
|
355
|
+
readonly read: number;
|
|
356
|
+
readonly write: number;
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
readonly cost: Money.USD;
|
|
349
360
|
};
|
|
350
361
|
export type SessionGenerateOperation<E = never> = (input: SessionGenerateInput) => Effect.Effect<SessionGenerateOutput, E>;
|
|
351
362
|
export type SessionInterruptInput = {
|
|
@@ -1739,7 +1750,7 @@ export type ExperimentalSessionLogOutput = ({
|
|
|
1739
1750
|
} | undefined;
|
|
1740
1751
|
readonly data: {
|
|
1741
1752
|
readonly sessionID: Session.ID;
|
|
1742
|
-
readonly source: "title" | "compaction";
|
|
1753
|
+
readonly source: "title" | "compaction" | "generate";
|
|
1743
1754
|
readonly cost: Money.USD;
|
|
1744
1755
|
readonly tokens: {
|
|
1745
1756
|
readonly input: number;
|
|
@@ -2808,6 +2819,14 @@ export type ExperimentalArtifactsDeleteInput = {
|
|
|
2808
2819
|
};
|
|
2809
2820
|
export type ExperimentalArtifactsDeleteOutput = void;
|
|
2810
2821
|
export type ExperimentalArtifactsDeleteOperation<E = never> = (input: ExperimentalArtifactsDeleteInput) => Effect.Effect<ExperimentalArtifactsDeleteOutput, E>;
|
|
2822
|
+
export type ExperimentalJobListInput = {
|
|
2823
|
+
readonly sessionID?: Session.ID | undefined;
|
|
2824
|
+
readonly kind?: Job.Kind | undefined;
|
|
2825
|
+
readonly status?: Job.Status | undefined;
|
|
2826
|
+
readonly descendants?: boolean | undefined;
|
|
2827
|
+
};
|
|
2828
|
+
export type ExperimentalJobListOutput = ReadonlyArray<Job.Info>;
|
|
2829
|
+
export type ExperimentalJobListOperation<E = never> = (input?: ExperimentalJobListInput) => Effect.Effect<ExperimentalJobListOutput, E>;
|
|
2811
2830
|
export interface ExperimentalApi<E = never> {
|
|
2812
2831
|
readonly persistentPty: {
|
|
2813
2832
|
readonly read: ExperimentalPersistentPtyReadOperation<E>;
|
|
@@ -2837,6 +2856,9 @@ export interface ExperimentalApi<E = never> {
|
|
|
2837
2856
|
readonly update: ExperimentalArtifactsUpdateOperation<E>;
|
|
2838
2857
|
readonly delete: ExperimentalArtifactsDeleteOperation<E>;
|
|
2839
2858
|
};
|
|
2859
|
+
readonly job: {
|
|
2860
|
+
readonly list: ExperimentalJobListOperation<E>;
|
|
2861
|
+
};
|
|
2840
2862
|
}
|
|
2841
2863
|
export type ShellListInput = {
|
|
2842
2864
|
readonly location?: {
|
package/dist/effect/client.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const make: (options?: {
|
|
|
19
19
|
reload: () => Effect.Effect<void, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
20
20
|
};
|
|
21
21
|
agent: {
|
|
22
|
-
list: (input?: import("./api.js").AgentListInput) => Effect.Effect<import("./api.js").AgentListOutput, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").
|
|
22
|
+
list: (input?: import("./api.js").AgentListInput) => Effect.Effect<import("./api.js").AgentListOutput, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
23
23
|
get: (input: import("./api.js").AgentGetInput) => Effect.Effect<import("./api.js").AgentGetOutput, import("@opencode/protocol/errors").AgentNotFoundError | ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
24
24
|
};
|
|
25
25
|
plugin: {
|
|
@@ -289,6 +289,9 @@ export declare const make: (options?: {
|
|
|
289
289
|
update: (input: import("./api.js").ExperimentalArtifactsUpdateInput) => Effect.Effect<import("./api.js").ExperimentalArtifactsUpdateOutput, import("@opencode/protocol/errors").ArtifactNotFoundError | 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").ServiceUnavailableError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
290
290
|
delete: (input: import("./api.js").ExperimentalArtifactsDeleteInput) => Effect.Effect<void, import("@opencode/protocol/errors").ArtifactNotFoundError | 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").ServiceUnavailableError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
291
291
|
};
|
|
292
|
+
job: {
|
|
293
|
+
list: (input?: import("./api.js").ExperimentalJobListInput) => Effect.Effect<import("./api.js").ExperimentalJobListOutput, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
294
|
+
};
|
|
292
295
|
session: {
|
|
293
296
|
stats: (input?: import("./api.js").ExperimentalSessionStatsInput) => Effect.Effect<import("./api.js").ExperimentalSessionStatsOutput, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
294
297
|
import: (input: import("./api.js").ExperimentalSessionImportInput) => Effect.Effect<import("@opencode/schema/session").Info, ClientError | import("@opencode/protocol/errors").ConflictError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
@@ -451,9 +454,9 @@ export declare const make: (options?: {
|
|
|
451
454
|
move: (input: import("./api.js").SessionMoveInput) => Effect.Effect<void, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
452
455
|
prompt: (input: import("./api.js").SessionPromptInput) => Effect.Effect<import("@opencode/schema/session-inbox").User, ClientError | import("@opencode/protocol/errors").ConflictError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
453
456
|
command: (input: import("./api.js").SessionCommandInput) => Effect.Effect<void, ClientError | import("@opencode/protocol/errors").CommandExecutionError | import("@opencode/protocol/errors").CommandNotFoundError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
454
|
-
synthetic: (input: import("./api.js").SessionSyntheticInput) => Effect.Effect<import("@opencode/schema/session-inbox").Synthetic, ClientError | import("@opencode/protocol/errors").ConflictError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("
|
|
457
|
+
synthetic: (input: import("./api.js").SessionSyntheticInput) => Effect.Effect<import("@opencode/schema/session-inbox").Synthetic, ClientError | import("@opencode/protocol/errors").ConflictError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
455
458
|
shell: (input: import("./api.js").SessionShellInput) => 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").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
456
|
-
compact: (input: import("./api.js").SessionCompactInput) => Effect.Effect<import("@opencode/schema/session-inbox").Compaction, ClientError | import("@opencode/protocol/errors").ConflictError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("
|
|
459
|
+
compact: (input: import("./api.js").SessionCompactInput) => Effect.Effect<import("@opencode/schema/session-inbox").Compaction, ClientError | import("@opencode/protocol/errors").ConflictError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError, never>;
|
|
457
460
|
revert: {
|
|
458
461
|
stage: (input: import("./api.js").SessionRevertStageInput) => Effect.Effect<import("@opencode/schema/session-revert").Revert, ClientError | import("effect/http/HttpClientError").HttpClientError | import("@opencode/protocol/errors").InvalidRequestError | import("@opencode/protocol/errors").LocationNotFoundError | import("@opencode/protocol/errors").MessageNotFoundError | import("effect/Schema").SchemaError | import("@opencode/protocol/errors").SessionBusyError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").UnknownError, never>;
|
|
459
462
|
clear: (input: import("./api.js").SessionRevertClearInput) => 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").SessionBusyError | import("@opencode/protocol/errors").SessionNotFoundError | import("@opencode/protocol/errors").UnauthorizedError | import("@opencode/protocol/errors").UnknownError, never>;
|
|
@@ -1938,7 +1941,10 @@ export declare const make: (options?: {
|
|
|
1938
1941
|
readonly directory: string & import("effect/Brand").Brand<"AbsolutePath">;
|
|
1939
1942
|
readonly workspaceID?: (string & import("effect/Brand").Brand<"Workspace.ID">) | undefined;
|
|
1940
1943
|
} | undefined;
|
|
1941
|
-
readonly data: {
|
|
1944
|
+
readonly data: {
|
|
1945
|
+
readonly integrationID: string & import("effect/Brand").Brand<"Integration.ID">;
|
|
1946
|
+
readonly credentialID: string & import("effect/Brand").Brand<"Credential.ID">;
|
|
1947
|
+
};
|
|
1942
1948
|
}) | ([Extract<Type, "filesystem.changed">] extends [never] ? never : {
|
|
1943
1949
|
readonly id: string & import("effect/Brand").Brand<"Event.ID">;
|
|
1944
1950
|
readonly created: number;
|
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/shared-events-c49mnkv6.js";
|
|
5
|
+
import"../chunks/shared-events-15p82y03.js";
|
|
6
|
+
import"../chunks/shared-events-6mptkzbc.js";
|
|
7
|
+
import"../chunks/shared-events-2r38e168.js";
|
|
8
|
+
import"../chunks/shared-events-y2etg5bs.js";
|
|
9
|
+
import"../chunks/shared-events-ryy6kscr.js";
|
|
10
|
+
import"../chunks/shared-events-gecjxyvt.js";
|
|
11
|
+
import"../chunks/shared-events-60xe5cbf.js";
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
exports_client as OpenCode,
|
|
14
|
+
make2 as make
|
|
15
15
|
};
|