llmist 2.6.0 → 3.1.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/README.md +10 -1
- package/dist/{chunk-364PEMVT.js → chunk-JCFPJMRQ.js} +754 -218
- package/dist/chunk-JCFPJMRQ.js.map +1 -0
- package/dist/{chunk-4IHLIYW5.js → chunk-LFI4WQVV.js} +6 -6
- package/dist/chunk-LFI4WQVV.js.map +1 -0
- package/dist/cli.cjs +1458 -279
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +702 -58
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +763 -226
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +139 -54
- package/dist/index.d.ts +139 -54
- package/dist/index.js +20 -18
- package/dist/{mock-stream-Jgg5u6Uf.d.cts → mock-stream-CTLm00_q.d.cts} +344 -56
- package/dist/{mock-stream-Jgg5u6Uf.d.ts → mock-stream-CTLm00_q.d.ts} +344 -56
- package/dist/testing/index.cjs +745 -210
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +6 -6
- package/dist/testing/index.d.ts +6 -6
- package/dist/testing/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-364PEMVT.js.map +0 -1
- package/dist/chunk-4IHLIYW5.js.map +0 -1
|
@@ -745,9 +745,9 @@ declare class ModelIdentifierParser {
|
|
|
745
745
|
*/
|
|
746
746
|
|
|
747
747
|
/**
|
|
748
|
-
* Options for
|
|
748
|
+
* Options for text generation methods (complete/stream).
|
|
749
749
|
*/
|
|
750
|
-
interface
|
|
750
|
+
interface TextGenerationOptions {
|
|
751
751
|
/** Model to use (supports aliases like "gpt4", "sonnet", "flash") */
|
|
752
752
|
model?: string;
|
|
753
753
|
/** Temperature (0-1) */
|
|
@@ -772,7 +772,7 @@ interface QuickOptions {
|
|
|
772
772
|
* console.log(answer); // "4" or "2+2 equals 4"
|
|
773
773
|
* ```
|
|
774
774
|
*/
|
|
775
|
-
declare function complete(client: LLMist, prompt: string, options?:
|
|
775
|
+
declare function complete(client: LLMist, prompt: string, options?: TextGenerationOptions): Promise<string>;
|
|
776
776
|
/**
|
|
777
777
|
* Quick streaming - returns async generator of text chunks.
|
|
778
778
|
*
|
|
@@ -790,7 +790,7 @@ declare function complete(client: LLMist, prompt: string, options?: QuickOptions
|
|
|
790
790
|
* }
|
|
791
791
|
* ```
|
|
792
792
|
*/
|
|
793
|
-
declare function stream(client: LLMist, prompt: string, options?:
|
|
793
|
+
declare function stream(client: LLMist, prompt: string, options?: TextGenerationOptions): AsyncGenerator<string>;
|
|
794
794
|
|
|
795
795
|
/**
|
|
796
796
|
* Example of gadget usage to help LLMs understand proper invocation.
|
|
@@ -986,6 +986,25 @@ interface GadgetSkippedEvent {
|
|
|
986
986
|
/** The error message from the failed dependency */
|
|
987
987
|
failedDependencyError: string;
|
|
988
988
|
}
|
|
989
|
+
/**
|
|
990
|
+
* Event emitted when stream processing completes, containing metadata.
|
|
991
|
+
* This allows the async generator to "return" metadata while still yielding events.
|
|
992
|
+
*/
|
|
993
|
+
interface StreamCompletionEvent {
|
|
994
|
+
type: "stream_complete";
|
|
995
|
+
/** The reason the LLM stopped generating (e.g., "stop", "tool_use") */
|
|
996
|
+
finishReason: string | null;
|
|
997
|
+
/** Token usage statistics from the LLM call */
|
|
998
|
+
usage?: TokenUsage;
|
|
999
|
+
/** Raw response text from the LLM */
|
|
1000
|
+
rawResponse: string;
|
|
1001
|
+
/** Final message after all interceptors applied */
|
|
1002
|
+
finalMessage: string;
|
|
1003
|
+
/** Whether any gadgets were executed during this iteration */
|
|
1004
|
+
didExecuteGadgets: boolean;
|
|
1005
|
+
/** Whether to break the agent loop (e.g., TaskComplete was called) */
|
|
1006
|
+
shouldBreakLoop: boolean;
|
|
1007
|
+
}
|
|
989
1008
|
type StreamEvent = {
|
|
990
1009
|
type: "text";
|
|
991
1010
|
content: string;
|
|
@@ -1003,7 +1022,52 @@ type StreamEvent = {
|
|
|
1003
1022
|
} | {
|
|
1004
1023
|
type: "compaction";
|
|
1005
1024
|
event: CompactionEvent;
|
|
1006
|
-
};
|
|
1025
|
+
} | StreamCompletionEvent;
|
|
1026
|
+
/**
|
|
1027
|
+
* Information about an LLM call within a nested subagent.
|
|
1028
|
+
* Used by parent agents to display real-time progress of subagent LLM calls.
|
|
1029
|
+
*/
|
|
1030
|
+
interface LLMCallInfo {
|
|
1031
|
+
/** Iteration number within the subagent loop */
|
|
1032
|
+
iteration: number;
|
|
1033
|
+
/** Model identifier (e.g., "sonnet", "gpt-4o") */
|
|
1034
|
+
model: string;
|
|
1035
|
+
/** Input tokens sent to the LLM */
|
|
1036
|
+
inputTokens?: number;
|
|
1037
|
+
/** Output tokens received from the LLM */
|
|
1038
|
+
outputTokens?: number;
|
|
1039
|
+
/** Reason the LLM stopped generating (e.g., "stop", "tool_use") */
|
|
1040
|
+
finishReason?: string;
|
|
1041
|
+
/** Elapsed time in milliseconds */
|
|
1042
|
+
elapsedMs?: number;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Event emitted by subagent gadgets to report internal agent activity.
|
|
1046
|
+
* Enables real-time display of nested LLM calls and gadget executions.
|
|
1047
|
+
*
|
|
1048
|
+
* @example
|
|
1049
|
+
* ```typescript
|
|
1050
|
+
* // Forwarding events from subagent to parent
|
|
1051
|
+
* for await (const event of subagent.run()) {
|
|
1052
|
+
* ctx.onNestedEvent?.({
|
|
1053
|
+
* type: event.type === "gadget_call" ? "gadget_call" : "gadget_result",
|
|
1054
|
+
* gadgetInvocationId: parentInvocationId,
|
|
1055
|
+
* depth: 1,
|
|
1056
|
+
* event,
|
|
1057
|
+
* });
|
|
1058
|
+
* }
|
|
1059
|
+
* ```
|
|
1060
|
+
*/
|
|
1061
|
+
interface NestedAgentEvent {
|
|
1062
|
+
/** Type of nested event */
|
|
1063
|
+
type: "llm_call_start" | "llm_call_end" | "gadget_call" | "gadget_result";
|
|
1064
|
+
/** Invocation ID of the parent gadget this nested event belongs to */
|
|
1065
|
+
gadgetInvocationId: string;
|
|
1066
|
+
/** Nesting depth (1 = direct child, 2 = grandchild, etc.) */
|
|
1067
|
+
depth: number;
|
|
1068
|
+
/** The actual event data - either a StreamEvent or LLMCallInfo */
|
|
1069
|
+
event: StreamEvent | LLMCallInfo;
|
|
1070
|
+
}
|
|
1007
1071
|
|
|
1008
1072
|
type TextOnlyHandler = TextOnlyStrategy | TextOnlyGadgetConfig | TextOnlyCustomHandler;
|
|
1009
1073
|
/**
|
|
@@ -1103,12 +1167,12 @@ interface CostReportingLLMist {
|
|
|
1103
1167
|
* Quick completion - returns final text response.
|
|
1104
1168
|
* Costs are automatically reported to the execution context.
|
|
1105
1169
|
*/
|
|
1106
|
-
complete(prompt: string, options?:
|
|
1170
|
+
complete(prompt: string, options?: TextGenerationOptions): Promise<string>;
|
|
1107
1171
|
/**
|
|
1108
1172
|
* Quick streaming - returns async generator of text chunks.
|
|
1109
1173
|
* Costs are automatically reported when the stream completes.
|
|
1110
1174
|
*/
|
|
1111
|
-
streamText(prompt: string, options?:
|
|
1175
|
+
streamText(prompt: string, options?: TextGenerationOptions): AsyncGenerator<string>;
|
|
1112
1176
|
/**
|
|
1113
1177
|
* Low-level stream access for full control.
|
|
1114
1178
|
* Costs are automatically reported based on usage metadata in chunks.
|
|
@@ -1257,16 +1321,144 @@ interface ExecutionContext {
|
|
|
1257
1321
|
* ```
|
|
1258
1322
|
*/
|
|
1259
1323
|
signal: AbortSignal;
|
|
1324
|
+
/**
|
|
1325
|
+
* Parent agent configuration for subagents to inherit.
|
|
1326
|
+
*
|
|
1327
|
+
* Contains the model and settings of the agent that invoked this gadget.
|
|
1328
|
+
* Subagent gadgets (like BrowseWeb) can use this to inherit the parent's
|
|
1329
|
+
* model by default, rather than using hardcoded defaults.
|
|
1330
|
+
*
|
|
1331
|
+
* This is optional - it will be `undefined` for:
|
|
1332
|
+
* - Gadgets executed via CLI `gadget run` command
|
|
1333
|
+
* - Direct gadget testing without agent context
|
|
1334
|
+
*
|
|
1335
|
+
* @example
|
|
1336
|
+
* ```typescript
|
|
1337
|
+
* execute: async (params, ctx) => {
|
|
1338
|
+
* // Inherit parent model unless explicitly specified
|
|
1339
|
+
* const model = params.model ?? ctx.agentConfig?.model ?? "sonnet";
|
|
1340
|
+
*
|
|
1341
|
+
* const agent = new AgentBuilder(new LLMist())
|
|
1342
|
+
* .withModel(model)
|
|
1343
|
+
* .build();
|
|
1344
|
+
* // ...
|
|
1345
|
+
* }
|
|
1346
|
+
* ```
|
|
1347
|
+
*/
|
|
1348
|
+
agentConfig?: AgentContextConfig;
|
|
1349
|
+
/**
|
|
1350
|
+
* Subagent-specific configuration overrides from CLI config.
|
|
1351
|
+
*
|
|
1352
|
+
* Contains per-subagent settings defined in `[subagents.Name]` or
|
|
1353
|
+
* `[profile.subagents.Name]` sections of cli.toml. Allows users to
|
|
1354
|
+
* customize subagent behavior without modifying gadget parameters.
|
|
1355
|
+
*
|
|
1356
|
+
* Resolution priority (highest to lowest):
|
|
1357
|
+
* 1. Runtime params (explicit gadget call)
|
|
1358
|
+
* 2. Profile-level subagent config
|
|
1359
|
+
* 3. Global subagent config
|
|
1360
|
+
* 4. Parent model (if "inherit")
|
|
1361
|
+
* 5. Package defaults
|
|
1362
|
+
*
|
|
1363
|
+
* @example
|
|
1364
|
+
* ```typescript
|
|
1365
|
+
* execute: async (params, ctx) => {
|
|
1366
|
+
* const subagentConfig = ctx.subagentConfig?.BrowseWeb ?? {};
|
|
1367
|
+
*
|
|
1368
|
+
* const model = params.model
|
|
1369
|
+
* ?? subagentConfig.model
|
|
1370
|
+
* ?? ctx.agentConfig?.model
|
|
1371
|
+
* ?? "sonnet";
|
|
1372
|
+
*
|
|
1373
|
+
* const maxIterations = params.maxIterations
|
|
1374
|
+
* ?? subagentConfig.maxIterations
|
|
1375
|
+
* ?? 15;
|
|
1376
|
+
* // ...
|
|
1377
|
+
* }
|
|
1378
|
+
* ```
|
|
1379
|
+
*/
|
|
1380
|
+
subagentConfig?: SubagentConfigMap;
|
|
1381
|
+
/**
|
|
1382
|
+
* Unique invocation ID for this gadget execution.
|
|
1383
|
+
* Used by `withParentContext()` to identify which parent gadget
|
|
1384
|
+
* nested events belong to.
|
|
1385
|
+
*/
|
|
1386
|
+
invocationId?: string;
|
|
1387
|
+
/**
|
|
1388
|
+
* Callback for subagent gadgets to report internal events to the parent.
|
|
1389
|
+
*
|
|
1390
|
+
* When provided, subagent gadgets (like BrowseWeb) can use this callback
|
|
1391
|
+
* to report their internal LLM calls and gadget executions in real-time.
|
|
1392
|
+
* This enables the parent agent to display nested progress indicators.
|
|
1393
|
+
*
|
|
1394
|
+
* **Recommended:** Use `builder.withParentContext(ctx)` instead of calling
|
|
1395
|
+
* this directly - it handles all the forwarding automatically.
|
|
1396
|
+
*
|
|
1397
|
+
* @example
|
|
1398
|
+
* ```typescript
|
|
1399
|
+
* // In a subagent gadget like BrowseWeb - just ONE LINE needed:
|
|
1400
|
+
* execute: async (params, ctx) => {
|
|
1401
|
+
* const agent = new AgentBuilder(client)
|
|
1402
|
+
* .withModel(model)
|
|
1403
|
+
* .withGadgets(Navigate, Click)
|
|
1404
|
+
* .withParentContext(ctx) // <-- Enables automatic event forwarding!
|
|
1405
|
+
* .ask(task);
|
|
1406
|
+
*
|
|
1407
|
+
* for await (const event of agent.run()) {
|
|
1408
|
+
* // Events automatically forwarded - just process normally
|
|
1409
|
+
* }
|
|
1410
|
+
* }
|
|
1411
|
+
* ```
|
|
1412
|
+
*/
|
|
1413
|
+
onNestedEvent?: (event: NestedAgentEvent) => void;
|
|
1414
|
+
}
|
|
1415
|
+
/**
|
|
1416
|
+
* Parent agent configuration passed to gadgets.
|
|
1417
|
+
* Contains settings that subagents can inherit.
|
|
1418
|
+
*/
|
|
1419
|
+
interface AgentContextConfig {
|
|
1420
|
+
/** Model identifier used by the parent agent */
|
|
1421
|
+
model: string;
|
|
1422
|
+
/** Temperature setting used by the parent agent */
|
|
1423
|
+
temperature?: number;
|
|
1260
1424
|
}
|
|
1425
|
+
/**
|
|
1426
|
+
* Configuration for a single subagent.
|
|
1427
|
+
* Can be defined globally in `[subagents.Name]` or per-profile in `[profile.subagents.Name]`.
|
|
1428
|
+
*
|
|
1429
|
+
* @example
|
|
1430
|
+
* ```toml
|
|
1431
|
+
* [subagents.BrowseWeb]
|
|
1432
|
+
* model = "inherit" # Use parent agent's model
|
|
1433
|
+
* maxIterations = 20
|
|
1434
|
+
* headless = true
|
|
1435
|
+
* ```
|
|
1436
|
+
*/
|
|
1437
|
+
interface SubagentConfig {
|
|
1438
|
+
/**
|
|
1439
|
+
* Model to use for this subagent.
|
|
1440
|
+
* - "inherit": Use parent agent's model (default behavior)
|
|
1441
|
+
* - Any model ID: Use specific model (e.g., "sonnet", "haiku", "gpt-4o")
|
|
1442
|
+
*/
|
|
1443
|
+
model?: string;
|
|
1444
|
+
/** Maximum iterations for the subagent loop */
|
|
1445
|
+
maxIterations?: number;
|
|
1446
|
+
/** Additional subagent-specific options */
|
|
1447
|
+
[key: string]: unknown;
|
|
1448
|
+
}
|
|
1449
|
+
/**
|
|
1450
|
+
* Map of subagent names to their configurations.
|
|
1451
|
+
*/
|
|
1452
|
+
type SubagentConfigMap = Record<string, SubagentConfig>;
|
|
1261
1453
|
|
|
1262
1454
|
/**
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1455
|
+
* Abstract base class for gadgets. Most users should use the `Gadget()` factory
|
|
1456
|
+
* or `createGadget()` function instead, as they provide better type safety
|
|
1457
|
+
* and simpler APIs.
|
|
1266
1458
|
*
|
|
1267
|
-
*
|
|
1459
|
+
* Extend this class directly only when you need advanced control over gadget behavior.
|
|
1268
1460
|
*/
|
|
1269
|
-
declare abstract class
|
|
1461
|
+
declare abstract class AbstractGadget {
|
|
1270
1462
|
/**
|
|
1271
1463
|
* The name of the gadget. Used for identification when LLM calls it.
|
|
1272
1464
|
* If not provided, defaults to the class name.
|
|
@@ -1332,14 +1524,14 @@ declare abstract class BaseGadget {
|
|
|
1332
1524
|
*/
|
|
1333
1525
|
abstract execute(params: Record<string, unknown>, ctx?: ExecutionContext): GadgetExecuteReturn | Promise<GadgetExecuteReturn>;
|
|
1334
1526
|
/**
|
|
1335
|
-
* Throws an
|
|
1527
|
+
* Throws an AbortException if the execution has been aborted.
|
|
1336
1528
|
*
|
|
1337
1529
|
* Call this at key checkpoints in long-running gadgets to allow early exit
|
|
1338
1530
|
* when the gadget has been cancelled (e.g., due to timeout). This enables
|
|
1339
1531
|
* resource cleanup and prevents unnecessary work after cancellation.
|
|
1340
1532
|
*
|
|
1341
1533
|
* @param ctx - The execution context containing the abort signal
|
|
1342
|
-
* @throws
|
|
1534
|
+
* @throws AbortException if ctx.signal.aborted is true
|
|
1343
1535
|
*
|
|
1344
1536
|
* @example
|
|
1345
1537
|
* ```typescript
|
|
@@ -1697,7 +1889,7 @@ type HintTemplate = string | ((context: HintContext) => string);
|
|
|
1697
1889
|
*
|
|
1698
1890
|
* @example
|
|
1699
1891
|
* ```typescript
|
|
1700
|
-
* const customConfig:
|
|
1892
|
+
* const customConfig: PromptTemplateConfig = {
|
|
1701
1893
|
* mainInstruction: "USE ONLY THE GADGET MARKERS BELOW:",
|
|
1702
1894
|
* criticalUsage: "Important: Follow the exact format shown.",
|
|
1703
1895
|
* rules: (ctx) => [
|
|
@@ -1708,7 +1900,7 @@ type HintTemplate = string | ((context: HintContext) => string);
|
|
|
1708
1900
|
* };
|
|
1709
1901
|
* ```
|
|
1710
1902
|
*/
|
|
1711
|
-
interface
|
|
1903
|
+
interface PromptTemplateConfig {
|
|
1712
1904
|
/**
|
|
1713
1905
|
* Main instruction block that appears at the start of the gadget system prompt.
|
|
1714
1906
|
* Default emphasizes using text markers instead of function calling.
|
|
@@ -1762,7 +1954,7 @@ declare const DEFAULT_HINTS: {
|
|
|
1762
1954
|
/**
|
|
1763
1955
|
* Default prompt templates used by llmist.
|
|
1764
1956
|
*/
|
|
1765
|
-
declare const DEFAULT_PROMPTS: Required<Omit<
|
|
1957
|
+
declare const DEFAULT_PROMPTS: Required<Omit<PromptTemplateConfig, "rules" | "customExamples" | "parallelGadgetsHint" | "iterationProgressHint"> & {
|
|
1766
1958
|
rules: (context: PromptContext) => string[];
|
|
1767
1959
|
customExamples: null;
|
|
1768
1960
|
}>;
|
|
@@ -1773,7 +1965,7 @@ declare function resolvePromptTemplate(template: PromptTemplate | undefined, def
|
|
|
1773
1965
|
/**
|
|
1774
1966
|
* Resolve rules template to an array of strings.
|
|
1775
1967
|
*/
|
|
1776
|
-
declare function resolveRulesTemplate(rules:
|
|
1968
|
+
declare function resolveRulesTemplate(rules: PromptTemplateConfig["rules"] | undefined, context: PromptContext): string[];
|
|
1777
1969
|
/**
|
|
1778
1970
|
* Resolve a hint template to a string using the given context.
|
|
1779
1971
|
* Supports both function templates and string templates with placeholders.
|
|
@@ -1785,14 +1977,14 @@ declare function resolveRulesTemplate(rules: PromptConfig["rules"] | undefined,
|
|
|
1785
1977
|
*/
|
|
1786
1978
|
declare function resolveHintTemplate(template: HintTemplate | undefined, defaultValue: string, context: HintContext): string;
|
|
1787
1979
|
|
|
1788
|
-
type
|
|
1980
|
+
type MessageRole = "system" | "user" | "assistant";
|
|
1789
1981
|
/**
|
|
1790
1982
|
* Message content can be a simple string (text only) or an array of content parts (multimodal).
|
|
1791
1983
|
* Using a string is simpler for text-only messages, while arrays support images and audio.
|
|
1792
1984
|
*/
|
|
1793
1985
|
type MessageContent = string | ContentPart[];
|
|
1794
1986
|
interface LLMMessage {
|
|
1795
|
-
role:
|
|
1987
|
+
role: MessageRole;
|
|
1796
1988
|
content: MessageContent;
|
|
1797
1989
|
name?: string;
|
|
1798
1990
|
metadata?: Record<string, unknown>;
|
|
@@ -1804,7 +1996,7 @@ interface LLMMessage {
|
|
|
1804
1996
|
* @param content - Message content (string or ContentPart[])
|
|
1805
1997
|
* @returns Array of content parts
|
|
1806
1998
|
*/
|
|
1807
|
-
declare function
|
|
1999
|
+
declare function normalizeMessageContent(content: MessageContent): ContentPart[];
|
|
1808
2000
|
/**
|
|
1809
2001
|
* Extract text from message content.
|
|
1810
2002
|
* Concatenates all text parts in the content.
|
|
@@ -1812,21 +2004,21 @@ declare function normalizeContent(content: MessageContent): ContentPart[];
|
|
|
1812
2004
|
* @param content - Message content (string or ContentPart[])
|
|
1813
2005
|
* @returns Combined text from all text parts
|
|
1814
2006
|
*/
|
|
1815
|
-
declare function
|
|
2007
|
+
declare function extractMessageText(content: MessageContent): string;
|
|
1816
2008
|
declare class LLMMessageBuilder {
|
|
1817
2009
|
private readonly messages;
|
|
1818
2010
|
private startPrefix;
|
|
1819
2011
|
private endPrefix;
|
|
1820
2012
|
private argPrefix;
|
|
1821
2013
|
private promptConfig;
|
|
1822
|
-
constructor(promptConfig?:
|
|
2014
|
+
constructor(promptConfig?: PromptTemplateConfig);
|
|
1823
2015
|
/**
|
|
1824
2016
|
* Set custom prefixes for gadget markers.
|
|
1825
2017
|
* Used to configure history builder to match system prompt markers.
|
|
1826
2018
|
*/
|
|
1827
2019
|
withPrefixes(startPrefix: string, endPrefix: string, argPrefix?: string): this;
|
|
1828
2020
|
addSystem(content: string, metadata?: Record<string, unknown>): this;
|
|
1829
|
-
addGadgets(gadgets:
|
|
2021
|
+
addGadgets(gadgets: AbstractGadget[], options?: {
|
|
1830
2022
|
startPrefix?: string;
|
|
1831
2023
|
endPrefix?: string;
|
|
1832
2024
|
argPrefix?: string;
|
|
@@ -1921,7 +2113,17 @@ declare class LLMMessageBuilder {
|
|
|
1921
2113
|
* ```
|
|
1922
2114
|
*/
|
|
1923
2115
|
addUserMultimodal(parts: ContentPart[]): this;
|
|
1924
|
-
|
|
2116
|
+
/**
|
|
2117
|
+
* Record a gadget execution result in the message history.
|
|
2118
|
+
* Creates an assistant message with the gadget invocation and a user message with the result.
|
|
2119
|
+
*
|
|
2120
|
+
* @param gadget - Name of the gadget that was executed
|
|
2121
|
+
* @param parameters - Parameters that were passed to the gadget
|
|
2122
|
+
* @param result - Text result from the gadget execution
|
|
2123
|
+
* @param media - Optional media outputs from the gadget
|
|
2124
|
+
* @param mediaIds - Optional IDs for the media outputs
|
|
2125
|
+
*/
|
|
2126
|
+
addGadgetCallResult(gadget: string, parameters: Record<string, unknown>, result: string, media?: GadgetMediaOutput[], mediaIds?: string[]): this;
|
|
1925
2127
|
/**
|
|
1926
2128
|
* Format parameters as Block format with JSON Pointer paths.
|
|
1927
2129
|
* Uses the configured argPrefix for consistency with system prompt.
|
|
@@ -2114,7 +2316,7 @@ declare class TextNamespace {
|
|
|
2114
2316
|
* @param options - Optional configuration
|
|
2115
2317
|
* @returns Complete text response
|
|
2116
2318
|
*/
|
|
2117
|
-
complete(prompt: string, options?:
|
|
2319
|
+
complete(prompt: string, options?: TextGenerationOptions): Promise<string>;
|
|
2118
2320
|
/**
|
|
2119
2321
|
* Stream text chunks.
|
|
2120
2322
|
*
|
|
@@ -2122,7 +2324,7 @@ declare class TextNamespace {
|
|
|
2122
2324
|
* @param options - Optional configuration
|
|
2123
2325
|
* @returns Async generator yielding text chunks
|
|
2124
2326
|
*/
|
|
2125
|
-
stream(prompt: string, options?:
|
|
2327
|
+
stream(prompt: string, options?: TextGenerationOptions): AsyncGenerator<string>;
|
|
2126
2328
|
}
|
|
2127
2329
|
|
|
2128
2330
|
/**
|
|
@@ -2345,7 +2547,7 @@ declare class LLMist {
|
|
|
2345
2547
|
* });
|
|
2346
2548
|
* ```
|
|
2347
2549
|
*/
|
|
2348
|
-
static complete(prompt: string, options?:
|
|
2550
|
+
static complete(prompt: string, options?: TextGenerationOptions): Promise<string>;
|
|
2349
2551
|
/**
|
|
2350
2552
|
* Quick streaming - returns async generator of text chunks.
|
|
2351
2553
|
* Convenient for streaming responses without needing agent setup.
|
|
@@ -2369,7 +2571,7 @@ declare class LLMist {
|
|
|
2369
2571
|
* }
|
|
2370
2572
|
* ```
|
|
2371
2573
|
*/
|
|
2372
|
-
static stream(prompt: string, options?:
|
|
2574
|
+
static stream(prompt: string, options?: TextGenerationOptions): AsyncGenerator<string>;
|
|
2373
2575
|
/**
|
|
2374
2576
|
* Instance method: Quick completion using this client instance.
|
|
2375
2577
|
*
|
|
@@ -2377,7 +2579,7 @@ declare class LLMist {
|
|
|
2377
2579
|
* @param options - Optional configuration
|
|
2378
2580
|
* @returns Complete text response
|
|
2379
2581
|
*/
|
|
2380
|
-
complete(prompt: string, options?:
|
|
2582
|
+
complete(prompt: string, options?: TextGenerationOptions): Promise<string>;
|
|
2381
2583
|
/**
|
|
2382
2584
|
* Instance method: Quick streaming using this client instance.
|
|
2383
2585
|
*
|
|
@@ -2385,7 +2587,7 @@ declare class LLMist {
|
|
|
2385
2587
|
* @param options - Optional configuration
|
|
2386
2588
|
* @returns Async generator yielding text chunks
|
|
2387
2589
|
*/
|
|
2388
|
-
streamText(prompt: string, options?:
|
|
2590
|
+
streamText(prompt: string, options?: TextGenerationOptions): AsyncGenerator<string>;
|
|
2389
2591
|
/**
|
|
2390
2592
|
* Create a fluent agent builder.
|
|
2391
2593
|
* Provides a chainable API for configuring and creating agents.
|
|
@@ -2432,8 +2634,8 @@ declare class LLMist {
|
|
|
2432
2634
|
createAgent(): AgentBuilder;
|
|
2433
2635
|
}
|
|
2434
2636
|
|
|
2435
|
-
type GadgetClass = new (...args: unknown[]) =>
|
|
2436
|
-
type GadgetOrClass =
|
|
2637
|
+
type GadgetClass = new (...args: unknown[]) => AbstractGadget;
|
|
2638
|
+
type GadgetOrClass = AbstractGadget | GadgetClass;
|
|
2437
2639
|
declare class GadgetRegistry {
|
|
2438
2640
|
private readonly gadgets;
|
|
2439
2641
|
/**
|
|
@@ -2472,12 +2674,12 @@ declare class GadgetRegistry {
|
|
|
2472
2674
|
* ```
|
|
2473
2675
|
*/
|
|
2474
2676
|
registerMany(gadgets: GadgetOrClass[]): this;
|
|
2475
|
-
register(name: string, gadget:
|
|
2476
|
-
registerByClass(gadget:
|
|
2477
|
-
get(name: string):
|
|
2677
|
+
register(name: string, gadget: AbstractGadget): void;
|
|
2678
|
+
registerByClass(gadget: AbstractGadget): void;
|
|
2679
|
+
get(name: string): AbstractGadget | undefined;
|
|
2478
2680
|
has(name: string): boolean;
|
|
2479
2681
|
getNames(): string[];
|
|
2480
|
-
getAll():
|
|
2682
|
+
getAll(): AbstractGadget[];
|
|
2481
2683
|
unregister(name: string): boolean;
|
|
2482
2684
|
clear(): void;
|
|
2483
2685
|
}
|
|
@@ -3320,8 +3522,8 @@ interface AgentOptions {
|
|
|
3320
3522
|
logger?: Logger<ILogObj>;
|
|
3321
3523
|
/** Clean hooks system */
|
|
3322
3524
|
hooks?: AgentHooks;
|
|
3323
|
-
/** Callback for human input */
|
|
3324
|
-
|
|
3525
|
+
/** Callback for requesting human input during execution */
|
|
3526
|
+
requestHumanInput?: (question: string) => Promise<string>;
|
|
3325
3527
|
/** Custom gadget start prefix */
|
|
3326
3528
|
gadgetStartPrefix?: string;
|
|
3327
3529
|
/** Custom gadget end prefix */
|
|
@@ -3349,8 +3551,8 @@ interface AgentOptions {
|
|
|
3349
3551
|
};
|
|
3350
3552
|
/** Stop on gadget error */
|
|
3351
3553
|
stopOnGadgetError?: boolean;
|
|
3352
|
-
/** Custom error
|
|
3353
|
-
|
|
3554
|
+
/** Custom error recovery logic */
|
|
3555
|
+
canRecoverFromGadgetError?: (context: {
|
|
3354
3556
|
error: string;
|
|
3355
3557
|
gadgetName: string;
|
|
3356
3558
|
errorType: "parse" | "validation" | "execution";
|
|
@@ -3359,7 +3561,7 @@ interface AgentOptions {
|
|
|
3359
3561
|
/** Default gadget timeout */
|
|
3360
3562
|
defaultGadgetTimeoutMs?: number;
|
|
3361
3563
|
/** Custom prompt configuration for gadget system prompts */
|
|
3362
|
-
promptConfig?:
|
|
3564
|
+
promptConfig?: PromptTemplateConfig;
|
|
3363
3565
|
/** Enable gadget output limiting (default: true) */
|
|
3364
3566
|
gadgetOutputLimit?: boolean;
|
|
3365
3567
|
/** Max gadget output as % of model context window (default: 15) */
|
|
@@ -3368,6 +3570,10 @@ interface AgentOptions {
|
|
|
3368
3570
|
compactionConfig?: CompactionConfig;
|
|
3369
3571
|
/** Optional abort signal for cancelling requests mid-flight */
|
|
3370
3572
|
signal?: AbortSignal;
|
|
3573
|
+
/** Subagent-specific configuration overrides (from CLI config) */
|
|
3574
|
+
subagentConfig?: SubagentConfigMap;
|
|
3575
|
+
/** Callback for subagent gadgets to report nested events to parent */
|
|
3576
|
+
onNestedEvent?: (event: NestedAgentEvent) => void;
|
|
3371
3577
|
}
|
|
3372
3578
|
/**
|
|
3373
3579
|
* Agent: Lean orchestrator that delegates to StreamProcessor.
|
|
@@ -3396,20 +3602,23 @@ declare class Agent {
|
|
|
3396
3602
|
private readonly gadgetStartPrefix?;
|
|
3397
3603
|
private readonly gadgetEndPrefix?;
|
|
3398
3604
|
private readonly gadgetArgPrefix?;
|
|
3399
|
-
private readonly
|
|
3605
|
+
private readonly requestHumanInput?;
|
|
3400
3606
|
private readonly textOnlyHandler;
|
|
3401
3607
|
private readonly textWithGadgetsHandler?;
|
|
3402
3608
|
private readonly stopOnGadgetError;
|
|
3403
|
-
private readonly
|
|
3609
|
+
private readonly canRecoverFromGadgetError?;
|
|
3404
3610
|
private readonly defaultGadgetTimeoutMs?;
|
|
3405
3611
|
private readonly defaultMaxTokens?;
|
|
3406
|
-
private
|
|
3612
|
+
private hasUserPrompt;
|
|
3407
3613
|
private readonly outputStore;
|
|
3408
3614
|
private readonly outputLimitEnabled;
|
|
3409
3615
|
private readonly outputLimitCharLimit;
|
|
3410
3616
|
private readonly compactionManager?;
|
|
3411
3617
|
private readonly mediaStore;
|
|
3412
3618
|
private readonly signal?;
|
|
3619
|
+
private readonly agentContextConfig;
|
|
3620
|
+
private readonly subagentConfig?;
|
|
3621
|
+
private readonly onNestedEvent?;
|
|
3413
3622
|
/**
|
|
3414
3623
|
* Creates a new Agent instance.
|
|
3415
3624
|
* @internal This constructor is private. Use LLMist.createAgent() or AgentBuilder instead.
|
|
@@ -3526,10 +3735,10 @@ declare class Agent {
|
|
|
3526
3735
|
*/
|
|
3527
3736
|
private resolveMaxTokensFromCatalog;
|
|
3528
3737
|
/**
|
|
3529
|
-
*
|
|
3738
|
+
* Chain the output limiter interceptor with user-provided hooks.
|
|
3530
3739
|
* The limiter runs first, then chains to any user interceptor.
|
|
3531
3740
|
*/
|
|
3532
|
-
private
|
|
3741
|
+
private chainOutputLimiterWithUserHooks;
|
|
3533
3742
|
/**
|
|
3534
3743
|
* Run agent with named event handlers (syntactic sugar).
|
|
3535
3744
|
*
|
|
@@ -3605,20 +3814,23 @@ declare class AgentBuilder {
|
|
|
3605
3814
|
private promptConfig?;
|
|
3606
3815
|
private gadgets;
|
|
3607
3816
|
private initialMessages;
|
|
3608
|
-
private
|
|
3817
|
+
private requestHumanInput?;
|
|
3609
3818
|
private gadgetStartPrefix?;
|
|
3610
3819
|
private gadgetEndPrefix?;
|
|
3611
3820
|
private gadgetArgPrefix?;
|
|
3612
3821
|
private textOnlyHandler?;
|
|
3613
3822
|
private textWithGadgetsHandler?;
|
|
3614
3823
|
private stopOnGadgetError?;
|
|
3615
|
-
private
|
|
3824
|
+
private canRecoverFromGadgetError?;
|
|
3616
3825
|
private defaultGadgetTimeoutMs?;
|
|
3617
3826
|
private gadgetOutputLimit?;
|
|
3618
3827
|
private gadgetOutputLimitPercent?;
|
|
3619
3828
|
private compactionConfig?;
|
|
3620
3829
|
private signal?;
|
|
3621
3830
|
private trailingMessage?;
|
|
3831
|
+
private subagentConfig?;
|
|
3832
|
+
private nestedEventCallback?;
|
|
3833
|
+
private parentContext?;
|
|
3622
3834
|
constructor(client?: LLMist);
|
|
3623
3835
|
/**
|
|
3624
3836
|
* Set the model to use.
|
|
@@ -3689,13 +3901,13 @@ declare class AgentBuilder {
|
|
|
3689
3901
|
*
|
|
3690
3902
|
* @example
|
|
3691
3903
|
* ```typescript
|
|
3692
|
-
* .
|
|
3904
|
+
* .withPromptTemplateConfig({
|
|
3693
3905
|
* mainInstruction: "Use the gadget markers below:",
|
|
3694
3906
|
* rules: ["Always use markers", "Never use function calling"]
|
|
3695
3907
|
* })
|
|
3696
3908
|
* ```
|
|
3697
3909
|
*/
|
|
3698
|
-
|
|
3910
|
+
withPromptTemplateConfig(config: PromptTemplateConfig): this;
|
|
3699
3911
|
/**
|
|
3700
3912
|
* Add gadgets (classes or instances).
|
|
3701
3913
|
* Can be called multiple times to add more gadgets.
|
|
@@ -3874,9 +4086,9 @@ declare class AgentBuilder {
|
|
|
3874
4086
|
* Provides fine-grained control over whether to continue after different types of errors.
|
|
3875
4087
|
* Overrides `stopOnGadgetError` when provided.
|
|
3876
4088
|
*
|
|
3877
|
-
* **Note:** This builder method configures the underlying `
|
|
4089
|
+
* **Note:** This builder method configures the underlying `canRecoverFromGadgetError` option
|
|
3878
4090
|
* in `AgentOptions`. The method is named `withErrorHandler` for better developer experience,
|
|
3879
|
-
* but maps to the `
|
|
4091
|
+
* but maps to the `canRecoverFromGadgetError` property internally.
|
|
3880
4092
|
*
|
|
3881
4093
|
* @param handler - Function that decides whether to continue after an error.
|
|
3882
4094
|
* Return `true` to continue execution, `false` to stop.
|
|
@@ -4016,6 +4228,80 @@ declare class AgentBuilder {
|
|
|
4016
4228
|
* ```
|
|
4017
4229
|
*/
|
|
4018
4230
|
withSignal(signal: AbortSignal): this;
|
|
4231
|
+
/**
|
|
4232
|
+
* Set subagent configuration overrides.
|
|
4233
|
+
*
|
|
4234
|
+
* Subagent gadgets (like BrowseWeb) can read these settings from ExecutionContext
|
|
4235
|
+
* to inherit model and other options from the CLI configuration.
|
|
4236
|
+
*
|
|
4237
|
+
* @param config - Subagent configuration map keyed by gadget name
|
|
4238
|
+
* @returns This builder for chaining
|
|
4239
|
+
*
|
|
4240
|
+
* @example
|
|
4241
|
+
* ```typescript
|
|
4242
|
+
* .withSubagentConfig({
|
|
4243
|
+
* BrowseWeb: { model: "inherit", maxIterations: 20, headless: true },
|
|
4244
|
+
* CodeAnalyzer: { model: "sonnet", maxIterations: 10 }
|
|
4245
|
+
* })
|
|
4246
|
+
* ```
|
|
4247
|
+
*/
|
|
4248
|
+
withSubagentConfig(config: SubagentConfigMap): this;
|
|
4249
|
+
/**
|
|
4250
|
+
* Set the callback for nested subagent events.
|
|
4251
|
+
*
|
|
4252
|
+
* Subagent gadgets (like BrowseWeb) can use ExecutionContext.onNestedEvent
|
|
4253
|
+
* to report their internal LLM calls and gadget executions in real-time.
|
|
4254
|
+
* This callback receives those events, enabling hierarchical progress display.
|
|
4255
|
+
*
|
|
4256
|
+
* @param callback - Function to handle nested agent events
|
|
4257
|
+
* @returns This builder for chaining
|
|
4258
|
+
*
|
|
4259
|
+
* @example
|
|
4260
|
+
* ```typescript
|
|
4261
|
+
* .withNestedEventCallback((event) => {
|
|
4262
|
+
* if (event.type === "llm_call_start") {
|
|
4263
|
+
* console.log(` Nested LLM #${event.event.iteration} starting...`);
|
|
4264
|
+
* } else if (event.type === "gadget_call") {
|
|
4265
|
+
* console.log(` ⏵ ${event.event.call.gadgetName}...`);
|
|
4266
|
+
* }
|
|
4267
|
+
* })
|
|
4268
|
+
* ```
|
|
4269
|
+
*/
|
|
4270
|
+
withNestedEventCallback(callback: (event: NestedAgentEvent) => void): this;
|
|
4271
|
+
/**
|
|
4272
|
+
* Enable automatic nested event forwarding to parent agent.
|
|
4273
|
+
*
|
|
4274
|
+
* When building a subagent inside a gadget, call this method to automatically
|
|
4275
|
+
* forward all LLM calls and gadget events to the parent agent. This enables
|
|
4276
|
+
* hierarchical progress display without any manual event handling.
|
|
4277
|
+
*
|
|
4278
|
+
* The method extracts `invocationId` and `onNestedEvent` from the execution
|
|
4279
|
+
* context and sets up automatic forwarding via hooks and event wrapping.
|
|
4280
|
+
*
|
|
4281
|
+
* @param ctx - ExecutionContext passed to the gadget's execute() method
|
|
4282
|
+
* @param depth - Nesting depth (default: 1 for direct child)
|
|
4283
|
+
* @returns This builder for chaining
|
|
4284
|
+
*
|
|
4285
|
+
* @example
|
|
4286
|
+
* ```typescript
|
|
4287
|
+
* // In a subagent gadget like BrowseWeb - ONE LINE enables auto-forwarding:
|
|
4288
|
+
* execute: async (params, ctx) => {
|
|
4289
|
+
* const agent = new AgentBuilder(client)
|
|
4290
|
+
* .withModel(model)
|
|
4291
|
+
* .withGadgets(Navigate, Click, Screenshot)
|
|
4292
|
+
* .withParentContext(ctx) // <-- This is all you need!
|
|
4293
|
+
* .ask(params.task);
|
|
4294
|
+
*
|
|
4295
|
+
* for await (const event of agent.run()) {
|
|
4296
|
+
* // Events automatically forwarded - just process normally
|
|
4297
|
+
* if (event.type === "text") {
|
|
4298
|
+
* result = event.content;
|
|
4299
|
+
* }
|
|
4300
|
+
* }
|
|
4301
|
+
* }
|
|
4302
|
+
* ```
|
|
4303
|
+
*/
|
|
4304
|
+
withParentContext(ctx: ExecutionContext, depth?: number): this;
|
|
4019
4305
|
/**
|
|
4020
4306
|
* Add an ephemeral trailing message that appears at the end of each LLM request.
|
|
4021
4307
|
*
|
|
@@ -4065,7 +4351,9 @@ declare class AgentBuilder {
|
|
|
4065
4351
|
*/
|
|
4066
4352
|
withSyntheticGadgetCall(gadgetName: string, parameters: Record<string, unknown>, result: string): this;
|
|
4067
4353
|
/**
|
|
4068
|
-
* Compose the final hooks, including
|
|
4354
|
+
* Compose the final hooks, including:
|
|
4355
|
+
* - Trailing message injection (if configured)
|
|
4356
|
+
* - Nested event forwarding for LLM calls (if parentContext is set)
|
|
4069
4357
|
*/
|
|
4070
4358
|
private composeHooks;
|
|
4071
4359
|
/**
|
|
@@ -4237,7 +4525,7 @@ interface IConversationManager {
|
|
|
4237
4525
|
* Adds a gadget call and its result to the conversation.
|
|
4238
4526
|
* Optionally includes media outputs (images, audio, etc.) for multimodal results.
|
|
4239
4527
|
*/
|
|
4240
|
-
|
|
4528
|
+
addGadgetCallResult(gadgetName: string, parameters: Record<string, unknown>, result: string, media?: GadgetMediaOutput[], mediaIds?: string[]): void;
|
|
4241
4529
|
/**
|
|
4242
4530
|
* Gets the complete conversation history including base messages (system prompts, gadget instructions).
|
|
4243
4531
|
*/
|
|
@@ -4973,4 +5261,4 @@ declare function createTextMockStream(text: string, options?: {
|
|
|
4973
5261
|
usage?: MockResponse["usage"];
|
|
4974
5262
|
}): LLMStream;
|
|
4975
5263
|
|
|
4976
|
-
export { type
|
|
5264
|
+
export { type LLMGenerationOptions as $, AbstractGadget as A, type MessageContent as B, type CompactionConfig as C, GadgetRegistry as D, MediaStore as E, type AgentContextConfig as F, type GadgetMediaOutput as G, type HintTemplate as H, type IConversationManager as I, type SubagentConfigMap as J, type ExecutionContext as K, type LLMMessage as L, MockProviderAdapter as M, type NestedAgentEvent as N, type GadgetExecuteReturn as O, type GadgetExample as P, type ParsedGadgetCall as Q, type ResolvedCompactionConfig as R, type StreamEvent as S, type TokenUsage as T, type GadgetExecutionResult as U, type MediaKind as V, type MediaMetadata as W, type GadgetExecuteResultWithMedia as X, type ProviderAdapter as Y, type ModelDescriptor as Z, type ModelSpec as _, type LLMStream as a, isTextPart as a$, type ImageModelSpec as a0, type ImageGenerationOptions as a1, type ImageGenerationResult as a2, type SpeechModelSpec as a3, type SpeechGenerationOptions as a4, type SpeechGenerationResult as a5, type HistoryMessage as a6, type TrailingMessage as a7, type TrailingMessageContext as a8, AgentBuilder as a9, type ObserveLLMCallContext as aA, type ObserveLLMCompleteContext as aB, type ObserveLLMErrorContext as aC, type Observers as aD, DEFAULT_COMPACTION_CONFIG as aE, DEFAULT_SUMMARIZATION_PROMPT as aF, type LLMistOptions as aG, type AudioContentPart as aH, type AudioMimeType as aI, type AudioSource as aJ, type ContentPart as aK, type ImageBase64Source as aL, type ImageContentPart as aM, type ImageMimeType as aN, type ImageSource as aO, type ImageUrlSource as aP, type TextContentPart as aQ, audioFromBase64 as aR, audioFromBuffer as aS, detectAudioMimeType as aT, detectImageMimeType as aU, imageFromBase64 as aV, imageFromBuffer as aW, imageFromUrl as aX, isAudioPart as aY, isDataUrl as aZ, isImagePart as a_, type EventHandlers as aa, collectEvents as ab, collectText as ac, runWithHandlers as ad, type AfterGadgetExecutionAction as ae, type AfterGadgetExecutionControllerContext as af, type AfterLLMCallAction as ag, type AfterLLMCallControllerContext as ah, type AfterLLMErrorAction as ai, type AgentOptions as aj, type BeforeGadgetExecutionAction as ak, type BeforeLLMCallAction as al, type ChunkInterceptorContext as am, type Controllers as an, type GadgetExecutionControllerContext as ao, type GadgetParameterInterceptorContext as ap, type GadgetResultInterceptorContext as aq, type Interceptors as ar, type LLMCallControllerContext as as, type LLMErrorControllerContext as at, type MessageInterceptorContext as au, type MessageTurn as av, type ObserveChunkContext as aw, type ObserveCompactionContext as ax, type ObserveGadgetCompleteContext as ay, type ObserveGadgetStartContext as az, type LLMStreamChunk as b, parseDataUrl as b0, text as b1, toBase64 as b2, type MessageRole as b3, extractMessageText as b4, LLMMessageBuilder as b5, normalizeMessageContent as b6, type CostEstimate as b7, type ModelFeatures as b8, type ModelLimits as b9, type TextOnlyGadgetConfig as bA, type TextOnlyHandler as bB, type TextOnlyStrategy as bC, type ModelPricing as ba, type VisionAnalyzeOptions as bb, type VisionAnalyzeResult as bc, type ProviderIdentifier as bd, ModelIdentifierParser as be, type HintContext as bf, type PromptContext as bg, type PromptTemplate as bh, type PromptTemplateConfig as bi, DEFAULT_HINTS as bj, DEFAULT_PROMPTS as bk, resolveHintTemplate as bl, resolvePromptTemplate as bm, resolveRulesTemplate as bn, type TextGenerationOptions as bo, complete as bp, stream as bq, type GadgetClass as br, type GadgetOrClass as bs, type CostReportingLLMist as bt, type GadgetExecuteResult as bu, type GadgetSkippedEvent as bv, type StoredMedia as bw, type TextOnlyAction as bx, type TextOnlyContext as by, type TextOnlyCustomHandler as bz, createMockAdapter as c, MockBuilder as d, createMockClient as e, MockManager as f, getMockManager as g, createMockStream as h, createTextMockStream as i, type MockAudioData as j, type MockImageData as k, type MockMatcher as l, mockLLM as m, type MockMatcherContext as n, type MockOptions as o, type MockRegistration as p, type MockResponse as q, type MockStats as r, type AgentHooks as s, ModelRegistry as t, LLMist as u, type CompactionEvent as v, type CompactionStats as w, type CompactionStrategy as x, type CompactionContext as y, type CompactionResult as z };
|