@opencode/client 2.1.2 → 2.1.4
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-probe-65kht65h.js → contract-15p82y03.js} +2 -2
- package/dist/chunks/{service-probe-61wt4y9h.js → contract-1x65x4hv.js} +15 -20
- package/dist/chunks/{service-probe-2ny4vxct.js → contract-2ny4vxct.js} +2 -2
- package/dist/chunks/{service-probe-frbwqjmf.js → contract-8bbb028w.js} +1 -1
- package/dist/chunks/{service-probe-032v66at.js → contract-9kmsh4jj.js} +8 -2
- package/dist/chunks/{service-probe-ezt8t3fk.js → contract-c46qzyff.js} +2 -2
- package/dist/chunks/{service-probe-ggt8t74w.js → contract-hg9t2gnm.js} +5 -5
- package/dist/chunks/{service-probe-t1xa31vm.js → contract-ryy6kscr.js} +1 -1
- package/dist/chunks/{service-probe-77ntr0t0.js → contract-s2hya144.js} +37 -3
- package/dist/chunks/{service-probe-6vp15eh6.js → contract-skhp7hxc.js} +1 -1
- package/dist/chunks/{service-probe-k9g6n5n1.js → contract-vwtmm97t.js} +4 -4
- package/dist/chunks/{service-probe-gbq9x9x6.js → contract-w10x3kfx.js} +21 -5
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +55 -1
- package/dist/effect/client.d.ts +791 -785
- package/dist/effect/client.js +8 -8
- package/dist/effect/generated/client-error.js +1 -1
- package/dist/effect/generated/client.d.ts +491 -485
- package/dist/effect/generated/client.js +3 -3
- package/dist/effect/generated/index.js +4 -4
- package/dist/effect/index.js +8 -8
- package/dist/effect/rpc.js +2 -2
- package/dist/effect/service.d.ts +1 -1
- package/dist/effect/service.js +11 -11
- package/dist/mcp.d.ts +44 -0
- package/dist/mcp.js +110 -0
- package/dist/promise/client.d.ts +12 -0
- package/dist/promise/client.js +7 -7
- package/dist/promise/generated/client-error.js +1 -1
- package/dist/promise/generated/client.d.ts +13 -1
- package/dist/promise/generated/client.js +2 -2
- package/dist/promise/generated/index.js +9 -9
- package/dist/promise/generated/types.d.ts +75 -9
- package/dist/promise/generated/types.js +2 -2
- package/dist/promise/index.js +11 -11
- package/dist/promise/rpc.js +2 -2
- package/dist/promise/service.js +11 -11
- package/dist/pty-handoff.js +4 -1
- package/dist/rpc-runtime.js +1 -1
- package/dist/service-contender.js +1 -1
- package/dist/service-probe.js +3 -3
- package/dist/service-timing.js +1 -1
- package/dist/service-version.js +1 -1
- package/dist/service.js +1 -1
- package/dist/shared-events.js +1 -1
- package/dist/solid/connection.js +1 -1
- package/dist/solid/data.js +9 -9
- package/dist/solid/index.js +12 -12
- package/dist/solid/pty.js +1 -1
- package/dist/solid/usage.js +1 -1
- package/package.json +13 -7
- /package/dist/chunks/{service-probe-6mptkzbc.js → contract-6mptkzbc.js} +0 -0
- /package/dist/chunks/{service-probe-8s2anffy.js → contract-8s2anffy.js} +0 -0
- /package/dist/chunks/{service-probe-9rqn6x4v.js → contract-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{service-probe-gne7h7mq.js → contract-gne7h7mq.js} +0 -0
- /package/dist/chunks/{service-probe-m2eywc8w.js → contract-m2eywc8w.js} +0 -0
- /package/dist/chunks/{service-probe-nwcpakzx.js → contract-nwcpakzx.js} +0 -0
- /package/dist/chunks/{service-probe-qav6mfdz.js → contract-qav6mfdz.js} +0 -0
- /package/dist/chunks/{service-probe-sxt88q69.js → contract-sxt88q69.js} +0 -0
- /package/dist/chunks/{service-probe-ve4aws36.js → contract-ve4aws36.js} +0 -0
- /package/dist/chunks/{service-probe-vmytr4q8.js → contract-vmytr4q8.js} +0 -0
- /package/dist/chunks/{service-probe-vyas3vgt.js → contract-vyas3vgt.js} +0 -0
- /package/dist/chunks/{service-probe-xgnj2w4v.js → contract-xgnj2w4v.js} +0 -0
- /package/dist/chunks/{service-probe-y2etg5bs.js → contract-y2etg5bs.js} +0 -0
- /package/dist/chunks/{service-probe-ydhz1zrh.js → contract-ydhz1zrh.js} +0 -0
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
readError2,
|
|
4
4
|
event2,
|
|
5
5
|
eventType2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-ryy6kscr.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./contract-9rqn6x4v.js";
|
|
10
10
|
|
|
11
11
|
// src/effect/rpc.ts
|
|
12
12
|
var exports_rpc = {};
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
isFormNotFoundError2,
|
|
3
3
|
isFormAlreadySettledError2,
|
|
4
4
|
isPermissionNotFoundError2
|
|
5
|
-
} from "./
|
|
5
|
+
} from "./contract-c46qzyff.js";
|
|
6
6
|
|
|
7
7
|
// src/solid/data.ts
|
|
8
8
|
import { Worktree } from "@opencode/schema/worktree";
|
|
@@ -10,7 +10,6 @@ import { SessionID } from "@opencode/schema/session-id";
|
|
|
10
10
|
import { SessionMessage } from "@opencode/schema/session-message";
|
|
11
11
|
import { createStore, produce, reconcile } from "solid-js/store";
|
|
12
12
|
import { batch, createEffect, createMemo, createSignal, onCleanup } from "solid-js";
|
|
13
|
-
var messageIDFromEvent = (eventID) => eventID.replace(/^evt_/, "msg_");
|
|
14
13
|
var messagePageLimit = 20;
|
|
15
14
|
var settleMs2 = 150;
|
|
16
15
|
function locationKey2(location) {
|
|
@@ -492,7 +491,7 @@ function createData2(config) {
|
|
|
492
491
|
if (store.session.info[event.data.sessionID])
|
|
493
492
|
setStore("session", "info", event.data.sessionID, "agent", event.data.agent);
|
|
494
493
|
message.insert(event.data.sessionID, {
|
|
495
|
-
id:
|
|
494
|
+
id: SessionMessage.ID.fromEvent(event.id),
|
|
496
495
|
type: "agent-switched",
|
|
497
496
|
agent: event.data.agent,
|
|
498
497
|
previous,
|
|
@@ -507,13 +506,13 @@ function createData2(config) {
|
|
|
507
506
|
if (!store.session.message[event.data.sessionID])
|
|
508
507
|
return;
|
|
509
508
|
message.insert(event.data.sessionID, {
|
|
510
|
-
id:
|
|
509
|
+
id: SessionMessage.ID.fromEvent(event.id),
|
|
511
510
|
type: "model-switched",
|
|
512
511
|
model: event.data.model,
|
|
513
512
|
previous,
|
|
514
513
|
time: { created: event.created }
|
|
515
514
|
});
|
|
516
|
-
refresh(() => api().session.message.get({ sessionID: event.data.sessionID, messageID:
|
|
515
|
+
refresh(() => api().session.message.get({ sessionID: event.data.sessionID, messageID: SessionMessage.ID.fromEvent(event.id) }).then((item) => {
|
|
517
516
|
message.update(event.data.sessionID, (draft, index) => {
|
|
518
517
|
const position = index.get(item.id);
|
|
519
518
|
if (position === undefined)
|
|
@@ -554,11 +553,10 @@ function createData2(config) {
|
|
|
554
553
|
subpath: current.subpath
|
|
555
554
|
};
|
|
556
555
|
setStore("session", "info", event.data.sessionID, "location", event.data.location);
|
|
557
|
-
|
|
558
|
-
setStore("session", "info", event.data.sessionID, "projectID", event.data.projectID);
|
|
556
|
+
setStore("session", "info", event.data.sessionID, "projectID", event.data.projectID);
|
|
559
557
|
setStore("session", "info", event.data.sessionID, "subpath", event.data.subpath);
|
|
560
558
|
message.insert(event.data.sessionID, {
|
|
561
|
-
id:
|
|
559
|
+
id: SessionMessage.ID.fromEvent(event.id),
|
|
562
560
|
type: "location-switched",
|
|
563
561
|
location: event.data.location,
|
|
564
562
|
projectID: event.data.projectID,
|
|
@@ -638,7 +636,7 @@ function createData2(config) {
|
|
|
638
636
|
if (updateText === undefined)
|
|
639
637
|
return;
|
|
640
638
|
message.insert(event.data.sessionID, {
|
|
641
|
-
id:
|
|
639
|
+
id: SessionMessage.ID.fromEvent(event.id),
|
|
642
640
|
type: "system",
|
|
643
641
|
text: updateText,
|
|
644
642
|
description: `Instructions updated: ${Object.keys(event.data.delta).join(", ")}`,
|
|
@@ -648,7 +646,7 @@ function createData2(config) {
|
|
|
648
646
|
return;
|
|
649
647
|
case "session.synthetic":
|
|
650
648
|
message.insert(event.data.sessionID, {
|
|
651
|
-
id:
|
|
649
|
+
id: SessionMessage.ID.fromEvent(event.id),
|
|
652
650
|
type: "synthetic",
|
|
653
651
|
text: event.data.text,
|
|
654
652
|
description: event.data.description,
|
|
@@ -658,7 +656,7 @@ function createData2(config) {
|
|
|
658
656
|
return;
|
|
659
657
|
case "session.shell.started":
|
|
660
658
|
message.insert(event.data.sessionID, {
|
|
661
|
-
id:
|
|
659
|
+
id: SessionMessage.ID.fromEvent(event.id),
|
|
662
660
|
type: "shell",
|
|
663
661
|
shellID: event.data.shell.id,
|
|
664
662
|
command: event.data.shell.command,
|
|
@@ -867,7 +865,7 @@ function createData2(config) {
|
|
|
867
865
|
if (event.data.inputID)
|
|
868
866
|
removePending(event.data.sessionID, event.data.inputID);
|
|
869
867
|
message.insert(event.data.sessionID, {
|
|
870
|
-
id: event.data.inputID ??
|
|
868
|
+
id: event.data.inputID ?? SessionMessage.ID.fromEvent(event.id),
|
|
871
869
|
type: "compaction",
|
|
872
870
|
status: "running",
|
|
873
871
|
reason: event.data.reason,
|
|
@@ -889,7 +887,7 @@ function createData2(config) {
|
|
|
889
887
|
if (event.type === "session.execution.interrupted" && event.data.reason === "shutdown")
|
|
890
888
|
return;
|
|
891
889
|
message.insert(event.data.sessionID, {
|
|
892
|
-
id:
|
|
890
|
+
id: SessionMessage.ID.fromEvent(event.id),
|
|
893
891
|
type: "idle",
|
|
894
892
|
outcome: event.type === "session.execution.succeeded" ? "succeeded" : event.type === "session.execution.failed" ? "failed" : "interrupted",
|
|
895
893
|
...event.type === "session.execution.failed" ? { error: event.data.error } : {},
|
|
@@ -955,7 +953,7 @@ function createData2(config) {
|
|
|
955
953
|
return;
|
|
956
954
|
}
|
|
957
955
|
message.append(draft, index, {
|
|
958
|
-
id:
|
|
956
|
+
id: SessionMessage.ID.fromEvent(event.id),
|
|
959
957
|
type: "compaction",
|
|
960
958
|
status: "completed",
|
|
961
959
|
reason: event.data.reason,
|
|
@@ -975,14 +973,11 @@ function createData2(config) {
|
|
|
975
973
|
const position = draft.findLastIndex((item) => item.type === "compaction" && item.status === "running");
|
|
976
974
|
const current = draft[position];
|
|
977
975
|
const failed = {
|
|
978
|
-
id: current?.id ?? event.data.inputID ??
|
|
976
|
+
id: current?.id ?? event.data.inputID ?? SessionMessage.ID.fromEvent(event.id),
|
|
979
977
|
type: "compaction",
|
|
980
978
|
status: "failed",
|
|
981
|
-
reason: event.data.reason
|
|
982
|
-
error: event.data.error
|
|
983
|
-
type: "compaction.failed",
|
|
984
|
-
message: "Compaction failed before recording an error"
|
|
985
|
-
},
|
|
979
|
+
reason: event.data.reason,
|
|
980
|
+
error: event.data.error,
|
|
986
981
|
metadata: current?.type === "compaction" ? current.metadata : event.metadata,
|
|
987
982
|
cost: event.data.cost,
|
|
988
983
|
tokens: event.data.tokens,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defaultEnsureTiming2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./contract-xgnj2w4v.js";
|
|
4
4
|
import {
|
|
5
5
|
matchesVersion2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-sxt88q69.js";
|
|
7
7
|
|
|
8
8
|
// src/service-probe.ts
|
|
9
9
|
import { homedir } from "node:os";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
headers2
|
|
3
|
+
} from "./contract-2ny4vxct.js";
|
|
1
4
|
import {
|
|
2
5
|
__export
|
|
3
|
-
} from "./
|
|
6
|
+
} from "./contract-9rqn6x4v.js";
|
|
4
7
|
|
|
5
8
|
// src/pty-handoff.ts
|
|
6
9
|
var exports_pty_handoff = {};
|
|
@@ -19,7 +22,10 @@ async function prepare2(file, info, timeout) {
|
|
|
19
22
|
const { OpenCode } = await import("../promise/index.js");
|
|
20
23
|
const client = OpenCode.make({
|
|
21
24
|
baseUrl: info.url,
|
|
22
|
-
headers:
|
|
25
|
+
headers: headers2({
|
|
26
|
+
url: info.url,
|
|
27
|
+
auth: info.password === undefined ? undefined : { type: "basic", username: "opencode", password: info.password }
|
|
28
|
+
})
|
|
23
29
|
});
|
|
24
30
|
const handoff = await client.experimental.persistentPty.handoff({ signal: AbortSignal.timeout(timeout) }).then(parse).catch(async (cause) => {
|
|
25
31
|
const concurrent = await read(file);
|
|
@@ -22,6 +22,7 @@ var isIntegrationNotFoundError2 = (value) => typeof value === "object" && value
|
|
|
22
22
|
var isIntegrationAttemptNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "IntegrationAttemptNotFoundError";
|
|
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
|
+
var isForbiddenError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ForbiddenError";
|
|
25
26
|
var isProjectNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ProjectNotFoundError";
|
|
26
27
|
var isPermissionSavedNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionSavedNotFoundError";
|
|
27
28
|
var isPermissionNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PermissionNotFoundError";
|
|
@@ -29,9 +30,8 @@ var isFileNotFoundError2 = (value) => typeof value === "object" && value !== nul
|
|
|
29
30
|
var isRpcError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "RpcError";
|
|
30
31
|
var isRpcInternalError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "RpcInternalError";
|
|
31
32
|
var isPtyNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "PtyNotFoundError";
|
|
32
|
-
var isForbiddenError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ForbiddenError";
|
|
33
33
|
var isShellNotFoundError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "ShellNotFoundError";
|
|
34
34
|
var isWorktreeError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "WorktreeError";
|
|
35
35
|
var isVcsInitNotSupportedError2 = (value) => typeof value === "object" && value !== null && ("_tag" in value) && value["_tag"] === "VcsInitNotSupportedError";
|
|
36
36
|
|
|
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,
|
|
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, isForbiddenError2, isProjectNotFoundError2, isPermissionSavedNotFoundError2, isPermissionNotFoundError2, isFileNotFoundError2, isRpcError2, isRpcInternalError2, isPtyNotFoundError2, isShellNotFoundError2, isWorktreeError2, isVcsInitNotSupportedError2 };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
make7
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./contract-8bbb028w.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientError2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-y2etg5bs.js";
|
|
7
7
|
import {
|
|
8
8
|
make4
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./contract-w10x3kfx.js";
|
|
10
10
|
import {
|
|
11
11
|
make3,
|
|
12
12
|
aborted2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./contract-15p82y03.js";
|
|
14
14
|
import {
|
|
15
15
|
__export
|
|
16
|
-
} from "./
|
|
16
|
+
} from "./contract-9rqn6x4v.js";
|
|
17
17
|
|
|
18
18
|
// src/effect/client.ts
|
|
19
19
|
var exports_client = {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientError3
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./contract-nwcpakzx.js";
|
|
4
4
|
import {
|
|
5
5
|
__export
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-9rqn6x4v.js";
|
|
7
7
|
|
|
8
8
|
// src/promise/generated/client.ts
|
|
9
9
|
var exports_client4 = {};
|
|
@@ -652,6 +652,13 @@ function make6(options) {
|
|
|
652
652
|
}, requestOptions).then((value) => value.data)
|
|
653
653
|
},
|
|
654
654
|
voice: {
|
|
655
|
+
models: (requestOptions) => request({
|
|
656
|
+
method: "GET",
|
|
657
|
+
path: `/api/experimental/voice/models`,
|
|
658
|
+
successStatus: 200,
|
|
659
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
660
|
+
empty: false
|
|
661
|
+
}, requestOptions).then((value) => value.data),
|
|
655
662
|
session: (input, requestOptions) => request({
|
|
656
663
|
method: "POST",
|
|
657
664
|
path: `/api/experimental/voice/session`,
|
|
@@ -659,7 +666,15 @@ function make6(options) {
|
|
|
659
666
|
successStatus: 200,
|
|
660
667
|
declaredStatuses: [400, 401, 404, 503],
|
|
661
668
|
empty: false
|
|
662
|
-
}, requestOptions).then((value) => value.data)
|
|
669
|
+
}, requestOptions).then((value) => value.data),
|
|
670
|
+
instructions: (input, requestOptions) => request({
|
|
671
|
+
method: "POST",
|
|
672
|
+
path: `/api/experimental/voice/session/${encodeURIComponent(input.sessionID)}/instructions`,
|
|
673
|
+
body: { instructions: input["instructions"] },
|
|
674
|
+
successStatus: 204,
|
|
675
|
+
declaredStatuses: [400, 401, 404, 503],
|
|
676
|
+
empty: true
|
|
677
|
+
}, requestOptions)
|
|
663
678
|
},
|
|
664
679
|
provider: {
|
|
665
680
|
list: (input, requestOptions) => request({
|
|
@@ -842,6 +857,17 @@ function make6(options) {
|
|
|
842
857
|
declaredStatuses: [400, 401, 404],
|
|
843
858
|
empty: false
|
|
844
859
|
}, requestOptions)
|
|
860
|
+
},
|
|
861
|
+
client: {
|
|
862
|
+
token: (input, requestOptions) => request({
|
|
863
|
+
method: "POST",
|
|
864
|
+
path: `/api/experimental/client-mcp/token`,
|
|
865
|
+
query: { location: input["location"], name: input["name"] },
|
|
866
|
+
headers: { "x-opencode-ticket": input["x-opencode-ticket"] },
|
|
867
|
+
successStatus: 200,
|
|
868
|
+
declaredStatuses: [400, 401, 403, 404],
|
|
869
|
+
empty: false
|
|
870
|
+
}, requestOptions)
|
|
845
871
|
}
|
|
846
872
|
},
|
|
847
873
|
credential: {
|
|
@@ -1359,6 +1385,14 @@ function make6(options) {
|
|
|
1359
1385
|
}, requestOptions)
|
|
1360
1386
|
},
|
|
1361
1387
|
debug: {
|
|
1388
|
+
heapDump: (input, requestOptions) => request({
|
|
1389
|
+
method: "POST",
|
|
1390
|
+
path: `/api/debug/heap-dump`,
|
|
1391
|
+
query: { directory: input?.["directory"] },
|
|
1392
|
+
successStatus: 200,
|
|
1393
|
+
declaredStatuses: [400, 401, 500],
|
|
1394
|
+
empty: false
|
|
1395
|
+
}, requestOptions),
|
|
1362
1396
|
location: {
|
|
1363
1397
|
list: (requestOptions) => request({
|
|
1364
1398
|
method: "GET",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
make7
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./contract-8bbb028w.js";
|
|
4
4
|
import {
|
|
5
5
|
make6
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-s2hya144.js";
|
|
7
7
|
import {
|
|
8
8
|
makeRpc2
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./contract-skhp7hxc.js";
|
|
10
10
|
import {
|
|
11
11
|
__export
|
|
12
|
-
} from "./
|
|
12
|
+
} from "./contract-9rqn6x4v.js";
|
|
13
13
|
|
|
14
14
|
// src/promise/client.ts
|
|
15
15
|
var exports_client3 = {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClientApi2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./contract-vmytr4q8.js";
|
|
4
4
|
import {
|
|
5
5
|
ClientError2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-y2etg5bs.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./contract-9rqn6x4v.js";
|
|
10
10
|
|
|
11
11
|
// src/effect/generated/client.ts
|
|
12
12
|
var exports_client2 = {};
|
|
@@ -271,10 +271,19 @@ var adaptGroupModel = (raw) => ({
|
|
|
271
271
|
});
|
|
272
272
|
var EndpointGenerateText = (raw) => (input) => preserveEffect()(raw["generate.text"]({ payload: { prompt: input["prompt"], model: input["model"] } }).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
273
273
|
var adaptGroupGenerate = (raw) => ({ text: EndpointGenerateText(raw) });
|
|
274
|
+
var EndpointVoiceModels = (raw) => () => preserveEffect()(raw["voice.models"]({}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
274
275
|
var EndpointVoiceSession = (raw) => (input) => preserveEffect()(raw["voice.session"]({
|
|
275
276
|
payload: { model: input["model"], session: input["session"], transport: input["transport"] }
|
|
276
277
|
}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
277
|
-
var
|
|
278
|
+
var EndpointVoiceInstructions = (raw) => (input) => preserveEffect()(raw["voice.instructions"]({
|
|
279
|
+
params: { sessionID: input["sessionID"] },
|
|
280
|
+
payload: { instructions: input["instructions"] }
|
|
281
|
+
}).pipe(Effect.mapError(mapClientError)));
|
|
282
|
+
var adaptGroupVoice = (raw) => ({
|
|
283
|
+
models: EndpointVoiceModels(raw),
|
|
284
|
+
session: EndpointVoiceSession(raw),
|
|
285
|
+
instructions: EndpointVoiceInstructions(raw)
|
|
286
|
+
});
|
|
278
287
|
var EndpointProviderList = (raw) => (input) => preserveEffect()(raw["provider.list"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
279
288
|
var EndpointProviderGet = (raw) => (input) => preserveEffect()(raw["provider.get"]({ params: { providerID: input["providerID"] }, query: { location: input["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
280
289
|
var adaptGroupProvider = (raw) => ({
|
|
@@ -355,13 +364,18 @@ var EndpointMcpRemove = (raw) => (input) => preserveEffect()(raw["mcp.remove"]({
|
|
|
355
364
|
var EndpointMcpConnect = (raw) => (input) => preserveEffect()(raw["mcp.connect"]({ params: { server: input["server"] }, query: { location: input["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
356
365
|
var EndpointMcpDisconnect = (raw) => (input) => preserveEffect()(raw["mcp.disconnect"]({ params: { server: input["server"] }, query: { location: input["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
357
366
|
var EndpointMcpResourceCatalog = (raw) => (input) => preserveEffect()(raw["mcp.resource.catalog"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
367
|
+
var EndpointMcpClientToken = (raw) => (input) => preserveEffect()(raw["mcp.clientToken"]({
|
|
368
|
+
query: { location: input["location"], name: input["name"] },
|
|
369
|
+
headers: { "x-opencode-ticket": input["x-opencode-ticket"] }
|
|
370
|
+
}).pipe(Effect.mapError(mapClientError)));
|
|
358
371
|
var adaptGroupMcp = (raw) => ({
|
|
359
372
|
list: EndpointMcpList(raw),
|
|
360
373
|
add: EndpointMcpAdd(raw),
|
|
361
374
|
remove: EndpointMcpRemove(raw),
|
|
362
375
|
connect: EndpointMcpConnect(raw),
|
|
363
376
|
disconnect: EndpointMcpDisconnect(raw),
|
|
364
|
-
resource: { catalog: EndpointMcpResourceCatalog(raw) }
|
|
377
|
+
resource: { catalog: EndpointMcpResourceCatalog(raw) },
|
|
378
|
+
client: { token: EndpointMcpClientToken(raw) }
|
|
365
379
|
});
|
|
366
380
|
var EndpointCredentialList = (raw) => () => preserveEffect()(raw["credential.list"]({}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
367
381
|
var EndpointCredentialCreate = (raw) => (input) => preserveEffect()(raw["credential.create"]({
|
|
@@ -580,9 +594,11 @@ var adaptGroupVcs = (raw) => ({
|
|
|
580
594
|
branch: { list: EndpointVcsBranchList(raw) },
|
|
581
595
|
diff: EndpointVcsDiff(raw)
|
|
582
596
|
});
|
|
597
|
+
var EndpointDebugHeapDump = (raw) => (input) => preserveEffect()(raw["debug.heapDump"]({ query: { directory: input?.["directory"] } }).pipe(Effect.mapError(mapClientError)));
|
|
583
598
|
var EndpointDebugLocationList = (raw) => () => preserveEffect()(raw["debug.location"]({}).pipe(Effect.mapError(mapClientError)));
|
|
584
599
|
var EndpointDebugLocationEvict = (raw) => (input) => preserveEffect()(raw["debug.location.evict"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
585
600
|
var adaptGroupDebug = (raw) => ({
|
|
601
|
+
heapDump: EndpointDebugHeapDump(raw),
|
|
586
602
|
location: { list: EndpointDebugLocationList(raw), evict: EndpointDebugLocationEvict(raw) }
|
|
587
603
|
});
|
|
588
604
|
var EndpointMigrationV1Status = (raw) => () => preserveEffect()(raw["migration.v1.status"]({}).pipe(Effect.mapError(mapClientError)));
|
package/dist/contract.js
CHANGED
package/dist/effect/api/api.d.ts
CHANGED
|
@@ -28,13 +28,13 @@ import type { Form } from "@opencode/schema/form";
|
|
|
28
28
|
import type { Provider } from "@opencode/schema/provider";
|
|
29
29
|
import type { Integration } from "@opencode/schema/integration";
|
|
30
30
|
import type { Mcp } from "@opencode/schema/mcp";
|
|
31
|
+
import type { PtyTicket } from "@opencode/schema/pty-ticket";
|
|
31
32
|
import type { Credential } from "@opencode/schema/credential";
|
|
32
33
|
import type { PermissionSaved } from "@opencode/schema/permission-saved";
|
|
33
34
|
import type { FileSystem } from "@opencode/schema/filesystem";
|
|
34
35
|
import type { Command } from "@opencode/schema/command";
|
|
35
36
|
import type { OpenCodeEvent } from "@opencode/protocol/groups/event";
|
|
36
37
|
import type { Pty } from "@opencode/schema/pty";
|
|
37
|
-
import type { PtyTicket } from "@opencode/schema/pty-ticket";
|
|
38
38
|
import type { Reference } from "@opencode/schema/reference";
|
|
39
39
|
import type { Worktree } from "@opencode/schema/worktree";
|
|
40
40
|
import type { Vcs } from "@opencode/schema/vcs";
|
|
@@ -1799,6 +1799,18 @@ export type GenerateTextOperation<E = never> = (input: GenerateTextInput) => Eff
|
|
|
1799
1799
|
export interface GenerateApi<E = never> {
|
|
1800
1800
|
readonly text: GenerateTextOperation<E>;
|
|
1801
1801
|
}
|
|
1802
|
+
export type VoiceModelsOutput = {
|
|
1803
|
+
readonly models: ReadonlyArray<{
|
|
1804
|
+
readonly model: string;
|
|
1805
|
+
readonly provider: string;
|
|
1806
|
+
readonly transports: ReadonlyArray<"webrtc" | "websocket">;
|
|
1807
|
+
readonly available: boolean;
|
|
1808
|
+
readonly integration?: string | undefined;
|
|
1809
|
+
readonly workspace?: string | undefined;
|
|
1810
|
+
}>;
|
|
1811
|
+
readonly default?: string | undefined;
|
|
1812
|
+
};
|
|
1813
|
+
export type VoiceModelsOperation<E = never> = () => Effect.Effect<VoiceModelsOutput, E>;
|
|
1802
1814
|
export type VoiceSessionInput = {
|
|
1803
1815
|
readonly model: string;
|
|
1804
1816
|
readonly session?: {
|
|
@@ -1822,10 +1834,21 @@ export type VoiceSessionOutput = {
|
|
|
1822
1834
|
readonly token: string;
|
|
1823
1835
|
readonly expiresAt: number;
|
|
1824
1836
|
};
|
|
1837
|
+
readonly session?: {
|
|
1838
|
+
readonly id: string;
|
|
1839
|
+
} | undefined;
|
|
1825
1840
|
};
|
|
1826
1841
|
export type VoiceSessionOperation<E = never> = (input: VoiceSessionInput) => Effect.Effect<VoiceSessionOutput, E>;
|
|
1842
|
+
export type VoiceInstructionsInput = {
|
|
1843
|
+
readonly sessionID: string;
|
|
1844
|
+
readonly instructions: string;
|
|
1845
|
+
};
|
|
1846
|
+
export type VoiceInstructionsOutput = void;
|
|
1847
|
+
export type VoiceInstructionsOperation<E = never> = (input: VoiceInstructionsInput) => Effect.Effect<VoiceInstructionsOutput, E>;
|
|
1827
1848
|
export interface VoiceApi<E = never> {
|
|
1849
|
+
readonly models: VoiceModelsOperation<E>;
|
|
1828
1850
|
readonly session: VoiceSessionOperation<E>;
|
|
1851
|
+
readonly instructions: VoiceInstructionsOperation<E>;
|
|
1829
1852
|
}
|
|
1830
1853
|
export type ProviderListInput = {
|
|
1831
1854
|
readonly location?: {
|
|
@@ -2057,6 +2080,18 @@ export type McpResourceCatalogOutput = {
|
|
|
2057
2080
|
readonly data: Mcp.ResourceCatalog;
|
|
2058
2081
|
};
|
|
2059
2082
|
export type McpResourceCatalogOperation<E = never> = (input?: McpResourceCatalogInput) => Effect.Effect<McpResourceCatalogOutput, E>;
|
|
2083
|
+
export type McpClientTokenInput = {
|
|
2084
|
+
readonly location?: {
|
|
2085
|
+
readonly directory?: string | undefined;
|
|
2086
|
+
} | undefined;
|
|
2087
|
+
readonly name: string;
|
|
2088
|
+
readonly "x-opencode-ticket"?: string | undefined;
|
|
2089
|
+
};
|
|
2090
|
+
export type McpClientTokenOutput = {
|
|
2091
|
+
readonly location: Location.PublicRef;
|
|
2092
|
+
readonly data: PtyTicket.ConnectToken;
|
|
2093
|
+
};
|
|
2094
|
+
export type McpClientTokenOperation<E = never> = (input: McpClientTokenInput) => Effect.Effect<McpClientTokenOutput, E>;
|
|
2060
2095
|
export interface McpApi<E = never> {
|
|
2061
2096
|
readonly list: McpListOperation<E>;
|
|
2062
2097
|
readonly add: McpAddOperation<E>;
|
|
@@ -2066,6 +2101,9 @@ export interface McpApi<E = never> {
|
|
|
2066
2101
|
readonly resource: {
|
|
2067
2102
|
readonly catalog: McpResourceCatalogOperation<E>;
|
|
2068
2103
|
};
|
|
2104
|
+
readonly client: {
|
|
2105
|
+
readonly token: McpClientTokenOperation<E>;
|
|
2106
|
+
};
|
|
2069
2107
|
}
|
|
2070
2108
|
export type CredentialListOutput = ReadonlyArray<Credential.Entry>;
|
|
2071
2109
|
export type CredentialListOperation<E = never> = () => Effect.Effect<CredentialListOutput, E>;
|
|
@@ -2755,6 +2793,21 @@ export interface VcsApi<E = never> {
|
|
|
2755
2793
|
};
|
|
2756
2794
|
readonly diff: VcsDiffOperation<E>;
|
|
2757
2795
|
}
|
|
2796
|
+
export type DebugHeapDumpInput = {
|
|
2797
|
+
readonly directory?: string | undefined;
|
|
2798
|
+
};
|
|
2799
|
+
export type DebugHeapDumpOutput = {
|
|
2800
|
+
readonly path: string;
|
|
2801
|
+
readonly pid: number;
|
|
2802
|
+
readonly memory: {
|
|
2803
|
+
readonly rss: number;
|
|
2804
|
+
readonly heapTotal: number;
|
|
2805
|
+
readonly heapUsed: number;
|
|
2806
|
+
readonly external: number;
|
|
2807
|
+
readonly arrayBuffers: number;
|
|
2808
|
+
};
|
|
2809
|
+
};
|
|
2810
|
+
export type DebugHeapDumpOperation<E = never> = (input?: DebugHeapDumpInput) => Effect.Effect<DebugHeapDumpOutput, E>;
|
|
2758
2811
|
export type DebugLocationListOutput = ReadonlyArray<Location.PublicRef>;
|
|
2759
2812
|
export type DebugLocationListOperation<E = never> = () => Effect.Effect<DebugLocationListOutput, E>;
|
|
2760
2813
|
export type DebugLocationEvictInput = {
|
|
@@ -2765,6 +2818,7 @@ export type DebugLocationEvictInput = {
|
|
|
2765
2818
|
export type DebugLocationEvictOutput = void;
|
|
2766
2819
|
export type DebugLocationEvictOperation<E = never> = (input?: DebugLocationEvictInput) => Effect.Effect<DebugLocationEvictOutput, E>;
|
|
2767
2820
|
export interface DebugApi<E = never> {
|
|
2821
|
+
readonly heapDump: DebugHeapDumpOperation<E>;
|
|
2768
2822
|
readonly location: {
|
|
2769
2823
|
readonly list: DebugLocationListOperation<E>;
|
|
2770
2824
|
readonly evict: DebugLocationEvictOperation<E>;
|