@opencode/client 2.0.32 → 2.1.0
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/{shared-events-2ny4vxct.js → rpc-runtime-2ny4vxct.js} +2 -2
- package/dist/chunks/{shared-events-q008jpwa.js → rpc-runtime-3d7b8k62.js} +4 -4
- package/dist/chunks/{shared-events-m77rqa4a.js → rpc-runtime-61wt4y9h.js} +22 -17
- package/dist/chunks/{shared-events-1y4a697q.js → rpc-runtime-6vp15eh6.js} +1 -1
- package/dist/chunks/{shared-events-td2fzm91.js → rpc-runtime-91bd4p6h.js} +1 -1
- package/dist/chunks/{shared-events-vt9jbch8.js → rpc-runtime-ezt8t3fk.js} +2 -1
- package/dist/chunks/{shared-events-frbwqjmf.js → rpc-runtime-frbwqjmf.js} +1 -1
- package/dist/chunks/{shared-events-hqeq47hr.js → rpc-runtime-nv358xrg.js} +17 -3
- package/dist/chunks/{shared-events-qf89ssmg.js → rpc-runtime-q4y9w4td.js} +22 -8
- package/dist/chunks/{shared-events-t1xa31vm.js → rpc-runtime-t1xa31vm.js} +1 -1
- package/dist/chunks/{shared-events-d86rytwj.js → rpc-runtime-tjkwftgd.js} +9 -9
- package/dist/chunks/{shared-events-mnyft54j.js → rpc-runtime-w1w809zr.js} +5 -5
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +62 -29
- package/dist/effect/client.d.ts +1387 -1362
- package/dist/effect/client.js +8 -8
- package/dist/effect/generated/client-error.js +1 -1
- package/dist/effect/generated/client.d.ts +1278 -1253
- package/dist/effect/generated/client.js +5 -5
- package/dist/effect/generated/index.js +4 -4
- package/dist/effect/index.js +8 -8
- package/dist/effect/rpc.js +4 -4
- package/dist/effect/service.js +6 -6
- package/dist/promise/client.d.ts +8 -7
- package/dist/promise/client.js +7 -7
- package/dist/promise/generated/client-error.js +1 -1
- package/dist/promise/generated/client.d.ts +3 -2
- package/dist/promise/generated/client.js +2 -2
- package/dist/promise/generated/index.js +10 -8
- package/dist/promise/generated/types.d.ts +228 -1429
- package/dist/promise/generated/types.js +3 -1
- package/dist/promise/index.js +12 -10
- package/dist/promise/rpc.js +2 -2
- package/dist/promise/service.js +6 -6
- package/dist/pty-handoff.js +1 -1
- package/dist/rpc-runtime.d.ts +5 -5
- package/dist/rpc-runtime.js +1 -1
- package/dist/service-contender.js +1 -1
- package/dist/service-probe.d.ts +5 -5
- package/dist/service-probe.js +3 -3
- package/dist/service-timing.js +1 -1
- package/dist/service-version.js +1 -1
- package/dist/service.js +1 -1
- package/dist/shared-events.js +1 -1
- package/dist/solid/connection.js +1 -1
- package/dist/solid/data.js +9 -9
- package/dist/solid/index.js +12 -12
- package/dist/solid/pty.js +1 -1
- package/dist/solid/usage.js +1 -1
- package/package.json +6 -6
- /package/dist/chunks/{shared-events-6mptkzbc.js → rpc-runtime-6mptkzbc.js} +0 -0
- /package/dist/chunks/{shared-events-7f0py9js.js → rpc-runtime-7f0py9js.js} +0 -0
- /package/dist/chunks/{shared-events-8s2anffy.js → rpc-runtime-8s2anffy.js} +0 -0
- /package/dist/chunks/{shared-events-9rqn6x4v.js → rpc-runtime-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{shared-events-gne7h7mq.js → rpc-runtime-gne7h7mq.js} +0 -0
- /package/dist/chunks/{shared-events-js54wxgp.js → rpc-runtime-js54wxgp.js} +0 -0
- /package/dist/chunks/{shared-events-m2eywc8w.js → rpc-runtime-m2eywc8w.js} +0 -0
- /package/dist/chunks/{shared-events-qav6mfdz.js → rpc-runtime-qav6mfdz.js} +0 -0
- /package/dist/chunks/{shared-events-sxt88q69.js → rpc-runtime-sxt88q69.js} +0 -0
- /package/dist/chunks/{shared-events-ve4aws36.js → rpc-runtime-ve4aws36.js} +0 -0
- /package/dist/chunks/{shared-events-vmytr4q8.js → rpc-runtime-vmytr4q8.js} +0 -0
- /package/dist/chunks/{shared-events-vyas3vgt.js → rpc-runtime-vyas3vgt.js} +0 -0
- /package/dist/chunks/{shared-events-xgnj2w4v.js → rpc-runtime-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{shared-events-ydhz1zrh.js → rpc-runtime-ydhz1zrh.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultEnsureTiming2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./rpc-runtime-xgnj2w4v.js";
|
|
4
4
|
import {
|
|
5
5
|
matchesVersion2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./rpc-runtime-sxt88q69.js";
|
|
7
7
|
|
|
8
8
|
// src/service-probe.ts
|
|
9
9
|
import { homedir } from "node:os";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
make7
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./rpc-runtime-frbwqjmf.js";
|
|
4
4
|
import {
|
|
5
5
|
make3
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./rpc-runtime-nv358xrg.js";
|
|
7
7
|
import {
|
|
8
8
|
makeRpc2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./rpc-runtime-6vp15eh6.js";
|
|
10
10
|
import {
|
|
11
11
|
__export
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./rpc-runtime-9rqn6x4v.js";
|
|
13
13
|
|
|
14
14
|
// src/promise/client.ts
|
|
15
15
|
var exports_client = {};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
isFormNotFoundError2,
|
|
3
3
|
isFormAlreadySettledError2,
|
|
4
4
|
isPermissionNotFoundError2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./rpc-runtime-ezt8t3fk.js";
|
|
6
6
|
|
|
7
7
|
// src/solid/data.ts
|
|
8
8
|
import { Worktree } from "@opencode/schema/worktree";
|
|
@@ -537,6 +537,14 @@ function createData2(config) {
|
|
|
537
537
|
if (store.session.info[event.data.sessionID])
|
|
538
538
|
setStore("session", "info", event.data.sessionID, "permissions", event.data.permissions);
|
|
539
539
|
return;
|
|
540
|
+
case "session.archived":
|
|
541
|
+
if (store.session.info[event.data.sessionID])
|
|
542
|
+
setStore("session", "info", event.data.sessionID, "time", "archived", event.created);
|
|
543
|
+
return;
|
|
544
|
+
case "session.unarchived":
|
|
545
|
+
if (store.session.info[event.data.sessionID])
|
|
546
|
+
setStore("session", "info", event.data.sessionID, "time", "archived", undefined);
|
|
547
|
+
return;
|
|
540
548
|
case "session.moved": {
|
|
541
549
|
const current = store.session.info[event.data.sessionID];
|
|
542
550
|
if (current) {
|
|
@@ -682,7 +690,7 @@ function createData2(config) {
|
|
|
682
690
|
existing.error = undefined;
|
|
683
691
|
existing.finish = undefined;
|
|
684
692
|
existing.rawFinish = undefined;
|
|
685
|
-
existing.
|
|
693
|
+
existing.native = undefined;
|
|
686
694
|
existing.time.created = event.data.started;
|
|
687
695
|
existing.time.streamed = undefined;
|
|
688
696
|
existing.time.completed = undefined;
|
|
@@ -717,7 +725,7 @@ function createData2(config) {
|
|
|
717
725
|
assistant.time.completed = event.created;
|
|
718
726
|
assistant.finish = event.data.finish;
|
|
719
727
|
assistant.rawFinish = event.data.rawFinish;
|
|
720
|
-
assistant.
|
|
728
|
+
assistant.native = event.data.native;
|
|
721
729
|
assistant.cost = event.data.cost;
|
|
722
730
|
assistant.tokens = event.data.tokens;
|
|
723
731
|
if (event.data.snapshot)
|
|
@@ -730,7 +738,7 @@ function createData2(config) {
|
|
|
730
738
|
assistant.time.completed = event.created;
|
|
731
739
|
assistant.finish = event.data.finish ?? "error";
|
|
732
740
|
assistant.rawFinish = event.data.rawFinish;
|
|
733
|
-
assistant.
|
|
741
|
+
assistant.native = event.data.native;
|
|
734
742
|
assistant.error = event.data.error;
|
|
735
743
|
assistant.retry = undefined;
|
|
736
744
|
if (event.data.cost !== undefined && event.data.tokens !== undefined) {
|
|
@@ -781,7 +789,7 @@ function createData2(config) {
|
|
|
781
789
|
message.editTool(event.data.sessionID, event.data.assistantMessageID, event.data.id, (tool) => {
|
|
782
790
|
tool.time.ran = event.created;
|
|
783
791
|
tool.executed = event.data.executed;
|
|
784
|
-
tool.
|
|
792
|
+
tool.native = event.data.native;
|
|
785
793
|
tool.state = { status: "running", input: event.data.input, metadata: {} };
|
|
786
794
|
});
|
|
787
795
|
return;
|
|
@@ -802,7 +810,8 @@ function createData2(config) {
|
|
|
802
810
|
content: [...event.data.content]
|
|
803
811
|
};
|
|
804
812
|
tool.executed = event.data.executed || tool.executed === true;
|
|
805
|
-
|
|
813
|
+
if (event.data.native)
|
|
814
|
+
tool.native = { ...tool.native, ...event.data.native };
|
|
806
815
|
tool.time.completed = event.created;
|
|
807
816
|
});
|
|
808
817
|
return;
|
|
@@ -818,7 +827,8 @@ function createData2(config) {
|
|
|
818
827
|
content: event.data.content
|
|
819
828
|
};
|
|
820
829
|
tool.executed = event.data.executed || tool.executed === true;
|
|
821
|
-
|
|
830
|
+
if (event.data.native)
|
|
831
|
+
tool.native = { ...tool.native, ...event.data.native };
|
|
822
832
|
tool.time.completed = event.created;
|
|
823
833
|
});
|
|
824
834
|
return;
|
|
@@ -827,7 +837,7 @@ function createData2(config) {
|
|
|
827
837
|
assistant.content.push({
|
|
828
838
|
type: "reasoning",
|
|
829
839
|
text: "",
|
|
830
|
-
|
|
840
|
+
native: event.data.native,
|
|
831
841
|
time: { created: event.created }
|
|
832
842
|
});
|
|
833
843
|
});
|
|
@@ -841,8 +851,8 @@ function createData2(config) {
|
|
|
841
851
|
message.editReasoning(event.data.sessionID, event.data.assistantMessageID, (reasoning) => {
|
|
842
852
|
reasoning.text = event.data.text;
|
|
843
853
|
reasoning.time = { created: reasoning.time?.created ?? event.created, completed: event.created };
|
|
844
|
-
if (event.data.
|
|
845
|
-
reasoning.
|
|
854
|
+
if (event.data.native !== undefined)
|
|
855
|
+
reasoning.native = event.data.native;
|
|
846
856
|
});
|
|
847
857
|
return;
|
|
848
858
|
case "session.retry.scheduled":
|
|
@@ -862,7 +872,6 @@ function createData2(config) {
|
|
|
862
872
|
status: "running",
|
|
863
873
|
reason: event.data.reason,
|
|
864
874
|
summary: "",
|
|
865
|
-
recent: event.data.recent ?? "",
|
|
866
875
|
time: { created: event.created }
|
|
867
876
|
});
|
|
868
877
|
if (event.data.inputID)
|
|
@@ -938,10 +947,8 @@ function createData2(config) {
|
|
|
938
947
|
status: "completed",
|
|
939
948
|
reason: event.data.reason,
|
|
940
949
|
model: event.data.model,
|
|
941
|
-
|
|
942
|
-
providerContext: event.data.providerContext,
|
|
950
|
+
native: event.data.native,
|
|
943
951
|
summary: event.data.text,
|
|
944
|
-
recent: event.data.recent,
|
|
945
952
|
cost: event.data.cost,
|
|
946
953
|
tokens: event.data.tokens
|
|
947
954
|
});
|
|
@@ -953,10 +960,8 @@ function createData2(config) {
|
|
|
953
960
|
status: "completed",
|
|
954
961
|
reason: event.data.reason,
|
|
955
962
|
model: event.data.model,
|
|
956
|
-
|
|
957
|
-
providerContext: event.data.providerContext,
|
|
963
|
+
native: event.data.native,
|
|
958
964
|
summary: event.data.text,
|
|
959
|
-
recent: event.data.recent,
|
|
960
965
|
cost: event.data.cost,
|
|
961
966
|
tokens: event.data.tokens,
|
|
962
967
|
time: { created: event.created }
|
|
@@ -23,6 +23,7 @@ var isIntegrationAttemptNotFoundError2 = (value) => typeof value === "object" &&
|
|
|
23
23
|
var isIntegrationMethodNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationMethodNotFoundError";
|
|
24
24
|
var isMcpServerNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "McpServerNotFoundError";
|
|
25
25
|
var isProjectNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ProjectNotFoundError";
|
|
26
|
+
var isPermissionSavedNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionSavedNotFoundError";
|
|
26
27
|
var isPermissionNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionNotFoundError";
|
|
27
28
|
var isFileNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "FileNotFoundError";
|
|
28
29
|
var isRpcError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "RpcError";
|
|
@@ -33,4 +34,4 @@ var isShellNotFoundError2 = (value) => typeof value === "object" && value !== nu
|
|
|
33
34
|
var isWorktreeError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "WorktreeError";
|
|
34
35
|
var isVcsInitNotSupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VcsInitNotSupportedError";
|
|
35
36
|
|
|
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 };
|
|
37
|
+
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, isPermissionSavedNotFoundError2, isPermissionNotFoundError2, isFileNotFoundError2, isRpcError2, isRpcInternalError2, isPtyNotFoundError2, isForbiddenError2, isShellNotFoundError2, isWorktreeError2, isVcsInitNotSupportedError2 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientError2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./rpc-runtime-js54wxgp.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./rpc-runtime-9rqn6x4v.js";
|
|
7
7
|
|
|
8
8
|
// src/promise/generated/client.ts
|
|
9
9
|
var exports_client2 = {};
|
|
@@ -226,6 +226,7 @@ function make3(options) {
|
|
|
226
226
|
order: input?.["order"],
|
|
227
227
|
search: input?.["search"],
|
|
228
228
|
parentID: input?.["parentID"],
|
|
229
|
+
archived: input?.["archived"],
|
|
229
230
|
directory: input?.["directory"],
|
|
230
231
|
project: input?.["project"],
|
|
231
232
|
subpath: input?.["subpath"],
|
|
@@ -330,7 +331,12 @@ function make3(options) {
|
|
|
330
331
|
update: (input, requestOptions) => request({
|
|
331
332
|
method: "PATCH",
|
|
332
333
|
path: `/api/session/${encodeURIComponent(input.sessionID)}`,
|
|
333
|
-
body: {
|
|
334
|
+
body: {
|
|
335
|
+
title: input["title"],
|
|
336
|
+
metadata: input["metadata"],
|
|
337
|
+
permissions: input["permissions"],
|
|
338
|
+
archived: input["archived"]
|
|
339
|
+
},
|
|
334
340
|
successStatus: 204,
|
|
335
341
|
declaredStatuses: [400, 401, 404],
|
|
336
342
|
empty: true
|
|
@@ -930,6 +936,14 @@ function make3(options) {
|
|
|
930
936
|
declaredStatuses: [400, 401, 404],
|
|
931
937
|
empty: false
|
|
932
938
|
}, requestOptions).then((value) => value.data),
|
|
939
|
+
update: (input, requestOptions) => request({
|
|
940
|
+
method: "PATCH",
|
|
941
|
+
path: `/api/permission/saved/${encodeURIComponent(input.id)}`,
|
|
942
|
+
body: { action: input["action"], resource: input["resource"] },
|
|
943
|
+
successStatus: 200,
|
|
944
|
+
declaredStatuses: [400, 401, 404, 409],
|
|
945
|
+
empty: false
|
|
946
|
+
}, requestOptions).then((value) => value.data),
|
|
933
947
|
remove: (input, requestOptions) => request({
|
|
934
948
|
method: "DELETE",
|
|
935
949
|
path: `/api/permission/saved/${encodeURIComponent(input.id)}`,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientApi2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./rpc-runtime-vmytr4q8.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientError3
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./rpc-runtime-7f0py9js.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./rpc-runtime-9rqn6x4v.js";
|
|
10
10
|
|
|
11
11
|
// src/effect/generated/client.ts
|
|
12
12
|
var exports_client4 = {};
|
|
13
13
|
__export(exports_client4, {
|
|
14
|
-
make: () =>
|
|
14
|
+
make: () => make5
|
|
15
15
|
});
|
|
16
16
|
import { Effect, Stream, Schema } from "effect";
|
|
17
17
|
import { Sse } from "effect/encoding";
|
|
@@ -54,6 +54,7 @@ var EndpointSessionList = (raw) => (input) => preserveEffect()(raw["session.list
|
|
|
54
54
|
order: input?.["order"],
|
|
55
55
|
search: input?.["search"],
|
|
56
56
|
parentID: input?.["parentID"],
|
|
57
|
+
archived: input?.["archived"],
|
|
57
58
|
directory: input?.["directory"],
|
|
58
59
|
project: input?.["project"],
|
|
59
60
|
subpath: input?.["subpath"],
|
|
@@ -93,7 +94,12 @@ var EndpointSessionSwitchAgent = (raw) => (input) => preserveEffect()(raw["sessi
|
|
|
93
94
|
var EndpointSessionSwitchModel = (raw) => (input) => preserveEffect()(raw["session.switchModel"]({ params: { sessionID: input["sessionID"] }, payload: { model: input["model"] } }).pipe(Effect.mapError(mapClientError)));
|
|
94
95
|
var EndpointSessionUpdate = (raw) => (input) => preserveEffect()(raw["session.update"]({
|
|
95
96
|
params: { sessionID: input["sessionID"] },
|
|
96
|
-
payload: {
|
|
97
|
+
payload: {
|
|
98
|
+
title: input["title"],
|
|
99
|
+
metadata: input["metadata"],
|
|
100
|
+
permissions: input["permissions"],
|
|
101
|
+
archived: input["archived"]
|
|
102
|
+
}
|
|
97
103
|
}).pipe(Effect.mapError(mapClientError)));
|
|
98
104
|
var EndpointSessionMove = (raw) => (input) => preserveEffect()(raw["session.move"]({
|
|
99
105
|
params: { sessionID: input["sessionID"] },
|
|
@@ -393,6 +399,10 @@ var EndpointFormList = (raw) => (input) => preserveEffect()(raw["form.list"]({ q
|
|
|
393
399
|
var adaptGroupForm = (raw) => ({ list: EndpointFormList(raw) });
|
|
394
400
|
var EndpointPermissionRequestList = (raw) => (input) => preserveEffect()(raw["permission.request.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
395
401
|
var EndpointPermissionSavedList = (raw) => (input) => preserveEffect()(raw["permission.saved.list"]({ query: { projectID: input?.["projectID"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
402
|
+
var EndpointPermissionSavedUpdate = (raw) => (input) => preserveEffect()(raw["permission.saved.update"]({
|
|
403
|
+
params: { id: input["id"] },
|
|
404
|
+
payload: { action: input["action"], resource: input["resource"] }
|
|
405
|
+
}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
396
406
|
var EndpointPermissionSavedRemove = (raw) => (input) => preserveEffect()(raw["permission.saved.remove"]({ params: { id: input["id"] } }).pipe(Effect.mapError(mapClientError)));
|
|
397
407
|
var EndpointPermissionCreate = (raw) => (input) => preserveEffect()(raw["session.permission.create"]({
|
|
398
408
|
params: { sessionID: input["sessionID"] },
|
|
@@ -414,7 +424,11 @@ var EndpointPermissionReply = (raw) => (input) => preserveEffect()(raw["session.
|
|
|
414
424
|
}).pipe(Effect.mapError(mapClientError)));
|
|
415
425
|
var adaptGroupPermission = (raw) => ({
|
|
416
426
|
request: { list: EndpointPermissionRequestList(raw) },
|
|
417
|
-
saved: {
|
|
427
|
+
saved: {
|
|
428
|
+
list: EndpointPermissionSavedList(raw),
|
|
429
|
+
update: EndpointPermissionSavedUpdate(raw),
|
|
430
|
+
remove: EndpointPermissionSavedRemove(raw)
|
|
431
|
+
},
|
|
418
432
|
create: EndpointPermissionCreate(raw),
|
|
419
433
|
list: EndpointPermissionList(raw),
|
|
420
434
|
get: EndpointPermissionGet(raw),
|
|
@@ -623,6 +637,6 @@ var adaptClient = (raw) => ({
|
|
|
623
637
|
websearch: adaptGroupWebsearch(raw["server.websearch"]),
|
|
624
638
|
config: adaptGroupConfig(raw["server.config"])
|
|
625
639
|
});
|
|
626
|
-
var
|
|
640
|
+
var make5 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
|
|
627
641
|
|
|
628
|
-
export {
|
|
642
|
+
export { make5, exports_client4 };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
make7
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./rpc-runtime-frbwqjmf.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientError3
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./rpc-runtime-7f0py9js.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./
|
|
8
|
+
make5
|
|
9
|
+
} from "./rpc-runtime-q4y9w4td.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
11
|
+
make6,
|
|
12
12
|
aborted2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./rpc-runtime-w1w809zr.js";
|
|
14
14
|
import {
|
|
15
15
|
__export
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./rpc-runtime-9rqn6x4v.js";
|
|
17
17
|
|
|
18
18
|
// src/effect/client.ts
|
|
19
19
|
var exports_client3 = {};
|
|
@@ -30,7 +30,7 @@ var CurrentHeaders = Context.Reference("@opencode/client/effect/rpc/headers", {
|
|
|
30
30
|
});
|
|
31
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
|
|
|
@@ -45,7 +45,7 @@ var make4 = Effect.fn("OpenCode.make")(function* (options) {
|
|
|
45
45
|
return {
|
|
46
46
|
...raw,
|
|
47
47
|
event: { ...raw.event, subscribe },
|
|
48
|
-
rpc: Object.assign(
|
|
48
|
+
rpc: Object.assign(make6((input, options) => raw.rpc.call(input).pipe(Effect.provideService(CurrentHeaders, options?.headers)), subscribe), raw.rpc)
|
|
49
49
|
};
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
readError2,
|
|
4
4
|
event2,
|
|
5
5
|
eventType2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./rpc-runtime-t1xa31vm.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./rpc-runtime-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
package/dist/effect/api/api.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type { Session } from "@opencode/schema/session";
|
|
|
6
6
|
import type { AbsolutePath } from "@opencode/schema/schema";
|
|
7
7
|
import type { Project } from "@opencode/schema/project";
|
|
8
8
|
import type { RelativePath } from "@opencode/schema/schema";
|
|
9
|
-
import type { SessionsCursor } from "@opencode/protocol/groups/session";
|
|
10
9
|
import type { Money } from "@opencode/schema/money";
|
|
11
10
|
import type { Model } from "@opencode/schema/model";
|
|
12
11
|
import type { DateTime } from "effect";
|
|
@@ -25,8 +24,8 @@ import type { Workspace } from "@opencode/schema/workspace";
|
|
|
25
24
|
import type { Instruction } from "@opencode/schema/instruction";
|
|
26
25
|
import type { Snapshot } from "@opencode/schema/snapshot";
|
|
27
26
|
import type { Shell } from "@opencode/schema/shell";
|
|
28
|
-
import type { Provider } from "@opencode/schema/provider";
|
|
29
27
|
import type { Form } from "@opencode/schema/form";
|
|
28
|
+
import type { Provider } from "@opencode/schema/provider";
|
|
30
29
|
import type { Integration } from "@opencode/schema/integration";
|
|
31
30
|
import type { Mcp } from "@opencode/schema/mcp";
|
|
32
31
|
import type { Credential } from "@opencode/schema/credential";
|
|
@@ -147,16 +146,17 @@ export type SessionListInput = {
|
|
|
147
146
|
readonly order?: "asc" | "desc" | undefined;
|
|
148
147
|
readonly search?: string | undefined;
|
|
149
148
|
readonly parentID?: Session.ID | null | undefined;
|
|
149
|
+
readonly archived?: boolean | undefined;
|
|
150
150
|
readonly directory?: AbsolutePath | undefined;
|
|
151
151
|
readonly project?: Project.ID | undefined;
|
|
152
152
|
readonly subpath?: RelativePath | undefined;
|
|
153
|
-
readonly cursor?:
|
|
153
|
+
readonly cursor?: Session.ListCursor | undefined;
|
|
154
154
|
};
|
|
155
155
|
export type SessionListOutput = {
|
|
156
156
|
readonly data: ReadonlyArray<Session.Info>;
|
|
157
157
|
readonly cursor: {
|
|
158
|
-
readonly previous?:
|
|
159
|
-
readonly next?:
|
|
158
|
+
readonly previous?: Session.ListCursor | undefined;
|
|
159
|
+
readonly next?: Session.ListCursor | undefined;
|
|
160
160
|
};
|
|
161
161
|
};
|
|
162
162
|
export type SessionListOperation<E = never> = (input?: SessionListInput) => Effect.Effect<SessionListOutput, E>;
|
|
@@ -302,6 +302,7 @@ export type SessionUpdateInput = {
|
|
|
302
302
|
readonly title?: string | undefined;
|
|
303
303
|
readonly metadata?: Session.Metadata | undefined;
|
|
304
304
|
readonly permissions?: Permission.Ruleset | undefined;
|
|
305
|
+
readonly archived?: boolean | undefined;
|
|
305
306
|
};
|
|
306
307
|
export type SessionUpdateOutput = void;
|
|
307
308
|
export type SessionUpdateOperation<E = never> = (input: SessionUpdateInput) => Effect.Effect<SessionUpdateOutput, E>;
|
|
@@ -636,6 +637,44 @@ export type SessionLogOutput = ({
|
|
|
636
637
|
readonly sessionID: Session.ID;
|
|
637
638
|
readonly idle: number;
|
|
638
639
|
};
|
|
640
|
+
} | {
|
|
641
|
+
readonly id: Event.ID;
|
|
642
|
+
readonly created: number;
|
|
643
|
+
readonly metadata?: {
|
|
644
|
+
readonly [x: string]: unknown;
|
|
645
|
+
} | undefined;
|
|
646
|
+
readonly type: "session.archived";
|
|
647
|
+
readonly durable: {
|
|
648
|
+
readonly aggregateID: string;
|
|
649
|
+
readonly seq: Event.Seq;
|
|
650
|
+
readonly version: Event.Version;
|
|
651
|
+
};
|
|
652
|
+
readonly location?: {
|
|
653
|
+
readonly directory: AbsolutePath;
|
|
654
|
+
readonly workspaceID?: Workspace.ID | undefined;
|
|
655
|
+
} | undefined;
|
|
656
|
+
readonly data: {
|
|
657
|
+
readonly sessionID: Session.ID;
|
|
658
|
+
};
|
|
659
|
+
} | {
|
|
660
|
+
readonly id: Event.ID;
|
|
661
|
+
readonly created: number;
|
|
662
|
+
readonly metadata?: {
|
|
663
|
+
readonly [x: string]: unknown;
|
|
664
|
+
} | undefined;
|
|
665
|
+
readonly type: "session.unarchived";
|
|
666
|
+
readonly durable: {
|
|
667
|
+
readonly aggregateID: string;
|
|
668
|
+
readonly seq: Event.Seq;
|
|
669
|
+
readonly version: Event.Version;
|
|
670
|
+
};
|
|
671
|
+
readonly location?: {
|
|
672
|
+
readonly directory: AbsolutePath;
|
|
673
|
+
readonly workspaceID?: Workspace.ID | undefined;
|
|
674
|
+
} | undefined;
|
|
675
|
+
readonly data: {
|
|
676
|
+
readonly sessionID: Session.ID;
|
|
677
|
+
};
|
|
639
678
|
} | {
|
|
640
679
|
readonly id: Event.ID;
|
|
641
680
|
readonly created: number;
|
|
@@ -1027,7 +1066,7 @@ export type SessionLogOutput = ({
|
|
|
1027
1066
|
readonly assistantMessageID: SessionMessage.ID;
|
|
1028
1067
|
readonly finish: "stop" | "length" | "tool-calls" | "content-filter" | "error" | "unknown";
|
|
1029
1068
|
readonly rawFinish?: string | undefined;
|
|
1030
|
-
readonly
|
|
1069
|
+
readonly native?: SessionMessage.Native | undefined;
|
|
1031
1070
|
readonly cost: Money.USD;
|
|
1032
1071
|
readonly tokens: {
|
|
1033
1072
|
readonly input: number;
|
|
@@ -1070,7 +1109,7 @@ export type SessionLogOutput = ({
|
|
|
1070
1109
|
};
|
|
1071
1110
|
readonly finish?: "content-filter" | undefined;
|
|
1072
1111
|
readonly rawFinish?: string | undefined;
|
|
1073
|
-
readonly
|
|
1112
|
+
readonly native?: SessionMessage.Native | undefined;
|
|
1074
1113
|
readonly cost?: Money.USD | undefined;
|
|
1075
1114
|
readonly tokens?: {
|
|
1076
1115
|
readonly input: number;
|
|
@@ -1126,7 +1165,7 @@ export type SessionLogOutput = ({
|
|
|
1126
1165
|
readonly assistantMessageID: SessionMessage.ID;
|
|
1127
1166
|
readonly ordinal: number;
|
|
1128
1167
|
readonly text: string;
|
|
1129
|
-
readonly
|
|
1168
|
+
readonly native?: SessionMessage.Native | undefined;
|
|
1130
1169
|
};
|
|
1131
1170
|
} | {
|
|
1132
1171
|
readonly id: Event.ID;
|
|
@@ -1148,7 +1187,7 @@ export type SessionLogOutput = ({
|
|
|
1148
1187
|
readonly sessionID: Session.ID;
|
|
1149
1188
|
readonly assistantMessageID: SessionMessage.ID;
|
|
1150
1189
|
readonly ordinal: number;
|
|
1151
|
-
readonly
|
|
1190
|
+
readonly native?: SessionMessage.Native | undefined;
|
|
1152
1191
|
};
|
|
1153
1192
|
} | {
|
|
1154
1193
|
readonly id: Event.ID;
|
|
@@ -1171,7 +1210,7 @@ export type SessionLogOutput = ({
|
|
|
1171
1210
|
readonly assistantMessageID: SessionMessage.ID;
|
|
1172
1211
|
readonly ordinal: number;
|
|
1173
1212
|
readonly text: string;
|
|
1174
|
-
readonly
|
|
1213
|
+
readonly native?: SessionMessage.Native | undefined;
|
|
1175
1214
|
};
|
|
1176
1215
|
} | {
|
|
1177
1216
|
readonly id: Event.ID;
|
|
@@ -1241,7 +1280,7 @@ export type SessionLogOutput = ({
|
|
|
1241
1280
|
readonly [x: string]: unknown;
|
|
1242
1281
|
};
|
|
1243
1282
|
readonly executed: boolean;
|
|
1244
|
-
readonly
|
|
1283
|
+
readonly native?: SessionMessage.Native | undefined;
|
|
1245
1284
|
};
|
|
1246
1285
|
} | {
|
|
1247
1286
|
readonly id: Event.ID;
|
|
@@ -1287,7 +1326,7 @@ export type SessionLogOutput = ({
|
|
|
1287
1326
|
readonly [x: string]: Schema.Json;
|
|
1288
1327
|
} | undefined;
|
|
1289
1328
|
readonly executed: boolean;
|
|
1290
|
-
readonly
|
|
1329
|
+
readonly native?: SessionMessage.Native | undefined;
|
|
1291
1330
|
};
|
|
1292
1331
|
} | {
|
|
1293
1332
|
readonly id: Event.ID;
|
|
@@ -1341,7 +1380,7 @@ export type SessionLogOutput = ({
|
|
|
1341
1380
|
readonly [x: string]: Schema.Json;
|
|
1342
1381
|
} | undefined;
|
|
1343
1382
|
readonly executed: boolean;
|
|
1344
|
-
readonly
|
|
1383
|
+
readonly native?: SessionMessage.Native | undefined;
|
|
1345
1384
|
};
|
|
1346
1385
|
} | {
|
|
1347
1386
|
readonly id: Event.ID;
|
|
@@ -1392,7 +1431,6 @@ export type SessionLogOutput = ({
|
|
|
1392
1431
|
readonly data: {
|
|
1393
1432
|
readonly sessionID: Session.ID;
|
|
1394
1433
|
readonly reason: "auto" | "manual";
|
|
1395
|
-
readonly recent: string;
|
|
1396
1434
|
readonly inputID?: SessionMessage.ID | undefined;
|
|
1397
1435
|
};
|
|
1398
1436
|
} | {
|
|
@@ -1415,21 +1453,8 @@ export type SessionLogOutput = ({
|
|
|
1415
1453
|
readonly sessionID: Session.ID;
|
|
1416
1454
|
readonly reason: "auto" | "manual";
|
|
1417
1455
|
readonly model?: Model.Ref | undefined;
|
|
1418
|
-
readonly
|
|
1419
|
-
readonly providerContext?: {
|
|
1420
|
-
readonly version: 1;
|
|
1421
|
-
readonly provenance: {
|
|
1422
|
-
readonly providerID: Provider.ID;
|
|
1423
|
-
readonly provider: string;
|
|
1424
|
-
readonly modelID: string;
|
|
1425
|
-
readonly route: string;
|
|
1426
|
-
readonly protocol: string;
|
|
1427
|
-
readonly endpoint: string;
|
|
1428
|
-
};
|
|
1429
|
-
readonly messages: Schema.Json;
|
|
1430
|
-
} | undefined;
|
|
1456
|
+
readonly native?: SessionMessage.Native | undefined;
|
|
1431
1457
|
readonly text: string;
|
|
1432
|
-
readonly recent: string;
|
|
1433
1458
|
readonly cost?: Money.USD | undefined;
|
|
1434
1459
|
readonly tokens?: {
|
|
1435
1460
|
readonly input: number;
|
|
@@ -1721,7 +1746,7 @@ export type MessageListInput = {
|
|
|
1721
1746
|
readonly limit?: number | undefined;
|
|
1722
1747
|
readonly order?: "asc" | "desc" | undefined;
|
|
1723
1748
|
readonly cursor?: string | undefined;
|
|
1724
|
-
readonly type?: "agent-switched" | "model-switched" | "location-switched" | "user" | "synthetic" | "system" | "skill" | "shell" | "assistant" | "compaction" | undefined;
|
|
1749
|
+
readonly type?: "agent-switched" | "model-switched" | "location-switched" | "user" | "synthetic" | "system" | "skill" | "shell" | "assistant" | "compaction" | "idle" | undefined;
|
|
1725
1750
|
};
|
|
1726
1751
|
export type MessageListOutput = {
|
|
1727
1752
|
readonly data: ReadonlyArray<SessionMessage.Info>;
|
|
@@ -2117,6 +2142,13 @@ export type PermissionSavedListInput = {
|
|
|
2117
2142
|
};
|
|
2118
2143
|
export type PermissionSavedListOutput = ReadonlyArray<PermissionSaved.Info>;
|
|
2119
2144
|
export type PermissionSavedListOperation<E = never> = (input?: PermissionSavedListInput) => Effect.Effect<PermissionSavedListOutput, E>;
|
|
2145
|
+
export type PermissionSavedUpdateInput = {
|
|
2146
|
+
readonly id: PermissionSaved.ID;
|
|
2147
|
+
readonly action?: string | undefined;
|
|
2148
|
+
readonly resource?: string | undefined;
|
|
2149
|
+
};
|
|
2150
|
+
export type PermissionSavedUpdateOutput = PermissionSaved.Info;
|
|
2151
|
+
export type PermissionSavedUpdateOperation<E = never> = (input: PermissionSavedUpdateInput) => Effect.Effect<PermissionSavedUpdateOutput, E>;
|
|
2120
2152
|
export type PermissionSavedRemoveInput = {
|
|
2121
2153
|
readonly id: PermissionSaved.ID;
|
|
2122
2154
|
};
|
|
@@ -2164,6 +2196,7 @@ export interface PermissionApi<E = never> {
|
|
|
2164
2196
|
};
|
|
2165
2197
|
readonly saved: {
|
|
2166
2198
|
readonly list: PermissionSavedListOperation<E>;
|
|
2199
|
+
readonly update: PermissionSavedUpdateOperation<E>;
|
|
2167
2200
|
readonly remove: PermissionSavedRemoveOperation<E>;
|
|
2168
2201
|
};
|
|
2169
2202
|
readonly create: PermissionCreateOperation<E>;
|