@opencode/client 2.0.22 → 2.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{service-contender-1tbj6z39.js → pty-handoff-1y4a697q.js} +1 -1
- package/dist/chunks/{service-contender-mxz277s4.js → pty-handoff-5yf5aaev.js} +12 -10
- package/dist/chunks/{service-contender-1kn39gq3.js → pty-handoff-71wkqa80.js} +14 -21
- package/dist/chunks/{service-contender-y2etg5bs.js → pty-handoff-7f0py9js.js} +2 -2
- package/dist/chunks/pty-handoff-ank0d71z.js +75 -0
- package/dist/chunks/pty-handoff-cqfz2qxq.js +30 -0
- package/dist/chunks/{service-contender-frbwqjmf.js → pty-handoff-frbwqjmf.js} +1 -1
- package/dist/chunks/{service-contender-nwcpakzx.js → pty-handoff-js54wxgp.js} +2 -2
- package/dist/chunks/{service-contender-krgmp8b6.js → pty-handoff-myyn5x39.js} +17 -17
- package/dist/chunks/{service-contender-50fct660.js → pty-handoff-qzsnm4q8.js} +77 -63
- package/dist/chunks/{service-contender-h11j9btw.js → pty-handoff-src6by76.js} +10 -1
- package/dist/chunks/{service-contender-t1xa31vm.js → pty-handoff-t1xa31vm.js} +1 -1
- package/dist/chunks/{service-contender-txckps9j.js → pty-handoff-ve4aws36.js} +48 -2
- package/dist/chunks/{service-contender-4tveyqeh.js → pty-handoff-vt9jbch8.js} +4 -2
- package/dist/chunks/{service-contender-z6qdwcsf.js → pty-handoff-w1w809zr.js} +5 -5
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +12 -0
- package/dist/effect/client.d.ts +93 -92
- package/dist/effect/client.js +12 -12
- package/dist/effect/generated/client-error.js +3 -3
- package/dist/effect/generated/client.d.ts +93 -92
- package/dist/effect/generated/client.js +5 -5
- package/dist/effect/generated/index.js +8 -8
- package/dist/effect/index.js +12 -12
- package/dist/effect/rpc.js +4 -4
- package/dist/effect/service.d.ts +5 -7
- package/dist/effect/service.js +44 -115
- package/dist/promise/client.d.ts +1 -0
- package/dist/promise/client.js +11 -11
- package/dist/promise/generated/client-error.js +3 -3
- package/dist/promise/generated/client.d.ts +2 -1
- package/dist/promise/generated/client.js +4 -4
- package/dist/promise/generated/index.js +13 -9
- package/dist/promise/generated/types.d.ts +33 -0
- package/dist/promise/generated/types.js +6 -2
- package/dist/promise/index.js +17 -13
- package/dist/promise/rpc.js +2 -2
- package/dist/promise/service.d.ts +2 -4
- package/dist/promise/service.js +41 -115
- package/dist/pty-handoff.d.ts +4 -1
- package/dist/pty-handoff.js +1 -1
- package/dist/rpc-runtime.js +1 -1
- package/dist/service-contender.d.ts +27 -1
- package/dist/service-contender.js +3 -3
- package/dist/service-probe.d.ts +53 -0
- package/dist/service-probe.js +13 -0
- package/dist/service-timing.js +1 -1
- package/dist/service-version.js +1 -1
- package/dist/service.js +1 -1
- package/dist/shared-events.js +1 -1
- package/dist/solid/connection.js +1 -1
- package/dist/solid/data.d.ts +3 -0
- package/dist/solid/data.js +9 -9
- package/dist/solid/index.js +11 -11
- package/dist/solid/pty.js +1 -1
- package/package.json +4 -4
- package/dist/chunks/service-contender-992ffpa9.js +0 -30
- /package/dist/chunks/{service-contender-6mptkzbc.js → pty-handoff-6mptkzbc.js} +0 -0
- /package/dist/chunks/{service-contender-9rqn6x4v.js → pty-handoff-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{service-contender-gne7h7mq.js → pty-handoff-gne7h7mq.js} +0 -0
- /package/dist/chunks/{service-contender-m2eywc8w.js → pty-handoff-m2eywc8w.js} +0 -0
- /package/dist/chunks/{service-contender-qav6mfdz.js → pty-handoff-qav6mfdz.js} +0 -0
- /package/dist/chunks/{service-contender-sxt88q69.js → pty-handoff-sxt88q69.js} +0 -0
- /package/dist/chunks/{service-contender-vmytr4q8.js → pty-handoff-vmytr4q8.js} +0 -0
- /package/dist/chunks/{service-contender-vyas3vgt.js → pty-handoff-vyas3vgt.js} +0 -0
- /package/dist/chunks/{service-contender-xgnj2w4v.js → pty-handoff-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{service-contender-ydhz1zrh.js → pty-handoff-ydhz1zrh.js} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
2
|
+
ClientError2
|
|
3
|
+
} from "./pty-handoff-js54wxgp.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./pty-handoff-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(`
|
|
@@ -160,7 +160,7 @@ function make6(options) {
|
|
|
160
160
|
path: `/api/location`,
|
|
161
161
|
query: { location: input?.["location"] },
|
|
162
162
|
successStatus: 200,
|
|
163
|
-
declaredStatuses: [400, 401],
|
|
163
|
+
declaredStatuses: [400, 401, 404],
|
|
164
164
|
empty: false
|
|
165
165
|
}, requestOptions),
|
|
166
166
|
reload: (requestOptions) => request({
|
|
@@ -177,7 +177,7 @@ function make6(options) {
|
|
|
177
177
|
path: `/api/agent`,
|
|
178
178
|
query: { location: input?.["location"] },
|
|
179
179
|
successStatus: 200,
|
|
180
|
-
declaredStatuses: [400, 401],
|
|
180
|
+
declaredStatuses: [400, 401, 404],
|
|
181
181
|
empty: false
|
|
182
182
|
}, requestOptions),
|
|
183
183
|
get: (input, requestOptions) => request({
|
|
@@ -195,7 +195,7 @@ function make6(options) {
|
|
|
195
195
|
path: `/api/plugin`,
|
|
196
196
|
query: { location: input?.["location"] },
|
|
197
197
|
successStatus: 200,
|
|
198
|
-
declaredStatuses: [400, 401],
|
|
198
|
+
declaredStatuses: [400, 401, 404],
|
|
199
199
|
empty: false
|
|
200
200
|
}, requestOptions),
|
|
201
201
|
check: (input, requestOptions) => request({
|
|
@@ -204,7 +204,7 @@ function make6(options) {
|
|
|
204
204
|
query: { location: input?.["location"] },
|
|
205
205
|
body: { target: input?.["target"] },
|
|
206
206
|
successStatus: 200,
|
|
207
|
-
declaredStatuses: [400, 401],
|
|
207
|
+
declaredStatuses: [400, 401, 404],
|
|
208
208
|
empty: false
|
|
209
209
|
}, requestOptions),
|
|
210
210
|
update: (input, requestOptions) => request({
|
|
@@ -213,7 +213,7 @@ function make6(options) {
|
|
|
213
213
|
query: { location: input["location"] },
|
|
214
214
|
body: { targets: input["targets"] },
|
|
215
215
|
successStatus: 204,
|
|
216
|
-
declaredStatuses: [400, 401, 503],
|
|
216
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
217
217
|
empty: true
|
|
218
218
|
}, requestOptions)
|
|
219
219
|
},
|
|
@@ -623,7 +623,7 @@ function make6(options) {
|
|
|
623
623
|
path: `/api/model`,
|
|
624
624
|
query: { location: input?.["location"] },
|
|
625
625
|
successStatus: 200,
|
|
626
|
-
declaredStatuses: [400, 401, 503],
|
|
626
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
627
627
|
empty: false
|
|
628
628
|
}, requestOptions),
|
|
629
629
|
default: (input, requestOptions) => request({
|
|
@@ -631,7 +631,7 @@ function make6(options) {
|
|
|
631
631
|
path: `/api/model/default`,
|
|
632
632
|
query: { location: input?.["location"] },
|
|
633
633
|
successStatus: 200,
|
|
634
|
-
declaredStatuses: [400, 401, 503],
|
|
634
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
635
635
|
empty: false
|
|
636
636
|
}, requestOptions)
|
|
637
637
|
},
|
|
@@ -641,7 +641,7 @@ function make6(options) {
|
|
|
641
641
|
path: `/api/experimental/generate`,
|
|
642
642
|
body: { prompt: input["prompt"], model: input["model"] },
|
|
643
643
|
successStatus: 200,
|
|
644
|
-
declaredStatuses: [400, 401, 503],
|
|
644
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
645
645
|
empty: false
|
|
646
646
|
}, requestOptions).then((value) => value.data)
|
|
647
647
|
},
|
|
@@ -651,7 +651,7 @@ function make6(options) {
|
|
|
651
651
|
path: `/api/provider`,
|
|
652
652
|
query: { location: input?.["location"] },
|
|
653
653
|
successStatus: 200,
|
|
654
|
-
declaredStatuses: [400, 401, 503],
|
|
654
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
655
655
|
empty: false
|
|
656
656
|
}, requestOptions),
|
|
657
657
|
get: (input, requestOptions) => request({
|
|
@@ -669,7 +669,7 @@ function make6(options) {
|
|
|
669
669
|
path: `/api/integration`,
|
|
670
670
|
query: { location: input?.["location"] },
|
|
671
671
|
successStatus: 200,
|
|
672
|
-
declaredStatuses: [400, 401],
|
|
672
|
+
declaredStatuses: [400, 401, 404],
|
|
673
673
|
empty: false
|
|
674
674
|
}, requestOptions),
|
|
675
675
|
get: (input, requestOptions) => request({
|
|
@@ -687,7 +687,7 @@ function make6(options) {
|
|
|
687
687
|
query: { location: input["location"] },
|
|
688
688
|
body: { url: input["url"] },
|
|
689
689
|
successStatus: 204,
|
|
690
|
-
declaredStatuses: [400, 401],
|
|
690
|
+
declaredStatuses: [400, 401, 404],
|
|
691
691
|
empty: true
|
|
692
692
|
}, requestOptions)
|
|
693
693
|
},
|
|
@@ -709,7 +709,7 @@ function make6(options) {
|
|
|
709
709
|
query: { location: input["location"] },
|
|
710
710
|
body: { methodID: input["methodID"], answer: input["answer"], label: input["label"] },
|
|
711
711
|
successStatus: 200,
|
|
712
|
-
declaredStatuses: [400, 401],
|
|
712
|
+
declaredStatuses: [400, 401, 404],
|
|
713
713
|
empty: false
|
|
714
714
|
}, requestOptions),
|
|
715
715
|
status: (input, requestOptions) => request({
|
|
@@ -734,7 +734,7 @@ function make6(options) {
|
|
|
734
734
|
path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/oauth/${encodeURIComponent(input.attemptID)}`,
|
|
735
735
|
query: { location: input["location"] },
|
|
736
736
|
successStatus: 204,
|
|
737
|
-
declaredStatuses: [400, 401],
|
|
737
|
+
declaredStatuses: [400, 401, 404],
|
|
738
738
|
empty: true
|
|
739
739
|
}, requestOptions)
|
|
740
740
|
},
|
|
@@ -761,7 +761,7 @@ function make6(options) {
|
|
|
761
761
|
path: `/api/integration/${encodeURIComponent(input.integrationID)}/connect/command/${encodeURIComponent(input.attemptID)}`,
|
|
762
762
|
query: { location: input["location"] },
|
|
763
763
|
successStatus: 204,
|
|
764
|
-
declaredStatuses: [400, 401],
|
|
764
|
+
declaredStatuses: [400, 401, 404],
|
|
765
765
|
empty: true
|
|
766
766
|
}, requestOptions)
|
|
767
767
|
}
|
|
@@ -772,7 +772,7 @@ function make6(options) {
|
|
|
772
772
|
path: `/api/mcp`,
|
|
773
773
|
query: { location: input?.["location"] },
|
|
774
774
|
successStatus: 200,
|
|
775
|
-
declaredStatuses: [400, 401],
|
|
775
|
+
declaredStatuses: [400, 401, 404],
|
|
776
776
|
empty: false
|
|
777
777
|
}, requestOptions),
|
|
778
778
|
add: (input, requestOptions) => request({
|
|
@@ -781,7 +781,7 @@ function make6(options) {
|
|
|
781
781
|
query: { location: input["location"] },
|
|
782
782
|
body: { config: input["config"] },
|
|
783
783
|
successStatus: 204,
|
|
784
|
-
declaredStatuses: [400, 401],
|
|
784
|
+
declaredStatuses: [400, 401, 404],
|
|
785
785
|
empty: true
|
|
786
786
|
}, requestOptions),
|
|
787
787
|
remove: (input, requestOptions) => request({
|
|
@@ -814,7 +814,7 @@ function make6(options) {
|
|
|
814
814
|
path: `/api/mcp/resource`,
|
|
815
815
|
query: { location: input?.["location"] },
|
|
816
816
|
successStatus: 200,
|
|
817
|
-
declaredStatuses: [400, 401],
|
|
817
|
+
declaredStatuses: [400, 401, 404],
|
|
818
818
|
empty: false
|
|
819
819
|
}, requestOptions)
|
|
820
820
|
}
|
|
@@ -859,7 +859,7 @@ function make6(options) {
|
|
|
859
859
|
}, requestOptions)
|
|
860
860
|
},
|
|
861
861
|
project: {
|
|
862
|
-
list: (requestOptions) => request({ method: "GET", path: `/api/project`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
|
|
862
|
+
list: (requestOptions) => request({ method: "GET", path: `/api/project`, successStatus: 200, declaredStatuses: [400, 401, 404], empty: false }, requestOptions),
|
|
863
863
|
update: (input, requestOptions) => request({
|
|
864
864
|
method: "PATCH",
|
|
865
865
|
path: `/api/project/${encodeURIComponent(input.projectID)}`,
|
|
@@ -880,7 +880,7 @@ function make6(options) {
|
|
|
880
880
|
path: `/api/form`,
|
|
881
881
|
query: { location: input?.["location"] },
|
|
882
882
|
successStatus: 200,
|
|
883
|
-
declaredStatuses: [400, 401],
|
|
883
|
+
declaredStatuses: [400, 401, 404],
|
|
884
884
|
empty: false
|
|
885
885
|
}, requestOptions)
|
|
886
886
|
},
|
|
@@ -891,7 +891,7 @@ function make6(options) {
|
|
|
891
891
|
path: `/api/permission/request`,
|
|
892
892
|
query: { location: input?.["location"] },
|
|
893
893
|
successStatus: 200,
|
|
894
|
-
declaredStatuses: [400, 401],
|
|
894
|
+
declaredStatuses: [400, 401, 404],
|
|
895
895
|
empty: false
|
|
896
896
|
}, requestOptions)
|
|
897
897
|
},
|
|
@@ -901,14 +901,14 @@ function make6(options) {
|
|
|
901
901
|
path: `/api/permission/saved`,
|
|
902
902
|
query: { projectID: input?.["projectID"] },
|
|
903
903
|
successStatus: 200,
|
|
904
|
-
declaredStatuses: [400, 401],
|
|
904
|
+
declaredStatuses: [400, 401, 404],
|
|
905
905
|
empty: false
|
|
906
906
|
}, requestOptions).then((value) => value.data),
|
|
907
907
|
remove: (input, requestOptions) => request({
|
|
908
908
|
method: "DELETE",
|
|
909
909
|
path: `/api/permission/saved/${encodeURIComponent(input.id)}`,
|
|
910
910
|
successStatus: 204,
|
|
911
|
-
declaredStatuses: [400, 401],
|
|
911
|
+
declaredStatuses: [400, 401, 404],
|
|
912
912
|
empty: true
|
|
913
913
|
}, requestOptions)
|
|
914
914
|
},
|
|
@@ -966,7 +966,7 @@ function make6(options) {
|
|
|
966
966
|
path: `/api/fs/list`,
|
|
967
967
|
query: { location: input?.["location"], path: input?.["path"] },
|
|
968
968
|
successStatus: 200,
|
|
969
|
-
declaredStatuses: [400, 401],
|
|
969
|
+
declaredStatuses: [400, 401, 404],
|
|
970
970
|
empty: false
|
|
971
971
|
}, requestOptions),
|
|
972
972
|
find: (input, requestOptions) => request({
|
|
@@ -974,7 +974,7 @@ function make6(options) {
|
|
|
974
974
|
path: `/api/fs/find`,
|
|
975
975
|
query: { location: input["location"], query: input["query"], type: input["type"], limit: input["limit"] },
|
|
976
976
|
successStatus: 200,
|
|
977
|
-
declaredStatuses: [400, 401],
|
|
977
|
+
declaredStatuses: [400, 401, 404],
|
|
978
978
|
empty: false
|
|
979
979
|
}, requestOptions),
|
|
980
980
|
write: (input, requestOptions) => request({
|
|
@@ -983,7 +983,7 @@ function make6(options) {
|
|
|
983
983
|
query: { location: input["location"], path: input["path"] },
|
|
984
984
|
body: input["payload"],
|
|
985
985
|
successStatus: 200,
|
|
986
|
-
declaredStatuses: [400, 401],
|
|
986
|
+
declaredStatuses: [400, 401, 404],
|
|
987
987
|
empty: false,
|
|
988
988
|
binaryBody: true
|
|
989
989
|
}, requestOptions)
|
|
@@ -994,7 +994,7 @@ function make6(options) {
|
|
|
994
994
|
path: `/api/command`,
|
|
995
995
|
query: { location: input?.["location"] },
|
|
996
996
|
successStatus: 200,
|
|
997
|
-
declaredStatuses: [400, 401],
|
|
997
|
+
declaredStatuses: [400, 401, 404],
|
|
998
998
|
empty: false
|
|
999
999
|
}, requestOptions)
|
|
1000
1000
|
},
|
|
@@ -1004,7 +1004,7 @@ function make6(options) {
|
|
|
1004
1004
|
path: `/api/skill`,
|
|
1005
1005
|
query: { location: input?.["location"] },
|
|
1006
1006
|
successStatus: 200,
|
|
1007
|
-
declaredStatuses: [400, 401],
|
|
1007
|
+
declaredStatuses: [400, 401, 404],
|
|
1008
1008
|
empty: false
|
|
1009
1009
|
}, requestOptions)
|
|
1010
1010
|
},
|
|
@@ -1015,7 +1015,7 @@ function make6(options) {
|
|
|
1015
1015
|
query: { location: input["location"] },
|
|
1016
1016
|
body: { input: input["input"] },
|
|
1017
1017
|
successStatus: 200,
|
|
1018
|
-
declaredStatuses: [400, 401, 500],
|
|
1018
|
+
declaredStatuses: [400, 401, 404, 500],
|
|
1019
1019
|
empty: false
|
|
1020
1020
|
}, requestOptions)
|
|
1021
1021
|
},
|
|
@@ -1028,7 +1028,7 @@ function make6(options) {
|
|
|
1028
1028
|
path: `/api/pty`,
|
|
1029
1029
|
query: { location: input?.["location"] },
|
|
1030
1030
|
successStatus: 200,
|
|
1031
|
-
declaredStatuses: [400, 401],
|
|
1031
|
+
declaredStatuses: [400, 401, 404],
|
|
1032
1032
|
empty: false
|
|
1033
1033
|
}, requestOptions),
|
|
1034
1034
|
create: (input, requestOptions) => request({
|
|
@@ -1043,7 +1043,7 @@ function make6(options) {
|
|
|
1043
1043
|
env: input?.["env"]
|
|
1044
1044
|
},
|
|
1045
1045
|
successStatus: 200,
|
|
1046
|
-
declaredStatuses: [400, 401],
|
|
1046
|
+
declaredStatuses: [400, 401, 404],
|
|
1047
1047
|
empty: false
|
|
1048
1048
|
}, requestOptions),
|
|
1049
1049
|
get: (input, requestOptions) => request({
|
|
@@ -1174,7 +1174,7 @@ function make6(options) {
|
|
|
1174
1174
|
path: `/api/shell`,
|
|
1175
1175
|
query: { location: input?.["location"] },
|
|
1176
1176
|
successStatus: 200,
|
|
1177
|
-
declaredStatuses: [400, 401],
|
|
1177
|
+
declaredStatuses: [400, 401, 404],
|
|
1178
1178
|
empty: false
|
|
1179
1179
|
}, requestOptions),
|
|
1180
1180
|
create: (input, requestOptions) => request({
|
|
@@ -1188,7 +1188,7 @@ function make6(options) {
|
|
|
1188
1188
|
metadata: input["metadata"]
|
|
1189
1189
|
},
|
|
1190
1190
|
successStatus: 200,
|
|
1191
|
-
declaredStatuses: [400, 401],
|
|
1191
|
+
declaredStatuses: [400, 401, 404],
|
|
1192
1192
|
empty: false
|
|
1193
1193
|
}, requestOptions),
|
|
1194
1194
|
get: (input, requestOptions) => request({
|
|
@@ -1212,7 +1212,7 @@ function make6(options) {
|
|
|
1212
1212
|
path: `/api/shell/${encodeURIComponent(input.id)}`,
|
|
1213
1213
|
query: { location: input["location"] },
|
|
1214
1214
|
successStatus: 204,
|
|
1215
|
-
declaredStatuses: [400, 401],
|
|
1215
|
+
declaredStatuses: [400, 401, 404],
|
|
1216
1216
|
empty: true
|
|
1217
1217
|
}, requestOptions)
|
|
1218
1218
|
},
|
|
@@ -1222,7 +1222,7 @@ function make6(options) {
|
|
|
1222
1222
|
path: `/api/reference`,
|
|
1223
1223
|
query: { location: input?.["location"] },
|
|
1224
1224
|
successStatus: 200,
|
|
1225
|
-
declaredStatuses: [400, 401],
|
|
1225
|
+
declaredStatuses: [400, 401, 404],
|
|
1226
1226
|
empty: false
|
|
1227
1227
|
}, requestOptions)
|
|
1228
1228
|
},
|
|
@@ -1267,12 +1267,20 @@ function make6(options) {
|
|
|
1267
1267
|
}, requestOptions)
|
|
1268
1268
|
},
|
|
1269
1269
|
vcs: {
|
|
1270
|
+
init: (input, requestOptions) => request({
|
|
1271
|
+
method: "POST",
|
|
1272
|
+
path: `/api/vcs/init`,
|
|
1273
|
+
query: { location: input?.["location"], provider: input?.["provider"] },
|
|
1274
|
+
successStatus: 204,
|
|
1275
|
+
declaredStatuses: [400, 401, 404, 409, 501, 503],
|
|
1276
|
+
empty: true
|
|
1277
|
+
}, requestOptions),
|
|
1270
1278
|
get: (input, requestOptions) => request({
|
|
1271
1279
|
method: "GET",
|
|
1272
1280
|
path: `/api/vcs`,
|
|
1273
1281
|
query: { location: input?.["location"] },
|
|
1274
1282
|
successStatus: 200,
|
|
1275
|
-
declaredStatuses: [400, 401],
|
|
1283
|
+
declaredStatuses: [400, 401, 404],
|
|
1276
1284
|
empty: false
|
|
1277
1285
|
}, requestOptions),
|
|
1278
1286
|
base: (input, requestOptions) => request({
|
|
@@ -1280,7 +1288,7 @@ function make6(options) {
|
|
|
1280
1288
|
path: `/api/vcs/base`,
|
|
1281
1289
|
query: { location: input?.["location"] },
|
|
1282
1290
|
successStatus: 200,
|
|
1283
|
-
declaredStatuses: [400, 401, 503],
|
|
1291
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
1284
1292
|
empty: false
|
|
1285
1293
|
}, requestOptions),
|
|
1286
1294
|
status: (input, requestOptions) => request({
|
|
@@ -1288,7 +1296,7 @@ function make6(options) {
|
|
|
1288
1296
|
path: `/api/vcs/status`,
|
|
1289
1297
|
query: { location: input?.["location"] },
|
|
1290
1298
|
successStatus: 200,
|
|
1291
|
-
declaredStatuses: [400, 401],
|
|
1299
|
+
declaredStatuses: [400, 401, 404],
|
|
1292
1300
|
empty: false
|
|
1293
1301
|
}, requestOptions),
|
|
1294
1302
|
branch: {
|
|
@@ -1297,7 +1305,7 @@ function make6(options) {
|
|
|
1297
1305
|
path: `/api/vcs/branch`,
|
|
1298
1306
|
query: { location: input?.["location"], search: input?.["search"], limit: input?.["limit"] },
|
|
1299
1307
|
successStatus: 200,
|
|
1300
|
-
declaredStatuses: [400, 401],
|
|
1308
|
+
declaredStatuses: [400, 401, 404],
|
|
1301
1309
|
empty: false
|
|
1302
1310
|
}, requestOptions)
|
|
1303
1311
|
},
|
|
@@ -1306,7 +1314,7 @@ function make6(options) {
|
|
|
1306
1314
|
path: `/api/vcs/diff`,
|
|
1307
1315
|
query: { location: input["location"], mode: input["mode"], base: input["base"], context: input["context"] },
|
|
1308
1316
|
successStatus: 200,
|
|
1309
|
-
declaredStatuses: [400, 401, 503],
|
|
1317
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
1310
1318
|
empty: false
|
|
1311
1319
|
}, requestOptions)
|
|
1312
1320
|
},
|
|
@@ -1346,7 +1354,7 @@ function make6(options) {
|
|
|
1346
1354
|
path: `/api/websearch/provider`,
|
|
1347
1355
|
query: { location: input?.["location"] },
|
|
1348
1356
|
successStatus: 200,
|
|
1349
|
-
declaredStatuses: [400, 401, 503],
|
|
1357
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
1350
1358
|
empty: false
|
|
1351
1359
|
}, requestOptions),
|
|
1352
1360
|
query: (input, requestOptions) => request({
|
|
@@ -1355,7 +1363,7 @@ function make6(options) {
|
|
|
1355
1363
|
query: { location: input["location"] },
|
|
1356
1364
|
body: { query: input["query"], providerID: input["providerID"] },
|
|
1357
1365
|
successStatus: 200,
|
|
1358
|
-
declaredStatuses: [400, 401, 503],
|
|
1366
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
1359
1367
|
empty: false
|
|
1360
1368
|
}, requestOptions)
|
|
1361
1369
|
},
|
|
@@ -1365,16 +1373,22 @@ function make6(options) {
|
|
|
1365
1373
|
path: `/api/config`,
|
|
1366
1374
|
query: { location: input?.["location"] },
|
|
1367
1375
|
successStatus: 200,
|
|
1368
|
-
declaredStatuses: [400, 401],
|
|
1376
|
+
declaredStatuses: [400, 401, 404],
|
|
1377
|
+
empty: false
|
|
1378
|
+
}, requestOptions),
|
|
1379
|
+
shells: (requestOptions) => request({
|
|
1380
|
+
method: "GET",
|
|
1381
|
+
path: `/api/config/shell`,
|
|
1382
|
+
successStatus: 200,
|
|
1383
|
+
declaredStatuses: [400, 401, 404],
|
|
1369
1384
|
empty: false
|
|
1370
1385
|
}, requestOptions),
|
|
1371
|
-
shells: (requestOptions) => request({ method: "GET", path: `/api/config/shell`, successStatus: 200, declaredStatuses: [400, 401], empty: false }, requestOptions),
|
|
1372
1386
|
update: (input, requestOptions) => request({
|
|
1373
1387
|
method: "PATCH",
|
|
1374
1388
|
path: `/api/experimental/config`,
|
|
1375
1389
|
body: { shell: input["shell"] },
|
|
1376
1390
|
successStatus: 204,
|
|
1377
|
-
declaredStatuses: [400, 401],
|
|
1391
|
+
declaredStatuses: [400, 401, 404],
|
|
1378
1392
|
empty: true
|
|
1379
1393
|
}, requestOptions)
|
|
1380
1394
|
}
|
|
@@ -1407,20 +1421,20 @@ async function json(response) {
|
|
|
1407
1421
|
try {
|
|
1408
1422
|
await response.body?.cancel();
|
|
1409
1423
|
} catch {}
|
|
1410
|
-
throw new
|
|
1424
|
+
throw new ClientError2("UnsupportedContentType", { detail: response.headers.get("content-type") });
|
|
1411
1425
|
}
|
|
1412
1426
|
let text;
|
|
1413
1427
|
try {
|
|
1414
1428
|
text = await response.text();
|
|
1415
1429
|
} catch (cause) {
|
|
1416
|
-
throw new
|
|
1430
|
+
throw new ClientError2("Transport", { cause });
|
|
1417
1431
|
}
|
|
1418
1432
|
if (text === "")
|
|
1419
|
-
throw new
|
|
1433
|
+
throw new ClientError2("MalformedResponse");
|
|
1420
1434
|
try {
|
|
1421
1435
|
return JSON.parse(text);
|
|
1422
1436
|
} catch (cause) {
|
|
1423
|
-
throw new
|
|
1437
|
+
throw new ClientError2("MalformedResponse", { cause });
|
|
1424
1438
|
}
|
|
1425
1439
|
}
|
|
1426
1440
|
function declared(body) {
|
|
@@ -1433,4 +1447,4 @@ function isContentType(response, expected) {
|
|
|
1433
1447
|
return response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() === expected;
|
|
1434
1448
|
}
|
|
1435
1449
|
|
|
1436
|
-
export {
|
|
1450
|
+
export { make3, exports_client2 };
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
isFormNotFoundError2,
|
|
3
3
|
isFormAlreadySettledError2,
|
|
4
4
|
isPermissionNotFoundError2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./pty-handoff-vt9jbch8.js";
|
|
6
6
|
|
|
7
7
|
// src/solid/data.ts
|
|
8
8
|
import { Worktree } from "@opencode/schema/worktree";
|
|
@@ -1162,6 +1162,9 @@ function createData2(config) {
|
|
|
1162
1162
|
status(sessionID) {
|
|
1163
1163
|
return store.session.active[sessionID] ?? "idle";
|
|
1164
1164
|
},
|
|
1165
|
+
active() {
|
|
1166
|
+
return Object.entries(store.session.active).flatMap(([sessionID, status]) => status === "running" ? [sessionID] : []);
|
|
1167
|
+
},
|
|
1165
1168
|
input: {
|
|
1166
1169
|
list(sessionID) {
|
|
1167
1170
|
return (store.session.pending[sessionID] ?? []).flatMap((item) => item.type === "compaction" ? [] : [item.id]);
|
|
@@ -1437,6 +1440,9 @@ function createData2(config) {
|
|
|
1437
1440
|
list(sessionID) {
|
|
1438
1441
|
return store.session.permission[sessionID];
|
|
1439
1442
|
},
|
|
1443
|
+
sessions() {
|
|
1444
|
+
return Object.entries(store.session.permission).flatMap(([sessionID, requests]) => requests.length > 0 ? [sessionID] : []);
|
|
1445
|
+
},
|
|
1440
1446
|
sync(sessionID) {
|
|
1441
1447
|
return sync.run(`session.permission:${sessionID}`, async () => {
|
|
1442
1448
|
setStore("session", "permission", sessionID, await api().permission.list({ sessionID }));
|
|
@@ -1463,6 +1469,9 @@ function createData2(config) {
|
|
|
1463
1469
|
const key = locationKey2(ref);
|
|
1464
1470
|
return forms?.filter((form) => form.location && locationKey2(form.location) === key);
|
|
1465
1471
|
},
|
|
1472
|
+
sessions() {
|
|
1473
|
+
return Object.entries(store.session.form).flatMap(([sessionID, forms]) => sessionID !== "global" && forms.length > 0 ? [sessionID] : []);
|
|
1474
|
+
},
|
|
1466
1475
|
sync(sessionID, ref) {
|
|
1467
1476
|
const key = `session.form:${sessionID}:${sessionID === "global" ? locationKey2(ref ?? defaultLocation()) : ""}`;
|
|
1468
1477
|
return sync.run(key, async () => {
|
|
@@ -4,6 +4,7 @@ var stderrLimit = 8 * 1024;
|
|
|
4
4
|
function spawnServiceContender2(command, args, env) {
|
|
5
5
|
const child = spawn(command, args, {
|
|
6
6
|
detached: true,
|
|
7
|
+
windowsHide: true,
|
|
7
8
|
stdio: ["ignore", "ignore", "pipe"],
|
|
8
9
|
env: { ...process.env, ...env }
|
|
9
10
|
});
|
|
@@ -36,7 +37,52 @@ function spawnServiceContender2(command, args, env) {
|
|
|
36
37
|
}
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function contenderPool2(timing) {
|
|
41
|
+
const contenders = new Set;
|
|
42
|
+
let failure;
|
|
43
|
+
let spawnDelay = timing.spawnDelay;
|
|
44
|
+
let lastSpawn = 0;
|
|
45
|
+
return {
|
|
46
|
+
failure: () => failure,
|
|
47
|
+
serviceAnswered() {
|
|
48
|
+
spawnDelay = timing.spawnDelay;
|
|
49
|
+
},
|
|
50
|
+
evict(pid) {
|
|
51
|
+
for (const item of contenders) {
|
|
52
|
+
if (item.child.pid === pid || contenderFinished2(item)) {
|
|
53
|
+
item.release();
|
|
54
|
+
contenders.delete(item);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
failure = undefined;
|
|
58
|
+
lastSpawn = 0;
|
|
59
|
+
},
|
|
60
|
+
recruitNow() {
|
|
61
|
+
lastSpawn = Date.now() - spawnDelay;
|
|
62
|
+
},
|
|
63
|
+
reap() {
|
|
64
|
+
const finished = [...contenders].filter(contenderFinished2);
|
|
65
|
+
failure ??= finished.map(contenderFailure).find((error) => error !== undefined);
|
|
66
|
+
if (finished.some((item) => item.child.exitCode === 0))
|
|
67
|
+
spawnDelay = Math.min(spawnDelay * 2, timing.maxSpawnDelay);
|
|
68
|
+
finished.forEach((item) => contenders.delete(item));
|
|
69
|
+
return contenders.size === 0 ? failure : undefined;
|
|
70
|
+
},
|
|
71
|
+
shouldRecruit(registered) {
|
|
72
|
+
if (lastSpawn === 0 && registered)
|
|
73
|
+
lastSpawn = Date.now();
|
|
74
|
+
return failure === undefined && contenders.size < 2 && Date.now() - lastSpawn >= spawnDelay;
|
|
75
|
+
},
|
|
76
|
+
add(contender) {
|
|
77
|
+
contenders.add(contender);
|
|
78
|
+
lastSpawn = Date.now();
|
|
79
|
+
},
|
|
80
|
+
releaseAll() {
|
|
81
|
+
contenders.forEach((contender) => contender.release());
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function contenderFailure(contender) {
|
|
40
86
|
const error = contender.error();
|
|
41
87
|
if (error !== undefined)
|
|
42
88
|
return error;
|
|
@@ -54,4 +100,4 @@ function startupError(message, stderr) {
|
|
|
54
100
|
${stderr}` : message);
|
|
55
101
|
}
|
|
56
102
|
|
|
57
|
-
export { spawnServiceContender2,
|
|
103
|
+
export { spawnServiceContender2, contenderPool2, contenderFinished2 };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/promise/generated/types.ts
|
|
2
2
|
var isInvalidRequestError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "InvalidRequestError";
|
|
3
3
|
var isUnauthorizedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "UnauthorizedError";
|
|
4
|
+
var isLocationNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "LocationNotFoundError";
|
|
4
5
|
var isServiceUnavailableError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ServiceUnavailableError";
|
|
5
6
|
var isAgentNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "AgentNotFoundError";
|
|
6
7
|
var isInvalidCursorError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "InvalidCursorError";
|
|
@@ -29,6 +30,7 @@ var isRpcInternalError2 = (value) => typeof value === "object" && value !== null
|
|
|
29
30
|
var isPtyNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PtyNotFoundError";
|
|
30
31
|
var isForbiddenError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ForbiddenError";
|
|
31
32
|
var isShellNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ShellNotFoundError";
|
|
32
|
-
var isWorktreeError2 = (value) => typeof value === "object" && value !== null && ("
|
|
33
|
+
var isWorktreeError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "WorktreeError";
|
|
34
|
+
var isVcsInitNotSupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VcsInitNotSupportedError";
|
|
33
35
|
|
|
34
|
-
export { isInvalidRequestError2, isUnauthorizedError2, isServiceUnavailableError2, isAgentNotFoundError2, isInvalidCursorError2, isSessionNotFoundError2, isConflictError2, isUnknownError2, isMessageNotFoundError2, isCommandNotFoundError2, isCommandExecutionError2, isSkillNotFoundError2, isSessionBusyError2, isInstructionEntryValueTooLargeError2, isFormNotFoundError2, isFormInvalidAnswerError2, isFormAlreadySettledError2, isProviderNotFoundError2, isIntegrationNotFoundError2, isIntegrationAttemptNotFoundError2, isIntegrationMethodNotFoundError2, isMcpServerNotFoundError2, isProjectNotFoundError2, isPermissionNotFoundError2, isFileNotFoundError2, isRpcError2, isRpcInternalError2, isPtyNotFoundError2, isForbiddenError2, isShellNotFoundError2, isWorktreeError2 };
|
|
36
|
+
export { isInvalidRequestError2, isUnauthorizedError2, isLocationNotFoundError2, isServiceUnavailableError2, isAgentNotFoundError2, isInvalidCursorError2, isSessionNotFoundError2, isConflictError2, isUnknownError2, isMessageNotFoundError2, isCommandNotFoundError2, isCommandExecutionError2, isSkillNotFoundError2, isSessionBusyError2, isInstructionEntryValueTooLargeError2, isFormNotFoundError2, isFormInvalidAnswerError2, isFormAlreadySettledError2, isProviderNotFoundError2, isIntegrationNotFoundError2, isIntegrationAttemptNotFoundError2, isIntegrationMethodNotFoundError2, isMcpServerNotFoundError2, isProjectNotFoundError2, isPermissionNotFoundError2, isFileNotFoundError2, isRpcError2, isRpcInternalError2, isPtyNotFoundError2, isForbiddenError2, isShellNotFoundError2, isWorktreeError2, isVcsInitNotSupportedError2 };
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
readError2,
|
|
4
4
|
event2,
|
|
5
5
|
eventType2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./pty-handoff-t1xa31vm.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./pty-handoff-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: () => make6
|
|
17
17
|
});
|
|
18
18
|
import { Effect, Stream } from "effect";
|
|
19
|
-
function
|
|
19
|
+
function make6(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 { make6, aborted2, exports_rpc };
|
package/dist/contract.js
CHANGED