@robota-sdk/agent-framework 3.0.0-beta.64
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/LICENSE +21 -0
- package/README.md +513 -0
- package/dist/node/index.cjs +100 -0
- package/dist/node/index.d.ts +2966 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +101 -0
- package/dist/node/index.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,2966 @@
|
|
|
1
|
+
import { FileSessionLogger, ICompactEvent, ISessionLogger, ISessionReplayValidationResult, ITerminalOutput, Session, TPermissionHandler } from "@robota-sdk/agent-session";
|
|
2
|
+
import { IAIProvider, IContextWindowState, IFileSystem, IFileSystemAsync, IHistoryEntry, IHookInput, IHookResult, IHookTypeExecutor, IProviderConfig, IProviderDefinition, IProviderDefinition as IProviderDefinition$1, IProviderModelCatalog, IProviderProbeResult, IProviderProfileConfig, ISession, ITerminalOutput as ITerminalOutput$1, ITerminalOutput as ITerminalOutput$2, IToolSchema, IToolWithEventService, THookDefinition, THooksConfig, TPermissionMode, TSessionEndReason, TToolArgs, TTrustLevel, TUniversalMessage, TUniversalValue, findProviderDefinition, formatEnvReference, getProviderCredentialRequirement, hasUsableSecretReference, isEnvReference, resolveEnvReference } from "@robota-sdk/agent-core";
|
|
3
|
+
import { IConfigurableTransport, ITransportAdapter, ITransportAdapter as ITransportAdapter$1, ITransportConfig } from "@robota-sdk/agent-interface-transport";
|
|
4
|
+
import { IAgentBackgroundTaskRequest, IBackgroundTaskError, IBackgroundTaskError as IBackgroundTaskError$1, IBackgroundTaskHandle, IBackgroundTaskInput, IBackgroundTaskListFilter, IBackgroundTaskLogCursor, IBackgroundTaskLogCursor as IBackgroundTaskLogCursor$1, IBackgroundTaskLogPage, IBackgroundTaskManager, IBackgroundTaskManager as IBackgroundTaskManager$1, IBackgroundTaskManagerOptions, IBackgroundTaskResult, IBackgroundTaskRunner, IBackgroundTaskStart, IBackgroundTaskState, IBackgroundTaskState as IBackgroundTaskState$1, IBaseBackgroundTaskRequest, ICreateLimitedOutputCaptureOptions, ILimitedOutputCapture, IPreparedSubagentWorktree, IProcessBackgroundTaskRequest, ISerializableProviderProfile, ISubagentJobHandle, ISubagentJobResult, ISubagentJobStart, ISubagentJobState, ISubagentManager, ISubagentManagerOptions, ISubagentRunner, ISubagentRunner as ISubagentRunner$1, ISubagentSpawnRequest, ISubagentWorktreeAdapter, ISubagentWorktreePrepareRequest, IWorktreeSubagentRunnerOptions, TBackgroundPermissionPolicy, TBackgroundPermissionPolicy as TBackgroundPermissionPolicy$1, TBackgroundPrimitive, TBackgroundPrimitive as TBackgroundPrimitive$1, TBackgroundTaskErrorCategory, TBackgroundTaskEvent, TBackgroundTaskEventListener, TBackgroundTaskIdFactory, TBackgroundTaskIsolation, TBackgroundTaskIsolation as TBackgroundTaskIsolation$1, TBackgroundTaskKind, TBackgroundTaskKind as TBackgroundTaskKind$1, TBackgroundTaskMode, TBackgroundTaskMode as TBackgroundTaskMode$1, TBackgroundTaskRequest, TBackgroundTaskRunnerEvent, TBackgroundTaskStatus, TBackgroundTaskStatus as TBackgroundTaskStatus$1, TBackgroundTaskTimeoutReason, TBackgroundTaskTransitionEvent, TSubagentJobMode, TSubagentJobStatus } from "@robota-sdk/agent-executor";
|
|
5
|
+
import { ISandboxClient, IWorkspaceManifest, createZodFunctionTool } from "@robota-sdk/agent-tools";
|
|
6
|
+
|
|
7
|
+
//#region src/background-tasks/background-job-orchestrator.d.ts
|
|
8
|
+
type TBackgroundJobWaitPolicy = 'detached' | 'wait_all' | 'wait_any' | 'manual';
|
|
9
|
+
type TBackgroundJobGroupStatus = 'running' | 'completed';
|
|
10
|
+
interface IBackgroundJobResultEnvelope {
|
|
11
|
+
taskId: string;
|
|
12
|
+
label: string;
|
|
13
|
+
status: TBackgroundTaskStatus$1;
|
|
14
|
+
summary?: string;
|
|
15
|
+
outputRef?: string;
|
|
16
|
+
error?: IBackgroundTaskError$1;
|
|
17
|
+
startedAt?: string;
|
|
18
|
+
completedAt?: string;
|
|
19
|
+
}
|
|
20
|
+
interface IBackgroundJobGroupState {
|
|
21
|
+
id: string;
|
|
22
|
+
parentSessionId: string;
|
|
23
|
+
waitPolicy: TBackgroundJobWaitPolicy;
|
|
24
|
+
taskIds: string[];
|
|
25
|
+
status: TBackgroundJobGroupStatus;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
label?: string;
|
|
29
|
+
completedAt?: string;
|
|
30
|
+
results: IBackgroundJobResultEnvelope[];
|
|
31
|
+
}
|
|
32
|
+
interface IBackgroundJobGroupSummary {
|
|
33
|
+
groupId: string;
|
|
34
|
+
status: TBackgroundJobGroupStatus;
|
|
35
|
+
total: number;
|
|
36
|
+
completed: number;
|
|
37
|
+
failed: number;
|
|
38
|
+
cancelled: number;
|
|
39
|
+
pending: number;
|
|
40
|
+
lines: string[];
|
|
41
|
+
}
|
|
42
|
+
interface IBackgroundJobGroupCreateRequest {
|
|
43
|
+
parentSessionId: string;
|
|
44
|
+
waitPolicy: TBackgroundJobWaitPolicy;
|
|
45
|
+
taskIds: string[];
|
|
46
|
+
label?: string;
|
|
47
|
+
}
|
|
48
|
+
type TBackgroundJobGroupEvent = {
|
|
49
|
+
type: 'background_job_group_created';
|
|
50
|
+
group: IBackgroundJobGroupState;
|
|
51
|
+
} | {
|
|
52
|
+
type: 'background_job_group_updated';
|
|
53
|
+
group: IBackgroundJobGroupState;
|
|
54
|
+
} | {
|
|
55
|
+
type: 'background_job_group_completed';
|
|
56
|
+
group: IBackgroundJobGroupState;
|
|
57
|
+
};
|
|
58
|
+
type TBackgroundJobGroupEventListener = (event: TBackgroundJobGroupEvent) => void;
|
|
59
|
+
type TBackgroundJobGroupIdFactory = (request: IBackgroundJobGroupCreateRequest) => string;
|
|
60
|
+
interface IBackgroundJobOrchestratorOptions {
|
|
61
|
+
manager: IBackgroundTaskManager$1;
|
|
62
|
+
now?: () => string;
|
|
63
|
+
idFactory?: TBackgroundJobGroupIdFactory;
|
|
64
|
+
initialGroups?: readonly IBackgroundJobGroupState[];
|
|
65
|
+
}
|
|
66
|
+
declare class BackgroundJobOrchestrator {
|
|
67
|
+
private readonly manager;
|
|
68
|
+
private readonly now;
|
|
69
|
+
private readonly idFactory;
|
|
70
|
+
private readonly unsubscribeManager;
|
|
71
|
+
private readonly listeners;
|
|
72
|
+
private readonly groups;
|
|
73
|
+
private sequence;
|
|
74
|
+
constructor(options: IBackgroundJobOrchestratorOptions);
|
|
75
|
+
createGroup(request: IBackgroundJobGroupCreateRequest): IBackgroundJobGroupState;
|
|
76
|
+
listGroups(): IBackgroundJobGroupState[];
|
|
77
|
+
getGroup(groupId: string): IBackgroundJobGroupState | undefined;
|
|
78
|
+
waitGroup(groupId: string): Promise<IBackgroundJobGroupState>;
|
|
79
|
+
subscribe(listener: TBackgroundJobGroupEventListener): () => void;
|
|
80
|
+
dispose(): void;
|
|
81
|
+
private nextGroupId;
|
|
82
|
+
private restoreGroup;
|
|
83
|
+
private createRecord;
|
|
84
|
+
private captureExistingTerminalTasks;
|
|
85
|
+
private handleTaskEvent;
|
|
86
|
+
private captureTask;
|
|
87
|
+
private evaluateCompletion;
|
|
88
|
+
private emit;
|
|
89
|
+
}
|
|
90
|
+
declare function summarizeBackgroundJobGroup(group: IBackgroundJobGroupState): IBackgroundJobGroupSummary;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/background-tasks/execution-workspace-types.d.ts
|
|
93
|
+
declare const EXECUTION_ORIGIN_METADATA_KEYS: {
|
|
94
|
+
readonly kind: "executionOriginKind";
|
|
95
|
+
readonly sessionId: "executionOriginSessionId";
|
|
96
|
+
readonly turnId: "executionOriginTurnId";
|
|
97
|
+
readonly commandName: "executionOriginCommandName";
|
|
98
|
+
readonly toolCallId: "executionOriginToolCallId";
|
|
99
|
+
readonly skillId: "executionOriginSkillId";
|
|
100
|
+
readonly label: "executionOriginLabel";
|
|
101
|
+
};
|
|
102
|
+
type TExecutionEntryKind = 'main_thread' | 'background_task' | 'background_group';
|
|
103
|
+
type TExecutionWorkspaceStatus = 'active' | 'idle' | TBackgroundTaskStatus$1;
|
|
104
|
+
type TExecutionAttention = 'none' | 'unread' | 'failed' | 'permission' | 'completed';
|
|
105
|
+
type TExecutionWorkspaceVisibility = 'default' | 'collapsed';
|
|
106
|
+
type TExecutionControl = 'select' | 'cancel' | 'close' | 'send' | 'read_log' | 'wait';
|
|
107
|
+
type TExecutionOriginKind = 'user_prompt' | 'slash_command' | 'model_command' | 'tool_call' | 'skill' | 'transport' | 'system';
|
|
108
|
+
type TExecutionDetailRecordKind = 'message' | 'tool_activity' | 'process_output' | 'progress' | 'result' | 'error' | 'group_summary';
|
|
109
|
+
type TExecutionWorkspaceUpdateCause = 'main_thread' | 'background_task' | 'background_group';
|
|
110
|
+
interface IExecutionOrigin {
|
|
111
|
+
readonly kind: TExecutionOriginKind;
|
|
112
|
+
readonly sessionId: string;
|
|
113
|
+
readonly turnId?: string;
|
|
114
|
+
readonly commandName?: string;
|
|
115
|
+
readonly toolCallId?: string;
|
|
116
|
+
readonly skillId?: string;
|
|
117
|
+
readonly label?: string;
|
|
118
|
+
}
|
|
119
|
+
interface IExecutionWorkspaceEntry {
|
|
120
|
+
readonly id: string;
|
|
121
|
+
readonly sourceId: string;
|
|
122
|
+
readonly kind: TExecutionEntryKind;
|
|
123
|
+
readonly parentId?: string;
|
|
124
|
+
readonly groupId?: string;
|
|
125
|
+
readonly origin: IExecutionOrigin;
|
|
126
|
+
readonly taskKind?: TBackgroundTaskKind$1;
|
|
127
|
+
readonly status: TExecutionWorkspaceStatus;
|
|
128
|
+
readonly title: string;
|
|
129
|
+
readonly subtitle?: string;
|
|
130
|
+
readonly preview?: string;
|
|
131
|
+
readonly currentAction?: string;
|
|
132
|
+
readonly unread: boolean;
|
|
133
|
+
readonly attention: TExecutionAttention;
|
|
134
|
+
readonly visibility: TExecutionWorkspaceVisibility;
|
|
135
|
+
readonly updatedAt: string;
|
|
136
|
+
readonly controls: readonly TExecutionControl[];
|
|
137
|
+
}
|
|
138
|
+
interface IExecutionWorkspaceFilter {
|
|
139
|
+
readonly includeMainThread?: boolean;
|
|
140
|
+
readonly kinds?: readonly TExecutionEntryKind[];
|
|
141
|
+
readonly visibility?: readonly TExecutionWorkspaceVisibility[];
|
|
142
|
+
}
|
|
143
|
+
interface IExecutionWorkspaceSnapshot {
|
|
144
|
+
readonly sessionId: string;
|
|
145
|
+
readonly selectedEntryId?: string;
|
|
146
|
+
readonly updatedAt: string;
|
|
147
|
+
readonly entries: readonly IExecutionWorkspaceEntry[];
|
|
148
|
+
}
|
|
149
|
+
interface IExecutionWorkspaceSnapshotOptions {
|
|
150
|
+
readonly selectedEntryId?: string;
|
|
151
|
+
readonly filter?: IExecutionWorkspaceFilter;
|
|
152
|
+
}
|
|
153
|
+
interface IExecutionWorkspaceEvent {
|
|
154
|
+
readonly type: 'execution_workspace_updated';
|
|
155
|
+
readonly cause: TExecutionWorkspaceUpdateCause;
|
|
156
|
+
readonly entryId?: string;
|
|
157
|
+
readonly snapshot: IExecutionWorkspaceSnapshot;
|
|
158
|
+
}
|
|
159
|
+
interface IExecutionDetailCursor {
|
|
160
|
+
readonly offset: number;
|
|
161
|
+
}
|
|
162
|
+
interface IExecutionDetailRecord {
|
|
163
|
+
readonly id: string;
|
|
164
|
+
readonly kind: TExecutionDetailRecordKind;
|
|
165
|
+
readonly text: string;
|
|
166
|
+
readonly timestamp?: string;
|
|
167
|
+
readonly sourceId?: string;
|
|
168
|
+
}
|
|
169
|
+
interface IExecutionDetailPage {
|
|
170
|
+
readonly entryId: string;
|
|
171
|
+
readonly cursor?: IExecutionDetailCursor;
|
|
172
|
+
readonly nextCursor?: IExecutionDetailCursor;
|
|
173
|
+
readonly records: readonly IExecutionDetailRecord[];
|
|
174
|
+
}
|
|
175
|
+
interface ICreateMainThreadEntryInput {
|
|
176
|
+
readonly sessionId: string;
|
|
177
|
+
readonly isExecuting: boolean;
|
|
178
|
+
readonly hasPendingPrompt: boolean;
|
|
179
|
+
readonly historyLength: number;
|
|
180
|
+
readonly updatedAt: string;
|
|
181
|
+
readonly preview?: string;
|
|
182
|
+
}
|
|
183
|
+
interface ICreateExecutionWorkspaceSnapshotInput {
|
|
184
|
+
readonly sessionId: string;
|
|
185
|
+
readonly mainThread: ICreateMainThreadEntryInput;
|
|
186
|
+
readonly tasks: readonly IBackgroundTaskState$1[];
|
|
187
|
+
readonly groups: readonly IBackgroundJobGroupState[];
|
|
188
|
+
readonly selectedEntryId?: string;
|
|
189
|
+
readonly filter?: IExecutionWorkspaceFilter;
|
|
190
|
+
}
|
|
191
|
+
interface IExecutionWorkspaceEntryRef {
|
|
192
|
+
readonly kind: TExecutionEntryKind;
|
|
193
|
+
readonly sourceId: string;
|
|
194
|
+
}
|
|
195
|
+
interface ICreateMainThreadDetailPageInput {
|
|
196
|
+
readonly entryId: string;
|
|
197
|
+
readonly history: readonly IHistoryEntry[];
|
|
198
|
+
readonly cursor?: IExecutionDetailCursor;
|
|
199
|
+
}
|
|
200
|
+
interface ICreateLineDetailPageInput {
|
|
201
|
+
readonly entryId: string;
|
|
202
|
+
readonly lines: readonly string[];
|
|
203
|
+
readonly cursor?: IBackgroundTaskLogCursor$1;
|
|
204
|
+
readonly nextCursor?: IBackgroundTaskLogCursor$1;
|
|
205
|
+
readonly kind?: TExecutionDetailRecordKind;
|
|
206
|
+
}
|
|
207
|
+
declare function createMainThreadExecutionEntryId(sessionId: string): string;
|
|
208
|
+
declare function createBackgroundTaskExecutionEntryId(taskId: string): string;
|
|
209
|
+
declare function createBackgroundGroupExecutionEntryId(groupId: string): string;
|
|
210
|
+
declare function parseExecutionWorkspaceEntryId(entryId: string): IExecutionWorkspaceEntryRef | undefined;
|
|
211
|
+
declare function createExecutionOriginMetadata(origin: IExecutionOrigin): Record<string, TBackgroundPrimitive$1>;
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/background-tasks/execution-workspace-projection.d.ts
|
|
214
|
+
declare function createExecutionWorkspaceSnapshot(input: ICreateExecutionWorkspaceSnapshotInput): IExecutionWorkspaceSnapshot;
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region src/background-tasks/execution-workspace-detail.d.ts
|
|
217
|
+
declare function createMainThreadDetailPage(input: ICreateMainThreadDetailPageInput): IExecutionDetailPage;
|
|
218
|
+
declare function createLineDetailPage(input: ICreateLineDetailPageInput): IExecutionDetailPage;
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/background-tasks/execution-workspace-spawner.d.ts
|
|
221
|
+
interface ISpawnAgentTaskRequest {
|
|
222
|
+
readonly label: string;
|
|
223
|
+
readonly agentType: string;
|
|
224
|
+
readonly prompt: string;
|
|
225
|
+
readonly mode?: TBackgroundTaskMode$1;
|
|
226
|
+
readonly parentTaskId?: string;
|
|
227
|
+
readonly depth?: number;
|
|
228
|
+
readonly cwd?: string;
|
|
229
|
+
readonly model?: string;
|
|
230
|
+
readonly isolation?: TBackgroundTaskIsolation$1;
|
|
231
|
+
readonly allowedTools?: readonly string[];
|
|
232
|
+
readonly disallowedTools?: readonly string[];
|
|
233
|
+
readonly permissionPolicy?: TBackgroundPermissionPolicy$1;
|
|
234
|
+
readonly timeoutMs?: number;
|
|
235
|
+
readonly idleTimeoutMs?: number;
|
|
236
|
+
readonly maxRuntimeMs?: number;
|
|
237
|
+
readonly outputLimitBytes?: number;
|
|
238
|
+
readonly maxTextDeltas?: number;
|
|
239
|
+
readonly repetitionWindow?: number;
|
|
240
|
+
readonly repetitionThreshold?: number;
|
|
241
|
+
}
|
|
242
|
+
interface ISpawnProcessTaskRequest {
|
|
243
|
+
readonly command: string;
|
|
244
|
+
readonly label?: string;
|
|
245
|
+
readonly mode?: TBackgroundTaskMode$1;
|
|
246
|
+
readonly parentTaskId?: string;
|
|
247
|
+
readonly depth?: number;
|
|
248
|
+
readonly cwd?: string;
|
|
249
|
+
readonly shell?: string;
|
|
250
|
+
readonly env?: Record<string, string>;
|
|
251
|
+
readonly stdin?: string;
|
|
252
|
+
readonly timeoutMs?: number;
|
|
253
|
+
readonly idleTimeoutMs?: number;
|
|
254
|
+
readonly maxRuntimeMs?: number;
|
|
255
|
+
readonly outputLimitBytes?: number;
|
|
256
|
+
}
|
|
257
|
+
interface IBackgroundTaskSpawnerGroupRequest {
|
|
258
|
+
readonly waitPolicy: IBackgroundJobGroupCreateRequest['waitPolicy'];
|
|
259
|
+
readonly taskIds: readonly string[];
|
|
260
|
+
readonly label?: string;
|
|
261
|
+
}
|
|
262
|
+
interface IExecutionWorkspaceTaskSpawner {
|
|
263
|
+
spawnAgent(request: ISpawnAgentTaskRequest): Promise<IBackgroundTaskState$1>;
|
|
264
|
+
spawnProcess(request: ISpawnProcessTaskRequest): Promise<IBackgroundTaskState$1>;
|
|
265
|
+
createGroup(request: IBackgroundTaskSpawnerGroupRequest): IBackgroundJobGroupState;
|
|
266
|
+
}
|
|
267
|
+
interface ICreateExecutionWorkspaceTaskSpawnerOptions {
|
|
268
|
+
readonly manager: IBackgroundTaskManager$1;
|
|
269
|
+
readonly groupOrchestrator: BackgroundJobOrchestrator;
|
|
270
|
+
readonly sessionId: string;
|
|
271
|
+
readonly cwd: string;
|
|
272
|
+
readonly origin: IExecutionOrigin;
|
|
273
|
+
}
|
|
274
|
+
declare function createExecutionWorkspaceTaskSpawner(options: ICreateExecutionWorkspaceTaskSpawnerOptions): IExecutionWorkspaceTaskSpawner;
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region src/capabilities/types.d.ts
|
|
277
|
+
type TCapabilityKind = 'builtin-command' | 'skill' | 'agent' | 'tool';
|
|
278
|
+
type TCapabilitySafety = 'read-only' | 'write' | 'process' | 'network' | 'background-agent';
|
|
279
|
+
interface ICapabilityDescriptor {
|
|
280
|
+
readonly name: string;
|
|
281
|
+
readonly kind: TCapabilityKind;
|
|
282
|
+
readonly description: string;
|
|
283
|
+
readonly userInvocable: boolean;
|
|
284
|
+
readonly modelInvocable: boolean;
|
|
285
|
+
readonly argumentHint?: string;
|
|
286
|
+
readonly safety?: TCapabilitySafety;
|
|
287
|
+
}
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/command-api/types.d.ts
|
|
290
|
+
/** A command entry */
|
|
291
|
+
interface ICommand {
|
|
292
|
+
/** Command name without slash (e.g., "mode") — used for invocation */
|
|
293
|
+
name: string;
|
|
294
|
+
/** User-friendly display label (e.g., "Interaction Mode"). Falls back to `name` if not set. */
|
|
295
|
+
displayName?: string;
|
|
296
|
+
/** Short description shown in autocomplete */
|
|
297
|
+
description: string;
|
|
298
|
+
/** Source identifier (e.g., "builtin", "skill") */
|
|
299
|
+
source: string;
|
|
300
|
+
/** Subcommands for hierarchical menus */
|
|
301
|
+
subcommands?: ICommand[];
|
|
302
|
+
/** Execute the command. Args is everything after the command name. */
|
|
303
|
+
execute?: (args: string) => void | Promise<void>;
|
|
304
|
+
/** Full SKILL.md content (only for skill commands) */
|
|
305
|
+
skillContent?: string;
|
|
306
|
+
/** Hint for the expected argument (Claude Code frontmatter) */
|
|
307
|
+
argumentHint?: string;
|
|
308
|
+
/** When true, models cannot invoke this skill autonomously */
|
|
309
|
+
disableModelInvocation?: boolean;
|
|
310
|
+
/** When true, models may invoke this command through the SDK-projected command tool */
|
|
311
|
+
modelInvocable?: boolean;
|
|
312
|
+
/** When false, users cannot invoke this skill directly */
|
|
313
|
+
userInvocable?: boolean;
|
|
314
|
+
/** Safety category for model-visible capability descriptors */
|
|
315
|
+
safety?: TCapabilitySafety;
|
|
316
|
+
/** List of tools this skill is allowed to use */
|
|
317
|
+
allowedTools?: string[];
|
|
318
|
+
/** Preferred model for executing this skill */
|
|
319
|
+
model?: string;
|
|
320
|
+
/** Effort level hint for the skill */
|
|
321
|
+
effort?: string;
|
|
322
|
+
/** Context scope for the skill (e.g., "project") */
|
|
323
|
+
context?: string;
|
|
324
|
+
/** Agent identity to use when executing this skill */
|
|
325
|
+
agent?: string;
|
|
326
|
+
/** Plugin installation directory (plugin skills/commands only) */
|
|
327
|
+
pluginDir?: string;
|
|
328
|
+
}
|
|
329
|
+
/** A source that provides commands */
|
|
330
|
+
interface ICommandSource {
|
|
331
|
+
name: string;
|
|
332
|
+
getCommands(): ICommand[];
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/command-api/statusline/statusline-command-api.d.ts
|
|
336
|
+
declare const STATUSLINE_COMMAND_DESCRIPTION = "Configure TUI status-line visibility and fields such as model, context, tokens, session, and git branch.";
|
|
337
|
+
declare const STATUSLINE_COMMAND_ARGUMENT_HINT = "on | off | reset | git on | git off";
|
|
338
|
+
interface IStatusLineCommandSettings {
|
|
339
|
+
enabled: boolean;
|
|
340
|
+
gitBranch: boolean;
|
|
341
|
+
}
|
|
342
|
+
type TStatusLineCommandSettingsPatch = Partial<IStatusLineCommandSettings> & Record<string, TUniversalValue>;
|
|
343
|
+
declare const DEFAULT_STATUS_LINE_COMMAND_SETTINGS: Readonly<IStatusLineCommandSettings>;
|
|
344
|
+
declare function buildStatusLineCommandSubcommands(source?: string): ICommand[];
|
|
345
|
+
declare function isStatusLineCommandSettingsPatch(value: Record<string, TUniversalValue>): value is TStatusLineCommandSettingsPatch;
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region src/command-api/effects.d.ts
|
|
348
|
+
type TCommandEffect = {
|
|
349
|
+
type: 'model-change-requested';
|
|
350
|
+
modelId: string;
|
|
351
|
+
} | {
|
|
352
|
+
type: 'language-change-requested';
|
|
353
|
+
language: string;
|
|
354
|
+
} | {
|
|
355
|
+
type: 'settings-reset-requested';
|
|
356
|
+
} | {
|
|
357
|
+
type: 'session-exit-requested';
|
|
358
|
+
reason?: TSessionEndReason;
|
|
359
|
+
message?: string;
|
|
360
|
+
} | {
|
|
361
|
+
type: 'session-restart-requested';
|
|
362
|
+
reason: TSessionEndReason;
|
|
363
|
+
message: string;
|
|
364
|
+
} | {
|
|
365
|
+
type: 'plugin-tui-requested';
|
|
366
|
+
} | {
|
|
367
|
+
type: 'plugin-registry-reload-requested';
|
|
368
|
+
} | {
|
|
369
|
+
type: 'settings-tui-requested';
|
|
370
|
+
} | {
|
|
371
|
+
type: 'session-picker-requested';
|
|
372
|
+
} | {
|
|
373
|
+
type: 'session-renamed';
|
|
374
|
+
name: string;
|
|
375
|
+
} | {
|
|
376
|
+
type: 'conversation-history-cleared';
|
|
377
|
+
} | {
|
|
378
|
+
type: 'session-execution-started';
|
|
379
|
+
} | {
|
|
380
|
+
type: 'statusline-settings-patch';
|
|
381
|
+
patch: TStatusLineCommandSettingsPatch;
|
|
382
|
+
} | {
|
|
383
|
+
type: 'agent-switcher-requested';
|
|
384
|
+
};
|
|
385
|
+
//#endregion
|
|
386
|
+
//#region src/command-api/interactions.d.ts
|
|
387
|
+
/** Choice option for command-owned follow-up prompts. */
|
|
388
|
+
interface ICommandChoicePromptOption {
|
|
389
|
+
value: string;
|
|
390
|
+
label: string;
|
|
391
|
+
}
|
|
392
|
+
/** Generic prompt descriptor rendered by host UIs for command interactions. */
|
|
393
|
+
type TCommandInteractionPrompt = {
|
|
394
|
+
kind: 'choice';
|
|
395
|
+
title: string;
|
|
396
|
+
description?: string;
|
|
397
|
+
options: readonly ICommandChoicePromptOption[];
|
|
398
|
+
maxVisible?: number;
|
|
399
|
+
} | {
|
|
400
|
+
kind: 'text';
|
|
401
|
+
title: string;
|
|
402
|
+
description?: string;
|
|
403
|
+
placeholder?: string;
|
|
404
|
+
allowEmpty?: boolean;
|
|
405
|
+
masked?: boolean;
|
|
406
|
+
validate?: (value: string) => string | undefined;
|
|
407
|
+
};
|
|
408
|
+
/** Stateful command continuation owned by the command module. */
|
|
409
|
+
interface ICommandInteraction {
|
|
410
|
+
prompt: TCommandInteractionPrompt;
|
|
411
|
+
submit(value: string): Promise<ICommandResult> | ICommandResult;
|
|
412
|
+
cancel?(): Promise<ICommandResult> | ICommandResult;
|
|
413
|
+
}
|
|
414
|
+
//#endregion
|
|
415
|
+
//#region src/command-api/command-result.d.ts
|
|
416
|
+
type TCommandResultDataValue = TUniversalValue | Record<string, unknown> | readonly Record<string, unknown>[];
|
|
417
|
+
/** Result of a system command execution. */
|
|
418
|
+
interface ICommandResult {
|
|
419
|
+
/** Human-readable output message */
|
|
420
|
+
message: string;
|
|
421
|
+
/** Command completed successfully */
|
|
422
|
+
success: boolean;
|
|
423
|
+
/** Additional structured data (command-specific diagnostics only) */
|
|
424
|
+
data?: Record<string, unknown>;
|
|
425
|
+
/** Typed host effects requested by the command */
|
|
426
|
+
effects?: readonly TCommandEffect[];
|
|
427
|
+
/** Command-owned follow-up prompt and continuation */
|
|
428
|
+
interaction?: ICommandInteraction;
|
|
429
|
+
}
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region src/agents/agent-definition-types.d.ts
|
|
432
|
+
/**
|
|
433
|
+
* Definition of an agent that can be spawned as a subagent.
|
|
434
|
+
*
|
|
435
|
+
* Built-in agents and custom (user-defined) agents share this shape.
|
|
436
|
+
* Optional fields inherit from the parent session when omitted.
|
|
437
|
+
*/
|
|
438
|
+
interface IAgentDefinition {
|
|
439
|
+
/** Unique name used to reference the agent (e.g., 'Explore', 'Plan'). */
|
|
440
|
+
name: string;
|
|
441
|
+
/** Human-readable description of the agent's purpose. */
|
|
442
|
+
description: string;
|
|
443
|
+
/** Markdown body content used as the agent's system prompt. */
|
|
444
|
+
systemPrompt: string;
|
|
445
|
+
/** Model override (e.g., 'claude-haiku-4-5', 'sonnet', 'opus'). Inherits parent model when omitted. */
|
|
446
|
+
model?: string;
|
|
447
|
+
/** Maximum number of agentic turns the subagent may execute. */
|
|
448
|
+
maxTurns?: number;
|
|
449
|
+
/** Allowlist of tool names. Only these tools are available when set. */
|
|
450
|
+
tools?: string[];
|
|
451
|
+
/** Denylist of tool names. These tools are removed from the inherited set. */
|
|
452
|
+
disallowedTools?: string[];
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/config/config-types.d.ts
|
|
456
|
+
/**
|
|
457
|
+
* Fully resolved config after merging all settings files and applying defaults.
|
|
458
|
+
*/
|
|
459
|
+
interface IResolvedConfig {
|
|
460
|
+
defaultTrustLevel: 'safe' | 'moderate' | 'full';
|
|
461
|
+
/** Response language code (e.g., "ko", "en"). Undefined = no language constraint. */
|
|
462
|
+
language?: string;
|
|
463
|
+
/** Active provider profile key when providers/currentProvider are used. */
|
|
464
|
+
currentProvider?: string;
|
|
465
|
+
provider: {
|
|
466
|
+
name: string;
|
|
467
|
+
model: string;
|
|
468
|
+
apiKey: string | undefined;
|
|
469
|
+
baseURL?: string;
|
|
470
|
+
timeout?: number;
|
|
471
|
+
options?: Record<string, TUniversalValue>;
|
|
472
|
+
};
|
|
473
|
+
permissions: {
|
|
474
|
+
allow: string[];
|
|
475
|
+
deny: string[];
|
|
476
|
+
};
|
|
477
|
+
env: Record<string, string>;
|
|
478
|
+
hooks?: THooksConfig;
|
|
479
|
+
/** Plugin enablement map: plugin name -> enabled/disabled */
|
|
480
|
+
enabledPlugins?: Record<string, boolean>;
|
|
481
|
+
/** Extra marketplace sources: name -> { source } */
|
|
482
|
+
extraKnownMarketplaces?: Record<string, {
|
|
483
|
+
source: {
|
|
484
|
+
type: string;
|
|
485
|
+
repo?: string;
|
|
486
|
+
url?: string;
|
|
487
|
+
path?: string;
|
|
488
|
+
ref?: string;
|
|
489
|
+
};
|
|
490
|
+
}>;
|
|
491
|
+
/** Auto-compact threshold as a 0-1 fraction. Set false to disable automatic compaction. */
|
|
492
|
+
autoCompactThreshold?: number | false;
|
|
493
|
+
/** Transport enable/disable + options: transport name -> { enabled, options } */
|
|
494
|
+
transports?: Record<string, {
|
|
495
|
+
enabled?: boolean;
|
|
496
|
+
options?: Record<string, unknown>;
|
|
497
|
+
}>;
|
|
498
|
+
}
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region src/context/context-file-tracker.d.ts
|
|
501
|
+
/** A single context file entry tracked with its content hash. */
|
|
502
|
+
interface IContextFileEntry {
|
|
503
|
+
/** Absolute path to the file. */
|
|
504
|
+
filePath: string;
|
|
505
|
+
/** Content as read at load time. */
|
|
506
|
+
content: string;
|
|
507
|
+
/** SHA-256 hex digest of `content`. */
|
|
508
|
+
contentHash: string;
|
|
509
|
+
}
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region src/context/context-loader.d.ts
|
|
512
|
+
interface ILoadedContext {
|
|
513
|
+
/** Concatenated content of all AGENTS.md files found (root-first) */
|
|
514
|
+
agentsMd: string;
|
|
515
|
+
/** Concatenated content of all CLAUDE.md files found (root-first) */
|
|
516
|
+
claudeMd: string;
|
|
517
|
+
/** Startup project memory index loaded from .robota/memory/MEMORY.md, if present */
|
|
518
|
+
memoryMd?: string;
|
|
519
|
+
/** Formatted active task context loaded from .agents/tasks/*.md, if present */
|
|
520
|
+
taskContext?: string;
|
|
521
|
+
/** Extracted "Compact Instructions" section from CLAUDE.md, if present */
|
|
522
|
+
compactInstructions?: string;
|
|
523
|
+
/** Per-file entries for all AGENTS.md files, root-first. Present for staleness detection. */
|
|
524
|
+
agentsFileEntries?: IContextFileEntry[];
|
|
525
|
+
/** Per-file entries for all CLAUDE.md files, root-first. Present for staleness detection. */
|
|
526
|
+
claudeFileEntries?: IContextFileEntry[];
|
|
527
|
+
}
|
|
528
|
+
//#endregion
|
|
529
|
+
//#region src/assembly/create-subagent-session.d.ts
|
|
530
|
+
/** Options for creating a subagent session. */
|
|
531
|
+
interface ISubagentOptions {
|
|
532
|
+
/** Agent definition (built-in or custom). */
|
|
533
|
+
agentDefinition: IAgentDefinition;
|
|
534
|
+
/** Parent's resolved config (for provider, permissions, etc.). */
|
|
535
|
+
parentConfig: IResolvedConfig;
|
|
536
|
+
/** Parent's loaded context (CLAUDE.md, AGENTS.md). */
|
|
537
|
+
parentContext: ILoadedContext;
|
|
538
|
+
/** Parent session's available tools (to inherit/filter). */
|
|
539
|
+
parentTools: IToolWithEventService[];
|
|
540
|
+
/** AI provider instance. */
|
|
541
|
+
provider: IAIProvider;
|
|
542
|
+
/** Terminal output interface. */
|
|
543
|
+
terminal: ITerminalOutput;
|
|
544
|
+
/** Stable session ID for transcript files. */
|
|
545
|
+
sessionId?: string;
|
|
546
|
+
/** Optional logger for subagent transcripts. */
|
|
547
|
+
sessionLogger?: ISessionLogger;
|
|
548
|
+
/** Whether this is a fork worker (uses fork suffix instead of standard). */
|
|
549
|
+
isForkWorker?: boolean;
|
|
550
|
+
/** Permission mode from parent (bypassPermissions, acceptEdits, etc.). */
|
|
551
|
+
permissionMode?: TPermissionMode;
|
|
552
|
+
/** Permission handler from parent. */
|
|
553
|
+
permissionHandler?: TPermissionHandler;
|
|
554
|
+
/** Plugin hooks configuration from parent session. */
|
|
555
|
+
hooks?: Record<string, unknown>;
|
|
556
|
+
/** Hook type executors from parent session (prompt, agent, etc.). */
|
|
557
|
+
hookTypeExecutors?: IHookTypeExecutor[];
|
|
558
|
+
/** Streaming callback. */
|
|
559
|
+
onTextDelta?: (delta: string) => void;
|
|
560
|
+
/** Tool execution callback. */
|
|
561
|
+
onToolExecution?: (event: {
|
|
562
|
+
type: 'start' | 'end';
|
|
563
|
+
toolName: string;
|
|
564
|
+
toolArgs?: TToolArgs;
|
|
565
|
+
success?: boolean;
|
|
566
|
+
denied?: boolean;
|
|
567
|
+
toolResultData?: string;
|
|
568
|
+
}) => void;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Create a fully-configured Session for subagent execution.
|
|
572
|
+
*
|
|
573
|
+
* Assembles provider, tools, and system prompt from parent context and
|
|
574
|
+
* agent definition, then returns a new Session instance.
|
|
575
|
+
*/
|
|
576
|
+
declare function createSubagentSession(options: ISubagentOptions): Session;
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region src/subagents/in-process-subagent-runner.d.ts
|
|
579
|
+
interface IInProcessSubagentRunnerDeps {
|
|
580
|
+
config: IResolvedConfig;
|
|
581
|
+
context: ILoadedContext;
|
|
582
|
+
tools: IToolWithEventService[];
|
|
583
|
+
terminal: ITerminalOutput$1;
|
|
584
|
+
provider: IAIProvider;
|
|
585
|
+
permissionMode?: TPermissionMode;
|
|
586
|
+
permissionHandler?: TPermissionHandler;
|
|
587
|
+
hooks?: ISubagentOptions['hooks'];
|
|
588
|
+
hookTypeExecutors?: IHookTypeExecutor[];
|
|
589
|
+
onTextDelta?: (delta: string) => void;
|
|
590
|
+
onToolExecution?: (event: {
|
|
591
|
+
type: 'start' | 'end';
|
|
592
|
+
toolName: string;
|
|
593
|
+
toolArgs?: TToolArgs;
|
|
594
|
+
success?: boolean;
|
|
595
|
+
denied?: boolean;
|
|
596
|
+
toolResultData?: string;
|
|
597
|
+
}) => void;
|
|
598
|
+
customAgentRegistry?: (name: string) => IAgentDefinition | undefined;
|
|
599
|
+
}
|
|
600
|
+
type TSubagentRunnerFactory = (deps: IInProcessSubagentRunnerDeps) => ISubagentRunner$1;
|
|
601
|
+
declare function createInProcessSubagentRunner(deps: IInProcessSubagentRunnerDeps): ISubagentRunner$1;
|
|
602
|
+
//#endregion
|
|
603
|
+
//#region src/command-api/plugin/plugin-command-api.d.ts
|
|
604
|
+
declare const PLUGIN_COMMAND_DESCRIPTION = "Manage plugins";
|
|
605
|
+
declare const PLUGIN_COMMAND_ARGUMENT_HINT = "manage | install <name@marketplace> | uninstall <name@marketplace> | enable <name@marketplace> | disable <name@marketplace> | marketplace <action>";
|
|
606
|
+
declare const RELOAD_PLUGINS_COMMAND_DESCRIPTION = "Reload all plugin resources";
|
|
607
|
+
type TPluginInstallScope = 'user' | 'project';
|
|
608
|
+
interface ICommandInstalledPlugin {
|
|
609
|
+
name: string;
|
|
610
|
+
description: string;
|
|
611
|
+
enabled: boolean;
|
|
612
|
+
}
|
|
613
|
+
interface ICommandAvailablePlugin {
|
|
614
|
+
name: string;
|
|
615
|
+
description: string;
|
|
616
|
+
installed: boolean;
|
|
617
|
+
}
|
|
618
|
+
interface ICommandMarketplaceSource {
|
|
619
|
+
name: string;
|
|
620
|
+
type: string;
|
|
621
|
+
}
|
|
622
|
+
interface ICommandPluginReloadResult {
|
|
623
|
+
loadedPluginCount: number;
|
|
624
|
+
}
|
|
625
|
+
interface ICommandPluginAdapter {
|
|
626
|
+
listInstalled(): Promise<readonly ICommandInstalledPlugin[]>;
|
|
627
|
+
listAvailablePlugins(marketplace: string): Promise<readonly ICommandAvailablePlugin[]>;
|
|
628
|
+
install(pluginId: string, scope?: TPluginInstallScope): Promise<void>;
|
|
629
|
+
uninstall(pluginId: string): Promise<void>;
|
|
630
|
+
enable(pluginId: string): Promise<void>;
|
|
631
|
+
disable(pluginId: string): Promise<void>;
|
|
632
|
+
marketplaceAdd(source: string): Promise<string>;
|
|
633
|
+
marketplaceRemove(name: string): Promise<void>;
|
|
634
|
+
marketplaceUpdate(name: string): Promise<void>;
|
|
635
|
+
marketplaceList(): Promise<readonly ICommandMarketplaceSource[]>;
|
|
636
|
+
reloadPlugins(): Promise<ICommandPluginReloadResult>;
|
|
637
|
+
}
|
|
638
|
+
declare function createPluginTuiRequestedEffect(): TCommandEffect;
|
|
639
|
+
declare function createPluginRegistryReloadRequestedEffect(): TCommandEffect;
|
|
640
|
+
declare function resolvePluginCommandAdapter(context: ICommandHostContext): ICommandPluginAdapter | undefined;
|
|
641
|
+
declare function buildPluginCommandSubcommands(): ICommand[];
|
|
642
|
+
//#endregion
|
|
643
|
+
//#region src/command-api/host-adapters.d.ts
|
|
644
|
+
interface ICommandSettingsDocument {
|
|
645
|
+
[key: string]: TUniversalValue;
|
|
646
|
+
}
|
|
647
|
+
interface ICommandSettingsAdapter<TSettings extends ICommandSettingsDocument = ICommandSettingsDocument> {
|
|
648
|
+
read(): TSettings;
|
|
649
|
+
write(settings: TSettings): void;
|
|
650
|
+
}
|
|
651
|
+
interface ICommandProcessAdapter {
|
|
652
|
+
requestExit(reason?: TSessionEndReason): void;
|
|
653
|
+
requestRestart(reason: TSessionEndReason, message: string): void;
|
|
654
|
+
}
|
|
655
|
+
interface ICommandPickerAdapter<TItem extends ICommandSettingsDocument> {
|
|
656
|
+
pick(items: readonly TItem[]): Promise<TItem | undefined> | TItem | undefined;
|
|
657
|
+
}
|
|
658
|
+
interface ICommandPermissionModeAdapter {
|
|
659
|
+
getPermissionMode(): TPermissionMode;
|
|
660
|
+
setPermissionMode(mode: TPermissionMode): void;
|
|
661
|
+
listSessionAllowedTools(): readonly string[];
|
|
662
|
+
}
|
|
663
|
+
interface ICommandHostAdapters {
|
|
664
|
+
settings?: ICommandSettingsAdapter;
|
|
665
|
+
process?: ICommandProcessAdapter;
|
|
666
|
+
permissionMode?: ICommandPermissionModeAdapter;
|
|
667
|
+
plugin?: ICommandPluginAdapter;
|
|
668
|
+
}
|
|
669
|
+
//#endregion
|
|
670
|
+
//#region src/checkpoints/edit-checkpoint-types.d.ts
|
|
671
|
+
interface IEditCheckpointRecorder {
|
|
672
|
+
captureFile(filePath: string): Promise<void> | void;
|
|
673
|
+
}
|
|
674
|
+
interface IEditCheckpointTurnInput {
|
|
675
|
+
sessionId: string;
|
|
676
|
+
prompt: string;
|
|
677
|
+
}
|
|
678
|
+
interface IEditCheckpointSummary {
|
|
679
|
+
id: string;
|
|
680
|
+
sessionId: string;
|
|
681
|
+
sequence: number;
|
|
682
|
+
prompt: string;
|
|
683
|
+
createdAt: string;
|
|
684
|
+
fileCount: number;
|
|
685
|
+
}
|
|
686
|
+
interface IEditCheckpointFileRecord {
|
|
687
|
+
originalPath: string;
|
|
688
|
+
existed: boolean;
|
|
689
|
+
snapshotFile?: string;
|
|
690
|
+
}
|
|
691
|
+
interface IEditCheckpointManifest extends IEditCheckpointSummary {
|
|
692
|
+
version: 1;
|
|
693
|
+
files: IEditCheckpointFileRecord[];
|
|
694
|
+
}
|
|
695
|
+
type TEditCheckpointFileRestoreAction = 'restore-preimage' | 'delete-created-file';
|
|
696
|
+
interface IEditCheckpointFileInspection {
|
|
697
|
+
originalPath: string;
|
|
698
|
+
relativePath: string;
|
|
699
|
+
existed: boolean;
|
|
700
|
+
restoreAction: TEditCheckpointFileRestoreAction;
|
|
701
|
+
snapshotAvailable: boolean;
|
|
702
|
+
snapshotSizeBytes?: number;
|
|
703
|
+
}
|
|
704
|
+
interface IEditCheckpointInspectionPlan {
|
|
705
|
+
checkpointIds: string[];
|
|
706
|
+
fileCount: number;
|
|
707
|
+
}
|
|
708
|
+
interface IEditCheckpointInspection {
|
|
709
|
+
target: IEditCheckpointSummary;
|
|
710
|
+
capturedFiles: IEditCheckpointFileInspection[];
|
|
711
|
+
restoreToCheckpoint: IEditCheckpointInspectionPlan;
|
|
712
|
+
rollbackThroughCheckpoint: IEditCheckpointInspectionPlan;
|
|
713
|
+
}
|
|
714
|
+
interface IEditCheckpointRestoreResult {
|
|
715
|
+
target: IEditCheckpointSummary;
|
|
716
|
+
restoredCheckpointCount: number;
|
|
717
|
+
restoredFileCount: number;
|
|
718
|
+
removedCheckpointCount: number;
|
|
719
|
+
}
|
|
720
|
+
//#endregion
|
|
721
|
+
//#region src/checkpoints/edit-checkpoint-store.d.ts
|
|
722
|
+
interface IEditCheckpointStoreOptions {
|
|
723
|
+
cwd: string;
|
|
724
|
+
now?: () => Date;
|
|
725
|
+
}
|
|
726
|
+
declare class EditCheckpointStore {
|
|
727
|
+
private readonly fs;
|
|
728
|
+
private readonly fsAsync;
|
|
729
|
+
private readonly cwd;
|
|
730
|
+
private readonly rootDir;
|
|
731
|
+
private readonly now;
|
|
732
|
+
private activeTurn;
|
|
733
|
+
constructor(options: IEditCheckpointStoreOptions, fs?: IFileSystem, fsAsync?: IFileSystemAsync);
|
|
734
|
+
beginTurn(input: IEditCheckpointTurnInput): Promise<IEditCheckpointSummary>;
|
|
735
|
+
captureFile(filePath: string): Promise<void>;
|
|
736
|
+
finalizeTurn(): Promise<IEditCheckpointSummary | undefined>;
|
|
737
|
+
list(sessionId: string): IEditCheckpointSummary[];
|
|
738
|
+
inspect(sessionId: string, checkpointId: string): IEditCheckpointInspection;
|
|
739
|
+
restoreToCheckpoint(sessionId: string, checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
740
|
+
rollbackThroughCheckpoint(sessionId: string, checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
741
|
+
private createFileRecord;
|
|
742
|
+
private restoreFile;
|
|
743
|
+
private loadManifests;
|
|
744
|
+
private nextSequence;
|
|
745
|
+
private writeManifest;
|
|
746
|
+
private sessionDir;
|
|
747
|
+
private checkpointDir;
|
|
748
|
+
}
|
|
749
|
+
//#endregion
|
|
750
|
+
//#region src/checkpoints/edit-checkpoint-tools.d.ts
|
|
751
|
+
declare function wrapEditCheckpointTools(tools: readonly IToolWithEventService[], recorder: IEditCheckpointRecorder): IToolWithEventService[];
|
|
752
|
+
//#endregion
|
|
753
|
+
//#region src/memory/project-memory-store.d.ts
|
|
754
|
+
declare const MEMORY_INDEX_MAX_LINES = 200;
|
|
755
|
+
declare const MEMORY_INDEX_MAX_BYTES: number;
|
|
756
|
+
type TMemoryType = 'user' | 'feedback' | 'project' | 'reference';
|
|
757
|
+
interface IStartupMemory {
|
|
758
|
+
content: string;
|
|
759
|
+
path: string;
|
|
760
|
+
lineCount: number;
|
|
761
|
+
truncated: boolean;
|
|
762
|
+
}
|
|
763
|
+
interface IMemoryTopicSummary {
|
|
764
|
+
name: string;
|
|
765
|
+
path: string;
|
|
766
|
+
}
|
|
767
|
+
interface IProjectMemorySummary {
|
|
768
|
+
indexPath: string;
|
|
769
|
+
topicsPath: string;
|
|
770
|
+
topics: IMemoryTopicSummary[];
|
|
771
|
+
}
|
|
772
|
+
interface IAppendMemoryInput {
|
|
773
|
+
type: TMemoryType;
|
|
774
|
+
topic: string;
|
|
775
|
+
text: string;
|
|
776
|
+
}
|
|
777
|
+
interface IAppendMemoryResult {
|
|
778
|
+
indexPath: string;
|
|
779
|
+
topicPath: string;
|
|
780
|
+
topic: string;
|
|
781
|
+
deduplicated: boolean;
|
|
782
|
+
}
|
|
783
|
+
declare function isMemoryType(value: string): value is TMemoryType;
|
|
784
|
+
declare class ProjectMemoryStore {
|
|
785
|
+
private readonly cwd;
|
|
786
|
+
private readonly now;
|
|
787
|
+
constructor(cwd: string, now?: () => Date);
|
|
788
|
+
getIndexPath(): string;
|
|
789
|
+
getTopicsPath(): string;
|
|
790
|
+
loadStartupMemory(): IStartupMemory;
|
|
791
|
+
list(): IProjectMemorySummary;
|
|
792
|
+
readTopic(topic: string): string;
|
|
793
|
+
append(input: IAppendMemoryInput): IAppendMemoryResult;
|
|
794
|
+
}
|
|
795
|
+
//#endregion
|
|
796
|
+
//#region src/memory/automatic-memory-types.d.ts
|
|
797
|
+
type TMemoryCandidateStatus = 'pending' | 'approved' | 'rejected' | 'saved' | 'skipped';
|
|
798
|
+
interface IMemoryCandidate {
|
|
799
|
+
id: string;
|
|
800
|
+
type: TMemoryType;
|
|
801
|
+
topic: string;
|
|
802
|
+
text: string;
|
|
803
|
+
sourceMessageIds: string[];
|
|
804
|
+
confidence: number;
|
|
805
|
+
createdAt: string;
|
|
806
|
+
reason: string;
|
|
807
|
+
}
|
|
808
|
+
interface IMemoryPendingRecord extends IMemoryCandidate {
|
|
809
|
+
status: TMemoryCandidateStatus;
|
|
810
|
+
updatedAt: string;
|
|
811
|
+
decisionReason?: string;
|
|
812
|
+
}
|
|
813
|
+
interface IMemoryReference {
|
|
814
|
+
topic: string;
|
|
815
|
+
path: string;
|
|
816
|
+
score: number;
|
|
817
|
+
truncated: boolean;
|
|
818
|
+
}
|
|
819
|
+
interface IMemoryEvent {
|
|
820
|
+
type: 'memory_candidate_extracted' | 'memory_candidate_queued' | 'memory_candidate_saved' | 'memory_candidate_skipped' | 'memory_candidate_approved' | 'memory_candidate_rejected' | 'memory_retrieved';
|
|
821
|
+
at: string;
|
|
822
|
+
candidateId?: string;
|
|
823
|
+
topic?: string;
|
|
824
|
+
reason?: string;
|
|
825
|
+
data?: Record<string, TUniversalValue>;
|
|
826
|
+
}
|
|
827
|
+
//#endregion
|
|
828
|
+
//#region src/context/prompt-file-reference-types.d.ts
|
|
829
|
+
type TPromptFileReferenceReason = 'manual' | 'prompt-reference';
|
|
830
|
+
type TPromptFileReferenceDiagnosticCode = 'not-found' | 'outside-root' | 'directory-not-supported' | 'file-too-large' | 'total-too-large' | 'too-many-references' | 'max-depth' | 'circular-reference' | 'unreadable';
|
|
831
|
+
interface IPromptFileReferenceToken {
|
|
832
|
+
original: string;
|
|
833
|
+
path: string;
|
|
834
|
+
index: number;
|
|
835
|
+
}
|
|
836
|
+
interface IPromptFileReferenceRecord {
|
|
837
|
+
originalReference: string;
|
|
838
|
+
sourcePath: string;
|
|
839
|
+
relativePath: string;
|
|
840
|
+
reason: TPromptFileReferenceReason;
|
|
841
|
+
depth: number;
|
|
842
|
+
byteLength: number;
|
|
843
|
+
}
|
|
844
|
+
interface IResolvedPromptFileReference extends IPromptFileReferenceRecord {
|
|
845
|
+
content: string;
|
|
846
|
+
}
|
|
847
|
+
interface IPromptFileReferenceDiagnostic {
|
|
848
|
+
code: TPromptFileReferenceDiagnosticCode;
|
|
849
|
+
severity: 'error';
|
|
850
|
+
reference: string;
|
|
851
|
+
message: string;
|
|
852
|
+
path?: string;
|
|
853
|
+
}
|
|
854
|
+
interface IPromptFileReferenceLimits {
|
|
855
|
+
maxDepth?: number;
|
|
856
|
+
maxReferences?: number;
|
|
857
|
+
maxFileBytes?: number;
|
|
858
|
+
maxTotalBytes?: number;
|
|
859
|
+
}
|
|
860
|
+
interface IPromptFileReferenceResolveOptions {
|
|
861
|
+
cwd: string;
|
|
862
|
+
limits?: IPromptFileReferenceLimits;
|
|
863
|
+
reason?: TPromptFileReferenceReason;
|
|
864
|
+
fsAsync?: IFileSystemAsync;
|
|
865
|
+
}
|
|
866
|
+
interface IResolvedPromptFileReferences {
|
|
867
|
+
references: IResolvedPromptFileReference[];
|
|
868
|
+
diagnostics: IPromptFileReferenceDiagnostic[];
|
|
869
|
+
}
|
|
870
|
+
interface IPromptFileReferenceHistoryData {
|
|
871
|
+
message: string;
|
|
872
|
+
references: IPromptFileReferenceRecord[];
|
|
873
|
+
}
|
|
874
|
+
//#endregion
|
|
875
|
+
//#region src/context/context-reference-inventory.d.ts
|
|
876
|
+
type TContextReferenceLoadType = 'manual' | 'prompt-reference';
|
|
877
|
+
type TContextReferenceStatus = 'active' | 'observed';
|
|
878
|
+
interface IContextReferenceItem {
|
|
879
|
+
id: string;
|
|
880
|
+
sourcePath: string;
|
|
881
|
+
relativePath: string;
|
|
882
|
+
originalReference: string;
|
|
883
|
+
loadType: TContextReferenceLoadType;
|
|
884
|
+
status: TContextReferenceStatus;
|
|
885
|
+
byteLength: number;
|
|
886
|
+
loadedAt: string;
|
|
887
|
+
lastUsedAt?: string;
|
|
888
|
+
}
|
|
889
|
+
interface IContextReferenceInventoryLimits {
|
|
890
|
+
maxActiveReferences?: number;
|
|
891
|
+
maxActiveBytes?: number;
|
|
892
|
+
maxObservedReferences?: number;
|
|
893
|
+
}
|
|
894
|
+
interface IContextReferenceAddResult {
|
|
895
|
+
reference?: IContextReferenceItem;
|
|
896
|
+
evicted: IContextReferenceItem[];
|
|
897
|
+
diagnostics: string[];
|
|
898
|
+
}
|
|
899
|
+
interface IContextReferenceRemoveResult {
|
|
900
|
+
removed?: IContextReferenceItem;
|
|
901
|
+
}
|
|
902
|
+
interface IContextReferenceClearResult {
|
|
903
|
+
removed: IContextReferenceItem[];
|
|
904
|
+
}
|
|
905
|
+
interface IContextReferenceUpsertResult {
|
|
906
|
+
references: IContextReferenceItem[];
|
|
907
|
+
evicted: IContextReferenceItem[];
|
|
908
|
+
}
|
|
909
|
+
declare function createContextReferenceItem(record: IPromptFileReferenceRecord, loadType: TContextReferenceLoadType, status: TContextReferenceStatus, timestamp?: string): IContextReferenceItem;
|
|
910
|
+
declare function upsertContextReference(references: readonly IContextReferenceItem[], item: IContextReferenceItem, limits?: IContextReferenceInventoryLimits): IContextReferenceUpsertResult;
|
|
911
|
+
declare function removeContextReference(references: readonly IContextReferenceItem[], query: string): {
|
|
912
|
+
references: IContextReferenceItem[];
|
|
913
|
+
result: IContextReferenceRemoveResult;
|
|
914
|
+
};
|
|
915
|
+
declare function clearContextReferences(references: readonly IContextReferenceItem[]): IContextReferenceClearResult;
|
|
916
|
+
declare function listActiveContextReferences(references: readonly IContextReferenceItem[]): IContextReferenceItem[];
|
|
917
|
+
declare function toContextReferenceRecords(references: readonly IContextReferenceItem[]): IPromptFileReferenceRecord[];
|
|
918
|
+
//#endregion
|
|
919
|
+
//#region src/command-api/context/context-command-api.d.ts
|
|
920
|
+
type TAutoCompactThreshold = number | false;
|
|
921
|
+
declare const DEFAULT_AUTO_COMPACT_THRESHOLD = 0.835;
|
|
922
|
+
declare const AUTO_COMPACT_THRESHOLD_SETTINGS_KEY = "autoCompactThreshold";
|
|
923
|
+
interface ICompactContextResult {
|
|
924
|
+
before: IContextWindowState;
|
|
925
|
+
after: IContextWindowState;
|
|
926
|
+
}
|
|
927
|
+
/** Read context-window state through the command host facade. */
|
|
928
|
+
declare function readCommandContextState(context: ICommandHostContext): IContextWindowState;
|
|
929
|
+
/** Read the effective automatic compact policy through the command host facade. */
|
|
930
|
+
declare function readAutoCompactThreshold(context: ICommandHostContext): TAutoCompactThreshold;
|
|
931
|
+
/** Read the source of the effective automatic compact policy. */
|
|
932
|
+
declare function readAutoCompactThresholdSource(context: ICommandHostContext): TAutoCompactThresholdSource;
|
|
933
|
+
/** Update the active session's automatic compact policy through the command host facade. */
|
|
934
|
+
declare function setCommandAutoCompactThreshold(context: ICommandHostContext, threshold: TAutoCompactThreshold, source: TAutoCompactThresholdSource): void;
|
|
935
|
+
/** Persist an automatic compact policy value through the host settings adapter, when present. */
|
|
936
|
+
declare function writeAutoCompactThresholdSetting(context: ICommandHostContext, threshold: TAutoCompactThreshold): boolean;
|
|
937
|
+
/** Remove the persisted automatic compact policy through the host settings adapter, when present. */
|
|
938
|
+
declare function resetAutoCompactThresholdSetting(context: ICommandHostContext): boolean;
|
|
939
|
+
/** Run manual compaction through the command host facade and return before/after state. */
|
|
940
|
+
declare function compactCommandContext(context: ICommandHostContext, instructions?: string): Promise<ICompactContextResult>;
|
|
941
|
+
/** List context reference inventory entries through the command host facade. */
|
|
942
|
+
declare function listCommandContextReferences(context: ICommandHostContext): IContextReferenceItem[];
|
|
943
|
+
/** Add a manual context reference through the command host facade. */
|
|
944
|
+
declare function addCommandContextReference(context: ICommandHostContext, path: string): Promise<IContextReferenceAddResult>;
|
|
945
|
+
/** Remove a context reference through the command host facade. */
|
|
946
|
+
declare function removeCommandContextReference(context: ICommandHostContext, path: string): IContextReferenceRemoveResult;
|
|
947
|
+
/** Clear all context references through the command host facade. */
|
|
948
|
+
declare function clearCommandContextReferences(context: ICommandHostContext): IContextReferenceClearResult;
|
|
949
|
+
//#endregion
|
|
950
|
+
//#region src/command-api/host-context.d.ts
|
|
951
|
+
interface ICommandListEntry {
|
|
952
|
+
name: string;
|
|
953
|
+
/** User-friendly display label. Falls back to `name` if not set. */
|
|
954
|
+
displayName?: string;
|
|
955
|
+
description: string;
|
|
956
|
+
}
|
|
957
|
+
interface ICommandSkillListEntry {
|
|
958
|
+
readonly name: string;
|
|
959
|
+
readonly description: string;
|
|
960
|
+
readonly source: string;
|
|
961
|
+
readonly modelInvocable: boolean;
|
|
962
|
+
readonly userInvocable: boolean;
|
|
963
|
+
readonly argumentHint?: string;
|
|
964
|
+
readonly context?: string;
|
|
965
|
+
readonly agent?: string;
|
|
966
|
+
}
|
|
967
|
+
type TCommandInvocationSource = 'user' | 'model';
|
|
968
|
+
interface ICommandSkillActivationRequest {
|
|
969
|
+
readonly invocationSource: TCommandInvocationSource;
|
|
970
|
+
readonly displayInput?: string;
|
|
971
|
+
readonly rawInput?: string;
|
|
972
|
+
}
|
|
973
|
+
type TAutoCompactThresholdSource = 'default' | 'settings' | 'session';
|
|
974
|
+
interface ICommandSessionRuntime {
|
|
975
|
+
clearHistory(): void;
|
|
976
|
+
compact(instructions?: string): Promise<void>;
|
|
977
|
+
getContextState(): IContextWindowState;
|
|
978
|
+
getPermissionMode(): TPermissionMode;
|
|
979
|
+
setPermissionMode(mode: TPermissionMode): void;
|
|
980
|
+
getSessionId(): string;
|
|
981
|
+
getMessageCount(): number;
|
|
982
|
+
getSessionAllowedTools(): readonly string[];
|
|
983
|
+
getAutoCompactThreshold(): number | false;
|
|
984
|
+
setAutoCompactThreshold?(threshold: TAutoCompactThreshold): void;
|
|
985
|
+
}
|
|
986
|
+
interface ICommandSessionReplayValidationReport {
|
|
987
|
+
logFile: string;
|
|
988
|
+
entryCount: number;
|
|
989
|
+
validation: ISessionReplayValidationResult;
|
|
990
|
+
}
|
|
991
|
+
interface ICommandHostContext {
|
|
992
|
+
clearConversationHistory?(): void;
|
|
993
|
+
validateCurrentSessionReplayLog?(): ICommandSessionReplayValidationReport;
|
|
994
|
+
getAgentJobCapability?(): IAgentJobHostContext | undefined;
|
|
995
|
+
getSession(): ICommandSessionRuntime;
|
|
996
|
+
getContextState(): IContextWindowState;
|
|
997
|
+
getAutoCompactThreshold(): TAutoCompactThreshold;
|
|
998
|
+
getAutoCompactThresholdSource?(): TAutoCompactThresholdSource;
|
|
999
|
+
setAutoCompactThreshold?(threshold: TAutoCompactThreshold, source?: TAutoCompactThresholdSource): void;
|
|
1000
|
+
getCommandHostAdapters?(): ICommandHostAdapters;
|
|
1001
|
+
compactContext(instructions?: string): Promise<void>;
|
|
1002
|
+
listContextReferences?(): IContextReferenceItem[];
|
|
1003
|
+
addContextReference?(path: string): Promise<IContextReferenceAddResult>;
|
|
1004
|
+
removeContextReference?(path: string): IContextReferenceRemoveResult;
|
|
1005
|
+
clearContextReferences?(): IContextReferenceClearResult;
|
|
1006
|
+
getCwd(): string;
|
|
1007
|
+
getCommandInvocationSource?(): TCommandInvocationSource;
|
|
1008
|
+
listCommands?(): ICommandListEntry[];
|
|
1009
|
+
listSkills?(): ICommandSkillListEntry[];
|
|
1010
|
+
executeSkillCommandByName?(name: string, args: string, request: ICommandSkillActivationRequest): Promise<ICommandResult | null>;
|
|
1011
|
+
listEditCheckpoints(): IEditCheckpointSummary[];
|
|
1012
|
+
inspectEditCheckpoint?(checkpointId: string): IEditCheckpointInspection;
|
|
1013
|
+
restoreEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
1014
|
+
rollbackEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
1015
|
+
getUsedMemoryReferences(): IMemoryReference[];
|
|
1016
|
+
recordMemoryEvent(event: IMemoryEvent): void;
|
|
1017
|
+
listBackgroundTasks(filter?: IBackgroundTaskListFilter): IBackgroundTaskState[];
|
|
1018
|
+
readBackgroundTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
1019
|
+
cancelBackgroundTask(taskId: string, reason?: string): Promise<void>;
|
|
1020
|
+
closeBackgroundTask(taskId: string): Promise<void>;
|
|
1021
|
+
}
|
|
1022
|
+
interface IAgentJobHostContext {
|
|
1023
|
+
listAgentDefinitions(): Array<{
|
|
1024
|
+
name: string;
|
|
1025
|
+
description: string;
|
|
1026
|
+
}>;
|
|
1027
|
+
listAgentJobs(): ISubagentJobState[];
|
|
1028
|
+
spawnAgentJob(input: {
|
|
1029
|
+
agentType: string;
|
|
1030
|
+
label: string;
|
|
1031
|
+
mode: 'foreground' | 'background';
|
|
1032
|
+
prompt: string;
|
|
1033
|
+
model?: string;
|
|
1034
|
+
isolation?: TBackgroundTaskIsolation;
|
|
1035
|
+
}): Promise<ISubagentJobState>;
|
|
1036
|
+
sendAgentJob(jobId: string, prompt: string): Promise<void>;
|
|
1037
|
+
cancelAgentJob(jobId: string, reason?: string): Promise<void>;
|
|
1038
|
+
closeAgentJob(jobId: string): Promise<void>;
|
|
1039
|
+
createBackgroundJobGroup(input: Omit<IBackgroundJobGroupCreateRequest, 'parentSessionId'>): IBackgroundJobGroupState;
|
|
1040
|
+
waitBackgroundJobGroup(groupId: string): Promise<IBackgroundJobGroupState>;
|
|
1041
|
+
readBackgroundTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
1042
|
+
}
|
|
1043
|
+
//#endregion
|
|
1044
|
+
//#region src/command-api/contracts.d.ts
|
|
1045
|
+
type TSystemCommandLifecycle = 'inline' | 'blocking' | 'background';
|
|
1046
|
+
/** A user-visible command with descriptor metadata and execute logic. */
|
|
1047
|
+
interface ISystemCommand {
|
|
1048
|
+
name: string;
|
|
1049
|
+
/** User-friendly display label (e.g., "Interaction Mode"). Falls back to `name` if not set. */
|
|
1050
|
+
displayName?: string;
|
|
1051
|
+
description: string;
|
|
1052
|
+
modelInvocable?: boolean;
|
|
1053
|
+
userInvocable?: boolean;
|
|
1054
|
+
argumentHint?: string;
|
|
1055
|
+
safety?: TCapabilitySafety;
|
|
1056
|
+
subcommands?: readonly ICommand[];
|
|
1057
|
+
lifecycle?: TSystemCommandLifecycle;
|
|
1058
|
+
/**
|
|
1059
|
+
* Whether executing this command requires explicit user permission/confirmation.
|
|
1060
|
+
* - `false`: runs immediately without any approval gate
|
|
1061
|
+
* - `true`: user confirmation is required before execution
|
|
1062
|
+
* - `undefined` (default): derived from `safety` — `'read-only'` → false, others → true
|
|
1063
|
+
*/
|
|
1064
|
+
requiresPermission?: boolean;
|
|
1065
|
+
execute(context: ICommandHostContext, args: string): Promise<ICommandResult> | ICommandResult;
|
|
1066
|
+
}
|
|
1067
|
+
//#endregion
|
|
1068
|
+
//#region src/command-api/command-module.d.ts
|
|
1069
|
+
type TCommandModuleSessionRequirement = 'agent-runtime';
|
|
1070
|
+
/** Composable command capability module. */
|
|
1071
|
+
interface ICommandModule {
|
|
1072
|
+
/** Stable module id for diagnostics and duplicate handling. */
|
|
1073
|
+
readonly name: string;
|
|
1074
|
+
/** Slash palette/autocomplete command sources contributed by this module. */
|
|
1075
|
+
readonly commandSources?: readonly ICommandSource[];
|
|
1076
|
+
/** Executable system commands contributed by this module. */
|
|
1077
|
+
readonly systemCommands?: readonly ISystemCommand[];
|
|
1078
|
+
/** Additional model-visible descriptors not derived from executable commands. */
|
|
1079
|
+
readonly commandDescriptors?: readonly ICapabilityDescriptor[];
|
|
1080
|
+
/** Runtime facilities required by this module. */
|
|
1081
|
+
readonly sessionRequirements?: readonly TCommandModuleSessionRequirement[];
|
|
1082
|
+
}
|
|
1083
|
+
//#endregion
|
|
1084
|
+
//#region src/command-api/provider/provider-settings.d.ts
|
|
1085
|
+
interface IProviderProfileSettings extends IProviderProfileConfig {
|
|
1086
|
+
[key: string]: TUniversalValue;
|
|
1087
|
+
}
|
|
1088
|
+
interface ILegacyProviderSettings {
|
|
1089
|
+
[key: string]: TUniversalValue;
|
|
1090
|
+
name?: string;
|
|
1091
|
+
model?: string;
|
|
1092
|
+
apiKey?: string;
|
|
1093
|
+
baseURL?: string;
|
|
1094
|
+
timeout?: number;
|
|
1095
|
+
options?: Record<string, TUniversalValue>;
|
|
1096
|
+
}
|
|
1097
|
+
type TProviderSettingsDocument = Record<string, TUniversalValue> & {
|
|
1098
|
+
currentProvider?: string;
|
|
1099
|
+
providers?: Record<string, IProviderProfileSettings>;
|
|
1100
|
+
provider?: ILegacyProviderSettings;
|
|
1101
|
+
};
|
|
1102
|
+
interface IProviderSetupInput {
|
|
1103
|
+
profile: string;
|
|
1104
|
+
type: string;
|
|
1105
|
+
model?: string;
|
|
1106
|
+
apiKey?: string;
|
|
1107
|
+
apiKeyEnv?: string;
|
|
1108
|
+
baseURL?: string;
|
|
1109
|
+
timeout?: number;
|
|
1110
|
+
setCurrent?: boolean;
|
|
1111
|
+
}
|
|
1112
|
+
interface IProviderSetupPatch {
|
|
1113
|
+
currentProvider?: string;
|
|
1114
|
+
providers: Record<string, IProviderProfileSettings>;
|
|
1115
|
+
}
|
|
1116
|
+
interface IProviderSettingsBuildOptions {
|
|
1117
|
+
providerDefinitions?: readonly IProviderDefinition$1[];
|
|
1118
|
+
}
|
|
1119
|
+
declare function upsertProviderProfile(settings: TProviderSettingsDocument, profileName: string, profile: IProviderProfileSettings): TProviderSettingsDocument;
|
|
1120
|
+
declare function setCurrentProvider(settings: TProviderSettingsDocument, profileName: string): TProviderSettingsDocument;
|
|
1121
|
+
declare function deleteProviderProfile(settings: TProviderSettingsDocument, profileName: string, options?: {
|
|
1122
|
+
replacementCurrentProvider?: string;
|
|
1123
|
+
}): TProviderSettingsDocument;
|
|
1124
|
+
declare function validateProviderProfile(profileName: string, profile: IProviderProfileSettings, options?: IProviderSettingsBuildOptions): void;
|
|
1125
|
+
declare function buildProviderSetupPatch(input: IProviderSetupInput, options?: IProviderSettingsBuildOptions): IProviderSetupPatch;
|
|
1126
|
+
declare function buildProviderProfile(input: IProviderSetupInput, options?: IProviderSettingsBuildOptions): IProviderProfileSettings;
|
|
1127
|
+
declare function mergeProviderPatch(settings: TProviderSettingsDocument, patch: IProviderSetupPatch): TProviderSettingsDocument;
|
|
1128
|
+
//#endregion
|
|
1129
|
+
//#region src/command-api/provider/provider-command-types.d.ts
|
|
1130
|
+
interface IProviderCommandSettingsAdapter {
|
|
1131
|
+
readMergedSettings(): TProviderSettingsDocument;
|
|
1132
|
+
readTargetSettings(): TProviderSettingsDocument;
|
|
1133
|
+
writeTargetSettings(settings: TProviderSettingsDocument): void;
|
|
1134
|
+
}
|
|
1135
|
+
interface IProviderCommandModuleOptions {
|
|
1136
|
+
providerDefinitions: readonly IProviderDefinition$1[];
|
|
1137
|
+
settings: IProviderCommandSettingsAdapter;
|
|
1138
|
+
}
|
|
1139
|
+
//#endregion
|
|
1140
|
+
//#region src/command-api/provider/provider-profile-names.d.ts
|
|
1141
|
+
interface IProviderProfileNameSuggestionInput {
|
|
1142
|
+
type: string;
|
|
1143
|
+
}
|
|
1144
|
+
interface IProviderProfileNameSuggestionOptions {
|
|
1145
|
+
existingProfileNames?: readonly string[];
|
|
1146
|
+
}
|
|
1147
|
+
declare function suggestProviderProfileName(input: IProviderProfileNameSuggestionInput, options?: IProviderProfileNameSuggestionOptions): string;
|
|
1148
|
+
declare function sanitizeProviderProfileName(value: string | undefined): string | undefined;
|
|
1149
|
+
//#endregion
|
|
1150
|
+
//#region src/command-api/provider/provider-command-probe.d.ts
|
|
1151
|
+
declare function testProviderProfileCommand(currentProvider: string | undefined, providers: Record<string, IProviderProfileSettings> | undefined, profileArg: string | undefined, options: IProviderCommandModuleOptions): Promise<ICommandResult>;
|
|
1152
|
+
declare function probeProviderProfile(profile: IProviderProfileConfig): Promise<IProviderProbeResult>;
|
|
1153
|
+
//#endregion
|
|
1154
|
+
//#region src/command-api/provider/settings-check.d.ts
|
|
1155
|
+
type TSettingsCheck = 'missing' | 'valid' | 'corrupt' | 'incomplete';
|
|
1156
|
+
declare function checkSettingsDocument(settings: TProviderSettingsDocument, providerDefinitions?: readonly IProviderDefinition$1[]): TSettingsCheck;
|
|
1157
|
+
//#endregion
|
|
1158
|
+
//#region src/command-api/provider/provider-merge.d.ts
|
|
1159
|
+
declare function readMergedProviderSettingsFromPaths(paths: readonly string[], fs?: IFileSystem): TProviderSettingsDocument;
|
|
1160
|
+
declare function mergeSettings(base: TProviderSettingsDocument, override: TProviderSettingsDocument): TProviderSettingsDocument;
|
|
1161
|
+
declare function mergeProviders(base: TProviderSettingsDocument['providers'], override: TProviderSettingsDocument['providers']): TProviderSettingsDocument['providers'];
|
|
1162
|
+
declare function resolveActiveProvider(settings: TProviderSettingsDocument, providerOverride: string | undefined, providerDefinitions: readonly IProviderDefinition$1[]): IProviderConfig | undefined;
|
|
1163
|
+
//#endregion
|
|
1164
|
+
//#region src/command-api/help/help-command-api.d.ts
|
|
1165
|
+
declare const HELP_COMMAND_DESCRIPTION = "Show available commands";
|
|
1166
|
+
declare function formatCommandHelpMessage(context: ICommandHostContext): string;
|
|
1167
|
+
//#endregion
|
|
1168
|
+
//#region src/command-api/background/background-command-api.d.ts
|
|
1169
|
+
declare const BACKGROUND_COMMAND_DESCRIPTION = "List and control background tasks";
|
|
1170
|
+
declare const BACKGROUND_COMMAND_USAGE = "Usage: background list | background read <task-id> [offset] | background cancel <task-id> | background close <task-id>";
|
|
1171
|
+
declare function buildBackgroundCommandSubcommands(): ICommand[];
|
|
1172
|
+
declare function formatCommandBackgroundTask(task: IBackgroundTaskState): string;
|
|
1173
|
+
declare function formatCommandBackgroundTaskList(tasks: IBackgroundTaskState[]): string;
|
|
1174
|
+
declare function parseCommandBackgroundLogCursor(value?: string): IBackgroundTaskLogCursor | undefined;
|
|
1175
|
+
declare function listCommandBackgroundTasks(context: ICommandHostContext, filter?: IBackgroundTaskListFilter): IBackgroundTaskState[];
|
|
1176
|
+
declare function readCommandBackgroundTaskLog(context: ICommandHostContext, taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
1177
|
+
declare function cancelCommandBackgroundTask(context: ICommandHostContext, taskId: string, reason?: string): Promise<void>;
|
|
1178
|
+
declare function closeCommandBackgroundTask(context: ICommandHostContext, taskId: string): Promise<void>;
|
|
1179
|
+
//#endregion
|
|
1180
|
+
//#region src/command-api/model/model-command-api.d.ts
|
|
1181
|
+
declare const MODEL_COMMAND_DESCRIPTION = "Change AI model";
|
|
1182
|
+
declare const MODEL_COMMAND_ARGUMENT_HINT = "<model-id>";
|
|
1183
|
+
interface IModelCommandSettingsAdapter {
|
|
1184
|
+
readMergedSettings(): TProviderSettingsDocument;
|
|
1185
|
+
}
|
|
1186
|
+
interface IModelCommandModuleOptions {
|
|
1187
|
+
providerDefinitions: readonly IProviderDefinition$1[];
|
|
1188
|
+
settings: IModelCommandSettingsAdapter;
|
|
1189
|
+
}
|
|
1190
|
+
interface IBuildModelCommandSubcommandsOptions {
|
|
1191
|
+
source?: string;
|
|
1192
|
+
providerDefinitions?: readonly IProviderDefinition$1[];
|
|
1193
|
+
settings?: TProviderSettingsDocument;
|
|
1194
|
+
}
|
|
1195
|
+
interface IActiveProviderModelCatalogState {
|
|
1196
|
+
providerType: string;
|
|
1197
|
+
catalog?: IProviderModelCatalog;
|
|
1198
|
+
refreshAttempted: boolean;
|
|
1199
|
+
refreshMessage?: string;
|
|
1200
|
+
}
|
|
1201
|
+
interface IResolveActiveProviderModelCatalogStateOptions {
|
|
1202
|
+
settings?: TProviderSettingsDocument;
|
|
1203
|
+
providerDefinitions?: readonly IProviderDefinition$1[];
|
|
1204
|
+
refresh?: boolean;
|
|
1205
|
+
}
|
|
1206
|
+
declare function buildModelCommandSubcommands(sourceOrOptions?: string | IBuildModelCommandSubcommandsOptions): ICommand[];
|
|
1207
|
+
declare function formatModelCommandUsageMessage(options?: {
|
|
1208
|
+
settings?: TProviderSettingsDocument;
|
|
1209
|
+
providerDefinitions?: readonly IProviderDefinition$1[];
|
|
1210
|
+
}): string;
|
|
1211
|
+
declare function formatModelCommandUsageMessageAsync(options?: IResolveActiveProviderModelCatalogStateOptions): Promise<string>;
|
|
1212
|
+
declare function resolveActiveProviderModelCatalog(settings: TProviderSettingsDocument | undefined, providerDefinitions?: readonly IProviderDefinition$1[]): IProviderModelCatalog | undefined;
|
|
1213
|
+
declare function resolveActiveProviderModelCatalogState(options: IResolveActiveProviderModelCatalogStateOptions): Promise<IActiveProviderModelCatalogState | undefined>;
|
|
1214
|
+
//#endregion
|
|
1215
|
+
//#region src/command-api/language/language-command-api.d.ts
|
|
1216
|
+
declare const LANGUAGE_COMMAND_DESCRIPTION = "Set response language";
|
|
1217
|
+
declare const LANGUAGE_COMMAND_ARGUMENT_HINT = "<code>";
|
|
1218
|
+
declare const RECOMMENDED_RESPONSE_LANGUAGES: readonly [{
|
|
1219
|
+
readonly code: "ko";
|
|
1220
|
+
readonly description: "Korean";
|
|
1221
|
+
}, {
|
|
1222
|
+
readonly code: "en";
|
|
1223
|
+
readonly description: "English";
|
|
1224
|
+
}, {
|
|
1225
|
+
readonly code: "ja";
|
|
1226
|
+
readonly description: "Japanese";
|
|
1227
|
+
}, {
|
|
1228
|
+
readonly code: "zh";
|
|
1229
|
+
readonly description: "Chinese";
|
|
1230
|
+
}];
|
|
1231
|
+
type TRecommendedResponseLanguage = (typeof RECOMMENDED_RESPONSE_LANGUAGES)[number]['code'];
|
|
1232
|
+
declare function buildLanguageCommandSubcommands(source?: string): ICommand[];
|
|
1233
|
+
declare function parseLanguageArgument(args: string): string | undefined;
|
|
1234
|
+
declare function formatLanguageUsageMessage(commandName?: string): string;
|
|
1235
|
+
//#endregion
|
|
1236
|
+
//#region src/command-api/permissions/permission-mode-command-api.d.ts
|
|
1237
|
+
declare const PERMISSION_MODE_COMMAND_DESCRIPTION = "Show/change permission mode";
|
|
1238
|
+
declare const PERMISSION_MODE_ARGUMENT_HINT = "plan | default | acceptEdits | bypassPermissions";
|
|
1239
|
+
declare const PERMISSIONS_COMMAND_DESCRIPTION = "Show/change permission mode and permission rules";
|
|
1240
|
+
interface IPermissionsCommandState {
|
|
1241
|
+
readonly mode: TPermissionMode;
|
|
1242
|
+
readonly sessionAllowed: readonly string[];
|
|
1243
|
+
}
|
|
1244
|
+
declare const VALID_PERMISSION_MODES: readonly TPermissionMode[];
|
|
1245
|
+
declare function buildPermissionModeSubcommands(source?: string): ICommand[];
|
|
1246
|
+
declare function parsePermissionModeArgument(args: string): string | undefined;
|
|
1247
|
+
declare function isPermissionMode(value: string): value is TPermissionMode;
|
|
1248
|
+
declare function formatInvalidPermissionModeMessage(): string;
|
|
1249
|
+
declare function resolvePermissionModeAdapter(context: ICommandHostContext): ICommandPermissionModeAdapter;
|
|
1250
|
+
declare function readCommandPermissionMode(context: ICommandHostContext): TPermissionMode;
|
|
1251
|
+
declare function writeCommandPermissionMode(context: ICommandHostContext, mode: TPermissionMode): void;
|
|
1252
|
+
declare function listCommandSessionAllowedTools(context: ICommandHostContext): readonly string[];
|
|
1253
|
+
declare function readCommandPermissionsState(context: ICommandHostContext): IPermissionsCommandState;
|
|
1254
|
+
declare function formatCommandPermissionsMessage(state: IPermissionsCommandState): string;
|
|
1255
|
+
//#endregion
|
|
1256
|
+
//#region src/command-api/session/session-command-api.d.ts
|
|
1257
|
+
declare const CLEAR_COMMAND_DESCRIPTION = "Clear conversation history";
|
|
1258
|
+
declare const RENAME_COMMAND_DESCRIPTION = "Rename the current session";
|
|
1259
|
+
declare const RENAME_COMMAND_USAGE = "Usage: rename <name>";
|
|
1260
|
+
declare const RESUME_COMMAND_DESCRIPTION = "Resume a previous session";
|
|
1261
|
+
declare const COST_COMMAND_DESCRIPTION = "Show session info";
|
|
1262
|
+
declare const VALIDATE_SESSION_COMMAND_DESCRIPTION = "Validate current session replay log";
|
|
1263
|
+
declare const EXIT_COMMAND_DESCRIPTION = "Exit CLI";
|
|
1264
|
+
interface ICommandSessionInfo {
|
|
1265
|
+
sessionId: string;
|
|
1266
|
+
messageCount: number;
|
|
1267
|
+
}
|
|
1268
|
+
declare function clearConversationHistory(context: ICommandHostContext): void;
|
|
1269
|
+
declare function parseSessionNameArgument(args: string): string | undefined;
|
|
1270
|
+
declare function createSessionRenamedEffect(name: string): TCommandEffect;
|
|
1271
|
+
declare function createSessionPickerRequestedEffect(): TCommandEffect;
|
|
1272
|
+
declare function createSessionExitRequestedEffect(): TCommandEffect;
|
|
1273
|
+
declare function readCommandSessionInfo(context: ICommandHostContext): ICommandSessionInfo;
|
|
1274
|
+
declare function validateCommandSessionReplayLog(context: ICommandHostContext): ICommandSessionReplayValidationReport;
|
|
1275
|
+
declare function formatCommandSessionReplayValidationReport(report: ICommandSessionReplayValidationReport): string;
|
|
1276
|
+
//#endregion
|
|
1277
|
+
//#region src/command-api/checkpoint/rewind-command-api.d.ts
|
|
1278
|
+
declare const REWIND_COMMAND_DESCRIPTION = "List, inspect, restore, or rollback edit checkpoints.";
|
|
1279
|
+
declare const REWIND_COMMAND_ARGUMENT_HINT = "list | inspect CHECKPOINT_ID | restore CHECKPOINT_ID | code CHECKPOINT_ID | rollback CHECKPOINT_ID";
|
|
1280
|
+
declare function buildRewindCommandSubcommands(source?: string): ICommand[];
|
|
1281
|
+
declare function listCommandEditCheckpoints(context: ICommandHostContext): readonly IEditCheckpointSummary[];
|
|
1282
|
+
declare function inspectCommandEditCheckpoint(context: ICommandHostContext, checkpointId: string): IEditCheckpointInspection;
|
|
1283
|
+
declare function restoreCommandEditCheckpoint(context: ICommandHostContext, checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
1284
|
+
declare function rollbackCommandEditCheckpoint(context: ICommandHostContext, checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
1285
|
+
//#endregion
|
|
1286
|
+
//#region src/command-api/memory/memory-command-api.d.ts
|
|
1287
|
+
declare const MEMORY_COMMAND_DESCRIPTION = "Project memory command. Use it to inspect project memory when stored context may help, save durable preferences, project conventions, feedback, or references worth reusing across sessions, review pending candidates, and report memory provenance. Do not store secrets, credentials, or transient facts.";
|
|
1288
|
+
declare const MEMORY_COMMAND_ARGUMENT_HINT = "list | show [topic] | add <user|feedback|project|reference> <topic> <text> | pending | approve <id> | reject <id> | used";
|
|
1289
|
+
declare const MEMORY_COMMAND_USAGE = "Usage: memory list | memory show [topic] | memory add <user|feedback|project|reference> <topic> <text> | memory pending | memory approve <id> | memory reject <id> | memory used";
|
|
1290
|
+
interface ICommandProjectMemoryStore {
|
|
1291
|
+
list(): IProjectMemorySummary;
|
|
1292
|
+
loadStartupMemory(): IStartupMemory;
|
|
1293
|
+
readTopic(topic: string): string;
|
|
1294
|
+
append(input: IAppendMemoryInput): IAppendMemoryResult;
|
|
1295
|
+
}
|
|
1296
|
+
interface ICommandPendingMemoryStore {
|
|
1297
|
+
get(id: string): IMemoryPendingRecord | undefined;
|
|
1298
|
+
list(status?: TMemoryCandidateStatus): IMemoryPendingRecord[];
|
|
1299
|
+
mark(id: string, status: TMemoryCandidateStatus, reason: string): IMemoryPendingRecord;
|
|
1300
|
+
upsert(candidate: IMemoryCandidate, status: TMemoryCandidateStatus, reason: string): void;
|
|
1301
|
+
}
|
|
1302
|
+
interface ICommandMemoryStores {
|
|
1303
|
+
project: ICommandProjectMemoryStore;
|
|
1304
|
+
pending: ICommandPendingMemoryStore;
|
|
1305
|
+
}
|
|
1306
|
+
declare function buildMemoryCommandSubcommands(source?: string): ICommand[];
|
|
1307
|
+
declare function createCommandProjectMemoryStore(cwd: string, now?: () => Date): ICommandProjectMemoryStore;
|
|
1308
|
+
declare function createCommandPendingMemoryStore(cwd: string, now?: () => Date): ICommandPendingMemoryStore;
|
|
1309
|
+
declare function createCommandMemoryStores(context: ICommandHostContext, now?: () => Date): ICommandMemoryStores;
|
|
1310
|
+
declare function isCommandMemoryType(value: string): value is TMemoryType;
|
|
1311
|
+
declare function hasSensitiveCommandMemoryContent(text: string): boolean;
|
|
1312
|
+
declare function listCommandUsedMemoryReferences(context: ICommandHostContext): readonly IMemoryReference[];
|
|
1313
|
+
declare function recordCommandMemoryEvent(context: ICommandHostContext, event: Omit<IMemoryEvent, 'at'>, now?: () => Date): void;
|
|
1314
|
+
//#endregion
|
|
1315
|
+
//#region src/commands/command-registry.d.ts
|
|
1316
|
+
/** Aggregates commands from multiple sources */
|
|
1317
|
+
declare class CommandRegistry {
|
|
1318
|
+
private sources;
|
|
1319
|
+
addSource(source: ICommandSource): void;
|
|
1320
|
+
replaceSource(name: string, source?: ICommandSource): void;
|
|
1321
|
+
addModule(module: ICommandModule): void;
|
|
1322
|
+
/** Get all commands, optionally filtered by prefix */
|
|
1323
|
+
getCommands(filter?: string): ICommand[];
|
|
1324
|
+
/** Resolve a short name to its fully qualified plugin:name form */
|
|
1325
|
+
resolveQualifiedName(shortName: string): string | null;
|
|
1326
|
+
/** Get subcommands for a specific command */
|
|
1327
|
+
getSubcommands(commandName: string): ICommand[];
|
|
1328
|
+
getCapabilityDescriptors(): ICapabilityDescriptor[];
|
|
1329
|
+
}
|
|
1330
|
+
//#endregion
|
|
1331
|
+
//#region src/commands/builtin-source.d.ts
|
|
1332
|
+
/** Command source for SDK-owned built-in commands. */
|
|
1333
|
+
declare class BuiltinCommandSource implements ICommandSource {
|
|
1334
|
+
readonly name = "builtin";
|
|
1335
|
+
private readonly commands;
|
|
1336
|
+
constructor(systemCommands?: readonly ISystemCommand[]);
|
|
1337
|
+
getCommands(): ICommand[];
|
|
1338
|
+
}
|
|
1339
|
+
declare function createBuiltinCommandModule(): ICommandModule;
|
|
1340
|
+
//#endregion
|
|
1341
|
+
//#region src/commands/skill-source.d.ts
|
|
1342
|
+
interface IFrontmatter {
|
|
1343
|
+
name?: string;
|
|
1344
|
+
description?: string;
|
|
1345
|
+
argumentHint?: string;
|
|
1346
|
+
disableModelInvocation?: boolean;
|
|
1347
|
+
userInvocable?: boolean;
|
|
1348
|
+
allowedTools?: string[];
|
|
1349
|
+
model?: string;
|
|
1350
|
+
effort?: string;
|
|
1351
|
+
context?: string;
|
|
1352
|
+
agent?: string;
|
|
1353
|
+
}
|
|
1354
|
+
/** Parse YAML-like frontmatter between --- markers */
|
|
1355
|
+
declare function parseFrontmatter(content: string): IFrontmatter | null;
|
|
1356
|
+
/** Command source that discovers skills from multiple directories */
|
|
1357
|
+
declare class SkillCommandSource implements ICommandSource {
|
|
1358
|
+
readonly name = "skill";
|
|
1359
|
+
private readonly cwd;
|
|
1360
|
+
private readonly home;
|
|
1361
|
+
private readonly fs;
|
|
1362
|
+
private cachedCommands;
|
|
1363
|
+
constructor(cwd: string, home?: string, fs?: IFileSystem);
|
|
1364
|
+
getCommands(): ICommand[];
|
|
1365
|
+
getModelInvocableSkills(): ICommand[];
|
|
1366
|
+
getUserInvocableSkills(): ICommand[];
|
|
1367
|
+
}
|
|
1368
|
+
//#endregion
|
|
1369
|
+
//#region src/plugins/marketplace-types.d.ts
|
|
1370
|
+
/**
|
|
1371
|
+
* Shared types for marketplace client and registry.
|
|
1372
|
+
*/
|
|
1373
|
+
/** Source specification for a marketplace. */
|
|
1374
|
+
type TMarketplaceSource = {
|
|
1375
|
+
type: 'github';
|
|
1376
|
+
repo: string;
|
|
1377
|
+
ref?: string;
|
|
1378
|
+
} | {
|
|
1379
|
+
type: 'git';
|
|
1380
|
+
url: string;
|
|
1381
|
+
ref?: string;
|
|
1382
|
+
} | {
|
|
1383
|
+
type: 'local';
|
|
1384
|
+
path: string;
|
|
1385
|
+
} | {
|
|
1386
|
+
type: 'url';
|
|
1387
|
+
url: string;
|
|
1388
|
+
};
|
|
1389
|
+
/** A single plugin entry in a marketplace manifest. */
|
|
1390
|
+
interface IMarketplacePluginEntry {
|
|
1391
|
+
name: string;
|
|
1392
|
+
title: string;
|
|
1393
|
+
description: string;
|
|
1394
|
+
source: string | {
|
|
1395
|
+
type: 'github';
|
|
1396
|
+
repo: string;
|
|
1397
|
+
} | {
|
|
1398
|
+
type: 'url';
|
|
1399
|
+
url: string;
|
|
1400
|
+
};
|
|
1401
|
+
tags: string[];
|
|
1402
|
+
}
|
|
1403
|
+
/** Manifest format read from `.claude-plugin/marketplace.json`. */
|
|
1404
|
+
interface IMarketplaceManifest {
|
|
1405
|
+
name: string;
|
|
1406
|
+
version: string;
|
|
1407
|
+
plugins: IMarketplacePluginEntry[];
|
|
1408
|
+
}
|
|
1409
|
+
/** Entry in known_marketplaces.json. */
|
|
1410
|
+
interface IKnownMarketplaceEntry {
|
|
1411
|
+
source: TMarketplaceSource;
|
|
1412
|
+
installLocation: string;
|
|
1413
|
+
lastUpdated: string;
|
|
1414
|
+
}
|
|
1415
|
+
/** Shape of known_marketplaces.json. */
|
|
1416
|
+
type TKnownMarketplacesRegistry = Record<string, IKnownMarketplaceEntry>;
|
|
1417
|
+
/** Exec function type for running shell commands. Injected at composition root. */
|
|
1418
|
+
type TExecFn = (command: string, options: {
|
|
1419
|
+
timeout: number;
|
|
1420
|
+
stdio?: string;
|
|
1421
|
+
}) => string | Buffer;
|
|
1422
|
+
/** Options for constructing a MarketplaceClient. */
|
|
1423
|
+
interface IMarketplaceClientOptions {
|
|
1424
|
+
/** Base plugins directory (e.g., `~/.robota/plugins`). */
|
|
1425
|
+
pluginsDir: string;
|
|
1426
|
+
/** Shell exec adapter — must be provided at composition root (e.g., execSync). */
|
|
1427
|
+
exec: TExecFn;
|
|
1428
|
+
}
|
|
1429
|
+
//#endregion
|
|
1430
|
+
//#region src/plugins/plugin-settings-store.d.ts
|
|
1431
|
+
/** Persisted marketplace source entry. */
|
|
1432
|
+
interface IPersistedMarketplaceSource {
|
|
1433
|
+
source: TMarketplaceSource;
|
|
1434
|
+
}
|
|
1435
|
+
/** Shape of the plugin-related keys in settings.json. */
|
|
1436
|
+
interface IPluginSettings {
|
|
1437
|
+
enabledPlugins: Record<string, boolean>;
|
|
1438
|
+
extraKnownMarketplaces: Record<string, IPersistedMarketplaceSource>;
|
|
1439
|
+
}
|
|
1440
|
+
/** Centralized settings store for plugin configuration. */
|
|
1441
|
+
declare class PluginSettingsStore {
|
|
1442
|
+
private readonly settingsPath;
|
|
1443
|
+
private readonly fs;
|
|
1444
|
+
constructor(settingsPath: string, fs?: IFileSystem);
|
|
1445
|
+
/** Read the full settings file from disk. */
|
|
1446
|
+
private readAll;
|
|
1447
|
+
/** Write the full settings file to disk. */
|
|
1448
|
+
private writeAll;
|
|
1449
|
+
/** Get the enabledPlugins map. */
|
|
1450
|
+
getEnabledPlugins(): Record<string, boolean>;
|
|
1451
|
+
/** Set a single plugin's enabled state. */
|
|
1452
|
+
setPluginEnabled(pluginId: string, enabled: boolean): void;
|
|
1453
|
+
/** Remove a plugin from enabledPlugins. */
|
|
1454
|
+
removePluginEntry(pluginId: string): void;
|
|
1455
|
+
/** Get all persisted marketplace sources. */
|
|
1456
|
+
getMarketplaceSources(): Record<string, IPersistedMarketplaceSource>;
|
|
1457
|
+
/** Add or update a marketplace source. */
|
|
1458
|
+
setMarketplaceSource(name: string, source: TMarketplaceSource): void;
|
|
1459
|
+
/** Remove a marketplace source. */
|
|
1460
|
+
removeMarketplaceSource(name: string): void;
|
|
1461
|
+
private getEnabledPluginsFrom;
|
|
1462
|
+
private getMarketplaceSourcesFrom;
|
|
1463
|
+
}
|
|
1464
|
+
//#endregion
|
|
1465
|
+
//#region src/plugins/bundle-plugin-types.d.ts
|
|
1466
|
+
/**
|
|
1467
|
+
* Types for the BundlePlugin system.
|
|
1468
|
+
*
|
|
1469
|
+
* A BundlePlugin is a directory-based plugin package that bundles
|
|
1470
|
+
* skills, hooks, agents, and MCP server configurations.
|
|
1471
|
+
*/
|
|
1472
|
+
/** Feature flags indicating what a bundle plugin provides. */
|
|
1473
|
+
interface IBundlePluginFeatures {
|
|
1474
|
+
commands?: boolean;
|
|
1475
|
+
agents?: boolean;
|
|
1476
|
+
skills?: boolean;
|
|
1477
|
+
hooks?: boolean;
|
|
1478
|
+
mcp?: boolean;
|
|
1479
|
+
}
|
|
1480
|
+
/** Manifest read from `.claude-plugin/plugin.json`. */
|
|
1481
|
+
interface IBundlePluginManifest {
|
|
1482
|
+
name: string;
|
|
1483
|
+
version: string;
|
|
1484
|
+
description: string;
|
|
1485
|
+
features: IBundlePluginFeatures;
|
|
1486
|
+
}
|
|
1487
|
+
/** A skill loaded from a bundle plugin's `skills/` directory. */
|
|
1488
|
+
interface IBundleSkill {
|
|
1489
|
+
name: string;
|
|
1490
|
+
description: string;
|
|
1491
|
+
skillContent: string;
|
|
1492
|
+
[key: string]: unknown;
|
|
1493
|
+
}
|
|
1494
|
+
/** A fully loaded bundle plugin with all its assets. */
|
|
1495
|
+
interface ILoadedBundlePlugin {
|
|
1496
|
+
manifest: IBundlePluginManifest;
|
|
1497
|
+
skills: IBundleSkill[];
|
|
1498
|
+
commands: IBundleSkill[];
|
|
1499
|
+
hooks: Record<string, unknown>;
|
|
1500
|
+
mcpConfig?: unknown;
|
|
1501
|
+
agents: string[];
|
|
1502
|
+
pluginDir: string;
|
|
1503
|
+
}
|
|
1504
|
+
/** Map of plugin identifiers to enabled/disabled state. */
|
|
1505
|
+
type TEnabledPlugins = Record<string, boolean>;
|
|
1506
|
+
//#endregion
|
|
1507
|
+
//#region src/plugins/bundle-plugin-loader.d.ts
|
|
1508
|
+
/** Loader for directory-based bundle plugins from the cache directory. */
|
|
1509
|
+
declare class BundlePluginLoader {
|
|
1510
|
+
private readonly pluginsDir;
|
|
1511
|
+
private readonly enabledPlugins;
|
|
1512
|
+
private readonly fs;
|
|
1513
|
+
constructor(pluginsDir: string, enabledPlugins?: TEnabledPlugins, fs?: IFileSystem);
|
|
1514
|
+
/** Load all discovered and enabled bundle plugins (sync). */
|
|
1515
|
+
loadPluginsSync(): ILoadedBundlePlugin[];
|
|
1516
|
+
/** Load all discovered and enabled bundle plugins (async wrapper). */
|
|
1517
|
+
loadAll(): Promise<ILoadedBundlePlugin[]>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Discover and load plugins from the cache directory.
|
|
1520
|
+
*
|
|
1521
|
+
* Directory structure: `<pluginsDir>/cache/<marketplace>/<plugin>/<version>/`
|
|
1522
|
+
* For each marketplace/plugin pair, the latest version (lexicographically last) is loaded.
|
|
1523
|
+
*/
|
|
1524
|
+
private discoverAndLoad;
|
|
1525
|
+
/** Read and validate a plugin.json manifest. Returns null if the manifest structure is invalid. */
|
|
1526
|
+
private readManifest;
|
|
1527
|
+
/**
|
|
1528
|
+
* Check if a plugin is explicitly disabled.
|
|
1529
|
+
* Checks both `name@marketplace` and `name` keys.
|
|
1530
|
+
* Plugins not listed in enabledPlugins are enabled by default.
|
|
1531
|
+
*/
|
|
1532
|
+
private isDisabled;
|
|
1533
|
+
/** Load a single plugin's skills, hooks, agents, and MCP config. */
|
|
1534
|
+
private loadPlugin;
|
|
1535
|
+
/** Load skills from the plugin's skills/ directory. */
|
|
1536
|
+
private loadSkills;
|
|
1537
|
+
/** Load commands from the plugin's commands/ directory (flat .md files). */
|
|
1538
|
+
private loadCommands;
|
|
1539
|
+
/** Load hooks from hooks/hooks.json if present. */
|
|
1540
|
+
private loadHooks;
|
|
1541
|
+
/** Load MCP server configuration from `.mcp.json` at the plugin root if present. */
|
|
1542
|
+
private loadMcpConfig;
|
|
1543
|
+
/** Load agent definitions from agents/ directory if present. */
|
|
1544
|
+
private loadAgents;
|
|
1545
|
+
}
|
|
1546
|
+
//#endregion
|
|
1547
|
+
//#region src/plugins/marketplace-client.d.ts
|
|
1548
|
+
/** Manages marketplace registries via shallow git clones. */
|
|
1549
|
+
declare class MarketplaceClient {
|
|
1550
|
+
private readonly pluginsDir;
|
|
1551
|
+
private readonly exec;
|
|
1552
|
+
private readonly marketplacesDir;
|
|
1553
|
+
private readonly registryPath;
|
|
1554
|
+
private readonly fs;
|
|
1555
|
+
constructor(options: IMarketplaceClientOptions & {
|
|
1556
|
+
fs?: IFileSystem;
|
|
1557
|
+
});
|
|
1558
|
+
/**
|
|
1559
|
+
* Add a marketplace by cloning its repository.
|
|
1560
|
+
*
|
|
1561
|
+
* 1. Shallow git clone (`--depth 1`) to `marketplaces/<name>/`.
|
|
1562
|
+
* 2. Read `.claude-plugin/marketplace.json` for the `name` field.
|
|
1563
|
+
* 3. Register in `known_marketplaces.json`.
|
|
1564
|
+
*
|
|
1565
|
+
* Returns the registered marketplace name from the manifest.
|
|
1566
|
+
*/
|
|
1567
|
+
addMarketplace(source: TMarketplaceSource): string;
|
|
1568
|
+
/**
|
|
1569
|
+
* Remove a marketplace.
|
|
1570
|
+
* Uninstalls all plugins from that marketplace, then deletes the clone directory
|
|
1571
|
+
* and removes from the registry.
|
|
1572
|
+
*/
|
|
1573
|
+
removeMarketplace(name: string): void;
|
|
1574
|
+
/**
|
|
1575
|
+
* Update a marketplace by running git pull on its clone.
|
|
1576
|
+
* The manifest is re-read from disk on demand (via fetchManifest), so the
|
|
1577
|
+
* updated manifest is automatically available after pull.
|
|
1578
|
+
*/
|
|
1579
|
+
updateMarketplace(name: string): void;
|
|
1580
|
+
/** List all registered marketplaces. */
|
|
1581
|
+
listMarketplaces(): Array<{
|
|
1582
|
+
name: string;
|
|
1583
|
+
source: TMarketplaceSource;
|
|
1584
|
+
lastUpdated: string;
|
|
1585
|
+
}>;
|
|
1586
|
+
/** Read the marketplace manifest from a registered marketplace's clone. */
|
|
1587
|
+
fetchManifest(marketplaceName: string): IMarketplaceManifest;
|
|
1588
|
+
/** Get the clone directory path for a registered marketplace. */
|
|
1589
|
+
getMarketplaceDir(name: string): string;
|
|
1590
|
+
/**
|
|
1591
|
+
* Get the current git SHA (first 12 chars) for a marketplace clone.
|
|
1592
|
+
* Used as a version identifier when plugins lack explicit versions.
|
|
1593
|
+
*/
|
|
1594
|
+
getMarketplaceSha(name: string): string;
|
|
1595
|
+
/** List all available plugins across all marketplaces. */
|
|
1596
|
+
listAvailablePlugins(): Array<IMarketplacePluginEntry & {
|
|
1597
|
+
marketplace: string;
|
|
1598
|
+
}>;
|
|
1599
|
+
/** Resolve a marketplace source to a git clone URL. */
|
|
1600
|
+
private resolveCloneUrl;
|
|
1601
|
+
/** Read and parse a marketplace.json from a file path. */
|
|
1602
|
+
private readManifestFromPath;
|
|
1603
|
+
}
|
|
1604
|
+
//#endregion
|
|
1605
|
+
//#region src/plugins/bundle-plugin-installer.d.ts
|
|
1606
|
+
/** Record of an installed plugin in installed_plugins.json. */
|
|
1607
|
+
interface IInstalledPluginRecord {
|
|
1608
|
+
pluginName: string;
|
|
1609
|
+
marketplace: string;
|
|
1610
|
+
version: string;
|
|
1611
|
+
installPath: string;
|
|
1612
|
+
installedAt: string;
|
|
1613
|
+
}
|
|
1614
|
+
/** Shape of installed_plugins.json. */
|
|
1615
|
+
type TInstalledPluginsRegistry = Record<string, IInstalledPluginRecord>;
|
|
1616
|
+
/** Options for constructing a BundlePluginInstaller. */
|
|
1617
|
+
interface IBundlePluginInstallerOptions {
|
|
1618
|
+
/** Base plugins directory (e.g., `~/.robota/plugins`). */
|
|
1619
|
+
pluginsDir: string;
|
|
1620
|
+
/** Shared settings store for enable/disable persistence. */
|
|
1621
|
+
settingsStore: PluginSettingsStore;
|
|
1622
|
+
/** MarketplaceClient for reading marketplace manifests. */
|
|
1623
|
+
marketplaceClient: MarketplaceClient;
|
|
1624
|
+
/** Shell exec adapter — must be provided at composition root (e.g., execSync). */
|
|
1625
|
+
exec: TExecFn;
|
|
1626
|
+
/** File system adapter for testability. */
|
|
1627
|
+
fs?: IFileSystem;
|
|
1628
|
+
}
|
|
1629
|
+
/** Installs, uninstalls, enables, and disables bundle plugins. */
|
|
1630
|
+
declare class BundlePluginInstaller {
|
|
1631
|
+
private readonly pluginsDir;
|
|
1632
|
+
private readonly cacheDir;
|
|
1633
|
+
private readonly registryPath;
|
|
1634
|
+
private readonly settingsStore;
|
|
1635
|
+
private readonly marketplaceClient;
|
|
1636
|
+
private readonly exec;
|
|
1637
|
+
private readonly fs;
|
|
1638
|
+
constructor(options: IBundlePluginInstallerOptions);
|
|
1639
|
+
/**
|
|
1640
|
+
* Install a plugin from a marketplace.
|
|
1641
|
+
*
|
|
1642
|
+
* 1. Read marketplace manifest to find the plugin entry.
|
|
1643
|
+
* 2. Resolve source (relative path, github, or url).
|
|
1644
|
+
* 3. Copy/clone to `cache/<marketplace>/<plugin>/<version>/`.
|
|
1645
|
+
* 4. Record in `installed_plugins.json`.
|
|
1646
|
+
*/
|
|
1647
|
+
install(pluginName: string, marketplaceName: string): Promise<void>;
|
|
1648
|
+
/**
|
|
1649
|
+
* Uninstall a plugin.
|
|
1650
|
+
* Removes from cache and from installed_plugins.json.
|
|
1651
|
+
*/
|
|
1652
|
+
uninstall(pluginId: string): Promise<void>;
|
|
1653
|
+
/** Enable a plugin by setting its enabledPlugins entry to true. */
|
|
1654
|
+
enable(pluginId: string): Promise<void>;
|
|
1655
|
+
/** Disable a plugin by setting its enabledPlugins entry to false. */
|
|
1656
|
+
disable(pluginId: string): Promise<void>;
|
|
1657
|
+
/** Get all installed plugins. */
|
|
1658
|
+
getInstalledPlugins(): TInstalledPluginsRegistry;
|
|
1659
|
+
/** Get plugins installed from a specific marketplace. */
|
|
1660
|
+
getPluginsByMarketplace(marketplaceName: string): IInstalledPluginRecord[];
|
|
1661
|
+
/** Resolve the version for a plugin entry. */
|
|
1662
|
+
private resolveVersion;
|
|
1663
|
+
/**
|
|
1664
|
+
* Normalize source object — Claude Code manifests use `source` key instead of `type`.
|
|
1665
|
+
* e.g., { source: "url", url: "..." } → { type: "url", url: "..." }
|
|
1666
|
+
*/
|
|
1667
|
+
private normalizeSource;
|
|
1668
|
+
/** Resolve the source and install the plugin. */
|
|
1669
|
+
private resolveAndInstall;
|
|
1670
|
+
/** Clone a git repository to the target directory. */
|
|
1671
|
+
private cloneToDir;
|
|
1672
|
+
/** Read the installed_plugins.json registry. */
|
|
1673
|
+
private readRegistry;
|
|
1674
|
+
/** Write the installed_plugins.json registry. */
|
|
1675
|
+
private writeRegistry;
|
|
1676
|
+
}
|
|
1677
|
+
//#endregion
|
|
1678
|
+
//#region src/commands/plugin-source.d.ts
|
|
1679
|
+
/**
|
|
1680
|
+
* Command source that discovers skills and commands from loaded BundlePlugins.
|
|
1681
|
+
*
|
|
1682
|
+
* - Skills: exposed as `/name` with `(plugin-name)` hint in description.
|
|
1683
|
+
* - Commands: exposed as `/plugin:command` (already namespaced by the loader).
|
|
1684
|
+
*/
|
|
1685
|
+
declare class PluginCommandSource implements ICommandSource {
|
|
1686
|
+
readonly name = "plugin";
|
|
1687
|
+
private readonly plugins;
|
|
1688
|
+
constructor(plugins: ILoadedBundlePlugin[]);
|
|
1689
|
+
getCommands(): ICommand[];
|
|
1690
|
+
}
|
|
1691
|
+
//#endregion
|
|
1692
|
+
//#region src/commands/system-command-executor.d.ts
|
|
1693
|
+
/** Registry for system commands. */
|
|
1694
|
+
declare class SystemCommandExecutor {
|
|
1695
|
+
private readonly commands;
|
|
1696
|
+
constructor(commands?: ISystemCommand[]);
|
|
1697
|
+
/** Register an additional command. */
|
|
1698
|
+
register(command: ISystemCommand): void;
|
|
1699
|
+
/** Execute a command by name. Returns null if command not found. */
|
|
1700
|
+
execute(name: string, session: ICommandHostContext, args: string): Promise<ICommandResult | null>;
|
|
1701
|
+
getCommand(name: string): ISystemCommand | undefined;
|
|
1702
|
+
/** Resolve whether a command requires permission confirmation. */
|
|
1703
|
+
resolveRequiresPermission(command: ISystemCommand): boolean;
|
|
1704
|
+
executeCommand(command: ISystemCommand, session: ICommandHostContext, args: string): Promise<ICommandResult>;
|
|
1705
|
+
/** List all registered commands. */
|
|
1706
|
+
listCommands(): ISystemCommand[];
|
|
1707
|
+
listModelInvocableCommands(): ICapabilityDescriptor[];
|
|
1708
|
+
isModelInvocable(name: string): boolean;
|
|
1709
|
+
executeModelInvocable(name: string, session: ICommandHostContext, args: string): Promise<ICommandResult | null>;
|
|
1710
|
+
/** Check if a command exists. */
|
|
1711
|
+
hasCommand(name: string): boolean;
|
|
1712
|
+
}
|
|
1713
|
+
//#endregion
|
|
1714
|
+
//#region src/commands/system-command.d.ts
|
|
1715
|
+
/** Built-in system commands. */
|
|
1716
|
+
declare function createSystemCommands(): ISystemCommand[];
|
|
1717
|
+
//#endregion
|
|
1718
|
+
//#region src/utils/skill-prompt.d.ts
|
|
1719
|
+
/** Shell exec function for skill preprocessing — injected from composition root. */
|
|
1720
|
+
type TShellExecFn = (command: string) => string;
|
|
1721
|
+
/** Context variables available during skill prompt processing */
|
|
1722
|
+
interface SkillPromptContext {
|
|
1723
|
+
/** Current session ID — substituted for ${CLAUDE_SESSION_ID} */
|
|
1724
|
+
sessionId?: string;
|
|
1725
|
+
/** Directory containing SKILL.md — substituted for ${CLAUDE_SKILL_DIR} */
|
|
1726
|
+
skillDir?: string;
|
|
1727
|
+
}
|
|
1728
|
+
/**
|
|
1729
|
+
* Substitute variables in skill content.
|
|
1730
|
+
*
|
|
1731
|
+
* Supported variables:
|
|
1732
|
+
* - `$ARGUMENTS` — all arguments passed to the skill
|
|
1733
|
+
* - `$ARGUMENTS[N]` — argument by index (0-based)
|
|
1734
|
+
* - `$N` — shorthand for `$ARGUMENTS[N]` (single digit, 0-9)
|
|
1735
|
+
* - `${CLAUDE_SESSION_ID}` — current session ID
|
|
1736
|
+
* - `${CLAUDE_SKILL_DIR}` — directory containing SKILL.md
|
|
1737
|
+
*/
|
|
1738
|
+
declare function substituteVariables(content: string, args: string, context?: SkillPromptContext): string;
|
|
1739
|
+
/**
|
|
1740
|
+
* Preprocess shell commands in skill content.
|
|
1741
|
+
* Matches `` !`...` `` patterns and replaces them with command output.
|
|
1742
|
+
* If no exec function is provided, shell patterns are replaced with empty string.
|
|
1743
|
+
*/
|
|
1744
|
+
declare function preprocessShellCommands(content: string, exec?: TShellExecFn): Promise<string>;
|
|
1745
|
+
//#endregion
|
|
1746
|
+
//#region src/commands/skill-executor.d.ts
|
|
1747
|
+
/** Options passed to the fork execution callback */
|
|
1748
|
+
interface IForkExecutionOptions {
|
|
1749
|
+
/** Agent identity to use (e.g., 'Explore', 'Plan') */
|
|
1750
|
+
agent?: string;
|
|
1751
|
+
/** Tools the subagent is allowed to use */
|
|
1752
|
+
allowedTools?: string[];
|
|
1753
|
+
}
|
|
1754
|
+
/** Callback interface for skill execution infrastructure */
|
|
1755
|
+
interface ISkillExecutionCallbacks {
|
|
1756
|
+
/**
|
|
1757
|
+
* Run skill content in an isolated subagent session.
|
|
1758
|
+
* The content becomes the subagent's prompt.
|
|
1759
|
+
* Returns the subagent's response.
|
|
1760
|
+
*/
|
|
1761
|
+
runInFork?: (content: string, options: IForkExecutionOptions) => Promise<string>;
|
|
1762
|
+
/** Shell exec function for preprocessing `` !`cmd` `` patterns — injected from composition root. */
|
|
1763
|
+
shellExec?: TShellExecFn;
|
|
1764
|
+
}
|
|
1765
|
+
/** Result of skill execution */
|
|
1766
|
+
interface ISkillExecutionResult {
|
|
1767
|
+
/** Execution mode used */
|
|
1768
|
+
mode: 'fork' | 'inject';
|
|
1769
|
+
/** For inject mode: the prompt to send as a user message */
|
|
1770
|
+
prompt?: string;
|
|
1771
|
+
/** For fork mode: the subagent's response */
|
|
1772
|
+
result?: string;
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
* Execute a skill command.
|
|
1776
|
+
*
|
|
1777
|
+
* When `context: 'fork'`, the skill runs in an isolated subagent session
|
|
1778
|
+
* via the `runInFork` callback. Throws if `runInFork` is not available.
|
|
1779
|
+
* For non-fork skills, the content is returned as a prompt for injection
|
|
1780
|
+
* into the current session.
|
|
1781
|
+
*/
|
|
1782
|
+
declare function executeSkill(skill: ICommand, args: string, callbacks: ISkillExecutionCallbacks, context?: SkillPromptContext): Promise<ISkillExecutionResult>;
|
|
1783
|
+
//#endregion
|
|
1784
|
+
//#region src/commands/skill-activation-events.d.ts
|
|
1785
|
+
type TSkillActivationSource = 'skill' | 'plugin';
|
|
1786
|
+
type TSkillActivationInvocation = 'user-slash' | 'model-tool';
|
|
1787
|
+
type TSkillActivationMode = 'inject' | 'fork';
|
|
1788
|
+
type TSkillActivationStatus = 'started' | 'completed' | 'failed';
|
|
1789
|
+
interface ISkillActivationEvent {
|
|
1790
|
+
readonly type: 'skill-activation';
|
|
1791
|
+
readonly skillName: string;
|
|
1792
|
+
readonly source: TSkillActivationSource;
|
|
1793
|
+
readonly invocation: TSkillActivationInvocation;
|
|
1794
|
+
readonly mode: TSkillActivationMode;
|
|
1795
|
+
readonly status: TSkillActivationStatus;
|
|
1796
|
+
readonly timestamp: string;
|
|
1797
|
+
readonly qualifiedName?: string;
|
|
1798
|
+
readonly error?: string;
|
|
1799
|
+
}
|
|
1800
|
+
interface ISkillActivationHistoryData extends ISkillActivationEvent {
|
|
1801
|
+
readonly message: string;
|
|
1802
|
+
}
|
|
1803
|
+
//#endregion
|
|
1804
|
+
//#region src/context/prompt-file-reference-format.d.ts
|
|
1805
|
+
declare function buildPromptWithFileReferences(input: string, references: readonly IResolvedPromptFileReference[]): string;
|
|
1806
|
+
declare function hasBlockingPromptFileReferenceDiagnostics(diagnostics: readonly IPromptFileReferenceDiagnostic[]): boolean;
|
|
1807
|
+
declare function formatPromptFileReferenceDiagnostics(diagnostics: readonly IPromptFileReferenceDiagnostic[]): string;
|
|
1808
|
+
declare function toPromptFileReferenceRecords(references: readonly IResolvedPromptFileReference[]): IPromptFileReferenceRecord[];
|
|
1809
|
+
declare function createPromptFileReferenceHistoryEntry(references: readonly IResolvedPromptFileReference[]): IHistoryEntry<IPromptFileReferenceHistoryData>;
|
|
1810
|
+
//#endregion
|
|
1811
|
+
//#region src/context/prompt-file-reference-parser.d.ts
|
|
1812
|
+
declare function parsePromptFileReferences(input: string): IPromptFileReferenceToken[];
|
|
1813
|
+
//#endregion
|
|
1814
|
+
//#region src/context/prompt-file-reference-resolver.d.ts
|
|
1815
|
+
declare function resolvePromptFileReferences(input: string, options: IPromptFileReferenceResolveOptions): Promise<IResolvedPromptFileReferences>;
|
|
1816
|
+
declare function resolvePromptFileReferencePaths(referencePaths: readonly string[], options: IPromptFileReferenceResolveOptions): Promise<IResolvedPromptFileReferences>;
|
|
1817
|
+
//#endregion
|
|
1818
|
+
//#region src/interactive/types.d.ts
|
|
1819
|
+
/** Permission handler result — SDK-owned type (mirrors agent-sessions TPermissionResult).
|
|
1820
|
+
* true = allow, false = deny, 'allow-session' = allow and remember for this session. */
|
|
1821
|
+
type TPermissionResultValue = boolean | 'allow-session';
|
|
1822
|
+
/** Tool execution state visible to clients. */
|
|
1823
|
+
interface IToolState {
|
|
1824
|
+
toolName: string;
|
|
1825
|
+
firstArg: string;
|
|
1826
|
+
isRunning: boolean;
|
|
1827
|
+
result?: 'success' | 'error' | 'denied';
|
|
1828
|
+
diffLines?: IDiffLine[];
|
|
1829
|
+
diffFile?: string;
|
|
1830
|
+
toolResultData?: string;
|
|
1831
|
+
}
|
|
1832
|
+
/** A single diff line for Edit tool display. */
|
|
1833
|
+
interface IDiffLine {
|
|
1834
|
+
type: 'add' | 'remove' | 'context' | 'hunk';
|
|
1835
|
+
text: string;
|
|
1836
|
+
lineNumber: number;
|
|
1837
|
+
}
|
|
1838
|
+
interface IUsageSnapshot {
|
|
1839
|
+
kind: 'exact' | 'estimated';
|
|
1840
|
+
scope: 'turn';
|
|
1841
|
+
totalTokens: number;
|
|
1842
|
+
promptTokens?: number;
|
|
1843
|
+
completionTokens?: number;
|
|
1844
|
+
contextUsedTokens: number;
|
|
1845
|
+
contextMaxTokens: number;
|
|
1846
|
+
contextUsedPercentage: number;
|
|
1847
|
+
costStatus: 'unknown' | 'estimated' | 'exact';
|
|
1848
|
+
}
|
|
1849
|
+
/** Result of a completed prompt execution. */
|
|
1850
|
+
interface IExecutionResult {
|
|
1851
|
+
response: string;
|
|
1852
|
+
history: IHistoryEntry[];
|
|
1853
|
+
toolSummaries: IToolSummary[];
|
|
1854
|
+
contextState: IContextWindowState;
|
|
1855
|
+
usage?: IUsageSnapshot;
|
|
1856
|
+
promptFileReferences?: IPromptFileReferenceRecord[];
|
|
1857
|
+
}
|
|
1858
|
+
/** Summary of a tool call extracted from history. */
|
|
1859
|
+
interface IToolSummary {
|
|
1860
|
+
name: string;
|
|
1861
|
+
args: string;
|
|
1862
|
+
}
|
|
1863
|
+
/** Permission handler delegate — clients provide their own UI. */
|
|
1864
|
+
type TInteractivePermissionHandler = (toolName: string, toolArgs: TToolArgs) => Promise<TPermissionResultValue>;
|
|
1865
|
+
/** Events emitted by InteractiveSession. */
|
|
1866
|
+
interface IInteractiveSessionEvents {
|
|
1867
|
+
text_delta: (delta: string) => void;
|
|
1868
|
+
tool_start: (state: IToolState) => void;
|
|
1869
|
+
tool_end: (state: IToolState) => void;
|
|
1870
|
+
thinking: (isThinking: boolean) => void;
|
|
1871
|
+
complete: (result: IExecutionResult) => void;
|
|
1872
|
+
error: (error: Error) => void;
|
|
1873
|
+
context_update: (state: IContextWindowState) => void;
|
|
1874
|
+
compact: (event: ICompactEvent) => void;
|
|
1875
|
+
interrupted: (result: IExecutionResult) => void;
|
|
1876
|
+
skill_activation: (event: ISkillActivationEvent) => void;
|
|
1877
|
+
background_task_event: (event: TBackgroundTaskEvent) => void;
|
|
1878
|
+
background_job_group_event: (event: TBackgroundJobGroupEvent) => void;
|
|
1879
|
+
execution_workspace_event: (event: IExecutionWorkspaceEvent) => void;
|
|
1880
|
+
user_message: (content: string) => void;
|
|
1881
|
+
/** Emitted when a context file (AGENTS.md or CLAUDE.md) is refreshed due to staleness. */
|
|
1882
|
+
context_file_refreshed: (event: IContextFileRefreshedEvent) => void;
|
|
1883
|
+
}
|
|
1884
|
+
/** Emitted when a context file is found stale and re-read before a turn. */
|
|
1885
|
+
interface IContextFileRefreshedEvent {
|
|
1886
|
+
filePath: string;
|
|
1887
|
+
}
|
|
1888
|
+
type TInteractiveEventName = keyof IInteractiveSessionEvents;
|
|
1889
|
+
//#endregion
|
|
1890
|
+
//#region src/interactive/i-interactive-session.d.ts
|
|
1891
|
+
/** Minimal session surface consumed by transport adapters and test factories. */
|
|
1892
|
+
interface IInteractiveSession {
|
|
1893
|
+
/** True once the underlying session has been initialized. */
|
|
1894
|
+
readonly isInitialized?: boolean;
|
|
1895
|
+
submit(input: string, displayInput?: string, rawInput?: string): Promise<void>;
|
|
1896
|
+
abort(): void;
|
|
1897
|
+
cancelQueue(): void;
|
|
1898
|
+
shutdown(options?: {
|
|
1899
|
+
reason?: string;
|
|
1900
|
+
message?: string;
|
|
1901
|
+
}): Promise<void>;
|
|
1902
|
+
isExecuting(): boolean;
|
|
1903
|
+
getPendingPrompt(): string | null;
|
|
1904
|
+
getMessages(): TUniversalMessage[];
|
|
1905
|
+
getContextState(): IContextWindowState;
|
|
1906
|
+
getSession(): {
|
|
1907
|
+
getSessionId(): string;
|
|
1908
|
+
};
|
|
1909
|
+
getCwd(): string;
|
|
1910
|
+
executeCommand(name: string, args: string): Promise<ICommandResult | null>;
|
|
1911
|
+
listCommands(): ICommandListEntry[];
|
|
1912
|
+
on<E extends TInteractiveEventName>(event: E, handler: IInteractiveSessionEvents[E]): void;
|
|
1913
|
+
off<E extends TInteractiveEventName>(event: E, handler: IInteractiveSessionEvents[E]): void;
|
|
1914
|
+
listBackgroundTasks(filter?: IBackgroundTaskListFilter): IBackgroundTaskState[];
|
|
1915
|
+
getBackgroundTask(taskId: string): IBackgroundTaskState | undefined;
|
|
1916
|
+
cancelBackgroundTask(taskId: string, reason?: string): Promise<void>;
|
|
1917
|
+
closeBackgroundTask(taskId: string): Promise<void>;
|
|
1918
|
+
sendBackgroundTask(taskId: string, input: IBackgroundTaskInput): Promise<void>;
|
|
1919
|
+
readBackgroundTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
1920
|
+
listBackgroundJobGroups(): IBackgroundJobGroupState[];
|
|
1921
|
+
getBackgroundJobGroup(groupId: string): IBackgroundJobGroupState | undefined;
|
|
1922
|
+
createBackgroundJobGroup(input: Omit<IBackgroundJobGroupCreateRequest, 'parentSessionId'>): IBackgroundJobGroupState;
|
|
1923
|
+
waitBackgroundJobGroup(groupId: string): Promise<IBackgroundJobGroupState>;
|
|
1924
|
+
getExecutionWorkspaceSnapshot(options?: IExecutionWorkspaceSnapshotOptions): IExecutionWorkspaceSnapshot;
|
|
1925
|
+
listAgentDefinitions(): Array<{
|
|
1926
|
+
name: string;
|
|
1927
|
+
description: string;
|
|
1928
|
+
}>;
|
|
1929
|
+
listAgentJobs(): ISubagentJobState[];
|
|
1930
|
+
spawnAgentJob(input: {
|
|
1931
|
+
agentType: string;
|
|
1932
|
+
label: string;
|
|
1933
|
+
mode: 'foreground' | 'background';
|
|
1934
|
+
prompt: string;
|
|
1935
|
+
model?: string;
|
|
1936
|
+
isolation?: TBackgroundTaskIsolation;
|
|
1937
|
+
}): Promise<ISubagentJobState>;
|
|
1938
|
+
sendAgentJob(jobId: string, prompt: string): Promise<void>;
|
|
1939
|
+
cancelAgentJob(jobId: string, reason?: string): Promise<void>;
|
|
1940
|
+
closeAgentJob(jobId: string): Promise<void>;
|
|
1941
|
+
}
|
|
1942
|
+
//#endregion
|
|
1943
|
+
//#region src/context/project-detector.d.ts
|
|
1944
|
+
type TProjectType = 'node' | 'python' | 'rust' | 'go' | 'unknown';
|
|
1945
|
+
type TPackageManager = 'pnpm' | 'yarn' | 'npm' | 'bun';
|
|
1946
|
+
type TLanguage = 'typescript' | 'javascript' | 'python' | 'rust' | 'go' | 'unknown';
|
|
1947
|
+
interface IProjectInfo {
|
|
1948
|
+
type: TProjectType;
|
|
1949
|
+
name?: string;
|
|
1950
|
+
packageManager?: TPackageManager;
|
|
1951
|
+
language: TLanguage;
|
|
1952
|
+
}
|
|
1953
|
+
//#endregion
|
|
1954
|
+
//#region src/context/system-prompt-builder.d.ts
|
|
1955
|
+
interface ISystemPromptParams {
|
|
1956
|
+
/** Concatenated AGENTS.md content (may be empty string) */
|
|
1957
|
+
agentsMd: string;
|
|
1958
|
+
/** Concatenated CLAUDE.md content (may be empty string) */
|
|
1959
|
+
claudeMd: string;
|
|
1960
|
+
/** Startup project memory index loaded from .robota/memory/MEMORY.md */
|
|
1961
|
+
memoryMd?: string;
|
|
1962
|
+
/** Formatted active task context loaded from .agents/tasks/*.md */
|
|
1963
|
+
taskContext?: string;
|
|
1964
|
+
/** Human-readable tool descriptions, one per entry */
|
|
1965
|
+
toolDescriptions: string[];
|
|
1966
|
+
/** Active trust level governing permission checks */
|
|
1967
|
+
trustLevel: TTrustLevel;
|
|
1968
|
+
/** Detected project metadata */
|
|
1969
|
+
projectInfo: IProjectInfo;
|
|
1970
|
+
/** Current working directory */
|
|
1971
|
+
cwd?: string;
|
|
1972
|
+
/** Response language code (e.g., "ko", "en"). If set, AI must respond in this language. */
|
|
1973
|
+
language?: string;
|
|
1974
|
+
/** Discovered skills to expose in the system prompt */
|
|
1975
|
+
skills?: Array<{
|
|
1976
|
+
name: string;
|
|
1977
|
+
description: string;
|
|
1978
|
+
disableModelInvocation?: boolean;
|
|
1979
|
+
}>;
|
|
1980
|
+
/** Discovered agents to expose in the system prompt */
|
|
1981
|
+
agents?: Array<{
|
|
1982
|
+
name: string;
|
|
1983
|
+
description: string;
|
|
1984
|
+
}>;
|
|
1985
|
+
/** Command descriptors to expose to the model */
|
|
1986
|
+
commandDescriptors?: ICapabilityDescriptor[];
|
|
1987
|
+
}
|
|
1988
|
+
//#endregion
|
|
1989
|
+
//#region src/interactive/session-persistence.d.ts
|
|
1990
|
+
interface IInteractiveSessionRecord {
|
|
1991
|
+
id: string;
|
|
1992
|
+
name?: string;
|
|
1993
|
+
cwd: string;
|
|
1994
|
+
createdAt: string;
|
|
1995
|
+
updatedAt: string;
|
|
1996
|
+
messages: TUniversalMessage[];
|
|
1997
|
+
history?: IHistoryEntry[];
|
|
1998
|
+
systemPrompt?: string;
|
|
1999
|
+
toolSchemas?: IToolSchema[];
|
|
2000
|
+
backgroundTasks?: IBackgroundTaskState[];
|
|
2001
|
+
backgroundTaskEvents?: TBackgroundTaskEvent[];
|
|
2002
|
+
backgroundJobGroups?: IBackgroundJobGroupState[];
|
|
2003
|
+
backgroundJobGroupEvents?: TBackgroundJobGroupEvent[];
|
|
2004
|
+
skillActivationEvents?: ISkillActivationEvent[];
|
|
2005
|
+
memoryEvents?: IMemoryEvent[];
|
|
2006
|
+
usedMemoryReferences?: IMemoryReference[];
|
|
2007
|
+
contextReferences?: IContextReferenceItem[];
|
|
2008
|
+
sandboxSnapshotId?: string;
|
|
2009
|
+
}
|
|
2010
|
+
interface IInteractiveSessionStore {
|
|
2011
|
+
save(session: IInteractiveSessionRecord): void;
|
|
2012
|
+
load(id: string): IInteractiveSessionRecord | undefined;
|
|
2013
|
+
list(): IInteractiveSessionRecord[];
|
|
2014
|
+
delete(id: string): void;
|
|
2015
|
+
}
|
|
2016
|
+
interface IResumableSessionSummary {
|
|
2017
|
+
id: string;
|
|
2018
|
+
name?: string;
|
|
2019
|
+
cwd: string;
|
|
2020
|
+
updatedAt: string;
|
|
2021
|
+
messageCount: number;
|
|
2022
|
+
preview: string;
|
|
2023
|
+
}
|
|
2024
|
+
declare function createProjectSessionStore(cwd: string, fs?: IFileSystem): IInteractiveSessionStore;
|
|
2025
|
+
declare function listResumableSessionSummaries(sessionStore: IInteractiveSessionStore | undefined, cwd: string): IResumableSessionSummary[];
|
|
2026
|
+
declare function resolveLatestSessionId(sessionStore: IInteractiveSessionStore | undefined, cwd: string): string | undefined;
|
|
2027
|
+
declare function resolveSessionIdByIdOrName(sessionStore: IInteractiveSessionStore | undefined, idOrName: string): string | undefined;
|
|
2028
|
+
//#endregion
|
|
2029
|
+
//#region src/reversible-execution/reversible-execution-policy.d.ts
|
|
2030
|
+
type TReversibleExecutionIsolation = 'none' | 'worktree' | 'provider-sandbox';
|
|
2031
|
+
type TReversibleRollbackLayer = 'none' | 'edit-checkpoint' | 'worktree' | 'provider-sandbox';
|
|
2032
|
+
type TReversibleSideEffect = 'none' | 'file-mutation' | 'shell-process' | 'subagent' | 'unknown';
|
|
2033
|
+
type TReversibleSafetyStatus = 'reversible' | 'read-only' | 'requires-checkpoint' | 'requires-isolation' | 'unknown';
|
|
2034
|
+
interface IReversibleExecutionOptions {
|
|
2035
|
+
mode: 'local-first';
|
|
2036
|
+
isolation?: TReversibleExecutionIsolation;
|
|
2037
|
+
enforceUntrackedSideEffects?: boolean;
|
|
2038
|
+
}
|
|
2039
|
+
interface IReversibleToolSafetyContext {
|
|
2040
|
+
checkpointAvailable: boolean;
|
|
2041
|
+
isolation: TReversibleExecutionIsolation;
|
|
2042
|
+
}
|
|
2043
|
+
interface IReversibleToolSafetyInput {
|
|
2044
|
+
toolName: string;
|
|
2045
|
+
toolArgs?: TToolArgs;
|
|
2046
|
+
context: IReversibleToolSafetyContext;
|
|
2047
|
+
}
|
|
2048
|
+
interface IReversibleToolSafetyReport {
|
|
2049
|
+
toolName: string;
|
|
2050
|
+
reversible: boolean;
|
|
2051
|
+
sideEffect: TReversibleSideEffect;
|
|
2052
|
+
rollbackLayer: TReversibleRollbackLayer;
|
|
2053
|
+
status: TReversibleSafetyStatus;
|
|
2054
|
+
message: string;
|
|
2055
|
+
}
|
|
2056
|
+
declare function evaluateReversibleToolSafety(input: IReversibleToolSafetyInput): IReversibleToolSafetyReport;
|
|
2057
|
+
declare function wrapReversibleExecutionTools(tools: readonly IToolWithEventService[], options: IReversibleExecutionOptions & {
|
|
2058
|
+
checkpointAvailable: boolean;
|
|
2059
|
+
}): IToolWithEventService[];
|
|
2060
|
+
//#endregion
|
|
2061
|
+
//#region src/hooks/prompt-executor.d.ts
|
|
2062
|
+
/** A minimal provider interface for single-turn completion. */
|
|
2063
|
+
interface IPromptProvider {
|
|
2064
|
+
complete(prompt: string): Promise<string>;
|
|
2065
|
+
}
|
|
2066
|
+
/** Factory that creates a provider instance, optionally for a specific model. */
|
|
2067
|
+
type TProviderFactory = (model?: string) => IPromptProvider;
|
|
2068
|
+
/** Constructor options for PromptExecutor. */
|
|
2069
|
+
interface IPromptExecutorOptions {
|
|
2070
|
+
providerFactory: TProviderFactory;
|
|
2071
|
+
defaultModel?: string;
|
|
2072
|
+
}
|
|
2073
|
+
declare class PromptExecutor implements IHookTypeExecutor {
|
|
2074
|
+
readonly type: "prompt";
|
|
2075
|
+
private readonly providerFactory;
|
|
2076
|
+
private readonly defaultModel;
|
|
2077
|
+
constructor(options: IPromptExecutorOptions);
|
|
2078
|
+
execute(definition: THookDefinition, input: IHookInput): Promise<IHookResult>;
|
|
2079
|
+
}
|
|
2080
|
+
//#endregion
|
|
2081
|
+
//#region src/hooks/agent-executor.d.ts
|
|
2082
|
+
/** A minimal session interface for running a prompt. */
|
|
2083
|
+
interface IAgentSession {
|
|
2084
|
+
run(prompt: string): Promise<string>;
|
|
2085
|
+
}
|
|
2086
|
+
/** Factory that creates a session instance with the given options. */
|
|
2087
|
+
type TSessionFactory = (options: {
|
|
2088
|
+
maxTurns?: number;
|
|
2089
|
+
timeout?: number;
|
|
2090
|
+
}) => IAgentSession;
|
|
2091
|
+
/** Constructor options for AgentExecutor. */
|
|
2092
|
+
interface IAgentExecutorOptions {
|
|
2093
|
+
sessionFactory: TSessionFactory;
|
|
2094
|
+
}
|
|
2095
|
+
declare class AgentExecutor implements IHookTypeExecutor {
|
|
2096
|
+
readonly type: "agent";
|
|
2097
|
+
private readonly sessionFactory;
|
|
2098
|
+
constructor(options: IAgentExecutorOptions);
|
|
2099
|
+
execute(definition: THookDefinition, input: IHookInput): Promise<IHookResult>;
|
|
2100
|
+
}
|
|
2101
|
+
//#endregion
|
|
2102
|
+
//#region src/assembly/create-session-types.d.ts
|
|
2103
|
+
type TAutoCompactThreshold$1 = number | false;
|
|
2104
|
+
/** Options for the createSession factory */
|
|
2105
|
+
interface ICreateSessionOptions {
|
|
2106
|
+
/** Resolved CLI configuration (model, API key, permissions) */
|
|
2107
|
+
config: IResolvedConfig;
|
|
2108
|
+
/** Working directory used for project context, skills, and agent definitions. */
|
|
2109
|
+
cwd?: string;
|
|
2110
|
+
/** Loaded AGENTS.md / CLAUDE.md context */
|
|
2111
|
+
context: ILoadedContext;
|
|
2112
|
+
/** Terminal I/O for permission prompts */
|
|
2113
|
+
terminal: ITerminalOutput;
|
|
2114
|
+
/** Project metadata for system prompt */
|
|
2115
|
+
projectInfo?: IProjectInfo;
|
|
2116
|
+
/** Initial permission mode (defaults to config.defaultTrustLevel → mode mapping) */
|
|
2117
|
+
permissionMode?: TPermissionMode;
|
|
2118
|
+
/** Maximum number of agentic turns per run() call. Undefined = unlimited. */
|
|
2119
|
+
maxTurns?: number;
|
|
2120
|
+
/** Optional session store for persistence */
|
|
2121
|
+
sessionStore?: IInteractiveSessionStore;
|
|
2122
|
+
/** Inject a pre-constructed AI provider (used by tests to avoid real API calls) */
|
|
2123
|
+
provider?: IAIProvider;
|
|
2124
|
+
/** Custom permission handler (overrides terminal-based prompts, used by Ink UI) */
|
|
2125
|
+
permissionHandler?: TPermissionHandler;
|
|
2126
|
+
/** Callback for text deltas — enables streaming text to the UI in real-time */
|
|
2127
|
+
onTextDelta?: (delta: string) => void;
|
|
2128
|
+
/** Callback when context window usage is refreshed */
|
|
2129
|
+
onContextUpdate?: (state: IContextWindowState) => void;
|
|
2130
|
+
/** Custom prompt-for-approval function (injected from CLI) */
|
|
2131
|
+
promptForApproval?: (terminal: ITerminalOutput, toolName: string, toolArgs: TToolArgs) => Promise<boolean>;
|
|
2132
|
+
/** Additional tools to register beyond the defaults (e.g. agent-tool) */
|
|
2133
|
+
additionalTools?: IToolWithEventService[];
|
|
2134
|
+
/** Additional background task runners composed by the runtime shell. */
|
|
2135
|
+
backgroundTaskRunners?: IBackgroundTaskRunner[];
|
|
2136
|
+
/** Runtime shell override for subagent execution. Defaults to the SDK in-process runner. */
|
|
2137
|
+
subagentRunnerFactory?: TSubagentRunnerFactory;
|
|
2138
|
+
/** Enable agent tool, agent definitions, and subagent runtime wiring for this session. */
|
|
2139
|
+
enableAgentRuntime?: boolean;
|
|
2140
|
+
/** Callback when a tool starts or finishes execution — enables real-time tool display in UI */
|
|
2141
|
+
onToolExecution?: (event: {
|
|
2142
|
+
type: 'start' | 'end';
|
|
2143
|
+
toolName: string;
|
|
2144
|
+
toolArgs?: TToolArgs;
|
|
2145
|
+
success?: boolean;
|
|
2146
|
+
denied?: boolean;
|
|
2147
|
+
toolResultData?: string;
|
|
2148
|
+
}) => void;
|
|
2149
|
+
/** Callback when context is compacted */
|
|
2150
|
+
onCompact?: (summary: string) => void;
|
|
2151
|
+
/** Callback with structured compaction metadata */
|
|
2152
|
+
onCompactEvent?: (event: ICompactEvent) => void;
|
|
2153
|
+
/** Instructions to include in the compaction prompt (e.g. from CLAUDE.md) */
|
|
2154
|
+
compactInstructions?: string;
|
|
2155
|
+
/** Auto-compact threshold as a 0-1 fraction. Set false to disable automatic compaction. */
|
|
2156
|
+
autoCompactThreshold?: TAutoCompactThreshold$1;
|
|
2157
|
+
/** Custom system prompt builder function */
|
|
2158
|
+
systemPromptBuilder?: (params: ISystemPromptParams) => string;
|
|
2159
|
+
/** Custom tool descriptions for the system prompt */
|
|
2160
|
+
toolDescriptions?: string[];
|
|
2161
|
+
/** Session logger — injected for pluggable session event logging. */
|
|
2162
|
+
sessionLogger?: ISessionLogger;
|
|
2163
|
+
/** Provider factory for prompt hook executors (DI). */
|
|
2164
|
+
providerFactory?: TProviderFactory;
|
|
2165
|
+
/** Session factory for agent hook executors (DI). */
|
|
2166
|
+
sessionFactory?: TSessionFactory;
|
|
2167
|
+
/** Additional hook type executors beyond the defaults (prompt, agent). */
|
|
2168
|
+
additionalHookExecutors?: IHookTypeExecutor[];
|
|
2169
|
+
/** Override session ID (used when resuming a session to reuse the original ID) */
|
|
2170
|
+
sessionId?: string;
|
|
2171
|
+
/** Pre-approved tool names — added to permissions.allow as ToolName(*) patterns. */
|
|
2172
|
+
allowedTools?: string[];
|
|
2173
|
+
/** Text to append to the generated system prompt. */
|
|
2174
|
+
appendSystemPrompt?: string;
|
|
2175
|
+
/** Model command execution bridge. */
|
|
2176
|
+
modelCommandExecutor?: (command: string, args: string) => Promise<ICommandResult | null>;
|
|
2177
|
+
/** Predicate for commands allowed through the model command execution bridge. */
|
|
2178
|
+
isModelCommandInvocable?: (command: string) => boolean;
|
|
2179
|
+
/** Model-visible command descriptors. */
|
|
2180
|
+
commandDescriptors?: ICapabilityDescriptor[];
|
|
2181
|
+
/** Recorder used to snapshot files before Write/Edit tools mutate them. */
|
|
2182
|
+
editCheckpointRecorder?: IEditCheckpointRecorder;
|
|
2183
|
+
/** Opt-in local-first reversible execution policy for write/shell tools. */
|
|
2184
|
+
reversibleExecution?: IReversibleExecutionOptions;
|
|
2185
|
+
/** Optional provider sandbox client used by sandbox-aware built-in tools. */
|
|
2186
|
+
sandboxClient?: ISandboxClient;
|
|
2187
|
+
/** Name reported to the underlying Robota agent config. Defaults to 'agent'. */
|
|
2188
|
+
agentName?: string;
|
|
2189
|
+
}
|
|
2190
|
+
//#endregion
|
|
2191
|
+
//#region src/assembly/create-tools.d.ts
|
|
2192
|
+
/**
|
|
2193
|
+
* Create the default set of CLI tools.
|
|
2194
|
+
* Returns the 8 standard tools as IToolWithEventService[].
|
|
2195
|
+
*/
|
|
2196
|
+
interface ICreateDefaultToolsOptions {
|
|
2197
|
+
sandboxClient?: ISandboxClient;
|
|
2198
|
+
}
|
|
2199
|
+
declare function createDefaultTools(options?: ICreateDefaultToolsOptions): IToolWithEventService[];
|
|
2200
|
+
//#endregion
|
|
2201
|
+
//#region src/assembly/subagent-prompts.d.ts
|
|
2202
|
+
/**
|
|
2203
|
+
* Framework system prompt suffixes for subagent sessions.
|
|
2204
|
+
*
|
|
2205
|
+
* These functions generate the standard prompt content injected into
|
|
2206
|
+
* subagent sessions to control output format and behavior.
|
|
2207
|
+
*/
|
|
2208
|
+
/** Options for assembling a subagent system prompt. */
|
|
2209
|
+
interface ISubagentPromptOptions {
|
|
2210
|
+
/** Agent definition markdown body. */
|
|
2211
|
+
agentBody: string;
|
|
2212
|
+
/** CLAUDE.md content to include. */
|
|
2213
|
+
claudeMd?: string;
|
|
2214
|
+
/** AGENTS.md content to include. */
|
|
2215
|
+
agentsMd?: string;
|
|
2216
|
+
/** When true, use fork worker suffix instead of standard subagent suffix. */
|
|
2217
|
+
isForkWorker: boolean;
|
|
2218
|
+
}
|
|
2219
|
+
/**
|
|
2220
|
+
* Returns the standard subagent suffix appended to agent body for normal subagents.
|
|
2221
|
+
*/
|
|
2222
|
+
declare function getSubagentSuffix(): string;
|
|
2223
|
+
/**
|
|
2224
|
+
* Returns the fork worker suffix for context:fork skill workers.
|
|
2225
|
+
*/
|
|
2226
|
+
declare function getForkWorkerSuffix(): string;
|
|
2227
|
+
/**
|
|
2228
|
+
* Assembles the full system prompt for a subagent.
|
|
2229
|
+
*
|
|
2230
|
+
* Assembly order:
|
|
2231
|
+
* 1. Agent definition body
|
|
2232
|
+
* 2. CLAUDE.md content (if provided)
|
|
2233
|
+
* 3. AGENTS.md content (if provided)
|
|
2234
|
+
* 4. Framework suffix (fork worker OR standard subagent)
|
|
2235
|
+
*/
|
|
2236
|
+
declare function assembleSubagentPrompt(options: ISubagentPromptOptions): string;
|
|
2237
|
+
//#endregion
|
|
2238
|
+
//#region src/assembly/subagent-logger.d.ts
|
|
2239
|
+
/**
|
|
2240
|
+
* Create a FileSessionLogger for a subagent session.
|
|
2241
|
+
*
|
|
2242
|
+
* The logger writes JSONL files into a `subagents/` subdirectory under the
|
|
2243
|
+
* parent session's log folder. The directory is created if it does not exist.
|
|
2244
|
+
*
|
|
2245
|
+
* @param parentSessionId - ID of the parent session (used as directory name)
|
|
2246
|
+
* @param agentId - Unique identifier for this subagent run
|
|
2247
|
+
* @param baseLogsDir - Root logs directory (e.g., `.robota/logs`)
|
|
2248
|
+
* @returns A FileSessionLogger writing to the subagent directory
|
|
2249
|
+
*/
|
|
2250
|
+
declare function createSubagentLogger(parentSessionId: string, _agentId: string, baseLogsDir: string, fs?: IFileSystem): FileSessionLogger;
|
|
2251
|
+
/**
|
|
2252
|
+
* Resolve the subagent log directory path without creating it.
|
|
2253
|
+
*
|
|
2254
|
+
* Useful when the caller needs the path for display or configuration
|
|
2255
|
+
* but does not want to create the directory immediately.
|
|
2256
|
+
*
|
|
2257
|
+
* @param parentSessionId - ID of the parent session
|
|
2258
|
+
* @param baseLogsDir - Root logs directory
|
|
2259
|
+
* @returns The resolved subagent log directory path
|
|
2260
|
+
*/
|
|
2261
|
+
declare function resolveSubagentLogDir(parentSessionId: string, baseLogsDir: string): string;
|
|
2262
|
+
//#endregion
|
|
2263
|
+
//#region src/interactive/interactive-session-options.d.ts
|
|
2264
|
+
/** Standard construction: cwd + provider. Config/context loaded internally. */
|
|
2265
|
+
interface IInteractiveSessionStandardOptions {
|
|
2266
|
+
cwd: string;
|
|
2267
|
+
provider: IAIProvider;
|
|
2268
|
+
permissionMode?: ICreateSessionOptions['permissionMode'];
|
|
2269
|
+
maxTurns?: number;
|
|
2270
|
+
permissionHandler?: TInteractivePermissionHandler;
|
|
2271
|
+
sessionStore?: IInteractiveSessionStore;
|
|
2272
|
+
sessionName?: string;
|
|
2273
|
+
resumeSessionId?: string;
|
|
2274
|
+
forkSession?: boolean;
|
|
2275
|
+
/** Skip AGENTS.md/CLAUDE.md loading and plugin discovery. */
|
|
2276
|
+
bare?: boolean;
|
|
2277
|
+
/** Pre-approved tool names passed to createSession. */
|
|
2278
|
+
allowedTools?: string[];
|
|
2279
|
+
/** Text to append to the system prompt. */
|
|
2280
|
+
appendSystemPrompt?: string;
|
|
2281
|
+
/** Override config language (e.g., "ko", "en"). Injected into system prompt. */
|
|
2282
|
+
language?: string;
|
|
2283
|
+
/** Runtime-composed background task runners. */
|
|
2284
|
+
backgroundTaskRunners?: IBackgroundTaskRunner[];
|
|
2285
|
+
/** Runtime shell override for subagent execution. */
|
|
2286
|
+
subagentRunnerFactory?: TSubagentRunnerFactory;
|
|
2287
|
+
/** Optional command modules composed into this session. */
|
|
2288
|
+
commandModules?: readonly ICommandModule[];
|
|
2289
|
+
/** Host adapters available to composed command modules. */
|
|
2290
|
+
commandHostAdapters?: ICommandHostAdapters;
|
|
2291
|
+
/** Shell exec function for preprocessing `` !`cmd` `` patterns in skills — injected from composition root. */
|
|
2292
|
+
shellExec?: TShellExecFn;
|
|
2293
|
+
/** Model-visible command descriptors derived from the composed command executor. */
|
|
2294
|
+
commandDescriptors?: readonly ICapabilityDescriptor[];
|
|
2295
|
+
/** Model command execution bridge. */
|
|
2296
|
+
modelCommandExecutor?: (command: string, args: string) => Promise<ICommandResult | null>;
|
|
2297
|
+
/** Predicate for commands allowed through the model command execution bridge. */
|
|
2298
|
+
isModelCommandInvocable?: (command: string) => boolean;
|
|
2299
|
+
/** Preloaded config to avoid duplicate discovery when caller needs it too. */
|
|
2300
|
+
config?: IResolvedConfig;
|
|
2301
|
+
/** Opt-in local-first reversible execution policy for write/shell tools. */
|
|
2302
|
+
reversibleExecution?: IReversibleExecutionOptions;
|
|
2303
|
+
/** Optional provider sandbox client used by sandbox-aware built-in tools. */
|
|
2304
|
+
sandboxClient?: ISandboxClient;
|
|
2305
|
+
/** Fresh-session workspace manifest applied through the sandbox client. */
|
|
2306
|
+
workspaceManifest?: IWorkspaceManifest;
|
|
2307
|
+
/** Sandbox target root for workspace manifest entries. Defaults to /workspace. */
|
|
2308
|
+
sandboxWorkspaceRoot?: string;
|
|
2309
|
+
/** Provider sandbox snapshot id to restore before replaying saved messages. */
|
|
2310
|
+
sandboxSnapshotId?: string;
|
|
2311
|
+
/** Name reported to the underlying Robota agent config. Defaults to 'agent'. */
|
|
2312
|
+
agentName?: string;
|
|
2313
|
+
}
|
|
2314
|
+
/** Test/advanced construction: inject pre-built session directly. */
|
|
2315
|
+
interface IInteractiveSessionInjectedOptions {
|
|
2316
|
+
session: Session;
|
|
2317
|
+
cwd?: string;
|
|
2318
|
+
provider?: IAIProvider;
|
|
2319
|
+
permissionMode?: ICreateSessionOptions['permissionMode'];
|
|
2320
|
+
maxTurns?: number;
|
|
2321
|
+
permissionHandler?: TInteractivePermissionHandler;
|
|
2322
|
+
sessionStore?: IInteractiveSessionStore;
|
|
2323
|
+
sessionName?: string;
|
|
2324
|
+
resumeSessionId?: string;
|
|
2325
|
+
forkSession?: boolean;
|
|
2326
|
+
/** Optional command modules composed into this injected session. */
|
|
2327
|
+
commandModules?: readonly ICommandModule[];
|
|
2328
|
+
/** Host adapters available to composed command modules. */
|
|
2329
|
+
commandHostAdapters?: ICommandHostAdapters;
|
|
2330
|
+
}
|
|
2331
|
+
/** Union of standard and injected construction options. */
|
|
2332
|
+
type TInteractiveSessionOptions = IInteractiveSessionStandardOptions | IInteractiveSessionInjectedOptions;
|
|
2333
|
+
//#endregion
|
|
2334
|
+
//#region src/interactive/interactive-session-background-tracker.d.ts
|
|
2335
|
+
interface IBackgroundTrackerState {
|
|
2336
|
+
tasks: IBackgroundTaskState[];
|
|
2337
|
+
taskEvents: TBackgroundTaskEvent[];
|
|
2338
|
+
groups: IBackgroundJobGroupState[];
|
|
2339
|
+
groupEvents: TBackgroundJobGroupEvent[];
|
|
2340
|
+
}
|
|
2341
|
+
declare class SessionBackgroundTaskTracker {
|
|
2342
|
+
private readonly getManager;
|
|
2343
|
+
private readonly onChanged;
|
|
2344
|
+
private readonly emitTaskEvent;
|
|
2345
|
+
private readonly emitGroupEvent;
|
|
2346
|
+
private readonly persistSession;
|
|
2347
|
+
private backgroundTasks;
|
|
2348
|
+
private backgroundTaskEvents;
|
|
2349
|
+
private backgroundJobGroups;
|
|
2350
|
+
private backgroundJobGroupEvents;
|
|
2351
|
+
private backgroundTaskUnsubscribe;
|
|
2352
|
+
private backgroundJobUnsubscribe;
|
|
2353
|
+
private backgroundJobOrchestrator;
|
|
2354
|
+
constructor(getManager: () => IBackgroundTaskManager | undefined, onChanged: (cause: TExecutionWorkspaceUpdateCause, entryId?: string) => void, emitTaskEvent: (event: TBackgroundTaskEvent) => void, emitGroupEvent: (event: TBackgroundJobGroupEvent) => void, persistSession: () => void);
|
|
2355
|
+
subscribe(session: Session): void;
|
|
2356
|
+
dispose(): void;
|
|
2357
|
+
restoreState(state: IBackgroundTrackerState): void;
|
|
2358
|
+
getState(): IBackgroundTrackerState;
|
|
2359
|
+
getManagerOrThrow(): IBackgroundTaskManager;
|
|
2360
|
+
getOrchestratorOrThrow(sessionId: string): BackgroundJobOrchestrator;
|
|
2361
|
+
cancelTask(taskId: string, reason?: string): Promise<void>;
|
|
2362
|
+
closeTask(taskId: string): Promise<void>;
|
|
2363
|
+
sendTask(taskId: string, input: IBackgroundTaskInput): Promise<void>;
|
|
2364
|
+
readTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
2365
|
+
listTasks(filter?: IBackgroundTaskListFilter): IBackgroundTaskState[];
|
|
2366
|
+
getTask(taskId: string): IBackgroundTaskState | undefined;
|
|
2367
|
+
createGroup(input: Omit<IBackgroundJobGroupCreateRequest, 'parentSessionId'>, sessionId: string): IBackgroundJobGroupState;
|
|
2368
|
+
listGroups(sessionId: string): IBackgroundJobGroupState[];
|
|
2369
|
+
getGroup(groupId: string, sessionId: string): IBackgroundJobGroupState | undefined;
|
|
2370
|
+
waitGroup(groupId: string, sessionId: string): Promise<IBackgroundJobGroupState>;
|
|
2371
|
+
readTaskDetail(entryId: string, taskId: string, cursor?: IExecutionDetailCursor): Promise<IExecutionDetailPage>;
|
|
2372
|
+
readGroupDetail(entryId: string, groupId: string, sessionId: string): IExecutionDetailPage;
|
|
2373
|
+
getTaskSnapshots(): IBackgroundTaskState[];
|
|
2374
|
+
getGroupSnapshots(): IBackgroundJobGroupState[];
|
|
2375
|
+
private subscribeGroupEvents;
|
|
2376
|
+
private recordTaskEvent;
|
|
2377
|
+
private recordGroupEvent;
|
|
2378
|
+
}
|
|
2379
|
+
//#endregion
|
|
2380
|
+
//#region src/interactive/interactive-session-history-tracker.d.ts
|
|
2381
|
+
interface IHistoryTrackerState {
|
|
2382
|
+
history: IHistoryEntry[];
|
|
2383
|
+
memoryEvents: IMemoryEvent[];
|
|
2384
|
+
usedMemoryReferences: IMemoryReference[];
|
|
2385
|
+
contextReferences: IContextReferenceItem[];
|
|
2386
|
+
skillActivationEvents: ISkillActivationEvent[];
|
|
2387
|
+
}
|
|
2388
|
+
declare class SessionHistoryTracker {
|
|
2389
|
+
private readonly cwd;
|
|
2390
|
+
private readonly getSessionId;
|
|
2391
|
+
private readonly getExecuting;
|
|
2392
|
+
private readonly persistSession;
|
|
2393
|
+
private readonly emitSkillActivation;
|
|
2394
|
+
private history;
|
|
2395
|
+
private editCheckpointStore;
|
|
2396
|
+
private memoryEvents;
|
|
2397
|
+
private usedMemoryReferences;
|
|
2398
|
+
private contextReferences;
|
|
2399
|
+
private skillActivationEvents;
|
|
2400
|
+
constructor(cwd: string, getSessionId: () => string, getExecuting: () => boolean, persistSession: () => void, emitSkillActivation: (event: ISkillActivationEvent) => void, editCheckpointStore?: EditCheckpointStore | null);
|
|
2401
|
+
restoreState(state: IHistoryTrackerState): void;
|
|
2402
|
+
getState(): IHistoryTrackerState;
|
|
2403
|
+
append(entry: IHistoryEntry): void;
|
|
2404
|
+
getHistory(): IHistoryEntry[];
|
|
2405
|
+
clearHistory(): void;
|
|
2406
|
+
resetUsedMemoryReferences(): void;
|
|
2407
|
+
recordContextReferenceUsage(records: readonly IPromptFileReferenceRecord[]): void;
|
|
2408
|
+
recordPromptContextReferences(records: readonly IPromptFileReferenceRecord[]): void;
|
|
2409
|
+
listEditCheckpoints(): IEditCheckpointSummary[];
|
|
2410
|
+
inspectEditCheckpoint(checkpointId: string): IEditCheckpointInspection;
|
|
2411
|
+
restoreEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
2412
|
+
rollbackEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
2413
|
+
beginEditCheckpointTurn(prompt: string): Promise<void>;
|
|
2414
|
+
finalizeEditCheckpointTurn(): Promise<void>;
|
|
2415
|
+
setEditCheckpointStore(store: EditCheckpointStore): void;
|
|
2416
|
+
getUsedMemoryReferences(): IMemoryReference[];
|
|
2417
|
+
recordMemoryEvent(event: IMemoryEvent): void;
|
|
2418
|
+
listContextReferences(): IContextReferenceItem[];
|
|
2419
|
+
addContextReference(path: string): Promise<IContextReferenceAddResult>;
|
|
2420
|
+
removeContextReference(path: string): IContextReferenceRemoveResult;
|
|
2421
|
+
clearContextReferences(): IContextReferenceClearResult;
|
|
2422
|
+
getSkillActivationEvents(): ISkillActivationEvent[];
|
|
2423
|
+
recordSkillActivationEvent(event: ISkillActivationEvent, appendHistory: boolean): void;
|
|
2424
|
+
private getCheckpointStore;
|
|
2425
|
+
}
|
|
2426
|
+
//#endregion
|
|
2427
|
+
//#region src/interactive/interactive-session-skill-router.d.ts
|
|
2428
|
+
declare class SessionSkillRouter {
|
|
2429
|
+
private readonly getSession;
|
|
2430
|
+
private readonly getSessionId;
|
|
2431
|
+
private readonly onSubmit;
|
|
2432
|
+
private readonly onApplyResult;
|
|
2433
|
+
private readonly recordSkillActivation;
|
|
2434
|
+
private readonly runSkillInFork;
|
|
2435
|
+
/** Called when a fork-context skill needs full lifecycle management (executing flag etc.) */
|
|
2436
|
+
private readonly onForkSkill;
|
|
2437
|
+
/** Called for blocking commands — wraps execution with thinking/executing lifecycle */
|
|
2438
|
+
private readonly onBlockingCommand;
|
|
2439
|
+
private readonly shellExec?;
|
|
2440
|
+
readonly commandExecutor: SystemCommandExecutor;
|
|
2441
|
+
private readonly skillCommandSource;
|
|
2442
|
+
private readonly commandHostAdapters?;
|
|
2443
|
+
private commandInvocationSource;
|
|
2444
|
+
constructor(commandModules: readonly ICommandModule[], cwd: string, commandHostAdapters: ICommandHostAdapters | undefined, getSession: () => ICommandHostContext, getSessionId: () => string, onSubmit: (prompt: string, displayInput?: string, rawInput?: string) => Promise<void>, onApplyResult: (result: string) => Promise<void>, recordSkillActivation: (event: ISkillActivationEvent, appendHistory: boolean) => void, runSkillInFork: (content: string, options: IForkExecutionOptions) => Promise<string>, /** Called when a fork-context skill needs full lifecycle management (executing flag etc.) */
|
|
2445
|
+
|
|
2446
|
+
onForkSkill: (skill: ICommand, args: string, displayInput: string | undefined, qualifiedName: string | undefined, invocation: ISkillActivationEvent['invocation']) => Promise<ISkillExecutionResult>, /** Called for blocking commands — wraps execution with thinking/executing lifecycle */
|
|
2447
|
+
|
|
2448
|
+
onBlockingCommand: (execute: () => Promise<ICommandResult>) => Promise<ICommandResult>, shellExec?: TShellExecFn | undefined);
|
|
2449
|
+
getCommandInvocationSource(): TCommandInvocationSource;
|
|
2450
|
+
getCommandHostAdapters(): ICommandHostAdapters;
|
|
2451
|
+
listCommands(): Array<{
|
|
2452
|
+
name: string;
|
|
2453
|
+
displayName?: string;
|
|
2454
|
+
description: string;
|
|
2455
|
+
}>;
|
|
2456
|
+
listSkills(): ICommandSkillListEntry[];
|
|
2457
|
+
listModelInvocableCommands(): Array<{
|
|
2458
|
+
name: string;
|
|
2459
|
+
description: string;
|
|
2460
|
+
}>;
|
|
2461
|
+
findSkillCommand(name: string): ICommand | undefined;
|
|
2462
|
+
executeCommand(name: string, args: string): Promise<ICommandResult | null>;
|
|
2463
|
+
executeCommandWithSource(source: TCommandInvocationSource, command: ISystemCommand, args: string): Promise<ICommandResult>;
|
|
2464
|
+
executeModelCommand(name: string, args: string): Promise<ICommandResult | null>;
|
|
2465
|
+
executeSkillCommandByName(name: string, args: string, request: ICommandSkillActivationRequest): Promise<ICommandResult | null>;
|
|
2466
|
+
executeUserResolvedSkillCommand(skill: ICommand, args: string, displayInput: string | undefined, rawInput: string | undefined, invocation: ISkillActivationEvent['invocation']): Promise<ISkillExecutionResult>;
|
|
2467
|
+
executeSkillWithActivation(skill: ICommand, args: string, invocation: ISkillActivationEvent['invocation'], qualifiedName?: string): Promise<ISkillExecutionResult>;
|
|
2468
|
+
private emitSkillActivation;
|
|
2469
|
+
private executeForegroundCommand;
|
|
2470
|
+
}
|
|
2471
|
+
//#endregion
|
|
2472
|
+
//#region src/interactive/interactive-session-init.d.ts
|
|
2473
|
+
/** Return value of createInteractiveSession — session plus staleness tracking data. */
|
|
2474
|
+
interface ICreatedInteractiveSession {
|
|
2475
|
+
session: Session;
|
|
2476
|
+
/** Per-file entries for AGENTS.md files loaded at startup. Used for staleness detection. */
|
|
2477
|
+
agentsFileEntries: IContextFileEntry[];
|
|
2478
|
+
/** Per-file entries for CLAUDE.md files loaded at startup. Used for staleness detection. */
|
|
2479
|
+
claudeFileEntries: IContextFileEntry[];
|
|
2480
|
+
/** Rebuilds the system message given updated agentsMd and claudeMd strings. */
|
|
2481
|
+
rebuildSystemMessage: (agentsMd: string, claudeMd: string) => string;
|
|
2482
|
+
}
|
|
2483
|
+
//#endregion
|
|
2484
|
+
//#region src/interactive/interactive-session-execution-controller.d.ts
|
|
2485
|
+
interface IExecutionControllerCallbacks {
|
|
2486
|
+
getSession: () => Session;
|
|
2487
|
+
getSessionOrThrow: () => Session;
|
|
2488
|
+
getCwd: () => string;
|
|
2489
|
+
getContextState: () => IContextWindowState;
|
|
2490
|
+
getExecutionWorkspaceSnapshot: () => IExecutionWorkspaceSnapshot;
|
|
2491
|
+
emit: <E extends string>(event: E, ...args: unknown[]) => void;
|
|
2492
|
+
persistSession: () => void;
|
|
2493
|
+
}
|
|
2494
|
+
declare class SessionExecutionController {
|
|
2495
|
+
private readonly histTracker;
|
|
2496
|
+
private readonly skillRouter;
|
|
2497
|
+
private readonly callbacks;
|
|
2498
|
+
executing: boolean;
|
|
2499
|
+
streamingText: string;
|
|
2500
|
+
flushTimer: ReturnType<typeof setTimeout> | null;
|
|
2501
|
+
activeTools: IToolState[];
|
|
2502
|
+
pendingPrompt: string | null;
|
|
2503
|
+
pendingDisplayInput: string | undefined;
|
|
2504
|
+
pendingRawInput: string | undefined;
|
|
2505
|
+
shuttingDown: boolean;
|
|
2506
|
+
constructor(histTracker: SessionHistoryTracker, skillRouter: SessionSkillRouter, callbacks: IExecutionControllerCallbacks);
|
|
2507
|
+
clearPendingQueue(): void;
|
|
2508
|
+
clearStreaming(): void;
|
|
2509
|
+
flushStreaming(): void;
|
|
2510
|
+
handleTextDelta(delta: string): void;
|
|
2511
|
+
handleCompactEvent(event: ICompactEvent): void;
|
|
2512
|
+
handleToolExecution(event: {
|
|
2513
|
+
type: 'start' | 'end';
|
|
2514
|
+
toolName: string;
|
|
2515
|
+
toolArgs?: TToolArgs;
|
|
2516
|
+
success?: boolean;
|
|
2517
|
+
denied?: boolean;
|
|
2518
|
+
toolResultData?: string;
|
|
2519
|
+
}): void;
|
|
2520
|
+
emitExecutionWorkspaceUpdated(cause: TExecutionWorkspaceUpdateCause, entryId?: string): void;
|
|
2521
|
+
private drainPendingQueue;
|
|
2522
|
+
executePrompt(input: string, displayInput: string | undefined, rawInput: string | undefined, agentsFileEntries: IContextFileEntry[], claudeFileEntries: IContextFileEntry[], rebuildSystemMessage: ICreatedInteractiveSession['rebuildSystemMessage'] | null, setEntries: (agents: IContextFileEntry[], claude: IContextFileEntry[]) => void, submit: (p: string, d?: string, r?: string) => Promise<void>): Promise<void>;
|
|
2523
|
+
executeForkSkillCommand(skill: ICommand, args: string, displayInput: string | undefined, qualifiedName: string | undefined, invocation: ISkillActivationEvent['invocation'], submit: (p: string, d?: string, r?: string) => Promise<void>): Promise<ISkillExecutionResult>;
|
|
2524
|
+
executeForegroundCommand(execute: () => Promise<ICommandResult>, submit: (p: string, d?: string, r?: string) => Promise<void>): Promise<ICommandResult>;
|
|
2525
|
+
applyForkSkillResult(result: string): Promise<void>;
|
|
2526
|
+
}
|
|
2527
|
+
//#endregion
|
|
2528
|
+
//#region src/tools/agent-tool.d.ts
|
|
2529
|
+
/** Dependencies injected at creation time via createAgentTool factory */
|
|
2530
|
+
interface IAgentToolDeps extends IInProcessSubagentRunnerDeps {
|
|
2531
|
+
cwd?: string;
|
|
2532
|
+
parentSessionId?: string;
|
|
2533
|
+
subagentDepth?: number;
|
|
2534
|
+
subagentManager?: ISubagentManager;
|
|
2535
|
+
backgroundTaskManager?: IBackgroundTaskManager;
|
|
2536
|
+
/** Optional custom agent registry for resolving non-built-in agent types. */
|
|
2537
|
+
customAgentRegistry?: (name: string) => IAgentDefinition | undefined;
|
|
2538
|
+
/** Model-visible and command-visible agent definitions available to this session. */
|
|
2539
|
+
agentDefinitions?: IAgentDefinition[];
|
|
2540
|
+
}
|
|
2541
|
+
/** Store agent tool deps keyed by a session (or any object). */
|
|
2542
|
+
declare function storeAgentToolDeps(key: object, deps: IAgentToolDeps): void;
|
|
2543
|
+
/** Retrieve agent tool deps for a given session key. */
|
|
2544
|
+
declare function retrieveAgentToolDeps(key: object): IAgentToolDeps | undefined;
|
|
2545
|
+
/**
|
|
2546
|
+
* Create an agent tool instance with deps captured in closure.
|
|
2547
|
+
*
|
|
2548
|
+
* Each session gets its own tool instance — no shared mutable state.
|
|
2549
|
+
*/
|
|
2550
|
+
declare function createAgentTool(deps: IAgentToolDeps): ReturnType<typeof createZodFunctionTool>;
|
|
2551
|
+
//#endregion
|
|
2552
|
+
//#region src/interactive/interactive-session-agent-jobs.d.ts
|
|
2553
|
+
interface ISpawnAgentJobInput {
|
|
2554
|
+
agentType: string;
|
|
2555
|
+
label: string;
|
|
2556
|
+
mode: 'foreground' | 'background';
|
|
2557
|
+
prompt: string;
|
|
2558
|
+
model?: string;
|
|
2559
|
+
isolation?: TBackgroundTaskIsolation;
|
|
2560
|
+
}
|
|
2561
|
+
//#endregion
|
|
2562
|
+
//#region src/interactive/interactive-session-base.d.ts
|
|
2563
|
+
declare abstract class InteractiveSessionBase {
|
|
2564
|
+
protected abstract readonly bgTracker: SessionBackgroundTaskTracker;
|
|
2565
|
+
protected abstract readonly histTracker: SessionHistoryTracker;
|
|
2566
|
+
protected abstract readonly skillRouter: SessionSkillRouter;
|
|
2567
|
+
protected abstract readonly execCtrl: SessionExecutionController;
|
|
2568
|
+
protected abstract getSessionOrThrow(): Session;
|
|
2569
|
+
protected abstract ensureInitialized(): Promise<void>;
|
|
2570
|
+
protected abstract getCwd(): string;
|
|
2571
|
+
isExecuting(): boolean;
|
|
2572
|
+
getPendingPrompt(): string | null;
|
|
2573
|
+
getStreamingText(): string;
|
|
2574
|
+
getActiveTools(): IToolState[];
|
|
2575
|
+
cancelQueue(): void;
|
|
2576
|
+
executeCommand(name: string, args: string): Promise<ICommandResult | null>;
|
|
2577
|
+
executeModelCommand(name: string, args: string): Promise<ICommandResult | null>;
|
|
2578
|
+
getCommandInvocationSource(): TCommandInvocationSource;
|
|
2579
|
+
executeSkillCommandByName(name: string, args: string, request: ICommandSkillActivationRequest): Promise<ICommandResult | null>;
|
|
2580
|
+
listCommands(): Array<{
|
|
2581
|
+
name: string;
|
|
2582
|
+
displayName?: string;
|
|
2583
|
+
description: string;
|
|
2584
|
+
}>;
|
|
2585
|
+
listSkills(): ICommandSkillListEntry[];
|
|
2586
|
+
listModelInvocableCommands(): Array<{
|
|
2587
|
+
name: string;
|
|
2588
|
+
description: string;
|
|
2589
|
+
}>;
|
|
2590
|
+
getCommandHostAdapters(): ICommandHostAdapters;
|
|
2591
|
+
getSkillActivationEvents(): ISkillActivationEvent[];
|
|
2592
|
+
getContextState(): IContextWindowState;
|
|
2593
|
+
compactContext(instructions?: string): Promise<void>;
|
|
2594
|
+
getFullHistory(): IHistoryEntry[];
|
|
2595
|
+
getMessages(): TUniversalMessage[];
|
|
2596
|
+
listEditCheckpoints(): IEditCheckpointSummary[];
|
|
2597
|
+
inspectEditCheckpoint(checkpointId: string): IEditCheckpointInspection;
|
|
2598
|
+
restoreEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
2599
|
+
rollbackEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
2600
|
+
getUsedMemoryReferences(): IMemoryReference[];
|
|
2601
|
+
recordMemoryEvent(event: IMemoryEvent): void;
|
|
2602
|
+
listContextReferences(): IContextReferenceItem[];
|
|
2603
|
+
addContextReference(path: string): Promise<IContextReferenceAddResult>;
|
|
2604
|
+
removeContextReference(path: string): IContextReferenceRemoveResult;
|
|
2605
|
+
clearContextReferences(): IContextReferenceClearResult;
|
|
2606
|
+
listBackgroundTasks(filter?: IBackgroundTaskListFilter): IBackgroundTaskState[];
|
|
2607
|
+
getBackgroundTask(taskId: string): IBackgroundTaskState | undefined;
|
|
2608
|
+
cancelBackgroundTask(taskId: string, reason?: string): Promise<void>;
|
|
2609
|
+
closeBackgroundTask(taskId: string): Promise<void>;
|
|
2610
|
+
sendBackgroundTask(taskId: string, input: IBackgroundTaskInput): Promise<void>;
|
|
2611
|
+
readBackgroundTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
2612
|
+
createBackgroundJobGroup(input: Omit<IBackgroundJobGroupCreateRequest, 'parentSessionId'>): IBackgroundJobGroupState;
|
|
2613
|
+
listBackgroundJobGroups(): IBackgroundJobGroupState[];
|
|
2614
|
+
getBackgroundJobGroup(groupId: string): IBackgroundJobGroupState | undefined;
|
|
2615
|
+
waitBackgroundJobGroup(groupId: string): Promise<IBackgroundJobGroupState>;
|
|
2616
|
+
getExecutionWorkspaceSnapshot(options?: IExecutionWorkspaceSnapshotOptions): IExecutionWorkspaceSnapshot;
|
|
2617
|
+
listExecutionWorkspaceEntries(filter?: IExecutionWorkspaceFilter): IExecutionWorkspaceEntry[];
|
|
2618
|
+
getExecutionWorkspaceEntry(entryId: string): IExecutionWorkspaceEntry | undefined;
|
|
2619
|
+
readExecutionWorkspaceDetail(entryId: string, cursor?: IExecutionDetailCursor): Promise<IExecutionDetailPage>;
|
|
2620
|
+
createExecutionWorkspaceTaskSpawner(origin: IExecutionOrigin): IExecutionWorkspaceTaskSpawner;
|
|
2621
|
+
listAgentDefinitions(): Array<{
|
|
2622
|
+
name: string;
|
|
2623
|
+
description: string;
|
|
2624
|
+
}>;
|
|
2625
|
+
listAgentJobs(): ISubagentJobState[];
|
|
2626
|
+
spawnAgentJob(input: ISpawnAgentJobInput): Promise<ISubagentJobState>;
|
|
2627
|
+
waitAgentJob(jobId: string): Promise<ISubagentJobResult>;
|
|
2628
|
+
sendAgentJob(jobId: string, prompt: string): Promise<void>;
|
|
2629
|
+
cancelAgentJob(jobId: string, reason?: string): Promise<void>;
|
|
2630
|
+
closeAgentJob(jobId: string): Promise<void>;
|
|
2631
|
+
}
|
|
2632
|
+
//#endregion
|
|
2633
|
+
//#region src/interactive/interactive-session.d.ts
|
|
2634
|
+
interface IInteractiveSessionShutdownOptions {
|
|
2635
|
+
reason?: TSessionEndReason;
|
|
2636
|
+
message?: string;
|
|
2637
|
+
}
|
|
2638
|
+
declare class InteractiveSession extends InteractiveSessionBase implements ISession, IAgentJobHostContext, IInteractiveSession {
|
|
2639
|
+
private session;
|
|
2640
|
+
private readonly listeners;
|
|
2641
|
+
private initialized;
|
|
2642
|
+
private initPromise;
|
|
2643
|
+
private sessionStore?;
|
|
2644
|
+
private sessionName?;
|
|
2645
|
+
private cwd?;
|
|
2646
|
+
private pendingRestoreMessages;
|
|
2647
|
+
private resumeSessionId?;
|
|
2648
|
+
private forkSession;
|
|
2649
|
+
private autoCompactThresholdSource;
|
|
2650
|
+
private shutdownPromise;
|
|
2651
|
+
private readonly sandboxClient?;
|
|
2652
|
+
private sandboxSnapshotId?;
|
|
2653
|
+
private agentsFileEntries;
|
|
2654
|
+
private claudeFileEntries;
|
|
2655
|
+
private rebuildSystemMessage;
|
|
2656
|
+
protected readonly bgTracker: SessionBackgroundTaskTracker;
|
|
2657
|
+
protected readonly histTracker: SessionHistoryTracker;
|
|
2658
|
+
protected readonly skillRouter: SessionSkillRouter;
|
|
2659
|
+
protected readonly execCtrl: SessionExecutionController;
|
|
2660
|
+
constructor(options: TInteractiveSessionOptions);
|
|
2661
|
+
private configureInjectedSession;
|
|
2662
|
+
private restoreSessionRecordIfNeeded;
|
|
2663
|
+
private startAsyncInitializationIfNeeded;
|
|
2664
|
+
private initializeAsync;
|
|
2665
|
+
protected ensureInitialized(): Promise<void>;
|
|
2666
|
+
protected getSessionOrThrow(): Session;
|
|
2667
|
+
getCwd(): string;
|
|
2668
|
+
get sessionId(): string;
|
|
2669
|
+
on<E extends TInteractiveEventName>(event: E, handler: IInteractiveSessionEvents[E]): void;
|
|
2670
|
+
off<E extends TInteractiveEventName>(event: E, handler: IInteractiveSessionEvents[E]): void;
|
|
2671
|
+
private emit;
|
|
2672
|
+
submit(input: string, displayInput?: string, rawInput?: string): Promise<void>;
|
|
2673
|
+
abort(): void;
|
|
2674
|
+
shutdown(options?: IInteractiveSessionShutdownOptions): Promise<void>;
|
|
2675
|
+
get isInitialized(): boolean;
|
|
2676
|
+
getAutoCompactThresholdSource(): TAutoCompactThresholdSource;
|
|
2677
|
+
getAutoCompactThreshold(): number | false;
|
|
2678
|
+
getSession(): Session;
|
|
2679
|
+
getAgentJobCapability(): IAgentJobHostContext;
|
|
2680
|
+
setAutoCompactThreshold(threshold: TAutoCompactThreshold, source?: TAutoCompactThresholdSource): void;
|
|
2681
|
+
clearConversationHistory(): void;
|
|
2682
|
+
getName(): string | undefined;
|
|
2683
|
+
attachTransport(transport: ITransportAdapter$1<IInteractiveSession>): void;
|
|
2684
|
+
setName(name: string): void;
|
|
2685
|
+
private getBackgroundTaskManager;
|
|
2686
|
+
private captureSandboxSnapshot;
|
|
2687
|
+
private persistCurrentSession;
|
|
2688
|
+
}
|
|
2689
|
+
//#endregion
|
|
2690
|
+
//#region src/query.d.ts
|
|
2691
|
+
interface ICreateQueryOptions {
|
|
2692
|
+
/** AI provider instance (required). */
|
|
2693
|
+
provider: IAIProvider;
|
|
2694
|
+
/** Working directory. Defaults to process.cwd(). */
|
|
2695
|
+
cwd?: string;
|
|
2696
|
+
/** Permission mode. Defaults to 'bypassPermissions' for programmatic use. */
|
|
2697
|
+
permissionMode?: TPermissionMode;
|
|
2698
|
+
/** Maximum agentic turns per query. */
|
|
2699
|
+
maxTurns?: number;
|
|
2700
|
+
/** Permission handler callback. */
|
|
2701
|
+
permissionHandler?: TInteractivePermissionHandler;
|
|
2702
|
+
/** Streaming text callback. */
|
|
2703
|
+
onTextDelta?: (delta: string) => void;
|
|
2704
|
+
}
|
|
2705
|
+
/**
|
|
2706
|
+
* Create a prompt-only query function bound to a provider.
|
|
2707
|
+
*
|
|
2708
|
+
* ```typescript
|
|
2709
|
+
* import { createQuery } from '@robota-sdk/agent-framework';
|
|
2710
|
+
* import { AnthropicProvider } from '@robota-sdk/agent-provider/anthropic';
|
|
2711
|
+
*
|
|
2712
|
+
* const query = createQuery({ provider: new AnthropicProvider({ apiKey: '...' }) });
|
|
2713
|
+
* const answer = await query('List all TypeScript files');
|
|
2714
|
+
* ```
|
|
2715
|
+
*/
|
|
2716
|
+
declare function createQuery(options: ICreateQueryOptions): (prompt: string) => Promise<string>;
|
|
2717
|
+
//#endregion
|
|
2718
|
+
//#region src/user-local/storage.d.ts
|
|
2719
|
+
declare const USER_LOCAL_STORAGE_CATEGORIES: readonly ["preferences", "view-state", "memory-projections", "task-associations", "workflow-metadata", "inspection-index"];
|
|
2720
|
+
type TUserLocalStorageCategory = (typeof USER_LOCAL_STORAGE_CATEGORIES)[number];
|
|
2721
|
+
interface IUserLocalStorageCategoryDefinition {
|
|
2722
|
+
readonly category: TUserLocalStorageCategory;
|
|
2723
|
+
readonly purpose: string;
|
|
2724
|
+
readonly mayExecuteCommands: false;
|
|
2725
|
+
}
|
|
2726
|
+
interface IUserLocalStorageItemSummary {
|
|
2727
|
+
readonly root: string;
|
|
2728
|
+
readonly category: TUserLocalStorageCategory;
|
|
2729
|
+
readonly key: string;
|
|
2730
|
+
readonly summary: string;
|
|
2731
|
+
readonly source: string;
|
|
2732
|
+
readonly scope: string;
|
|
2733
|
+
readonly storageLocation: string;
|
|
2734
|
+
readonly createdAt?: string;
|
|
2735
|
+
readonly lastUsedAt?: string;
|
|
2736
|
+
readonly enabled: boolean;
|
|
2737
|
+
readonly deleteAvailable: boolean;
|
|
2738
|
+
readonly disableAvailable: boolean;
|
|
2739
|
+
}
|
|
2740
|
+
interface IUserLocalStorageCategoryProjection {
|
|
2741
|
+
readonly category: TUserLocalStorageCategory;
|
|
2742
|
+
readonly purpose: string;
|
|
2743
|
+
readonly mayExecuteCommands: false;
|
|
2744
|
+
readonly storageLocation: string;
|
|
2745
|
+
readonly itemCount: number;
|
|
2746
|
+
readonly items: readonly IUserLocalStorageItemSummary[];
|
|
2747
|
+
}
|
|
2748
|
+
interface IUserLocalStorageInspection {
|
|
2749
|
+
readonly root: string;
|
|
2750
|
+
readonly activeRepositoryRoot: string;
|
|
2751
|
+
readonly categories: readonly IUserLocalStorageCategoryProjection[];
|
|
2752
|
+
readonly generatedAt: string;
|
|
2753
|
+
}
|
|
2754
|
+
interface IResolveUserLocalStorageRootOptions {
|
|
2755
|
+
readonly activeRepositoryRoot: string;
|
|
2756
|
+
readonly homeDir?: string;
|
|
2757
|
+
readonly storageRoot?: string;
|
|
2758
|
+
readonly fsAsync?: IFileSystemAsync;
|
|
2759
|
+
}
|
|
2760
|
+
interface IInspectUserLocalStorageOptions extends IResolveUserLocalStorageRootOptions {
|
|
2761
|
+
readonly now?: () => Date;
|
|
2762
|
+
readonly createDirectories?: boolean;
|
|
2763
|
+
}
|
|
2764
|
+
declare const USER_LOCAL_STORAGE_CATEGORY_DEFINITIONS: readonly IUserLocalStorageCategoryDefinition[];
|
|
2765
|
+
declare function resolveUserLocalStorageRoot(options: IResolveUserLocalStorageRootOptions): Promise<string>;
|
|
2766
|
+
declare function inspectUserLocalStorage(options: IInspectUserLocalStorageOptions): Promise<IUserLocalStorageInspection>;
|
|
2767
|
+
//#endregion
|
|
2768
|
+
//#region src/user-local/memory-types.d.ts
|
|
2769
|
+
declare const USER_LOCAL_MEMORY_CATEGORIES: readonly ["view-preference", "last-visible-cwd", "background-selection", "task-association", "display-preference", "inspection-choice"];
|
|
2770
|
+
type TUserLocalMemoryCategory = (typeof USER_LOCAL_MEMORY_CATEGORIES)[number];
|
|
2771
|
+
type TUserLocalMemoryCommandExecutionEffect = 'none';
|
|
2772
|
+
interface IUserLocalMemoryItemProjection {
|
|
2773
|
+
readonly root: string;
|
|
2774
|
+
readonly category: TUserLocalMemoryCategory;
|
|
2775
|
+
readonly key: string;
|
|
2776
|
+
readonly summary: string;
|
|
2777
|
+
readonly valueSummary: string;
|
|
2778
|
+
readonly source: string;
|
|
2779
|
+
readonly scope: string;
|
|
2780
|
+
readonly storageLocation: string;
|
|
2781
|
+
readonly createdAt: string;
|
|
2782
|
+
readonly lastUsedAt: string;
|
|
2783
|
+
readonly enabled: boolean;
|
|
2784
|
+
readonly displayNavigationRule: string;
|
|
2785
|
+
readonly commandExecutionEffect: TUserLocalMemoryCommandExecutionEffect;
|
|
2786
|
+
readonly deleteAvailable: true;
|
|
2787
|
+
readonly disableAvailable: true;
|
|
2788
|
+
}
|
|
2789
|
+
interface IUserLocalMemoryListProjection {
|
|
2790
|
+
readonly root: string;
|
|
2791
|
+
readonly activeRepositoryRoot: string;
|
|
2792
|
+
readonly items: readonly IUserLocalMemoryItemProjection[];
|
|
2793
|
+
}
|
|
2794
|
+
interface IUserLocalMemorySetOptions extends IResolveUserLocalStorageRootOptions {
|
|
2795
|
+
readonly category: TUserLocalMemoryCategory;
|
|
2796
|
+
readonly key: string;
|
|
2797
|
+
readonly value: string;
|
|
2798
|
+
readonly summary: string;
|
|
2799
|
+
readonly source: string;
|
|
2800
|
+
readonly scope?: string;
|
|
2801
|
+
readonly now?: () => Date;
|
|
2802
|
+
}
|
|
2803
|
+
interface IUserLocalMemoryItemOptions extends IResolveUserLocalStorageRootOptions {
|
|
2804
|
+
readonly category: TUserLocalMemoryCategory;
|
|
2805
|
+
readonly key: string;
|
|
2806
|
+
readonly now?: () => Date;
|
|
2807
|
+
}
|
|
2808
|
+
interface IUserLocalMemoryListOptions extends IResolveUserLocalStorageRootOptions {
|
|
2809
|
+
readonly now?: () => Date;
|
|
2810
|
+
}
|
|
2811
|
+
interface IUserLocalMemoryDeleteResult {
|
|
2812
|
+
readonly category: TUserLocalMemoryCategory;
|
|
2813
|
+
readonly key: string;
|
|
2814
|
+
readonly deleted: boolean;
|
|
2815
|
+
}
|
|
2816
|
+
//#endregion
|
|
2817
|
+
//#region src/user-local/memory.d.ts
|
|
2818
|
+
declare function setUserLocalMemoryItem(options: IUserLocalMemorySetOptions): Promise<IUserLocalMemoryItemProjection>;
|
|
2819
|
+
declare function listUserLocalMemoryItems(options: IUserLocalMemoryListOptions): Promise<IUserLocalMemoryListProjection>;
|
|
2820
|
+
declare function inspectUserLocalMemoryItem(options: IUserLocalMemoryItemOptions): Promise<IUserLocalMemoryItemProjection>;
|
|
2821
|
+
declare function disableUserLocalMemoryItem(options: IUserLocalMemoryItemOptions): Promise<IUserLocalMemoryItemProjection>;
|
|
2822
|
+
declare function deleteUserLocalMemoryItem(options: IUserLocalMemoryItemOptions): Promise<IUserLocalMemoryDeleteResult>;
|
|
2823
|
+
declare function readEnabledUserLocalMemoryItem(options: IUserLocalMemoryItemOptions): Promise<IUserLocalMemoryItemProjection | null>;
|
|
2824
|
+
//#endregion
|
|
2825
|
+
//#region src/self-hosting/self-hosting-verification.d.ts
|
|
2826
|
+
type TSelfHostingVerificationPhase = 'checkpoint' | 'edit' | 'handoff' | 'verify' | 'recover';
|
|
2827
|
+
type TSelfHostingLoopState = 'idle' | 'checkpointed' | 'editing' | 'verifying' | 'passed' | 'failed' | 'rolled_back' | 'cancelled';
|
|
2828
|
+
type TSelfHostingLoopEvent = 'checkpoint_created' | 'edits_started' | 'edits_applied' | 'verify_passed' | 'verify_failed' | 'rollback_completed' | 'cancelled';
|
|
2829
|
+
interface ISelfHostingVerificationPlanInput {
|
|
2830
|
+
changedFiles: readonly string[];
|
|
2831
|
+
packageScopes?: readonly string[];
|
|
2832
|
+
baseRef?: string;
|
|
2833
|
+
}
|
|
2834
|
+
interface ISelfHostingVerificationStep {
|
|
2835
|
+
id: string;
|
|
2836
|
+
phase: TSelfHostingVerificationPhase;
|
|
2837
|
+
description: string;
|
|
2838
|
+
required: boolean;
|
|
2839
|
+
command?: string;
|
|
2840
|
+
}
|
|
2841
|
+
interface ISelfHostingVerificationPlan {
|
|
2842
|
+
changedFiles: readonly string[];
|
|
2843
|
+
packageScopes: readonly string[];
|
|
2844
|
+
baseRef: string;
|
|
2845
|
+
steps: readonly ISelfHostingVerificationStep[];
|
|
2846
|
+
}
|
|
2847
|
+
declare function planSelfHostingVerification(input: ISelfHostingVerificationPlanInput): ISelfHostingVerificationPlan;
|
|
2848
|
+
declare function transitionSelfHostingLoop(state: TSelfHostingLoopState, event: TSelfHostingLoopEvent): TSelfHostingLoopState;
|
|
2849
|
+
//#endregion
|
|
2850
|
+
//#region src/agents/built-in-agents.d.ts
|
|
2851
|
+
/**
|
|
2852
|
+
* All built-in agent definitions shipped with the SDK.
|
|
2853
|
+
* Order matters: general-purpose is the default fallback.
|
|
2854
|
+
*/
|
|
2855
|
+
declare const BUILT_IN_AGENTS: IAgentDefinition[];
|
|
2856
|
+
/**
|
|
2857
|
+
* Look up a built-in agent definition by name.
|
|
2858
|
+
* Returns `undefined` if no built-in agent matches.
|
|
2859
|
+
*/
|
|
2860
|
+
declare function getBuiltInAgent(name: string): IAgentDefinition | undefined;
|
|
2861
|
+
//#endregion
|
|
2862
|
+
//#region src/tools/command-execution-tool.d.ts
|
|
2863
|
+
type TModelCommandDescriptor$1 = Pick<ICapabilityDescriptor, 'name' | 'description' | 'argumentHint'>;
|
|
2864
|
+
interface ICommandExecutionToolDeps {
|
|
2865
|
+
isModelInvocable: (command: string) => boolean;
|
|
2866
|
+
execute: (command: string, args: string) => Promise<ICommandResult | null>;
|
|
2867
|
+
commandNames?: readonly string[];
|
|
2868
|
+
commandDescriptors?: readonly TModelCommandDescriptor$1[];
|
|
2869
|
+
}
|
|
2870
|
+
declare function createCommandExecutionTool(deps: ICommandExecutionToolDeps): ReturnType<typeof createZodFunctionTool>;
|
|
2871
|
+
//#endregion
|
|
2872
|
+
//#region src/tools/model-command-tool-projection.d.ts
|
|
2873
|
+
declare const MODEL_COMMAND_TOOL_PREFIX: "robota_command_";
|
|
2874
|
+
declare const PROVIDER_SAFE_TOOL_NAME_PATTERN: RegExp;
|
|
2875
|
+
type TModelCommandDescriptor = Pick<ICapabilityDescriptor, 'name' | 'description' | 'argumentHint'>;
|
|
2876
|
+
interface IProjectedModelCommandTool {
|
|
2877
|
+
readonly commandName: string;
|
|
2878
|
+
readonly toolName: string;
|
|
2879
|
+
readonly description: string;
|
|
2880
|
+
readonly descriptor: TModelCommandDescriptor;
|
|
2881
|
+
}
|
|
2882
|
+
interface IModelCommandToolProjection {
|
|
2883
|
+
readonly commandTools: readonly IProjectedModelCommandTool[];
|
|
2884
|
+
readonly toolNameToCommandName: ReadonlyMap<string, string>;
|
|
2885
|
+
readonly commandNameToToolName: ReadonlyMap<string, string>;
|
|
2886
|
+
}
|
|
2887
|
+
interface IProjectedCommandExecutionToolsDeps {
|
|
2888
|
+
isModelInvocable: (command: string) => boolean;
|
|
2889
|
+
execute: (command: string, args: string) => Promise<ICommandResult | null>;
|
|
2890
|
+
commandDescriptors: readonly TModelCommandDescriptor[];
|
|
2891
|
+
}
|
|
2892
|
+
declare function normalizeModelCommandName(command: string): string;
|
|
2893
|
+
declare function createProviderSafeModelCommandToolName(commandName: string): string;
|
|
2894
|
+
declare function createModelCommandToolProjection(commandDescriptors: readonly TModelCommandDescriptor[]): IModelCommandToolProjection;
|
|
2895
|
+
declare function formatProjectedModelCommandToolPromptDescription(projection: IProjectedModelCommandTool): string;
|
|
2896
|
+
declare function createProjectedCommandExecutionTools(deps: IProjectedCommandExecutionToolsDeps): Array<ReturnType<typeof createZodFunctionTool>>;
|
|
2897
|
+
//#endregion
|
|
2898
|
+
//#region src/tools/background-process-tool.d.ts
|
|
2899
|
+
interface IBackgroundProcessToolDeps {
|
|
2900
|
+
backgroundTaskManager: IBackgroundTaskManager;
|
|
2901
|
+
cwd?: string;
|
|
2902
|
+
parentSessionId?: string;
|
|
2903
|
+
metadata?: Record<string, TBackgroundPrimitive>;
|
|
2904
|
+
}
|
|
2905
|
+
declare function createBackgroundProcessTool(deps: IBackgroundProcessToolDeps): ReturnType<typeof createZodFunctionTool>;
|
|
2906
|
+
//#endregion
|
|
2907
|
+
//#region src/paths.d.ts
|
|
2908
|
+
/**
|
|
2909
|
+
* Standard Robota storage paths.
|
|
2910
|
+
*
|
|
2911
|
+
* All CLI runtime data lives under .robota/ (project) or ~/.robota/ (user).
|
|
2912
|
+
* .agents/ is read-only from CLI's perspective (owned by AGENTS.md standard).
|
|
2913
|
+
*/
|
|
2914
|
+
/** Project-level .robota/ paths (relative to cwd). */
|
|
2915
|
+
declare function projectPaths(cwd: string): {
|
|
2916
|
+
settings: string;
|
|
2917
|
+
settingsLocal: string;
|
|
2918
|
+
logs: string;
|
|
2919
|
+
sessions: string;
|
|
2920
|
+
memory: string;
|
|
2921
|
+
checkpoints: string;
|
|
2922
|
+
};
|
|
2923
|
+
/** User-level ~/.robota/ paths. */
|
|
2924
|
+
declare function userPaths(): {
|
|
2925
|
+
settings: string;
|
|
2926
|
+
sessions: string;
|
|
2927
|
+
};
|
|
2928
|
+
//#endregion
|
|
2929
|
+
//#region src/context/task-context.d.ts
|
|
2930
|
+
type TTaskFileStatus = 'todo' | 'in-progress' | 'blocked' | 'completed' | 'unknown';
|
|
2931
|
+
interface ITaskContextFile {
|
|
2932
|
+
path: string;
|
|
2933
|
+
relativePath: string;
|
|
2934
|
+
title: string;
|
|
2935
|
+
status: TTaskFileStatus;
|
|
2936
|
+
branch?: string;
|
|
2937
|
+
scope?: string;
|
|
2938
|
+
objective?: string;
|
|
2939
|
+
openItems: readonly string[];
|
|
2940
|
+
}
|
|
2941
|
+
interface ITaskSelectionOptions {
|
|
2942
|
+
currentBranch?: string;
|
|
2943
|
+
maxTasks?: number;
|
|
2944
|
+
}
|
|
2945
|
+
interface IUpdateTaskFileStatusOptions {
|
|
2946
|
+
now?: Date;
|
|
2947
|
+
progressMessage?: string;
|
|
2948
|
+
}
|
|
2949
|
+
declare function readCurrentGitBranch(cwd: string, fs?: IFileSystem): string | undefined;
|
|
2950
|
+
declare function discoverTaskFiles(cwd: string, fs?: IFileSystem): string[];
|
|
2951
|
+
declare function parseTaskFile(taskPath: string, cwd: string, fs?: IFileSystem): ITaskContextFile;
|
|
2952
|
+
declare function selectRelevantTasks(tasks: readonly ITaskContextFile[], options?: ITaskSelectionOptions): ITaskContextFile[];
|
|
2953
|
+
declare function formatTaskContext(tasks: readonly ITaskContextFile[]): string;
|
|
2954
|
+
declare function loadTaskContext(cwd: string, options?: ITaskSelectionOptions, fs?: IFileSystem): string;
|
|
2955
|
+
declare function updateTaskFileStatus(taskPath: string, status: TTaskFileStatus, options?: IUpdateTaskFileStatusOptions, fs?: IFileSystem): void;
|
|
2956
|
+
//#endregion
|
|
2957
|
+
//#region src/permissions/permission-prompt.d.ts
|
|
2958
|
+
declare function promptForApproval(terminal: ITerminalOutput$2, toolName: string, toolArgs: TToolArgs): Promise<boolean>;
|
|
2959
|
+
//#endregion
|
|
2960
|
+
//#region src/testing/create-test-interactive-session.d.ts
|
|
2961
|
+
/** Creates a stub IInteractiveSession for use in tests. All methods return sensible defaults.
|
|
2962
|
+
* Pass overrides to spy on or replace specific methods. */
|
|
2963
|
+
declare function createTestInteractiveSession(overrides?: Partial<IInteractiveSession>): IInteractiveSession;
|
|
2964
|
+
//#endregion
|
|
2965
|
+
export { AUTO_COMPACT_THRESHOLD_SETTINGS_KEY, AgentExecutor, BACKGROUND_COMMAND_DESCRIPTION, BACKGROUND_COMMAND_USAGE, BUILT_IN_AGENTS, BackgroundJobOrchestrator, BuiltinCommandSource, BundlePluginInstaller, BundlePluginLoader, CLEAR_COMMAND_DESCRIPTION, COST_COMMAND_DESCRIPTION, CommandRegistry, DEFAULT_AUTO_COMPACT_THRESHOLD, DEFAULT_STATUS_LINE_COMMAND_SETTINGS, EXECUTION_ORIGIN_METADATA_KEYS, EXIT_COMMAND_DESCRIPTION, EditCheckpointStore, HELP_COMMAND_DESCRIPTION, type IActiveProviderModelCatalogState, type IAgentBackgroundTaskRequest, type IAgentDefinition, type IAgentExecutorOptions, type IAgentJobHostContext, type IAgentSession, type IAgentToolDeps, type IAppendMemoryInput, type IAppendMemoryResult, type IBackgroundJobGroupCreateRequest, type IBackgroundJobGroupState, type IBackgroundJobGroupSummary, type IBackgroundJobOrchestratorOptions, type IBackgroundJobResultEnvelope, type IBackgroundProcessToolDeps, type IBackgroundTaskError, type IBackgroundTaskHandle, type IBackgroundTaskInput, type IBackgroundTaskListFilter, type IBackgroundTaskLogCursor, type IBackgroundTaskLogPage, type IBackgroundTaskManager, type IBackgroundTaskManagerOptions, type IBackgroundTaskResult, type IBackgroundTaskRunner, type IBackgroundTaskSpawnerGroupRequest, type IBackgroundTaskStart, type IBackgroundTaskState, type IBaseBackgroundTaskRequest, type IBuildModelCommandSubcommandsOptions, type IBundlePluginFeatures, type IBundlePluginInstallerOptions, type IBundlePluginManifest, type IBundleSkill, type ICapabilityDescriptor, type ICommand, type ICommandAvailablePlugin, type ICommandChoicePromptOption, type ICommandExecutionToolDeps, type ICommandHostAdapters, type ICommandHostContext, type ICommandInstalledPlugin, type ICommandInteraction, type ICommandListEntry, type ICommandMarketplaceSource, type ICommandMemoryStores, type ICommandModule, type ICommandPendingMemoryStore, type ICommandPermissionModeAdapter, type ICommandPickerAdapter, type ICommandPluginAdapter, type ICommandPluginReloadResult, type ICommandProcessAdapter, type ICommandProjectMemoryStore, type ICommandResult, type ICommandSessionInfo, type ICommandSessionReplayValidationReport, type ICommandSessionRuntime, type ICommandSettingsAdapter, type ICommandSettingsDocument, type ICommandSkillListEntry, type ICommandSource, type ICompactContextResult, type IConfigurableTransport, type IContextFileRefreshedEvent, type IContextReferenceAddResult, type IContextReferenceClearResult, type IContextReferenceInventoryLimits, type IContextReferenceItem, type IContextReferenceRemoveResult, type IContextReferenceUpsertResult, type ICreateExecutionWorkspaceSnapshotInput, type ICreateExecutionWorkspaceTaskSpawnerOptions, type ICreateLimitedOutputCaptureOptions, type ICreateLineDetailPageInput, type ICreateMainThreadDetailPageInput, type ICreateMainThreadEntryInput, type ICreateQueryOptions, type IDiffLine, type IEditCheckpointFileInspection, type IEditCheckpointFileRecord, type IEditCheckpointInspection, type IEditCheckpointInspectionPlan, type IEditCheckpointManifest, type IEditCheckpointRecorder, type IEditCheckpointRestoreResult, type IEditCheckpointSummary, type IEditCheckpointTurnInput, type IExecutionDetailCursor, type IExecutionDetailPage, type IExecutionDetailRecord, type IExecutionOrigin, type IExecutionResult, type IExecutionWorkspaceEntry, type IExecutionWorkspaceEntryRef, type IExecutionWorkspaceEvent, type IExecutionWorkspaceFilter, type IExecutionWorkspaceSnapshot, type IExecutionWorkspaceSnapshotOptions, type IExecutionWorkspaceTaskSpawner, type IForkExecutionOptions, type IInProcessSubagentRunnerDeps, type IInspectUserLocalStorageOptions, type IInstalledPluginRecord, type IInteractiveSession, type IInteractiveSessionEvents, type IInteractiveSessionRecord, type IInteractiveSessionShutdownOptions, type IInteractiveSessionStore, type IKnownMarketplaceEntry, type ILegacyProviderSettings, type ILimitedOutputCapture, type ILoadedBundlePlugin, type IMarketplaceClientOptions, type IMarketplaceManifest, type IMarketplacePluginEntry, type IMemoryCandidate, type IMemoryEvent, type IMemoryPendingRecord, type IMemoryReference, type IModelCommandModuleOptions, type IModelCommandSettingsAdapter, type IModelCommandToolProjection, type IPermissionsCommandState, type IPluginSettings, type IPreparedSubagentWorktree, type IProcessBackgroundTaskRequest, type IProjectMemorySummary, type IProjectedCommandExecutionToolsDeps, type IProjectedModelCommandTool, type IPromptExecutorOptions, type IPromptFileReferenceDiagnostic, type IPromptFileReferenceHistoryData, type IPromptFileReferenceLimits, type IPromptFileReferenceRecord, type IPromptFileReferenceResolveOptions, type IPromptFileReferenceToken, type IPromptProvider, type IProviderCommandModuleOptions, type IProviderCommandSettingsAdapter, type IProviderDefinition, type IProviderProfileNameSuggestionInput, type IProviderProfileNameSuggestionOptions, type IProviderProfileSettings, type IProviderSettingsBuildOptions, type IProviderSetupInput, type IProviderSetupPatch, type IResolveActiveProviderModelCatalogStateOptions, type IResolveUserLocalStorageRootOptions, type IResolvedPromptFileReference, type IResolvedPromptFileReferences, type IResumableSessionSummary, type IReversibleExecutionOptions, type IReversibleToolSafetyContext, type IReversibleToolSafetyInput, type IReversibleToolSafetyReport, type ISelfHostingVerificationPlan, type ISelfHostingVerificationPlanInput, type ISelfHostingVerificationStep, type ISerializableProviderProfile, type ISkillActivationEvent, type ISkillActivationHistoryData, type ISkillExecutionCallbacks, type ISkillExecutionResult, type ISpawnAgentTaskRequest, type ISpawnProcessTaskRequest, type IStartupMemory, type IStatusLineCommandSettings, type ISubagentJobHandle, type ISubagentJobResult, type ISubagentJobStart, type ISubagentJobState, type ISubagentManager, type ISubagentManagerOptions, type ISubagentOptions, type ISubagentPromptOptions, type ISubagentRunner, type ISubagentSpawnRequest, type ISubagentWorktreeAdapter, type ISubagentWorktreePrepareRequest, type ISystemCommand, type ITaskContextFile, type ITaskSelectionOptions, type IToolState, type IToolSummary, type ITransportAdapter, type ITransportConfig, type IUpdateTaskFileStatusOptions, type IUsageSnapshot, type IUserLocalMemoryDeleteResult, type IUserLocalMemoryItemOptions, type IUserLocalMemoryItemProjection, type IUserLocalMemoryListOptions, type IUserLocalMemoryListProjection, type IUserLocalMemorySetOptions, type IUserLocalStorageCategoryDefinition, type IUserLocalStorageCategoryProjection, type IUserLocalStorageInspection, type IUserLocalStorageItemSummary, type IWorktreeSubagentRunnerOptions, InteractiveSession, LANGUAGE_COMMAND_ARGUMENT_HINT, LANGUAGE_COMMAND_DESCRIPTION, MEMORY_COMMAND_ARGUMENT_HINT, MEMORY_COMMAND_DESCRIPTION, MEMORY_COMMAND_USAGE, MEMORY_INDEX_MAX_BYTES, MEMORY_INDEX_MAX_LINES, MODEL_COMMAND_ARGUMENT_HINT, MODEL_COMMAND_DESCRIPTION, MODEL_COMMAND_TOOL_PREFIX, MarketplaceClient, PERMISSIONS_COMMAND_DESCRIPTION, PERMISSION_MODE_ARGUMENT_HINT, PERMISSION_MODE_COMMAND_DESCRIPTION, PLUGIN_COMMAND_ARGUMENT_HINT, PLUGIN_COMMAND_DESCRIPTION, PROVIDER_SAFE_TOOL_NAME_PATTERN, PluginCommandSource, PluginSettingsStore, ProjectMemoryStore, PromptExecutor, RECOMMENDED_RESPONSE_LANGUAGES, RELOAD_PLUGINS_COMMAND_DESCRIPTION, RENAME_COMMAND_DESCRIPTION, RENAME_COMMAND_USAGE, RESUME_COMMAND_DESCRIPTION, REWIND_COMMAND_ARGUMENT_HINT, REWIND_COMMAND_DESCRIPTION, STATUSLINE_COMMAND_ARGUMENT_HINT, STATUSLINE_COMMAND_DESCRIPTION, SkillCommandSource, type SkillPromptContext, SystemCommandExecutor, type TAutoCompactThreshold, type TAutoCompactThresholdSource, type TBackgroundJobGroupEvent, type TBackgroundJobGroupEventListener, type TBackgroundJobGroupIdFactory, type TBackgroundJobGroupStatus, type TBackgroundJobWaitPolicy, type TBackgroundPermissionPolicy, type TBackgroundPrimitive, type TBackgroundTaskErrorCategory, type TBackgroundTaskEvent, type TBackgroundTaskEventListener, type TBackgroundTaskIdFactory, type TBackgroundTaskIsolation, type TBackgroundTaskKind, type TBackgroundTaskMode, type TBackgroundTaskRequest, type TBackgroundTaskRunnerEvent, type TBackgroundTaskStatus, type TBackgroundTaskTimeoutReason, type TBackgroundTaskTransitionEvent, type TCapabilityKind, type TCapabilitySafety, type TCommandEffect, type TCommandInteractionPrompt, type TCommandModuleSessionRequirement, type TCommandResultDataValue, type TContextReferenceLoadType, type TContextReferenceStatus, type TEditCheckpointFileRestoreAction, type TEnabledPlugins, type TExecutionAttention, type TExecutionControl, type TExecutionDetailRecordKind, type TExecutionEntryKind, type TExecutionOriginKind, type TExecutionWorkspaceStatus, type TExecutionWorkspaceUpdateCause, type TExecutionWorkspaceVisibility, type TInstalledPluginsRegistry, type TInteractiveEventName, type TInteractivePermissionHandler, type TInteractiveSessionOptions, type TKnownMarketplacesRegistry, type TMarketplaceSource, type TMemoryCandidateStatus, type TMemoryType, type TPermissionResultValue, type TPluginInstallScope, type TPromptFileReferenceDiagnosticCode, type TPromptFileReferenceReason, type TProviderFactory, type TProviderSettingsDocument, type TRecommendedResponseLanguage, type TReversibleExecutionIsolation, type TReversibleRollbackLayer, type TReversibleSafetyStatus, type TReversibleSideEffect, type TSelfHostingLoopEvent, type TSelfHostingLoopState, type TSelfHostingVerificationPhase, type TSessionFactory, type TSettingsCheck, type TShellExecFn, type TSkillActivationInvocation, type TSkillActivationMode, type TSkillActivationSource, type TSkillActivationStatus, type TStatusLineCommandSettingsPatch, type TSubagentJobMode, type TSubagentJobStatus, type TSubagentRunnerFactory, type TSystemCommandLifecycle, type TTaskFileStatus, type TUserLocalMemoryCategory, type TUserLocalMemoryCommandExecutionEffect, type TUserLocalStorageCategory, USER_LOCAL_MEMORY_CATEGORIES, USER_LOCAL_STORAGE_CATEGORIES, USER_LOCAL_STORAGE_CATEGORY_DEFINITIONS, VALIDATE_SESSION_COMMAND_DESCRIPTION, VALID_PERMISSION_MODES, addCommandContextReference, assembleSubagentPrompt, buildBackgroundCommandSubcommands, buildLanguageCommandSubcommands, buildMemoryCommandSubcommands, buildModelCommandSubcommands, buildPermissionModeSubcommands, buildPluginCommandSubcommands, buildPromptWithFileReferences, buildProviderProfile, buildProviderSetupPatch, buildRewindCommandSubcommands, buildStatusLineCommandSubcommands, cancelCommandBackgroundTask, checkSettingsDocument, clearCommandContextReferences, clearContextReferences, clearConversationHistory, closeCommandBackgroundTask, compactCommandContext, createAgentTool, createBackgroundGroupExecutionEntryId, createBackgroundProcessTool, createBackgroundTaskExecutionEntryId, createBuiltinCommandModule, createCommandExecutionTool, createCommandMemoryStores, createCommandPendingMemoryStore, createCommandProjectMemoryStore, createContextReferenceItem, createDefaultTools, createExecutionOriginMetadata, createExecutionWorkspaceSnapshot, createExecutionWorkspaceTaskSpawner, createInProcessSubagentRunner, createLineDetailPage, createMainThreadDetailPage, createMainThreadExecutionEntryId, createModelCommandToolProjection, createPluginRegistryReloadRequestedEffect, createPluginTuiRequestedEffect, createProjectSessionStore, createProjectedCommandExecutionTools, createPromptFileReferenceHistoryEntry, createProviderSafeModelCommandToolName, createQuery, createSessionExitRequestedEffect, createSessionPickerRequestedEffect, createSessionRenamedEffect, createSubagentLogger, createSubagentSession, createSystemCommands, createTestInteractiveSession, deleteProviderProfile, deleteUserLocalMemoryItem, disableUserLocalMemoryItem, discoverTaskFiles, evaluateReversibleToolSafety, executeSkill, findProviderDefinition, formatCommandBackgroundTask, formatCommandBackgroundTaskList, formatCommandHelpMessage, formatCommandPermissionsMessage, formatCommandSessionReplayValidationReport, formatEnvReference, formatInvalidPermissionModeMessage, formatLanguageUsageMessage, formatModelCommandUsageMessage, formatModelCommandUsageMessageAsync, formatProjectedModelCommandToolPromptDescription, formatPromptFileReferenceDiagnostics, formatTaskContext, getBuiltInAgent, getForkWorkerSuffix, getProviderCredentialRequirement, getSubagentSuffix, hasBlockingPromptFileReferenceDiagnostics, hasSensitiveCommandMemoryContent, hasUsableSecretReference, inspectCommandEditCheckpoint, inspectUserLocalMemoryItem, inspectUserLocalStorage, isCommandMemoryType, isEnvReference, isMemoryType, isPermissionMode, isStatusLineCommandSettingsPatch, listActiveContextReferences, listCommandBackgroundTasks, listCommandContextReferences, listCommandEditCheckpoints, listCommandSessionAllowedTools, listCommandUsedMemoryReferences, listResumableSessionSummaries, listUserLocalMemoryItems, loadTaskContext, mergeProviderPatch, mergeProviders, mergeSettings, normalizeModelCommandName, parseCommandBackgroundLogCursor, parseExecutionWorkspaceEntryId, parseFrontmatter, parseLanguageArgument, parsePermissionModeArgument, parsePromptFileReferences, parseSessionNameArgument, parseTaskFile, planSelfHostingVerification, preprocessShellCommands, probeProviderProfile, projectPaths, promptForApproval, readAutoCompactThreshold, readAutoCompactThresholdSource, readCommandBackgroundTaskLog, readCommandContextState, readCommandPermissionMode, readCommandPermissionsState, readCommandSessionInfo, readCurrentGitBranch, readEnabledUserLocalMemoryItem, readMergedProviderSettingsFromPaths, recordCommandMemoryEvent, removeCommandContextReference, removeContextReference, resetAutoCompactThresholdSetting, resolveActiveProvider, resolveActiveProviderModelCatalog, resolveActiveProviderModelCatalogState, resolveEnvReference, resolveLatestSessionId, resolvePermissionModeAdapter, resolvePluginCommandAdapter, resolvePromptFileReferencePaths, resolvePromptFileReferences, resolveSessionIdByIdOrName, resolveSubagentLogDir, resolveUserLocalStorageRoot, restoreCommandEditCheckpoint, retrieveAgentToolDeps, rollbackCommandEditCheckpoint, sanitizeProviderProfileName, selectRelevantTasks, setCommandAutoCompactThreshold, setCurrentProvider, setUserLocalMemoryItem, storeAgentToolDeps, substituteVariables, suggestProviderProfileName, summarizeBackgroundJobGroup, testProviderProfileCommand, toContextReferenceRecords, toPromptFileReferenceRecords, transitionSelfHostingLoop, updateTaskFileStatus, upsertContextReference, upsertProviderProfile, userPaths, validateCommandSessionReplayLog, validateProviderProfile, wrapEditCheckpointTools, wrapReversibleExecutionTools, writeAutoCompactThresholdSetting, writeCommandPermissionMode };
|
|
2966
|
+
//# sourceMappingURL=index.d.ts.map
|