@opencode/client 0.0.0-reserved → 2.0.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/README.md +24 -2
- package/dist/contract.d.ts +1 -0
- package/dist/contract.js +1 -0
- package/dist/effect/api/api.d.ts +2698 -0
- package/dist/effect/api/api.js +0 -0
- package/dist/effect/api.d.ts +8 -0
- package/dist/effect/api.js +0 -0
- package/dist/effect/client.d.ts +2464 -0
- package/dist/effect/client.js +29 -0
- package/dist/effect/generated/client-error.d.ts +7 -0
- package/dist/effect/generated/client-error.js +5 -0
- package/dist/effect/generated/client.d.ts +2463 -0
- package/dist/effect/generated/client.js +603 -0
- package/dist/effect/generated/index.d.ts +2 -0
- package/dist/effect/generated/index.js +2 -0
- package/dist/effect/index.d.ts +35 -0
- package/dist/effect/index.js +30 -0
- package/dist/effect/rpc.d.ts +20 -0
- package/dist/effect/rpc.js +49 -0
- package/dist/effect/service.d.ts +78 -0
- package/dist/effect/service.js +259 -0
- package/dist/promise/api.d.ts +24 -0
- package/dist/promise/api.js +0 -0
- package/dist/promise/client.d.ts +257 -0
- package/dist/promise/client.js +13 -0
- package/dist/promise/generated/client-error.d.ts +6 -0
- package/dist/promise/generated/client-error.js +8 -0
- package/dist/promise/generated/client.d.ts +264 -0
- package/dist/promise/generated/client.js +1426 -0
- package/dist/promise/generated/index.d.ts +3 -0
- package/dist/promise/generated/index.js +3 -0
- package/dist/promise/generated/types.d.ts +8777 -0
- package/dist/promise/generated/types.js +30 -0
- package/dist/promise/index.d.ts +6 -0
- package/dist/promise/index.js +2 -0
- package/dist/promise/rpc.d.ts +32 -0
- package/dist/promise/rpc.js +86 -0
- package/dist/promise/service.d.ts +26 -0
- package/dist/promise/service.js +247 -0
- package/dist/pty-handoff.d.ts +9 -0
- package/dist/pty-handoff.js +121 -0
- package/dist/rpc-runtime.d.ts +21 -0
- package/dist/rpc-runtime.js +32 -0
- package/dist/service-contender.d.ts +11 -0
- package/dist/service-contender.js +56 -0
- package/dist/service-timing.d.ts +13 -0
- package/dist/service-timing.js +19 -0
- package/dist/service-version.d.ts +2 -0
- package/dist/service-version.js +9 -0
- package/dist/service.d.ts +52 -0
- package/dist/service.js +0 -0
- package/dist/shared-events.d.ts +11 -0
- package/dist/shared-events.js +137 -0
- package/dist/solid/connection.d.ts +37 -0
- package/dist/solid/connection.js +246 -0
- package/dist/solid/data.d.ts +201 -0
- package/dist/solid/data.js +1731 -0
- package/dist/solid/index.d.ts +3 -0
- package/dist/solid/index.js +3 -0
- package/dist/solid/pty.d.ts +22 -0
- package/dist/solid/pty.js +43 -0
- package/package.json +76 -6
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type { AgentInfo, CommandInfo, ConfigEntry, FormCancelInput, FormInfo, FormReplyInput, IntegrationInfo, LocationRef, LocationGetOutput, McpResource, McpServer, ModelInfo, ModelRef, PermissionSavedInfo, PermissionRequest, PermissionReplyInput, Project, ProviderInfo, ReferenceInfo, SessionMessageInfo, SessionInfo, SessionInboxInfo, SessionInboxCompaction, ShellInfo, SkillInfo, VcsInfo, OpenCodeEvent, OpenCodeClient, WebSearchProvider } from "../promise";
|
|
2
|
+
import { type SessionPromptInput } from "../promise";
|
|
3
|
+
export type DataSessionStatus = "idle" | "running";
|
|
4
|
+
type OpenCodeEventMap = {
|
|
5
|
+
[Type in OpenCodeEvent["type"]]: Extract<OpenCodeEvent, {
|
|
6
|
+
type: Type;
|
|
7
|
+
}>;
|
|
8
|
+
};
|
|
9
|
+
export type CreateDataInput = {
|
|
10
|
+
readonly api: () => OpenCodeClient;
|
|
11
|
+
readonly directory: string;
|
|
12
|
+
/** Raw-message window used for an initial transcript read. Older pages retain their normal size. */
|
|
13
|
+
readonly initialMessageLimit?: () => number;
|
|
14
|
+
readonly event: {
|
|
15
|
+
readonly on: <Type extends OpenCodeEvent["type"]>(type: Type, handler: (event: OpenCodeEventMap[Type]) => void) => () => void;
|
|
16
|
+
readonly listen: (handler: (event: {
|
|
17
|
+
name: OpenCodeEvent["type"];
|
|
18
|
+
details: OpenCodeEvent;
|
|
19
|
+
}) => void) => () => void;
|
|
20
|
+
};
|
|
21
|
+
readonly connection?: {
|
|
22
|
+
readonly status: () => "connected" | "connecting" | "reconnecting";
|
|
23
|
+
};
|
|
24
|
+
/** Receives failed event-driven reads. Explicit reads still reject to their caller. */
|
|
25
|
+
readonly onError?: (error: unknown) => void;
|
|
26
|
+
};
|
|
27
|
+
export declare const settleMs = 150;
|
|
28
|
+
export type FormWithLocation = FormInfo & {
|
|
29
|
+
readonly location?: LocationRef;
|
|
30
|
+
};
|
|
31
|
+
type ShellWithLocation = ShellInfo & {
|
|
32
|
+
readonly location: LocationRef;
|
|
33
|
+
};
|
|
34
|
+
export declare function locationKey(location: LocationRef): string;
|
|
35
|
+
export declare function createData(config: CreateDataInput): {
|
|
36
|
+
on: <Type extends OpenCodeEvent["type"]>(type: Type, handler: (event: OpenCodeEventMap[Type]) => void) => () => void;
|
|
37
|
+
listen: (handler: (event: {
|
|
38
|
+
name: OpenCodeEvent["type"];
|
|
39
|
+
details: OpenCodeEvent;
|
|
40
|
+
}) => void) => () => void;
|
|
41
|
+
session: {
|
|
42
|
+
list(): SessionInfo[];
|
|
43
|
+
get(sessionID: string): SessionInfo;
|
|
44
|
+
creating(sessionID: string): boolean;
|
|
45
|
+
remember(info: SessionInfo): void;
|
|
46
|
+
setStatus(sessionID: string, status: DataSessionStatus): void;
|
|
47
|
+
root(sessionID: string): string;
|
|
48
|
+
family(sessionID: string): string[];
|
|
49
|
+
/** Clear heavy cached data for the root and all known descendants. */
|
|
50
|
+
evict(sessionID: string): void;
|
|
51
|
+
cost(sessionID: string): number;
|
|
52
|
+
status(sessionID: string): DataSessionStatus;
|
|
53
|
+
input: {
|
|
54
|
+
list(sessionID: string): string[];
|
|
55
|
+
has(sessionID: string, inboxID: string): boolean;
|
|
56
|
+
};
|
|
57
|
+
pending: {
|
|
58
|
+
list(sessionID: string): SessionInboxInfo[];
|
|
59
|
+
sync(sessionID: string): Promise<void>;
|
|
60
|
+
invalidate(sessionID: string): void;
|
|
61
|
+
};
|
|
62
|
+
create(input: {
|
|
63
|
+
id?: string;
|
|
64
|
+
title?: string;
|
|
65
|
+
agent?: string;
|
|
66
|
+
model?: ModelRef;
|
|
67
|
+
location?: LocationRef;
|
|
68
|
+
projectID?: string;
|
|
69
|
+
}): {
|
|
70
|
+
id: string;
|
|
71
|
+
request: Promise<SessionInfo>;
|
|
72
|
+
};
|
|
73
|
+
compact(input: {
|
|
74
|
+
sessionID: string;
|
|
75
|
+
model?: ModelRef;
|
|
76
|
+
}): Promise<SessionInboxCompaction>;
|
|
77
|
+
prompt(input: SessionPromptInput & {
|
|
78
|
+
gate?: Promise<unknown>;
|
|
79
|
+
prepare?: () => Promise<unknown>;
|
|
80
|
+
}): Promise<import("../promise").SessionInboxUser>;
|
|
81
|
+
sync(sessionID: string, options?: {
|
|
82
|
+
children?: boolean;
|
|
83
|
+
}): Promise<void>;
|
|
84
|
+
invalidate(sessionID: string): void;
|
|
85
|
+
message: {
|
|
86
|
+
list(sessionID: string): SessionMessageInfo[];
|
|
87
|
+
get(sessionID: string, messageID: string): SessionMessageInfo | undefined;
|
|
88
|
+
sync(sessionID: string): Promise<void>;
|
|
89
|
+
more(sessionID: string): boolean;
|
|
90
|
+
loading(sessionID: string): boolean;
|
|
91
|
+
loadMore(sessionID: string, options?: {
|
|
92
|
+
all?: boolean;
|
|
93
|
+
signal?: AbortSignal;
|
|
94
|
+
/** Runs synchronously inside the store-publication batch. */
|
|
95
|
+
beforePublish?: () => void;
|
|
96
|
+
}): Promise<void>;
|
|
97
|
+
invalidate(sessionID: string): void;
|
|
98
|
+
};
|
|
99
|
+
permission: {
|
|
100
|
+
list(sessionID: string): PermissionRequest[];
|
|
101
|
+
sync(sessionID: string): Promise<void>;
|
|
102
|
+
invalidate(sessionID: string): void;
|
|
103
|
+
reply(input: PermissionReplyInput): Promise<void>;
|
|
104
|
+
};
|
|
105
|
+
form: {
|
|
106
|
+
list(sessionID: string, ref?: LocationRef): FormWithLocation[] | undefined;
|
|
107
|
+
sync(sessionID: string, ref?: LocationRef): Promise<void>;
|
|
108
|
+
invalidate(sessionID: string, ref?: LocationRef): void;
|
|
109
|
+
reply(input: FormReplyInput, ref?: LocationRef): Promise<void>;
|
|
110
|
+
cancel(input: FormCancelInput, ref?: LocationRef): Promise<void>;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
project: {
|
|
114
|
+
list(): Project[];
|
|
115
|
+
get(projectID: string): Project;
|
|
116
|
+
sync(): Promise<void>;
|
|
117
|
+
invalidate(): void;
|
|
118
|
+
permission: {
|
|
119
|
+
list(projectID: string): PermissionSavedInfo[];
|
|
120
|
+
sync(projectID: string): Promise<void>;
|
|
121
|
+
invalidate(projectID: string): void;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
shell: {
|
|
125
|
+
list(location?: LocationRef): ShellWithLocation[];
|
|
126
|
+
listBySession(sessionID: string): ShellWithLocation[];
|
|
127
|
+
get(id: string): ShellWithLocation | undefined;
|
|
128
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
129
|
+
invalidate: (ref?: LocationRef) => void;
|
|
130
|
+
};
|
|
131
|
+
location: {
|
|
132
|
+
info(ref?: LocationRef): LocationGetOutput | undefined;
|
|
133
|
+
default(): LocationRef;
|
|
134
|
+
syncInfo(ref?: LocationRef): Promise<void>;
|
|
135
|
+
sync(ref?: LocationRef): Promise<void>;
|
|
136
|
+
invalidate(ref?: LocationRef): void;
|
|
137
|
+
vcs: {
|
|
138
|
+
info: (ref?: LocationRef) => VcsInfo | undefined;
|
|
139
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
140
|
+
invalidate: (ref?: LocationRef) => void;
|
|
141
|
+
};
|
|
142
|
+
agent: {
|
|
143
|
+
list: (ref?: LocationRef) => AgentInfo[] | undefined;
|
|
144
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
145
|
+
invalidate: (ref?: LocationRef) => void;
|
|
146
|
+
};
|
|
147
|
+
command: {
|
|
148
|
+
list: (ref?: LocationRef) => CommandInfo[] | undefined;
|
|
149
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
150
|
+
invalidate: (ref?: LocationRef) => void;
|
|
151
|
+
};
|
|
152
|
+
config: {
|
|
153
|
+
list: (ref?: LocationRef) => ConfigEntry[] | undefined;
|
|
154
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
155
|
+
invalidate: (ref?: LocationRef) => void;
|
|
156
|
+
};
|
|
157
|
+
integration: {
|
|
158
|
+
list: (ref?: LocationRef) => IntegrationInfo[] | undefined;
|
|
159
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
160
|
+
invalidate: (ref?: LocationRef) => void;
|
|
161
|
+
};
|
|
162
|
+
mcp: {
|
|
163
|
+
server: {
|
|
164
|
+
list: (ref?: LocationRef) => McpServer[] | undefined;
|
|
165
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
166
|
+
invalidate: (ref?: LocationRef) => void;
|
|
167
|
+
};
|
|
168
|
+
resource: {
|
|
169
|
+
list: (ref?: LocationRef) => McpResource[] | undefined;
|
|
170
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
171
|
+
invalidate: (ref?: LocationRef) => void;
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
model: {
|
|
175
|
+
list: (ref?: LocationRef) => ModelInfo[] | undefined;
|
|
176
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
177
|
+
invalidate: (ref?: LocationRef) => void;
|
|
178
|
+
};
|
|
179
|
+
provider: {
|
|
180
|
+
list: (ref?: LocationRef) => ProviderInfo[] | undefined;
|
|
181
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
182
|
+
invalidate: (ref?: LocationRef) => void;
|
|
183
|
+
};
|
|
184
|
+
reference: {
|
|
185
|
+
list: (ref?: LocationRef) => ReferenceInfo[] | undefined;
|
|
186
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
187
|
+
invalidate: (ref?: LocationRef) => void;
|
|
188
|
+
};
|
|
189
|
+
websearch: {
|
|
190
|
+
list(location?: LocationRef): WebSearchProvider[] | undefined;
|
|
191
|
+
refresh(ref?: LocationRef): Promise<void>;
|
|
192
|
+
};
|
|
193
|
+
skill: {
|
|
194
|
+
list: (ref?: LocationRef) => SkillInfo[] | undefined;
|
|
195
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
196
|
+
invalidate: (ref?: LocationRef) => void;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
export type Data = ReturnType<typeof createData>;
|
|
201
|
+
export {};
|