@kilocode/client 0.0.0-stage → 0.0.0-v2-9
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 +26 -2
- package/dist/chunks/contract-15p82y03.js +62 -0
- package/dist/chunks/contract-1x65x4hv.js +1701 -0
- package/dist/chunks/contract-5bf0yjkp.js +111 -0
- package/dist/chunks/contract-6mptkzbc.js +0 -0
- package/dist/chunks/contract-8bbb028w.js +145 -0
- package/dist/chunks/contract-8s2anffy.js +11 -0
- package/dist/chunks/contract-8ye1ye6f.js +92 -0
- package/dist/chunks/contract-9rqn6x4v.js +16 -0
- package/dist/chunks/contract-c46qzyff.js +37 -0
- package/dist/chunks/contract-gne7h7mq.js +50 -0
- package/dist/chunks/contract-hjez4bfs.js +52 -0
- package/dist/chunks/contract-m2eywc8w.js +0 -0
- package/dist/chunks/contract-nwcpakzx.js +12 -0
- package/dist/chunks/contract-qav6mfdz.js +0 -0
- package/dist/chunks/contract-ryy6kscr.js +39 -0
- package/dist/chunks/contract-s2hya144.js +1524 -0
- package/dist/chunks/contract-skhp7hxc.js +81 -0
- package/dist/chunks/contract-sxt88q69.js +12 -0
- package/dist/chunks/contract-ve4aws36.js +103 -0
- package/dist/chunks/contract-vmytr4q8.js +4 -0
- package/dist/chunks/contract-vwtmm97t.js +30 -0
- package/dist/chunks/contract-vyas3vgt.js +0 -0
- package/dist/chunks/contract-w10x3kfx.js +658 -0
- package/dist/chunks/contract-xgnj2w4v.js +20 -0
- package/dist/chunks/contract-y2etg5bs.js +9 -0
- package/dist/chunks/contract-ydhz1zrh.js +238 -0
- package/dist/contract.d.ts +1 -0
- package/dist/contract.js +12 -0
- package/dist/effect/api/api.d.ts +2927 -0
- package/dist/effect/api/api.js +0 -0
- package/dist/effect/api.d.ts +4 -0
- package/dist/effect/api.js +0 -0
- package/dist/effect/client.d.ts +2569 -0
- package/dist/effect/client.js +15 -0
- package/dist/effect/generated/client-error.d.ts +7 -0
- package/dist/effect/generated/client-error.js +6 -0
- package/dist/effect/generated/client.d.ts +2568 -0
- package/dist/effect/generated/client.js +8 -0
- package/dist/effect/generated/index.d.ts +2 -0
- package/dist/effect/generated/index.js +12 -0
- package/dist/effect/index.d.ts +35 -0
- package/dist/effect/index.js +75 -0
- package/dist/effect/rpc.d.ts +20 -0
- package/dist/effect/rpc.js +11 -0
- package/dist/effect/service.d.ts +90 -0
- package/dist/effect/service.js +187 -0
- package/dist/mcp.d.ts +44 -0
- package/dist/mcp.js +110 -0
- package/dist/promise/api.d.ts +21 -0
- package/dist/promise/api.js +0 -0
- package/dist/promise/client.d.ts +270 -0
- package/dist/promise/client.js +14 -0
- package/dist/promise/generated/client-error.d.ts +8 -0
- package/dist/promise/generated/client-error.js +6 -0
- package/dist/promise/generated/client.d.ts +277 -0
- package/dist/promise/generated/client.js +7 -0
- package/dist/promise/generated/index.d.ts +3 -0
- package/dist/promise/generated/index.js +81 -0
- package/dist/promise/generated/types.d.ts +7877 -0
- package/dist/promise/generated/types.js +72 -0
- package/dist/promise/index.d.ts +6 -0
- package/dist/promise/index.js +85 -0
- package/dist/promise/rpc.d.ts +32 -0
- package/dist/promise/rpc.js +7 -0
- package/dist/promise/service.d.ts +24 -0
- package/dist/promise/service.js +187 -0
- package/dist/pty-handoff.d.ts +12 -0
- package/dist/pty-handoff.js +17 -0
- package/dist/rpc-runtime.d.ts +20 -0
- package/dist/rpc-runtime.js +14 -0
- package/dist/service-contender.d.ts +37 -0
- package/dist/service-contender.js +10 -0
- package/dist/service-probe.d.ts +70 -0
- package/dist/service-probe.js +16 -0
- package/dist/service-timing.d.ts +12 -0
- package/dist/service-timing.js +10 -0
- package/dist/service-version.d.ts +2 -0
- package/dist/service-version.js +6 -0
- package/dist/service.d.ts +52 -0
- package/dist/service.js +1 -0
- package/dist/shared-events.d.ts +11 -0
- package/dist/shared-events.js +8 -0
- package/dist/solid/connection.d.ts +37 -0
- package/dist/solid/connection.js +10 -0
- package/dist/solid/data.d.ts +211 -0
- package/dist/solid/data.js +18 -0
- package/dist/solid/index.d.ts +4 -0
- package/dist/solid/index.js +36 -0
- package/dist/solid/pty.d.ts +22 -0
- package/dist/solid/pty.js +8 -0
- package/dist/solid/usage.d.ts +9 -0
- package/dist/solid/usage.js +6 -0
- package/package.json +88 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Connection details for a local OpenCode service. */
|
|
2
|
+
export type Endpoint = {
|
|
3
|
+
/** Base URL of the service. */
|
|
4
|
+
readonly url: string;
|
|
5
|
+
/** Authentication required by the service, when configured. */
|
|
6
|
+
readonly auth?: {
|
|
7
|
+
/** HTTP authentication scheme. */
|
|
8
|
+
readonly type: "basic";
|
|
9
|
+
/** Basic authentication username. */
|
|
10
|
+
readonly username: string;
|
|
11
|
+
/** Basic authentication password. */
|
|
12
|
+
readonly password: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
/** Options used to discover the local OpenCode service. */
|
|
16
|
+
export type DiscoverOptions = {
|
|
17
|
+
/** Absolute registration file path. Defaults to the XDG state directory. */
|
|
18
|
+
readonly file?: string;
|
|
19
|
+
/** Required exact service version or compatibility predicate. */
|
|
20
|
+
readonly version?: string | ((version: string) => boolean);
|
|
21
|
+
};
|
|
22
|
+
/** Reason ensuring the service requires a new process. */
|
|
23
|
+
export type EnsureReason = "missing" | "version-mismatch";
|
|
24
|
+
/** Options used to ensure the local OpenCode service is running. */
|
|
25
|
+
export type EnsureOptions = DiscoverOptions & {
|
|
26
|
+
/** Service command and arguments. Defaults to `opencode serve --service`. */
|
|
27
|
+
readonly command?: ReadonlyArray<string>;
|
|
28
|
+
/** Environment variables added to the inherited service process environment. */
|
|
29
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
30
|
+
/** Called once before spawning a new service process. */
|
|
31
|
+
readonly onStart?: (reason: EnsureReason, previousVersion?: string) => void;
|
|
32
|
+
};
|
|
33
|
+
/** Options used to stop the local OpenCode service. */
|
|
34
|
+
export type StopOptions = {
|
|
35
|
+
/** Absolute registration file path. Defaults to the XDG state directory. */
|
|
36
|
+
readonly file?: string;
|
|
37
|
+
/** How to handle persistent terminals before stopping the service. */
|
|
38
|
+
readonly pty?: "clear" | "handoff";
|
|
39
|
+
};
|
|
40
|
+
/** Contents of the local service registration file. */
|
|
41
|
+
export type Info = {
|
|
42
|
+
/** Unique service instance identifier. */
|
|
43
|
+
readonly id?: string;
|
|
44
|
+
/** OpenCode version served by the process. */
|
|
45
|
+
readonly version?: string;
|
|
46
|
+
/** Base URL advertised by the service. */
|
|
47
|
+
readonly url: string;
|
|
48
|
+
/** Operating system process identifier. */
|
|
49
|
+
readonly pid: number;
|
|
50
|
+
/** Private service password, when authentication is enabled. */
|
|
51
|
+
readonly password?: string;
|
|
52
|
+
};
|
package/dist/service.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunks/contract-qav6mfdz.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * as SharedEvents from "./shared-events.js";
|
|
2
|
+
export type SubscribeOptions = {
|
|
3
|
+
readonly signal?: AbortSignal;
|
|
4
|
+
/** Reports transport activity on the shared stream, including keepalive frames that carry no event. */
|
|
5
|
+
readonly onActivity?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function make<A extends {
|
|
8
|
+
readonly type: string;
|
|
9
|
+
}>(connect: (signal: AbortSignal, onActivity: () => void) => AsyncIterable<A>): {
|
|
10
|
+
subscribe(options?: SubscribeOptions): AsyncIterable<A>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { OpenCodeClient, OpenCodeEvent } from "../promise";
|
|
2
|
+
export type ClientConnectionStatus = "connected" | "connecting" | "reconnecting";
|
|
3
|
+
export type ClientConnectionEvent = {
|
|
4
|
+
readonly type: "client.connection";
|
|
5
|
+
readonly created: number;
|
|
6
|
+
readonly data: {
|
|
7
|
+
readonly status: "connecting" | "connected" | "disconnected" | "reconnecting";
|
|
8
|
+
readonly attempt: number;
|
|
9
|
+
readonly error?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type ClientConnectionOptions = {
|
|
13
|
+
readonly reconnect?: (signal: AbortSignal) => Promise<OpenCodeClient>;
|
|
14
|
+
readonly onEvent: (event: OpenCodeEvent) => void;
|
|
15
|
+
readonly flushInterval?: number;
|
|
16
|
+
readonly pageLifecycle?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Abort and reconnect a stream that receives no bytes for this long. The server writes a keepalive
|
|
19
|
+
* comment every 15 seconds, so a quiet but healthy stream never trips this.
|
|
20
|
+
*/
|
|
21
|
+
readonly idleTimeout?: number;
|
|
22
|
+
readonly log?: {
|
|
23
|
+
readonly debug?: (message: string, data?: Readonly<Record<string, unknown>>) => void;
|
|
24
|
+
readonly info?: (message: string, data?: Readonly<Record<string, unknown>>) => void;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare const defaultIdleTimeout = 45000;
|
|
28
|
+
export declare const foregroundIdleThreshold = 20000;
|
|
29
|
+
export declare function createClientConnection(initialApi: OpenCodeClient, options: ClientConnectionOptions): {
|
|
30
|
+
status: () => ClientConnectionStatus;
|
|
31
|
+
attempt: () => number;
|
|
32
|
+
error: () => string | undefined;
|
|
33
|
+
internal: {
|
|
34
|
+
history: () => ClientConnectionEvent[];
|
|
35
|
+
resync: (reason: string) => void;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defaultIdleTimeout2,
|
|
3
|
+
foregroundIdleThreshold2,
|
|
4
|
+
createClientConnection2
|
|
5
|
+
} from "../chunks/contract-ydhz1zrh.js";
|
|
6
|
+
export {
|
|
7
|
+
createClientConnection2 as createClientConnection,
|
|
8
|
+
defaultIdleTimeout2 as defaultIdleTimeout,
|
|
9
|
+
foregroundIdleThreshold2 as foregroundIdleThreshold
|
|
10
|
+
};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import type { AgentInfo, CommandInfo, ConfigEntry, SessionFormCancelInput, FormInfo, SessionFormReplyInput, IntegrationInfo, LocationRef, 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
|
+
/**
|
|
5
|
+
* Where a pending user prompt stands relative to the runner: `starting` is promoted at the next idle boundary,
|
|
6
|
+
* `steering` waits for the next step boundary of an execution that already delivered input, `stranded` outlived an
|
|
7
|
+
* execution that ended without delivering it, and `queued` waits for every steer to drain.
|
|
8
|
+
*/
|
|
9
|
+
export type DataPendingStatus = "starting" | "steering" | "stranded" | "queued";
|
|
10
|
+
type OpenCodeEventMap = {
|
|
11
|
+
[Type in OpenCodeEvent["type"]]: Extract<OpenCodeEvent, {
|
|
12
|
+
type: Type;
|
|
13
|
+
}>;
|
|
14
|
+
};
|
|
15
|
+
export type CreateDataInput = {
|
|
16
|
+
readonly api: () => OpenCodeClient;
|
|
17
|
+
readonly directory: string;
|
|
18
|
+
/** Raw-message window used for an initial transcript read. Older pages retain their normal size. */
|
|
19
|
+
readonly initialMessageLimit?: () => number;
|
|
20
|
+
readonly event: {
|
|
21
|
+
readonly on: <Type extends OpenCodeEvent["type"]>(type: Type, handler: (event: OpenCodeEventMap[Type]) => void) => () => void;
|
|
22
|
+
readonly listen: (handler: (event: {
|
|
23
|
+
name: OpenCodeEvent["type"];
|
|
24
|
+
details: OpenCodeEvent;
|
|
25
|
+
}) => void) => () => void;
|
|
26
|
+
};
|
|
27
|
+
readonly connection?: {
|
|
28
|
+
readonly status: () => "connected" | "connecting" | "reconnecting";
|
|
29
|
+
};
|
|
30
|
+
/** Receives failed event-driven reads. Explicit reads still reject to their caller. */
|
|
31
|
+
readonly onError?: (error: unknown) => void;
|
|
32
|
+
};
|
|
33
|
+
export declare const settleMs = 150;
|
|
34
|
+
export type FormWithLocation = FormInfo & {
|
|
35
|
+
readonly location?: LocationRef;
|
|
36
|
+
};
|
|
37
|
+
type ShellWithLocation = ShellInfo & {
|
|
38
|
+
readonly location: LocationRef;
|
|
39
|
+
};
|
|
40
|
+
export declare function locationKey(location: LocationRef): string;
|
|
41
|
+
export declare function createData(config: CreateDataInput): {
|
|
42
|
+
on: <Type extends OpenCodeEvent["type"]>(type: Type, handler: (event: OpenCodeEventMap[Type]) => void) => () => void;
|
|
43
|
+
listen: (handler: (event: {
|
|
44
|
+
name: OpenCodeEvent["type"];
|
|
45
|
+
details: OpenCodeEvent;
|
|
46
|
+
}) => void) => () => void;
|
|
47
|
+
session: {
|
|
48
|
+
list(): SessionInfo[];
|
|
49
|
+
get(sessionID: string): SessionInfo;
|
|
50
|
+
creating(sessionID: string): boolean;
|
|
51
|
+
remember(info: SessionInfo): void;
|
|
52
|
+
setStatus(sessionID: string, status: DataSessionStatus): void;
|
|
53
|
+
root(sessionID: string): string;
|
|
54
|
+
family(sessionID: string): string[];
|
|
55
|
+
/** Clear heavy cached data for the root and all known descendants. */
|
|
56
|
+
evict(sessionID: string): void;
|
|
57
|
+
cost(sessionID: string): number;
|
|
58
|
+
status(sessionID: string): DataSessionStatus;
|
|
59
|
+
active(): string[];
|
|
60
|
+
input: {
|
|
61
|
+
list(sessionID: string): string[];
|
|
62
|
+
has(sessionID: string, inboxID: string): boolean;
|
|
63
|
+
};
|
|
64
|
+
pending: {
|
|
65
|
+
list(sessionID: string): SessionInboxInfo[];
|
|
66
|
+
status(sessionID: string, inboxID: string): DataPendingStatus | undefined;
|
|
67
|
+
sync(sessionID: string): Promise<void>;
|
|
68
|
+
invalidate(sessionID: string): void;
|
|
69
|
+
};
|
|
70
|
+
create(input: {
|
|
71
|
+
id?: string;
|
|
72
|
+
title?: string;
|
|
73
|
+
agent?: string;
|
|
74
|
+
model?: ModelRef;
|
|
75
|
+
location?: LocationRef;
|
|
76
|
+
projectID?: string;
|
|
77
|
+
}): {
|
|
78
|
+
id: string;
|
|
79
|
+
request: Promise<SessionInfo>;
|
|
80
|
+
};
|
|
81
|
+
compact(input: {
|
|
82
|
+
sessionID: string;
|
|
83
|
+
model?: ModelRef;
|
|
84
|
+
}): Promise<SessionInboxCompaction>;
|
|
85
|
+
prompt(input: SessionPromptInput & {
|
|
86
|
+
gate?: Promise<unknown>;
|
|
87
|
+
prepare?: () => Promise<unknown>;
|
|
88
|
+
}): Promise<import("../promise").SessionInboxUser>;
|
|
89
|
+
sync(sessionID: string, options?: {
|
|
90
|
+
children?: boolean;
|
|
91
|
+
}): Promise<void>;
|
|
92
|
+
invalidate(sessionID: string): void;
|
|
93
|
+
message: {
|
|
94
|
+
list(sessionID: string): SessionMessageInfo[];
|
|
95
|
+
get(sessionID: string, messageID: string): SessionMessageInfo | undefined;
|
|
96
|
+
sync(sessionID: string): Promise<void>;
|
|
97
|
+
more(sessionID: string): boolean;
|
|
98
|
+
loading(sessionID: string): boolean;
|
|
99
|
+
loadMore(sessionID: string, options?: {
|
|
100
|
+
all?: boolean;
|
|
101
|
+
signal?: AbortSignal;
|
|
102
|
+
/** Runs synchronously inside the store-publication batch. */
|
|
103
|
+
beforePublish?: () => void;
|
|
104
|
+
}): Promise<void>;
|
|
105
|
+
invalidate(sessionID: string): void;
|
|
106
|
+
};
|
|
107
|
+
permission: {
|
|
108
|
+
list(sessionID: string): PermissionRequest[];
|
|
109
|
+
sessions(): string[];
|
|
110
|
+
sync(sessionID: string): Promise<void>;
|
|
111
|
+
invalidate(sessionID: string): void;
|
|
112
|
+
reply(input: PermissionReplyInput): Promise<void>;
|
|
113
|
+
};
|
|
114
|
+
form: {
|
|
115
|
+
list(sessionID: string, ref?: LocationRef): FormWithLocation[] | undefined;
|
|
116
|
+
sessions(): string[];
|
|
117
|
+
sync(sessionID: string, ref?: LocationRef): Promise<void>;
|
|
118
|
+
invalidate(sessionID: string, ref?: LocationRef): void;
|
|
119
|
+
reply(input: SessionFormReplyInput, ref?: LocationRef): Promise<void>;
|
|
120
|
+
cancel(input: SessionFormCancelInput, ref?: LocationRef): Promise<void>;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
project: {
|
|
124
|
+
list(): Project[];
|
|
125
|
+
get(projectID: string): Project;
|
|
126
|
+
sync(): Promise<void>;
|
|
127
|
+
invalidate(): void;
|
|
128
|
+
permission: {
|
|
129
|
+
list(projectID: string): PermissionSavedInfo[];
|
|
130
|
+
sync(projectID: string): Promise<void>;
|
|
131
|
+
invalidate(projectID: string): void;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
shell: {
|
|
135
|
+
list(location?: LocationRef): ShellWithLocation[];
|
|
136
|
+
listBySession(sessionID: string): ShellWithLocation[];
|
|
137
|
+
get(id: string): ShellWithLocation | undefined;
|
|
138
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
139
|
+
invalidate: (ref?: LocationRef) => void;
|
|
140
|
+
};
|
|
141
|
+
location: {
|
|
142
|
+
info(ref?: LocationRef): import("../promise").LocationPublicInfo | undefined;
|
|
143
|
+
default(): LocationRef;
|
|
144
|
+
syncInfo(ref?: LocationRef): Promise<void>;
|
|
145
|
+
sync(ref?: LocationRef): Promise<void>;
|
|
146
|
+
invalidate(ref?: LocationRef): void;
|
|
147
|
+
vcs: {
|
|
148
|
+
info: (ref?: LocationRef) => VcsInfo | undefined;
|
|
149
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
150
|
+
invalidate: (ref?: LocationRef) => void;
|
|
151
|
+
};
|
|
152
|
+
agent: {
|
|
153
|
+
list: (ref?: LocationRef) => AgentInfo[] | undefined;
|
|
154
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
155
|
+
invalidate: (ref?: LocationRef) => void;
|
|
156
|
+
};
|
|
157
|
+
command: {
|
|
158
|
+
list: (ref?: LocationRef) => CommandInfo[] | undefined;
|
|
159
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
160
|
+
invalidate: (ref?: LocationRef) => void;
|
|
161
|
+
};
|
|
162
|
+
config: {
|
|
163
|
+
list: (ref?: LocationRef) => ConfigEntry[] | undefined;
|
|
164
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
165
|
+
invalidate: (ref?: LocationRef) => void;
|
|
166
|
+
};
|
|
167
|
+
integration: {
|
|
168
|
+
list: (ref?: LocationRef) => IntegrationInfo[] | undefined;
|
|
169
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
170
|
+
invalidate: (ref?: LocationRef) => void;
|
|
171
|
+
};
|
|
172
|
+
mcp: {
|
|
173
|
+
server: {
|
|
174
|
+
list: (ref?: LocationRef) => McpServer[] | undefined;
|
|
175
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
176
|
+
invalidate: (ref?: LocationRef) => void;
|
|
177
|
+
};
|
|
178
|
+
resource: {
|
|
179
|
+
list: (ref?: LocationRef) => McpResource[] | undefined;
|
|
180
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
181
|
+
invalidate: (ref?: LocationRef) => void;
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
model: {
|
|
185
|
+
list: (ref?: LocationRef) => ModelInfo[] | undefined;
|
|
186
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
187
|
+
invalidate: (ref?: LocationRef) => void;
|
|
188
|
+
};
|
|
189
|
+
provider: {
|
|
190
|
+
list: (ref?: LocationRef) => ProviderInfo[] | undefined;
|
|
191
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
192
|
+
invalidate: (ref?: LocationRef) => void;
|
|
193
|
+
};
|
|
194
|
+
reference: {
|
|
195
|
+
list: (ref?: LocationRef) => ReferenceInfo[] | undefined;
|
|
196
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
197
|
+
invalidate: (ref?: LocationRef) => void;
|
|
198
|
+
};
|
|
199
|
+
websearch: {
|
|
200
|
+
list(location?: LocationRef): WebSearchProvider[] | undefined;
|
|
201
|
+
refresh(ref?: LocationRef): Promise<void>;
|
|
202
|
+
};
|
|
203
|
+
skill: {
|
|
204
|
+
list: (ref?: LocationRef) => SkillInfo[] | undefined;
|
|
205
|
+
sync: (ref?: LocationRef) => Promise<void>;
|
|
206
|
+
invalidate: (ref?: LocationRef) => void;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
export type Data = ReturnType<typeof createData>;
|
|
211
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
settleMs2,
|
|
3
|
+
locationKey2,
|
|
4
|
+
createData2
|
|
5
|
+
} from "../chunks/contract-1x65x4hv.js";
|
|
6
|
+
import"../chunks/contract-m2eywc8w.js";
|
|
7
|
+
import"../chunks/contract-vwtmm97t.js";
|
|
8
|
+
import"../chunks/contract-vyas3vgt.js";
|
|
9
|
+
import"../chunks/contract-s2hya144.js";
|
|
10
|
+
import"../chunks/contract-nwcpakzx.js";
|
|
11
|
+
import"../chunks/contract-skhp7hxc.js";
|
|
12
|
+
import"../chunks/contract-c46qzyff.js";
|
|
13
|
+
import"../chunks/contract-8bbb028w.js";
|
|
14
|
+
export {
|
|
15
|
+
createData2 as createData,
|
|
16
|
+
locationKey2 as locationKey,
|
|
17
|
+
settleMs2 as settleMs
|
|
18
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import"../chunks/contract-nwcpakzx.js";
|
|
2
|
+
import"../chunks/contract-s2hya144.js";
|
|
3
|
+
import"../chunks/contract-c46qzyff.js";
|
|
4
|
+
import"../chunks/contract-vyas3vgt.js";
|
|
5
|
+
import"../chunks/contract-8bbb028w.js";
|
|
6
|
+
import"../chunks/contract-skhp7hxc.js";
|
|
7
|
+
import"../chunks/contract-vwtmm97t.js";
|
|
8
|
+
import"../chunks/contract-m2eywc8w.js";
|
|
9
|
+
import {
|
|
10
|
+
settleMs2,
|
|
11
|
+
locationKey2,
|
|
12
|
+
createData2
|
|
13
|
+
} from "../chunks/contract-1x65x4hv.js";
|
|
14
|
+
import {
|
|
15
|
+
defaultIdleTimeout2,
|
|
16
|
+
foregroundIdleThreshold2,
|
|
17
|
+
createClientConnection2
|
|
18
|
+
} from "../chunks/contract-ydhz1zrh.js";
|
|
19
|
+
import {
|
|
20
|
+
createPtyClient2,
|
|
21
|
+
createPersistentPtyClient2
|
|
22
|
+
} from "../chunks/contract-gne7h7mq.js";
|
|
23
|
+
import {
|
|
24
|
+
lastAssistantWithUsage2
|
|
25
|
+
} from "../chunks/contract-8s2anffy.js";
|
|
26
|
+
export {
|
|
27
|
+
createClientConnection2 as createClientConnection,
|
|
28
|
+
createData2 as createData,
|
|
29
|
+
createPersistentPtyClient2 as createPersistentPtyClient,
|
|
30
|
+
createPtyClient2 as createPtyClient,
|
|
31
|
+
defaultIdleTimeout2 as defaultIdleTimeout,
|
|
32
|
+
foregroundIdleThreshold2 as foregroundIdleThreshold,
|
|
33
|
+
lastAssistantWithUsage2 as lastAssistantWithUsage,
|
|
34
|
+
locationKey2 as locationKey,
|
|
35
|
+
settleMs2 as settleMs
|
|
36
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ExperimentalPersistentPtyConnectTokenInput, OpenCodeClient, PtyConnectTokenInput } from "../promise";
|
|
2
|
+
export type PtyClientOptions = {
|
|
3
|
+
readonly url: string;
|
|
4
|
+
readonly openSocket?: (url: URL) => WebSocket;
|
|
5
|
+
};
|
|
6
|
+
export type PtyConnectInput = {
|
|
7
|
+
readonly ptyID: PtyConnectTokenInput["ptyID"];
|
|
8
|
+
readonly location?: PtyConnectTokenInput["location"];
|
|
9
|
+
readonly cursor?: number;
|
|
10
|
+
};
|
|
11
|
+
export type PersistentPtyConnectInput = {
|
|
12
|
+
readonly ptyID: ExperimentalPersistentPtyConnectTokenInput["ptyID"];
|
|
13
|
+
readonly cursor: number;
|
|
14
|
+
readonly attachmentID: string;
|
|
15
|
+
readonly takeover?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare function createPtyClient(api: OpenCodeClient, options: PtyClientOptions): {
|
|
18
|
+
connect(input: PtyConnectInput): Promise<WebSocket>;
|
|
19
|
+
};
|
|
20
|
+
export declare function createPersistentPtyClient(api: OpenCodeClient, options: PtyClientOptions): {
|
|
21
|
+
connect(input: PersistentPtyConnectInput): Promise<WebSocket>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SessionMessageAssistant, SessionMessageInfo } from "../promise";
|
|
2
|
+
/**
|
|
3
|
+
* The assistant step whose tokens fill the context window now: the latest one after the last completed
|
|
4
|
+
* compaction and before the revert boundary. Every client shows context usage from this step, so the TUI
|
|
5
|
+
* and the desktop app agree on it.
|
|
6
|
+
*/
|
|
7
|
+
export declare function lastAssistantWithUsage(messages: ReadonlyArray<SessionMessageInfo>, boundary?: string): (SessionMessageAssistant & {
|
|
8
|
+
tokens: NonNullable<SessionMessageAssistant["tokens"]>;
|
|
9
|
+
}) | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,90 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/package.json",
|
|
2
3
|
"name": "@kilocode/client",
|
|
3
|
-
"version": "0.0.0-
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
4
|
+
"version": "0.0.0-v2-9",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Kilo-Org/kilocode.git",
|
|
10
|
+
"directory": "packages/client"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"import": "./dist/promise/index.js",
|
|
21
|
+
"types": "./dist/promise/index.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./promise": {
|
|
24
|
+
"import": "./dist/promise/index.js",
|
|
25
|
+
"types": "./dist/promise/index.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./promise/api": {
|
|
28
|
+
"import": "./dist/promise/api.js",
|
|
29
|
+
"types": "./dist/promise/api.d.ts"
|
|
30
|
+
},
|
|
31
|
+
"./service": {
|
|
32
|
+
"import": "./dist/promise/service.js",
|
|
33
|
+
"types": "./dist/promise/service.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./solid": {
|
|
36
|
+
"import": "./dist/solid/index.js",
|
|
37
|
+
"types": "./dist/solid/index.d.ts"
|
|
38
|
+
},
|
|
39
|
+
"./effect": {
|
|
40
|
+
"import": "./dist/effect/index.js",
|
|
41
|
+
"types": "./dist/effect/index.d.ts"
|
|
42
|
+
},
|
|
43
|
+
"./effect/api": {
|
|
44
|
+
"import": "./dist/effect/api.js",
|
|
45
|
+
"types": "./dist/effect/api.d.ts"
|
|
46
|
+
},
|
|
47
|
+
"./effect/service": {
|
|
48
|
+
"import": "./dist/effect/service.js",
|
|
49
|
+
"types": "./dist/effect/service.d.ts"
|
|
50
|
+
},
|
|
51
|
+
"./mcp": {
|
|
52
|
+
"import": "./dist/mcp.js",
|
|
53
|
+
"types": "./dist/mcp.d.ts"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "bun run script/build-package.ts",
|
|
58
|
+
"generate": "bun run script/build.ts",
|
|
59
|
+
"check:generated": "bun run generate && git diff --exit-code -- src/promise/generated src/effect/generated src/effect/api",
|
|
60
|
+
"test": "bun test --timeout 5000",
|
|
61
|
+
"typecheck": "bun check --no-script",
|
|
62
|
+
"typecheck:tsc": "tsc --noEmit"
|
|
63
|
+
},
|
|
64
|
+
"dependencies": {
|
|
65
|
+
"@opencode/schema": "npm:@kilocode/schema@0.0.0-v2-9",
|
|
66
|
+
"@opencode/protocol": "npm:@kilocode/protocol@0.0.0-v2-9"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"effect": "4.0.1",
|
|
70
|
+
"solid-js": ">=1.9.0"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"effect": {
|
|
74
|
+
"optional": true
|
|
75
|
+
},
|
|
76
|
+
"solid-js": {
|
|
77
|
+
"optional": true
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@effect/platform-node": "4.0.1",
|
|
82
|
+
"@modelcontextprotocol/client": "2.3.1",
|
|
83
|
+
"@opencode/httpapi-codegen": "2.1.3",
|
|
84
|
+
"@tsconfig/bun": "1.0.9",
|
|
85
|
+
"@types/bun": "1.4.3",
|
|
86
|
+
"@typescript/native": "npm:typescript@7.1.0-beta",
|
|
87
|
+
"effect": "4.0.1",
|
|
88
|
+
"solid-js": "1.9.15"
|
|
89
|
+
}
|
|
90
|
+
}
|