@code-yeongyu/senpi 2026.8.28 → 2026.8.29
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/CHANGELOG.md +74 -0
- package/dist/cli/args.d.ts +2 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +4 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js +2 -0
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +5 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +1 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +1 -0
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +3 -0
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/credential-accounts.d.ts.map +1 -1
- package/dist/core/credential-accounts.js +22 -12
- package/dist/core/credential-accounts.js.map +1 -1
- package/dist/core/credential-pool/classify.d.ts +6 -1
- package/dist/core/credential-pool/classify.d.ts.map +1 -1
- package/dist/core/credential-pool/classify.js +22 -5
- package/dist/core/credential-pool/classify.js.map +1 -1
- package/dist/core/credential-pool/failover.d.ts +8 -0
- package/dist/core/credential-pool/failover.d.ts.map +1 -1
- package/dist/core/credential-pool/failover.js +24 -6
- package/dist/core/credential-pool/failover.js.map +1 -1
- package/dist/core/credential-pool/rotation-stream.d.ts +13 -2
- package/dist/core/credential-pool/rotation-stream.d.ts.map +1 -1
- package/dist/core/credential-pool/rotation-stream.js +97 -10
- package/dist/core/credential-pool/rotation-stream.js.map +1 -1
- package/dist/core/extensions/builtin/goal/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/goal/index.js +7 -0
- package/dist/core/extensions/builtin/goal/index.js.map +1 -1
- package/dist/core/extensions/builtin/service-tier.d.ts.map +1 -1
- package/dist/core/extensions/builtin/service-tier.js +13 -0
- package/dist/core/extensions/builtin/service-tier.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/extension.js +4 -2
- package/dist/core/extensions/builtin/terminal/extension.js.map +1 -1
- package/dist/core/model-config-schema.d.ts +4 -4
- package/dist/core/model-runtime.d.ts +2 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +74 -37
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/retry-fallback/chains.d.ts +23 -1
- package/dist/core/retry-fallback/chains.d.ts.map +1 -1
- package/dist/core/retry-fallback/chains.js +59 -3
- package/dist/core/retry-fallback/chains.js.map +1 -1
- package/dist/core/retry-fallback/controller.d.ts.map +1 -1
- package/dist/core/retry-fallback/controller.js +9 -2
- package/dist/core/retry-fallback/controller.js.map +1 -1
- package/dist/core/retry-fallback/settings.d.ts.map +1 -1
- package/dist/core/retry-fallback/settings.js +9 -0
- package/dist/core/retry-fallback/settings.js.map +1 -1
- package/dist/core/retry-fallback/validate.js +1 -1
- package/dist/core/retry-fallback/validate.js.map +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +9 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +31 -0
- package/dist/core/session-manager.js.map +1 -1
- package/dist/main.d.ts +7 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +10 -1
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/favorite-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/favorite-models-selector.js +2 -2
- package/dist/modes/interactive/components/favorite-models-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-host-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-host-runtime.js +323 -33
- package/dist/modes/interactive/interactive-host-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +276 -237
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
- package/dist/modes/rpc/connection-handler.js +133 -24
- package/dist/modes/rpc/connection-handler.js.map +1 -1
- package/dist/modes/rpc/multi-session-host.js +14 -4
- package/dist/modes/rpc/multi-session-host.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +82 -13
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +85 -28
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts +3 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +3 -1
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +162 -2
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modes/rpc/session-command-router.d.ts +22 -0
- package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
- package/dist/modes/rpc/session-command-router.js +147 -16
- package/dist/modes/rpc/session-command-router.js.map +1 -1
- package/dist/modes/rpc/session-event-writer.d.ts +2 -0
- package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
- package/dist/modes/rpc/session-event-writer.js +4 -0
- package/dist/modes/rpc/session-event-writer.js.map +1 -1
- package/dist/modes/rpc/session-registry.d.ts +7 -0
- package/dist/modes/rpc/session-registry.d.ts.map +1 -1
- package/dist/modes/rpc/session-registry.js +9 -0
- package/dist/modes/rpc/session-registry.js.map +1 -1
- package/docs/rpc.md +37 -0
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +24 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +6 -3
- package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +3 -3
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/baseten.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/fireworks.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +2 -2
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +7 -7
|
@@ -35,8 +35,20 @@ export interface ModelInfo {
|
|
|
35
35
|
reasoning: boolean;
|
|
36
36
|
supportedThinkingLevels?: ThinkingLevel[];
|
|
37
37
|
}
|
|
38
|
+
type PromptOptions = {
|
|
39
|
+
images?: ImageContent[];
|
|
40
|
+
streamingBehavior?: "steer" | "followUp";
|
|
41
|
+
thinkingLevel?: ThinkingLevel;
|
|
42
|
+
promptDisposition?: (disposition: PromptDisposition) => void;
|
|
43
|
+
preflightResult?: (success: boolean) => void;
|
|
44
|
+
expandPromptTemplates?: boolean;
|
|
45
|
+
};
|
|
38
46
|
export type RpcProviderAccountEvent = RpcAuthAccountsChangedEvent | RpcAccountFailoverEvent;
|
|
39
|
-
export type RpcClientEvent = JsonAgentSessionEvent | RpcProviderAccountEvent | RpcExtensionEvent
|
|
47
|
+
export type RpcClientEvent = JsonAgentSessionEvent | RpcProviderAccountEvent | RpcExtensionEvent | {
|
|
48
|
+
type: "bash_start";
|
|
49
|
+
} | {
|
|
50
|
+
type: "bash_end";
|
|
51
|
+
};
|
|
40
52
|
export type RpcEventListener = (event: RpcClientEvent) => void;
|
|
41
53
|
export declare class RpcClient {
|
|
42
54
|
private process;
|
|
@@ -99,32 +111,63 @@ export declare class RpcClient {
|
|
|
99
111
|
* order. A success response without a disposition (older host) maps to "handled"
|
|
100
112
|
* so the echo degrades to canonical-only rendering instead of double-rendering.
|
|
101
113
|
*/
|
|
102
|
-
prompt(message: string,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
prompt(message: string, images?: ImageContent[]): Promise<void>;
|
|
115
|
+
prompt(message: string, options?: PromptOptions): Promise<void>;
|
|
116
|
+
appendUserMessage(content: unknown): Promise<void>;
|
|
117
|
+
appendSessionEntry(entry: import("../../core/session-manager.ts").SessionEntry): Promise<void>;
|
|
118
|
+
sendCustomMessage<T = unknown>(message: {
|
|
119
|
+
customType: string;
|
|
120
|
+
content: unknown;
|
|
121
|
+
display: boolean;
|
|
122
|
+
details?: T;
|
|
123
|
+
}, options?: {
|
|
124
|
+
triggerTurn?: boolean;
|
|
125
|
+
deliverAs?: "steer" | "followUp" | "nextTurn";
|
|
108
126
|
}): Promise<void>;
|
|
109
127
|
/**
|
|
110
128
|
* Queue a steering message to interrupt the agent mid-run.
|
|
111
129
|
*/
|
|
112
|
-
steer(message: string, images?: ImageContent[]
|
|
130
|
+
steer(message: string, images?: ImageContent[], recovery?: {
|
|
131
|
+
enqueueOrder?: number;
|
|
132
|
+
}): Promise<void>;
|
|
113
133
|
/**
|
|
114
134
|
* Queue a follow-up message to be processed after the agent finishes.
|
|
115
135
|
*/
|
|
116
|
-
followUp(message: string, images?: ImageContent[]
|
|
136
|
+
followUp(message: string, images?: ImageContent[], recovery?: {
|
|
137
|
+
enqueueOrder?: number;
|
|
138
|
+
}): Promise<void>;
|
|
117
139
|
/**
|
|
118
140
|
* Abort current operation.
|
|
119
141
|
*/
|
|
120
142
|
abort(): Promise<void>;
|
|
143
|
+
abortCompaction(): Promise<void>;
|
|
144
|
+
reload(): Promise<{
|
|
145
|
+
cancelled: boolean;
|
|
146
|
+
reason?: string;
|
|
147
|
+
}>;
|
|
148
|
+
checkReloadVeto(): Promise<{
|
|
149
|
+
cancelled: boolean;
|
|
150
|
+
reason?: string;
|
|
151
|
+
}>;
|
|
121
152
|
/**
|
|
122
153
|
* Clear queued steering and follow-up messages, returning their text.
|
|
123
154
|
*/
|
|
124
|
-
clearQueue(
|
|
155
|
+
clearQueue(options?: {
|
|
156
|
+
abortWillFollow?: boolean;
|
|
157
|
+
}): Promise<{
|
|
125
158
|
steering: string[];
|
|
126
159
|
followUp: string[];
|
|
160
|
+
ordered: Array<{
|
|
161
|
+
text: string;
|
|
162
|
+
mode: "steer" | "followUp";
|
|
163
|
+
enqueueOrder: number;
|
|
164
|
+
}>;
|
|
127
165
|
}>;
|
|
166
|
+
getSteeringMessages(): Promise<string[]>;
|
|
167
|
+
getFollowUpMessages(): Promise<string[]>;
|
|
168
|
+
abortBranchSummary(): Promise<void>;
|
|
169
|
+
recordBashResult(command: string, result: BashResult, excludeFromContext?: boolean): Promise<void>;
|
|
170
|
+
setLabel(entryId: string, label?: string): Promise<void>;
|
|
128
171
|
/**
|
|
129
172
|
* Start a new session, optionally with parent tracking.
|
|
130
173
|
* @param parentSession - Optional parent session path for lineage tracking
|
|
@@ -143,6 +186,7 @@ export declare class RpcClient {
|
|
|
143
186
|
setModel(provider: string, modelId: string): Promise<{
|
|
144
187
|
provider: string;
|
|
145
188
|
id: string;
|
|
189
|
+
systemPromptName?: string;
|
|
146
190
|
}>;
|
|
147
191
|
/**
|
|
148
192
|
* Cycle to next model.
|
|
@@ -224,7 +268,21 @@ export declare class RpcClient {
|
|
|
224
268
|
/**
|
|
225
269
|
* Execute a bash command.
|
|
226
270
|
*/
|
|
227
|
-
bash(command: string
|
|
271
|
+
bash(command: string, options?: {
|
|
272
|
+
excludeFromContext?: boolean;
|
|
273
|
+
operations?: Record<string, unknown>;
|
|
274
|
+
}): Promise<BashResult>;
|
|
275
|
+
navigateTree(targetId: string, options?: {
|
|
276
|
+
summarize?: boolean;
|
|
277
|
+
customInstructions?: string;
|
|
278
|
+
replaceInstructions?: boolean;
|
|
279
|
+
label?: string;
|
|
280
|
+
}): Promise<{
|
|
281
|
+
cancelled: boolean;
|
|
282
|
+
editorText?: string;
|
|
283
|
+
aborted?: boolean;
|
|
284
|
+
summaryEntry?: unknown;
|
|
285
|
+
}>;
|
|
228
286
|
/**
|
|
229
287
|
* Abort running bash command.
|
|
230
288
|
*/
|
|
@@ -239,18 +297,25 @@ export declare class RpcClient {
|
|
|
239
297
|
exportHtml(outputPath?: string): Promise<{
|
|
240
298
|
path: string;
|
|
241
299
|
}>;
|
|
300
|
+
exportJsonl(outputPath?: string): Promise<{
|
|
301
|
+
path: string;
|
|
302
|
+
}>;
|
|
242
303
|
/**
|
|
243
304
|
* Switch to a different session file.
|
|
244
305
|
* @returns Object with `cancelled: true` if an extension cancelled the switch
|
|
245
306
|
*/
|
|
246
|
-
switchSession(sessionPath: string
|
|
307
|
+
switchSession(sessionPath: string, options?: {
|
|
308
|
+
cwdOverride?: string;
|
|
309
|
+
}): Promise<{
|
|
247
310
|
cancelled: boolean;
|
|
248
311
|
}>;
|
|
249
312
|
/**
|
|
250
313
|
* Fork from a specific message.
|
|
251
314
|
* @returns Object with `text` (the message text) and `cancelled` (if extension cancelled)
|
|
252
315
|
*/
|
|
253
|
-
fork(entryId: string
|
|
316
|
+
fork(entryId: string, options?: {
|
|
317
|
+
position?: "before" | "at";
|
|
318
|
+
}): Promise<{
|
|
254
319
|
text: string;
|
|
255
320
|
cancelled: boolean;
|
|
256
321
|
}>;
|
|
@@ -290,6 +355,9 @@ export declare class RpcClient {
|
|
|
290
355
|
* Set the session display name.
|
|
291
356
|
*/
|
|
292
357
|
setSessionName(name: string): Promise<void>;
|
|
358
|
+
importJsonl(inputPath: string, cwdOverride?: string): Promise<{
|
|
359
|
+
cancelled: boolean;
|
|
360
|
+
}>;
|
|
293
361
|
/**
|
|
294
362
|
* Get all messages in the session.
|
|
295
363
|
*/
|
|
@@ -325,4 +393,5 @@ export declare class RpcClient {
|
|
|
325
393
|
private send;
|
|
326
394
|
private getData;
|
|
327
395
|
}
|
|
396
|
+
export {};
|
|
328
397
|
//# sourceMappingURL=rpc-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rpc-client.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"rpc-client.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE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hE;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,EAAE,EAAE,OAAO,SAAQ,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAUhH,OAAO,CAAC,UAAU;IA2BlB,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,qBAAqB;YAQf,IAAI;IAiElB,OAAO,CAAC,OAAO;CAef"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import { createConnection } from "node:net";
|
|
8
|
+
import { MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
8
9
|
import { attachJsonlLineReader, serializeJsonLine } from "./jsonl.js";
|
|
9
10
|
function isProviderAccountEvent(event) {
|
|
10
11
|
return event.type === "auth_accounts_changed" || event.type === "account_failover";
|
|
@@ -195,24 +196,19 @@ export class RpcClient {
|
|
|
195
196
|
const response = await this.send({ type: "list_sessions" }, false);
|
|
196
197
|
return this.getData(response).sessions;
|
|
197
198
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
*
|
|
203
|
-
* The disposition/preflight callbacks mirror AgentSession's local prompt contract:
|
|
204
|
-
* they fire synchronously while the response frame is dispatched — before any
|
|
205
|
-
* queued message_start event — so optimistic-echo eligibility is settled in wire
|
|
206
|
-
* order. A success response without a disposition (older host) maps to "handled"
|
|
207
|
-
* so the echo degrades to canonical-only rendering instead of double-rendering.
|
|
208
|
-
*/
|
|
209
|
-
async prompt(message, options) {
|
|
199
|
+
async prompt(message, optionsOrImages) {
|
|
200
|
+
const options = Array.isArray(optionsOrImages)
|
|
201
|
+
? { images: optionsOrImages }
|
|
202
|
+
: (optionsOrImages ?? {});
|
|
210
203
|
const response = await this.send({
|
|
211
204
|
type: "prompt",
|
|
212
205
|
message,
|
|
213
|
-
...(options
|
|
214
|
-
...(options
|
|
215
|
-
...(options
|
|
206
|
+
...(options.images ? { images: options.images } : {}),
|
|
207
|
+
...(options.streamingBehavior ? { streamingBehavior: options.streamingBehavior } : {}),
|
|
208
|
+
...(options.thinkingLevel ? { thinkingLevel: options.thinkingLevel } : {}),
|
|
209
|
+
...(options.expandPromptTemplates !== undefined
|
|
210
|
+
? { expandPromptTemplates: options.expandPromptTemplates }
|
|
211
|
+
: {}),
|
|
216
212
|
}, true, {
|
|
217
213
|
onResponse: (wireResponse) => {
|
|
218
214
|
if (!wireResponse.success) {
|
|
@@ -231,17 +227,26 @@ export class RpcClient {
|
|
|
231
227
|
throw new Error(response.error);
|
|
232
228
|
}
|
|
233
229
|
}
|
|
230
|
+
async appendUserMessage(content) {
|
|
231
|
+
await this.send({ type: "append_user_message", content });
|
|
232
|
+
}
|
|
233
|
+
async appendSessionEntry(entry) {
|
|
234
|
+
await this.send({ type: "append_session_entry", entry });
|
|
235
|
+
}
|
|
236
|
+
async sendCustomMessage(message, options) {
|
|
237
|
+
await this.send({ type: "send_custom_message", ...message, ...options });
|
|
238
|
+
}
|
|
234
239
|
/**
|
|
235
240
|
* Queue a steering message to interrupt the agent mid-run.
|
|
236
241
|
*/
|
|
237
|
-
async steer(message, images) {
|
|
238
|
-
await this.send({ type: "steer", message, images });
|
|
242
|
+
async steer(message, images, recovery) {
|
|
243
|
+
await this.send({ type: "steer", message, images, enqueueOrder: recovery?.enqueueOrder });
|
|
239
244
|
}
|
|
240
245
|
/**
|
|
241
246
|
* Queue a follow-up message to be processed after the agent finishes.
|
|
242
247
|
*/
|
|
243
|
-
async followUp(message, images) {
|
|
244
|
-
await this.send({ type: "follow_up", message, images });
|
|
248
|
+
async followUp(message, images, recovery) {
|
|
249
|
+
await this.send({ type: "follow_up", message, images, enqueueOrder: recovery?.enqueueOrder });
|
|
245
250
|
}
|
|
246
251
|
/**
|
|
247
252
|
* Abort current operation.
|
|
@@ -249,13 +254,41 @@ export class RpcClient {
|
|
|
249
254
|
async abort() {
|
|
250
255
|
await this.send({ type: "abort" });
|
|
251
256
|
}
|
|
257
|
+
async abortCompaction() {
|
|
258
|
+
await this.send({ type: "abort_compaction" });
|
|
259
|
+
}
|
|
260
|
+
async reload() {
|
|
261
|
+
const response = await this.send({ type: "reload" });
|
|
262
|
+
return this.getData(response);
|
|
263
|
+
}
|
|
264
|
+
async checkReloadVeto() {
|
|
265
|
+
const response = await this.send({ type: "check_reload_veto" });
|
|
266
|
+
return this.getData(response);
|
|
267
|
+
}
|
|
252
268
|
/**
|
|
253
269
|
* Clear queued steering and follow-up messages, returning their text.
|
|
254
270
|
*/
|
|
255
|
-
async clearQueue() {
|
|
256
|
-
const response = await this.send({ type: "clear_queue" });
|
|
271
|
+
async clearQueue(options) {
|
|
272
|
+
const response = await this.send({ type: "clear_queue", abortWillFollow: options?.abortWillFollow });
|
|
257
273
|
return this.getData(response);
|
|
258
274
|
}
|
|
275
|
+
async getSteeringMessages() {
|
|
276
|
+
const response = await this.send({ type: "get_steering_messages" });
|
|
277
|
+
return this.getData(response).messages;
|
|
278
|
+
}
|
|
279
|
+
async getFollowUpMessages() {
|
|
280
|
+
const response = await this.send({ type: "get_follow_up_messages" });
|
|
281
|
+
return this.getData(response).messages;
|
|
282
|
+
}
|
|
283
|
+
async abortBranchSummary() {
|
|
284
|
+
await this.send({ type: "abort_branch_summary" });
|
|
285
|
+
}
|
|
286
|
+
async recordBashResult(command, result, excludeFromContext) {
|
|
287
|
+
await this.send({ type: "record_bash_result", command, result, excludeFromContext });
|
|
288
|
+
}
|
|
289
|
+
async setLabel(entryId, label) {
|
|
290
|
+
await this.send({ type: "set_label", entryId, label });
|
|
291
|
+
}
|
|
259
292
|
/**
|
|
260
293
|
* Start a new session, optionally with parent tracking.
|
|
261
294
|
* @param parentSession - Optional parent session path for lineage tracking
|
|
@@ -376,8 +409,17 @@ export class RpcClient {
|
|
|
376
409
|
/**
|
|
377
410
|
* Execute a bash command.
|
|
378
411
|
*/
|
|
379
|
-
async bash(command) {
|
|
380
|
-
const response = await this.send({
|
|
412
|
+
async bash(command, options) {
|
|
413
|
+
const response = await this.send({
|
|
414
|
+
type: "bash",
|
|
415
|
+
command,
|
|
416
|
+
excludeFromContext: options?.excludeFromContext,
|
|
417
|
+
operations: options?.operations,
|
|
418
|
+
});
|
|
419
|
+
return this.getData(response);
|
|
420
|
+
}
|
|
421
|
+
async navigateTree(targetId, options) {
|
|
422
|
+
const response = await this.send({ type: "navigate_tree", targetId, ...options });
|
|
381
423
|
return this.getData(response);
|
|
382
424
|
}
|
|
383
425
|
/**
|
|
@@ -400,20 +442,24 @@ export class RpcClient {
|
|
|
400
442
|
const response = await this.send({ type: "export_html", outputPath });
|
|
401
443
|
return this.getData(response);
|
|
402
444
|
}
|
|
445
|
+
async exportJsonl(outputPath) {
|
|
446
|
+
const response = await this.send({ type: "export_jsonl", outputPath });
|
|
447
|
+
return this.getData(response);
|
|
448
|
+
}
|
|
403
449
|
/**
|
|
404
450
|
* Switch to a different session file.
|
|
405
451
|
* @returns Object with `cancelled: true` if an extension cancelled the switch
|
|
406
452
|
*/
|
|
407
|
-
async switchSession(sessionPath) {
|
|
408
|
-
const response = await this.send({ type: "switch_session", sessionPath });
|
|
453
|
+
async switchSession(sessionPath, options) {
|
|
454
|
+
const response = await this.send({ type: "switch_session", sessionPath, cwdOverride: options?.cwdOverride });
|
|
409
455
|
return this.getData(response);
|
|
410
456
|
}
|
|
411
457
|
/**
|
|
412
458
|
* Fork from a specific message.
|
|
413
459
|
* @returns Object with `text` (the message text) and `cancelled` (if extension cancelled)
|
|
414
460
|
*/
|
|
415
|
-
async fork(entryId) {
|
|
416
|
-
const response = await this.send({ type: "fork", entryId });
|
|
461
|
+
async fork(entryId, options) {
|
|
462
|
+
const response = await this.send({ type: "fork", entryId, position: options?.position });
|
|
417
463
|
return this.getData(response);
|
|
418
464
|
}
|
|
419
465
|
/**
|
|
@@ -458,6 +504,10 @@ export class RpcClient {
|
|
|
458
504
|
async setSessionName(name) {
|
|
459
505
|
await this.send({ type: "set_session_name", name });
|
|
460
506
|
}
|
|
507
|
+
async importJsonl(inputPath, cwdOverride) {
|
|
508
|
+
const response = await this.send({ type: "import_jsonl", inputPath, cwdOverride });
|
|
509
|
+
return this.getData(response);
|
|
510
|
+
}
|
|
461
511
|
/**
|
|
462
512
|
* Get all messages in the session.
|
|
463
513
|
*/
|
|
@@ -527,7 +577,10 @@ export class RpcClient {
|
|
|
527
577
|
reject(new Error(`Timeout collecting events. Stderr: ${this.stderr}`));
|
|
528
578
|
}, timeout);
|
|
529
579
|
const unsubscribe = this.onEvent((event) => {
|
|
530
|
-
if (isProviderAccountEvent(event) ||
|
|
580
|
+
if (isProviderAccountEvent(event) ||
|
|
581
|
+
event.type === "extension_event" ||
|
|
582
|
+
event.type === "bash_start" ||
|
|
583
|
+
event.type === "bash_end")
|
|
531
584
|
return;
|
|
532
585
|
events.push(event);
|
|
533
586
|
if (event.type === "agent_settled") {
|
|
@@ -637,6 +690,7 @@ export class RpcClient {
|
|
|
637
690
|
const writeError = error instanceof Error ? error : new Error(String(error));
|
|
638
691
|
const pending = this.pendingRequests.get(id);
|
|
639
692
|
this.pendingRequests.delete(id);
|
|
693
|
+
pending?.onReject?.(writeError);
|
|
640
694
|
pending?.reject(writeError);
|
|
641
695
|
}
|
|
642
696
|
});
|
|
@@ -644,6 +698,9 @@ export class RpcClient {
|
|
|
644
698
|
getData(response) {
|
|
645
699
|
if (!response.success) {
|
|
646
700
|
const errorResponse = response;
|
|
701
|
+
if (errorResponse.errorCode === "missing_session_cwd" && errorResponse.errorData) {
|
|
702
|
+
throw new MissingSessionCwdError(errorResponse.errorData);
|
|
703
|
+
}
|
|
647
704
|
throw new Error(errorResponse.error);
|
|
648
705
|
}
|
|
649
706
|
// Type assertion: we trust response.data matches T based on the command sent.
|