@opencode/client 2.1.3 → 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-9j12j8xw.js → contract-15p82y03.js} +5 -5
- package/dist/chunks/{service-probe-61wt4y9h.js → contract-1x65x4hv.js} +15 -20
- package/dist/chunks/{service-probe-8ye1ye6f.js → contract-2ny4vxct.js} +2 -2
- package/dist/chunks/{service-probe-8bbb028w.js → contract-8bbb028w.js} +1 -1
- package/dist/chunks/{service-probe-v1n69e13.js → contract-9kmsh4jj.js} +8 -2
- package/dist/chunks/{service-probe-ezt8t3fk.js → contract-c46qzyff.js} +2 -2
- package/dist/chunks/{service-probe-xwk4fryp.js → contract-hg9t2gnm.js} +9 -9
- package/dist/chunks/{service-probe-ryy6kscr.js → contract-ryy6kscr.js} +1 -1
- package/dist/chunks/{service-probe-g22sa7qz.js → contract-s2hya144.js} +21 -2
- package/dist/chunks/{service-probe-6vp15eh6.js → contract-skhp7hxc.js} +1 -1
- package/dist/chunks/{service-probe-9p0yrv34.js → contract-vwtmm97t.js} +4 -4
- package/dist/chunks/{service-probe-5r97ebd4.js → contract-w10x3kfx.js} +14 -7
- package/dist/contract.js +1 -1
- package/dist/effect/api/api.d.ts +32 -1
- package/dist/effect/client.d.ts +789 -785
- package/dist/effect/client.js +8 -8
- package/dist/effect/generated/client-error.js +1 -1
- package/dist/effect/generated/client.d.ts +489 -485
- 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.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 +4 -0
- package/dist/promise/client.js +7 -7
- package/dist/promise/generated/client-error.js +1 -1
- package/dist/promise/generated/client.d.ts +5 -1
- package/dist/promise/generated/client.js +2 -2
- package/dist/promise/generated/index.js +5 -5
- package/dist/promise/generated/types.d.ts +47 -9
- package/dist/promise/generated/types.js +2 -2
- package/dist/promise/index.js +9 -9
- 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 +12 -6
- /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,20 +3,20 @@ import {
|
|
|
3
3
|
readError2,
|
|
4
4
|
event2,
|
|
5
5
|
eventType2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./contract-ryy6kscr.js";
|
|
7
7
|
import {
|
|
8
8
|
__export
|
|
9
|
-
} from "./
|
|
9
|
+
} from "./contract-9rqn6x4v.js";
|
|
10
10
|
|
|
11
11
|
// src/effect/rpc.ts
|
|
12
12
|
var exports_rpc = {};
|
|
13
13
|
__export(exports_rpc, {
|
|
14
14
|
RpcClientRuntime: () => exports_rpc,
|
|
15
15
|
aborted: () => aborted2,
|
|
16
|
-
make: () =>
|
|
16
|
+
make: () => make3
|
|
17
17
|
});
|
|
18
18
|
import { Effect, Stream } from "effect";
|
|
19
|
-
function
|
|
19
|
+
function make3(call, subscribe) {
|
|
20
20
|
return (definition) => {
|
|
21
21
|
const methods = Object.fromEntries(Object.entries(definition.methods).map(([name, method]) => [
|
|
22
22
|
name,
|
|
@@ -59,4 +59,4 @@ function aborted2(signal) {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export {
|
|
62
|
+
export { make3, aborted2, exports_rpc };
|
|
@@ -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
|
-
|
|
9
|
-
} from "./
|
|
8
|
+
make4
|
|
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 = {};
|
|
@@ -30,7 +30,7 @@ var CurrentHeaders = Context.Reference("@opencode/client/effect/rpc/headers", {
|
|
|
30
30
|
});
|
|
31
31
|
var make2 = Effect.fn("OpenCode.make")(function* (options) {
|
|
32
32
|
const httpClient = yield* HttpClient.HttpClient;
|
|
33
|
-
const raw = yield*
|
|
33
|
+
const raw = yield* make4(options).pipe(Effect.provideService(HttpClient.HttpClient, HttpClient.mapRequestEffect(httpClient, (request) => Effect.map(CurrentHeaders, (headers) => headers ? HttpClientRequest.setHeaders(request, new Headers(headers)) : request))));
|
|
34
34
|
const context = yield* Effect.context();
|
|
35
35
|
const native = raw.event.subscribe();
|
|
36
36
|
|
|
@@ -45,7 +45,7 @@ var make2 = 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(make3((input, options) => raw.rpc.call(input).pipe(Effect.provideService(CurrentHeaders, options?.headers)), subscribe), raw.rpc)
|
|
49
49
|
};
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -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 = {};
|
|
@@ -857,6 +857,17 @@ function make6(options) {
|
|
|
857
857
|
declaredStatuses: [400, 401, 404],
|
|
858
858
|
empty: false
|
|
859
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)
|
|
860
871
|
}
|
|
861
872
|
},
|
|
862
873
|
credential: {
|
|
@@ -1374,6 +1385,14 @@ function make6(options) {
|
|
|
1374
1385
|
}, requestOptions)
|
|
1375
1386
|
},
|
|
1376
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),
|
|
1377
1396
|
location: {
|
|
1378
1397
|
list: (requestOptions) => request({
|
|
1379
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,17 +1,17 @@
|
|
|
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 = {};
|
|
13
13
|
__export(exports_client2, {
|
|
14
|
-
make: () =>
|
|
14
|
+
make: () => make4
|
|
15
15
|
});
|
|
16
16
|
import { Effect, Stream, Schema } from "effect";
|
|
17
17
|
import { Sse } from "effect/encoding";
|
|
@@ -364,13 +364,18 @@ var EndpointMcpRemove = (raw) => (input) => preserveEffect()(raw["mcp.remove"]({
|
|
|
364
364
|
var EndpointMcpConnect = (raw) => (input) => preserveEffect()(raw["mcp.connect"]({ params: { server: input["server"] }, query: { location: input["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
365
365
|
var EndpointMcpDisconnect = (raw) => (input) => preserveEffect()(raw["mcp.disconnect"]({ params: { server: input["server"] }, query: { location: input["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
366
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)));
|
|
367
371
|
var adaptGroupMcp = (raw) => ({
|
|
368
372
|
list: EndpointMcpList(raw),
|
|
369
373
|
add: EndpointMcpAdd(raw),
|
|
370
374
|
remove: EndpointMcpRemove(raw),
|
|
371
375
|
connect: EndpointMcpConnect(raw),
|
|
372
376
|
disconnect: EndpointMcpDisconnect(raw),
|
|
373
|
-
resource: { catalog: EndpointMcpResourceCatalog(raw) }
|
|
377
|
+
resource: { catalog: EndpointMcpResourceCatalog(raw) },
|
|
378
|
+
client: { token: EndpointMcpClientToken(raw) }
|
|
374
379
|
});
|
|
375
380
|
var EndpointCredentialList = (raw) => () => preserveEffect()(raw["credential.list"]({}).pipe(Effect.mapError(mapClientError), Effect.map((value) => value.data)));
|
|
376
381
|
var EndpointCredentialCreate = (raw) => (input) => preserveEffect()(raw["credential.create"]({
|
|
@@ -589,9 +594,11 @@ var adaptGroupVcs = (raw) => ({
|
|
|
589
594
|
branch: { list: EndpointVcsBranchList(raw) },
|
|
590
595
|
diff: EndpointVcsDiff(raw)
|
|
591
596
|
});
|
|
597
|
+
var EndpointDebugHeapDump = (raw) => (input) => preserveEffect()(raw["debug.heapDump"]({ query: { directory: input?.["directory"] } }).pipe(Effect.mapError(mapClientError)));
|
|
592
598
|
var EndpointDebugLocationList = (raw) => () => preserveEffect()(raw["debug.location"]({}).pipe(Effect.mapError(mapClientError)));
|
|
593
599
|
var EndpointDebugLocationEvict = (raw) => (input) => preserveEffect()(raw["debug.location.evict"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError)));
|
|
594
600
|
var adaptGroupDebug = (raw) => ({
|
|
601
|
+
heapDump: EndpointDebugHeapDump(raw),
|
|
595
602
|
location: { list: EndpointDebugLocationList(raw), evict: EndpointDebugLocationEvict(raw) }
|
|
596
603
|
});
|
|
597
604
|
var EndpointMigrationV1Status = (raw) => () => preserveEffect()(raw["migration.v1.status"]({}).pipe(Effect.mapError(mapClientError)));
|
|
@@ -646,6 +653,6 @@ var adaptClient = (raw) => ({
|
|
|
646
653
|
websearch: adaptGroupWebsearch(raw["server.websearch"]),
|
|
647
654
|
config: adaptGroupConfig(raw["server.config"])
|
|
648
655
|
});
|
|
649
|
-
var
|
|
656
|
+
var make4 = (options) => HttpApiClient.make(ClientApi2, options).pipe(Effect.map(adaptClient));
|
|
650
657
|
|
|
651
|
-
export {
|
|
658
|
+
export { make4, exports_client2 };
|
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";
|
|
@@ -2080,6 +2080,18 @@ export type McpResourceCatalogOutput = {
|
|
|
2080
2080
|
readonly data: Mcp.ResourceCatalog;
|
|
2081
2081
|
};
|
|
2082
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>;
|
|
2083
2095
|
export interface McpApi<E = never> {
|
|
2084
2096
|
readonly list: McpListOperation<E>;
|
|
2085
2097
|
readonly add: McpAddOperation<E>;
|
|
@@ -2089,6 +2101,9 @@ export interface McpApi<E = never> {
|
|
|
2089
2101
|
readonly resource: {
|
|
2090
2102
|
readonly catalog: McpResourceCatalogOperation<E>;
|
|
2091
2103
|
};
|
|
2104
|
+
readonly client: {
|
|
2105
|
+
readonly token: McpClientTokenOperation<E>;
|
|
2106
|
+
};
|
|
2092
2107
|
}
|
|
2093
2108
|
export type CredentialListOutput = ReadonlyArray<Credential.Entry>;
|
|
2094
2109
|
export type CredentialListOperation<E = never> = () => Effect.Effect<CredentialListOutput, E>;
|
|
@@ -2778,6 +2793,21 @@ export interface VcsApi<E = never> {
|
|
|
2778
2793
|
};
|
|
2779
2794
|
readonly diff: VcsDiffOperation<E>;
|
|
2780
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>;
|
|
2781
2811
|
export type DebugLocationListOutput = ReadonlyArray<Location.PublicRef>;
|
|
2782
2812
|
export type DebugLocationListOperation<E = never> = () => Effect.Effect<DebugLocationListOutput, E>;
|
|
2783
2813
|
export type DebugLocationEvictInput = {
|
|
@@ -2788,6 +2818,7 @@ export type DebugLocationEvictInput = {
|
|
|
2788
2818
|
export type DebugLocationEvictOutput = void;
|
|
2789
2819
|
export type DebugLocationEvictOperation<E = never> = (input?: DebugLocationEvictInput) => Effect.Effect<DebugLocationEvictOutput, E>;
|
|
2790
2820
|
export interface DebugApi<E = never> {
|
|
2821
|
+
readonly heapDump: DebugHeapDumpOperation<E>;
|
|
2791
2822
|
readonly location: {
|
|
2792
2823
|
readonly list: DebugLocationListOperation<E>;
|
|
2793
2824
|
readonly evict: DebugLocationEvictOperation<E>;
|