@gencode/agents 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { S as AgentsConfig, _ as saveAgentsConfig, a as listAgents, b as AgentConfig, c as normalizeAgentId, d as resolveAgentDir, f as resolveAgentIdByBinding, g as resolveModelString, h as resolveModelFallbacks, i as getAgentConfig, l as removeAgent, m as resolveDefaultAgentId, n as addBinding, o as listBindings, p as resolveAgentsConfigPath, s as loadAgentsConfig, t as addAgent, u as removeBindings, v as updateAgentIdentity, x as AgentModelConfig, y as AgentBinding } from "./index-pXTy2jgd.js";
2
2
  import * as _gencode_shared0 from "@gencode/shared";
3
3
  import { AgentCustomProgressEvent, AgentProgressEvent, AgentProgressEvent as AgentProgressEvent$1, AgentProgressEvent as AgentProgressEvent$2, CallbackEventPayload, CallbackEventPayload as CallbackEventPayload$1, Channel, Channel as Channel$1, CollapseSpan, HitlCheckpoint, HitlCheckpoint as HitlCheckpoint$1, HitlHistoryEntry, HitlRequest, HitlRequest as HitlRequest$1, HitlResolution, HitlResolution as HitlResolution$1, HitlStatus, HitlToolContext, HitlToolContext as HitlToolContext$1, ModelUsageCheckpoint, PausedRunState, PausedRunState as PausedRunState$1, ReadStateRecord, RunResultPayload, RunResultPayload as RunResultPayload$1, SessionContextSnapshot, SessionMemorySnapshot, SessionMetadata, SessionMetadata as SessionMetadata$1, SessionSummary, SessionSummary as SessionSummary$1, SnipRecord, ToolResultReference, UiToolExtra, UiToolOutputSchema, UiToolPausedState, UiToolRequest, UiToolResult, UiToolValidationResult } from "@gencode/shared";
4
- import { AssistantMessage, Message } from "@mariozechner/pi-ai";
5
4
  import { AgentMessage, AgentTool } from "@mariozechner/pi-agent-core";
5
+ import { AssistantMessage, Message } from "@mariozechner/pi-ai";
6
6
 
7
7
  //#region src/loop-detection/tool-loop-detection.d.ts
8
8
  type ToolLoopDetectionConfig = {
@@ -168,9 +168,11 @@ declare function buildSkillsPrompt(skills: Skill[]): string;
168
168
  //#region src/agents/definitions.d.ts
169
169
  declare const SYSTEM_AGENTS_DIR = "/aimax/agents";
170
170
  type AgentConfigSource = "system" | "user" | "project";
171
+ type AgentVisibility = "public" | "internal";
171
172
  type AgentDefinition = {
172
173
  name: string;
173
174
  description: string;
175
+ visibility?: AgentVisibility;
174
176
  tools?: string[];
175
177
  disallowedTools?: string[];
176
178
  model?: string;
@@ -190,30 +192,99 @@ type AgentDirectoryCandidate = {
190
192
  dir: string;
191
193
  source: AgentConfigSource;
192
194
  };
193
- type AgentRuntimePolicy = {
195
+ type AgentRuntimePolicy = AgentDefinitionsContext & {
196
+ activeAgent?: AgentDefinition;
197
+ requestedAgentName?: string;
198
+ };
199
+ type AgentRuntimePolicyInput = Partial<AgentDefinitionsContext> & {
194
200
  activeAgent?: AgentDefinition;
195
- availableAgents?: AgentDefinition[];
196
201
  requestedAgentName?: string;
197
202
  };
203
+ type AgentDefinitionsStats = {
204
+ total: number;
205
+ public: number;
206
+ internal: number;
207
+ };
208
+ type AgentDefinitionsContext = {
209
+ allAgents: AgentDefinition[];
210
+ availableAgents: AgentDefinition[];
211
+ findPublic(name: string | undefined): AgentDefinition | undefined;
212
+ findAny(name: string | undefined): AgentDefinition | undefined;
213
+ stats(): AgentDefinitionsStats;
214
+ };
198
215
  declare function agentDirCandidates(options: AgentScanOptions): AgentDirectoryCandidate[];
199
216
  declare function scanAgentDefinitions(options: AgentScanOptions): Promise<AgentDefinition[]>;
217
+ declare function createAgentDefinitionsContext(params?: {
218
+ allAgents?: AgentDefinition[];
219
+ availableAgents?: AgentDefinition[];
220
+ }): AgentDefinitionsContext;
221
+ declare function resolveAgentDefinitionsContext(options: AgentScanOptions & {
222
+ agentPolicy?: AgentRuntimePolicyInput;
223
+ }): Promise<AgentDefinitionsContext>;
200
224
  declare function loadAgentDefinitionsFromDir(dir: string, source: AgentConfigSource): Promise<AgentDefinition[]>;
201
225
  declare function parseAgentDefinition(content: string, options: {
202
226
  sourcePath: string;
203
227
  source: AgentConfigSource;
204
228
  }): AgentDefinition | undefined;
205
- declare function findAgentDefinition(agents: AgentDefinition[], name: string | undefined): AgentDefinition | undefined;
229
+ declare function findAgentDefinition(agents: AgentDefinition[], name: string | undefined, options?: {
230
+ includeInternal?: boolean;
231
+ }): AgentDefinition | undefined;
232
+ declare function agentVisibility(agent: AgentDefinition): AgentVisibility;
233
+ declare function publicAgentDefinitions(agents: AgentDefinition[]): AgentDefinition[];
206
234
  declare function filterSkillsForAgent(skills: Skill[], agent?: AgentDefinition): Skill[];
207
235
  declare function filterToolsForAgent(tools: AgentTool[], agent?: AgentDefinition): AgentTool[];
208
236
  declare function buildAgentDelegationPrompt(agents: AgentDefinition[]): string;
209
237
  declare function buildAgentTaskPrompt(agent: AgentDefinition, task: string): string;
210
238
  //#endregion
239
+ //#region src/session/session-storage.d.ts
240
+ /**
241
+ * Unified session storage layer.
242
+ *
243
+ * When encryption is enabled, all session file content is encrypted at rest
244
+ * using AES-GCM. The on-disk envelope is designed to be readable from both
245
+ * Node and browser Web Crypto implementations.
246
+ */
247
+ declare const DEFAULT_SESSION_ENCRYPTION_KEY = "aimax-session-default-key-v1";
248
+ type SessionEncryptionKey = {
249
+ keyId: string;
250
+ secret: string;
251
+ };
252
+ type SessionEncryptionConfig = {
253
+ primaryKeyId: string;
254
+ keys: SessionEncryptionKey[];
255
+ };
256
+ declare function createSessionEncryptionConfig(primarySecret?: string, legacySecrets?: string[]): SessionEncryptionConfig;
257
+ declare function setDefaultSessionEncryptionConfig(config?: SessionEncryptionConfig): void;
258
+ declare function getDefaultSessionEncryptionConfig(): SessionEncryptionConfig;
259
+ declare function encryptContent(plain: string, config?: SessionEncryptionConfig): string;
260
+ declare function decryptContent(raw: string, config?: SessionEncryptionConfig): string;
261
+ declare function isEncryptedContent(raw: string): boolean;
262
+ declare function readSessionFile(filePath: string, encryptionConfig?: SessionEncryptionConfig): Promise<string | null>;
263
+ declare function writeSessionFile(filePath: string, content: string, encrypt?: boolean, encryptionConfig?: SessionEncryptionConfig): Promise<void>;
264
+ declare function appendSessionFile(filePath: string, line: string, encrypt?: boolean, encryptionConfig?: SessionEncryptionConfig): Promise<void>;
265
+ declare function atomicWriteSessionFile(filePath: string, content: string, encrypt?: boolean, encryptionConfig?: SessionEncryptionConfig): Promise<void>;
266
+ declare function readSessionFileContent(filePath: string, encryptionConfig?: SessionEncryptionConfig): Promise<string | null>;
267
+ //#endregion
211
268
  //#region src/types.d.ts
212
269
  /** Context injected when this run is itself a subagent */
213
270
  type SubagentContext = {
214
271
  /** Nesting depth of this run (root = 0, first child = 1, …) */depth: number; /** Session ID of the parent that spawned this subagent */
215
272
  parentSessionId: string;
216
273
  };
274
+ type AutoSkillReviewMode = "off" | "gate" | "dry_run" | "write";
275
+ type AutoSkillReviewReasonCode = "tool_call_volume" | "tool_diversity" | "state_changing_tools" | "tool_errors" | "multi_turn";
276
+ type AutoSkillReviewGateScope = "session" | "currentRun" | "reviewWindow";
277
+ type AutoSkillReviewGateRuleConfig = {
278
+ enabled: false;
279
+ min?: number;
280
+ toolNames?: string[];
281
+ } | {
282
+ enabled?: true;
283
+ min: number;
284
+ toolNames?: string[];
285
+ };
286
+ type AutoSkillReviewGateConfig = Partial<Record<AutoSkillReviewReasonCode, number | AutoSkillReviewGateRuleConfig>>;
287
+ type AutoSkillReviewGatesConfig = Partial<Record<AutoSkillReviewGateScope, AutoSkillReviewGateConfig>>;
217
288
  type SessionPathScope = {
218
289
  subagent?: {
219
290
  parentSessionId: string;
@@ -227,7 +298,8 @@ type SessionPathScope = {
227
298
  };
228
299
  type AgentRunParamsBase = {
229
300
  /** User data directory path (e.g. /data/user1) */dataDir: string; /** Optional current project directory used as the default cwd context for repository/code work. */
230
- projectDir?: string; /** The .aimax child directory used to persist session state; defaults to "sessions". */
301
+ projectDir?: string; /** Optional system-level agent definition directory; defaults to /aimax/agents. */
302
+ systemAgentsDir?: string; /** The .aimax child directory used to persist session state; defaults to "sessions". */
231
303
  sessionStoreName?: string; /** Optional nested path scope for session state, used for subagent-owned sessions. */
232
304
  sessionPathScope?: SessionPathScope; /** Session ID to resume; if omitted, a new session is created */
233
305
  sessionId?: string; /** Message ID for correlating events */
@@ -237,7 +309,8 @@ type AgentRunParamsBase = {
237
309
  /** vLLM/OpenAI-compatible API base URL */baseUrl: string;
238
310
  apiKey: string;
239
311
  model: string; /** Context window size; defaults to 200000 */
240
- contextWindow?: number; /** Flash model for lightweight tasks (e.g. title generation) */
312
+ contextWindow?: number; /** Maximum number of tokens for LLM output; defaults to 32768 */
313
+ maxTokens?: number; /** Flash model for lightweight tasks (e.g. title generation) */
241
314
  flashModel?: string;
242
315
  }; /** In-process progress callback */
243
316
  onProgress?: (event: AgentProgressEvent$1) => Promise<void>; /** Execution timeout in milliseconds; defaults to 600000 (10 min) */
@@ -266,7 +339,9 @@ type AgentRunParamsBase = {
266
339
  * Additional skill registry directories supplied by the CLI.
267
340
  * Each directory contains skill child directories such as <dir>/<skill-name>/SKILL.md.
268
341
  */
269
- skillsLoadPaths?: string[]; /** Memory system options (optional) */
342
+ skillsLoadPaths?: string[]; /** Whether to encrypt session data at rest using AES-GCM. */
343
+ encryptSessions?: boolean; /** Optional explicit encryption key ring used for session data at rest. */
344
+ sessionEncryption?: SessionEncryptionConfig; /** Memory system options (optional) */
270
345
  memory?: {
271
346
  /** Explicit memory provider id (overrides plugins.slots.memory) */providerId?: string; /** Explicit plugin id for memory provider (used when providerId not set) */
272
347
  pluginId?: string; /** Whether memory replies should include source path/line hints */
@@ -275,6 +350,16 @@ type AgentRunParamsBase = {
275
350
  messaging?: {
276
351
  enabled?: boolean; /** Human-readable configured channel list */
277
352
  channels?: string[];
353
+ }; /** Internal auto-skill controls. CLI wiring is intentionally separate. */
354
+ autoSkills?: {
355
+ load?: {
356
+ /** Defaults to false. When false, the main agent cannot see or load learned auto-skills. */enabled?: boolean;
357
+ };
358
+ review?: {
359
+ /** Defaults to "write": run post-run auto-skill review when gates pass unless explicitly disabled. */mode?: AutoSkillReviewMode; /** Defaults to 1. Hard cap for review attempts that complete per session. */
360
+ maxReviewsPerSession?: number; /** Scope-based all-AND gates for session, current run, and review window statistics. */
361
+ gates?: AutoSkillReviewGatesConfig;
362
+ };
278
363
  };
279
364
  /**
280
365
  * Maximum number of recent user turns to include in context.
@@ -282,7 +367,7 @@ type AgentRunParamsBase = {
282
367
  * 0 or undefined means no limit.
283
368
  */
284
369
  historyLimit?: number; /** Internal multi-agent prompt/model/tool policy resolved at run time. */
285
- agentPolicy?: AgentRuntimePolicy;
370
+ agentPolicy?: AgentRuntimePolicyInput;
286
371
  };
287
372
  /** Parameters for running an agent session */
288
373
  type AgentRunParams = AgentRunParamsBase & ({
@@ -870,7 +955,9 @@ declare function runAgent(params: AgentRunParams, _registryForTesting?: Subagent
870
955
  //#region src/session/session.d.ts
871
956
  declare const DEFAULT_SESSION_STORE_NAME = "sessions";
872
957
  type SessionPathOptions = {
873
- storeName?: string;
958
+ storeName?: string; /** Whether session data should be encrypted at rest. */
959
+ encryptSessions?: boolean; /** Optional explicit encryption key ring used for session file reads/writes. */
960
+ sessionEncryption?: SessionEncryptionConfig;
874
961
  subagent?: {
875
962
  parentSessionId: string;
876
963
  /**
@@ -926,8 +1013,12 @@ type ArtifactOperationInput = {
926
1013
  sourceFile?: string;
927
1014
  content: string;
928
1015
  toolCallId: string;
929
- toolName: string;
1016
+ toolName: string; /** Whether this operation was performed by the agent itself or a subagent */
1017
+ source: "agent" | "subagent"; /** The session that actually performed this operation */
1018
+ sessionId: string;
930
1019
  };
1020
+ /** Operation shape that tool implementations provide before the recorder enriches it with source/sessionId. */
1021
+ type ArtifactOpInput = Omit<ArtifactOperationInput, "source" | "sessionId">;
931
1022
  type ArtifactOperation = ArtifactOperationInput & {
932
1023
  timestamp: string;
933
1024
  truncated: boolean;
@@ -1295,6 +1386,95 @@ declare function resolveMemoryProvider(params: {
1295
1386
  } | null;
1296
1387
  declare function resetMemoryProviderRegistryForTests(): void;
1297
1388
  //#endregion
1389
+ //#region src/auto-skills/paths.d.ts
1390
+ declare function autoSkillsDir(dataDir: string): string;
1391
+ //#endregion
1392
+ //#region src/auto-skills/types.d.ts
1393
+ type AutoSkillSource = "auto";
1394
+ type AutoSkillStatus = "active" | "archived";
1395
+ type AutoSkillCategory = {
1396
+ path: string;
1397
+ name: string;
1398
+ description: string;
1399
+ createdBy?: string;
1400
+ };
1401
+ type AutoSkillIndexEntry = {
1402
+ skillId: string;
1403
+ name: string;
1404
+ description: string;
1405
+ categoryPath: string;
1406
+ source: AutoSkillSource;
1407
+ status: AutoSkillStatus;
1408
+ rootDir: string;
1409
+ skillDir: string;
1410
+ skillFile: string;
1411
+ metadataFile?: string;
1412
+ tags: string[];
1413
+ relatedSkills: string[];
1414
+ confidence?: number;
1415
+ createdAt?: string;
1416
+ updatedAt?: string;
1417
+ };
1418
+ type AutoSkillListItem = {
1419
+ skillId: string;
1420
+ name: string;
1421
+ description: string;
1422
+ categoryPath: string;
1423
+ source: AutoSkillSource;
1424
+ };
1425
+ type AutoSkillSearchResult = AutoSkillListItem & {
1426
+ score: number;
1427
+ };
1428
+ type AutoSkillViewResult = AutoSkillListItem & {
1429
+ status: AutoSkillStatus;
1430
+ content: string;
1431
+ path: string;
1432
+ skillDir: string;
1433
+ filePath?: string;
1434
+ tags?: string[];
1435
+ relatedSkills?: string[];
1436
+ };
1437
+ type AutoSkillsLoaderOptions = {
1438
+ dataDir?: string;
1439
+ rootDir?: string;
1440
+ includeArchived?: boolean;
1441
+ maxSkillBytes?: number;
1442
+ maxResourceBytes?: number;
1443
+ };
1444
+ type AutoSkillListOptions = {
1445
+ categoryPath?: string;
1446
+ recursive?: boolean;
1447
+ };
1448
+ type AutoSkillSearchOptions = {
1449
+ query: string;
1450
+ limit?: number;
1451
+ };
1452
+ type AutoSkillViewOptions = {
1453
+ skillId: string;
1454
+ filePath?: string;
1455
+ };
1456
+ //#endregion
1457
+ //#region src/auto-skills/loader.d.ts
1458
+ declare function createAutoSkillsLoader(options: AutoSkillsLoaderOptions): AutoSkillsLoader;
1459
+ declare class AutoSkillsLoader {
1460
+ readonly rootDir: string;
1461
+ private readonly includeArchived;
1462
+ private readonly maxSkillBytes;
1463
+ private readonly maxResourceBytes;
1464
+ constructor(options: AutoSkillsLoaderOptions);
1465
+ autoSkillCategories(): Promise<AutoSkillCategory[]>;
1466
+ autoSkillList(options?: AutoSkillListOptions): Promise<AutoSkillListItem[]>;
1467
+ autoSkillSearch(options: AutoSkillSearchOptions): Promise<AutoSkillSearchResult[]>;
1468
+ autoSkillView(options: AutoSkillViewOptions): Promise<AutoSkillViewResult>;
1469
+ loadIndex(): Promise<AutoSkillIndexEntry[]>;
1470
+ private loadIndexState;
1471
+ private parseEntriesFromManifest;
1472
+ private visibleEntries;
1473
+ private visibleEntriesFrom;
1474
+ private optionsHash;
1475
+ private loadEntry;
1476
+ }
1477
+ //#endregion
1298
1478
  //#region src/commands/types.d.ts
1299
1479
  type SlashCommandSpec = {
1300
1480
  name: string;
@@ -1325,6 +1505,7 @@ type SystemPromptParams = {
1325
1505
  };
1326
1506
  toolNames?: string[];
1327
1507
  toolSummaries?: Record<string, string>;
1508
+ autoSkillCategories?: AutoSkillCategory[];
1328
1509
  promptMode?: PromptMode;
1329
1510
  bootstrapWarnings?: string[];
1330
1511
  memoryCitationsMode?: MemoryCitationsMode;
@@ -1747,7 +1928,7 @@ declare function createProcessTool(options: ProcessToolOptions): AgentTool<typeo
1747
1928
  declare function createBashTool(workspaceDir: string): AgentTool;
1748
1929
  //#endregion
1749
1930
  //#region src/tools/files.d.ts
1750
- type ArtifactRecorder = (operation: ArtifactOperationInput) => Promise<void>;
1931
+ type ArtifactRecorder = (operation: ArtifactOpInput) => Promise<void>;
1751
1932
  declare const readFileSchema: TObject<{
1752
1933
  path: TString;
1753
1934
  offset: TOptional<TNumber>;
@@ -1797,7 +1978,7 @@ declare const applyPatchSchema: TObject<{
1797
1978
  type ApplyPatchToolOptions = {
1798
1979
  sessionId?: string;
1799
1980
  hitlResume?: AgentRunParams["hitlResume"];
1800
- artifactRecorder?: (operation: ArtifactOperationInput) => Promise<void>;
1981
+ artifactRecorder?: (operation: ArtifactOpInput) => Promise<void>;
1801
1982
  };
1802
1983
  declare function createApplyPatchTool(workspaceDir: string, options?: ApplyPatchToolOptions): AgentTool<typeof applyPatchSchema, ApplyPatchDetails>;
1803
1984
  //#endregion
@@ -1858,6 +2039,43 @@ declare function createSkillLoadTool(params: {
1858
2039
  reportSkillUsed?: SkillUsedReporter;
1859
2040
  }): AgentTool<typeof skillLoadSchema, SkillLoadToolResult>;
1860
2041
  //#endregion
2042
+ //#region src/tools/auto-skills.d.ts
2043
+ declare const autoSkillCategoriesSchema: TObject<{}>;
2044
+ declare const autoSkillListSchema: TObject<{
2045
+ categoryPath: TOptional<TString>;
2046
+ recursive: TOptional<TBoolean>;
2047
+ }>;
2048
+ declare const autoSkillSearchSchema: TObject<{
2049
+ query: TString;
2050
+ limit: TOptional<TNumber>;
2051
+ }>;
2052
+ declare const autoSkillViewSchema: TObject<{
2053
+ skillId: TString;
2054
+ filePath: TOptional<TString>;
2055
+ }>;
2056
+ type AutoSkillCategoriesToolResult = {
2057
+ categories: AutoSkillCategory[];
2058
+ count: number;
2059
+ error?: string;
2060
+ };
2061
+ type AutoSkillListToolResult = {
2062
+ skills: AutoSkillListItem[];
2063
+ count: number;
2064
+ error?: string;
2065
+ };
2066
+ type AutoSkillSearchToolResult = {
2067
+ skills: AutoSkillSearchResult[];
2068
+ count: number;
2069
+ error?: string;
2070
+ };
2071
+ type AutoSkillViewToolResult = Partial<AutoSkillViewResult> & {
2072
+ error?: string;
2073
+ };
2074
+ declare function createAutoSkillCategoriesTool(dataDir: string): AgentTool<typeof autoSkillCategoriesSchema, AutoSkillCategoriesToolResult>;
2075
+ declare function createAutoSkillListTool(dataDir: string): AgentTool<typeof autoSkillListSchema, AutoSkillListToolResult>;
2076
+ declare function createAutoSkillSearchTool(dataDir: string): AgentTool<typeof autoSkillSearchSchema, AutoSkillSearchToolResult>;
2077
+ declare function createAutoSkillViewTool(dataDir: string): AgentTool<typeof autoSkillViewSchema, AutoSkillViewToolResult>;
2078
+ //#endregion
1861
2079
  //#region src/tools/image.d.ts
1862
2080
  declare const imageSchema: TObject<{
1863
2081
  image: TString;
@@ -1875,10 +2093,12 @@ declare function createImageTool(): AgentTool<typeof imageSchema, ImageResult>;
1875
2093
  declare const spawnTaskSchema: TObject<{
1876
2094
  task: TString;
1877
2095
  label: TOptional<TString>;
2096
+ agent: TOptional<TString>;
1878
2097
  }>;
1879
2098
  declare const spawnSchema: TObject<{
1880
2099
  task: TString;
1881
2100
  label: TOptional<TString>;
2101
+ agent: TOptional<TString>;
1882
2102
  }>;
1883
2103
  declare const batchSpawnSchema: TObject<{
1884
2104
  tasks: TArray<typeof spawnTaskSchema>;
@@ -1911,7 +2131,7 @@ type BatchSpawnResult = {
1911
2131
  status: "done" | "partial_error" | "error";
1912
2132
  results: BatchSpawnItemResult[];
1913
2133
  };
1914
- type InheritedRunParams = Pick<AgentRunParams, "plugins" | "skillsLoadPaths" | "memory" | "messaging" | "historyLimit" | "onProgress" | "messageId" | "sessionStoreName" | "agentPolicy">;
2134
+ type InheritedRunParams = Pick<AgentRunParams, "plugins" | "skillsLoadPaths" | "memory" | "messaging" | "historyLimit" | "onProgress" | "messageId" | "sessionStoreName" | "autoSkills" | "agentPolicy" | "sessionEncryption">;
1915
2135
  /** Formats the announce message injected into the parent session when a subagent completes. */
1916
2136
  declare function buildSubagentAnnounceMessage(params: {
1917
2137
  task: string;
@@ -2043,11 +2263,10 @@ declare function isUiToolPauseSignal(error: unknown): error is UiToolPauseSignal
2043
2263
  type SubagentToolsContext = {
2044
2264
  sessionId: string;
2045
2265
  /**
2046
- * Runtime-local session id for artifacts and other tool side files.
2047
- * Usually the same as `sessionId`; in subagent runs, `sessionId` may point
2048
- * to the parent interaction session while this remains the child run session.
2266
+ * Runtime-local session id, used to record which session actually performed
2267
+ * an artifact operation. Always refers to the currently executing session.
2049
2268
  */
2050
- currentSessionId?: string;
2269
+ runtimeSessionId?: string;
2051
2270
  /**
2052
2271
  * Absolute filesystem path of the current (spawning) session's directory.
2053
2272
  * Passed to createSubagentSpawnTool so it can correctly nest child sessions
@@ -2059,8 +2278,9 @@ type SubagentToolsContext = {
2059
2278
  depth: number;
2060
2279
  channel: AgentRunParams["channel"];
2061
2280
  llm: AgentRunParams["llm"];
2062
- inheritedRunParams?: Pick<AgentRunParams, "plugins" | "skillsLoadPaths" | "memory" | "messaging" | "historyLimit" | "onProgress" | "messageId" | "sessionStoreName" | "agentPolicy">;
2281
+ inheritedRunParams?: Pick<AgentRunParams, "plugins" | "skillsLoadPaths" | "memory" | "messaging" | "historyLimit" | "onProgress" | "messageId" | "sessionStoreName" | "autoSkills" | "agentPolicy" | "sessionEncryption">;
2063
2282
  loopDetection?: ToolLoopDetectionConfig;
2283
+ autoSkillsLoadEnabled?: boolean;
2064
2284
  memoryOptions?: MemoryToolOptions;
2065
2285
  pluginSkillDirs?: string[];
2066
2286
  skillsLoadPaths?: string[];
@@ -2529,4 +2749,4 @@ declare function formatClarifyResolution(resolution: HitlResolution): string;
2529
2749
  declare function formatReviewResolution(resolution: HitlResolution): string;
2530
2750
  declare function buildResumeNarration(resolution: HitlResolution, kind: string): string;
2531
2751
  //#endregion
2532
- export { AgentBinding, AgentConfig, type AgentConfigSource, type AgentCustomProgressEvent, type AgentDefinition, type AgentDirectoryCandidate, AgentModelConfig, type AgentProgressEvent, type AgentRunParams, type AgentRunResult, type AgentRuntimePolicy, type AgentScanOptions, AgentsConfig, type ArtifactOperation, type ArtifactOperationInput, type ArtifactOperationName, type ArtifactOperationType, BOOTSTRAP_FILE_NAMES, BOOTSTRAP_MAX_CHARS, BOOTSTRAP_TOTAL_MAX_CHARS, type BootstrapContextFile, type BootstrapEnsureResult, type BootstrapFile, type BootstrapMountResult, type BootstrapMountStatus, type CallbackEventPayload, type CallbackPayload, type Channel, type ContextManager, type CronExecutionRecord, DEFAULT_SESSION_STORE_NAME, type EmbeddingProvider, type EmbeddingProviderContext, type EmbeddingProviderFactory, type EmbeddingProviderRegistration, HITL_MESSAGES, type HitlPauseContext, HitlPauseSignal, type HitlToolContext, MAX_ARTIFACT_CONTENT_CHARS, MAX_CHILDREN_PER_SESSION, MAX_SUBAGENT_DEPTH, type MemoryCallOptions, type MemoryChangeSource, type MemoryChangedEvent, type MemoryChangedHandler, MemoryIndexManager, type MemoryProvider, type MemoryProviderContext, type MemoryProviderFactory, type MemoryProviderRegistration, type MemoryProviderStatus, type MemoryRebuildSummary, type MemorySearchOptions, type MemorySearchResult, type NormalizedPluginsConfig, PLUGIN_MANIFEST_FILENAME, PLUGIN_MANIFEST_FILENAMES, type PersistedSubagentRunRecord, type PersistedToolResult, type PluginApi, type PluginCandidate, type PluginConfigUiHint, type PluginCustomProgressInput, type PluginDiagnostic, type PluginDiscoveryOptions, type PluginDiscoveryResult, type PluginEntryConfig, type PluginExecutionRuntime, type PluginHookAfterCompactionEvent, type PluginHookAfterPromptBuildEvent, type PluginHookAfterToolCallEvent, type PluginHookAgentContext, type PluginHookAgentEndEvent, type PluginHookAssistantMessageEndEvent, type PluginHookBeforeCompactionEvent, type PluginHookBeforeCompactionResult, type PluginHookBeforeModelResolveEvent, type PluginHookBeforeModelResolveResult, type PluginHookBeforePromptBuildEvent, type PluginHookBeforePromptBuildResult, type PluginHookBeforeToolCallEvent, type PluginHookBeforeToolCallResult, type PluginHookDreamGateEvent, type PluginHookDreamGateResult, type PluginHookHandlerMap, type PluginHookLlmInputEvent, type PluginHookLlmOutputEvent, type PluginHookMemoryChangedEvent, type PluginHookName, PluginHookRegistry, type PluginHookSessionEndEvent, type PluginHookSessionResetEvent, type PluginHookSessionStartEvent, type PluginKind, type PluginManifest, type PluginManifestLoadResult, type PluginManifestRegistry, type PluginOrigin, type PluginProgressEmitter, type PluginRecord, type PluginRegistry, type PluginRuntime, type PluginRuntimeContext, type PluginSystem, type PluginSystemOptions, type PluginToolOptions, PluginToolRegistry, type PluginUiToolDescriptor, type PluginUiToolOptions, type PluginsConfig, type PluginsConfigValidationResult, type RegisteredPluginTool, type ResumeOptions, type ResumeValidationResult, type RunResultPayload, SYSTEM_AGENTS_DIR, type SessionContextStore, type SessionExport, type SessionInspection, type SessionMetadata, type SessionMetadataUpdate, type SessionSummary, type Skill, type SkillDirectory, type SkillViewResult, type SlashCommandList, type SubagentContext, SubagentRegistry, type SubagentRunRecord, type SubagentStatus, type SubagentToolsContext, type SystemPromptParams, type ToolLoopDetectionConfig, type TranscriptEntry, type UiToolInputSchema, type UiToolOptions, UiToolPauseSignal, addAgent, addBinding, agentDirCandidates, aimaxDir, appendArtifactOperation, appendCronExecutionRecord, appendRecentToMemory, appendToMemory, appendTranscriptEntry, approvalSummaryFromResolution, artifactsPath, bootstrapMountLayout, buildAgentDelegationPrompt, buildAgentTaskPrompt, buildBootstrapContextFiles, buildResumeNarration, buildSkillsPrompt, buildSubagentAnnounceMessage, buildSystemPrompt, cleanupOldSubagentRecords, clearPendingHitl, clearPendingUiTool, collapseLogPath, contextSnapshotPath, createAgentTools, createApplyPatchTool, createBashTool, createBatchSubagentSpawnTool, createBuiltinMemoryProvider, createContextManager, createEditFileTool, createExecTool, createImageTool, createListDirTool, createMemoryAppendTool, createMemoryForgetTool, createMemoryGetTool, createMemoryListTool, createMemoryLogTool, createMemorySearchTool, createMemoryUpdateTool, createMemoryWriteTool, createPendingHitl, createPendingUiTool, createPluginProgressEmitter, createPluginRuntime, createProcessTool, createReadFileTool, createSession, createSessionContextStore, createSessionSearchTool, createSkillListTool, createSkillLoadTool, createSubagentSpawnTool, createSubagentsTool, createUiTool, createWriteFileTool, cronExecutionsPath, defaultUiToolInputSchema, deleteMemoryFile, discoverAIMaxPlugins, ensureBootstrapMountLayout, ensureSession, exportSession, filterSkillsForAgent, filterToolsForAgent, findAgentDefinition, findSkillByName, formatApprovalResolution, formatClarifyResolution, formatReviewResolution, generateSessionTitle, getAgentConfig, getMemoryLines, hasBootstrapSentinel, hitlHistoryPath, initializePluginSystem, inspectBootstrapMountLayout, inspectSession, isBootstrapMountLayoutReady, isHitlPauseSignal, isUiToolPauseSignal, listAgents, listAvailableSlashCommands, listBindings, listMemoryFiles, listSessionSummaries, listSessions, listSubagentRunsFromDisk, loadAgentDefinitionsFromDir, loadAgentsConfig, loadArtifactOperations, loadBootstrapFiles, loadCronExecutionRecords, readPendingHitl as loadPendingHitl, readPendingHitl, readPendingUiTool as loadPendingUiTool, readPendingUiTool, loadPluginManifest, loadPluginManifestRegistry, loadPlugins, loadSessionContextSnapshot, loadSessionMetadata, loadSkillView, loadSkills, loadSkillsFromDirs, loadSkillsWithPluginDirs, loadSubagentRegistryFromDisk, loadTranscript, memoryDir, metadataPath, normalizeAgentId, normalizePluginsConfig, normalizeSessionStoreName, parseAgentDefinition, pendingHitlPath, pendingUiToolPath, primaryMemoryPath, readHitlHistory, readMemoryFile, readPrimaryMemory, registerEmbeddingProvider, registerMemoryProvider, removeAgent, removeBindings, replaceMemoryFile, resetEmbeddingProviderRegistryForTests, resetMemoryProviderRegistryForTests, resolveAgentDir, resolveAgentIdByBinding, resolveAgentsConfigPath, resolveDefaultAgentId, resolveEmbeddingProvider, resolveHitlRequest, resolveHitlRequest as resolvePendingHitl, resolveMemoryProvider, resolveModelFallbacks, resolveModelString, resolvePendingUiTool, resolvePluginManifestPath, rewriteTranscript, runAgent, saveAgentsConfig, saveSessionMetadata, saveSubagentRegistryToDisk, scanAgentDefinitions, searchMemory, sessionDir, sessionMemoryPath, sessionsDir, skillsDir, toolResultsDir, transcriptPath, transitionHitlStatus, updateAgentIdentity, updateSessionMetadata, validatePluginsConfig, validateResume, wrapToolsWithHooks };
2752
+ export { AgentBinding, AgentConfig, type AgentConfigSource, type AgentCustomProgressEvent, type AgentDefinition, type AgentDefinitionsContext, type AgentDefinitionsStats, type AgentDirectoryCandidate, AgentModelConfig, type AgentProgressEvent, type AgentRunParams, type AgentRunResult, type AgentRuntimePolicy, type AgentRuntimePolicyInput, type AgentScanOptions, type AgentVisibility, AgentsConfig, type ArtifactOpInput, type ArtifactOperation, type ArtifactOperationInput, type ArtifactOperationName, type ArtifactOperationType, type AutoSkillCategory, type AutoSkillIndexEntry, type AutoSkillListItem, type AutoSkillListOptions, type AutoSkillSearchOptions, type AutoSkillSearchResult, type AutoSkillStatus, type AutoSkillViewOptions, type AutoSkillViewResult, AutoSkillsLoader, type AutoSkillsLoaderOptions, BOOTSTRAP_FILE_NAMES, BOOTSTRAP_MAX_CHARS, BOOTSTRAP_TOTAL_MAX_CHARS, type BootstrapContextFile, type BootstrapEnsureResult, type BootstrapFile, type BootstrapMountResult, type BootstrapMountStatus, type CallbackEventPayload, type CallbackPayload, type Channel, type ContextManager, type CronExecutionRecord, DEFAULT_SESSION_ENCRYPTION_KEY, DEFAULT_SESSION_STORE_NAME, type EmbeddingProvider, type EmbeddingProviderContext, type EmbeddingProviderFactory, type EmbeddingProviderRegistration, HITL_MESSAGES, type HitlPauseContext, HitlPauseSignal, type HitlToolContext, MAX_ARTIFACT_CONTENT_CHARS, MAX_CHILDREN_PER_SESSION, MAX_SUBAGENT_DEPTH, type MemoryCallOptions, type MemoryChangeSource, type MemoryChangedEvent, type MemoryChangedHandler, MemoryIndexManager, type MemoryProvider, type MemoryProviderContext, type MemoryProviderFactory, type MemoryProviderRegistration, type MemoryProviderStatus, type MemoryRebuildSummary, type MemorySearchOptions, type MemorySearchResult, type NormalizedPluginsConfig, PLUGIN_MANIFEST_FILENAME, PLUGIN_MANIFEST_FILENAMES, type PersistedSubagentRunRecord, type PersistedToolResult, type PluginApi, type PluginCandidate, type PluginConfigUiHint, type PluginCustomProgressInput, type PluginDiagnostic, type PluginDiscoveryOptions, type PluginDiscoveryResult, type PluginEntryConfig, type PluginExecutionRuntime, type PluginHookAfterCompactionEvent, type PluginHookAfterPromptBuildEvent, type PluginHookAfterToolCallEvent, type PluginHookAgentContext, type PluginHookAgentEndEvent, type PluginHookAssistantMessageEndEvent, type PluginHookBeforeCompactionEvent, type PluginHookBeforeCompactionResult, type PluginHookBeforeModelResolveEvent, type PluginHookBeforeModelResolveResult, type PluginHookBeforePromptBuildEvent, type PluginHookBeforePromptBuildResult, type PluginHookBeforeToolCallEvent, type PluginHookBeforeToolCallResult, type PluginHookDreamGateEvent, type PluginHookDreamGateResult, type PluginHookHandlerMap, type PluginHookLlmInputEvent, type PluginHookLlmOutputEvent, type PluginHookMemoryChangedEvent, type PluginHookName, PluginHookRegistry, type PluginHookSessionEndEvent, type PluginHookSessionResetEvent, type PluginHookSessionStartEvent, type PluginKind, type PluginManifest, type PluginManifestLoadResult, type PluginManifestRegistry, type PluginOrigin, type PluginProgressEmitter, type PluginRecord, type PluginRegistry, type PluginRuntime, type PluginRuntimeContext, type PluginSystem, type PluginSystemOptions, type PluginToolOptions, PluginToolRegistry, type PluginUiToolDescriptor, type PluginUiToolOptions, type PluginsConfig, type PluginsConfigValidationResult, type RegisteredPluginTool, type ResumeOptions, type ResumeValidationResult, type RunResultPayload, SYSTEM_AGENTS_DIR, type SessionContextStore, type SessionEncryptionConfig, type SessionEncryptionKey, type SessionExport, type SessionInspection, type SessionMetadata, type SessionMetadataUpdate, type SessionSummary, type Skill, type SkillDirectory, type SkillViewResult, type SlashCommandList, type SubagentContext, SubagentRegistry, type SubagentRunRecord, type SubagentStatus, type SubagentToolsContext, type SystemPromptParams, type ToolLoopDetectionConfig, type TranscriptEntry, type UiToolInputSchema, type UiToolOptions, UiToolPauseSignal, addAgent, addBinding, agentDirCandidates, agentVisibility, aimaxDir, appendArtifactOperation, appendCronExecutionRecord, appendRecentToMemory, appendSessionFile, appendToMemory, appendTranscriptEntry, approvalSummaryFromResolution, artifactsPath, atomicWriteSessionFile, autoSkillsDir, bootstrapMountLayout, buildAgentDelegationPrompt, buildAgentTaskPrompt, buildBootstrapContextFiles, buildResumeNarration, buildSkillsPrompt, buildSubagentAnnounceMessage, buildSystemPrompt, cleanupOldSubagentRecords, clearPendingHitl, clearPendingUiTool, collapseLogPath, contextSnapshotPath, createAgentDefinitionsContext, createAgentTools, createApplyPatchTool, createAutoSkillCategoriesTool, createAutoSkillListTool, createAutoSkillSearchTool, createAutoSkillViewTool, createAutoSkillsLoader, createBashTool, createBatchSubagentSpawnTool, createBuiltinMemoryProvider, createContextManager, createEditFileTool, createExecTool, createImageTool, createListDirTool, createMemoryAppendTool, createMemoryForgetTool, createMemoryGetTool, createMemoryListTool, createMemoryLogTool, createMemorySearchTool, createMemoryUpdateTool, createMemoryWriteTool, createPendingHitl, createPendingUiTool, createPluginProgressEmitter, createPluginRuntime, createProcessTool, createReadFileTool, createSession, createSessionContextStore, createSessionEncryptionConfig, createSessionSearchTool, createSkillListTool, createSkillLoadTool, createSubagentSpawnTool, createSubagentsTool, createUiTool, createWriteFileTool, cronExecutionsPath, decryptContent, defaultUiToolInputSchema, deleteMemoryFile, discoverAIMaxPlugins, encryptContent, ensureBootstrapMountLayout, ensureSession, exportSession, filterSkillsForAgent, filterToolsForAgent, findAgentDefinition, findSkillByName, formatApprovalResolution, formatClarifyResolution, formatReviewResolution, generateSessionTitle, getAgentConfig, getDefaultSessionEncryptionConfig, getMemoryLines, hasBootstrapSentinel, hitlHistoryPath, initializePluginSystem, inspectBootstrapMountLayout, inspectSession, isBootstrapMountLayoutReady, isEncryptedContent, isHitlPauseSignal, isUiToolPauseSignal, listAgents, listAvailableSlashCommands, listBindings, listMemoryFiles, listSessionSummaries, listSessions, listSubagentRunsFromDisk, loadAgentDefinitionsFromDir, loadAgentsConfig, loadArtifactOperations, loadBootstrapFiles, loadCronExecutionRecords, readPendingHitl as loadPendingHitl, readPendingHitl, readPendingUiTool as loadPendingUiTool, readPendingUiTool, loadPluginManifest, loadPluginManifestRegistry, loadPlugins, loadSessionContextSnapshot, loadSessionMetadata, loadSkillView, loadSkills, loadSkillsFromDirs, loadSkillsWithPluginDirs, loadSubagentRegistryFromDisk, loadTranscript, memoryDir, metadataPath, normalizeAgentId, normalizePluginsConfig, normalizeSessionStoreName, parseAgentDefinition, pendingHitlPath, pendingUiToolPath, primaryMemoryPath, publicAgentDefinitions, readHitlHistory, readMemoryFile, readPrimaryMemory, readSessionFile, readSessionFileContent, registerEmbeddingProvider, registerMemoryProvider, removeAgent, removeBindings, replaceMemoryFile, resetEmbeddingProviderRegistryForTests, resetMemoryProviderRegistryForTests, resolveAgentDefinitionsContext, resolveAgentDir, resolveAgentIdByBinding, resolveAgentsConfigPath, resolveDefaultAgentId, resolveEmbeddingProvider, resolveHitlRequest, resolveHitlRequest as resolvePendingHitl, resolveMemoryProvider, resolveModelFallbacks, resolveModelString, resolvePendingUiTool, resolvePluginManifestPath, rewriteTranscript, runAgent, saveAgentsConfig, saveSessionMetadata, saveSubagentRegistryToDisk, scanAgentDefinitions, searchMemory, sessionDir, sessionMemoryPath, sessionsDir, setDefaultSessionEncryptionConfig, skillsDir, toolResultsDir, transcriptPath, transitionHitlStatus, updateAgentIdentity, updateSessionMetadata, validatePluginsConfig, validateResume, wrapToolsWithHooks, writeSessionFile };