@robota-sdk/agent-framework 3.0.0-beta.75 → 3.0.0-beta.77
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 +661 -21
- package/README.md +54 -36
- package/dist/node/index-BeYNnJed.d.ts +2656 -0
- package/dist/node/index-BeYNnJed.d.ts.map +1 -0
- package/dist/node/index-DLFjpsfm.d.ts +2658 -0
- package/dist/node/index-DLFjpsfm.d.ts.map +1 -0
- package/dist/node/index.cjs +3 -110
- package/dist/node/index.d.ts +13 -2468
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +3 -110
- package/dist/node/index.js.map +1 -1
- package/dist/node/interactive-C93XBn4U.js +111 -0
- package/dist/node/interactive-C93XBn4U.js.map +1 -0
- package/dist/node/interactive-D1dVksoo.cjs +110 -0
- package/dist/node/testing/index.cjs +2 -0
- package/dist/node/testing/index.d.ts +157 -0
- package/dist/node/testing/index.d.ts.map +1 -0
- package/dist/node/testing/index.js +3 -0
- package/dist/node/testing/index.js.map +1 -0
- package/package.json +21 -8
|
@@ -0,0 +1,2656 @@
|
|
|
1
|
+
import { IBackgroundJobGroupCreateRequest, IBackgroundJobGroupCreateRequest as IBackgroundJobGroupCreateRequest$1, IBackgroundJobGroupState, IBackgroundJobGroupState as IBackgroundJobGroupState$1, IBackgroundJobGroupSummary, IBackgroundTaskInput, IBackgroundTaskListFilter, IBackgroundTaskLogCursor, IBackgroundTaskLogPage, IBackgroundTaskState, ICapabilityDescriptor, ICommand, ICommandListEntry, ICommandPluginAdapter, ICommandPluginAdapter as ICommandPluginAdapter$1, ICommandResult as ICommandResult$1, ICommandSource, ICompactEvent, IContextReferenceItem, ICreateExecutionWorkspaceSnapshotInput, ICreateLineDetailPageInput, ICreateMainThreadDetailPageInput, IExecutionDetailCursor, IExecutionDetailPage, IExecutionOrigin, IExecutionOrigin as IExecutionOrigin$1, IExecutionResult, IExecutionWorkspaceEntry, IExecutionWorkspaceEntryRef, IExecutionWorkspaceFilter, IExecutionWorkspaceSnapshot, IExecutionWorkspaceSnapshotOptions, IGoalState, IInteractiveSession, IInteractiveSessionEvents as IInteractiveSessionEvents$1, IInteractiveSessionStore, IMemoryEvent, IMemoryReference, IPromptFileReferenceRecord, IResumableSessionSummary, ISkillActivationEvent, IStatusLineCommandSettings, ISubagentJobState, ITerminalHandoff, IToolState, IToolSummary, ITransportAdapter, TBackgroundJobGroupEvent, TBackgroundJobGroupEventListener, TBackgroundJobGroupIdFactory, TBackgroundPermissionPolicy, TBackgroundPrimitive, TBackgroundTaskEvent, TBackgroundTaskIsolation, TBackgroundTaskMode, TCapabilitySafety, TCommandEffect, TContextReferenceLoadType, TContextReferenceStatus, TExecutionWorkspaceUpdateCause, TGoalStopReason, TInteractiveEventName as TInteractiveEventName$1, TInteractivePermissionHandler, TMemoryType, TPermissionResultValue, TPromptFileReferenceReason, TStatusLineCommandSettingsPatch, TTurnSource } from "@robota-sdk/agent-interface-transport";
|
|
2
|
+
import { IAIProvider, IContextWindowState, IFileSystem, IFileSystemAsync, IHistoryEntry, IHookInput, IHookResult, IHookTypeExecutor, IProviderDefinition, IProviderDefinitionConfig, IProviderProbeResult, IProviderProfileConfig, ISession, ITerminalOutput, IToolWithEventService, IUserInteraction, THookDefinition, THooksConfig, TModelEffort, TPermissionMode, TSessionEndReason, TToolArgs, TUniversalMessage, TUniversalValue, formatEnvReference, hasUsableSecretReference, isEnvReference, resolveEnvReference } from "@robota-sdk/agent-core";
|
|
3
|
+
import { IBackgroundTaskHandle, IBackgroundTaskManager, IBackgroundTaskManager as IBackgroundTaskManager$1, IBackgroundTaskManagerOptions, IBackgroundTaskRunner as IBackgroundTaskRunner$1, IBackgroundTaskStart, ICreateLimitedOutputCaptureOptions, ILimitedOutputCapture, IPreparedSubagentWorktree, ISubagentJobHandle, ISubagentJobResult, ISubagentJobStart, ISubagentManager, ISubagentManagerOptions, ISubagentRunner, ISubagentRunner as ISubagentRunner$1, ISubagentSpawnRequest, ISubagentWorktreeAdapter, ISubagentWorktreePrepareRequest, IWorktreeSubagentRunnerOptions, TBackgroundTaskIdFactory, TBackgroundTaskRunnerEvent, TBackgroundTaskTransitionEvent } from "@robota-sdk/agent-executor";
|
|
4
|
+
import { FileSessionLogger, ISessionLogger, ISessionReplayValidationResult, ITerminalOutput as ITerminalOutput$1, Session, TPermissionHandler, TPermissionResult } from "@robota-sdk/agent-session";
|
|
5
|
+
import { ISandboxClient, IWorkspaceManifest, createZodFunctionTool } from "@robota-sdk/agent-tools";
|
|
6
|
+
//#region src/command-api/org-policy/org-policy-types.d.ts
|
|
7
|
+
interface IOrgPolicy {
|
|
8
|
+
/** Allowed provider profile names. Undefined = all allowed. */
|
|
9
|
+
allowedProviders?: string[];
|
|
10
|
+
/** Slash command names blocked by policy (without leading slash). */
|
|
11
|
+
blockedCommands?: string[];
|
|
12
|
+
/** If true, API keys must be stored as env references ($ENV:VAR), not plaintext. */
|
|
13
|
+
requireApiKeyFromEnv?: boolean;
|
|
14
|
+
/** Shown in policy violation messages so users know who to contact. */
|
|
15
|
+
adminContact?: string;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/command-api/plugin/plugin-command-api.d.ts
|
|
19
|
+
declare const PLUGIN_COMMAND_DESCRIPTION = "Manage plugins";
|
|
20
|
+
declare const PLUGIN_COMMAND_ARGUMENT_HINT = "manage | install <name@marketplace> | uninstall <name@marketplace> | enable <name@marketplace> | disable <name@marketplace> | marketplace <action>";
|
|
21
|
+
declare const RELOAD_PLUGINS_COMMAND_DESCRIPTION = "Reload all plugin resources";
|
|
22
|
+
declare function createPluginTuiRequestedEffect(): TCommandEffect;
|
|
23
|
+
declare function createPluginRegistryReloadRequestedEffect(): TCommandEffect;
|
|
24
|
+
declare function resolvePluginCommandAdapter(context: ICommandHostContext): ICommandPluginAdapter | undefined;
|
|
25
|
+
declare function buildPluginCommandSubcommands(): ICommand[];
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/command-api/host-adapters.d.ts
|
|
28
|
+
interface ICommandSettingsDocument {
|
|
29
|
+
[key: string]: TUniversalValue;
|
|
30
|
+
}
|
|
31
|
+
interface ICommandSettingsAdapter<TSettings extends ICommandSettingsDocument = ICommandSettingsDocument> {
|
|
32
|
+
read(): TSettings;
|
|
33
|
+
write(settings: TSettings): void;
|
|
34
|
+
}
|
|
35
|
+
interface ICommandProcessAdapter {
|
|
36
|
+
requestExit(reason?: TSessionEndReason): void;
|
|
37
|
+
requestRestart(reason: TSessionEndReason, message: string): void;
|
|
38
|
+
}
|
|
39
|
+
interface ICommandPickerAdapter<TItem extends ICommandSettingsDocument> {
|
|
40
|
+
pick(items: readonly TItem[]): Promise<TItem | undefined> | TItem | undefined;
|
|
41
|
+
}
|
|
42
|
+
interface ICommandPermissionModeAdapter {
|
|
43
|
+
getPermissionMode(): TPermissionMode;
|
|
44
|
+
setPermissionMode(mode: TPermissionMode): void;
|
|
45
|
+
listSessionAllowedTools(): readonly string[];
|
|
46
|
+
}
|
|
47
|
+
interface ICommandHostAdapters {
|
|
48
|
+
settings?: ICommandSettingsAdapter;
|
|
49
|
+
process?: ICommandProcessAdapter;
|
|
50
|
+
permissionMode?: ICommandPermissionModeAdapter;
|
|
51
|
+
plugin?: ICommandPluginAdapter$1;
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/background-tasks/background-job-orchestrator.d.ts
|
|
55
|
+
interface IBackgroundJobOrchestratorOptions {
|
|
56
|
+
manager: IBackgroundTaskManager;
|
|
57
|
+
now?: () => string;
|
|
58
|
+
idFactory?: TBackgroundJobGroupIdFactory;
|
|
59
|
+
initialGroups?: readonly IBackgroundJobGroupState[];
|
|
60
|
+
}
|
|
61
|
+
declare class BackgroundJobOrchestrator {
|
|
62
|
+
private readonly manager;
|
|
63
|
+
private readonly now;
|
|
64
|
+
private readonly idFactory;
|
|
65
|
+
private readonly unsubscribeManager;
|
|
66
|
+
private readonly listeners;
|
|
67
|
+
private readonly groups;
|
|
68
|
+
private sequence;
|
|
69
|
+
constructor(options: IBackgroundJobOrchestratorOptions);
|
|
70
|
+
createGroup(request: IBackgroundJobGroupCreateRequest): IBackgroundJobGroupState;
|
|
71
|
+
listGroups(): IBackgroundJobGroupState[];
|
|
72
|
+
getGroup(groupId: string): IBackgroundJobGroupState | undefined;
|
|
73
|
+
waitGroup(groupId: string): Promise<IBackgroundJobGroupState>;
|
|
74
|
+
subscribe(listener: TBackgroundJobGroupEventListener): () => void;
|
|
75
|
+
dispose(): void;
|
|
76
|
+
private nextGroupId;
|
|
77
|
+
private restoreGroup;
|
|
78
|
+
private createRecord;
|
|
79
|
+
private captureExistingTerminalTasks;
|
|
80
|
+
private handleTaskEvent;
|
|
81
|
+
private captureTask;
|
|
82
|
+
private evaluateCompletion;
|
|
83
|
+
private emit;
|
|
84
|
+
}
|
|
85
|
+
declare function summarizeBackgroundJobGroup(group: IBackgroundJobGroupState): IBackgroundJobGroupSummary;
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/background-tasks/execution-workspace-types.d.ts
|
|
88
|
+
declare const EXECUTION_ORIGIN_METADATA_KEYS: {
|
|
89
|
+
readonly kind: "executionOriginKind";
|
|
90
|
+
readonly sessionId: "executionOriginSessionId";
|
|
91
|
+
readonly turnId: "executionOriginTurnId";
|
|
92
|
+
readonly commandName: "executionOriginCommandName";
|
|
93
|
+
readonly toolCallId: "executionOriginToolCallId";
|
|
94
|
+
readonly skillId: "executionOriginSkillId";
|
|
95
|
+
readonly label: "executionOriginLabel";
|
|
96
|
+
};
|
|
97
|
+
declare function createMainThreadExecutionEntryId(sessionId: string): string;
|
|
98
|
+
declare function createBackgroundTaskExecutionEntryId(taskId: string): string;
|
|
99
|
+
declare function createBackgroundGroupExecutionEntryId(groupId: string): string;
|
|
100
|
+
declare function parseExecutionWorkspaceEntryId(entryId: string): IExecutionWorkspaceEntryRef | undefined;
|
|
101
|
+
declare function createExecutionOriginMetadata(origin: IExecutionOrigin): Record<string, TBackgroundPrimitive>;
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/background-tasks/execution-workspace-projection.d.ts
|
|
104
|
+
declare function createExecutionWorkspaceSnapshot(input: ICreateExecutionWorkspaceSnapshotInput): IExecutionWorkspaceSnapshot;
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/background-tasks/execution-workspace-detail.d.ts
|
|
107
|
+
declare function createMainThreadDetailPage(input: ICreateMainThreadDetailPageInput): IExecutionDetailPage;
|
|
108
|
+
declare function createLineDetailPage(input: ICreateLineDetailPageInput): IExecutionDetailPage;
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/background-tasks/execution-workspace-spawner.d.ts
|
|
111
|
+
interface ISpawnAgentTaskRequest {
|
|
112
|
+
readonly label: string;
|
|
113
|
+
readonly agentType: string;
|
|
114
|
+
readonly prompt: string;
|
|
115
|
+
readonly mode?: TBackgroundTaskMode;
|
|
116
|
+
readonly parentTaskId?: string;
|
|
117
|
+
readonly depth?: number;
|
|
118
|
+
readonly cwd?: string;
|
|
119
|
+
readonly model?: string;
|
|
120
|
+
readonly isolation?: TBackgroundTaskIsolation;
|
|
121
|
+
readonly allowedTools?: readonly string[];
|
|
122
|
+
readonly disallowedTools?: readonly string[];
|
|
123
|
+
readonly permissionPolicy?: TBackgroundPermissionPolicy;
|
|
124
|
+
readonly timeoutMs?: number;
|
|
125
|
+
readonly idleTimeoutMs?: number;
|
|
126
|
+
readonly maxRuntimeMs?: number;
|
|
127
|
+
readonly outputLimitBytes?: number;
|
|
128
|
+
readonly maxTextDeltas?: number;
|
|
129
|
+
readonly repetitionWindow?: number;
|
|
130
|
+
readonly repetitionThreshold?: number;
|
|
131
|
+
}
|
|
132
|
+
interface ISpawnProcessTaskRequest {
|
|
133
|
+
readonly command: string;
|
|
134
|
+
readonly label?: string;
|
|
135
|
+
readonly mode?: TBackgroundTaskMode;
|
|
136
|
+
readonly parentTaskId?: string;
|
|
137
|
+
readonly depth?: number;
|
|
138
|
+
readonly cwd?: string;
|
|
139
|
+
readonly shell?: string;
|
|
140
|
+
readonly env?: Record<string, string>;
|
|
141
|
+
readonly stdin?: string;
|
|
142
|
+
readonly timeoutMs?: number;
|
|
143
|
+
readonly idleTimeoutMs?: number;
|
|
144
|
+
readonly maxRuntimeMs?: number;
|
|
145
|
+
readonly outputLimitBytes?: number;
|
|
146
|
+
}
|
|
147
|
+
interface IBackgroundTaskSpawnerGroupRequest {
|
|
148
|
+
readonly waitPolicy: IBackgroundJobGroupCreateRequest$1['waitPolicy'];
|
|
149
|
+
readonly taskIds: readonly string[];
|
|
150
|
+
readonly label?: string;
|
|
151
|
+
}
|
|
152
|
+
interface IExecutionWorkspaceTaskSpawner {
|
|
153
|
+
spawnAgent(request: ISpawnAgentTaskRequest): Promise<IBackgroundTaskState>;
|
|
154
|
+
spawnProcess(request: ISpawnProcessTaskRequest): Promise<IBackgroundTaskState>;
|
|
155
|
+
createGroup(request: IBackgroundTaskSpawnerGroupRequest): IBackgroundJobGroupState$1;
|
|
156
|
+
}
|
|
157
|
+
interface ICreateExecutionWorkspaceTaskSpawnerOptions {
|
|
158
|
+
readonly manager: IBackgroundTaskManager;
|
|
159
|
+
readonly groupOrchestrator: BackgroundJobOrchestrator;
|
|
160
|
+
readonly sessionId: string;
|
|
161
|
+
readonly cwd: string;
|
|
162
|
+
readonly origin: IExecutionOrigin$1;
|
|
163
|
+
}
|
|
164
|
+
declare function createExecutionWorkspaceTaskSpawner(options: ICreateExecutionWorkspaceTaskSpawnerOptions): IExecutionWorkspaceTaskSpawner;
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region src/checkpoints/edit-checkpoint-types.d.ts
|
|
167
|
+
interface IEditCheckpointRecorder {
|
|
168
|
+
captureFile(filePath: string): Promise<void> | void;
|
|
169
|
+
}
|
|
170
|
+
interface IEditCheckpointTurnInput {
|
|
171
|
+
sessionId: string;
|
|
172
|
+
prompt: string;
|
|
173
|
+
}
|
|
174
|
+
interface IEditCheckpointSummary {
|
|
175
|
+
id: string;
|
|
176
|
+
sessionId: string;
|
|
177
|
+
sequence: number;
|
|
178
|
+
prompt: string;
|
|
179
|
+
createdAt: string;
|
|
180
|
+
fileCount: number;
|
|
181
|
+
}
|
|
182
|
+
interface IEditCheckpointFileRecord {
|
|
183
|
+
originalPath: string;
|
|
184
|
+
existed: boolean;
|
|
185
|
+
snapshotFile?: string;
|
|
186
|
+
}
|
|
187
|
+
interface IEditCheckpointManifest extends IEditCheckpointSummary {
|
|
188
|
+
version: 1;
|
|
189
|
+
files: IEditCheckpointFileRecord[];
|
|
190
|
+
}
|
|
191
|
+
type TEditCheckpointFileRestoreAction = 'restore-preimage' | 'delete-created-file';
|
|
192
|
+
interface IEditCheckpointFileInspection {
|
|
193
|
+
originalPath: string;
|
|
194
|
+
relativePath: string;
|
|
195
|
+
existed: boolean;
|
|
196
|
+
restoreAction: TEditCheckpointFileRestoreAction;
|
|
197
|
+
snapshotAvailable: boolean;
|
|
198
|
+
snapshotSizeBytes?: number;
|
|
199
|
+
}
|
|
200
|
+
interface IEditCheckpointInspectionPlan {
|
|
201
|
+
checkpointIds: string[];
|
|
202
|
+
fileCount: number;
|
|
203
|
+
}
|
|
204
|
+
interface IEditCheckpointInspection {
|
|
205
|
+
target: IEditCheckpointSummary;
|
|
206
|
+
capturedFiles: IEditCheckpointFileInspection[];
|
|
207
|
+
restoreToCheckpoint: IEditCheckpointInspectionPlan;
|
|
208
|
+
rollbackThroughCheckpoint: IEditCheckpointInspectionPlan;
|
|
209
|
+
}
|
|
210
|
+
interface IEditCheckpointRestoreResult {
|
|
211
|
+
target: IEditCheckpointSummary;
|
|
212
|
+
restoredCheckpointCount: number;
|
|
213
|
+
restoredFileCount: number;
|
|
214
|
+
removedCheckpointCount: number;
|
|
215
|
+
}
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/checkpoints/edit-checkpoint-store.d.ts
|
|
218
|
+
interface IEditCheckpointStoreOptions {
|
|
219
|
+
cwd: string;
|
|
220
|
+
now?: () => Date;
|
|
221
|
+
}
|
|
222
|
+
declare class EditCheckpointStore {
|
|
223
|
+
private readonly fs;
|
|
224
|
+
private readonly fsAsync;
|
|
225
|
+
private readonly cwd;
|
|
226
|
+
private readonly rootDir;
|
|
227
|
+
private readonly now;
|
|
228
|
+
private activeTurn;
|
|
229
|
+
constructor(options: IEditCheckpointStoreOptions, fs?: IFileSystem, fsAsync?: IFileSystemAsync);
|
|
230
|
+
beginTurn(input: IEditCheckpointTurnInput): Promise<IEditCheckpointSummary>;
|
|
231
|
+
captureFile(filePath: string): Promise<void>;
|
|
232
|
+
finalizeTurn(): Promise<IEditCheckpointSummary | undefined>;
|
|
233
|
+
list(sessionId: string): IEditCheckpointSummary[];
|
|
234
|
+
inspect(sessionId: string, checkpointId: string): IEditCheckpointInspection;
|
|
235
|
+
restoreToCheckpoint(sessionId: string, checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
236
|
+
rollbackThroughCheckpoint(sessionId: string, checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
237
|
+
private createFileRecord;
|
|
238
|
+
private restoreFile;
|
|
239
|
+
private loadManifests;
|
|
240
|
+
private nextSequence;
|
|
241
|
+
private writeManifest;
|
|
242
|
+
private sessionDir;
|
|
243
|
+
private checkpointDir;
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/checkpoints/edit-checkpoint-tools.d.ts
|
|
247
|
+
declare function wrapEditCheckpointTools(tools: readonly IToolWithEventService[], recorder: IEditCheckpointRecorder): IToolWithEventService[];
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/context/prompt-file-reference-types.d.ts
|
|
250
|
+
type TPromptFileReferenceDiagnosticCode = 'not-found' | 'outside-root' | 'directory-not-supported' | 'file-too-large' | 'total-too-large' | 'too-many-references' | 'max-depth' | 'circular-reference' | 'unreadable';
|
|
251
|
+
interface IPromptFileReferenceToken {
|
|
252
|
+
original: string;
|
|
253
|
+
path: string;
|
|
254
|
+
index: number;
|
|
255
|
+
}
|
|
256
|
+
interface IResolvedPromptFileReference extends IPromptFileReferenceRecord {
|
|
257
|
+
content: string;
|
|
258
|
+
}
|
|
259
|
+
interface IPromptFileReferenceDiagnostic {
|
|
260
|
+
code: TPromptFileReferenceDiagnosticCode;
|
|
261
|
+
severity: 'error';
|
|
262
|
+
reference: string;
|
|
263
|
+
message: string;
|
|
264
|
+
path?: string;
|
|
265
|
+
}
|
|
266
|
+
interface IPromptFileReferenceLimits {
|
|
267
|
+
maxDepth?: number;
|
|
268
|
+
maxReferences?: number;
|
|
269
|
+
maxFileBytes?: number;
|
|
270
|
+
maxTotalBytes?: number;
|
|
271
|
+
}
|
|
272
|
+
interface IPromptFileReferenceResolveOptions {
|
|
273
|
+
cwd: string;
|
|
274
|
+
limits?: IPromptFileReferenceLimits;
|
|
275
|
+
reason?: TPromptFileReferenceReason;
|
|
276
|
+
fsAsync?: IFileSystemAsync;
|
|
277
|
+
}
|
|
278
|
+
interface IResolvedPromptFileReferences {
|
|
279
|
+
references: IResolvedPromptFileReference[];
|
|
280
|
+
diagnostics: IPromptFileReferenceDiagnostic[];
|
|
281
|
+
}
|
|
282
|
+
interface IPromptFileReferenceHistoryData {
|
|
283
|
+
message: string;
|
|
284
|
+
references: IPromptFileReferenceRecord[];
|
|
285
|
+
}
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/context/context-reference-inventory.d.ts
|
|
288
|
+
interface IContextReferenceInventoryLimits {
|
|
289
|
+
maxActiveReferences?: number;
|
|
290
|
+
maxActiveBytes?: number;
|
|
291
|
+
maxObservedReferences?: number;
|
|
292
|
+
}
|
|
293
|
+
interface IContextReferenceAddResult {
|
|
294
|
+
reference?: IContextReferenceItem;
|
|
295
|
+
evicted: IContextReferenceItem[];
|
|
296
|
+
diagnostics: string[];
|
|
297
|
+
}
|
|
298
|
+
interface IContextReferenceRemoveResult {
|
|
299
|
+
removed?: IContextReferenceItem;
|
|
300
|
+
}
|
|
301
|
+
interface IContextReferenceClearResult {
|
|
302
|
+
removed: IContextReferenceItem[];
|
|
303
|
+
}
|
|
304
|
+
interface IContextReferenceUpsertResult {
|
|
305
|
+
references: IContextReferenceItem[];
|
|
306
|
+
evicted: IContextReferenceItem[];
|
|
307
|
+
}
|
|
308
|
+
declare function createContextReferenceItem(record: IPromptFileReferenceRecord, loadType: TContextReferenceLoadType, status: TContextReferenceStatus, timestamp?: string): IContextReferenceItem;
|
|
309
|
+
declare function upsertContextReference(references: readonly IContextReferenceItem[], item: IContextReferenceItem, limits?: IContextReferenceInventoryLimits): IContextReferenceUpsertResult;
|
|
310
|
+
declare function removeContextReference(references: readonly IContextReferenceItem[], query: string): {
|
|
311
|
+
references: IContextReferenceItem[];
|
|
312
|
+
result: IContextReferenceRemoveResult;
|
|
313
|
+
};
|
|
314
|
+
declare function clearContextReferences(references: readonly IContextReferenceItem[]): IContextReferenceClearResult;
|
|
315
|
+
declare function listActiveContextReferences(references: readonly IContextReferenceItem[]): IContextReferenceItem[];
|
|
316
|
+
declare function toContextReferenceRecords(references: readonly IContextReferenceItem[]): IPromptFileReferenceRecord[];
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/goal/goal-controller.d.ts
|
|
319
|
+
declare const DEFAULT_GOAL_MAX_ITERATIONS = 25;
|
|
320
|
+
declare const DEFAULT_GOAL_NO_PROGRESS_LIMIT = 2;
|
|
321
|
+
/** Parsed structured completion signal emitted by the agent via the goal-status tool. */
|
|
322
|
+
interface IGoalSignal {
|
|
323
|
+
status: 'continue' | 'satisfied';
|
|
324
|
+
reason: string;
|
|
325
|
+
}
|
|
326
|
+
/** The controller's decision after a goal-driven turn completes. */
|
|
327
|
+
type TGoalDecision = {
|
|
328
|
+
action: 'continue';
|
|
329
|
+
prompt: string;
|
|
330
|
+
goal: IGoalState;
|
|
331
|
+
} | {
|
|
332
|
+
action: 'stop';
|
|
333
|
+
reason: TGoalStopReason;
|
|
334
|
+
goal: IGoalState;
|
|
335
|
+
};
|
|
336
|
+
/** Options for {@link GoalController.start}. */
|
|
337
|
+
interface IGoalStartOptions {
|
|
338
|
+
maxIterations?: number;
|
|
339
|
+
noProgressLimit?: number;
|
|
340
|
+
}
|
|
341
|
+
/** Injected seams so the controller stays deterministic and testable. */
|
|
342
|
+
interface IGoalControllerDeps {
|
|
343
|
+
now: () => string;
|
|
344
|
+
createId: () => string;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Read the structured completion signal from a finished turn's tool summaries. Returns the LAST
|
|
348
|
+
* `report_goal_status` call's validated payload, or `null` when the agent did not signal. The
|
|
349
|
+
* payload is schema-validated at the tool layer, so this is deterministic — never prose parsing.
|
|
350
|
+
*/
|
|
351
|
+
declare function extractGoalSignal(toolSummaries: readonly IToolSummary[]): IGoalSignal | null;
|
|
352
|
+
declare class GoalController {
|
|
353
|
+
private readonly deps;
|
|
354
|
+
private goal;
|
|
355
|
+
private consecutiveIdleTurns;
|
|
356
|
+
private noProgressLimit;
|
|
357
|
+
constructor(deps?: IGoalControllerDeps);
|
|
358
|
+
getState(): IGoalState | null;
|
|
359
|
+
isActive(): boolean;
|
|
360
|
+
/**
|
|
361
|
+
* Begin pursuing a new goal. Throws on an empty objective. Returns the seeded state and the
|
|
362
|
+
* first-turn prompt the caller should submit.
|
|
363
|
+
*/
|
|
364
|
+
start(objective: string, options?: IGoalStartOptions): {
|
|
365
|
+
goal: IGoalState;
|
|
366
|
+
prompt: string;
|
|
367
|
+
};
|
|
368
|
+
/** Restore a persisted goal on resume. Only an `active` goal resumes pursuit. */
|
|
369
|
+
restore(goal: IGoalState, noProgressLimit?: number): void;
|
|
370
|
+
/** User-requested cancellation. Returns the stopped state, or `null` when no goal is active. */
|
|
371
|
+
cancel(): IGoalState | null;
|
|
372
|
+
/**
|
|
373
|
+
* Advance the goal after a goal-driven turn completes. Returns the next decision, or `null`
|
|
374
|
+
* when no goal is active (the caller should ignore non-goal turns).
|
|
375
|
+
*/
|
|
376
|
+
onTurnComplete(result: IExecutionResult): TGoalDecision | null;
|
|
377
|
+
private stop;
|
|
378
|
+
}
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region src/goal/goal-status-tool.d.ts
|
|
381
|
+
/** Tool name the agent calls to report goal status. Vendor-neutral, generic. */
|
|
382
|
+
declare const GOAL_SIGNAL_TOOL_NAME = "report_goal_status";
|
|
383
|
+
/**
|
|
384
|
+
* Create the goal completion-signal tool. Included in the session tool set only when goal
|
|
385
|
+
* pursuit is enabled (interactive sessions). The agent must call it only while pursuing an
|
|
386
|
+
* assigned goal; outside a goal it is a harmless no-op acknowledgement.
|
|
387
|
+
*/
|
|
388
|
+
declare function createGoalStatusTool(): IToolWithEventService;
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region src/goal/goal-prompts.d.ts
|
|
391
|
+
/** The prompt that kicks off goal pursuit (first iteration). */
|
|
392
|
+
declare function buildGoalStartPrompt(objective: string): string;
|
|
393
|
+
/** The continuation prompt for each subsequent goal-driven turn. */
|
|
394
|
+
declare function buildGoalContinuationPrompt(goal: IGoalState): string;
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region src/memory/project-memory-store.d.ts
|
|
397
|
+
declare const MEMORY_INDEX_MAX_LINES = 200;
|
|
398
|
+
declare const MEMORY_INDEX_MAX_BYTES: number;
|
|
399
|
+
interface IStartupMemory {
|
|
400
|
+
content: string;
|
|
401
|
+
path: string;
|
|
402
|
+
lineCount: number;
|
|
403
|
+
truncated: boolean;
|
|
404
|
+
}
|
|
405
|
+
interface IMemoryTopicSummary {
|
|
406
|
+
name: string;
|
|
407
|
+
path: string;
|
|
408
|
+
}
|
|
409
|
+
interface IProjectMemorySummary {
|
|
410
|
+
indexPath: string;
|
|
411
|
+
topicsPath: string;
|
|
412
|
+
topics: IMemoryTopicSummary[];
|
|
413
|
+
}
|
|
414
|
+
interface IAppendMemoryInput {
|
|
415
|
+
type: TMemoryType;
|
|
416
|
+
topic: string;
|
|
417
|
+
text: string;
|
|
418
|
+
}
|
|
419
|
+
interface IAppendMemoryResult {
|
|
420
|
+
indexPath: string;
|
|
421
|
+
topicPath: string;
|
|
422
|
+
topic: string;
|
|
423
|
+
deduplicated: boolean;
|
|
424
|
+
}
|
|
425
|
+
declare function isMemoryType(value: string): value is TMemoryType;
|
|
426
|
+
declare class ProjectMemoryStore {
|
|
427
|
+
private readonly cwd;
|
|
428
|
+
private readonly now;
|
|
429
|
+
constructor(cwd: string, now?: () => Date);
|
|
430
|
+
getIndexPath(): string;
|
|
431
|
+
getTopicsPath(): string;
|
|
432
|
+
loadStartupMemory(): IStartupMemory;
|
|
433
|
+
list(): IProjectMemorySummary;
|
|
434
|
+
readTopic(topic: string): string;
|
|
435
|
+
append(input: IAppendMemoryInput): IAppendMemoryResult;
|
|
436
|
+
}
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/memory/automatic-memory-types.d.ts
|
|
439
|
+
type TMemoryCandidateStatus = 'pending' | 'approved' | 'rejected' | 'saved' | 'skipped';
|
|
440
|
+
interface IMemoryCandidate {
|
|
441
|
+
id: string;
|
|
442
|
+
type: TMemoryType;
|
|
443
|
+
topic: string;
|
|
444
|
+
text: string;
|
|
445
|
+
sourceMessageIds: string[];
|
|
446
|
+
confidence: number;
|
|
447
|
+
createdAt: string;
|
|
448
|
+
reason: string;
|
|
449
|
+
}
|
|
450
|
+
interface IMemoryPendingRecord extends IMemoryCandidate {
|
|
451
|
+
status: TMemoryCandidateStatus;
|
|
452
|
+
updatedAt: string;
|
|
453
|
+
decisionReason?: string;
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region src/command-api/context/context-command-api.d.ts
|
|
457
|
+
type TAutoCompactThreshold$1 = number | false;
|
|
458
|
+
declare const DEFAULT_AUTO_COMPACT_THRESHOLD = 0.835;
|
|
459
|
+
declare const AUTO_COMPACT_THRESHOLD_SETTINGS_KEY = "autoCompactThreshold";
|
|
460
|
+
interface ICompactContextResult {
|
|
461
|
+
before: IContextWindowState;
|
|
462
|
+
after: IContextWindowState;
|
|
463
|
+
beforeMessageCount: number;
|
|
464
|
+
afterMessageCount: number;
|
|
465
|
+
}
|
|
466
|
+
/** Read context-window state through the command host facade. */
|
|
467
|
+
declare function readCommandContextState(context: ICommandHostContext): IContextWindowState;
|
|
468
|
+
/** Read the effective automatic compact policy through the command host facade. */
|
|
469
|
+
declare function readAutoCompactThreshold(context: ICommandHostContext): TAutoCompactThreshold$1;
|
|
470
|
+
/** Read the source of the effective automatic compact policy. */
|
|
471
|
+
declare function readAutoCompactThresholdSource(context: ICommandHostContext): TAutoCompactThresholdSource;
|
|
472
|
+
/** Update the active session's automatic compact policy through the command host facade. */
|
|
473
|
+
declare function setCommandAutoCompactThreshold(context: ICommandHostContext, threshold: TAutoCompactThreshold$1, source: TAutoCompactThresholdSource): void;
|
|
474
|
+
/** Persist an automatic compact policy value through the host settings adapter, when present. */
|
|
475
|
+
declare function writeAutoCompactThresholdSetting(context: ICommandHostContext, threshold: TAutoCompactThreshold$1): boolean;
|
|
476
|
+
/** Remove the persisted automatic compact policy through the host settings adapter, when present. */
|
|
477
|
+
declare function resetAutoCompactThresholdSetting(context: ICommandHostContext): boolean;
|
|
478
|
+
/** Run manual compaction through the command host facade and return before/after state. */
|
|
479
|
+
declare function compactCommandContext(context: ICommandHostContext, instructions?: string): Promise<ICompactContextResult>;
|
|
480
|
+
/** List context reference inventory entries through the command host facade. */
|
|
481
|
+
declare function listCommandContextReferences(context: ICommandHostContext): IContextReferenceItem[];
|
|
482
|
+
/** Add a manual context reference through the command host facade. */
|
|
483
|
+
declare function addCommandContextReference(context: ICommandHostContext, path: string): Promise<IContextReferenceAddResult>;
|
|
484
|
+
/** Remove a context reference through the command host facade. */
|
|
485
|
+
declare function removeCommandContextReference(context: ICommandHostContext, path: string): IContextReferenceRemoveResult;
|
|
486
|
+
/** Clear all context references through the command host facade. */
|
|
487
|
+
declare function clearCommandContextReferences(context: ICommandHostContext): IContextReferenceClearResult;
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region src/command-api/host-context.d.ts
|
|
490
|
+
interface ICommandSkillListEntry {
|
|
491
|
+
readonly name: string;
|
|
492
|
+
readonly description: string;
|
|
493
|
+
readonly source: string;
|
|
494
|
+
readonly modelInvocable: boolean;
|
|
495
|
+
readonly userInvocable: boolean;
|
|
496
|
+
readonly argumentHint?: string;
|
|
497
|
+
readonly context?: string;
|
|
498
|
+
readonly agent?: string;
|
|
499
|
+
}
|
|
500
|
+
type TCommandInvocationSource = 'user' | 'model';
|
|
501
|
+
interface ICommandSkillActivationRequest {
|
|
502
|
+
readonly invocationSource: TCommandInvocationSource;
|
|
503
|
+
readonly displayInput?: string;
|
|
504
|
+
readonly rawInput?: string;
|
|
505
|
+
}
|
|
506
|
+
type TAutoCompactThresholdSource = 'default' | 'settings' | 'session';
|
|
507
|
+
/**
|
|
508
|
+
* Live model re-application options (PRESET-013). Carries the model group a preset switch may
|
|
509
|
+
* re-apply to a running session; `maxOutputTokens` maps to the agent's `maxTokens` channel.
|
|
510
|
+
*/
|
|
511
|
+
interface IModelReapplyOptions {
|
|
512
|
+
model?: string;
|
|
513
|
+
effort?: TModelEffort;
|
|
514
|
+
temperature?: number;
|
|
515
|
+
maxOutputTokens?: number;
|
|
516
|
+
}
|
|
517
|
+
interface ICommandSessionRuntime {
|
|
518
|
+
clearHistory(): void;
|
|
519
|
+
compact(instructions?: string): Promise<void>;
|
|
520
|
+
getContextState(): IContextWindowState;
|
|
521
|
+
getPermissionMode(): TPermissionMode;
|
|
522
|
+
setPermissionMode(mode: TPermissionMode): void;
|
|
523
|
+
getSessionId(): string;
|
|
524
|
+
getMessageCount(): number;
|
|
525
|
+
getSessionAllowedTools(): readonly string[];
|
|
526
|
+
getAutoCompactThreshold(): number | false;
|
|
527
|
+
getFullHistory(): IHistoryEntry[];
|
|
528
|
+
getHistory(): TUniversalMessage[];
|
|
529
|
+
setAutoCompactThreshold?(threshold: TAutoCompactThreshold$1): void;
|
|
530
|
+
getSessionTokenUsage?(): {
|
|
531
|
+
inputTokens: number;
|
|
532
|
+
outputTokens: number;
|
|
533
|
+
} | undefined;
|
|
534
|
+
getModelId?(): string | undefined;
|
|
535
|
+
/**
|
|
536
|
+
* Re-apply model/effort/temperature/maxOutputTokens to the live session (PRESET-013).
|
|
537
|
+
* May be async: the runtime ensures the agent is fully initialized before mutating its model
|
|
538
|
+
* configuration, so callers must await the result.
|
|
539
|
+
*/
|
|
540
|
+
applyModelOptions?(options: IModelReapplyOptions): void | Promise<void>;
|
|
541
|
+
/** Read the active preset id (PRESET-011 runtime state). */
|
|
542
|
+
getActivePresetId?(): string;
|
|
543
|
+
/** Set the active preset id (PRESET-011 runtime state — pure state, no option re-application). */
|
|
544
|
+
setActivePresetId?(id: string): void;
|
|
545
|
+
/** Toggle subagent dispatch live for the running session (PRESET-016 runtime gate). */
|
|
546
|
+
setParallelSubagentsEnabled?(enabled: boolean): void;
|
|
547
|
+
}
|
|
548
|
+
interface ICommandSessionReplayValidationReport {
|
|
549
|
+
logFile: string;
|
|
550
|
+
entryCount: number;
|
|
551
|
+
validation: ISessionReplayValidationResult;
|
|
552
|
+
}
|
|
553
|
+
interface ICommandHostContext {
|
|
554
|
+
clearConversationHistory?(): void;
|
|
555
|
+
validateCurrentSessionReplayLog?(): ICommandSessionReplayValidationReport;
|
|
556
|
+
getAgentJobCapability?(): IAgentJobHostContext | undefined;
|
|
557
|
+
/**
|
|
558
|
+
* CMD-004: the injected "ask the user" port, or undefined when no interactive renderer is attached.
|
|
559
|
+
* A command solicits a structured answer via `getUserInteraction()?.ask(request)`; absence means no
|
|
560
|
+
* human is available (headless/automation, or a model-invoked command) — the command must handle it
|
|
561
|
+
* as a cancellation, never a silent guess.
|
|
562
|
+
*/
|
|
563
|
+
getUserInteraction?(): IUserInteraction | undefined;
|
|
564
|
+
getSession(): ICommandSessionRuntime;
|
|
565
|
+
/** PRESET-014 — re-apply a preset persona to the live system prompt. */
|
|
566
|
+
applyPersona?(persona: string): void;
|
|
567
|
+
/** PRESET-017 — toggle the verify-before-done self-verification section on the live prompt. */
|
|
568
|
+
applySelfVerification?(enabled: boolean): void;
|
|
569
|
+
/** PRESET-015 — re-apply command-module selection to the live session. */
|
|
570
|
+
applyCommandModuleSelection?(enabled: readonly string[] | undefined, disabled: readonly string[] | undefined): void;
|
|
571
|
+
getContextState(): IContextWindowState;
|
|
572
|
+
getAutoCompactThreshold(): TAutoCompactThreshold$1;
|
|
573
|
+
getAutoCompactThresholdSource?(): TAutoCompactThresholdSource;
|
|
574
|
+
setAutoCompactThreshold?(threshold: TAutoCompactThreshold$1, source?: TAutoCompactThresholdSource): void;
|
|
575
|
+
getCommandHostAdapters?(): ICommandHostAdapters;
|
|
576
|
+
compactContext(instructions?: string): Promise<void>;
|
|
577
|
+
listContextReferences?(): IContextReferenceItem[];
|
|
578
|
+
addContextReference?(path: string): Promise<IContextReferenceAddResult>;
|
|
579
|
+
removeContextReference?(path: string): IContextReferenceRemoveResult;
|
|
580
|
+
clearContextReferences?(): IContextReferenceClearResult;
|
|
581
|
+
getCwd(): string;
|
|
582
|
+
getCommandInvocationSource?(): TCommandInvocationSource;
|
|
583
|
+
listCommands?(): ICommandListEntry[];
|
|
584
|
+
listSkills?(): ICommandSkillListEntry[];
|
|
585
|
+
executeSkillCommandByName?(name: string, args: string, request: ICommandSkillActivationRequest): Promise<ICommandResult$1 | null>;
|
|
586
|
+
listEditCheckpoints(): IEditCheckpointSummary[];
|
|
587
|
+
inspectEditCheckpoint?(checkpointId: string): IEditCheckpointInspection;
|
|
588
|
+
restoreEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
589
|
+
rollbackEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
590
|
+
getUsedMemoryReferences(): IMemoryReference[];
|
|
591
|
+
recordMemoryEvent(event: IMemoryEvent): void;
|
|
592
|
+
listBackgroundTasks(filter?: IBackgroundTaskListFilter): IBackgroundTaskState[];
|
|
593
|
+
readBackgroundTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
594
|
+
cancelBackgroundTask(taskId: string, reason?: string): Promise<void>;
|
|
595
|
+
closeBackgroundTask(taskId: string): Promise<void>;
|
|
596
|
+
/** GOAL-001 — assign and begin pursuing an autonomous goal. */
|
|
597
|
+
setGoal?(objective: string, options?: IGoalStartOptions): Promise<IGoalState>;
|
|
598
|
+
/** GOAL-001 — the current goal state, or null when no goal has been set. */
|
|
599
|
+
getGoalState?(): IGoalState | null;
|
|
600
|
+
/** GOAL-001 — cancel an in-flight goal; returns the stopped state or null. */
|
|
601
|
+
cancelGoal?(): IGoalState | null;
|
|
602
|
+
/**
|
|
603
|
+
* TERM-001 — whether the active transport can hand the real terminal to a child process. `false`
|
|
604
|
+
* (or `runWithTerminal` absent) when there is no interactive TTY (e.g. headless).
|
|
605
|
+
*/
|
|
606
|
+
canHandoffTerminal?(): boolean;
|
|
607
|
+
/**
|
|
608
|
+
* TERM-001 — suspend the display, run `fn` (which spawns a child with inherited stdio), then
|
|
609
|
+
* restore the display. Exclusive (one handoff at a time) and abort-safe; rejects without running
|
|
610
|
+
* `fn` when a handoff is not possible. The framework owns this orchestration; the transport
|
|
611
|
+
* implements the underlying suspend/resume.
|
|
612
|
+
*/
|
|
613
|
+
runWithTerminal?<T>(fn: () => Promise<T>): Promise<T>;
|
|
614
|
+
}
|
|
615
|
+
interface IAgentJobHostContext {
|
|
616
|
+
listAgentDefinitions(): Array<{
|
|
617
|
+
name: string;
|
|
618
|
+
description: string;
|
|
619
|
+
}>;
|
|
620
|
+
listAgentJobs(): ISubagentJobState[];
|
|
621
|
+
spawnAgentJob(input: {
|
|
622
|
+
agentType: string;
|
|
623
|
+
label: string;
|
|
624
|
+
mode: 'foreground' | 'background';
|
|
625
|
+
prompt: string;
|
|
626
|
+
model?: string;
|
|
627
|
+
isolation?: TBackgroundTaskIsolation;
|
|
628
|
+
}): Promise<ISubagentJobState>;
|
|
629
|
+
sendAgentJob(jobId: string, prompt: string): Promise<void>;
|
|
630
|
+
cancelAgentJob(jobId: string, reason?: string): Promise<void>;
|
|
631
|
+
closeAgentJob(jobId: string): Promise<void>;
|
|
632
|
+
createBackgroundJobGroup(input: Omit<IBackgroundJobGroupCreateRequest$1, 'parentSessionId'>): IBackgroundJobGroupState$1;
|
|
633
|
+
waitBackgroundJobGroup(groupId: string): Promise<IBackgroundJobGroupState$1>;
|
|
634
|
+
/**
|
|
635
|
+
* FLOW-005: schedule a recurring/one-shot agent wake. On each cron fire the agent loop
|
|
636
|
+
* re-enters with `agentInstruction` (FLOW-001/002). `cronExpression` may be a standard cron
|
|
637
|
+
* string or an ISO timestamp (one-shot).
|
|
638
|
+
*/
|
|
639
|
+
spawnScheduledWake(input: {
|
|
640
|
+
label: string;
|
|
641
|
+
cronExpression: string;
|
|
642
|
+
agentInstruction: string;
|
|
643
|
+
}): Promise<IBackgroundTaskState>;
|
|
644
|
+
/**
|
|
645
|
+
* FLOW-005: monitor a process's output and wake the agent with `agentInstruction` when a
|
|
646
|
+
* line matches `matchPattern` (FLOW-004).
|
|
647
|
+
*/
|
|
648
|
+
spawnMonitorWake(input: {
|
|
649
|
+
label: string;
|
|
650
|
+
command: string;
|
|
651
|
+
matchPattern: string;
|
|
652
|
+
agentInstruction: string;
|
|
653
|
+
}): Promise<IBackgroundTaskState>;
|
|
654
|
+
readBackgroundTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
655
|
+
}
|
|
656
|
+
//#endregion
|
|
657
|
+
//#region src/command-api/contracts.d.ts
|
|
658
|
+
type TSystemCommandLifecycle = 'inline' | 'blocking' | 'background';
|
|
659
|
+
/** A user-visible command with descriptor metadata and execute logic. */
|
|
660
|
+
interface ISystemCommand {
|
|
661
|
+
name: string;
|
|
662
|
+
/** User-friendly display label (e.g., "Interaction Mode"). Falls back to `name` if not set. */
|
|
663
|
+
displayName?: string;
|
|
664
|
+
description: string;
|
|
665
|
+
/** Optional usage example shown in /help output (e.g., "/compact Summarize the context"). */
|
|
666
|
+
example?: string;
|
|
667
|
+
modelInvocable?: boolean;
|
|
668
|
+
userInvocable?: boolean;
|
|
669
|
+
argumentHint?: string;
|
|
670
|
+
safety?: TCapabilitySafety;
|
|
671
|
+
subcommands?: readonly ICommand[];
|
|
672
|
+
lifecycle?: TSystemCommandLifecycle;
|
|
673
|
+
/**
|
|
674
|
+
* Whether executing this command requires explicit user permission/confirmation.
|
|
675
|
+
* - `false`: runs immediately without any approval gate
|
|
676
|
+
* - `true`: user confirmation is required before execution
|
|
677
|
+
* - `undefined` (default): derived from `safety` — `'read-only'` → false, others → true
|
|
678
|
+
*/
|
|
679
|
+
requiresPermission?: boolean;
|
|
680
|
+
execute(context: ICommandHostContext, args: string): Promise<ICommandResult$1> | ICommandResult$1;
|
|
681
|
+
}
|
|
682
|
+
//#endregion
|
|
683
|
+
//#region src/command-api/command-module.d.ts
|
|
684
|
+
type TCommandModuleSessionRequirement = 'agent-runtime';
|
|
685
|
+
/** Composable command capability module. */
|
|
686
|
+
interface ICommandModule {
|
|
687
|
+
/** Stable module id for diagnostics and duplicate handling. */
|
|
688
|
+
readonly name: string;
|
|
689
|
+
/** Slash palette/autocomplete command sources contributed by this module. */
|
|
690
|
+
readonly commandSources?: readonly ICommandSource[];
|
|
691
|
+
/** Executable system commands contributed by this module. */
|
|
692
|
+
readonly systemCommands?: readonly ISystemCommand[];
|
|
693
|
+
/** Additional model-visible descriptors not derived from executable commands. */
|
|
694
|
+
readonly commandDescriptors?: readonly ICapabilityDescriptor[];
|
|
695
|
+
/** Runtime facilities required by this module. */
|
|
696
|
+
readonly sessionRequirements?: readonly TCommandModuleSessionRequirement[];
|
|
697
|
+
}
|
|
698
|
+
//#endregion
|
|
699
|
+
//#region src/command-api/provider/provider-settings.d.ts
|
|
700
|
+
interface IProviderProfileSettings extends IProviderProfileConfig {
|
|
701
|
+
[key: string]: TUniversalValue;
|
|
702
|
+
}
|
|
703
|
+
interface ILegacyProviderSettings {
|
|
704
|
+
[key: string]: TUniversalValue;
|
|
705
|
+
name?: string;
|
|
706
|
+
model?: string;
|
|
707
|
+
apiKey?: string;
|
|
708
|
+
baseURL?: string;
|
|
709
|
+
timeout?: number;
|
|
710
|
+
options?: Record<string, TUniversalValue>;
|
|
711
|
+
}
|
|
712
|
+
type TProviderSettingsDocument = Record<string, TUniversalValue> & {
|
|
713
|
+
currentProvider?: string;
|
|
714
|
+
providers?: Record<string, IProviderProfileSettings>;
|
|
715
|
+
provider?: ILegacyProviderSettings;
|
|
716
|
+
};
|
|
717
|
+
interface IProviderSetupInput {
|
|
718
|
+
profile: string;
|
|
719
|
+
type: string;
|
|
720
|
+
model?: string;
|
|
721
|
+
apiKey?: string;
|
|
722
|
+
apiKeyEnv?: string;
|
|
723
|
+
baseURL?: string;
|
|
724
|
+
timeout?: number;
|
|
725
|
+
setCurrent?: boolean;
|
|
726
|
+
}
|
|
727
|
+
interface IProviderSetupPatch {
|
|
728
|
+
currentProvider?: string;
|
|
729
|
+
providers: Record<string, IProviderProfileSettings>;
|
|
730
|
+
}
|
|
731
|
+
interface IProviderSettingsBuildOptions {
|
|
732
|
+
providerDefinitions?: readonly IProviderDefinition[];
|
|
733
|
+
/** Environment map for configure-time checks (test seam, default: process.env). */
|
|
734
|
+
env?: Record<string, string | undefined>;
|
|
735
|
+
}
|
|
736
|
+
declare function upsertProviderProfile(settings: TProviderSettingsDocument, profileName: string, profile: IProviderProfileSettings): TProviderSettingsDocument;
|
|
737
|
+
declare function setCurrentProvider(settings: TProviderSettingsDocument, profileName: string): TProviderSettingsDocument;
|
|
738
|
+
declare function deleteProviderProfile(settings: TProviderSettingsDocument, profileName: string, options?: {
|
|
739
|
+
replacementCurrentProvider?: string;
|
|
740
|
+
}): TProviderSettingsDocument;
|
|
741
|
+
declare function validateProviderProfile(profileName: string, profile: IProviderProfileSettings, options?: IProviderSettingsBuildOptions): void;
|
|
742
|
+
declare function buildProviderSetupPatch(input: IProviderSetupInput, options?: IProviderSettingsBuildOptions): IProviderSetupPatch;
|
|
743
|
+
declare function buildProviderProfile(input: IProviderSetupInput, options?: IProviderSettingsBuildOptions): IProviderProfileSettings;
|
|
744
|
+
declare function mergeProviderPatch(settings: TProviderSettingsDocument, patch: IProviderSetupPatch): TProviderSettingsDocument;
|
|
745
|
+
//#endregion
|
|
746
|
+
//#region src/command-api/provider/provider-command-types.d.ts
|
|
747
|
+
interface IProviderCommandSettingsAdapter {
|
|
748
|
+
readMergedSettings(): TProviderSettingsDocument;
|
|
749
|
+
readTargetSettings(): TProviderSettingsDocument;
|
|
750
|
+
writeTargetSettings(settings: TProviderSettingsDocument): void;
|
|
751
|
+
}
|
|
752
|
+
interface IProviderCommandModuleOptions {
|
|
753
|
+
providerDefinitions: readonly IProviderDefinition[];
|
|
754
|
+
settings: IProviderCommandSettingsAdapter;
|
|
755
|
+
orgPolicy?: IOrgPolicy;
|
|
756
|
+
}
|
|
757
|
+
//#endregion
|
|
758
|
+
//#region src/command-api/provider/provider-profile-names.d.ts
|
|
759
|
+
interface IProviderProfileNameSuggestionInput {
|
|
760
|
+
type: string;
|
|
761
|
+
}
|
|
762
|
+
interface IProviderProfileNameSuggestionOptions {
|
|
763
|
+
existingProfileNames?: readonly string[];
|
|
764
|
+
}
|
|
765
|
+
declare function suggestProviderProfileName(input: IProviderProfileNameSuggestionInput, options?: IProviderProfileNameSuggestionOptions): string;
|
|
766
|
+
declare function sanitizeProviderProfileName(value: string | undefined): string | undefined;
|
|
767
|
+
//#endregion
|
|
768
|
+
//#region src/command-api/provider/provider-command-probe.d.ts
|
|
769
|
+
declare function testProviderProfileCommand(currentProvider: string | undefined, providers: Record<string, IProviderProfileSettings> | undefined, profileArg: string | undefined, options: IProviderCommandModuleOptions): Promise<ICommandResult$1>;
|
|
770
|
+
declare function probeProviderProfile(profile: IProviderProfileConfig): Promise<IProviderProbeResult>;
|
|
771
|
+
//#endregion
|
|
772
|
+
//#region src/command-api/provider/settings-check.d.ts
|
|
773
|
+
type TSettingsCheck = 'missing' | 'valid' | 'corrupt' | 'incomplete';
|
|
774
|
+
declare function checkSettingsDocument(settings: TProviderSettingsDocument, providerDefinitions?: readonly IProviderDefinition[]): TSettingsCheck;
|
|
775
|
+
declare function checkSettingsFile(filePath: string, providerDefinitions?: readonly IProviderDefinition[]): TSettingsCheck;
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region src/command-api/provider/provider-configuration.d.ts
|
|
778
|
+
interface IProviderSwitchOptions {
|
|
779
|
+
knownProviders?: Record<string, IProviderProfileSettings>;
|
|
780
|
+
}
|
|
781
|
+
interface IActiveModelChangeOptions {
|
|
782
|
+
settingsPaths?: readonly string[];
|
|
783
|
+
providerOverride?: string | undefined;
|
|
784
|
+
}
|
|
785
|
+
interface IProviderSettingsWriteTargetOptions {
|
|
786
|
+
settingsPaths?: readonly string[];
|
|
787
|
+
}
|
|
788
|
+
interface IActiveModelChangeResult {
|
|
789
|
+
settingsPath: string;
|
|
790
|
+
settings: TProviderSettingsDocument;
|
|
791
|
+
profileName?: string;
|
|
792
|
+
}
|
|
793
|
+
declare function resolveProviderSettingsWriteTargetPath(cwd: string, options?: IProviderSettingsWriteTargetOptions): string;
|
|
794
|
+
declare function applyProviderConfiguration(settingsPath: string, input: IProviderSetupInput, options?: IProviderSettingsBuildOptions): TProviderSettingsDocument;
|
|
795
|
+
declare function applyProviderSwitch(settingsPath: string, profileName: string, options?: IProviderSwitchOptions): TProviderSettingsDocument;
|
|
796
|
+
declare function applyActiveModelChange(cwd: string, modelId: string, options?: IActiveModelChangeOptions): IActiveModelChangeResult;
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region src/command-api/provider/provider-merge.d.ts
|
|
799
|
+
declare function readMergedProviderSettingsFromPaths(paths: readonly string[], fs?: IFileSystem): TProviderSettingsDocument;
|
|
800
|
+
declare function mergeSettings(base: TProviderSettingsDocument, override: TProviderSettingsDocument): TProviderSettingsDocument;
|
|
801
|
+
declare function mergeProviders(base: TProviderSettingsDocument['providers'], override: TProviderSettingsDocument['providers']): TProviderSettingsDocument['providers'];
|
|
802
|
+
declare function resolveActiveProvider(settings: TProviderSettingsDocument, providerOverride: string | undefined, providerDefinitions: readonly IProviderDefinition[]): IProviderDefinitionConfig | undefined;
|
|
803
|
+
//#endregion
|
|
804
|
+
//#region src/command-api/provider/provider-factory.d.ts
|
|
805
|
+
interface IReadProviderSettingsOptions {
|
|
806
|
+
providerOverride?: string;
|
|
807
|
+
providerDefinitions?: readonly IProviderDefinition[];
|
|
808
|
+
/** Environment map for env-default synthesis (test seam, default: process.env). */
|
|
809
|
+
env?: Record<string, string | undefined>;
|
|
810
|
+
}
|
|
811
|
+
/**
|
|
812
|
+
* Missing or unusable provider configuration at session start.
|
|
813
|
+
* Typed so callers can map it to a distinct exit code without message matching.
|
|
814
|
+
*/
|
|
815
|
+
declare class ProviderConfigError extends Error {
|
|
816
|
+
constructor(message: string);
|
|
817
|
+
}
|
|
818
|
+
declare function readMergedProviderSettings(cwd: string): TProviderSettingsDocument;
|
|
819
|
+
/**
|
|
820
|
+
* Zero-config fallback: synthesize an in-memory provider config from the first
|
|
821
|
+
* definition (in order) whose defaults are complete — `$ENV:` apiKey reference with the
|
|
822
|
+
* referenced variable set, plus a default model. Settings profiles always win; nothing
|
|
823
|
+
* is persisted. Returns undefined when no definition qualifies.
|
|
824
|
+
*/
|
|
825
|
+
declare function resolveEnvDefaultProvider(providerDefinitions: readonly IProviderDefinition[], env?: Record<string, string | undefined>): IProviderDefinitionConfig | undefined;
|
|
826
|
+
declare function readProviderSettings(cwd: string, options?: IReadProviderSettingsOptions): IProviderDefinitionConfig;
|
|
827
|
+
declare function createProviderFromSettings(cwd: string, modelOverride?: string, options?: IReadProviderSettingsOptions): IAIProvider;
|
|
828
|
+
//#endregion
|
|
829
|
+
//#region src/command-api/help/help-command-api.d.ts
|
|
830
|
+
declare const HELP_COMMAND_DESCRIPTION = "Show available commands";
|
|
831
|
+
declare function formatCommandHelpMessage(context: ICommandHostContext): string;
|
|
832
|
+
//#endregion
|
|
833
|
+
//#region src/command-api/background/background-command-api.d.ts
|
|
834
|
+
declare const BACKGROUND_COMMAND_DESCRIPTION = "List and control background tasks";
|
|
835
|
+
declare const BACKGROUND_COMMAND_USAGE = "Usage: background list | background read <task-id> [offset] | background cancel <task-id> | background close <task-id>";
|
|
836
|
+
declare function buildBackgroundCommandSubcommands(): ICommand[];
|
|
837
|
+
declare function formatCommandBackgroundTask(task: IBackgroundTaskState): string;
|
|
838
|
+
declare function formatCommandBackgroundTaskList(tasks: IBackgroundTaskState[]): string;
|
|
839
|
+
declare function parseCommandBackgroundLogCursor(value?: string): IBackgroundTaskLogCursor | undefined;
|
|
840
|
+
declare function listCommandBackgroundTasks(context: ICommandHostContext, filter?: IBackgroundTaskListFilter): IBackgroundTaskState[];
|
|
841
|
+
declare function readCommandBackgroundTaskLog(context: ICommandHostContext, taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
842
|
+
declare function cancelCommandBackgroundTask(context: ICommandHostContext, taskId: string, reason?: string): Promise<void>;
|
|
843
|
+
declare function closeCommandBackgroundTask(context: ICommandHostContext, taskId: string): Promise<void>;
|
|
844
|
+
//#endregion
|
|
845
|
+
//#region src/command-api/language/language-command-api.d.ts
|
|
846
|
+
declare const LANGUAGE_COMMAND_DESCRIPTION = "Set response language";
|
|
847
|
+
declare const LANGUAGE_COMMAND_ARGUMENT_HINT = "<code>";
|
|
848
|
+
declare const RECOMMENDED_RESPONSE_LANGUAGES: readonly [{
|
|
849
|
+
readonly code: "ko";
|
|
850
|
+
readonly description: "Korean";
|
|
851
|
+
}, {
|
|
852
|
+
readonly code: "en";
|
|
853
|
+
readonly description: "English";
|
|
854
|
+
}, {
|
|
855
|
+
readonly code: "ja";
|
|
856
|
+
readonly description: "Japanese";
|
|
857
|
+
}, {
|
|
858
|
+
readonly code: "zh";
|
|
859
|
+
readonly description: "Chinese";
|
|
860
|
+
}];
|
|
861
|
+
type TRecommendedResponseLanguage = (typeof RECOMMENDED_RESPONSE_LANGUAGES)[number]['code'];
|
|
862
|
+
declare function buildLanguageCommandSubcommands(source?: string): ICommand[];
|
|
863
|
+
declare function parseLanguageArgument(args: string): string | undefined;
|
|
864
|
+
declare function formatLanguageUsageMessage(commandName?: string): string;
|
|
865
|
+
//#endregion
|
|
866
|
+
//#region src/command-api/permissions/permission-mode-command-api.d.ts
|
|
867
|
+
declare const PERMISSION_MODE_COMMAND_DESCRIPTION = "Show/change permission mode";
|
|
868
|
+
declare const PERMISSION_MODE_ARGUMENT_HINT = "plan | default | acceptEdits | bypassPermissions";
|
|
869
|
+
declare const PERMISSIONS_COMMAND_DESCRIPTION = "Show/change permission mode and permission rules";
|
|
870
|
+
interface IPermissionsCommandState {
|
|
871
|
+
readonly mode: TPermissionMode;
|
|
872
|
+
readonly sessionAllowed: readonly string[];
|
|
873
|
+
}
|
|
874
|
+
declare const VALID_PERMISSION_MODES: readonly TPermissionMode[];
|
|
875
|
+
declare function buildPermissionModeSubcommands(source?: string): ICommand[];
|
|
876
|
+
declare function parsePermissionModeArgument(args: string): string | undefined;
|
|
877
|
+
declare function isPermissionMode(value: string): value is TPermissionMode;
|
|
878
|
+
declare function formatInvalidPermissionModeMessage(): string;
|
|
879
|
+
declare function resolvePermissionModeAdapter(context: ICommandHostContext): ICommandPermissionModeAdapter;
|
|
880
|
+
declare function readCommandPermissionMode(context: ICommandHostContext): TPermissionMode;
|
|
881
|
+
declare function writeCommandPermissionMode(context: ICommandHostContext, mode: TPermissionMode): void;
|
|
882
|
+
declare function listCommandSessionAllowedTools(context: ICommandHostContext): readonly string[];
|
|
883
|
+
declare function readCommandPermissionsState(context: ICommandHostContext): IPermissionsCommandState;
|
|
884
|
+
declare function formatCommandPermissionsMessage(state: IPermissionsCommandState): string;
|
|
885
|
+
//#endregion
|
|
886
|
+
//#region src/command-api/preset/preset-application.d.ts
|
|
887
|
+
/**
|
|
888
|
+
* Resolved-preset option subset that can be re-applied to a *live* session.
|
|
889
|
+
*
|
|
890
|
+
* This is a framework-owned shape. The agent-preset package's `IResolvedPresetOptions` satisfies it
|
|
891
|
+
* structurally, so a consumer can hand a `resolvePreset(...)` result straight to
|
|
892
|
+
* {@link applyPresetToSession} without framework importing agent-preset (no dependency cycle).
|
|
893
|
+
*
|
|
894
|
+
* PRESET-012 carries the permission/trust group (`permissionMode`); PRESET-013 adds the model group
|
|
895
|
+
* (`model`, `effort`, `temperature`, `maxOutputTokens`); PRESET-014 adds the `persona` block,
|
|
896
|
+
* re-applied to the live system prompt; PRESET-015 adds the command-module selection group
|
|
897
|
+
* (`enabledCommandModules`/`disabledCommandModules`), re-filtered against the session-start set.
|
|
898
|
+
*/
|
|
899
|
+
interface IPresetApplicationOptions {
|
|
900
|
+
permissionMode?: TPermissionMode;
|
|
901
|
+
model?: string;
|
|
902
|
+
effort?: TModelEffort;
|
|
903
|
+
temperature?: number;
|
|
904
|
+
maxOutputTokens?: number;
|
|
905
|
+
/** PRESET-014 — preset persona re-applied to the live system prompt. */
|
|
906
|
+
persona?: string;
|
|
907
|
+
/** PRESET-015 — allowlist of command-module names to keep on the live session. */
|
|
908
|
+
enabledCommandModules?: readonly string[];
|
|
909
|
+
/** PRESET-015 — denylist of command-module names to remove from the live session. */
|
|
910
|
+
disabledCommandModules?: readonly string[];
|
|
911
|
+
/** PRESET-016 — runtime gate toggle for subagent dispatch on the live session. */
|
|
912
|
+
enableParallelSubagents?: boolean;
|
|
913
|
+
/** PRESET-017 — toggle the verify-before-done self-verification section on the live prompt. */
|
|
914
|
+
selfVerification?: boolean;
|
|
915
|
+
}
|
|
916
|
+
/** Outcome of {@link applyPresetToSession}: which option groups were re-applied vs. skipped. */
|
|
917
|
+
interface IPresetApplicationResult {
|
|
918
|
+
/** Option-group keys whose value was present and applied to the live session. */
|
|
919
|
+
readonly applied: readonly string[];
|
|
920
|
+
/** Option-group keys absent from the resolved options (left untouched). */
|
|
921
|
+
readonly skipped: readonly string[];
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Re-apply a resolved preset to a live session and record it as the active preset.
|
|
925
|
+
*
|
|
926
|
+
* This is the single entry point for live preset switching. It first records the active preset id
|
|
927
|
+
* (PRESET-011 runtime state) — the runtime's `setActivePresetId` is optional, so it is invoked
|
|
928
|
+
* defensively. It then re-applies each option group it owns; PRESET-012 applies the permission
|
|
929
|
+
* posture via the existing `writeCommandPermissionMode` seam, and PRESET-013 re-applies the model
|
|
930
|
+
* group (`model`/`effort`/`temperature`/`maxOutputTokens`) via the runtime's optional
|
|
931
|
+
* `applyModelOptions`. PRESET-014 re-applies the `persona` group via the host context's optional
|
|
932
|
+
* `applyPersona` seam. PRESET-015 re-applies the command-module selection group via the host
|
|
933
|
+
* context's optional `applyCommandModuleSelection` seam. PRESET-016 toggles the parallel-subagents
|
|
934
|
+
* runtime gate via the runtime's optional `setParallelSubagentsEnabled` seam. PRESET-017 toggles
|
|
935
|
+
* the verify-before-done self-verification section via the host context's optional
|
|
936
|
+
* `applySelfVerification` seam. Groups absent from `options` are left untouched and reported under
|
|
937
|
+
* `skipped`.
|
|
938
|
+
*/
|
|
939
|
+
declare function applyPresetToSession(context: ICommandHostContext, presetId: string, options: IPresetApplicationOptions): Promise<IPresetApplicationResult>;
|
|
940
|
+
//#endregion
|
|
941
|
+
//#region src/config/settings-io.d.ts
|
|
942
|
+
type TSettingsData = Record<string, TUniversalValue>;
|
|
943
|
+
declare function getUserSettingsPath(): string;
|
|
944
|
+
type TSettingsScope = 'user' | 'project-local';
|
|
945
|
+
declare function resolveSettingsPathForScope(cwd: string, scope: TSettingsScope | undefined): string;
|
|
946
|
+
/**
|
|
947
|
+
* CLI-069: missing file → empty defaults (non-error); an EXISTING file that
|
|
948
|
+
* fails to parse throws SettingsParseError — no warn-and-continue masking.
|
|
949
|
+
*/
|
|
950
|
+
declare function readSettings(path: string): TSettingsData;
|
|
951
|
+
declare function writeSettings(path: string, settings: TSettingsData): void;
|
|
952
|
+
declare function updateModelInSettings(settingsPath: string, modelId: string): void;
|
|
953
|
+
declare function deleteSettings(path: string): boolean;
|
|
954
|
+
//#endregion
|
|
955
|
+
//#region src/command-api/statusline/statusline-command-api.d.ts
|
|
956
|
+
declare const STATUSLINE_COMMAND_DESCRIPTION = "Configure TUI status-line visibility and fields such as model, context, tokens, session, and git branch.";
|
|
957
|
+
declare const STATUSLINE_COMMAND_ARGUMENT_HINT = "on | off | reset | git on | git off";
|
|
958
|
+
declare const DEFAULT_STATUS_LINE_COMMAND_SETTINGS: Readonly<IStatusLineCommandSettings>;
|
|
959
|
+
declare function buildStatusLineCommandSubcommands(source?: string): ICommand[];
|
|
960
|
+
declare function isStatusLineCommandSettingsPatch(value: Record<string, TUniversalValue>): value is TStatusLineCommandSettingsPatch;
|
|
961
|
+
declare function readStatusLineSettings(settings: TSettingsData): IStatusLineCommandSettings;
|
|
962
|
+
declare function applyStatusLineSettings(settingsPath: string, patch: TStatusLineCommandSettingsPatch): IStatusLineCommandSettings;
|
|
963
|
+
//#endregion
|
|
964
|
+
//#region src/command-api/session/session-command-api.d.ts
|
|
965
|
+
declare const CLEAR_COMMAND_DESCRIPTION = "Clear conversation history";
|
|
966
|
+
declare const RENAME_COMMAND_DESCRIPTION = "Rename the current session";
|
|
967
|
+
declare const RENAME_COMMAND_USAGE = "Usage: rename <name>";
|
|
968
|
+
declare const RESUME_COMMAND_DESCRIPTION = "Resume a previous session";
|
|
969
|
+
declare const COST_COMMAND_DESCRIPTION = "Show session token usage and estimated cost. /cost budget <amount> sets a monthly budget.";
|
|
970
|
+
declare const VALIDATE_SESSION_COMMAND_DESCRIPTION = "Validate current session replay log";
|
|
971
|
+
declare const EXIT_COMMAND_DESCRIPTION = "Exit CLI";
|
|
972
|
+
interface ICommandSessionInfo {
|
|
973
|
+
sessionId: string;
|
|
974
|
+
messageCount: number;
|
|
975
|
+
}
|
|
976
|
+
declare function clearConversationHistory(context: ICommandHostContext): void;
|
|
977
|
+
declare function parseSessionNameArgument(args: string): string | undefined;
|
|
978
|
+
declare function createSessionRenamedEffect(name: string): TCommandEffect;
|
|
979
|
+
declare function createSessionPickerRequestedEffect(): TCommandEffect;
|
|
980
|
+
declare function createSessionExitRequestedEffect(): TCommandEffect;
|
|
981
|
+
declare function readCommandSessionInfo(context: ICommandHostContext): ICommandSessionInfo;
|
|
982
|
+
declare function validateCommandSessionReplayLog(context: ICommandHostContext): ICommandSessionReplayValidationReport;
|
|
983
|
+
declare function formatCommandSessionReplayValidationReport(report: ICommandSessionReplayValidationReport): string;
|
|
984
|
+
//#endregion
|
|
985
|
+
//#region src/command-api/checkpoint/rewind-command-api.d.ts
|
|
986
|
+
declare const REWIND_COMMAND_DESCRIPTION = "List, inspect, restore, or rollback edit checkpoints.";
|
|
987
|
+
declare const REWIND_COMMAND_ARGUMENT_HINT = "list | inspect CHECKPOINT_ID | restore CHECKPOINT_ID | code CHECKPOINT_ID | rollback CHECKPOINT_ID";
|
|
988
|
+
declare function buildRewindCommandSubcommands(source?: string): ICommand[];
|
|
989
|
+
declare function listCommandEditCheckpoints(context: ICommandHostContext): readonly IEditCheckpointSummary[];
|
|
990
|
+
declare function inspectCommandEditCheckpoint(context: ICommandHostContext, checkpointId: string): IEditCheckpointInspection;
|
|
991
|
+
declare function restoreCommandEditCheckpoint(context: ICommandHostContext, checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
992
|
+
declare function rollbackCommandEditCheckpoint(context: ICommandHostContext, checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
993
|
+
//#endregion
|
|
994
|
+
//#region src/command-api/memory/memory-command-api.d.ts
|
|
995
|
+
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.";
|
|
996
|
+
declare const MEMORY_COMMAND_ARGUMENT_HINT = "list | show [topic] | add <user|feedback|project|reference> <topic> <text> | pending | approve <id> | reject <id> | used";
|
|
997
|
+
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";
|
|
998
|
+
interface ICommandProjectMemoryStore {
|
|
999
|
+
list(): IProjectMemorySummary;
|
|
1000
|
+
loadStartupMemory(): IStartupMemory;
|
|
1001
|
+
readTopic(topic: string): string;
|
|
1002
|
+
append(input: IAppendMemoryInput): IAppendMemoryResult;
|
|
1003
|
+
}
|
|
1004
|
+
interface ICommandPendingMemoryStore {
|
|
1005
|
+
get(id: string): IMemoryPendingRecord | undefined;
|
|
1006
|
+
list(status?: TMemoryCandidateStatus): IMemoryPendingRecord[];
|
|
1007
|
+
mark(id: string, status: TMemoryCandidateStatus, reason: string): IMemoryPendingRecord;
|
|
1008
|
+
upsert(candidate: IMemoryCandidate, status: TMemoryCandidateStatus, reason: string): void;
|
|
1009
|
+
}
|
|
1010
|
+
interface ICommandMemoryStores {
|
|
1011
|
+
project: ICommandProjectMemoryStore;
|
|
1012
|
+
pending: ICommandPendingMemoryStore;
|
|
1013
|
+
}
|
|
1014
|
+
declare function buildMemoryCommandSubcommands(source?: string): ICommand[];
|
|
1015
|
+
declare function createCommandProjectMemoryStore(cwd: string, now?: () => Date): ICommandProjectMemoryStore;
|
|
1016
|
+
declare function createCommandPendingMemoryStore(cwd: string, now?: () => Date): ICommandPendingMemoryStore;
|
|
1017
|
+
declare function createCommandMemoryStores(context: ICommandHostContext, now?: () => Date): ICommandMemoryStores;
|
|
1018
|
+
declare function isCommandMemoryType(value: string): value is TMemoryType;
|
|
1019
|
+
declare function hasSensitiveCommandMemoryContent(text: string): boolean;
|
|
1020
|
+
declare function listCommandUsedMemoryReferences(context: ICommandHostContext): readonly IMemoryReference[];
|
|
1021
|
+
declare function recordCommandMemoryEvent(context: ICommandHostContext, event: Omit<IMemoryEvent, 'at'>, now?: () => Date): void;
|
|
1022
|
+
//#endregion
|
|
1023
|
+
//#region src/commands/command-registry.d.ts
|
|
1024
|
+
/** Aggregates commands from multiple sources */
|
|
1025
|
+
declare class CommandRegistry {
|
|
1026
|
+
private sources;
|
|
1027
|
+
addSource(source: ICommandSource): void;
|
|
1028
|
+
replaceSource(name: string, source?: ICommandSource): void;
|
|
1029
|
+
addModule(module: ICommandModule): void;
|
|
1030
|
+
/** Get all commands, optionally filtered by prefix */
|
|
1031
|
+
getCommands(filter?: string): ICommand[];
|
|
1032
|
+
/** Resolve a short name to its fully qualified plugin:name form */
|
|
1033
|
+
resolveQualifiedName(shortName: string): string | null;
|
|
1034
|
+
/** Get subcommands for a specific command */
|
|
1035
|
+
getSubcommands(commandName: string): ICommand[];
|
|
1036
|
+
getCapabilityDescriptors(): ICapabilityDescriptor[];
|
|
1037
|
+
}
|
|
1038
|
+
//#endregion
|
|
1039
|
+
//#region src/commands/builtin-source.d.ts
|
|
1040
|
+
/** Command source for SDK-owned built-in commands. */
|
|
1041
|
+
declare class BuiltinCommandSource implements ICommandSource {
|
|
1042
|
+
readonly name = "builtin";
|
|
1043
|
+
private readonly commands;
|
|
1044
|
+
constructor(systemCommands?: readonly ISystemCommand[]);
|
|
1045
|
+
getCommands(): ICommand[];
|
|
1046
|
+
}
|
|
1047
|
+
declare function createBuiltinCommandModule(): ICommandModule;
|
|
1048
|
+
//#endregion
|
|
1049
|
+
//#region src/commands/skill-source.d.ts
|
|
1050
|
+
interface IFrontmatter {
|
|
1051
|
+
name?: string;
|
|
1052
|
+
description?: string;
|
|
1053
|
+
argumentHint?: string;
|
|
1054
|
+
disableModelInvocation?: boolean;
|
|
1055
|
+
userInvocable?: boolean;
|
|
1056
|
+
allowedTools?: string[];
|
|
1057
|
+
model?: string;
|
|
1058
|
+
effort?: string;
|
|
1059
|
+
context?: string;
|
|
1060
|
+
agent?: string;
|
|
1061
|
+
}
|
|
1062
|
+
/** Parse YAML-like frontmatter between --- markers */
|
|
1063
|
+
declare function parseFrontmatter(content: string): IFrontmatter | null;
|
|
1064
|
+
/** Command source that discovers skills from multiple directories */
|
|
1065
|
+
declare class SkillCommandSource implements ICommandSource {
|
|
1066
|
+
readonly name = "skill";
|
|
1067
|
+
private readonly cwd;
|
|
1068
|
+
private readonly home;
|
|
1069
|
+
private readonly fs;
|
|
1070
|
+
private cachedCommands;
|
|
1071
|
+
constructor(cwd: string, home?: string, fs?: IFileSystem);
|
|
1072
|
+
getCommands(): ICommand[];
|
|
1073
|
+
getModelInvocableSkills(): ICommand[];
|
|
1074
|
+
getUserInvocableSkills(): ICommand[];
|
|
1075
|
+
}
|
|
1076
|
+
//#endregion
|
|
1077
|
+
//#region src/plugins/marketplace-types.d.ts
|
|
1078
|
+
/**
|
|
1079
|
+
* Shared types for marketplace client and registry.
|
|
1080
|
+
*/
|
|
1081
|
+
/** Source specification for a marketplace. */
|
|
1082
|
+
type TMarketplaceSource = {
|
|
1083
|
+
type: 'github';
|
|
1084
|
+
repo: string;
|
|
1085
|
+
ref?: string;
|
|
1086
|
+
} | {
|
|
1087
|
+
type: 'git';
|
|
1088
|
+
url: string;
|
|
1089
|
+
ref?: string;
|
|
1090
|
+
} | {
|
|
1091
|
+
type: 'local';
|
|
1092
|
+
path: string;
|
|
1093
|
+
} | {
|
|
1094
|
+
type: 'url';
|
|
1095
|
+
url: string;
|
|
1096
|
+
};
|
|
1097
|
+
/** A single plugin entry in a marketplace manifest. */
|
|
1098
|
+
interface IMarketplacePluginEntry {
|
|
1099
|
+
name: string;
|
|
1100
|
+
title: string;
|
|
1101
|
+
description: string;
|
|
1102
|
+
source: string | {
|
|
1103
|
+
type: 'github';
|
|
1104
|
+
repo: string;
|
|
1105
|
+
} | {
|
|
1106
|
+
type: 'url';
|
|
1107
|
+
url: string;
|
|
1108
|
+
};
|
|
1109
|
+
tags: string[];
|
|
1110
|
+
}
|
|
1111
|
+
/** Manifest format read from `.claude-plugin/marketplace.json`. */
|
|
1112
|
+
interface IMarketplaceManifest {
|
|
1113
|
+
name: string;
|
|
1114
|
+
version: string;
|
|
1115
|
+
plugins: IMarketplacePluginEntry[];
|
|
1116
|
+
}
|
|
1117
|
+
/** Entry in known_marketplaces.json. */
|
|
1118
|
+
interface IKnownMarketplaceEntry {
|
|
1119
|
+
source: TMarketplaceSource;
|
|
1120
|
+
installLocation: string;
|
|
1121
|
+
lastUpdated: string;
|
|
1122
|
+
}
|
|
1123
|
+
/** Shape of known_marketplaces.json. */
|
|
1124
|
+
type TKnownMarketplacesRegistry = Record<string, IKnownMarketplaceEntry>;
|
|
1125
|
+
/** Exec function type for running shell commands. Injected at composition root. */
|
|
1126
|
+
type TExecFn = (command: string, options: {
|
|
1127
|
+
timeout: number;
|
|
1128
|
+
stdio?: string;
|
|
1129
|
+
}) => string | Buffer;
|
|
1130
|
+
/** Options for constructing a MarketplaceClient. */
|
|
1131
|
+
interface IMarketplaceClientOptions {
|
|
1132
|
+
/** Base plugins directory (e.g., `~/.robota/plugins`). */
|
|
1133
|
+
pluginsDir: string;
|
|
1134
|
+
/** Shell exec adapter — must be provided at composition root (e.g., execSync). */
|
|
1135
|
+
exec: TExecFn;
|
|
1136
|
+
}
|
|
1137
|
+
//#endregion
|
|
1138
|
+
//#region src/plugins/plugin-settings-store.d.ts
|
|
1139
|
+
/** Persisted marketplace source entry. */
|
|
1140
|
+
interface IPersistedMarketplaceSource {
|
|
1141
|
+
source: TMarketplaceSource;
|
|
1142
|
+
}
|
|
1143
|
+
/** Shape of the plugin-related keys in settings.json. */
|
|
1144
|
+
interface IPluginSettings {
|
|
1145
|
+
enabledPlugins: Record<string, boolean>;
|
|
1146
|
+
extraKnownMarketplaces: Record<string, IPersistedMarketplaceSource>;
|
|
1147
|
+
}
|
|
1148
|
+
/** Centralized settings store for plugin configuration. */
|
|
1149
|
+
declare class PluginSettingsStore {
|
|
1150
|
+
private readonly settingsPath;
|
|
1151
|
+
private readonly fs;
|
|
1152
|
+
constructor(settingsPath: string, fs?: IFileSystem);
|
|
1153
|
+
/** Read the full settings file from disk. */
|
|
1154
|
+
private readAll;
|
|
1155
|
+
/** Write the full settings file to disk. */
|
|
1156
|
+
private writeAll;
|
|
1157
|
+
/** Get the enabledPlugins map. */
|
|
1158
|
+
getEnabledPlugins(): Record<string, boolean>;
|
|
1159
|
+
/** Set a single plugin's enabled state. */
|
|
1160
|
+
setPluginEnabled(pluginId: string, enabled: boolean): void;
|
|
1161
|
+
/** Remove a plugin from enabledPlugins. */
|
|
1162
|
+
removePluginEntry(pluginId: string): void;
|
|
1163
|
+
/** Get all persisted marketplace sources. */
|
|
1164
|
+
getMarketplaceSources(): Record<string, IPersistedMarketplaceSource>;
|
|
1165
|
+
/** Add or update a marketplace source. */
|
|
1166
|
+
setMarketplaceSource(name: string, source: TMarketplaceSource): void;
|
|
1167
|
+
/** Remove a marketplace source. */
|
|
1168
|
+
removeMarketplaceSource(name: string): void;
|
|
1169
|
+
private getEnabledPluginsFrom;
|
|
1170
|
+
private getMarketplaceSourcesFrom;
|
|
1171
|
+
}
|
|
1172
|
+
//#endregion
|
|
1173
|
+
//#region src/plugins/bundle-plugin-types.d.ts
|
|
1174
|
+
/**
|
|
1175
|
+
* Types for the BundlePlugin system.
|
|
1176
|
+
*
|
|
1177
|
+
* A BundlePlugin is a directory-based plugin package that bundles
|
|
1178
|
+
* skills, hooks, agents, and MCP server configurations.
|
|
1179
|
+
*/
|
|
1180
|
+
/** Feature flags indicating what a bundle plugin provides. */
|
|
1181
|
+
interface IBundlePluginFeatures {
|
|
1182
|
+
commands?: boolean;
|
|
1183
|
+
agents?: boolean;
|
|
1184
|
+
skills?: boolean;
|
|
1185
|
+
hooks?: boolean;
|
|
1186
|
+
mcp?: boolean;
|
|
1187
|
+
}
|
|
1188
|
+
/** Manifest read from `.claude-plugin/plugin.json`. */
|
|
1189
|
+
interface IBundlePluginManifest {
|
|
1190
|
+
name: string;
|
|
1191
|
+
version: string;
|
|
1192
|
+
description: string;
|
|
1193
|
+
features: IBundlePluginFeatures;
|
|
1194
|
+
}
|
|
1195
|
+
/** A skill loaded from a bundle plugin's `skills/` directory. */
|
|
1196
|
+
interface IBundleSkill {
|
|
1197
|
+
name: string;
|
|
1198
|
+
description: string;
|
|
1199
|
+
skillContent: string;
|
|
1200
|
+
[key: string]: unknown;
|
|
1201
|
+
}
|
|
1202
|
+
/** A fully loaded bundle plugin with all its assets. */
|
|
1203
|
+
interface ILoadedBundlePlugin {
|
|
1204
|
+
manifest: IBundlePluginManifest;
|
|
1205
|
+
skills: IBundleSkill[];
|
|
1206
|
+
commands: IBundleSkill[];
|
|
1207
|
+
hooks: Record<string, unknown>;
|
|
1208
|
+
mcpConfig?: unknown;
|
|
1209
|
+
agents: string[];
|
|
1210
|
+
pluginDir: string;
|
|
1211
|
+
}
|
|
1212
|
+
/** Map of plugin identifiers to enabled/disabled state. */
|
|
1213
|
+
type TEnabledPlugins = Record<string, boolean>;
|
|
1214
|
+
//#endregion
|
|
1215
|
+
//#region src/plugins/bundle-plugin-loader.d.ts
|
|
1216
|
+
/** Loader for directory-based bundle plugins from the cache directory. */
|
|
1217
|
+
declare class BundlePluginLoader {
|
|
1218
|
+
private readonly pluginsDir;
|
|
1219
|
+
private readonly enabledPlugins;
|
|
1220
|
+
private readonly fs;
|
|
1221
|
+
constructor(pluginsDir: string, enabledPlugins?: TEnabledPlugins, fs?: IFileSystem);
|
|
1222
|
+
/** Load all discovered and enabled bundle plugins (sync). */
|
|
1223
|
+
loadPluginsSync(): ILoadedBundlePlugin[];
|
|
1224
|
+
/** Load all discovered and enabled bundle plugins (async wrapper). */
|
|
1225
|
+
loadAll(): Promise<ILoadedBundlePlugin[]>;
|
|
1226
|
+
/**
|
|
1227
|
+
* Discover and load plugins from the cache directory.
|
|
1228
|
+
*
|
|
1229
|
+
* Directory structure: `<pluginsDir>/cache/<marketplace>/<plugin>/<version>/`
|
|
1230
|
+
* For each marketplace/plugin pair, the latest version (lexicographically last) is loaded.
|
|
1231
|
+
*/
|
|
1232
|
+
private discoverAndLoad;
|
|
1233
|
+
/** Read and validate a plugin.json manifest. Returns null if the manifest structure is invalid. */
|
|
1234
|
+
private readManifest;
|
|
1235
|
+
/**
|
|
1236
|
+
* Check if a plugin is explicitly disabled.
|
|
1237
|
+
* Checks both `name@marketplace` and `name` keys.
|
|
1238
|
+
* Plugins not listed in enabledPlugins are enabled by default.
|
|
1239
|
+
*/
|
|
1240
|
+
private isDisabled;
|
|
1241
|
+
/** Load a single plugin's skills, hooks, agents, and MCP config. */
|
|
1242
|
+
private loadPlugin;
|
|
1243
|
+
/** Load skills from the plugin's skills/ directory. */
|
|
1244
|
+
private loadSkills;
|
|
1245
|
+
/** Load commands from the plugin's commands/ directory (flat .md files). */
|
|
1246
|
+
private loadCommands;
|
|
1247
|
+
/** Load hooks from hooks/hooks.json if present. */
|
|
1248
|
+
private loadHooks;
|
|
1249
|
+
/** Load MCP server configuration from `.mcp.json` at the plugin root if present. */
|
|
1250
|
+
private loadMcpConfig;
|
|
1251
|
+
/** Load agent definitions from agents/ directory if present. */
|
|
1252
|
+
private loadAgents;
|
|
1253
|
+
}
|
|
1254
|
+
//#endregion
|
|
1255
|
+
//#region src/plugins/marketplace-client.d.ts
|
|
1256
|
+
/** Manages marketplace registries via shallow git clones. */
|
|
1257
|
+
declare class MarketplaceClient {
|
|
1258
|
+
private readonly pluginsDir;
|
|
1259
|
+
private readonly exec;
|
|
1260
|
+
private readonly marketplacesDir;
|
|
1261
|
+
private readonly registryPath;
|
|
1262
|
+
private readonly fs;
|
|
1263
|
+
constructor(options: IMarketplaceClientOptions & {
|
|
1264
|
+
fs?: IFileSystem;
|
|
1265
|
+
});
|
|
1266
|
+
/**
|
|
1267
|
+
* Add a marketplace by cloning its repository.
|
|
1268
|
+
*
|
|
1269
|
+
* 1. Shallow git clone (`--depth 1`) to `marketplaces/<name>/`.
|
|
1270
|
+
* 2. Read `.claude-plugin/marketplace.json` for the `name` field.
|
|
1271
|
+
* 3. Register in `known_marketplaces.json`.
|
|
1272
|
+
*
|
|
1273
|
+
* Returns the registered marketplace name from the manifest.
|
|
1274
|
+
*/
|
|
1275
|
+
addMarketplace(source: TMarketplaceSource): string;
|
|
1276
|
+
/**
|
|
1277
|
+
* Remove a marketplace.
|
|
1278
|
+
* Uninstalls all plugins from that marketplace, then deletes the clone directory
|
|
1279
|
+
* and removes from the registry.
|
|
1280
|
+
*/
|
|
1281
|
+
removeMarketplace(name: string): void;
|
|
1282
|
+
/**
|
|
1283
|
+
* Update a marketplace by running git pull on its clone.
|
|
1284
|
+
* The manifest is re-read from disk on demand (via fetchManifest), so the
|
|
1285
|
+
* updated manifest is automatically available after pull.
|
|
1286
|
+
*/
|
|
1287
|
+
updateMarketplace(name: string): void;
|
|
1288
|
+
/** List all registered marketplaces. */
|
|
1289
|
+
listMarketplaces(): Array<{
|
|
1290
|
+
name: string;
|
|
1291
|
+
source: TMarketplaceSource;
|
|
1292
|
+
lastUpdated: string;
|
|
1293
|
+
}>;
|
|
1294
|
+
/** Read the marketplace manifest from a registered marketplace's clone. */
|
|
1295
|
+
fetchManifest(marketplaceName: string): IMarketplaceManifest;
|
|
1296
|
+
/** Get the clone directory path for a registered marketplace. */
|
|
1297
|
+
getMarketplaceDir(name: string): string;
|
|
1298
|
+
/**
|
|
1299
|
+
* Get the current git SHA (first 12 chars) for a marketplace clone.
|
|
1300
|
+
* Used as a version identifier when plugins lack explicit versions.
|
|
1301
|
+
*/
|
|
1302
|
+
getMarketplaceSha(name: string): string;
|
|
1303
|
+
/** List all available plugins across all marketplaces. */
|
|
1304
|
+
listAvailablePlugins(): Array<IMarketplacePluginEntry & {
|
|
1305
|
+
marketplace: string;
|
|
1306
|
+
}>;
|
|
1307
|
+
/** Resolve a marketplace source to a git clone URL. */
|
|
1308
|
+
private resolveCloneUrl;
|
|
1309
|
+
/** Read and parse a marketplace.json from a file path. */
|
|
1310
|
+
private readManifestFromPath;
|
|
1311
|
+
}
|
|
1312
|
+
//#endregion
|
|
1313
|
+
//#region src/plugins/bundle-plugin-installer.d.ts
|
|
1314
|
+
/** Record of an installed plugin in installed_plugins.json. */
|
|
1315
|
+
interface IInstalledPluginRecord {
|
|
1316
|
+
pluginName: string;
|
|
1317
|
+
marketplace: string;
|
|
1318
|
+
version: string;
|
|
1319
|
+
installPath: string;
|
|
1320
|
+
installedAt: string;
|
|
1321
|
+
}
|
|
1322
|
+
/** Shape of installed_plugins.json. */
|
|
1323
|
+
type TInstalledPluginsRegistry = Record<string, IInstalledPluginRecord>;
|
|
1324
|
+
/** Options for constructing a BundlePluginInstaller. */
|
|
1325
|
+
interface IBundlePluginInstallerOptions {
|
|
1326
|
+
/** Base plugins directory (e.g., `~/.robota/plugins`). */
|
|
1327
|
+
pluginsDir: string;
|
|
1328
|
+
/** Shared settings store for enable/disable persistence. */
|
|
1329
|
+
settingsStore: PluginSettingsStore;
|
|
1330
|
+
/** MarketplaceClient for reading marketplace manifests. */
|
|
1331
|
+
marketplaceClient: MarketplaceClient;
|
|
1332
|
+
/** Shell exec adapter — must be provided at composition root (e.g., execSync). */
|
|
1333
|
+
exec: TExecFn;
|
|
1334
|
+
/** File system adapter for testability. */
|
|
1335
|
+
fs?: IFileSystem;
|
|
1336
|
+
}
|
|
1337
|
+
/** Installs, uninstalls, enables, and disables bundle plugins. */
|
|
1338
|
+
declare class BundlePluginInstaller {
|
|
1339
|
+
private readonly pluginsDir;
|
|
1340
|
+
private readonly cacheDir;
|
|
1341
|
+
private readonly registryPath;
|
|
1342
|
+
private readonly settingsStore;
|
|
1343
|
+
private readonly marketplaceClient;
|
|
1344
|
+
private readonly exec;
|
|
1345
|
+
private readonly fs;
|
|
1346
|
+
constructor(options: IBundlePluginInstallerOptions);
|
|
1347
|
+
/**
|
|
1348
|
+
* Install a plugin from a marketplace.
|
|
1349
|
+
*
|
|
1350
|
+
* 1. Read marketplace manifest to find the plugin entry.
|
|
1351
|
+
* 2. Resolve source (relative path, github, or url).
|
|
1352
|
+
* 3. Copy/clone to `cache/<marketplace>/<plugin>/<version>/`.
|
|
1353
|
+
* 4. Record in `installed_plugins.json`.
|
|
1354
|
+
*/
|
|
1355
|
+
install(pluginName: string, marketplaceName: string): Promise<void>;
|
|
1356
|
+
/**
|
|
1357
|
+
* Uninstall a plugin.
|
|
1358
|
+
* Removes from cache and from installed_plugins.json.
|
|
1359
|
+
*/
|
|
1360
|
+
uninstall(pluginId: string): Promise<void>;
|
|
1361
|
+
/** Enable a plugin by setting its enabledPlugins entry to true. */
|
|
1362
|
+
enable(pluginId: string): Promise<void>;
|
|
1363
|
+
/** Disable a plugin by setting its enabledPlugins entry to false. */
|
|
1364
|
+
disable(pluginId: string): Promise<void>;
|
|
1365
|
+
/** Get all installed plugins. */
|
|
1366
|
+
getInstalledPlugins(): TInstalledPluginsRegistry;
|
|
1367
|
+
/** Get plugins installed from a specific marketplace. */
|
|
1368
|
+
getPluginsByMarketplace(marketplaceName: string): IInstalledPluginRecord[];
|
|
1369
|
+
/** Resolve the version for a plugin entry. */
|
|
1370
|
+
private resolveVersion;
|
|
1371
|
+
/**
|
|
1372
|
+
* Normalize source object — Claude Code manifests use `source` key instead of `type`.
|
|
1373
|
+
* e.g., { source: "url", url: "..." } → { type: "url", url: "..." }
|
|
1374
|
+
*/
|
|
1375
|
+
private normalizeSource;
|
|
1376
|
+
/** Resolve the source and install the plugin. */
|
|
1377
|
+
private resolveAndInstall;
|
|
1378
|
+
/** Clone a git repository to the target directory. */
|
|
1379
|
+
private cloneToDir;
|
|
1380
|
+
/** Read the installed_plugins.json registry. */
|
|
1381
|
+
private readRegistry;
|
|
1382
|
+
/** Write the installed_plugins.json registry. */
|
|
1383
|
+
private writeRegistry;
|
|
1384
|
+
}
|
|
1385
|
+
//#endregion
|
|
1386
|
+
//#region src/commands/plugin-source.d.ts
|
|
1387
|
+
/**
|
|
1388
|
+
* Command source that discovers skills and commands from loaded BundlePlugins.
|
|
1389
|
+
*
|
|
1390
|
+
* - Skills: exposed as `/name` with `(plugin-name)` hint in description.
|
|
1391
|
+
* - Commands: exposed as `/plugin:command` (already namespaced by the loader).
|
|
1392
|
+
*/
|
|
1393
|
+
declare class PluginCommandSource implements ICommandSource {
|
|
1394
|
+
readonly name = "plugin";
|
|
1395
|
+
private readonly plugins;
|
|
1396
|
+
constructor(plugins: ILoadedBundlePlugin[]);
|
|
1397
|
+
getCommands(): ICommand[];
|
|
1398
|
+
}
|
|
1399
|
+
//#endregion
|
|
1400
|
+
//#region src/commands/system-command-executor.d.ts
|
|
1401
|
+
/** Registry for system commands. */
|
|
1402
|
+
declare class SystemCommandExecutor {
|
|
1403
|
+
private readonly commands;
|
|
1404
|
+
constructor(commands?: ISystemCommand[]);
|
|
1405
|
+
/** Register an additional command. */
|
|
1406
|
+
register(command: ISystemCommand): void;
|
|
1407
|
+
/** Replace the entire command set (used by live preset command-module re-selection — PRESET-015). */
|
|
1408
|
+
replaceCommands(commands: readonly ISystemCommand[]): void;
|
|
1409
|
+
/** Execute a command by name. Returns null if command not found. */
|
|
1410
|
+
execute(name: string, session: ICommandHostContext, args: string): Promise<ICommandResult$1 | null>;
|
|
1411
|
+
getCommand(name: string): ISystemCommand | undefined;
|
|
1412
|
+
/** Resolve whether a command requires permission confirmation. */
|
|
1413
|
+
resolveRequiresPermission(command: ISystemCommand): boolean;
|
|
1414
|
+
executeCommand(command: ISystemCommand, session: ICommandHostContext, args: string): Promise<ICommandResult$1>;
|
|
1415
|
+
/** List all registered commands. */
|
|
1416
|
+
listCommands(): ISystemCommand[];
|
|
1417
|
+
listModelInvocableCommands(): ICapabilityDescriptor[];
|
|
1418
|
+
isModelInvocable(name: string): boolean;
|
|
1419
|
+
executeModelInvocable(name: string, session: ICommandHostContext, args: string): Promise<ICommandResult$1 | null>;
|
|
1420
|
+
/** Check if a command exists. */
|
|
1421
|
+
hasCommand(name: string): boolean;
|
|
1422
|
+
}
|
|
1423
|
+
//#endregion
|
|
1424
|
+
//#region src/commands/system-command.d.ts
|
|
1425
|
+
/** Built-in system commands. */
|
|
1426
|
+
declare function createSystemCommands(): ISystemCommand[];
|
|
1427
|
+
//#endregion
|
|
1428
|
+
//#region src/utils/skill-prompt.d.ts
|
|
1429
|
+
/** Shell exec function for skill preprocessing — injected from composition root. */
|
|
1430
|
+
type TShellExecFn = (command: string) => string;
|
|
1431
|
+
/** Context variables available during skill prompt processing */
|
|
1432
|
+
interface ISkillPromptContext {
|
|
1433
|
+
/** Current session ID — substituted for ${CLAUDE_SESSION_ID} */
|
|
1434
|
+
sessionId?: string;
|
|
1435
|
+
/** Directory containing SKILL.md — substituted for ${CLAUDE_SKILL_DIR} */
|
|
1436
|
+
skillDir?: string;
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* Substitute variables in skill content.
|
|
1440
|
+
*
|
|
1441
|
+
* Supported variables:
|
|
1442
|
+
* - `$ARGUMENTS` — all arguments passed to the skill
|
|
1443
|
+
* - `$ARGUMENTS[N]` — argument by index (0-based)
|
|
1444
|
+
* - `$N` — shorthand for `$ARGUMENTS[N]` (single digit, 0-9)
|
|
1445
|
+
* - `${CLAUDE_SESSION_ID}` — current session ID
|
|
1446
|
+
* - `${CLAUDE_SKILL_DIR}` — directory containing SKILL.md
|
|
1447
|
+
*/
|
|
1448
|
+
declare function substituteVariables(content: string, args: string, context?: ISkillPromptContext): string;
|
|
1449
|
+
/**
|
|
1450
|
+
* Preprocess shell commands in skill content.
|
|
1451
|
+
* Matches `` !`...` `` patterns and replaces them with command output.
|
|
1452
|
+
* If no exec function is provided, shell patterns are replaced with empty string.
|
|
1453
|
+
*/
|
|
1454
|
+
declare function preprocessShellCommands(content: string, exec?: TShellExecFn): Promise<string>;
|
|
1455
|
+
//#endregion
|
|
1456
|
+
//#region src/commands/skill-executor.d.ts
|
|
1457
|
+
/** Options passed to the fork execution callback */
|
|
1458
|
+
interface IForkExecutionOptions {
|
|
1459
|
+
/** Agent identity to use (e.g., 'Explore', 'Plan') */
|
|
1460
|
+
agent?: string;
|
|
1461
|
+
/** Tools the subagent is allowed to use */
|
|
1462
|
+
allowedTools?: string[];
|
|
1463
|
+
}
|
|
1464
|
+
/** Callback interface for skill execution infrastructure */
|
|
1465
|
+
interface ISkillExecutionCallbacks {
|
|
1466
|
+
/**
|
|
1467
|
+
* Run skill content in an isolated subagent session.
|
|
1468
|
+
* The content becomes the subagent's prompt.
|
|
1469
|
+
* Returns the subagent's response.
|
|
1470
|
+
*/
|
|
1471
|
+
runInFork?: (content: string, options: IForkExecutionOptions) => Promise<string>;
|
|
1472
|
+
/** Shell exec function for preprocessing `` !`cmd` `` patterns — injected from composition root. */
|
|
1473
|
+
shellExec?: TShellExecFn;
|
|
1474
|
+
}
|
|
1475
|
+
/** Result of skill execution */
|
|
1476
|
+
interface ISkillExecutionResult {
|
|
1477
|
+
/** Execution mode used */
|
|
1478
|
+
mode: 'fork' | 'inject';
|
|
1479
|
+
/** For inject mode: the prompt to send as a user message */
|
|
1480
|
+
prompt?: string;
|
|
1481
|
+
/** For fork mode: the subagent's response */
|
|
1482
|
+
result?: string;
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Execute a skill command.
|
|
1486
|
+
*
|
|
1487
|
+
* When `context: 'fork'`, the skill runs in an isolated subagent session
|
|
1488
|
+
* via the `runInFork` callback. Throws if `runInFork` is not available.
|
|
1489
|
+
* For non-fork skills, the content is returned as a prompt for injection
|
|
1490
|
+
* into the current session.
|
|
1491
|
+
*/
|
|
1492
|
+
declare function executeSkill(skill: ICommand, args: string, callbacks: ISkillExecutionCallbacks, context?: ISkillPromptContext): Promise<ISkillExecutionResult>;
|
|
1493
|
+
//#endregion
|
|
1494
|
+
//#region src/commands/skill-activation-events.d.ts
|
|
1495
|
+
interface ISkillActivationHistoryData extends ISkillActivationEvent {
|
|
1496
|
+
readonly message: string;
|
|
1497
|
+
}
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region src/interactive/interactive-session-background-tracker.d.ts
|
|
1500
|
+
interface IBackgroundTrackerState {
|
|
1501
|
+
tasks: IBackgroundTaskState[];
|
|
1502
|
+
taskEvents: TBackgroundTaskEvent[];
|
|
1503
|
+
groups: IBackgroundJobGroupState$1[];
|
|
1504
|
+
groupEvents: TBackgroundJobGroupEvent[];
|
|
1505
|
+
}
|
|
1506
|
+
declare class SessionBackgroundTaskTracker {
|
|
1507
|
+
private readonly getManager;
|
|
1508
|
+
private readonly onChanged;
|
|
1509
|
+
private readonly emitTaskEvent;
|
|
1510
|
+
private readonly emitGroupEvent;
|
|
1511
|
+
private readonly persistSession;
|
|
1512
|
+
private readonly onWake?;
|
|
1513
|
+
private readonly appendSystemNote?;
|
|
1514
|
+
private readonly appendHistoryEntry?;
|
|
1515
|
+
private backgroundTasks;
|
|
1516
|
+
private backgroundTaskEvents;
|
|
1517
|
+
private backgroundJobGroups;
|
|
1518
|
+
private backgroundJobGroupEvents;
|
|
1519
|
+
private backgroundTaskUnsubscribe;
|
|
1520
|
+
private backgroundJobUnsubscribe;
|
|
1521
|
+
private backgroundJobOrchestrator;
|
|
1522
|
+
constructor(getManager: () => IBackgroundTaskManager$1 | undefined, onChanged: (cause: TExecutionWorkspaceUpdateCause, entryId?: string) => void, emitTaskEvent: (event: TBackgroundTaskEvent) => void, emitGroupEvent: (event: TBackgroundJobGroupEvent) => void, persistSession: () => void, onWake?: ((instruction: string, taskId: string) => void) | undefined, appendSystemNote?: ((message: string) => void) | undefined, appendHistoryEntry?: ((entry: IHistoryEntry) => void) | undefined);
|
|
1523
|
+
subscribe(session: Session): void;
|
|
1524
|
+
/**
|
|
1525
|
+
* FLOW-003: re-spawn restored sleeping scheduled wakes so they fire again after a resume,
|
|
1526
|
+
* and surface a one-time note for any whose fire time elapsed while the CLI was closed.
|
|
1527
|
+
*/
|
|
1528
|
+
private reArmRestoredSchedules;
|
|
1529
|
+
dispose(): void;
|
|
1530
|
+
restoreState(state: IBackgroundTrackerState): void;
|
|
1531
|
+
getState(): IBackgroundTrackerState;
|
|
1532
|
+
getManagerOrThrow(): IBackgroundTaskManager$1;
|
|
1533
|
+
getOrchestratorOrThrow(sessionId: string): BackgroundJobOrchestrator;
|
|
1534
|
+
cancelTask(taskId: string, reason?: string): Promise<void>;
|
|
1535
|
+
closeTask(taskId: string): Promise<void>;
|
|
1536
|
+
sendTask(taskId: string, input: IBackgroundTaskInput): Promise<void>;
|
|
1537
|
+
readTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
1538
|
+
listTasks(filter?: IBackgroundTaskListFilter): IBackgroundTaskState[];
|
|
1539
|
+
getTask(taskId: string): IBackgroundTaskState | undefined;
|
|
1540
|
+
createGroup(input: Omit<IBackgroundJobGroupCreateRequest$1, 'parentSessionId'>, sessionId: string): IBackgroundJobGroupState$1;
|
|
1541
|
+
listGroups(sessionId: string): IBackgroundJobGroupState$1[];
|
|
1542
|
+
getGroup(groupId: string, sessionId: string): IBackgroundJobGroupState$1 | undefined;
|
|
1543
|
+
waitGroup(groupId: string, sessionId: string): Promise<IBackgroundJobGroupState$1>;
|
|
1544
|
+
readTaskDetail(entryId: string, taskId: string, cursor?: IExecutionDetailCursor): Promise<IExecutionDetailPage>;
|
|
1545
|
+
readGroupDetail(entryId: string, groupId: string, sessionId: string): IExecutionDetailPage;
|
|
1546
|
+
getTaskSnapshots(): IBackgroundTaskState[];
|
|
1547
|
+
getGroupSnapshots(): IBackgroundJobGroupState$1[];
|
|
1548
|
+
private subscribeGroupEvents;
|
|
1549
|
+
private recordTaskEvent;
|
|
1550
|
+
/**
|
|
1551
|
+
* ANALYTICS-001 (Phase 2): when a background agent task completes with token usage, append a
|
|
1552
|
+
* source-attributed usage-summary to the parent history so the usage report attributes those tokens
|
|
1553
|
+
* to that task (not the main thread).
|
|
1554
|
+
*/
|
|
1555
|
+
private recordCompletedTaskUsage;
|
|
1556
|
+
private recordGroupEvent;
|
|
1557
|
+
}
|
|
1558
|
+
//#endregion
|
|
1559
|
+
//#region src/agents/agent-definition-types.d.ts
|
|
1560
|
+
/**
|
|
1561
|
+
* Definition of an agent that can be spawned as a subagent.
|
|
1562
|
+
*
|
|
1563
|
+
* Built-in agents and custom (user-defined) agents share this shape.
|
|
1564
|
+
* Optional fields inherit from the parent session when omitted.
|
|
1565
|
+
*/
|
|
1566
|
+
interface IAgentDefinition {
|
|
1567
|
+
/** Unique name used to reference the agent (e.g., 'Explore', 'Plan'). */
|
|
1568
|
+
name: string;
|
|
1569
|
+
/** Human-readable description of the agent's purpose. */
|
|
1570
|
+
description: string;
|
|
1571
|
+
/** Markdown body content used as the agent's system prompt. */
|
|
1572
|
+
systemPrompt: string;
|
|
1573
|
+
/** Model override (e.g., 'claude-haiku-4-5', 'sonnet', 'opus'). Inherits parent model when omitted. */
|
|
1574
|
+
model?: string;
|
|
1575
|
+
/** Maximum number of agentic turns the subagent may execute. */
|
|
1576
|
+
maxTurns?: number;
|
|
1577
|
+
/** Allowlist of tool names. Only these tools are available when set. */
|
|
1578
|
+
tools?: string[];
|
|
1579
|
+
/** Denylist of tool names. These tools are removed from the inherited set. */
|
|
1580
|
+
disallowedTools?: string[];
|
|
1581
|
+
}
|
|
1582
|
+
//#endregion
|
|
1583
|
+
//#region src/config/config-types.d.ts
|
|
1584
|
+
/**
|
|
1585
|
+
* Fully resolved config after merging all settings files and applying defaults.
|
|
1586
|
+
*/
|
|
1587
|
+
interface IResolvedConfig {
|
|
1588
|
+
defaultTrustLevel: 'safe' | 'moderate' | 'full';
|
|
1589
|
+
/** Response language code (e.g., "ko", "en"). Undefined = no language constraint. */
|
|
1590
|
+
language?: string;
|
|
1591
|
+
/** Active provider profile key when providers/currentProvider are used. */
|
|
1592
|
+
currentProvider?: string;
|
|
1593
|
+
provider: {
|
|
1594
|
+
name: string;
|
|
1595
|
+
model: string;
|
|
1596
|
+
apiKey: string | undefined;
|
|
1597
|
+
baseURL?: string;
|
|
1598
|
+
timeout?: number;
|
|
1599
|
+
options?: Record<string, TUniversalValue>;
|
|
1600
|
+
};
|
|
1601
|
+
permissions: {
|
|
1602
|
+
allow: string[];
|
|
1603
|
+
deny: string[];
|
|
1604
|
+
};
|
|
1605
|
+
env: Record<string, string>;
|
|
1606
|
+
hooks?: THooksConfig;
|
|
1607
|
+
/** Plugin enablement map: plugin name -> enabled/disabled */
|
|
1608
|
+
enabledPlugins?: Record<string, boolean>;
|
|
1609
|
+
/** Extra marketplace sources: name -> { source } */
|
|
1610
|
+
extraKnownMarketplaces?: Record<string, {
|
|
1611
|
+
source: {
|
|
1612
|
+
type: string;
|
|
1613
|
+
repo?: string;
|
|
1614
|
+
url?: string;
|
|
1615
|
+
path?: string;
|
|
1616
|
+
ref?: string;
|
|
1617
|
+
};
|
|
1618
|
+
}>;
|
|
1619
|
+
/** Auto-compact threshold as a 0-1 fraction. Set false to disable automatic compaction. */
|
|
1620
|
+
autoCompactThreshold?: number | false;
|
|
1621
|
+
/** Transport enable/disable + options: transport name -> { enabled, options } */
|
|
1622
|
+
transports?: Record<string, {
|
|
1623
|
+
enabled?: boolean;
|
|
1624
|
+
options?: Record<string, unknown>;
|
|
1625
|
+
}>;
|
|
1626
|
+
}
|
|
1627
|
+
//#endregion
|
|
1628
|
+
//#region src/context/context-file-tracker.d.ts
|
|
1629
|
+
/** A single context file entry tracked with its content hash. */
|
|
1630
|
+
interface IContextFileEntry {
|
|
1631
|
+
/** Absolute path to the file. */
|
|
1632
|
+
filePath: string;
|
|
1633
|
+
/** Content as read at load time. */
|
|
1634
|
+
content: string;
|
|
1635
|
+
/** SHA-256 hex digest of `content`. */
|
|
1636
|
+
contentHash: string;
|
|
1637
|
+
}
|
|
1638
|
+
//#endregion
|
|
1639
|
+
//#region src/context/context-loader.d.ts
|
|
1640
|
+
interface ILoadedContext {
|
|
1641
|
+
/** Concatenated content of all AGENTS.md files found (root-first) */
|
|
1642
|
+
agentsMd: string;
|
|
1643
|
+
/** Concatenated content of all CLAUDE.md files found (root-first) */
|
|
1644
|
+
claudeMd: string;
|
|
1645
|
+
/** Startup project memory index loaded from .robota/memory/MEMORY.md, if present */
|
|
1646
|
+
memoryMd?: string;
|
|
1647
|
+
/** Formatted active task context loaded from .agents/tasks/*.md, if present */
|
|
1648
|
+
taskContext?: string;
|
|
1649
|
+
/** Extracted "Compact Instructions" section from CLAUDE.md, if present */
|
|
1650
|
+
compactInstructions?: string;
|
|
1651
|
+
/** Per-file entries for all AGENTS.md files, root-first. Present for staleness detection. */
|
|
1652
|
+
agentsFileEntries?: IContextFileEntry[];
|
|
1653
|
+
/** Per-file entries for all CLAUDE.md files, root-first. Present for staleness detection. */
|
|
1654
|
+
claudeFileEntries?: IContextFileEntry[];
|
|
1655
|
+
}
|
|
1656
|
+
//#endregion
|
|
1657
|
+
//#region src/assembly/create-subagent-session.d.ts
|
|
1658
|
+
/** Options for creating a subagent session. */
|
|
1659
|
+
interface ISubagentOptions {
|
|
1660
|
+
/** Agent definition (built-in or custom). */
|
|
1661
|
+
agentDefinition: IAgentDefinition;
|
|
1662
|
+
/** Parent's resolved config (for provider, permissions, etc.). */
|
|
1663
|
+
parentConfig: IResolvedConfig;
|
|
1664
|
+
/** Parent's loaded context (CLAUDE.md, AGENTS.md). */
|
|
1665
|
+
parentContext: ILoadedContext;
|
|
1666
|
+
/** Parent session's available tools (to inherit/filter). */
|
|
1667
|
+
parentTools: IToolWithEventService[];
|
|
1668
|
+
/** AI provider instance. */
|
|
1669
|
+
provider: IAIProvider;
|
|
1670
|
+
/** Terminal output interface. */
|
|
1671
|
+
terminal: ITerminalOutput$1;
|
|
1672
|
+
/** Stable session ID for transcript files. */
|
|
1673
|
+
sessionId?: string;
|
|
1674
|
+
/** Optional logger for subagent transcripts. */
|
|
1675
|
+
sessionLogger?: ISessionLogger;
|
|
1676
|
+
/** Whether this is a fork worker (uses fork suffix instead of standard). */
|
|
1677
|
+
isForkWorker?: boolean;
|
|
1678
|
+
/** Permission mode from parent (bypassPermissions, acceptEdits, etc.). */
|
|
1679
|
+
permissionMode?: TPermissionMode;
|
|
1680
|
+
/** Permission handler from parent. */
|
|
1681
|
+
permissionHandler?: TPermissionHandler;
|
|
1682
|
+
/** Plugin hooks configuration from parent session. */
|
|
1683
|
+
hooks?: Record<string, unknown>;
|
|
1684
|
+
/** Hook type executors from parent session (prompt, agent, etc.). */
|
|
1685
|
+
hookTypeExecutors?: IHookTypeExecutor[];
|
|
1686
|
+
/** Streaming callback. */
|
|
1687
|
+
onTextDelta?: (delta: string) => void;
|
|
1688
|
+
/** Tool execution callback. */
|
|
1689
|
+
onToolExecution?: (event: {
|
|
1690
|
+
type: 'start' | 'end';
|
|
1691
|
+
toolName: string;
|
|
1692
|
+
toolArgs?: TToolArgs;
|
|
1693
|
+
success?: boolean;
|
|
1694
|
+
denied?: boolean;
|
|
1695
|
+
toolResultData?: string;
|
|
1696
|
+
executionId?: string;
|
|
1697
|
+
}) => void;
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* Create a fully-configured Session for subagent execution.
|
|
1701
|
+
*
|
|
1702
|
+
* Assembles provider, tools, and system prompt from parent context and
|
|
1703
|
+
* agent definition, then returns a new Session instance.
|
|
1704
|
+
*/
|
|
1705
|
+
declare function createSubagentSession(options: ISubagentOptions): Session;
|
|
1706
|
+
//#endregion
|
|
1707
|
+
//#region src/subagents/in-process-subagent-runner.d.ts
|
|
1708
|
+
interface IInProcessSubagentRunnerDeps {
|
|
1709
|
+
config: IResolvedConfig;
|
|
1710
|
+
context: ILoadedContext;
|
|
1711
|
+
tools: IToolWithEventService[];
|
|
1712
|
+
terminal: ITerminalOutput;
|
|
1713
|
+
provider: IAIProvider;
|
|
1714
|
+
permissionMode?: TPermissionMode;
|
|
1715
|
+
permissionHandler?: TPermissionHandler;
|
|
1716
|
+
hooks?: ISubagentOptions['hooks'];
|
|
1717
|
+
hookTypeExecutors?: IHookTypeExecutor[];
|
|
1718
|
+
onTextDelta?: (delta: string) => void;
|
|
1719
|
+
onToolExecution?: (event: {
|
|
1720
|
+
type: 'start' | 'end';
|
|
1721
|
+
toolName: string;
|
|
1722
|
+
toolArgs?: TToolArgs;
|
|
1723
|
+
success?: boolean;
|
|
1724
|
+
denied?: boolean;
|
|
1725
|
+
toolResultData?: string;
|
|
1726
|
+
executionId?: string;
|
|
1727
|
+
}) => void;
|
|
1728
|
+
customAgentRegistry?: (name: string) => IAgentDefinition | undefined;
|
|
1729
|
+
}
|
|
1730
|
+
type TSubagentRunnerFactory = (deps: IInProcessSubagentRunnerDeps) => ISubagentRunner;
|
|
1731
|
+
declare function createInProcessSubagentRunner(deps: IInProcessSubagentRunnerDeps): ISubagentRunner;
|
|
1732
|
+
//#endregion
|
|
1733
|
+
//#region src/tools/agent-tool.d.ts
|
|
1734
|
+
/** Dependencies injected at creation time via createAgentTool factory */
|
|
1735
|
+
interface IAgentToolDeps extends IInProcessSubagentRunnerDeps {
|
|
1736
|
+
cwd?: string;
|
|
1737
|
+
parentSessionId?: string;
|
|
1738
|
+
subagentDepth?: number;
|
|
1739
|
+
subagentManager?: ISubagentManager;
|
|
1740
|
+
backgroundTaskManager?: IBackgroundTaskManager$1;
|
|
1741
|
+
/** Optional custom agent registry for resolving non-built-in agent types. */
|
|
1742
|
+
customAgentRegistry?: (name: string) => IAgentDefinition | undefined;
|
|
1743
|
+
/** Model-visible and command-visible agent definitions available to this session. */
|
|
1744
|
+
agentDefinitions?: IAgentDefinition[];
|
|
1745
|
+
/** PRESET-016 — runtime gate; when present and returns false, subagent dispatch is refused. */
|
|
1746
|
+
isParallelSubagentsEnabled?: () => boolean;
|
|
1747
|
+
}
|
|
1748
|
+
/** Store agent tool deps keyed by a session (or any object). */
|
|
1749
|
+
declare function storeAgentToolDeps(key: object, deps: IAgentToolDeps): void;
|
|
1750
|
+
/** Retrieve agent tool deps for a given session key. */
|
|
1751
|
+
declare function retrieveAgentToolDeps(key: object): IAgentToolDeps | undefined;
|
|
1752
|
+
/**
|
|
1753
|
+
* Create an agent tool instance with deps captured in closure.
|
|
1754
|
+
*
|
|
1755
|
+
* Each session gets its own tool instance — no shared mutable state.
|
|
1756
|
+
*/
|
|
1757
|
+
declare function createAgentTool(deps: IAgentToolDeps): ReturnType<typeof createZodFunctionTool>;
|
|
1758
|
+
//#endregion
|
|
1759
|
+
//#region src/interactive/interactive-session-agent-jobs.d.ts
|
|
1760
|
+
interface ISpawnAgentJobInput {
|
|
1761
|
+
agentType: string;
|
|
1762
|
+
label: string;
|
|
1763
|
+
mode: 'foreground' | 'background';
|
|
1764
|
+
prompt: string;
|
|
1765
|
+
model?: string;
|
|
1766
|
+
isolation?: TBackgroundTaskIsolation;
|
|
1767
|
+
}
|
|
1768
|
+
//#endregion
|
|
1769
|
+
//#region src/context/prompt-file-reference-format.d.ts
|
|
1770
|
+
declare function buildPromptWithFileReferences(input: string, references: readonly IResolvedPromptFileReference[]): string;
|
|
1771
|
+
declare function hasBlockingPromptFileReferenceDiagnostics(diagnostics: readonly IPromptFileReferenceDiagnostic[]): boolean;
|
|
1772
|
+
declare function formatPromptFileReferenceDiagnostics(diagnostics: readonly IPromptFileReferenceDiagnostic[]): string;
|
|
1773
|
+
declare function toPromptFileReferenceRecords(references: readonly IResolvedPromptFileReference[]): IPromptFileReferenceRecord[];
|
|
1774
|
+
declare function createPromptFileReferenceHistoryEntry(references: readonly IResolvedPromptFileReference[]): IHistoryEntry<IPromptFileReferenceHistoryData>;
|
|
1775
|
+
//#endregion
|
|
1776
|
+
//#region src/context/prompt-file-reference-parser.d.ts
|
|
1777
|
+
declare function parsePromptFileReferences(input: string): IPromptFileReferenceToken[];
|
|
1778
|
+
//#endregion
|
|
1779
|
+
//#region src/context/prompt-file-reference-resolver.d.ts
|
|
1780
|
+
declare function resolvePromptFileReferences(input: string, options: IPromptFileReferenceResolveOptions): Promise<IResolvedPromptFileReferences>;
|
|
1781
|
+
declare function resolvePromptFileReferencePaths(referencePaths: readonly string[], options: IPromptFileReferenceResolveOptions): Promise<IResolvedPromptFileReferences>;
|
|
1782
|
+
//#endregion
|
|
1783
|
+
//#region src/interactive/interactive-session-history-tracker.d.ts
|
|
1784
|
+
interface IHistoryTrackerState {
|
|
1785
|
+
history: IHistoryEntry[];
|
|
1786
|
+
memoryEvents: IMemoryEvent[];
|
|
1787
|
+
usedMemoryReferences: IMemoryReference[];
|
|
1788
|
+
contextReferences: IContextReferenceItem[];
|
|
1789
|
+
skillActivationEvents: ISkillActivationEvent[];
|
|
1790
|
+
}
|
|
1791
|
+
declare class SessionHistoryTracker {
|
|
1792
|
+
private readonly cwd;
|
|
1793
|
+
private readonly getSessionId;
|
|
1794
|
+
private readonly getExecuting;
|
|
1795
|
+
private readonly persistSession;
|
|
1796
|
+
private readonly emitSkillActivation;
|
|
1797
|
+
private readonly emitMemoryEvent;
|
|
1798
|
+
private history;
|
|
1799
|
+
private editCheckpointStore;
|
|
1800
|
+
private memoryEvents;
|
|
1801
|
+
private usedMemoryReferences;
|
|
1802
|
+
private contextReferences;
|
|
1803
|
+
private systemContextReferences;
|
|
1804
|
+
private skillActivationEvents;
|
|
1805
|
+
constructor(cwd: string, getSessionId: () => string, getExecuting: () => boolean, persistSession: () => void, emitSkillActivation: (event: ISkillActivationEvent) => void, emitMemoryEvent: (event: IMemoryEvent) => void, editCheckpointStore?: EditCheckpointStore | null);
|
|
1806
|
+
restoreState(state: IHistoryTrackerState): void;
|
|
1807
|
+
getState(): IHistoryTrackerState;
|
|
1808
|
+
append(entry: IHistoryEntry): void;
|
|
1809
|
+
getHistory(): IHistoryEntry[];
|
|
1810
|
+
clearHistory(): void;
|
|
1811
|
+
resetUsedMemoryReferences(): void;
|
|
1812
|
+
recordContextReferenceUsage(records: readonly IPromptFileReferenceRecord[]): void;
|
|
1813
|
+
recordPromptContextReferences(records: readonly IPromptFileReferenceRecord[]): void;
|
|
1814
|
+
listEditCheckpoints(): IEditCheckpointSummary[];
|
|
1815
|
+
inspectEditCheckpoint(checkpointId: string): IEditCheckpointInspection;
|
|
1816
|
+
restoreEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
1817
|
+
rollbackEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
1818
|
+
beginEditCheckpointTurn(prompt: string): Promise<void>;
|
|
1819
|
+
finalizeEditCheckpointTurn(): Promise<void>;
|
|
1820
|
+
setEditCheckpointStore(store: EditCheckpointStore): void;
|
|
1821
|
+
getUsedMemoryReferences(): IMemoryReference[];
|
|
1822
|
+
recordMemoryEvent(event: IMemoryEvent): void;
|
|
1823
|
+
recordSystemContextFiles(entries: readonly IContextFileEntry[]): void;
|
|
1824
|
+
listContextReferences(): IContextReferenceItem[];
|
|
1825
|
+
listInjectionContextReferences(): IContextReferenceItem[];
|
|
1826
|
+
addContextReference(path: string): Promise<IContextReferenceAddResult>;
|
|
1827
|
+
removeContextReference(path: string): IContextReferenceRemoveResult;
|
|
1828
|
+
clearContextReferences(): IContextReferenceClearResult;
|
|
1829
|
+
getSkillActivationEvents(): ISkillActivationEvent[];
|
|
1830
|
+
recordSkillActivationEvent(event: ISkillActivationEvent, appendHistory: boolean): void;
|
|
1831
|
+
private getCheckpointStore;
|
|
1832
|
+
}
|
|
1833
|
+
//#endregion
|
|
1834
|
+
//#region src/interactive/session-persistence.d.ts
|
|
1835
|
+
declare function createProjectSessionStore(cwd: string, fs?: IFileSystem): IInteractiveSessionStore;
|
|
1836
|
+
/**
|
|
1837
|
+
* User-level session store (`~/.robota/sessions`). Symmetric to {@link createProjectSessionStore};
|
|
1838
|
+
* there is no user-level replay-log directory, so it reads persisted records only.
|
|
1839
|
+
*/
|
|
1840
|
+
declare function createUserSessionStore(fs?: IFileSystem): IInteractiveSessionStore;
|
|
1841
|
+
declare function listResumableSessionSummaries(sessionStore: IInteractiveSessionStore | undefined, cwd: string): IResumableSessionSummary[];
|
|
1842
|
+
declare function resolveLatestSessionId(sessionStore: IInteractiveSessionStore | undefined, cwd: string): string | undefined;
|
|
1843
|
+
declare function resolveSessionIdByIdOrName(sessionStore: IInteractiveSessionStore | undefined, idOrName: string): string | undefined;
|
|
1844
|
+
//#endregion
|
|
1845
|
+
//#region src/context/project-detector.d.ts
|
|
1846
|
+
type TProjectType = 'node' | 'python' | 'rust' | 'go' | 'unknown';
|
|
1847
|
+
type TPackageManager = 'pnpm' | 'yarn' | 'npm' | 'bun';
|
|
1848
|
+
type TLanguage = 'typescript' | 'javascript' | 'python' | 'rust' | 'go' | 'unknown';
|
|
1849
|
+
interface IProjectInfo {
|
|
1850
|
+
type: TProjectType;
|
|
1851
|
+
name?: string;
|
|
1852
|
+
packageManager?: TPackageManager;
|
|
1853
|
+
language: TLanguage;
|
|
1854
|
+
}
|
|
1855
|
+
//#endregion
|
|
1856
|
+
//#region src/context/system-prompt-builder.d.ts
|
|
1857
|
+
interface ISystemPromptParams {
|
|
1858
|
+
/**
|
|
1859
|
+
* Preset persona block (portable personality/behaviour). When set and non-blank it is
|
|
1860
|
+
* composed as a `source: 'persona'` section with priority 5; empty/undefined adds no section.
|
|
1861
|
+
*/
|
|
1862
|
+
persona?: string;
|
|
1863
|
+
/**
|
|
1864
|
+
* PRESET-017: when true, a concise verify-before-done directive is composed as a
|
|
1865
|
+
* `source: 'self-verification'` section with priority 6; false/undefined adds no section.
|
|
1866
|
+
*/
|
|
1867
|
+
selfVerification?: boolean;
|
|
1868
|
+
/** Concatenated AGENTS.md content (may be empty string) */
|
|
1869
|
+
agentsMd: string;
|
|
1870
|
+
/** Concatenated CLAUDE.md content (may be empty string) */
|
|
1871
|
+
claudeMd: string;
|
|
1872
|
+
/** Startup project memory index loaded from .robota/memory/MEMORY.md */
|
|
1873
|
+
memoryMd?: string;
|
|
1874
|
+
/** Formatted active task context loaded from .agents/tasks/*.md */
|
|
1875
|
+
taskContext?: string;
|
|
1876
|
+
/** Human-readable tool descriptions, one per entry */
|
|
1877
|
+
toolDescriptions: string[];
|
|
1878
|
+
/** Active permission mode — the value the permission gate enforces */
|
|
1879
|
+
permissionMode: TPermissionMode;
|
|
1880
|
+
/** Detected project metadata */
|
|
1881
|
+
projectInfo: IProjectInfo;
|
|
1882
|
+
/** Current working directory */
|
|
1883
|
+
cwd?: string;
|
|
1884
|
+
/** Response language code (e.g., "ko", "en"). If set, AI must respond in this language. */
|
|
1885
|
+
language?: string;
|
|
1886
|
+
/** Discovered skills to expose in the system prompt */
|
|
1887
|
+
skills?: Array<{
|
|
1888
|
+
name: string;
|
|
1889
|
+
description: string;
|
|
1890
|
+
disableModelInvocation?: boolean;
|
|
1891
|
+
}>;
|
|
1892
|
+
/** Discovered agents to expose in the system prompt */
|
|
1893
|
+
agents?: Array<{
|
|
1894
|
+
name: string;
|
|
1895
|
+
description: string;
|
|
1896
|
+
}>;
|
|
1897
|
+
/** Command descriptors to expose to the model */
|
|
1898
|
+
commandDescriptors?: ICapabilityDescriptor[];
|
|
1899
|
+
}
|
|
1900
|
+
//#endregion
|
|
1901
|
+
//#region src/hooks/agent-executor.d.ts
|
|
1902
|
+
/** A minimal session interface for running a prompt. */
|
|
1903
|
+
interface IAgentSession {
|
|
1904
|
+
run(prompt: string): Promise<string>;
|
|
1905
|
+
}
|
|
1906
|
+
/** Factory that creates a session instance with the given options. */
|
|
1907
|
+
type TSessionFactory = (options: {
|
|
1908
|
+
maxTurns?: number;
|
|
1909
|
+
timeout?: number;
|
|
1910
|
+
}) => IAgentSession;
|
|
1911
|
+
/** Constructor options for AgentExecutor. */
|
|
1912
|
+
interface IAgentExecutorOptions {
|
|
1913
|
+
sessionFactory: TSessionFactory;
|
|
1914
|
+
}
|
|
1915
|
+
declare class AgentExecutor implements IHookTypeExecutor {
|
|
1916
|
+
readonly type: "agent";
|
|
1917
|
+
private readonly sessionFactory;
|
|
1918
|
+
constructor(options: IAgentExecutorOptions);
|
|
1919
|
+
execute(definition: THookDefinition, input: IHookInput): Promise<IHookResult>;
|
|
1920
|
+
}
|
|
1921
|
+
//#endregion
|
|
1922
|
+
//#region src/hooks/prompt-executor.d.ts
|
|
1923
|
+
/** A minimal provider interface for single-turn completion. */
|
|
1924
|
+
interface IPromptProvider {
|
|
1925
|
+
complete(prompt: string): Promise<string>;
|
|
1926
|
+
}
|
|
1927
|
+
/** Factory that creates a provider instance, optionally for a specific model. */
|
|
1928
|
+
type TProviderFactory = (model?: string) => IPromptProvider;
|
|
1929
|
+
/** Constructor options for PromptExecutor. */
|
|
1930
|
+
interface IPromptExecutorOptions {
|
|
1931
|
+
providerFactory: TProviderFactory;
|
|
1932
|
+
defaultModel?: string;
|
|
1933
|
+
}
|
|
1934
|
+
declare class PromptExecutor implements IHookTypeExecutor {
|
|
1935
|
+
readonly type: "prompt";
|
|
1936
|
+
private readonly providerFactory;
|
|
1937
|
+
private readonly defaultModel;
|
|
1938
|
+
constructor(options: IPromptExecutorOptions);
|
|
1939
|
+
execute(definition: THookDefinition, input: IHookInput): Promise<IHookResult>;
|
|
1940
|
+
}
|
|
1941
|
+
//#endregion
|
|
1942
|
+
//#region src/reversible-execution/reversible-execution-policy.d.ts
|
|
1943
|
+
type TReversibleExecutionIsolation = 'none' | 'worktree' | 'provider-sandbox';
|
|
1944
|
+
type TReversibleRollbackLayer = 'none' | 'edit-checkpoint' | 'worktree' | 'provider-sandbox';
|
|
1945
|
+
type TReversibleSideEffect = 'none' | 'file-mutation' | 'shell-process' | 'subagent' | 'unknown';
|
|
1946
|
+
type TReversibleSafetyStatus = 'reversible' | 'read-only' | 'requires-checkpoint' | 'requires-isolation' | 'unknown';
|
|
1947
|
+
interface IReversibleExecutionOptions {
|
|
1948
|
+
mode: 'local-first';
|
|
1949
|
+
isolation?: TReversibleExecutionIsolation;
|
|
1950
|
+
enforceUntrackedSideEffects?: boolean;
|
|
1951
|
+
}
|
|
1952
|
+
interface IReversibleToolSafetyContext {
|
|
1953
|
+
checkpointAvailable: boolean;
|
|
1954
|
+
isolation: TReversibleExecutionIsolation;
|
|
1955
|
+
}
|
|
1956
|
+
interface IReversibleToolSafetyInput {
|
|
1957
|
+
toolName: string;
|
|
1958
|
+
toolArgs?: TToolArgs;
|
|
1959
|
+
context: IReversibleToolSafetyContext;
|
|
1960
|
+
}
|
|
1961
|
+
interface IReversibleToolSafetyReport {
|
|
1962
|
+
toolName: string;
|
|
1963
|
+
reversible: boolean;
|
|
1964
|
+
sideEffect: TReversibleSideEffect;
|
|
1965
|
+
rollbackLayer: TReversibleRollbackLayer;
|
|
1966
|
+
status: TReversibleSafetyStatus;
|
|
1967
|
+
message: string;
|
|
1968
|
+
}
|
|
1969
|
+
declare function evaluateReversibleToolSafety(input: IReversibleToolSafetyInput): IReversibleToolSafetyReport;
|
|
1970
|
+
declare function wrapReversibleExecutionTools(tools: readonly IToolWithEventService[], options: IReversibleExecutionOptions & {
|
|
1971
|
+
checkpointAvailable: boolean;
|
|
1972
|
+
}): IToolWithEventService[];
|
|
1973
|
+
//#endregion
|
|
1974
|
+
//#region src/assembly/create-session-types.d.ts
|
|
1975
|
+
type TAutoCompactThreshold = number | false;
|
|
1976
|
+
/** Options for the createSession factory */
|
|
1977
|
+
interface ICreateSessionOptions {
|
|
1978
|
+
/** Resolved CLI configuration (model, API key, permissions) */
|
|
1979
|
+
config: IResolvedConfig;
|
|
1980
|
+
/** Working directory used for project context, skills, and agent definitions. */
|
|
1981
|
+
cwd?: string;
|
|
1982
|
+
/** Loaded AGENTS.md / CLAUDE.md context */
|
|
1983
|
+
context: ILoadedContext;
|
|
1984
|
+
/** Terminal I/O for permission prompts */
|
|
1985
|
+
terminal: ITerminalOutput$1;
|
|
1986
|
+
/** Project metadata for system prompt */
|
|
1987
|
+
projectInfo?: IProjectInfo;
|
|
1988
|
+
/** Initial permission mode (defaults to config.defaultTrustLevel → mode mapping) */
|
|
1989
|
+
permissionMode?: TPermissionMode;
|
|
1990
|
+
/** Maximum number of agentic turns per run() call. Undefined = unlimited. */
|
|
1991
|
+
maxTurns?: number;
|
|
1992
|
+
/** Optional session store for persistence */
|
|
1993
|
+
sessionStore?: IInteractiveSessionStore;
|
|
1994
|
+
/** Inject a pre-constructed AI provider (used by tests to avoid real API calls) */
|
|
1995
|
+
provider?: IAIProvider;
|
|
1996
|
+
/** Custom permission handler (overrides terminal-based prompts, used by Ink UI) */
|
|
1997
|
+
permissionHandler?: TPermissionHandler;
|
|
1998
|
+
/**
|
|
1999
|
+
* Injected "ask the user" port (CMD-005): forwarded into the session/agent so model-invoked tools
|
|
2000
|
+
* (AskUserQuestion) can solicit a structured answer. Absent headless.
|
|
2001
|
+
*/
|
|
2002
|
+
ask?: IUserInteraction['ask'];
|
|
2003
|
+
/** Callback for text deltas — enables streaming text to the UI in real-time */
|
|
2004
|
+
onTextDelta?: (delta: string) => void;
|
|
2005
|
+
/** Callback when context window usage is refreshed */
|
|
2006
|
+
onContextUpdate?: (state: IContextWindowState) => void;
|
|
2007
|
+
/** Custom prompt-for-approval function (injected from CLI) */
|
|
2008
|
+
promptForApproval?: (terminal: ITerminalOutput$1, toolName: string, toolArgs: TToolArgs) => Promise<TPermissionResult>;
|
|
2009
|
+
/** Additional tools to register beyond the defaults (e.g. agent-tool) */
|
|
2010
|
+
additionalTools?: IToolWithEventService[];
|
|
2011
|
+
/** GOAL-001: include the `report_goal_status` completion-signal tool (interactive sessions). */
|
|
2012
|
+
includeGoalTool?: boolean;
|
|
2013
|
+
/** Additional background task runners composed by the runtime shell. */
|
|
2014
|
+
backgroundTaskRunners?: IBackgroundTaskRunner$1[];
|
|
2015
|
+
/** Runtime shell override for subagent execution. Defaults to the SDK in-process runner. */
|
|
2016
|
+
subagentRunnerFactory?: TSubagentRunnerFactory;
|
|
2017
|
+
/** Enable agent tool, agent definitions, and subagent runtime wiring for this session. */
|
|
2018
|
+
enableAgentRuntime?: boolean;
|
|
2019
|
+
/**
|
|
2020
|
+
* Preset execution capability: when true the assembly turns on `enableAgentRuntime`
|
|
2021
|
+
* so subagent/background dispatch is active for this session. Threaded from the
|
|
2022
|
+
* preset's `enableParallelSubagents` flag.
|
|
2023
|
+
*/
|
|
2024
|
+
enableParallelSubagents?: boolean;
|
|
2025
|
+
/**
|
|
2026
|
+
* Preset execution capability: when true the framework composes a verify-before-done
|
|
2027
|
+
* self-verification section into the system prompt (PRESET-017), as a normal
|
|
2028
|
+
* priority-sorted `source: 'self-verification'` section.
|
|
2029
|
+
*/
|
|
2030
|
+
selfVerification?: boolean;
|
|
2031
|
+
/** Callback when a tool starts or finishes execution — enables real-time tool display in UI */
|
|
2032
|
+
onToolExecution?: (event: {
|
|
2033
|
+
type: 'start' | 'end';
|
|
2034
|
+
toolName: string;
|
|
2035
|
+
toolArgs?: TToolArgs;
|
|
2036
|
+
success?: boolean;
|
|
2037
|
+
denied?: boolean;
|
|
2038
|
+
toolResultData?: string;
|
|
2039
|
+
executionId?: string;
|
|
2040
|
+
}) => void;
|
|
2041
|
+
/** Callback when context is compacted */
|
|
2042
|
+
onCompact?: (summary: string) => void;
|
|
2043
|
+
/** Callback with structured compaction metadata */
|
|
2044
|
+
onCompactEvent?: (event: ICompactEvent) => void;
|
|
2045
|
+
/** Instructions to include in the compaction prompt (e.g. from CLAUDE.md) */
|
|
2046
|
+
compactInstructions?: string;
|
|
2047
|
+
/** Auto-compact threshold as a 0-1 fraction. Set false to disable automatic compaction. */
|
|
2048
|
+
autoCompactThreshold?: TAutoCompactThreshold;
|
|
2049
|
+
/** Custom system prompt builder function */
|
|
2050
|
+
systemPromptBuilder?: (params: ISystemPromptParams) => string;
|
|
2051
|
+
/** Custom tool descriptions for the system prompt */
|
|
2052
|
+
toolDescriptions?: string[];
|
|
2053
|
+
/** Session logger — injected for pluggable session event logging. */
|
|
2054
|
+
sessionLogger?: ISessionLogger;
|
|
2055
|
+
/** Provider factory for prompt hook executors (DI). */
|
|
2056
|
+
providerFactory?: TProviderFactory;
|
|
2057
|
+
/** Session factory for agent hook executors (DI). */
|
|
2058
|
+
sessionFactory?: TSessionFactory;
|
|
2059
|
+
/** Additional hook type executors beyond the defaults (prompt, agent). */
|
|
2060
|
+
additionalHookExecutors?: IHookTypeExecutor[];
|
|
2061
|
+
/** Override session ID (used when resuming a session to reuse the original ID) */
|
|
2062
|
+
sessionId?: string;
|
|
2063
|
+
/** Pre-approved tool names — added to permissions.allow as ToolName(*) patterns. */
|
|
2064
|
+
allowedTools?: string[];
|
|
2065
|
+
/** Denied tool names — added to permissions.deny as ToolName(*) patterns. denied > allowed. */
|
|
2066
|
+
deniedTools?: string[];
|
|
2067
|
+
/** Override the model from config. When set, takes precedence over config.provider.model. */
|
|
2068
|
+
model?: string;
|
|
2069
|
+
/**
|
|
2070
|
+
* Reasoning-effort dial for this session, threaded to the provider request builder.
|
|
2071
|
+
* Resolved from a preset's `effort` (PRESET-008). When unset, the framework→provider
|
|
2072
|
+
* seam defaults it to `'high'`. Native-effort providers map it onto their request
|
|
2073
|
+
* parameter; providers without native effort ignore it as a documented no-op.
|
|
2074
|
+
*/
|
|
2075
|
+
effort?: TModelEffort;
|
|
2076
|
+
/** Text to append to the generated system prompt. */
|
|
2077
|
+
appendSystemPrompt?: string;
|
|
2078
|
+
/** Preset persona block composed as a `source: 'persona'` system-prompt section (priority 5). */
|
|
2079
|
+
persona?: string;
|
|
2080
|
+
/** Model command execution bridge. */
|
|
2081
|
+
modelCommandExecutor?: (command: string, args: string) => Promise<ICommandResult$1 | null>;
|
|
2082
|
+
/** Predicate for commands allowed through the model command execution bridge. */
|
|
2083
|
+
isModelCommandInvocable?: (command: string) => boolean;
|
|
2084
|
+
/** Model-visible command descriptors. */
|
|
2085
|
+
commandDescriptors?: ICapabilityDescriptor[];
|
|
2086
|
+
/** Recorder used to snapshot files before Write/Edit tools mutate them. */
|
|
2087
|
+
editCheckpointRecorder?: IEditCheckpointRecorder;
|
|
2088
|
+
/** Opt-in local-first reversible execution policy for write/shell tools. */
|
|
2089
|
+
reversibleExecution?: IReversibleExecutionOptions;
|
|
2090
|
+
/** Optional provider sandbox client used by sandbox-aware built-in tools. */
|
|
2091
|
+
sandboxClient?: ISandboxClient;
|
|
2092
|
+
/** Name reported to the underlying Robota agent config. Defaults to 'agent'. */
|
|
2093
|
+
agentName?: string;
|
|
2094
|
+
/** Active preset id selected at startup (PRESET-011 runtime state). Defaults to 'default'. */
|
|
2095
|
+
activePresetId?: string;
|
|
2096
|
+
/** Request structured output from the provider for this session. */
|
|
2097
|
+
responseFormat?: {
|
|
2098
|
+
type: 'text' | 'json_object';
|
|
2099
|
+
};
|
|
2100
|
+
}
|
|
2101
|
+
/** Result of createSession — session instance plus a system-message rebuilder for context refresh. */
|
|
2102
|
+
interface ICreateSessionResult {
|
|
2103
|
+
session: Session;
|
|
2104
|
+
/**
|
|
2105
|
+
* Rebuild the system message using updated context strings.
|
|
2106
|
+
* Called by staleness detection when AGENTS.md or CLAUDE.md files change between turns.
|
|
2107
|
+
* PRESET-014: an optional `overrides.persona` re-applies a preset persona to the live prompt;
|
|
2108
|
+
* PRESET-017: an optional `overrides.selfVerification` toggles the verify-before-done section.
|
|
2109
|
+
* Either override is retained for subsequent (override-less) rebuilds.
|
|
2110
|
+
*/
|
|
2111
|
+
rebuildSystemMessage: (agentsMd: string, claudeMd: string, overrides?: {
|
|
2112
|
+
persona?: string;
|
|
2113
|
+
selfVerification?: boolean;
|
|
2114
|
+
}) => string;
|
|
2115
|
+
}
|
|
2116
|
+
//#endregion
|
|
2117
|
+
//#region src/assembly/create-tools.d.ts
|
|
2118
|
+
/**
|
|
2119
|
+
* Create the default set of CLI tools.
|
|
2120
|
+
* Returns the standard tools as IToolWithEventService[].
|
|
2121
|
+
*/
|
|
2122
|
+
interface ICreateDefaultToolsOptions {
|
|
2123
|
+
sandboxClient?: ISandboxClient;
|
|
2124
|
+
cwd?: string;
|
|
2125
|
+
}
|
|
2126
|
+
declare function createDefaultTools(options?: ICreateDefaultToolsOptions): IToolWithEventService[];
|
|
2127
|
+
//#endregion
|
|
2128
|
+
//#region src/assembly/subagent-prompts.d.ts
|
|
2129
|
+
/**
|
|
2130
|
+
* Framework system prompt suffixes for subagent sessions.
|
|
2131
|
+
*
|
|
2132
|
+
* These functions generate the standard prompt content injected into
|
|
2133
|
+
* subagent sessions to control output format and behavior.
|
|
2134
|
+
*/
|
|
2135
|
+
/** Options for assembling a subagent system prompt. */
|
|
2136
|
+
interface ISubagentPromptOptions {
|
|
2137
|
+
/** Agent definition markdown body. */
|
|
2138
|
+
agentBody: string;
|
|
2139
|
+
/** CLAUDE.md content to include. */
|
|
2140
|
+
claudeMd?: string;
|
|
2141
|
+
/** AGENTS.md content to include. */
|
|
2142
|
+
agentsMd?: string;
|
|
2143
|
+
/** When true, use fork worker suffix instead of standard subagent suffix. */
|
|
2144
|
+
isForkWorker: boolean;
|
|
2145
|
+
}
|
|
2146
|
+
/**
|
|
2147
|
+
* Returns the standard subagent suffix appended to agent body for normal subagents.
|
|
2148
|
+
*/
|
|
2149
|
+
declare function getSubagentSuffix(): string;
|
|
2150
|
+
/**
|
|
2151
|
+
* Returns the fork worker suffix for context:fork skill workers.
|
|
2152
|
+
*/
|
|
2153
|
+
declare function getForkWorkerSuffix(): string;
|
|
2154
|
+
/**
|
|
2155
|
+
* Assembles the full system prompt for a subagent.
|
|
2156
|
+
*
|
|
2157
|
+
* Assembly order:
|
|
2158
|
+
* 1. Agent definition body
|
|
2159
|
+
* 2. CLAUDE.md content (if provided)
|
|
2160
|
+
* 3. AGENTS.md content (if provided)
|
|
2161
|
+
* 4. Framework suffix (fork worker OR standard subagent)
|
|
2162
|
+
*/
|
|
2163
|
+
declare function assembleSubagentPrompt(options: ISubagentPromptOptions): string;
|
|
2164
|
+
//#endregion
|
|
2165
|
+
//#region src/assembly/subagent-logger.d.ts
|
|
2166
|
+
/**
|
|
2167
|
+
* Create a FileSessionLogger for a subagent session.
|
|
2168
|
+
*
|
|
2169
|
+
* The logger writes JSONL files into a `subagents/` subdirectory under the
|
|
2170
|
+
* parent session's log folder. The directory is created if it does not exist.
|
|
2171
|
+
*
|
|
2172
|
+
* @param parentSessionId - ID of the parent session (used as directory name)
|
|
2173
|
+
* @param agentId - Unique identifier for this subagent run
|
|
2174
|
+
* @param baseLogsDir - Root logs directory (e.g., `.robota/logs`)
|
|
2175
|
+
* @returns A FileSessionLogger writing to the subagent directory
|
|
2176
|
+
*/
|
|
2177
|
+
declare function createSubagentLogger(parentSessionId: string, _agentId: string, baseLogsDir: string, fs?: IFileSystem): FileSessionLogger;
|
|
2178
|
+
/**
|
|
2179
|
+
* Resolve the subagent log directory path without creating it.
|
|
2180
|
+
*
|
|
2181
|
+
* Useful when the caller needs the path for display or configuration
|
|
2182
|
+
* but does not want to create the directory immediately.
|
|
2183
|
+
*
|
|
2184
|
+
* @param parentSessionId - ID of the parent session
|
|
2185
|
+
* @param baseLogsDir - Root logs directory
|
|
2186
|
+
* @returns The resolved subagent log directory path
|
|
2187
|
+
*/
|
|
2188
|
+
declare function resolveSubagentLogDir(parentSessionId: string, baseLogsDir: string): string;
|
|
2189
|
+
//#endregion
|
|
2190
|
+
//#region src/interactive/interactive-session-options.d.ts
|
|
2191
|
+
/** Standard construction: cwd + provider. Config/context loaded internally. */
|
|
2192
|
+
interface IInteractiveSessionStandardOptions {
|
|
2193
|
+
cwd: string;
|
|
2194
|
+
provider: IAIProvider;
|
|
2195
|
+
permissionMode?: ICreateSessionOptions['permissionMode'];
|
|
2196
|
+
maxTurns?: number;
|
|
2197
|
+
permissionHandler?: TInteractivePermissionHandler;
|
|
2198
|
+
sessionStore?: IInteractiveSessionStore;
|
|
2199
|
+
sessionName?: string;
|
|
2200
|
+
resumeSessionId?: string;
|
|
2201
|
+
forkSession?: boolean;
|
|
2202
|
+
/** Skip AGENTS.md/CLAUDE.md loading and plugin discovery. */
|
|
2203
|
+
bare?: boolean;
|
|
2204
|
+
/** Pre-approved tool names passed to createSession. */
|
|
2205
|
+
allowedTools?: string[];
|
|
2206
|
+
/** Denied tool names — added to permissions.deny. denied > allowed. */
|
|
2207
|
+
deniedTools?: string[];
|
|
2208
|
+
/** Override the model from config. When set, takes precedence over config.provider.model. */
|
|
2209
|
+
model?: string;
|
|
2210
|
+
/** Text to append to the system prompt. */
|
|
2211
|
+
appendSystemPrompt?: string;
|
|
2212
|
+
/** Preset persona block composed as a `source: 'persona'` system-prompt section (priority 5). */
|
|
2213
|
+
persona?: string;
|
|
2214
|
+
/** Replace the entire system prompt with this string. Takes precedence over the default builder. */
|
|
2215
|
+
systemPrompt?: string;
|
|
2216
|
+
/** Override config language (e.g., "ko", "en"). Injected into system prompt. */
|
|
2217
|
+
language?: string;
|
|
2218
|
+
/** Runtime-composed background task runners. */
|
|
2219
|
+
backgroundTaskRunners?: IBackgroundTaskRunner$1[];
|
|
2220
|
+
/** Runtime shell override for subagent execution. */
|
|
2221
|
+
subagentRunnerFactory?: TSubagentRunnerFactory;
|
|
2222
|
+
/** Optional command modules composed into this session. */
|
|
2223
|
+
commandModules?: readonly ICommandModule[];
|
|
2224
|
+
/** Host adapters available to composed command modules. */
|
|
2225
|
+
commandHostAdapters?: ICommandHostAdapters;
|
|
2226
|
+
/** Shell exec function for preprocessing `` !`cmd` `` patterns in skills — injected from composition root. */
|
|
2227
|
+
shellExec?: TShellExecFn;
|
|
2228
|
+
/**
|
|
2229
|
+
* TERM-001: transport-provided terminal-handoff capability. When present, the session can hand the
|
|
2230
|
+
* real terminal to a child process (e.g. `/shell`, `$EDITOR`) and restore the display. Absent /
|
|
2231
|
+
* `canHandoffTerminal === false` for transports with no interactive TTY (headless).
|
|
2232
|
+
*/
|
|
2233
|
+
terminalHandoff?: ITerminalHandoff;
|
|
2234
|
+
/**
|
|
2235
|
+
* CMD-004: transport-provided "ask the user" handler. When present, commands can solicit a
|
|
2236
|
+
* structured answer (confirm/select/multi/text) through the interaction channel. Absent for
|
|
2237
|
+
* non-interactive transports — the session then treats an ask as `cancelled`, never a silent guess.
|
|
2238
|
+
*/
|
|
2239
|
+
askHandler?: IUserInteraction['ask'];
|
|
2240
|
+
/** Model-visible command descriptors derived from the composed command executor. */
|
|
2241
|
+
commandDescriptors?: readonly ICapabilityDescriptor[];
|
|
2242
|
+
/** Provider definitions for hot-swap via /provider switch. */
|
|
2243
|
+
providerDefinitions?: readonly import('@robota-sdk/agent-core').IProviderDefinition[];
|
|
2244
|
+
/** Model command execution bridge. */
|
|
2245
|
+
modelCommandExecutor?: (command: string, args: string) => Promise<ICommandResult$1 | null>;
|
|
2246
|
+
/** Predicate for commands allowed through the model command execution bridge. */
|
|
2247
|
+
isModelCommandInvocable?: (command: string) => boolean;
|
|
2248
|
+
/** Preloaded config to avoid duplicate discovery when caller needs it too. */
|
|
2249
|
+
config?: IResolvedConfig;
|
|
2250
|
+
/** Opt-in local-first reversible execution policy for write/shell tools. */
|
|
2251
|
+
reversibleExecution?: IReversibleExecutionOptions;
|
|
2252
|
+
/** Optional provider sandbox client used by sandbox-aware built-in tools. */
|
|
2253
|
+
sandboxClient?: ISandboxClient;
|
|
2254
|
+
/** Fresh-session workspace manifest applied through the sandbox client. */
|
|
2255
|
+
workspaceManifest?: IWorkspaceManifest;
|
|
2256
|
+
/** Sandbox target root for workspace manifest entries. Defaults to /workspace. */
|
|
2257
|
+
sandboxWorkspaceRoot?: string;
|
|
2258
|
+
/** Provider sandbox snapshot id to restore before replaying saved messages. */
|
|
2259
|
+
sandboxSnapshotId?: string;
|
|
2260
|
+
/** Name reported to the underlying Robota agent config. Defaults to 'agent'. */
|
|
2261
|
+
agentName?: string;
|
|
2262
|
+
/** Active preset id selected at startup (PRESET-011 runtime state). Defaults to 'default'. */
|
|
2263
|
+
activePresetId?: string;
|
|
2264
|
+
/** Preset execution capability: activate agent runtime + subagent/background dispatch. */
|
|
2265
|
+
enableParallelSubagents?: boolean;
|
|
2266
|
+
/** Preset execution capability: run a post-task self-verification step. */
|
|
2267
|
+
selfVerification?: boolean;
|
|
2268
|
+
/** Organization policy for enforcing provider restrictions, command blocks, and API key rules. */
|
|
2269
|
+
orgPolicy?: IOrgPolicy;
|
|
2270
|
+
/** Additional tools registered alongside the default CLI tools. */
|
|
2271
|
+
additionalTools?: IToolWithEventService[];
|
|
2272
|
+
/** Request structured output from the provider for this session. */
|
|
2273
|
+
responseFormat?: {
|
|
2274
|
+
type: 'text' | 'json_object';
|
|
2275
|
+
};
|
|
2276
|
+
}
|
|
2277
|
+
/** Test/advanced construction: inject pre-built session directly. */
|
|
2278
|
+
interface IInteractiveSessionInjectedOptions {
|
|
2279
|
+
session: Session;
|
|
2280
|
+
cwd?: string;
|
|
2281
|
+
provider?: IAIProvider;
|
|
2282
|
+
permissionMode?: ICreateSessionOptions['permissionMode'];
|
|
2283
|
+
maxTurns?: number;
|
|
2284
|
+
permissionHandler?: TInteractivePermissionHandler;
|
|
2285
|
+
sessionStore?: IInteractiveSessionStore;
|
|
2286
|
+
sessionName?: string;
|
|
2287
|
+
resumeSessionId?: string;
|
|
2288
|
+
forkSession?: boolean;
|
|
2289
|
+
/** Optional command modules composed into this injected session. */
|
|
2290
|
+
commandModules?: readonly ICommandModule[];
|
|
2291
|
+
/** Host adapters available to composed command modules. */
|
|
2292
|
+
commandHostAdapters?: ICommandHostAdapters;
|
|
2293
|
+
/** TERM-001: transport-provided terminal-handoff capability (see standard options). */
|
|
2294
|
+
terminalHandoff?: ITerminalHandoff;
|
|
2295
|
+
/** CMD-004: transport-provided "ask the user" handler (see standard options). */
|
|
2296
|
+
askHandler?: IUserInteraction['ask'];
|
|
2297
|
+
}
|
|
2298
|
+
/** Union of standard and injected construction options. */
|
|
2299
|
+
type TInteractiveSessionOptions = IInteractiveSessionStandardOptions | IInteractiveSessionInjectedOptions;
|
|
2300
|
+
//#endregion
|
|
2301
|
+
//#region src/interactive/interactive-session-init.d.ts
|
|
2302
|
+
/** Return value of createInteractiveSession — session plus staleness tracking data. */
|
|
2303
|
+
interface ICreatedInteractiveSession {
|
|
2304
|
+
session: Session;
|
|
2305
|
+
/** Per-file entries for AGENTS.md files loaded at startup. Used for staleness detection. */
|
|
2306
|
+
agentsFileEntries: IContextFileEntry[];
|
|
2307
|
+
/** Per-file entries for CLAUDE.md files loaded at startup. Used for staleness detection. */
|
|
2308
|
+
claudeFileEntries: IContextFileEntry[];
|
|
2309
|
+
/**
|
|
2310
|
+
* Rebuilds the system message given updated agentsMd and claudeMd strings. PRESET-014: an
|
|
2311
|
+
* optional `overrides.persona` re-applies a preset persona to the live prompt; PRESET-017: an
|
|
2312
|
+
* optional `overrides.selfVerification` toggles the verify-before-done section. Either override
|
|
2313
|
+
* is retained for subsequent (override-less) rebuilds.
|
|
2314
|
+
*/
|
|
2315
|
+
rebuildSystemMessage: (agentsMd: string, claudeMd: string, overrides?: {
|
|
2316
|
+
persona?: string;
|
|
2317
|
+
selfVerification?: boolean;
|
|
2318
|
+
}) => string;
|
|
2319
|
+
}
|
|
2320
|
+
//#endregion
|
|
2321
|
+
//#region src/interactive/interactive-session-skill-router.d.ts
|
|
2322
|
+
declare class SessionSkillRouter {
|
|
2323
|
+
private readonly getSession;
|
|
2324
|
+
private readonly getSessionId;
|
|
2325
|
+
private readonly onSubmit;
|
|
2326
|
+
private readonly onApplyResult;
|
|
2327
|
+
private readonly recordSkillActivation;
|
|
2328
|
+
private readonly runSkillInFork;
|
|
2329
|
+
/** Called when a fork-context skill needs full lifecycle management (executing flag etc.) */
|
|
2330
|
+
private readonly onForkSkill;
|
|
2331
|
+
/** Called for blocking commands — wraps execution with thinking/executing lifecycle */
|
|
2332
|
+
private readonly onBlockingCommand;
|
|
2333
|
+
private readonly shellExec?;
|
|
2334
|
+
readonly commandExecutor: SystemCommandExecutor;
|
|
2335
|
+
/** Command modules received at construction — retained for live re-selection (PRESET-015). */
|
|
2336
|
+
private readonly allCommandModules;
|
|
2337
|
+
private readonly skillCommandSource;
|
|
2338
|
+
private readonly commandHostAdapters?;
|
|
2339
|
+
private commandInvocationSource;
|
|
2340
|
+
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.) */
|
|
2341
|
+
|
|
2342
|
+
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 */
|
|
2343
|
+
|
|
2344
|
+
onBlockingCommand: (execute: () => Promise<ICommandResult$1>) => Promise<ICommandResult$1>, shellExec?: TShellExecFn | undefined);
|
|
2345
|
+
/** PRESET-015 — re-filter the session's command modules and rebuild the executor live. */
|
|
2346
|
+
reapplyCommandModuleSelection(enabled: readonly string[] | undefined, disabled: readonly string[] | undefined): void;
|
|
2347
|
+
getCommandInvocationSource(): TCommandInvocationSource;
|
|
2348
|
+
getCommandHostAdapters(): ICommandHostAdapters;
|
|
2349
|
+
listCommands(): Array<{
|
|
2350
|
+
name: string;
|
|
2351
|
+
displayName?: string;
|
|
2352
|
+
description: string;
|
|
2353
|
+
example?: string;
|
|
2354
|
+
}>;
|
|
2355
|
+
listSkills(): ICommandSkillListEntry[];
|
|
2356
|
+
listModelInvocableCommands(): Array<{
|
|
2357
|
+
name: string;
|
|
2358
|
+
description: string;
|
|
2359
|
+
}>;
|
|
2360
|
+
findSkillCommand(name: string): ICommand | undefined;
|
|
2361
|
+
executeCommand(name: string, args: string): Promise<ICommandResult$1 | null>;
|
|
2362
|
+
executeCommandWithSource(source: TCommandInvocationSource, command: ISystemCommand, args: string): Promise<ICommandResult$1>;
|
|
2363
|
+
executeModelCommand(name: string, args: string): Promise<ICommandResult$1 | null>;
|
|
2364
|
+
executeSkillCommandByName(name: string, args: string, request: ICommandSkillActivationRequest): Promise<ICommandResult$1 | null>;
|
|
2365
|
+
executeUserResolvedSkillCommand(skill: ICommand, args: string, displayInput: string | undefined, rawInput: string | undefined, invocation: ISkillActivationEvent['invocation']): Promise<ISkillExecutionResult>;
|
|
2366
|
+
executeSkillWithActivation(skill: ICommand, args: string, invocation: ISkillActivationEvent['invocation'], qualifiedName?: string): Promise<ISkillExecutionResult>;
|
|
2367
|
+
private emitSkillActivation;
|
|
2368
|
+
private executeForegroundCommand;
|
|
2369
|
+
}
|
|
2370
|
+
//#endregion
|
|
2371
|
+
//#region src/interactive/interactive-session-execution-controller.d.ts
|
|
2372
|
+
interface IExecutionControllerCallbacks {
|
|
2373
|
+
getSession: () => Session;
|
|
2374
|
+
getSessionOrThrow: () => Session;
|
|
2375
|
+
getCwd: () => string;
|
|
2376
|
+
getContextState: () => IContextWindowState;
|
|
2377
|
+
getExecutionWorkspaceSnapshot: () => IExecutionWorkspaceSnapshot;
|
|
2378
|
+
emit: <E extends string>(event: E, ...args: unknown[]) => void;
|
|
2379
|
+
persistSession: () => void;
|
|
2380
|
+
}
|
|
2381
|
+
/** Options threaded through submit/executePrompt for non-user turns (FLOW-002). */
|
|
2382
|
+
interface ITurnOptions {
|
|
2383
|
+
turnSource?: TTurnSource;
|
|
2384
|
+
/** When set, the in-flight wake for this background task id is cleared on turn completion. */
|
|
2385
|
+
wakeTaskId?: string;
|
|
2386
|
+
}
|
|
2387
|
+
/** A submit callback that optionally carries turn options (default = user turn). */
|
|
2388
|
+
type TSubmitFn = (prompt: string, displayInput?: string, rawInput?: string, options?: ITurnOptions) => Promise<void>;
|
|
2389
|
+
declare class SessionExecutionController {
|
|
2390
|
+
private readonly histTracker;
|
|
2391
|
+
private readonly skillRouter;
|
|
2392
|
+
private readonly callbacks;
|
|
2393
|
+
executing: boolean;
|
|
2394
|
+
streamingText: string;
|
|
2395
|
+
flushTimer: ReturnType<typeof setTimeout> | null;
|
|
2396
|
+
activeTools: IToolState[];
|
|
2397
|
+
pendingPrompt: string | null;
|
|
2398
|
+
pendingDisplayInput: string | undefined;
|
|
2399
|
+
pendingRawInput: string | undefined;
|
|
2400
|
+
pendingTurnOptions: ITurnOptions;
|
|
2401
|
+
shuttingDown: boolean;
|
|
2402
|
+
/** FLOW-002: background task ids with an in-flight wake turn (coalesces duplicate wakes). */
|
|
2403
|
+
readonly wakeTaskIds: Set<string>;
|
|
2404
|
+
constructor(histTracker: SessionHistoryTracker, skillRouter: SessionSkillRouter, callbacks: IExecutionControllerCallbacks);
|
|
2405
|
+
clearPendingQueue(): void;
|
|
2406
|
+
clearStreaming(): void;
|
|
2407
|
+
flushStreaming(): void;
|
|
2408
|
+
handleTextDelta(delta: string): void;
|
|
2409
|
+
handleCompactEvent(event: ICompactEvent): void;
|
|
2410
|
+
handleToolExecution(event: {
|
|
2411
|
+
type: 'start' | 'end';
|
|
2412
|
+
toolName: string;
|
|
2413
|
+
toolArgs?: TToolArgs;
|
|
2414
|
+
success?: boolean;
|
|
2415
|
+
denied?: boolean;
|
|
2416
|
+
toolResultData?: string;
|
|
2417
|
+
executionId?: string;
|
|
2418
|
+
}): void;
|
|
2419
|
+
emitExecutionWorkspaceUpdated(cause: TExecutionWorkspaceUpdateCause, entryId?: string): void;
|
|
2420
|
+
private drainPendingQueue;
|
|
2421
|
+
executePrompt(input: string, displayInput: string | undefined, rawInput: string | undefined, agentsFileEntries: IContextFileEntry[], claudeFileEntries: IContextFileEntry[], rebuildSystemMessage: ICreatedInteractiveSession['rebuildSystemMessage'] | null, setEntries: (agents: IContextFileEntry[], claude: IContextFileEntry[]) => void, submit: TSubmitFn, turnOptions?: ITurnOptions): Promise<void>;
|
|
2422
|
+
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>;
|
|
2423
|
+
executeForegroundCommand(execute: () => Promise<ICommandResult$1>, submit: (p: string, d?: string, r?: string) => Promise<void>): Promise<ICommandResult$1>;
|
|
2424
|
+
applyForkSkillResult(result: string): Promise<void>;
|
|
2425
|
+
}
|
|
2426
|
+
//#endregion
|
|
2427
|
+
//#region src/interactive/interactive-session-base.d.ts
|
|
2428
|
+
declare abstract class InteractiveSessionBase {
|
|
2429
|
+
protected abstract readonly bgTracker: SessionBackgroundTaskTracker;
|
|
2430
|
+
protected abstract readonly histTracker: SessionHistoryTracker;
|
|
2431
|
+
protected abstract readonly skillRouter: SessionSkillRouter;
|
|
2432
|
+
protected abstract readonly execCtrl: SessionExecutionController;
|
|
2433
|
+
protected abstract getSessionOrThrow(): Session;
|
|
2434
|
+
protected abstract ensureInitialized(): Promise<void>;
|
|
2435
|
+
protected abstract getCwd(): string;
|
|
2436
|
+
isExecuting(): boolean;
|
|
2437
|
+
getPendingPrompt(): string | null;
|
|
2438
|
+
getStreamingText(): string;
|
|
2439
|
+
getActiveTools(): SessionExecutionController['activeTools'];
|
|
2440
|
+
cancelQueue(): void;
|
|
2441
|
+
executeCommand(name: string, args: string): Promise<ICommandResult$1 | null>;
|
|
2442
|
+
executeModelCommand(name: string, args: string): Promise<ICommandResult$1 | null>;
|
|
2443
|
+
getCommandInvocationSource(): TCommandInvocationSource;
|
|
2444
|
+
executeSkillCommandByName(name: string, args: string, request: ICommandSkillActivationRequest): Promise<ICommandResult$1 | null>;
|
|
2445
|
+
listCommands(): Array<{
|
|
2446
|
+
name: string;
|
|
2447
|
+
displayName?: string;
|
|
2448
|
+
description: string;
|
|
2449
|
+
example?: string;
|
|
2450
|
+
}>;
|
|
2451
|
+
listSkills(): ICommandSkillListEntry[];
|
|
2452
|
+
listModelInvocableCommands(): Array<{
|
|
2453
|
+
name: string;
|
|
2454
|
+
description: string;
|
|
2455
|
+
}>;
|
|
2456
|
+
getCommandHostAdapters(): ICommandHostAdapters;
|
|
2457
|
+
getSkillActivationEvents(): ISkillActivationEvent[];
|
|
2458
|
+
getContextState(): IContextWindowState;
|
|
2459
|
+
compactContext(instructions?: string): Promise<void>;
|
|
2460
|
+
getFullHistory(): IHistoryEntry[];
|
|
2461
|
+
getMessages(): TUniversalMessage[];
|
|
2462
|
+
listEditCheckpoints(): IEditCheckpointSummary[];
|
|
2463
|
+
inspectEditCheckpoint(checkpointId: string): IEditCheckpointInspection;
|
|
2464
|
+
restoreEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
2465
|
+
rollbackEditCheckpoint(checkpointId: string): Promise<IEditCheckpointRestoreResult>;
|
|
2466
|
+
getUsedMemoryReferences(): IMemoryReference[];
|
|
2467
|
+
recordMemoryEvent(event: IMemoryEvent): void;
|
|
2468
|
+
listContextReferences(): IContextReferenceItem[];
|
|
2469
|
+
addContextReference(path: string): Promise<IContextReferenceAddResult>;
|
|
2470
|
+
removeContextReference(path: string): IContextReferenceRemoveResult;
|
|
2471
|
+
clearContextReferences(): IContextReferenceClearResult;
|
|
2472
|
+
listBackgroundTasks(filter?: IBackgroundTaskListFilter): IBackgroundTaskState[];
|
|
2473
|
+
getBackgroundTask(taskId: string): IBackgroundTaskState | undefined;
|
|
2474
|
+
cancelBackgroundTask(taskId: string, reason?: string): Promise<void>;
|
|
2475
|
+
closeBackgroundTask(taskId: string): Promise<void>;
|
|
2476
|
+
sendBackgroundTask(taskId: string, input: IBackgroundTaskInput): Promise<void>;
|
|
2477
|
+
readBackgroundTaskLog(taskId: string, cursor?: IBackgroundTaskLogCursor): Promise<IBackgroundTaskLogPage>;
|
|
2478
|
+
createBackgroundJobGroup(input: Omit<IBackgroundJobGroupCreateRequest$1, 'parentSessionId'>): IBackgroundJobGroupState$1;
|
|
2479
|
+
listBackgroundJobGroups(): IBackgroundJobGroupState$1[];
|
|
2480
|
+
getBackgroundJobGroup(groupId: string): IBackgroundJobGroupState$1 | undefined;
|
|
2481
|
+
waitBackgroundJobGroup(groupId: string): Promise<IBackgroundJobGroupState$1>;
|
|
2482
|
+
getExecutionWorkspaceSnapshot(options?: IExecutionWorkspaceSnapshotOptions): IExecutionWorkspaceSnapshot;
|
|
2483
|
+
listExecutionWorkspaceEntries(filter?: IExecutionWorkspaceFilter): IExecutionWorkspaceEntry[];
|
|
2484
|
+
getExecutionWorkspaceEntry(entryId: string): IExecutionWorkspaceEntry | undefined;
|
|
2485
|
+
readExecutionWorkspaceDetail(entryId: string, cursor?: IExecutionDetailCursor): Promise<IExecutionDetailPage>;
|
|
2486
|
+
createExecutionWorkspaceTaskSpawner(origin: IExecutionOrigin$1): IExecutionWorkspaceTaskSpawner;
|
|
2487
|
+
listAgentDefinitions(): Array<{
|
|
2488
|
+
name: string;
|
|
2489
|
+
description: string;
|
|
2490
|
+
}>;
|
|
2491
|
+
listAgentJobs(): ISubagentJobState[];
|
|
2492
|
+
spawnAgentJob(input: ISpawnAgentJobInput): Promise<ISubagentJobState>;
|
|
2493
|
+
waitAgentJob(jobId: string): Promise<ISubagentJobResult>;
|
|
2494
|
+
sendAgentJob(jobId: string, prompt: string): Promise<void>;
|
|
2495
|
+
cancelAgentJob(jobId: string, reason?: string): Promise<void>;
|
|
2496
|
+
closeAgentJob(jobId: string): Promise<void>;
|
|
2497
|
+
spawnScheduledWake(input: {
|
|
2498
|
+
label: string;
|
|
2499
|
+
cronExpression: string;
|
|
2500
|
+
agentInstruction: string;
|
|
2501
|
+
}): Promise<IBackgroundTaskState>;
|
|
2502
|
+
spawnMonitorWake(input: {
|
|
2503
|
+
label: string;
|
|
2504
|
+
command: string;
|
|
2505
|
+
matchPattern: string;
|
|
2506
|
+
agentInstruction: string;
|
|
2507
|
+
}): Promise<IBackgroundTaskState>;
|
|
2508
|
+
}
|
|
2509
|
+
//#endregion
|
|
2510
|
+
//#region src/interactive/interactive-session.d.ts
|
|
2511
|
+
interface IInteractiveSessionShutdownOptions {
|
|
2512
|
+
reason?: TSessionEndReason;
|
|
2513
|
+
message?: string;
|
|
2514
|
+
}
|
|
2515
|
+
declare class InteractiveSession extends InteractiveSessionBase implements ISession, IAgentJobHostContext, IInteractiveSession {
|
|
2516
|
+
private session;
|
|
2517
|
+
private readonly listeners;
|
|
2518
|
+
private initialized;
|
|
2519
|
+
private initPromise;
|
|
2520
|
+
private sessionStore?;
|
|
2521
|
+
private sessionName?;
|
|
2522
|
+
private cwd?;
|
|
2523
|
+
private pendingRestoreMessages;
|
|
2524
|
+
private resumeSessionId?;
|
|
2525
|
+
private forkSession;
|
|
2526
|
+
private autoCompactThresholdSource;
|
|
2527
|
+
private shutdownPromise;
|
|
2528
|
+
private readonly sandboxClient?;
|
|
2529
|
+
private sandboxSnapshotId?;
|
|
2530
|
+
private agentsFileEntries;
|
|
2531
|
+
private claudeFileEntries;
|
|
2532
|
+
private rebuildSystemMessage;
|
|
2533
|
+
private providerDefinitions;
|
|
2534
|
+
private orgPolicy;
|
|
2535
|
+
protected readonly bgTracker: SessionBackgroundTaskTracker;
|
|
2536
|
+
protected readonly histTracker: SessionHistoryTracker;
|
|
2537
|
+
protected readonly skillRouter: SessionSkillRouter;
|
|
2538
|
+
protected readonly execCtrl: SessionExecutionController;
|
|
2539
|
+
/** GOAL-001: autonomous objective-pursuit controller (inert until a goal is set). */
|
|
2540
|
+
private readonly goalController;
|
|
2541
|
+
/** GOAL-001: origin of the most recently started turn — gates goal-loop advancement. */
|
|
2542
|
+
private currentTurnSource;
|
|
2543
|
+
/** TERM-001: transport-provided terminal-handoff capability (undefined when none). */
|
|
2544
|
+
private readonly terminalHandoff?;
|
|
2545
|
+
/** CMD-004: transport-provided "ask the user" handler (undefined when no interactive renderer). */
|
|
2546
|
+
private readonly askHandler?;
|
|
2547
|
+
/** TERM-001: guards handoff exclusivity (one handoff at a time). */
|
|
2548
|
+
private terminalHandoffActive;
|
|
2549
|
+
constructor(options: TInteractiveSessionOptions);
|
|
2550
|
+
private configureInjectedSession;
|
|
2551
|
+
private restoreSessionRecordIfNeeded;
|
|
2552
|
+
private startAsyncInitializationIfNeeded;
|
|
2553
|
+
private initializeAsync;
|
|
2554
|
+
protected ensureInitialized(): Promise<void>;
|
|
2555
|
+
protected getSessionOrThrow(): Session;
|
|
2556
|
+
getCwd(): string;
|
|
2557
|
+
get sessionId(): string;
|
|
2558
|
+
on<E extends TInteractiveEventName$1>(event: E, handler: IInteractiveSessionEvents$1[E]): void;
|
|
2559
|
+
off<E extends TInteractiveEventName$1>(event: E, handler: IInteractiveSessionEvents$1[E]): void;
|
|
2560
|
+
private emit;
|
|
2561
|
+
submit(input: string, displayInput?: string, rawInput?: string, options?: ITurnOptions): Promise<void>;
|
|
2562
|
+
/**
|
|
2563
|
+
* FLOW-002: re-enter the agent loop with a non-user turn triggered by a background wake
|
|
2564
|
+
* (a scheduled fire or, later, a monitor match). Coalesces by source task id so repeated
|
|
2565
|
+
* wakes for the same task while one is still in flight collapse to a single turn.
|
|
2566
|
+
*/
|
|
2567
|
+
requestWakeup(instruction: string, sourceTaskId: string): boolean;
|
|
2568
|
+
abort(): void;
|
|
2569
|
+
shutdown(options?: IInteractiveSessionShutdownOptions): Promise<void>;
|
|
2570
|
+
get isInitialized(): boolean;
|
|
2571
|
+
getAutoCompactThresholdSource(): TAutoCompactThresholdSource;
|
|
2572
|
+
getAutoCompactThreshold(): number | false;
|
|
2573
|
+
getSession(): Session;
|
|
2574
|
+
/**
|
|
2575
|
+
* PRESET-014: re-apply a preset persona to the live system prompt. Recomposes the system
|
|
2576
|
+
* message from the currently tracked AGENTS.md/CLAUDE.md entries (the same content the staleness
|
|
2577
|
+
* refresh uses) plus the new persona, then propagates it to the session. No-op before init,
|
|
2578
|
+
* when the rebuild closure is not yet available.
|
|
2579
|
+
*/
|
|
2580
|
+
applyPersona(persona: string): void;
|
|
2581
|
+
/**
|
|
2582
|
+
* PRESET-017: toggle the verify-before-done self-verification section on the live system prompt.
|
|
2583
|
+
* Recomposes the system message from the currently tracked AGENTS.md/CLAUDE.md entries plus the
|
|
2584
|
+
* new selfVerification flag, then propagates it to the session. No-op before init, when the
|
|
2585
|
+
* rebuild closure is not yet available.
|
|
2586
|
+
*/
|
|
2587
|
+
applySelfVerification(enabled: boolean): void;
|
|
2588
|
+
/**
|
|
2589
|
+
* PRESET-015: re-apply a preset's command-module selection to the live session by delegating to
|
|
2590
|
+
* the skill router, which re-filters the session-start module set and rebuilds the executor.
|
|
2591
|
+
*/
|
|
2592
|
+
applyCommandModuleSelection(enabled: readonly string[] | undefined, disabled: readonly string[] | undefined): void;
|
|
2593
|
+
getAgentJobCapability(): IAgentJobHostContext;
|
|
2594
|
+
/**
|
|
2595
|
+
* CMD-004: the injected "ask the user" port, or undefined when no interactive renderer is attached
|
|
2596
|
+
* (headless/automation) — a command must treat absence as "no human available", never a silent
|
|
2597
|
+
* guess. The model-invocation guard lives in {@link createUserInteractionPort}.
|
|
2598
|
+
*/
|
|
2599
|
+
getUserInteraction(): IUserInteraction | undefined;
|
|
2600
|
+
/**
|
|
2601
|
+
* TERM-001: whether the active transport can hand the real terminal to a child process. False
|
|
2602
|
+
* when no handoff capability was injected or its `canHandoffTerminal` is false (e.g. headless).
|
|
2603
|
+
*/
|
|
2604
|
+
canHandoffTerminal(): boolean;
|
|
2605
|
+
/**
|
|
2606
|
+
* TERM-001: suspend the display, run `fn` (which spawns a child with inherited stdio), then
|
|
2607
|
+
* restore. The framework owns the ORCHESTRATION: it enforces exclusivity (one handoff at a time)
|
|
2608
|
+
* and fast-fails when no interactive terminal is available, instead of hanging. The transport
|
|
2609
|
+
* implements the underlying suspend/resume; the caller's `fn` spawns whatever child it wants — the
|
|
2610
|
+
* framework stays platform-neutral and never spawns a shell.
|
|
2611
|
+
*/
|
|
2612
|
+
runWithTerminal<T>(fn: () => Promise<T>): Promise<T>;
|
|
2613
|
+
setAutoCompactThreshold(threshold: TAutoCompactThreshold$1, source?: TAutoCompactThresholdSource): void;
|
|
2614
|
+
clearConversationHistory(): void;
|
|
2615
|
+
getName(): string | undefined;
|
|
2616
|
+
attachTransport(transport: ITransportAdapter<IInteractiveSession>): void;
|
|
2617
|
+
setName(name: string): void;
|
|
2618
|
+
private getBackgroundTaskManager;
|
|
2619
|
+
/**
|
|
2620
|
+
* Surface an error that happened OUTSIDE the turn boundary (background task, catalog
|
|
2621
|
+
* refresh, persistence, un-caught promise) into the conversation (ERR-001 G1). The entry
|
|
2622
|
+
* carries `metadata.kind: 'error'` so transports render it as a styled error block, and the
|
|
2623
|
+
* 'error' event drives transport error state. The session stays fully usable.
|
|
2624
|
+
*/
|
|
2625
|
+
reportBackgroundError(error: Error, source?: string): void;
|
|
2626
|
+
private captureSandboxSnapshot;
|
|
2627
|
+
private persistCurrentSession;
|
|
2628
|
+
/**
|
|
2629
|
+
* GOAL-001: assign an autonomous goal and begin pursuing it. The agent takes follow-up turns
|
|
2630
|
+
* on its own until it signals the goal satisfied or a bound fires (max iterations, no-progress,
|
|
2631
|
+
* or {@link cancelGoal}). Returns the seeded goal state. Throws on an empty objective.
|
|
2632
|
+
*/
|
|
2633
|
+
setGoal(objective: string, options?: IGoalStartOptions): Promise<IGoalState>;
|
|
2634
|
+
/** GOAL-001: the current goal state, or `null` when no goal has been set. */
|
|
2635
|
+
getGoalState(): IGoalState | null;
|
|
2636
|
+
/** GOAL-001: cancel an in-flight goal. Returns the stopped state, or `null` when none is active. */
|
|
2637
|
+
cancelGoal(): IGoalState | null;
|
|
2638
|
+
/** GOAL-001: schedule the next goal-driven turn via the FLOW-002 wakeup primitive. */
|
|
2639
|
+
private scheduleGoalTurn;
|
|
2640
|
+
/** GOAL-001: advance the goal loop after an agent-driven turn completes. */
|
|
2641
|
+
private handleGoalTurnComplete;
|
|
2642
|
+
/** GOAL-001: after a resume, continue pursuing a restored active goal once initialized. */
|
|
2643
|
+
private resumeGoalIfActive;
|
|
2644
|
+
private switchProvider;
|
|
2645
|
+
executeCommand(name: string, args: string): Promise<ICommandResult$1 | null>;
|
|
2646
|
+
}
|
|
2647
|
+
//#endregion
|
|
2648
|
+
//#region src/interactive/session-naming.d.ts
|
|
2649
|
+
/**
|
|
2650
|
+
* Generate a short session title from the first user message using the active provider.
|
|
2651
|
+
* Falls back to a sanitized form of the message when the model returns nothing usable.
|
|
2652
|
+
*/
|
|
2653
|
+
declare function generateSessionName(provider: IAIProvider, firstMessage: string): Promise<string>;
|
|
2654
|
+
//#endregion
|
|
2655
|
+
export { IPreparedSubagentWorktree as $, IBackgroundTaskManager$1 as $a, IMemoryCandidate as $i, updateModelInSettings as $n, applyProviderConfiguration as $r, parseFrontmatter as $t, IAgentExecutorOptions as A, toContextReferenceRecords as Aa, ICapabilityDescriptor as Ai, RESUME_COMMAND_DESCRIPTION as An, ICommandSettingsAdapter as Ao, closeCommandBackgroundTask as Ar, createSystemCommands as At, resolveSessionIdByIdOrName as B, wrapEditCheckpointTools as Ba, ICompactContextResult as Bi, DEFAULT_STATUS_LINE_COMMAND_SETTINGS as Bn, IOrgPolicy as Bo, createProviderFromSettings as Br, IBundlePluginManifest as Bt, evaluateReversibleToolSafety as C, IContextReferenceInventoryLimits as Ca, setCurrentProvider as Ci, rollbackCommandEditCheckpoint as Cn, BackgroundJobOrchestrator as Co, buildLanguageCommandSubcommands as Cr, ISkillExecutionCallbacks as Ct, PromptExecutor as D, createContextReferenceItem as Da, TCommandModuleSessionRequirement as Di, ICommandSessionInfo as Dn, ICommandPermissionModeAdapter as Do, BACKGROUND_COMMAND_USAGE as Dr, TShellExecFn as Dt, IPromptProvider as E, clearContextReferences as Ea, ICommandModule as Ei, EXIT_COMMAND_DESCRIPTION as En, ICommandHostAdapters as Eo, BACKGROUND_COMMAND_DESCRIPTION as Er, ISkillPromptContext as Et, IInteractiveSessionStore as F, IPromptFileReferenceResolveOptions as Fa, ICommandSkillListEntry as Fi, createSessionRenamedEffect as Fn, buildPluginCommandSubcommands as Fo, readCommandBackgroundTaskLog as Fr, IInstalledPluginRecord as Ft, createPromptFileReferenceHistoryEntry as G, IEditCheckpointInspectionPlan as Ga, listCommandContextReferences as Gi, isStatusLineCommandSettingsPatch as Gn, mergeSettings as Gr, PluginSettingsStore as Gt, resolvePromptFileReferences as H, IEditCheckpointFileInspection as Ha, addCommandContextReference as Hi, STATUSLINE_COMMAND_DESCRIPTION as Hn, readProviderSettings as Hr, ILoadedBundlePlugin as Ht, createProjectSessionStore as I, IPromptFileReferenceToken as Ia, IModelReapplyOptions as Ii, formatCommandSessionReplayValidationReport as In, createPluginRegistryReloadRequestedEffect as Io, HELP_COMMAND_DESCRIPTION as Ir, TInstalledPluginsRegistry as It, toPromptFileReferenceRecords as J, IEditCheckpointRestoreResult as Ja, readCommandContextState as Ji, TSettingsScope as Jn, IActiveModelChangeOptions as Jr, IMarketplaceManifest as Jt, formatPromptFileReferenceDiagnostics as K, IEditCheckpointManifest as Ka, readAutoCompactThreshold as Ki, readStatusLineSettings as Kn, readMergedProviderSettingsFromPaths as Kr, IKnownMarketplaceEntry as Kt, createUserSessionStore as L, IResolvedPromptFileReference as La, TAutoCompactThresholdSource as Li, parseSessionNameArgument as Ln, createPluginTuiRequestedEffect as Lo, formatCommandHelpMessage as Lr, MarketplaceClient as Lt, TSessionFactory as M, IPromptFileReferenceDiagnostic as Ma, ICommandHostContext as Mi, clearConversationHistory as Mn, PLUGIN_COMMAND_ARGUMENT_HINT as Mo, formatCommandBackgroundTaskList as Mr, PluginCommandSource as Mt, TInteractivePermissionHandler as N, IPromptFileReferenceHistoryData as Na, ICommandSessionReplayValidationReport as Ni, createSessionExitRequestedEffect as Nn, PLUGIN_COMMAND_DESCRIPTION as No, listCommandBackgroundTasks as Nr, BundlePluginInstaller as Nt, TProviderFactory as O, listActiveContextReferences as Oa, ISystemCommand as Oi, RENAME_COMMAND_DESCRIPTION as On, ICommandPickerAdapter as Oo, buildBackgroundCommandSubcommands as Or, preprocessShellCommands as Ot, TPermissionResultValue as P, IPromptFileReferenceLimits as Pa, ICommandSessionRuntime as Pi, createSessionPickerRequestedEffect as Pn, RELOAD_PLUGINS_COMMAND_DESCRIPTION as Po, parseCommandBackgroundLogCursor as Pr, IBundlePluginInstallerOptions as Pt, storeAgentToolDeps as Q, IBackgroundTaskHandle as Qa, writeAutoCompactThresholdSetting as Qi, resolveSettingsPathForScope as Qn, applyActiveModelChange as Qr, SkillCommandSource as Qt, listResumableSessionSummaries as R, IResolvedPromptFileReferences as Ra, AUTO_COMPACT_THRESHOLD_SETTINGS_KEY as Ri, readCommandSessionInfo as Rn, resolvePluginCommandAdapter as Ro, IReadProviderSettingsOptions as Rr, BundlePluginLoader as Rt, TReversibleSideEffect as S, IContextReferenceClearResult as Sa, mergeProviderPatch as Si, restoreCommandEditCheckpoint as Sn, parseExecutionWorkspaceEntryId as So, TRecommendedResponseLanguage as Sr, IForkExecutionOptions as St, IPromptExecutorOptions as T, IContextReferenceUpsertResult as Ta, validateProviderProfile as Ti, COST_COMMAND_DESCRIPTION as Tn, summarizeBackgroundJobGroup as To, parseLanguageArgument as Tr, executeSkill as Tt, parsePromptFileReferences as U, IEditCheckpointFileRecord as Ua, clearCommandContextReferences as Ui, applyStatusLineSettings as Un, resolveEnvDefaultProvider as Ur, TEnabledPlugins as Ut, resolvePromptFileReferencePaths as V, EditCheckpointStore as Va, TAutoCompactThreshold$1 as Vi, STATUSLINE_COMMAND_ARGUMENT_HINT as Vn, readMergedProviderSettings as Vr, IBundleSkill as Vt, buildPromptWithFileReferences as W, IEditCheckpointInspection as Wa, compactCommandContext as Wi, buildStatusLineCommandSubcommands as Wn, mergeProviders as Wr, IPluginSettings as Wt, createAgentTool as X, IEditCheckpointTurnInput as Xa, resetAutoCompactThresholdSetting as Xi, getUserSettingsPath as Xn, IProviderSettingsWriteTargetOptions as Xr, TKnownMarketplacesRegistry as Xt, IAgentToolDeps as Y, IEditCheckpointSummary as Ya, removeCommandContextReference as Yi, deleteSettings as Yn, IActiveModelChangeResult as Yr, IMarketplacePluginEntry as Yt, retrieveAgentToolDeps as Z, TEditCheckpointFileRestoreAction as Za, setCommandAutoCompactThreshold as Zi, readSettings as Zn, IProviderSwitchOptions as Zr, TMarketplaceSource as Zt, IReversibleToolSafetyInput as _, IGoalSignal as _a, IProviderSetupPatch as _i, REWIND_COMMAND_ARGUMENT_HINT as _n, EXECUTION_ORIGIN_METADATA_KEYS as _o, resolvePermissionModeAdapter as _r, formatEnvReference as _t, TInteractiveSessionOptions as a, IStartupMemory as aa, probeProviderProfile as ai, ICommandProjectMemoryStore as an, TBackgroundTaskIdFactory as ao, PERMISSIONS_COMMAND_DESCRIPTION as ar, ISubagentRunner$1 as at, TReversibleRollbackLayer as b, extractGoalSignal as ba, buildProviderSetupPatch as bi, inspectCommandEditCheckpoint as bn, createExecutionOriginMetadata as bo, LANGUAGE_COMMAND_DESCRIPTION as br, resolveEnvReference as bt, ISubagentPromptOptions as c, ProjectMemoryStore as ca, IProviderProfileNameSuggestionOptions as ci, MEMORY_COMMAND_USAGE as cn, IBackgroundTaskSpawnerGroupRequest as co, VALID_PERMISSION_MODES as cr, ISubagentWorktreePrepareRequest as ct, getSubagentSuffix as d, buildGoalStartPrompt as da, IProviderCommandModuleOptions as di, createCommandPendingMemoryStore as dn, ISpawnAgentTaskRequest as do, formatInvalidPermissionModeMessage as dr, TSubagentRunnerFactory as dt, IMemoryPendingRecord as ea, applyProviderSwitch as ei, BuiltinCommandSource as en, IBackgroundTaskManagerOptions as eo, writeSettings as er, ISubagentJobHandle as et, createDefaultTools as f, GOAL_SIGNAL_TOOL_NAME as fa, IProviderCommandSettingsAdapter as fi, createCommandProjectMemoryStore as fn, ISpawnProcessTaskRequest as fo, isPermissionMode as fr, createInProcessSubagentRunner as ft, IReversibleToolSafetyContext as g, GoalController as ga, IProviderSetupInput as gi, recordCommandMemoryEvent as gn, createExecutionWorkspaceSnapshot as go, readCommandPermissionsState as gr, IAgentDefinition as gt, IReversibleExecutionOptions as h, DEFAULT_GOAL_NO_PROGRESS_LIMIT as ha, IProviderSettingsBuildOptions as hi, listCommandUsedMemoryReferences as hn, createMainThreadDetailPage as ho, readCommandPermissionMode as hr, IResolvedConfig as ht, IInteractiveSession as i, IProjectMemorySummary as ia, checkSettingsFile as ii, ICommandPendingMemoryStore as in, ILimitedOutputCapture as io, IPermissionsCommandState as ir, ISubagentManagerOptions as it, IAgentSession as j, upsertContextReference as ja, IAgentJobHostContext as ji, VALIDATE_SESSION_COMMAND_DESCRIPTION as jn, ICommandSettingsDocument as jo, formatCommandBackgroundTask as jr, SystemCommandExecutor as jt, AgentExecutor as k, removeContextReference as ka, TSystemCommandLifecycle as ki, RENAME_COMMAND_USAGE as kn, ICommandProcessAdapter as ko, cancelCommandBackgroundTask as kr, substituteVariables as kt, assembleSubagentPrompt as l, isMemoryType as la, sanitizeProviderProfileName as li, buildMemoryCommandSubcommands as ln, ICreateExecutionWorkspaceTaskSpawnerOptions as lo, buildPermissionModeSubcommands as lr, IWorktreeSubagentRunnerOptions as lt, ICreateSessionResult as m, DEFAULT_GOAL_MAX_ITERATIONS as ma, IProviderProfileSettings as mi, isCommandMemoryType as mn, createLineDetailPage as mo, parsePermissionModeArgument as mr, createSubagentSession as mt, IInteractiveSessionShutdownOptions as n, IAppendMemoryInput as na, TSettingsCheck as ni, CommandRegistry as nn, IBackgroundTaskStart as no, IPresetApplicationResult as nr, ISubagentJobStart as nt, createSubagentLogger as o, MEMORY_INDEX_MAX_BYTES as oa, testProviderProfileCommand as oi, MEMORY_COMMAND_ARGUMENT_HINT as on, TBackgroundTaskRunnerEvent as oo, PERMISSION_MODE_ARGUMENT_HINT as or, ISubagentSpawnRequest as ot, ICreateSessionOptions as p, createGoalStatusTool as pa, ILegacyProviderSettings as pi, hasSensitiveCommandMemoryContent as pn, createExecutionWorkspaceTaskSpawner as po, listCommandSessionAllowedTools as pr, ISubagentOptions as pt, hasBlockingPromptFileReferenceDiagnostics as q, IEditCheckpointRecorder as qa, readAutoCompactThresholdSource as qi, TSettingsData as qn, resolveActiveProvider as qr, IMarketplaceClientOptions as qt, InteractiveSession as r, IAppendMemoryResult as ra, checkSettingsDocument as ri, ICommandMemoryStores as rn, ICreateLimitedOutputCaptureOptions as ro, applyPresetToSession as rr, ISubagentManager as rt, resolveSubagentLogDir as s, MEMORY_INDEX_MAX_LINES as sa, IProviderProfileNameSuggestionInput as si, MEMORY_COMMAND_DESCRIPTION as sn, TBackgroundTaskTransitionEvent as so, PERMISSION_MODE_COMMAND_DESCRIPTION as sr, ISubagentWorktreeAdapter as st, generateSessionName as t, TMemoryCandidateStatus as ta, resolveProviderSettingsWriteTargetPath as ti, createBuiltinCommandModule as tn, IBackgroundTaskRunner$1 as to, IPresetApplicationOptions as tr, ISubagentJobResult as tt, getForkWorkerSuffix as u, buildGoalContinuationPrompt as ua, suggestProviderProfileName as ui, createCommandMemoryStores as un, IExecutionWorkspaceTaskSpawner as uo, formatCommandPermissionsMessage as ur, IInProcessSubagentRunnerDeps as ut, IReversibleToolSafetyReport as v, IGoalStartOptions as va, TProviderSettingsDocument as vi, REWIND_COMMAND_DESCRIPTION as vn, createBackgroundGroupExecutionEntryId as vo, writeCommandPermissionMode as vr, hasUsableSecretReference as vt, wrapReversibleExecutionTools as w, IContextReferenceRemoveResult as wa, upsertProviderProfile as wi, CLEAR_COMMAND_DESCRIPTION as wn, IBackgroundJobOrchestratorOptions as wo, formatLanguageUsageMessage as wr, ISkillExecutionResult as wt, TReversibleSafetyStatus as x, IContextReferenceAddResult as xa, deleteProviderProfile as xi, listCommandEditCheckpoints as xn, createMainThreadExecutionEntryId as xo, RECOMMENDED_RESPONSE_LANGUAGES as xr, ISkillActivationHistoryData as xt, TReversibleExecutionIsolation as y, TGoalDecision as ya, buildProviderProfile as yi, buildRewindCommandSubcommands as yn, createBackgroundTaskExecutionEntryId as yo, LANGUAGE_COMMAND_ARGUMENT_HINT as yr, isEnvReference as yt, resolveLatestSessionId as z, TPromptFileReferenceDiagnosticCode as za, DEFAULT_AUTO_COMPACT_THRESHOLD as zi, validateCommandSessionReplayLog as zn, ICommandResult$1 as zo, ProviderConfigError as zr, IBundlePluginFeatures as zt };
|
|
2656
|
+
//# sourceMappingURL=index-BeYNnJed.d.ts.map
|