llmist 18.2.0 → 18.3.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.cjs +205 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +120 -2
- package/dist/index.d.ts +120 -2
- package/dist/index.js +205 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1929,6 +1929,27 @@ interface ObserveGadgetStartContext {
|
|
|
1929
1929
|
/** Present when event is from a subagent (undefined for top-level agent) */
|
|
1930
1930
|
subagentContext?: SubagentContext;
|
|
1931
1931
|
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Context for a progressive gadget-argument partial.
|
|
1934
|
+
* Read-only observation point. Values are RAW/uncoerced — see `GadgetArgsPartialEvent`.
|
|
1935
|
+
*
|
|
1936
|
+
* Unlike `onGadgetExecutionStart`, this fires BEFORE the gadget call is complete
|
|
1937
|
+
* (and before any ExecutionTree node exists for the gadget), repeatedly, as the
|
|
1938
|
+
* argument value streams in. The same `invocationId` later appears on the gadget's
|
|
1939
|
+
* `gadget_call` event and (if it executes) its start/complete contexts.
|
|
1940
|
+
*/
|
|
1941
|
+
interface ObserveGadgetArgsPartialContext {
|
|
1942
|
+
iteration: number;
|
|
1943
|
+
invocationId: string;
|
|
1944
|
+
gadgetName: string;
|
|
1945
|
+
fieldPath: string;
|
|
1946
|
+
value: string;
|
|
1947
|
+
delta: string;
|
|
1948
|
+
isFieldComplete: boolean;
|
|
1949
|
+
logger: Logger<ILogObj>;
|
|
1950
|
+
/** Present when event is from a subagent (undefined for top-level agent) */
|
|
1951
|
+
subagentContext?: SubagentContext;
|
|
1952
|
+
}
|
|
1932
1953
|
/**
|
|
1933
1954
|
* Context provided when a gadget execution completes.
|
|
1934
1955
|
* Read-only observation point.
|
|
@@ -2005,6 +2026,12 @@ interface Observers {
|
|
|
2005
2026
|
onLLMCallError?: (context: ObserveLLMErrorContext) => void | Promise<void>;
|
|
2006
2027
|
/** Called when a gadget execution starts */
|
|
2007
2028
|
onGadgetExecutionStart?: (context: ObserveGadgetStartContext) => void | Promise<void>;
|
|
2029
|
+
/**
|
|
2030
|
+
* Called for each progressive argument partial while a gadget call is still
|
|
2031
|
+
* streaming (before its `gadget_call`). Read-only; awaited in emission order.
|
|
2032
|
+
* Values are RAW/uncoerced and should be treated as best-effort. Keep cheap.
|
|
2033
|
+
*/
|
|
2034
|
+
onGadgetArgsPartial?: (context: ObserveGadgetArgsPartialContext) => void | Promise<void>;
|
|
2008
2035
|
/** Called when a gadget execution completes (success or error) */
|
|
2009
2036
|
onGadgetExecutionComplete?: (context: ObserveGadgetCompleteContext) => void | Promise<void>;
|
|
2010
2037
|
/** Called when a gadget is skipped due to a failed dependency */
|
|
@@ -3976,6 +4003,39 @@ interface GadgetSkippedEvent {
|
|
|
3976
4003
|
/** The error message from the failed dependency */
|
|
3977
4004
|
failedDependencyError: string;
|
|
3978
4005
|
}
|
|
4006
|
+
/**
|
|
4007
|
+
* Emitted repeatedly while a gadget call is still streaming, surfacing the
|
|
4008
|
+
* GROWING RAW value of one argument field BEFORE the gadget block terminates.
|
|
4009
|
+
*
|
|
4010
|
+
* Use this for progressive UIs (e.g. a form field that fills in live as the
|
|
4011
|
+
* agent streams a long text value).
|
|
4012
|
+
*
|
|
4013
|
+
* Important semantics:
|
|
4014
|
+
* - Values are RAW and UNCOERCED. The authoritative, validated/coerced
|
|
4015
|
+
* parameters arrive later on the single `gadget_call` event.
|
|
4016
|
+
* - `invocationId` is identical across every partial for a gadget AND its
|
|
4017
|
+
* final `gadget_call`, so consumers can correlate them.
|
|
4018
|
+
* - All partials for an invocation are emitted BEFORE that invocation's
|
|
4019
|
+
* `gadget_call`.
|
|
4020
|
+
* - Prefer `value` (replace) over `delta` (append) for correctness; `delta`
|
|
4021
|
+
* is a convenience that can occasionally differ by a trailing newline.
|
|
4022
|
+
* - A partial does NOT guarantee the gadget will execute (it may still be
|
|
4023
|
+
* skipped by `maxGadgetsPerResponse` or fail validation).
|
|
4024
|
+
*/
|
|
4025
|
+
interface GadgetArgsPartialEvent {
|
|
4026
|
+
type: "gadget_args_partial";
|
|
4027
|
+
/** Stable invocation id (same on all partials + the final `gadget_call`). */
|
|
4028
|
+
invocationId: string;
|
|
4029
|
+
gadgetName: string;
|
|
4030
|
+
/** JSON-pointer-ish path of the field, e.g. "title", "config/timeout", "items/0". */
|
|
4031
|
+
fieldPath: string;
|
|
4032
|
+
/** Full accumulated RAW value for this field so far (one trailing newline stripped). */
|
|
4033
|
+
value: string;
|
|
4034
|
+
/** Text appended since the previous partial for this field ("" if only completion flipped). */
|
|
4035
|
+
delta: string;
|
|
4036
|
+
/** True once a later `!!!ARG:` or the terminator proves this field's value is final. */
|
|
4037
|
+
isFieldComplete: boolean;
|
|
4038
|
+
}
|
|
3979
4039
|
/**
|
|
3980
4040
|
* Event emitted when stream processing completes, containing metadata.
|
|
3981
4041
|
* This allows the async generator to "return" metadata while still yielding events.
|
|
@@ -4007,7 +4067,7 @@ type StreamEvent = {
|
|
|
4007
4067
|
} | {
|
|
4008
4068
|
type: "gadget_call";
|
|
4009
4069
|
call: ParsedGadgetCall;
|
|
4010
|
-
} | {
|
|
4070
|
+
} | GadgetArgsPartialEvent | {
|
|
4011
4071
|
type: "gadget_result";
|
|
4012
4072
|
result: GadgetExecutionResult;
|
|
4013
4073
|
} | GadgetSkippedEvent | {
|
|
@@ -5155,6 +5215,19 @@ interface EventHandlers {
|
|
|
5155
5215
|
parametersRaw: string;
|
|
5156
5216
|
dependencies: string[];
|
|
5157
5217
|
}) => void | Promise<void>;
|
|
5218
|
+
/**
|
|
5219
|
+
* Called for each progressive argument partial while a gadget call is still
|
|
5220
|
+
* streaming (before `onGadgetCall`). Values are RAW/uncoerced; prefer `value`
|
|
5221
|
+
* (replace) over `delta` (append). Great for live form-fill UIs.
|
|
5222
|
+
*/
|
|
5223
|
+
onGadgetArgsPartial?: (partial: {
|
|
5224
|
+
gadgetName: string;
|
|
5225
|
+
invocationId: string;
|
|
5226
|
+
fieldPath: string;
|
|
5227
|
+
value: string;
|
|
5228
|
+
delta: string;
|
|
5229
|
+
isFieldComplete: boolean;
|
|
5230
|
+
}) => void | Promise<void>;
|
|
5158
5231
|
/** Called when a gadget execution completes */
|
|
5159
5232
|
onGadgetResult?: (result: {
|
|
5160
5233
|
gadgetName: string;
|
|
@@ -8031,6 +8104,10 @@ declare class StreamProcessor {
|
|
|
8031
8104
|
private readonly logger;
|
|
8032
8105
|
private readonly parser;
|
|
8033
8106
|
private readonly tree?;
|
|
8107
|
+
/** LLM-call node these gadgets hang off; used to derive subagentContext for partials. */
|
|
8108
|
+
private readonly parentNodeId?;
|
|
8109
|
+
/** Parent agent observers (subagent visibility) — also notified for arg partials. */
|
|
8110
|
+
private readonly parentObservers?;
|
|
8034
8111
|
private responseText;
|
|
8035
8112
|
private readonly dependencyResolver;
|
|
8036
8113
|
/** Queue of completed gadget results ready to be yielded (for real-time streaming) */
|
|
@@ -8830,9 +8907,13 @@ interface StreamParserOptions {
|
|
|
8830
8907
|
declare class GadgetCallParser {
|
|
8831
8908
|
private buffer;
|
|
8832
8909
|
private lastEmittedTextOffset;
|
|
8910
|
+
/** Non-null only while a single trailing gadget block is mid-stream. */
|
|
8911
|
+
private currentPartial;
|
|
8833
8912
|
private readonly startPrefix;
|
|
8834
8913
|
private readonly endPrefix;
|
|
8835
8914
|
private readonly argPrefix;
|
|
8915
|
+
/** Length of the longest marker; `maxMarkerLength - 1` is the scan-resume overlap. */
|
|
8916
|
+
private readonly maxMarkerLength;
|
|
8836
8917
|
constructor(options?: StreamParserOptions);
|
|
8837
8918
|
/**
|
|
8838
8919
|
* Extract and consume text up to the given index.
|
|
@@ -8862,6 +8943,43 @@ declare class GadgetCallParser {
|
|
|
8862
8943
|
*/
|
|
8863
8944
|
private parseParameters;
|
|
8864
8945
|
feed(chunk: string): Generator<StreamEvent>;
|
|
8946
|
+
/** Create fresh partial-tracking state for a newly-started streaming gadget. */
|
|
8947
|
+
private newPartialState;
|
|
8948
|
+
/**
|
|
8949
|
+
* Emit per-field "growing value" partials for an in-progress (or, when
|
|
8950
|
+
* `allComplete`, a just-completed) gadget body delimited by [bodyStart, bodyEnd).
|
|
8951
|
+
*
|
|
8952
|
+
* Incremental by design: each call resumes the `!!!ARG:` scan near where the last
|
|
8953
|
+
* one stopped (backing off by one marker's worth so a marker split across a chunk
|
|
8954
|
+
* boundary is still found) and only re-touches the in-progress field, so a long
|
|
8955
|
+
* streamed body costs O(new bytes) per feed instead of O(body). Every field except
|
|
8956
|
+
* the in-progress (last) one is complete — a following `!!!ARG:` terminated it; the
|
|
8957
|
+
* last field is tentative unless `allComplete`. The tentative field holds back any
|
|
8958
|
+
* suffix that is a partial prefix of a gadget marker so it never leaks into a value.
|
|
8959
|
+
*
|
|
8960
|
+
* We deliberately do NOT run stripMarkdownFences here: an unbalanced opening fence
|
|
8961
|
+
* sits before the first `!!!ARG:` (never emitted) and the authoritative gadget_call
|
|
8962
|
+
* still strips fences from the full raw parameters.
|
|
8963
|
+
*/
|
|
8964
|
+
private emitArgPartials;
|
|
8965
|
+
/**
|
|
8966
|
+
* Emit a single field whose `!!!ARG:` marker starts at `markerAbs` and whose value
|
|
8967
|
+
* runs to `valueEndAbs` (the next marker, or the body end). Mirrors the per-field
|
|
8968
|
+
* semantics of the old split-based emitter: field-path line, hold-back for a
|
|
8969
|
+
* tentative value, single trailing-newline strip.
|
|
8970
|
+
*/
|
|
8971
|
+
private emitFieldRange;
|
|
8972
|
+
/**
|
|
8973
|
+
* Emit a single partial for a field, but only when its value grew or it newly
|
|
8974
|
+
* completed — keeping event volume proportional to field growth, not characters.
|
|
8975
|
+
*/
|
|
8976
|
+
private emitFieldDelta;
|
|
8977
|
+
/**
|
|
8978
|
+
* Length of the longest suffix of `value` that is a proper prefix of any gadget
|
|
8979
|
+
* marker (start/end/arg). Used to hold back the beginning of an incoming marker
|
|
8980
|
+
* so it never appears inside a streamed value.
|
|
8981
|
+
*/
|
|
8982
|
+
private trailingPartialMarkerLength;
|
|
8865
8983
|
finalize(): Generator<StreamEvent>;
|
|
8866
8984
|
reset(): void;
|
|
8867
8985
|
}
|
|
@@ -11147,4 +11265,4 @@ declare const timing: {
|
|
|
11147
11265
|
*/
|
|
11148
11266
|
declare function getHostExports(ctx: ExecutionContext): HostExports;
|
|
11149
11267
|
|
|
11150
|
-
export { AbortException, AbstractGadget, type AddGadgetParams, type AddLLMCallParams, type AfterGadgetExecutionAction, type AfterGadgetExecutionControllerContext, type AfterLLMCallAction, type AfterLLMCallControllerContext, type AfterLLMErrorAction, Agent, AgentBuilder, type AgentHooks, type AgentOptions, AnthropicMessagesProvider, type AudioContentPart, type AudioMimeType, type AudioSource, type BaseExecutionEvent, BaseSessionManager, type BeforeGadgetExecutionAction, type BeforeLLMCallAction, type BeforeSkillActivationAction, BudgetPricingUnavailableError, type CachingConfig, type CachingScope, type ChunkInterceptorContext, type CompactionConfig, type CompactionContext, type CompactionEvent, CompactionManager, type CompactionResult, type CompactionStats, type CompactionStrategy, type CompleteGadgetParams, type CompleteLLMCallParams, type ContentPart, type Controllers, ConversationManager, type CostEstimate, type CostReportingLLMist, type CreateGadgetConfig, type CreateMcpServerOptions, DEFAULT_COMPACTION_CONFIG, DEFAULT_HINTS, DEFAULT_MCP_COMMAND_ALLOWLIST, DEFAULT_PROMPTS, DEFAULT_RATE_LIMIT_CONFIG, DEFAULT_RETRY_CONFIG, DEFAULT_SUMMARIZATION_PROMPT, EmptyCompletionError, type EventHandlers, type ExecutionContext, type ExecutionEvent, type ExecutionEventType, type ExecutionNode, type ExecutionNodeType, ExecutionTree, FALLBACK_CHARS_PER_TOKEN, type FileLoggingOptions, type FileLoggingState, type FileWrittenInfo, type FormatLLMErrorContext, GADGET_ARG_PREFIX, GADGET_END_PREFIX, GADGET_START_PREFIX, Gadget, type GadgetCallEvent, GadgetCallParser, type GadgetClass, type GadgetCompleteEvent, type GadgetConfig, type GadgetErrorEvent, type GadgetEvent, type GadgetExample, type GadgetExecuteResult, type GadgetExecuteResultWithMedia, type GadgetExecuteReturn, type GadgetExecutionControllerContext, type GadgetExecutionMode, type GadgetExecutionResult, GadgetExecutor, type GadgetExecutorOptions, type GadgetFactoryExports, type GadgetMediaOutput, type GadgetNode, type GadgetOrClass, GadgetOutputStore, type GadgetParameterInterceptorContext, GadgetRegistry, type GadgetResultInterceptorContext, type GadgetSkippedEvent, type GadgetStartEvent, type GadgetState, GeminiGenerativeProvider, type HintContext, type HintTemplate, type HintsConfig, type HistoryMessage, HookPresets, type HostExports, type HttpMcpServerSpec, HuggingFaceProvider, type HumanInputRequiredEvent, HumanInputRequiredException, HybridStrategy, type IConversationManager, type ISessionManager, type ImageBase64Source, type ImageContentPart, type ImageGenerationOptions, type ImageGenerationResult, type ImageMimeType, type ImageModelSpec, type ImageSource, type ImageUrlSource, type Interceptors, type IterationHintOptions, type JSONSchemaLike, JsonSchemaConversionError, type LLMCallCompleteEvent, type LLMCallControllerContext, type LLMCallErrorEvent, type LLMCallNode, type LLMCallStartEvent, type LLMCallStreamEvent, type LLMErrorControllerContext, type LLMEvent, type LLMGenerationOptions, type LLMMessage, LLMMessageBuilder, type LLMResponseEndEvent, type LLMStream, type LLMStreamChunk, LLMist, type LLMistOptions, type LLMistPackageManifest, LOAD_SKILL_GADGET_NAME, type LoggerOptions, type LoggingOptions, MODEL_ALIASES, McpClient, type McpClientOptions, McpConnectError, type McpContentBlock, McpError, McpLifecycle, type McpServerCapabilities, type McpServerHandle, type McpServerSpec, type McpToolAdapterOptions, McpToolCallError, type McpToolDescriptor, type McpToolResult, McpUntrustedCommandError, type MediaKind, type MediaMetadata, MediaStore, type MessageContent, type MessageInterceptorContext, type MessageRole, type MessageTurn, type ModelDescriptor, type ModelFeatures, ModelIdentifierParser, type ModelLimits, type ModelPricing, ModelRegistry, type ModelSpec, type NodeId, type ObserveChunkContext, type ObserveCompactionContext, type ObserveGadgetCompleteContext, type ObserveGadgetStartContext, type ObserveLLMCallContext, type ObserveLLMCompleteContext, type ObserveLLMErrorContext, type ObserveRateLimitThrottleContext, type ObserveRetryAttemptContext, type ObserveSkillActivatedContext, type Observers, OpenAIChatProvider, type OpenAICompatibleConfig, OpenAICompatibleProvider, type OpenRouterConfig, OpenRouterProvider, type OpenRouterRouting, type OutputLimitConfig, type ParallelGadgetHintOptions, type ParsedGadgetCall, type ParsedSkill, type PrefixConfig, type PresetDefinition, type PromptContext, type PromptTemplate, type PromptTemplateConfig, type ProviderAdapter, type ProviderIdentifier, type RateLimitConfig, type RateLimitStats, RateLimitTracker, type ReasoningConfig, type ReasoningEffort, type ResolveValueOptions, type ResolvedCompactionConfig, type ResolvedRateLimitConfig, type ResolvedRetryConfig, type RetryConfig, type RetryOptions, type SessionManifestEntry, SimpleSessionManager, Skill, type SkillActivation, type SkillActivationControllerContext, type SkillActivationOptions, type SkillInstructionInterceptorContext, type SkillMetadata, SkillRegistry, type SkillResource, type SkillSource, SlidingWindowStrategy, type SpeechGenerationOptions, type SpeechGenerationResult, type SpeechModelSpec, type StdioMcpServerSpec, type StoredMedia, type StoredOutput, type StreamCompleteEvent, type StreamEvent, type StreamProcessingResult, StreamProcessor, type StreamProcessorOptions, type SubagentConfig, type SubagentConfigMap, type SubagentContext, type SubagentManifestEntry, type SubagentOptions, SummarizationStrategy, TaskCompletionSignal, type TextContentPart, type TextEvent, type TextGenerationOptions, type TextOnlyAction, type TextOnlyContext, type TextOnlyCustomHandler, type TextOnlyGadgetConfig, type TextOnlyHandler, type TextOnlyStrategy, type ThinkingChunk, type ThinkingEvent, TimeoutException, type TokenUsage, type TrailingMessage, type TrailingMessageContext, type CompactionEvent$1 as TreeCompactionEvent, type TreeConfig, type GadgetSkippedEvent$1 as TreeGadgetSkippedEvent, type TriggeredLimitInfo, type ValidationIssue, type ValidationResult, type VisionAnalyzeOptions, type VisionAnalyzeResult, assertCommandAllowed, audioFromBase64, audioFromBuffer, collectEvents, collectText, complete, createAnthropicProviderFromEnv, createFileLoggingState, createGadget, createGadgetOutputViewer, createGeminiProviderFromEnv, createHints, createHuggingFaceProviderFromEnv, createLoadSkillGadget, createLogger, createMcpServer, createMediaOutput, createOpenAIProviderFromEnv, createOpenRouterProviderFromEnv, createSubagent, defaultLogger, detectAudioMimeType, detectImageMimeType, discoverProviderAdapters, discoverSkills, extractMessageText, extractRetryAfterMs, filterByDepth, filterByParent, filterRootEvents, format, formatBytes, formatCallNumber, formatDate, formatDuration, formatLLMError, formatLlmRequest, gadgetError, gadgetResultToMcpContent, gadgetSuccess, gadgetToMcpTool, getErrorMessage, getHostExports, getModelId, getPresetGadgets, getProvider, getSubagent, groupByParent, hasHostExports, hasPreset, hasProviderPrefix, hasSubagents, humanDelay, imageFromBase64, imageFromBuffer, imageFromUrl, isAbortError, isAudioPart, isDataUrl, isGadgetEvent, isImagePart, isLLMEvent, isLikelyContextOverflow, isRetryableError, isRootEvent, isSubagentEvent, isTextPart, iterationProgressHint, jsonSchemaToZod, listPresets, listSubagents, loadSkillsFromDirectory, mcpToolToGadget, normalizeMessageContent, parallelGadgetHint, parseDataUrl, parseFrontmatter, parseManifest, parseMetadata, parseRetryAfterHeader, parseSkillContent, parseSkillFile, randomDelay, renderSkillForMcpPrompt, resetFileLoggingState, resolveConfig, resolveHintTemplate, resolveInstructions, resolveModel, resolvePromptTemplate, resolveRateLimitConfig, resolveRetryConfig, resolveRulesTemplate, resolveSubagentModel, resolveSubagentTimeout, resolveValue, resultWithAudio, resultWithFile, resultWithImage, resultWithImages, resultWithMedia, runGadgetForMcp, runWithHandlers, scanResources, schemaToJSONSchema, skillToMcpPrompt, stream, stripProviderPrefix, substituteArguments, substituteVariables, text, timing, toBase64, truncate, validateAndApplyDefaults, validateGadgetParams, validateGadgetSchema, validateMetadata, withErrorHandling, withRetry, withTimeout };
|
|
11268
|
+
export { AbortException, AbstractGadget, type AddGadgetParams, type AddLLMCallParams, type AfterGadgetExecutionAction, type AfterGadgetExecutionControllerContext, type AfterLLMCallAction, type AfterLLMCallControllerContext, type AfterLLMErrorAction, Agent, AgentBuilder, type AgentHooks, type AgentOptions, AnthropicMessagesProvider, type AudioContentPart, type AudioMimeType, type AudioSource, type BaseExecutionEvent, BaseSessionManager, type BeforeGadgetExecutionAction, type BeforeLLMCallAction, type BeforeSkillActivationAction, BudgetPricingUnavailableError, type CachingConfig, type CachingScope, type ChunkInterceptorContext, type CompactionConfig, type CompactionContext, type CompactionEvent, CompactionManager, type CompactionResult, type CompactionStats, type CompactionStrategy, type CompleteGadgetParams, type CompleteLLMCallParams, type ContentPart, type Controllers, ConversationManager, type CostEstimate, type CostReportingLLMist, type CreateGadgetConfig, type CreateMcpServerOptions, DEFAULT_COMPACTION_CONFIG, DEFAULT_HINTS, DEFAULT_MCP_COMMAND_ALLOWLIST, DEFAULT_PROMPTS, DEFAULT_RATE_LIMIT_CONFIG, DEFAULT_RETRY_CONFIG, DEFAULT_SUMMARIZATION_PROMPT, EmptyCompletionError, type EventHandlers, type ExecutionContext, type ExecutionEvent, type ExecutionEventType, type ExecutionNode, type ExecutionNodeType, ExecutionTree, FALLBACK_CHARS_PER_TOKEN, type FileLoggingOptions, type FileLoggingState, type FileWrittenInfo, type FormatLLMErrorContext, GADGET_ARG_PREFIX, GADGET_END_PREFIX, GADGET_START_PREFIX, Gadget, type GadgetArgsPartialEvent, type GadgetCallEvent, GadgetCallParser, type GadgetClass, type GadgetCompleteEvent, type GadgetConfig, type GadgetErrorEvent, type GadgetEvent, type GadgetExample, type GadgetExecuteResult, type GadgetExecuteResultWithMedia, type GadgetExecuteReturn, type GadgetExecutionControllerContext, type GadgetExecutionMode, type GadgetExecutionResult, GadgetExecutor, type GadgetExecutorOptions, type GadgetFactoryExports, type GadgetMediaOutput, type GadgetNode, type GadgetOrClass, GadgetOutputStore, type GadgetParameterInterceptorContext, GadgetRegistry, type GadgetResultInterceptorContext, type GadgetSkippedEvent, type GadgetStartEvent, type GadgetState, GeminiGenerativeProvider, type HintContext, type HintTemplate, type HintsConfig, type HistoryMessage, HookPresets, type HostExports, type HttpMcpServerSpec, HuggingFaceProvider, type HumanInputRequiredEvent, HumanInputRequiredException, HybridStrategy, type IConversationManager, type ISessionManager, type ImageBase64Source, type ImageContentPart, type ImageGenerationOptions, type ImageGenerationResult, type ImageMimeType, type ImageModelSpec, type ImageSource, type ImageUrlSource, type Interceptors, type IterationHintOptions, type JSONSchemaLike, JsonSchemaConversionError, type LLMCallCompleteEvent, type LLMCallControllerContext, type LLMCallErrorEvent, type LLMCallNode, type LLMCallStartEvent, type LLMCallStreamEvent, type LLMErrorControllerContext, type LLMEvent, type LLMGenerationOptions, type LLMMessage, LLMMessageBuilder, type LLMResponseEndEvent, type LLMStream, type LLMStreamChunk, LLMist, type LLMistOptions, type LLMistPackageManifest, LOAD_SKILL_GADGET_NAME, type LoggerOptions, type LoggingOptions, MODEL_ALIASES, McpClient, type McpClientOptions, McpConnectError, type McpContentBlock, McpError, McpLifecycle, type McpServerCapabilities, type McpServerHandle, type McpServerSpec, type McpToolAdapterOptions, McpToolCallError, type McpToolDescriptor, type McpToolResult, McpUntrustedCommandError, type MediaKind, type MediaMetadata, MediaStore, type MessageContent, type MessageInterceptorContext, type MessageRole, type MessageTurn, type ModelDescriptor, type ModelFeatures, ModelIdentifierParser, type ModelLimits, type ModelPricing, ModelRegistry, type ModelSpec, type NodeId, type ObserveChunkContext, type ObserveCompactionContext, type ObserveGadgetArgsPartialContext, type ObserveGadgetCompleteContext, type ObserveGadgetStartContext, type ObserveLLMCallContext, type ObserveLLMCompleteContext, type ObserveLLMErrorContext, type ObserveRateLimitThrottleContext, type ObserveRetryAttemptContext, type ObserveSkillActivatedContext, type Observers, OpenAIChatProvider, type OpenAICompatibleConfig, OpenAICompatibleProvider, type OpenRouterConfig, OpenRouterProvider, type OpenRouterRouting, type OutputLimitConfig, type ParallelGadgetHintOptions, type ParsedGadgetCall, type ParsedSkill, type PrefixConfig, type PresetDefinition, type PromptContext, type PromptTemplate, type PromptTemplateConfig, type ProviderAdapter, type ProviderIdentifier, type RateLimitConfig, type RateLimitStats, RateLimitTracker, type ReasoningConfig, type ReasoningEffort, type ResolveValueOptions, type ResolvedCompactionConfig, type ResolvedRateLimitConfig, type ResolvedRetryConfig, type RetryConfig, type RetryOptions, type SessionManifestEntry, SimpleSessionManager, Skill, type SkillActivation, type SkillActivationControllerContext, type SkillActivationOptions, type SkillInstructionInterceptorContext, type SkillMetadata, SkillRegistry, type SkillResource, type SkillSource, SlidingWindowStrategy, type SpeechGenerationOptions, type SpeechGenerationResult, type SpeechModelSpec, type StdioMcpServerSpec, type StoredMedia, type StoredOutput, type StreamCompleteEvent, type StreamEvent, type StreamProcessingResult, StreamProcessor, type StreamProcessorOptions, type SubagentConfig, type SubagentConfigMap, type SubagentContext, type SubagentManifestEntry, type SubagentOptions, SummarizationStrategy, TaskCompletionSignal, type TextContentPart, type TextEvent, type TextGenerationOptions, type TextOnlyAction, type TextOnlyContext, type TextOnlyCustomHandler, type TextOnlyGadgetConfig, type TextOnlyHandler, type TextOnlyStrategy, type ThinkingChunk, type ThinkingEvent, TimeoutException, type TokenUsage, type TrailingMessage, type TrailingMessageContext, type CompactionEvent$1 as TreeCompactionEvent, type TreeConfig, type GadgetSkippedEvent$1 as TreeGadgetSkippedEvent, type TriggeredLimitInfo, type ValidationIssue, type ValidationResult, type VisionAnalyzeOptions, type VisionAnalyzeResult, assertCommandAllowed, audioFromBase64, audioFromBuffer, collectEvents, collectText, complete, createAnthropicProviderFromEnv, createFileLoggingState, createGadget, createGadgetOutputViewer, createGeminiProviderFromEnv, createHints, createHuggingFaceProviderFromEnv, createLoadSkillGadget, createLogger, createMcpServer, createMediaOutput, createOpenAIProviderFromEnv, createOpenRouterProviderFromEnv, createSubagent, defaultLogger, detectAudioMimeType, detectImageMimeType, discoverProviderAdapters, discoverSkills, extractMessageText, extractRetryAfterMs, filterByDepth, filterByParent, filterRootEvents, format, formatBytes, formatCallNumber, formatDate, formatDuration, formatLLMError, formatLlmRequest, gadgetError, gadgetResultToMcpContent, gadgetSuccess, gadgetToMcpTool, getErrorMessage, getHostExports, getModelId, getPresetGadgets, getProvider, getSubagent, groupByParent, hasHostExports, hasPreset, hasProviderPrefix, hasSubagents, humanDelay, imageFromBase64, imageFromBuffer, imageFromUrl, isAbortError, isAudioPart, isDataUrl, isGadgetEvent, isImagePart, isLLMEvent, isLikelyContextOverflow, isRetryableError, isRootEvent, isSubagentEvent, isTextPart, iterationProgressHint, jsonSchemaToZod, listPresets, listSubagents, loadSkillsFromDirectory, mcpToolToGadget, normalizeMessageContent, parallelGadgetHint, parseDataUrl, parseFrontmatter, parseManifest, parseMetadata, parseRetryAfterHeader, parseSkillContent, parseSkillFile, randomDelay, renderSkillForMcpPrompt, resetFileLoggingState, resolveConfig, resolveHintTemplate, resolveInstructions, resolveModel, resolvePromptTemplate, resolveRateLimitConfig, resolveRetryConfig, resolveRulesTemplate, resolveSubagentModel, resolveSubagentTimeout, resolveValue, resultWithAudio, resultWithFile, resultWithImage, resultWithImages, resultWithMedia, runGadgetForMcp, runWithHandlers, scanResources, schemaToJSONSchema, skillToMcpPrompt, stream, stripProviderPrefix, substituteArguments, substituteVariables, text, timing, toBase64, truncate, validateAndApplyDefaults, validateGadgetParams, validateGadgetSchema, validateMetadata, withErrorHandling, withRetry, withTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -1929,6 +1929,27 @@ interface ObserveGadgetStartContext {
|
|
|
1929
1929
|
/** Present when event is from a subagent (undefined for top-level agent) */
|
|
1930
1930
|
subagentContext?: SubagentContext;
|
|
1931
1931
|
}
|
|
1932
|
+
/**
|
|
1933
|
+
* Context for a progressive gadget-argument partial.
|
|
1934
|
+
* Read-only observation point. Values are RAW/uncoerced — see `GadgetArgsPartialEvent`.
|
|
1935
|
+
*
|
|
1936
|
+
* Unlike `onGadgetExecutionStart`, this fires BEFORE the gadget call is complete
|
|
1937
|
+
* (and before any ExecutionTree node exists for the gadget), repeatedly, as the
|
|
1938
|
+
* argument value streams in. The same `invocationId` later appears on the gadget's
|
|
1939
|
+
* `gadget_call` event and (if it executes) its start/complete contexts.
|
|
1940
|
+
*/
|
|
1941
|
+
interface ObserveGadgetArgsPartialContext {
|
|
1942
|
+
iteration: number;
|
|
1943
|
+
invocationId: string;
|
|
1944
|
+
gadgetName: string;
|
|
1945
|
+
fieldPath: string;
|
|
1946
|
+
value: string;
|
|
1947
|
+
delta: string;
|
|
1948
|
+
isFieldComplete: boolean;
|
|
1949
|
+
logger: Logger<ILogObj>;
|
|
1950
|
+
/** Present when event is from a subagent (undefined for top-level agent) */
|
|
1951
|
+
subagentContext?: SubagentContext;
|
|
1952
|
+
}
|
|
1932
1953
|
/**
|
|
1933
1954
|
* Context provided when a gadget execution completes.
|
|
1934
1955
|
* Read-only observation point.
|
|
@@ -2005,6 +2026,12 @@ interface Observers {
|
|
|
2005
2026
|
onLLMCallError?: (context: ObserveLLMErrorContext) => void | Promise<void>;
|
|
2006
2027
|
/** Called when a gadget execution starts */
|
|
2007
2028
|
onGadgetExecutionStart?: (context: ObserveGadgetStartContext) => void | Promise<void>;
|
|
2029
|
+
/**
|
|
2030
|
+
* Called for each progressive argument partial while a gadget call is still
|
|
2031
|
+
* streaming (before its `gadget_call`). Read-only; awaited in emission order.
|
|
2032
|
+
* Values are RAW/uncoerced and should be treated as best-effort. Keep cheap.
|
|
2033
|
+
*/
|
|
2034
|
+
onGadgetArgsPartial?: (context: ObserveGadgetArgsPartialContext) => void | Promise<void>;
|
|
2008
2035
|
/** Called when a gadget execution completes (success or error) */
|
|
2009
2036
|
onGadgetExecutionComplete?: (context: ObserveGadgetCompleteContext) => void | Promise<void>;
|
|
2010
2037
|
/** Called when a gadget is skipped due to a failed dependency */
|
|
@@ -3976,6 +4003,39 @@ interface GadgetSkippedEvent {
|
|
|
3976
4003
|
/** The error message from the failed dependency */
|
|
3977
4004
|
failedDependencyError: string;
|
|
3978
4005
|
}
|
|
4006
|
+
/**
|
|
4007
|
+
* Emitted repeatedly while a gadget call is still streaming, surfacing the
|
|
4008
|
+
* GROWING RAW value of one argument field BEFORE the gadget block terminates.
|
|
4009
|
+
*
|
|
4010
|
+
* Use this for progressive UIs (e.g. a form field that fills in live as the
|
|
4011
|
+
* agent streams a long text value).
|
|
4012
|
+
*
|
|
4013
|
+
* Important semantics:
|
|
4014
|
+
* - Values are RAW and UNCOERCED. The authoritative, validated/coerced
|
|
4015
|
+
* parameters arrive later on the single `gadget_call` event.
|
|
4016
|
+
* - `invocationId` is identical across every partial for a gadget AND its
|
|
4017
|
+
* final `gadget_call`, so consumers can correlate them.
|
|
4018
|
+
* - All partials for an invocation are emitted BEFORE that invocation's
|
|
4019
|
+
* `gadget_call`.
|
|
4020
|
+
* - Prefer `value` (replace) over `delta` (append) for correctness; `delta`
|
|
4021
|
+
* is a convenience that can occasionally differ by a trailing newline.
|
|
4022
|
+
* - A partial does NOT guarantee the gadget will execute (it may still be
|
|
4023
|
+
* skipped by `maxGadgetsPerResponse` or fail validation).
|
|
4024
|
+
*/
|
|
4025
|
+
interface GadgetArgsPartialEvent {
|
|
4026
|
+
type: "gadget_args_partial";
|
|
4027
|
+
/** Stable invocation id (same on all partials + the final `gadget_call`). */
|
|
4028
|
+
invocationId: string;
|
|
4029
|
+
gadgetName: string;
|
|
4030
|
+
/** JSON-pointer-ish path of the field, e.g. "title", "config/timeout", "items/0". */
|
|
4031
|
+
fieldPath: string;
|
|
4032
|
+
/** Full accumulated RAW value for this field so far (one trailing newline stripped). */
|
|
4033
|
+
value: string;
|
|
4034
|
+
/** Text appended since the previous partial for this field ("" if only completion flipped). */
|
|
4035
|
+
delta: string;
|
|
4036
|
+
/** True once a later `!!!ARG:` or the terminator proves this field's value is final. */
|
|
4037
|
+
isFieldComplete: boolean;
|
|
4038
|
+
}
|
|
3979
4039
|
/**
|
|
3980
4040
|
* Event emitted when stream processing completes, containing metadata.
|
|
3981
4041
|
* This allows the async generator to "return" metadata while still yielding events.
|
|
@@ -4007,7 +4067,7 @@ type StreamEvent = {
|
|
|
4007
4067
|
} | {
|
|
4008
4068
|
type: "gadget_call";
|
|
4009
4069
|
call: ParsedGadgetCall;
|
|
4010
|
-
} | {
|
|
4070
|
+
} | GadgetArgsPartialEvent | {
|
|
4011
4071
|
type: "gadget_result";
|
|
4012
4072
|
result: GadgetExecutionResult;
|
|
4013
4073
|
} | GadgetSkippedEvent | {
|
|
@@ -5155,6 +5215,19 @@ interface EventHandlers {
|
|
|
5155
5215
|
parametersRaw: string;
|
|
5156
5216
|
dependencies: string[];
|
|
5157
5217
|
}) => void | Promise<void>;
|
|
5218
|
+
/**
|
|
5219
|
+
* Called for each progressive argument partial while a gadget call is still
|
|
5220
|
+
* streaming (before `onGadgetCall`). Values are RAW/uncoerced; prefer `value`
|
|
5221
|
+
* (replace) over `delta` (append). Great for live form-fill UIs.
|
|
5222
|
+
*/
|
|
5223
|
+
onGadgetArgsPartial?: (partial: {
|
|
5224
|
+
gadgetName: string;
|
|
5225
|
+
invocationId: string;
|
|
5226
|
+
fieldPath: string;
|
|
5227
|
+
value: string;
|
|
5228
|
+
delta: string;
|
|
5229
|
+
isFieldComplete: boolean;
|
|
5230
|
+
}) => void | Promise<void>;
|
|
5158
5231
|
/** Called when a gadget execution completes */
|
|
5159
5232
|
onGadgetResult?: (result: {
|
|
5160
5233
|
gadgetName: string;
|
|
@@ -8031,6 +8104,10 @@ declare class StreamProcessor {
|
|
|
8031
8104
|
private readonly logger;
|
|
8032
8105
|
private readonly parser;
|
|
8033
8106
|
private readonly tree?;
|
|
8107
|
+
/** LLM-call node these gadgets hang off; used to derive subagentContext for partials. */
|
|
8108
|
+
private readonly parentNodeId?;
|
|
8109
|
+
/** Parent agent observers (subagent visibility) — also notified for arg partials. */
|
|
8110
|
+
private readonly parentObservers?;
|
|
8034
8111
|
private responseText;
|
|
8035
8112
|
private readonly dependencyResolver;
|
|
8036
8113
|
/** Queue of completed gadget results ready to be yielded (for real-time streaming) */
|
|
@@ -8830,9 +8907,13 @@ interface StreamParserOptions {
|
|
|
8830
8907
|
declare class GadgetCallParser {
|
|
8831
8908
|
private buffer;
|
|
8832
8909
|
private lastEmittedTextOffset;
|
|
8910
|
+
/** Non-null only while a single trailing gadget block is mid-stream. */
|
|
8911
|
+
private currentPartial;
|
|
8833
8912
|
private readonly startPrefix;
|
|
8834
8913
|
private readonly endPrefix;
|
|
8835
8914
|
private readonly argPrefix;
|
|
8915
|
+
/** Length of the longest marker; `maxMarkerLength - 1` is the scan-resume overlap. */
|
|
8916
|
+
private readonly maxMarkerLength;
|
|
8836
8917
|
constructor(options?: StreamParserOptions);
|
|
8837
8918
|
/**
|
|
8838
8919
|
* Extract and consume text up to the given index.
|
|
@@ -8862,6 +8943,43 @@ declare class GadgetCallParser {
|
|
|
8862
8943
|
*/
|
|
8863
8944
|
private parseParameters;
|
|
8864
8945
|
feed(chunk: string): Generator<StreamEvent>;
|
|
8946
|
+
/** Create fresh partial-tracking state for a newly-started streaming gadget. */
|
|
8947
|
+
private newPartialState;
|
|
8948
|
+
/**
|
|
8949
|
+
* Emit per-field "growing value" partials for an in-progress (or, when
|
|
8950
|
+
* `allComplete`, a just-completed) gadget body delimited by [bodyStart, bodyEnd).
|
|
8951
|
+
*
|
|
8952
|
+
* Incremental by design: each call resumes the `!!!ARG:` scan near where the last
|
|
8953
|
+
* one stopped (backing off by one marker's worth so a marker split across a chunk
|
|
8954
|
+
* boundary is still found) and only re-touches the in-progress field, so a long
|
|
8955
|
+
* streamed body costs O(new bytes) per feed instead of O(body). Every field except
|
|
8956
|
+
* the in-progress (last) one is complete — a following `!!!ARG:` terminated it; the
|
|
8957
|
+
* last field is tentative unless `allComplete`. The tentative field holds back any
|
|
8958
|
+
* suffix that is a partial prefix of a gadget marker so it never leaks into a value.
|
|
8959
|
+
*
|
|
8960
|
+
* We deliberately do NOT run stripMarkdownFences here: an unbalanced opening fence
|
|
8961
|
+
* sits before the first `!!!ARG:` (never emitted) and the authoritative gadget_call
|
|
8962
|
+
* still strips fences from the full raw parameters.
|
|
8963
|
+
*/
|
|
8964
|
+
private emitArgPartials;
|
|
8965
|
+
/**
|
|
8966
|
+
* Emit a single field whose `!!!ARG:` marker starts at `markerAbs` and whose value
|
|
8967
|
+
* runs to `valueEndAbs` (the next marker, or the body end). Mirrors the per-field
|
|
8968
|
+
* semantics of the old split-based emitter: field-path line, hold-back for a
|
|
8969
|
+
* tentative value, single trailing-newline strip.
|
|
8970
|
+
*/
|
|
8971
|
+
private emitFieldRange;
|
|
8972
|
+
/**
|
|
8973
|
+
* Emit a single partial for a field, but only when its value grew or it newly
|
|
8974
|
+
* completed — keeping event volume proportional to field growth, not characters.
|
|
8975
|
+
*/
|
|
8976
|
+
private emitFieldDelta;
|
|
8977
|
+
/**
|
|
8978
|
+
* Length of the longest suffix of `value` that is a proper prefix of any gadget
|
|
8979
|
+
* marker (start/end/arg). Used to hold back the beginning of an incoming marker
|
|
8980
|
+
* so it never appears inside a streamed value.
|
|
8981
|
+
*/
|
|
8982
|
+
private trailingPartialMarkerLength;
|
|
8865
8983
|
finalize(): Generator<StreamEvent>;
|
|
8866
8984
|
reset(): void;
|
|
8867
8985
|
}
|
|
@@ -11147,4 +11265,4 @@ declare const timing: {
|
|
|
11147
11265
|
*/
|
|
11148
11266
|
declare function getHostExports(ctx: ExecutionContext): HostExports;
|
|
11149
11267
|
|
|
11150
|
-
export { AbortException, AbstractGadget, type AddGadgetParams, type AddLLMCallParams, type AfterGadgetExecutionAction, type AfterGadgetExecutionControllerContext, type AfterLLMCallAction, type AfterLLMCallControllerContext, type AfterLLMErrorAction, Agent, AgentBuilder, type AgentHooks, type AgentOptions, AnthropicMessagesProvider, type AudioContentPart, type AudioMimeType, type AudioSource, type BaseExecutionEvent, BaseSessionManager, type BeforeGadgetExecutionAction, type BeforeLLMCallAction, type BeforeSkillActivationAction, BudgetPricingUnavailableError, type CachingConfig, type CachingScope, type ChunkInterceptorContext, type CompactionConfig, type CompactionContext, type CompactionEvent, CompactionManager, type CompactionResult, type CompactionStats, type CompactionStrategy, type CompleteGadgetParams, type CompleteLLMCallParams, type ContentPart, type Controllers, ConversationManager, type CostEstimate, type CostReportingLLMist, type CreateGadgetConfig, type CreateMcpServerOptions, DEFAULT_COMPACTION_CONFIG, DEFAULT_HINTS, DEFAULT_MCP_COMMAND_ALLOWLIST, DEFAULT_PROMPTS, DEFAULT_RATE_LIMIT_CONFIG, DEFAULT_RETRY_CONFIG, DEFAULT_SUMMARIZATION_PROMPT, EmptyCompletionError, type EventHandlers, type ExecutionContext, type ExecutionEvent, type ExecutionEventType, type ExecutionNode, type ExecutionNodeType, ExecutionTree, FALLBACK_CHARS_PER_TOKEN, type FileLoggingOptions, type FileLoggingState, type FileWrittenInfo, type FormatLLMErrorContext, GADGET_ARG_PREFIX, GADGET_END_PREFIX, GADGET_START_PREFIX, Gadget, type GadgetCallEvent, GadgetCallParser, type GadgetClass, type GadgetCompleteEvent, type GadgetConfig, type GadgetErrorEvent, type GadgetEvent, type GadgetExample, type GadgetExecuteResult, type GadgetExecuteResultWithMedia, type GadgetExecuteReturn, type GadgetExecutionControllerContext, type GadgetExecutionMode, type GadgetExecutionResult, GadgetExecutor, type GadgetExecutorOptions, type GadgetFactoryExports, type GadgetMediaOutput, type GadgetNode, type GadgetOrClass, GadgetOutputStore, type GadgetParameterInterceptorContext, GadgetRegistry, type GadgetResultInterceptorContext, type GadgetSkippedEvent, type GadgetStartEvent, type GadgetState, GeminiGenerativeProvider, type HintContext, type HintTemplate, type HintsConfig, type HistoryMessage, HookPresets, type HostExports, type HttpMcpServerSpec, HuggingFaceProvider, type HumanInputRequiredEvent, HumanInputRequiredException, HybridStrategy, type IConversationManager, type ISessionManager, type ImageBase64Source, type ImageContentPart, type ImageGenerationOptions, type ImageGenerationResult, type ImageMimeType, type ImageModelSpec, type ImageSource, type ImageUrlSource, type Interceptors, type IterationHintOptions, type JSONSchemaLike, JsonSchemaConversionError, type LLMCallCompleteEvent, type LLMCallControllerContext, type LLMCallErrorEvent, type LLMCallNode, type LLMCallStartEvent, type LLMCallStreamEvent, type LLMErrorControllerContext, type LLMEvent, type LLMGenerationOptions, type LLMMessage, LLMMessageBuilder, type LLMResponseEndEvent, type LLMStream, type LLMStreamChunk, LLMist, type LLMistOptions, type LLMistPackageManifest, LOAD_SKILL_GADGET_NAME, type LoggerOptions, type LoggingOptions, MODEL_ALIASES, McpClient, type McpClientOptions, McpConnectError, type McpContentBlock, McpError, McpLifecycle, type McpServerCapabilities, type McpServerHandle, type McpServerSpec, type McpToolAdapterOptions, McpToolCallError, type McpToolDescriptor, type McpToolResult, McpUntrustedCommandError, type MediaKind, type MediaMetadata, MediaStore, type MessageContent, type MessageInterceptorContext, type MessageRole, type MessageTurn, type ModelDescriptor, type ModelFeatures, ModelIdentifierParser, type ModelLimits, type ModelPricing, ModelRegistry, type ModelSpec, type NodeId, type ObserveChunkContext, type ObserveCompactionContext, type ObserveGadgetCompleteContext, type ObserveGadgetStartContext, type ObserveLLMCallContext, type ObserveLLMCompleteContext, type ObserveLLMErrorContext, type ObserveRateLimitThrottleContext, type ObserveRetryAttemptContext, type ObserveSkillActivatedContext, type Observers, OpenAIChatProvider, type OpenAICompatibleConfig, OpenAICompatibleProvider, type OpenRouterConfig, OpenRouterProvider, type OpenRouterRouting, type OutputLimitConfig, type ParallelGadgetHintOptions, type ParsedGadgetCall, type ParsedSkill, type PrefixConfig, type PresetDefinition, type PromptContext, type PromptTemplate, type PromptTemplateConfig, type ProviderAdapter, type ProviderIdentifier, type RateLimitConfig, type RateLimitStats, RateLimitTracker, type ReasoningConfig, type ReasoningEffort, type ResolveValueOptions, type ResolvedCompactionConfig, type ResolvedRateLimitConfig, type ResolvedRetryConfig, type RetryConfig, type RetryOptions, type SessionManifestEntry, SimpleSessionManager, Skill, type SkillActivation, type SkillActivationControllerContext, type SkillActivationOptions, type SkillInstructionInterceptorContext, type SkillMetadata, SkillRegistry, type SkillResource, type SkillSource, SlidingWindowStrategy, type SpeechGenerationOptions, type SpeechGenerationResult, type SpeechModelSpec, type StdioMcpServerSpec, type StoredMedia, type StoredOutput, type StreamCompleteEvent, type StreamEvent, type StreamProcessingResult, StreamProcessor, type StreamProcessorOptions, type SubagentConfig, type SubagentConfigMap, type SubagentContext, type SubagentManifestEntry, type SubagentOptions, SummarizationStrategy, TaskCompletionSignal, type TextContentPart, type TextEvent, type TextGenerationOptions, type TextOnlyAction, type TextOnlyContext, type TextOnlyCustomHandler, type TextOnlyGadgetConfig, type TextOnlyHandler, type TextOnlyStrategy, type ThinkingChunk, type ThinkingEvent, TimeoutException, type TokenUsage, type TrailingMessage, type TrailingMessageContext, type CompactionEvent$1 as TreeCompactionEvent, type TreeConfig, type GadgetSkippedEvent$1 as TreeGadgetSkippedEvent, type TriggeredLimitInfo, type ValidationIssue, type ValidationResult, type VisionAnalyzeOptions, type VisionAnalyzeResult, assertCommandAllowed, audioFromBase64, audioFromBuffer, collectEvents, collectText, complete, createAnthropicProviderFromEnv, createFileLoggingState, createGadget, createGadgetOutputViewer, createGeminiProviderFromEnv, createHints, createHuggingFaceProviderFromEnv, createLoadSkillGadget, createLogger, createMcpServer, createMediaOutput, createOpenAIProviderFromEnv, createOpenRouterProviderFromEnv, createSubagent, defaultLogger, detectAudioMimeType, detectImageMimeType, discoverProviderAdapters, discoverSkills, extractMessageText, extractRetryAfterMs, filterByDepth, filterByParent, filterRootEvents, format, formatBytes, formatCallNumber, formatDate, formatDuration, formatLLMError, formatLlmRequest, gadgetError, gadgetResultToMcpContent, gadgetSuccess, gadgetToMcpTool, getErrorMessage, getHostExports, getModelId, getPresetGadgets, getProvider, getSubagent, groupByParent, hasHostExports, hasPreset, hasProviderPrefix, hasSubagents, humanDelay, imageFromBase64, imageFromBuffer, imageFromUrl, isAbortError, isAudioPart, isDataUrl, isGadgetEvent, isImagePart, isLLMEvent, isLikelyContextOverflow, isRetryableError, isRootEvent, isSubagentEvent, isTextPart, iterationProgressHint, jsonSchemaToZod, listPresets, listSubagents, loadSkillsFromDirectory, mcpToolToGadget, normalizeMessageContent, parallelGadgetHint, parseDataUrl, parseFrontmatter, parseManifest, parseMetadata, parseRetryAfterHeader, parseSkillContent, parseSkillFile, randomDelay, renderSkillForMcpPrompt, resetFileLoggingState, resolveConfig, resolveHintTemplate, resolveInstructions, resolveModel, resolvePromptTemplate, resolveRateLimitConfig, resolveRetryConfig, resolveRulesTemplate, resolveSubagentModel, resolveSubagentTimeout, resolveValue, resultWithAudio, resultWithFile, resultWithImage, resultWithImages, resultWithMedia, runGadgetForMcp, runWithHandlers, scanResources, schemaToJSONSchema, skillToMcpPrompt, stream, stripProviderPrefix, substituteArguments, substituteVariables, text, timing, toBase64, truncate, validateAndApplyDefaults, validateGadgetParams, validateGadgetSchema, validateMetadata, withErrorHandling, withRetry, withTimeout };
|
|
11268
|
+
export { AbortException, AbstractGadget, type AddGadgetParams, type AddLLMCallParams, type AfterGadgetExecutionAction, type AfterGadgetExecutionControllerContext, type AfterLLMCallAction, type AfterLLMCallControllerContext, type AfterLLMErrorAction, Agent, AgentBuilder, type AgentHooks, type AgentOptions, AnthropicMessagesProvider, type AudioContentPart, type AudioMimeType, type AudioSource, type BaseExecutionEvent, BaseSessionManager, type BeforeGadgetExecutionAction, type BeforeLLMCallAction, type BeforeSkillActivationAction, BudgetPricingUnavailableError, type CachingConfig, type CachingScope, type ChunkInterceptorContext, type CompactionConfig, type CompactionContext, type CompactionEvent, CompactionManager, type CompactionResult, type CompactionStats, type CompactionStrategy, type CompleteGadgetParams, type CompleteLLMCallParams, type ContentPart, type Controllers, ConversationManager, type CostEstimate, type CostReportingLLMist, type CreateGadgetConfig, type CreateMcpServerOptions, DEFAULT_COMPACTION_CONFIG, DEFAULT_HINTS, DEFAULT_MCP_COMMAND_ALLOWLIST, DEFAULT_PROMPTS, DEFAULT_RATE_LIMIT_CONFIG, DEFAULT_RETRY_CONFIG, DEFAULT_SUMMARIZATION_PROMPT, EmptyCompletionError, type EventHandlers, type ExecutionContext, type ExecutionEvent, type ExecutionEventType, type ExecutionNode, type ExecutionNodeType, ExecutionTree, FALLBACK_CHARS_PER_TOKEN, type FileLoggingOptions, type FileLoggingState, type FileWrittenInfo, type FormatLLMErrorContext, GADGET_ARG_PREFIX, GADGET_END_PREFIX, GADGET_START_PREFIX, Gadget, type GadgetArgsPartialEvent, type GadgetCallEvent, GadgetCallParser, type GadgetClass, type GadgetCompleteEvent, type GadgetConfig, type GadgetErrorEvent, type GadgetEvent, type GadgetExample, type GadgetExecuteResult, type GadgetExecuteResultWithMedia, type GadgetExecuteReturn, type GadgetExecutionControllerContext, type GadgetExecutionMode, type GadgetExecutionResult, GadgetExecutor, type GadgetExecutorOptions, type GadgetFactoryExports, type GadgetMediaOutput, type GadgetNode, type GadgetOrClass, GadgetOutputStore, type GadgetParameterInterceptorContext, GadgetRegistry, type GadgetResultInterceptorContext, type GadgetSkippedEvent, type GadgetStartEvent, type GadgetState, GeminiGenerativeProvider, type HintContext, type HintTemplate, type HintsConfig, type HistoryMessage, HookPresets, type HostExports, type HttpMcpServerSpec, HuggingFaceProvider, type HumanInputRequiredEvent, HumanInputRequiredException, HybridStrategy, type IConversationManager, type ISessionManager, type ImageBase64Source, type ImageContentPart, type ImageGenerationOptions, type ImageGenerationResult, type ImageMimeType, type ImageModelSpec, type ImageSource, type ImageUrlSource, type Interceptors, type IterationHintOptions, type JSONSchemaLike, JsonSchemaConversionError, type LLMCallCompleteEvent, type LLMCallControllerContext, type LLMCallErrorEvent, type LLMCallNode, type LLMCallStartEvent, type LLMCallStreamEvent, type LLMErrorControllerContext, type LLMEvent, type LLMGenerationOptions, type LLMMessage, LLMMessageBuilder, type LLMResponseEndEvent, type LLMStream, type LLMStreamChunk, LLMist, type LLMistOptions, type LLMistPackageManifest, LOAD_SKILL_GADGET_NAME, type LoggerOptions, type LoggingOptions, MODEL_ALIASES, McpClient, type McpClientOptions, McpConnectError, type McpContentBlock, McpError, McpLifecycle, type McpServerCapabilities, type McpServerHandle, type McpServerSpec, type McpToolAdapterOptions, McpToolCallError, type McpToolDescriptor, type McpToolResult, McpUntrustedCommandError, type MediaKind, type MediaMetadata, MediaStore, type MessageContent, type MessageInterceptorContext, type MessageRole, type MessageTurn, type ModelDescriptor, type ModelFeatures, ModelIdentifierParser, type ModelLimits, type ModelPricing, ModelRegistry, type ModelSpec, type NodeId, type ObserveChunkContext, type ObserveCompactionContext, type ObserveGadgetArgsPartialContext, type ObserveGadgetCompleteContext, type ObserveGadgetStartContext, type ObserveLLMCallContext, type ObserveLLMCompleteContext, type ObserveLLMErrorContext, type ObserveRateLimitThrottleContext, type ObserveRetryAttemptContext, type ObserveSkillActivatedContext, type Observers, OpenAIChatProvider, type OpenAICompatibleConfig, OpenAICompatibleProvider, type OpenRouterConfig, OpenRouterProvider, type OpenRouterRouting, type OutputLimitConfig, type ParallelGadgetHintOptions, type ParsedGadgetCall, type ParsedSkill, type PrefixConfig, type PresetDefinition, type PromptContext, type PromptTemplate, type PromptTemplateConfig, type ProviderAdapter, type ProviderIdentifier, type RateLimitConfig, type RateLimitStats, RateLimitTracker, type ReasoningConfig, type ReasoningEffort, type ResolveValueOptions, type ResolvedCompactionConfig, type ResolvedRateLimitConfig, type ResolvedRetryConfig, type RetryConfig, type RetryOptions, type SessionManifestEntry, SimpleSessionManager, Skill, type SkillActivation, type SkillActivationControllerContext, type SkillActivationOptions, type SkillInstructionInterceptorContext, type SkillMetadata, SkillRegistry, type SkillResource, type SkillSource, SlidingWindowStrategy, type SpeechGenerationOptions, type SpeechGenerationResult, type SpeechModelSpec, type StdioMcpServerSpec, type StoredMedia, type StoredOutput, type StreamCompleteEvent, type StreamEvent, type StreamProcessingResult, StreamProcessor, type StreamProcessorOptions, type SubagentConfig, type SubagentConfigMap, type SubagentContext, type SubagentManifestEntry, type SubagentOptions, SummarizationStrategy, TaskCompletionSignal, type TextContentPart, type TextEvent, type TextGenerationOptions, type TextOnlyAction, type TextOnlyContext, type TextOnlyCustomHandler, type TextOnlyGadgetConfig, type TextOnlyHandler, type TextOnlyStrategy, type ThinkingChunk, type ThinkingEvent, TimeoutException, type TokenUsage, type TrailingMessage, type TrailingMessageContext, type CompactionEvent$1 as TreeCompactionEvent, type TreeConfig, type GadgetSkippedEvent$1 as TreeGadgetSkippedEvent, type TriggeredLimitInfo, type ValidationIssue, type ValidationResult, type VisionAnalyzeOptions, type VisionAnalyzeResult, assertCommandAllowed, audioFromBase64, audioFromBuffer, collectEvents, collectText, complete, createAnthropicProviderFromEnv, createFileLoggingState, createGadget, createGadgetOutputViewer, createGeminiProviderFromEnv, createHints, createHuggingFaceProviderFromEnv, createLoadSkillGadget, createLogger, createMcpServer, createMediaOutput, createOpenAIProviderFromEnv, createOpenRouterProviderFromEnv, createSubagent, defaultLogger, detectAudioMimeType, detectImageMimeType, discoverProviderAdapters, discoverSkills, extractMessageText, extractRetryAfterMs, filterByDepth, filterByParent, filterRootEvents, format, formatBytes, formatCallNumber, formatDate, formatDuration, formatLLMError, formatLlmRequest, gadgetError, gadgetResultToMcpContent, gadgetSuccess, gadgetToMcpTool, getErrorMessage, getHostExports, getModelId, getPresetGadgets, getProvider, getSubagent, groupByParent, hasHostExports, hasPreset, hasProviderPrefix, hasSubagents, humanDelay, imageFromBase64, imageFromBuffer, imageFromUrl, isAbortError, isAudioPart, isDataUrl, isGadgetEvent, isImagePart, isLLMEvent, isLikelyContextOverflow, isRetryableError, isRootEvent, isSubagentEvent, isTextPart, iterationProgressHint, jsonSchemaToZod, listPresets, listSubagents, loadSkillsFromDirectory, mcpToolToGadget, normalizeMessageContent, parallelGadgetHint, parseDataUrl, parseFrontmatter, parseManifest, parseMetadata, parseRetryAfterHeader, parseSkillContent, parseSkillFile, randomDelay, renderSkillForMcpPrompt, resetFileLoggingState, resolveConfig, resolveHintTemplate, resolveInstructions, resolveModel, resolvePromptTemplate, resolveRateLimitConfig, resolveRetryConfig, resolveRulesTemplate, resolveSubagentModel, resolveSubagentTimeout, resolveValue, resultWithAudio, resultWithFile, resultWithImage, resultWithImages, resultWithMedia, runGadgetForMcp, runWithHandlers, scanResources, schemaToJSONSchema, skillToMcpPrompt, stream, stripProviderPrefix, substituteArguments, substituteVariables, text, timing, toBase64, truncate, validateAndApplyDefaults, validateGadgetParams, validateGadgetSchema, validateMetadata, withErrorHandling, withRetry, withTimeout };
|