@opencode/client 0.0.0-dev-19794 → 0.0.0-dev-19808

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.
Files changed (52) hide show
  1. package/dist/chunks/rpc-runtime-1tbj6z39.js +81 -0
  2. package/dist/chunks/rpc-runtime-4tveyqeh.js +34 -0
  3. package/dist/chunks/rpc-runtime-65kht65h.js +62 -0
  4. package/dist/chunks/rpc-runtime-6mptkzbc.js +0 -0
  5. package/dist/chunks/rpc-runtime-9rqn6x4v.js +16 -0
  6. package/dist/chunks/rpc-runtime-atpwm825.js +1638 -0
  7. package/dist/chunks/rpc-runtime-bssvn03b.js +594 -0
  8. package/dist/chunks/rpc-runtime-epez1aze.js +30 -0
  9. package/dist/chunks/rpc-runtime-fcxvjmkt.js +52 -0
  10. package/dist/chunks/rpc-runtime-frbwqjmf.js +145 -0
  11. package/dist/chunks/rpc-runtime-g7m14arh.js +112 -0
  12. package/dist/chunks/rpc-runtime-m2eywc8w.js +0 -0
  13. package/dist/chunks/rpc-runtime-n3c99vt5.js +11 -0
  14. package/dist/chunks/rpc-runtime-qav6mfdz.js +0 -0
  15. package/dist/chunks/rpc-runtime-radw39tv.js +1402 -0
  16. package/dist/chunks/rpc-runtime-sxt88q69.js +12 -0
  17. package/dist/chunks/rpc-runtime-t1xa31vm.js +39 -0
  18. package/dist/chunks/rpc-runtime-tr4b6894.js +21 -0
  19. package/dist/chunks/rpc-runtime-txckps9j.js +57 -0
  20. package/dist/chunks/rpc-runtime-vmytr4q8.js +4 -0
  21. package/dist/chunks/rpc-runtime-vyas3vgt.js +0 -0
  22. package/dist/chunks/rpc-runtime-y2etg5bs.js +9 -0
  23. package/dist/chunks/rpc-runtime-ydhz1zrh.js +238 -0
  24. package/dist/chunks/rpc-runtime-yepdgb80.js +44 -0
  25. package/dist/contract.js +12 -1
  26. package/dist/effect/client.js +15 -29
  27. package/dist/effect/generated/client-error.js +6 -5
  28. package/dist/effect/generated/client.js +8 -582
  29. package/dist/effect/generated/index.js +12 -2
  30. package/dist/effect/index.js +75 -30
  31. package/dist/effect/rpc.js +11 -49
  32. package/dist/effect/service.js +238 -245
  33. package/dist/promise/client.js +14 -13
  34. package/dist/promise/generated/client-error.js +6 -8
  35. package/dist/promise/generated/client.js +7 -1396
  36. package/dist/promise/generated/index.js +75 -3
  37. package/dist/promise/generated/types.js +66 -34
  38. package/dist/promise/index.js +79 -2
  39. package/dist/promise/rpc.js +7 -86
  40. package/dist/promise/service.js +230 -227
  41. package/dist/pty-handoff.js +14 -121
  42. package/dist/rpc-runtime.js +14 -32
  43. package/dist/service-contender.js +10 -56
  44. package/dist/service-timing.js +9 -18
  45. package/dist/service-version.js +6 -9
  46. package/dist/service.js +1 -0
  47. package/dist/shared-events.js +8 -137
  48. package/dist/solid/connection.js +10 -246
  49. package/dist/solid/data.js +18 -1774
  50. package/dist/solid/index.js +32 -3
  51. package/dist/solid/pty.js +8 -41
  52. package/package.json +4 -4
@@ -1,3 +1,75 @@
1
- export { ClientError } from "./client-error.js";
2
- export * as OpenCode from "./client.js";
3
- export * from "./types.js";
1
+ import"../../chunks/rpc-runtime-vyas3vgt.js";
2
+ import {
3
+ isInvalidRequestError2,
4
+ isUnauthorizedError2,
5
+ isServiceUnavailableError2,
6
+ isAgentNotFoundError2,
7
+ isInvalidCursorError2,
8
+ isSessionNotFoundError2,
9
+ isConflictError2,
10
+ isUnknownError2,
11
+ isMessageNotFoundError2,
12
+ isCommandNotFoundError2,
13
+ isCommandExecutionError2,
14
+ isSkillNotFoundError2,
15
+ isSessionBusyError2,
16
+ isInstructionEntryValueTooLargeError2,
17
+ isFormNotFoundError2,
18
+ isFormInvalidAnswerError2,
19
+ isFormAlreadySettledError2,
20
+ isProviderNotFoundError2,
21
+ isIntegrationNotFoundError2,
22
+ isIntegrationAttemptNotFoundError2,
23
+ isIntegrationMethodNotFoundError2,
24
+ isMcpServerNotFoundError2,
25
+ isProjectNotFoundError2,
26
+ isPermissionNotFoundError2,
27
+ isFileNotFoundError2,
28
+ isRpcError2,
29
+ isRpcInternalError2,
30
+ isPtyNotFoundError2,
31
+ isForbiddenError2,
32
+ isShellNotFoundError2,
33
+ isWorktreeError2
34
+ } from "../../chunks/rpc-runtime-4tveyqeh.js";
35
+ import {
36
+ exports_client4
37
+ } from "../../chunks/rpc-runtime-radw39tv.js";
38
+ import {
39
+ ClientError3
40
+ } from "../../chunks/rpc-runtime-n3c99vt5.js";
41
+ export {
42
+ ClientError3 as ClientError,
43
+ exports_client4 as OpenCode,
44
+ isAgentNotFoundError2 as isAgentNotFoundError,
45
+ isCommandExecutionError2 as isCommandExecutionError,
46
+ isCommandNotFoundError2 as isCommandNotFoundError,
47
+ isConflictError2 as isConflictError,
48
+ isFileNotFoundError2 as isFileNotFoundError,
49
+ isForbiddenError2 as isForbiddenError,
50
+ isFormAlreadySettledError2 as isFormAlreadySettledError,
51
+ isFormInvalidAnswerError2 as isFormInvalidAnswerError,
52
+ isFormNotFoundError2 as isFormNotFoundError,
53
+ isInstructionEntryValueTooLargeError2 as isInstructionEntryValueTooLargeError,
54
+ isIntegrationAttemptNotFoundError2 as isIntegrationAttemptNotFoundError,
55
+ isIntegrationMethodNotFoundError2 as isIntegrationMethodNotFoundError,
56
+ isIntegrationNotFoundError2 as isIntegrationNotFoundError,
57
+ isInvalidCursorError2 as isInvalidCursorError,
58
+ isInvalidRequestError2 as isInvalidRequestError,
59
+ isMcpServerNotFoundError2 as isMcpServerNotFoundError,
60
+ isMessageNotFoundError2 as isMessageNotFoundError,
61
+ isPermissionNotFoundError2 as isPermissionNotFoundError,
62
+ isProjectNotFoundError2 as isProjectNotFoundError,
63
+ isProviderNotFoundError2 as isProviderNotFoundError,
64
+ isPtyNotFoundError2 as isPtyNotFoundError,
65
+ isRpcError2 as isRpcError,
66
+ isRpcInternalError2 as isRpcInternalError,
67
+ isServiceUnavailableError2 as isServiceUnavailableError,
68
+ isSessionBusyError2 as isSessionBusyError,
69
+ isSessionNotFoundError2 as isSessionNotFoundError,
70
+ isShellNotFoundError2 as isShellNotFoundError,
71
+ isSkillNotFoundError2 as isSkillNotFoundError,
72
+ isUnauthorizedError2 as isUnauthorizedError,
73
+ isUnknownError2 as isUnknownError,
74
+ isWorktreeError2 as isWorktreeError
75
+ };
@@ -1,34 +1,66 @@
1
- export const isInvalidRequestError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "InvalidRequestError";
2
- export const isUnauthorizedError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "UnauthorizedError";
3
- export const isServiceUnavailableError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ServiceUnavailableError";
4
- export const isAgentNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "AgentNotFoundError";
5
- export const isInvalidCursorError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "InvalidCursorError";
6
- export const isSessionNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "SessionNotFoundError";
7
- export const isConflictError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ConflictError";
8
- export const isUnknownError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "UnknownError";
9
- export const isMessageNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "MessageNotFoundError";
10
- export const isCommandNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "CommandNotFoundError";
11
- export const isCommandExecutionError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "CommandExecutionError";
12
- export const isSkillNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "SkillNotFoundError";
13
- export const isSessionBusyError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "SessionBusyError";
14
- export const isInstructionEntryValueTooLargeError = (value) => typeof value === "object" &&
15
- value !== null &&
16
- "_tag" in value &&
17
- value["_tag"] === "InstructionEntryValueTooLargeError";
18
- export const isFormNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "FormNotFoundError";
19
- export const isFormInvalidAnswerError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "FormInvalidAnswerError";
20
- export const isFormAlreadySettledError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "FormAlreadySettledError";
21
- export const isProviderNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ProviderNotFoundError";
22
- export const isIntegrationNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "IntegrationNotFoundError";
23
- export const isIntegrationAttemptNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "IntegrationAttemptNotFoundError";
24
- export const isIntegrationMethodNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "IntegrationMethodNotFoundError";
25
- export const isMcpServerNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "McpServerNotFoundError";
26
- export const isProjectNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ProjectNotFoundError";
27
- export const isPermissionNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "PermissionNotFoundError";
28
- export const isFileNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "FileNotFoundError";
29
- export const isRpcError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "RpcError";
30
- export const isRpcInternalError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "RpcInternalError";
31
- export const isPtyNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "PtyNotFoundError";
32
- export const isForbiddenError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ForbiddenError";
33
- export const isShellNotFoundError = (value) => typeof value === "object" && value !== null && "_tag" in value && value["_tag"] === "ShellNotFoundError";
34
- export const isWorktreeError = (value) => typeof value === "object" && value !== null && "name" in value && value["name"] === "WorktreeError";
1
+ import {
2
+ isInvalidRequestError2,
3
+ isUnauthorizedError2,
4
+ isServiceUnavailableError2,
5
+ isAgentNotFoundError2,
6
+ isInvalidCursorError2,
7
+ isSessionNotFoundError2,
8
+ isConflictError2,
9
+ isUnknownError2,
10
+ isMessageNotFoundError2,
11
+ isCommandNotFoundError2,
12
+ isCommandExecutionError2,
13
+ isSkillNotFoundError2,
14
+ isSessionBusyError2,
15
+ isInstructionEntryValueTooLargeError2,
16
+ isFormNotFoundError2,
17
+ isFormInvalidAnswerError2,
18
+ isFormAlreadySettledError2,
19
+ isProviderNotFoundError2,
20
+ isIntegrationNotFoundError2,
21
+ isIntegrationAttemptNotFoundError2,
22
+ isIntegrationMethodNotFoundError2,
23
+ isMcpServerNotFoundError2,
24
+ isProjectNotFoundError2,
25
+ isPermissionNotFoundError2,
26
+ isFileNotFoundError2,
27
+ isRpcError2,
28
+ isRpcInternalError2,
29
+ isPtyNotFoundError2,
30
+ isForbiddenError2,
31
+ isShellNotFoundError2,
32
+ isWorktreeError2
33
+ } from "../../chunks/rpc-runtime-4tveyqeh.js";
34
+ export {
35
+ isAgentNotFoundError2 as isAgentNotFoundError,
36
+ isCommandExecutionError2 as isCommandExecutionError,
37
+ isCommandNotFoundError2 as isCommandNotFoundError,
38
+ isConflictError2 as isConflictError,
39
+ isFileNotFoundError2 as isFileNotFoundError,
40
+ isForbiddenError2 as isForbiddenError,
41
+ isFormAlreadySettledError2 as isFormAlreadySettledError,
42
+ isFormInvalidAnswerError2 as isFormInvalidAnswerError,
43
+ isFormNotFoundError2 as isFormNotFoundError,
44
+ isInstructionEntryValueTooLargeError2 as isInstructionEntryValueTooLargeError,
45
+ isIntegrationAttemptNotFoundError2 as isIntegrationAttemptNotFoundError,
46
+ isIntegrationMethodNotFoundError2 as isIntegrationMethodNotFoundError,
47
+ isIntegrationNotFoundError2 as isIntegrationNotFoundError,
48
+ isInvalidCursorError2 as isInvalidCursorError,
49
+ isInvalidRequestError2 as isInvalidRequestError,
50
+ isMcpServerNotFoundError2 as isMcpServerNotFoundError,
51
+ isMessageNotFoundError2 as isMessageNotFoundError,
52
+ isPermissionNotFoundError2 as isPermissionNotFoundError,
53
+ isProjectNotFoundError2 as isProjectNotFoundError,
54
+ isProviderNotFoundError2 as isProviderNotFoundError,
55
+ isPtyNotFoundError2 as isPtyNotFoundError,
56
+ isRpcError2 as isRpcError,
57
+ isRpcInternalError2 as isRpcInternalError,
58
+ isServiceUnavailableError2 as isServiceUnavailableError,
59
+ isSessionBusyError2 as isSessionBusyError,
60
+ isSessionNotFoundError2 as isSessionNotFoundError,
61
+ isShellNotFoundError2 as isShellNotFoundError,
62
+ isSkillNotFoundError2 as isSkillNotFoundError,
63
+ isUnauthorizedError2 as isUnauthorizedError,
64
+ isUnknownError2 as isUnknownError,
65
+ isWorktreeError2 as isWorktreeError
66
+ };
@@ -1,2 +1,79 @@
1
- export * from "./generated/index.js";
2
- export { OpenCode } from "./client.js";
1
+ import"../chunks/rpc-runtime-m2eywc8w.js";
2
+ import {
3
+ exports_client3
4
+ } from "../chunks/rpc-runtime-epez1aze.js";
5
+ import"../chunks/rpc-runtime-1tbj6z39.js";
6
+ import"../chunks/rpc-runtime-vyas3vgt.js";
7
+ import {
8
+ isInvalidRequestError2,
9
+ isUnauthorizedError2,
10
+ isServiceUnavailableError2,
11
+ isAgentNotFoundError2,
12
+ isInvalidCursorError2,
13
+ isSessionNotFoundError2,
14
+ isConflictError2,
15
+ isUnknownError2,
16
+ isMessageNotFoundError2,
17
+ isCommandNotFoundError2,
18
+ isCommandExecutionError2,
19
+ isSkillNotFoundError2,
20
+ isSessionBusyError2,
21
+ isInstructionEntryValueTooLargeError2,
22
+ isFormNotFoundError2,
23
+ isFormInvalidAnswerError2,
24
+ isFormAlreadySettledError2,
25
+ isProviderNotFoundError2,
26
+ isIntegrationNotFoundError2,
27
+ isIntegrationAttemptNotFoundError2,
28
+ isIntegrationMethodNotFoundError2,
29
+ isMcpServerNotFoundError2,
30
+ isProjectNotFoundError2,
31
+ isPermissionNotFoundError2,
32
+ isFileNotFoundError2,
33
+ isRpcError2,
34
+ isRpcInternalError2,
35
+ isPtyNotFoundError2,
36
+ isForbiddenError2,
37
+ isShellNotFoundError2,
38
+ isWorktreeError2
39
+ } from "../chunks/rpc-runtime-4tveyqeh.js";
40
+ import"../chunks/rpc-runtime-radw39tv.js";
41
+ import {
42
+ ClientError3
43
+ } from "../chunks/rpc-runtime-n3c99vt5.js";
44
+ import"../chunks/rpc-runtime-frbwqjmf.js";
45
+ export {
46
+ ClientError3 as ClientError,
47
+ exports_client3 as OpenCode,
48
+ isAgentNotFoundError2 as isAgentNotFoundError,
49
+ isCommandExecutionError2 as isCommandExecutionError,
50
+ isCommandNotFoundError2 as isCommandNotFoundError,
51
+ isConflictError2 as isConflictError,
52
+ isFileNotFoundError2 as isFileNotFoundError,
53
+ isForbiddenError2 as isForbiddenError,
54
+ isFormAlreadySettledError2 as isFormAlreadySettledError,
55
+ isFormInvalidAnswerError2 as isFormInvalidAnswerError,
56
+ isFormNotFoundError2 as isFormNotFoundError,
57
+ isInstructionEntryValueTooLargeError2 as isInstructionEntryValueTooLargeError,
58
+ isIntegrationAttemptNotFoundError2 as isIntegrationAttemptNotFoundError,
59
+ isIntegrationMethodNotFoundError2 as isIntegrationMethodNotFoundError,
60
+ isIntegrationNotFoundError2 as isIntegrationNotFoundError,
61
+ isInvalidCursorError2 as isInvalidCursorError,
62
+ isInvalidRequestError2 as isInvalidRequestError,
63
+ isMcpServerNotFoundError2 as isMcpServerNotFoundError,
64
+ isMessageNotFoundError2 as isMessageNotFoundError,
65
+ isPermissionNotFoundError2 as isPermissionNotFoundError,
66
+ isProjectNotFoundError2 as isProjectNotFoundError,
67
+ isProviderNotFoundError2 as isProviderNotFoundError,
68
+ isPtyNotFoundError2 as isPtyNotFoundError,
69
+ isRpcError2 as isRpcError,
70
+ isRpcInternalError2 as isRpcInternalError,
71
+ isServiceUnavailableError2 as isServiceUnavailableError,
72
+ isSessionBusyError2 as isSessionBusyError,
73
+ isSessionNotFoundError2 as isSessionNotFoundError,
74
+ isShellNotFoundError2 as isShellNotFoundError,
75
+ isSkillNotFoundError2 as isSkillNotFoundError,
76
+ isUnauthorizedError2 as isUnauthorizedError,
77
+ isUnknownError2 as isUnknownError,
78
+ isWorktreeError2 as isWorktreeError
79
+ };
@@ -1,86 +1,7 @@
1
- import { isRpcError, isRpcInternalError } from "./generated/types.js";
2
- export function makeRpc(raw, events) {
3
- return (definition) => {
4
- const subscribe = (name, options) => {
5
- if (!Object.hasOwn(definition.events, name))
6
- throw new Error(`Unknown RPC event: ${definition.id}.${name}`);
7
- const type = eventType(definition, name);
8
- return {
9
- [Symbol.asyncIterator]() {
10
- const controller = new AbortController();
11
- const signal = options?.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal;
12
- const iterator = (async function* () {
13
- try {
14
- for await (const published of events.subscribe({ signal })) {
15
- if (signal.aborted)
16
- return;
17
- if (published.type !== type)
18
- continue;
19
- // SAFETY: The exact RPC type was selected above; Promise contracts require no client-side transform.
20
- // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion
21
- yield published;
22
- }
23
- }
24
- catch (error) {
25
- if (!signal.aborted)
26
- throw error;
27
- }
28
- finally {
29
- controller.abort();
30
- }
31
- })();
32
- return {
33
- next: () => iterator.next(),
34
- return: () => {
35
- // Interrupt a pending source read before closing the generator.
36
- controller.abort();
37
- return iterator.return();
38
- },
39
- };
40
- },
41
- };
42
- };
43
- // SAFETY: Every runtime key comes from this definition's method and event maps, which define RpcClient's mapped keys.
44
- // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion
45
- return Object.assign(Object.fromEntries(Object.keys(definition.methods).map((name) => [
46
- name,
47
- async (input, options) => {
48
- try {
49
- const result = await raw.rpc.call({
50
- rpcID: definition.id,
51
- method: name,
52
- // SAFETY: The method schema defines the accepted input; this assertion bridges it to the generic JSON transport.
53
- // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion
54
- input: input,
55
- location: options?.location,
56
- }, { signal: options?.signal, headers: options?.headers });
57
- return result.output;
58
- }
59
- catch (error) {
60
- if (!isRpcError(error) && !isRpcInternalError(error))
61
- throw error;
62
- throw error.data === undefined
63
- ? { type: error.type, message: error.message }
64
- : { type: error.type, message: error.message, data: error.data };
65
- }
66
- },
67
- ])), {
68
- events: {
69
- subscribe,
70
- on: (name, handler, options) => {
71
- const controller = new AbortController();
72
- const signal = options?.signal ? AbortSignal.any([controller.signal, options.signal]) : controller.signal;
73
- const source = subscribe(name, { signal });
74
- void (async () => {
75
- for await (const event of source)
76
- await handler(event);
77
- })().catch((error) => console.error(error));
78
- return () => controller.abort();
79
- },
80
- },
81
- });
82
- };
83
- }
84
- function eventType(definition, name) {
85
- return `rpc.${definition.id}.${name}`;
86
- }
1
+ import {
2
+ makeRpc2
3
+ } from "../chunks/rpc-runtime-1tbj6z39.js";
4
+ import"../chunks/rpc-runtime-4tveyqeh.js";
5
+ export {
6
+ makeRpc2 as makeRpc
7
+ };