@dudko.dev/agent-web 0.0.50 → 0.0.52
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 +49 -4
- package/dist/agent-web.js +173 -165
- package/dist/agent-web.js.map +1 -1
- package/dist/{chunk-3V27UZT6.js → chunk-DOWC4CFZ.js} +257 -3
- package/dist/chunk-DOWC4CFZ.js.map +1 -0
- package/dist/{chunk-IT77BVAD.js → chunk-HXUR2SG5.js} +2 -2
- package/dist/{chunk-JTZEUPIG.js → chunk-NUL6QEAX.js} +49 -49
- package/dist/chunk-NUL6QEAX.js.map +1 -0
- package/dist/{chunk-6XHCPSZE.js → chunk-QWOKTI62.js} +58 -6
- package/dist/chunk-QWOKTI62.js.map +1 -0
- package/dist/chunk-R5VCITT3.js +192 -0
- package/dist/chunk-R5VCITT3.js.map +1 -0
- package/dist/{chunk-7Y5UC6L7.js → chunk-SVGIGIRR.js} +3 -3
- package/dist/fit-reference-worker.cjs +158 -0
- package/dist/fit-reference-worker.cjs.map +1 -0
- package/dist/fit-reference-worker.d.cts +1 -0
- package/dist/fit-reference-worker.d.ts +1 -0
- package/dist/fit-reference-worker.js +16 -0
- package/dist/fit-reference-worker.js.map +1 -0
- package/dist/index.cjs +1366 -366
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +130 -72
- package/dist/index.d.ts +130 -72
- package/dist/index.js +589 -89
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +2 -2
- package/dist/media-fit-worker-Do1qzteo.d.cts +159 -0
- package/dist/media-fit-worker-Do1qzteo.d.ts +159 -0
- package/dist/{sandbox-IGTCMOOX.js → sandbox-QNEDQZTA.js} +3 -3
- package/dist/secrets.js +3 -3
- package/dist/{webllm-BEL5A4OF.js → webllm-EZSJGU6P.js} +2 -2
- package/package.json +14 -2
- package/dist/chunk-3V27UZT6.js.map +0 -1
- package/dist/chunk-6XHCPSZE.js.map +0 -1
- package/dist/chunk-JTZEUPIG.js.map +0 -1
- /package/dist/{chunk-IT77BVAD.js.map → chunk-HXUR2SG5.js.map} +0 -0
- /package/dist/{chunk-7Y5UC6L7.js.map → chunk-SVGIGIRR.js.map} +0 -0
- /package/dist/{sandbox-IGTCMOOX.js.map → sandbox-QNEDQZTA.js.map} +0 -0
- /package/dist/{webllm-BEL5A4OF.js.map → webllm-EZSJGU6P.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,8 @@ import { P as McpSkillConsentView, B as McpElicitationSchema, y as McpElicitatio
|
|
|
3
3
|
export { g as MCP_APPS_EXTENSION, k as MCP_APP_MAX_HTML_CHARS, l as MCP_APP_MAX_RESULT_CHARS, m as MCP_APP_MIME_TYPE, V as MCP_SKILLS_EXTENSION, W as MCP_SKILLS_MAX_PER_SERVER, X as MCP_SKILLS_MAX_TOTAL, Y as MCP_SKILL_BODY_MAX_CHARS, Z as MCP_SKILL_CONSENTS, _ as MCP_SKILL_CONSENT_DEFAULT, $ as MCP_SKILL_DESCRIPTION_MAX_CHARS, a0 as MCP_SKILL_DIRECTORY_ENTRIES_MAX, a1 as MCP_SKILL_FILE_MAX_CHARS, a2 as MCP_SKILL_MAX_RESOURCES, a3 as MCP_SKILL_MAX_TOTAL_BYTES, a4 as MCP_SKILL_SNAPSHOTS_MAX_BYTES, a5 as MCP_SKILL_SNAPSHOT_MAX_DEPTH, a6 as MCP_SKILL_SNAPSHOT_MAX_DIRECTORIES, a7 as MCP_SKILL_URI_MAX_CHARS, q as McpAppCsp, r as McpAppPermissions, b as McpAppResource, c as McpAppVisibility, x as McpElicitationFieldSchema, a8 as McpSkillsOptions, f as McpSkillsSetting, a9 as SkillDirectoryListing, G as mcpAppOrigin, aa as mcpSkillEntryRefusal, ab as mcpSkillPreamble, ac as mcpSkillUriRefusal } from './skills-ufoyTJ-B.cjs';
|
|
4
4
|
import { PipelineEvent, PipelineNode, PipelineDefinition, PipelineResult, PipelineNodeRunner } from './pipeline-engine.cjs';
|
|
5
5
|
export { PIPELINE_LIMITS, PIPELINE_ROUTER_SYSTEM, PipelineAbortBehaviour, PipelineCondition, PipelineEdge, PipelineGraphRunOptions, PipelineIssue, PipelineNodeContext, PipelineNodeError, PipelineNodeEvent, PipelineNodeInput, PipelineNodeOutput, PipelineNodeSource, PipelinePlan, PipelineRoute, PipelineStop, PipelineTraceEntry, PipelineUsage, PipelineValidation, PipelineValidationError, matchPipelineRoute, normalizePipeline, preparePipeline, renderPipelineNodeInput, renderPipelineRoutePrompt, runPipelineGraph, testPipelineCondition, validatePipeline } from './pipeline-engine.cjs';
|
|
6
|
+
import { I as IReferenceUse, M as MediaFitReference, a as IGeneratedPictures, b as IReferenceResult } from './media-fit-worker-Do1qzteo.cjs';
|
|
7
|
+
export { F as FitReferenceWorker, c as FitReferenceWorkerScope, G as GENERATE_IMAGE_TOOL, d as GENERATE_SPEECH_TOOL, e as IFitReferenceOptions, f as IFittedReference, g as IImageSize, h as IMediaUsage, i as IReferenceBounds, j as IReferencePicture, k as MEDIA_AUDIO_TYPES, l as MEDIA_DEFAULT_MAX_CALLS, m as MEDIA_FIT_TIMEOUT_MS, n as MEDIA_FOLDER, o as MEDIA_IMAGE_TYPES, p as MEDIA_MAX_ATTACHED_AUDIO, q as MEDIA_MAX_AUDIO_INPUT_BYTES, r as MEDIA_MAX_IMAGE_BYTES, s as MEDIA_MAX_PROMPT_CHARS, t as MEDIA_MAX_REFERENCE_BYTES, u as MEDIA_MAX_REFERENCE_IMAGES, v as MEDIA_MAX_REFERENCE_SIDE, w as MEDIA_MAX_REFERENCE_SOURCE_BYTES, x as MEDIA_MAX_REFERENCE_SOURCE_PIXELS, y as MEDIA_MAX_REFERENCE_TOTAL_BYTES, z as MEDIA_MAX_SPEECH_BYTES, A as MEDIA_MAX_SPEECH_CHARS, B as MEDIA_MAX_TRANSCRIPT_CHARS, C as MEDIA_REFERENCE_TYPES, D as MEDIA_TIMEOUT_MS, E as MediaBudgetError, H as MediaError, J as MediaKind, S as ServeFitReferenceOptions, T as TRANSCRIBE_AUDIO_TOOL, K as acceptMedia, L as acceptReference, N as acceptReferenceSource, O as fitReferenceImage, P as fitReferenceInWorker, Q as imageDimensions, R as mediaUsageOf, U as serveFitReferenceWorker, V as sniffMediaType, W as wrapTranscript } from './media-fit-worker-Do1qzteo.cjs';
|
|
6
8
|
import { CredentialStore } from './secrets.cjs';
|
|
7
9
|
export { EncryptedBlob, MemoryCredentialStore, VaultCredentialStore, decryptJSON, encryptJSON, getOrCreateVaultKey } from './secrets.cjs';
|
|
8
10
|
import { A as AgentToolSet, a as AgentTool } from './types-DwSMj_Xs.cjs';
|
|
@@ -828,71 +830,6 @@ declare const checkAskUserAnswer: (q: AskUserQuestion, raw: unknown) => {
|
|
|
828
830
|
reason: string;
|
|
829
831
|
};
|
|
830
832
|
|
|
831
|
-
declare const GENERATE_IMAGE_TOOL = "generate_image";
|
|
832
|
-
declare const GENERATE_SPEECH_TOOL = "generate_speech";
|
|
833
|
-
declare const TRANSCRIBE_AUDIO_TOOL = "transcribe_audio";
|
|
834
|
-
type MediaKind = 'image' | 'speech' | 'transcription';
|
|
835
|
-
declare const MEDIA_DEFAULT_MAX_CALLS = 8;
|
|
836
|
-
declare const MEDIA_TIMEOUT_MS = 120000;
|
|
837
|
-
declare const MEDIA_MAX_IMAGE_BYTES: number;
|
|
838
|
-
declare const MEDIA_MAX_SPEECH_BYTES: number;
|
|
839
|
-
declare const MEDIA_MAX_AUDIO_INPUT_BYTES: number;
|
|
840
|
-
declare const MEDIA_MAX_PROMPT_CHARS = 4000;
|
|
841
|
-
declare const MEDIA_MAX_SPEECH_CHARS = 4000;
|
|
842
|
-
declare const MEDIA_MAX_TRANSCRIPT_CHARS = 20000;
|
|
843
|
-
declare const MEDIA_MAX_ATTACHED_AUDIO = 4;
|
|
844
|
-
declare const MEDIA_MAX_REFERENCE_IMAGES = 4;
|
|
845
|
-
declare const MEDIA_MAX_REFERENCE_BYTES: number;
|
|
846
|
-
declare const MEDIA_MAX_REFERENCE_TOTAL_BYTES: number;
|
|
847
|
-
declare const MEDIA_MAX_REFERENCE_SIDE = 4096;
|
|
848
|
-
declare const MEDIA_FOLDER = "media";
|
|
849
|
-
declare class MediaError extends Error {
|
|
850
|
-
constructor(message: string);
|
|
851
|
-
toJSON(): string;
|
|
852
|
-
}
|
|
853
|
-
declare class MediaBudgetError extends MediaError {
|
|
854
|
-
constructor(cap: number);
|
|
855
|
-
}
|
|
856
|
-
declare const MEDIA_IMAGE_TYPES: Readonly<Record<string, string>>;
|
|
857
|
-
declare const MEDIA_AUDIO_TYPES: Readonly<Record<string, string>>;
|
|
858
|
-
declare const MEDIA_REFERENCE_TYPES: Readonly<Record<string, string>>;
|
|
859
|
-
declare const sniffMediaType: (bytes: Uint8Array) => string | undefined;
|
|
860
|
-
interface IAcceptedMedia {
|
|
861
|
-
mediaType: string;
|
|
862
|
-
ext: string;
|
|
863
|
-
}
|
|
864
|
-
declare const acceptMedia: (family: "image" | "audio", bytes: Uint8Array, maxBytes: number, what: string) => IAcceptedMedia;
|
|
865
|
-
interface IImageSize {
|
|
866
|
-
width: number;
|
|
867
|
-
height: number;
|
|
868
|
-
}
|
|
869
|
-
declare const imageDimensions: (bytes: Uint8Array) => IImageSize | undefined;
|
|
870
|
-
interface IAcceptedReference extends IAcceptedMedia, IImageSize {
|
|
871
|
-
}
|
|
872
|
-
declare const acceptReference: (bytes: Uint8Array, what: string) => IAcceptedReference;
|
|
873
|
-
interface IReferenceUse {
|
|
874
|
-
used: boolean;
|
|
875
|
-
count: number;
|
|
876
|
-
paths: string[];
|
|
877
|
-
}
|
|
878
|
-
interface IReferenceResult extends IReferenceUse {
|
|
879
|
-
note?: string;
|
|
880
|
-
}
|
|
881
|
-
interface IMediaUsage {
|
|
882
|
-
mediaCalls: number;
|
|
883
|
-
imagesGenerated: number;
|
|
884
|
-
speechCharacters: number;
|
|
885
|
-
transcriptionSeconds: number;
|
|
886
|
-
}
|
|
887
|
-
declare const mediaUsageOf: (usage: Partial<IMediaUsage> | undefined) => IMediaUsage | undefined;
|
|
888
|
-
interface ITranscriptBlock {
|
|
889
|
-
name: string;
|
|
890
|
-
text: string;
|
|
891
|
-
language?: string;
|
|
892
|
-
durationInSeconds?: number;
|
|
893
|
-
}
|
|
894
|
-
declare const wrapTranscript: (block: ITranscriptBlock) => string;
|
|
895
|
-
|
|
896
833
|
type ReplanMode = 'continue' | 'revise' | 'finish';
|
|
897
834
|
type Phase = 'plan' | 'execute' | 'replan' | 'synthesize';
|
|
898
835
|
/**
|
|
@@ -1516,14 +1453,37 @@ interface SessionWatch {
|
|
|
1516
1453
|
readonly state: SessionRunState;
|
|
1517
1454
|
/**
|
|
1518
1455
|
* Say something to the run in the other tab: it reaches the model at the run's next boundary,
|
|
1519
|
-
* as `RunControl.send` does there.
|
|
1520
|
-
*
|
|
1521
|
-
*
|
|
1456
|
+
* as `RunControl.send` does there. The answer is THAT tab's, and nothing else decides it while
|
|
1457
|
+
* the run goes:
|
|
1458
|
+
*
|
|
1459
|
+
* - `true` when that tab took the message (its acknowledgement);
|
|
1460
|
+
* - `false` when it refused it (the run has no `control`, already took `RELAY_MAX_SENDS`, or is
|
|
1461
|
+
* finishing), or when the run ENDED without taking it - its tab said so (`done`, `stopped`), or
|
|
1462
|
+
* nobody holds the session any more (`gone`: the tab closed or crashed). One tab's messages
|
|
1463
|
+
* keep their order and it answers a message before it says its run is over, so an end with no
|
|
1464
|
+
* answer before it means that run never took it.
|
|
1465
|
+
*
|
|
1466
|
+
* There is no time limit while the run's tab holds the session: a tab the browser froze in the
|
|
1467
|
+
* background (a phone does that to every tab out of sight) takes the message when it wakes, so
|
|
1468
|
+
* "no answer yet" is not a refusal - the promise stays pending, and a host that showed the text
|
|
1469
|
+
* as refused would hand it to a second run. Only the tab that announced the run decides: an
|
|
1470
|
+
* answer, or an end, posted under another tab's id is ignored (any page of the origin can post).
|
|
1471
|
+
*
|
|
1472
|
+
* Resolves `false` at once when nothing runs or the text is empty or over
|
|
1473
|
+
* `RELAY_MAX_SEND_CHARS`, and on `close()` - then the other tab may still take it: this watch no
|
|
1474
|
+
* longer knows. Where the browser cannot be asked who holds the session (no
|
|
1475
|
+
* `navigator.locks.query()`), a run whose tab closed is never seen to end, and a message to it
|
|
1476
|
+
* waits until `close()`.
|
|
1522
1477
|
*/
|
|
1523
1478
|
send(text: string): Promise<boolean>;
|
|
1524
|
-
/**
|
|
1479
|
+
/**
|
|
1480
|
+
* Stop the run in the other tab. Resolves true when that tab took the request, false when it
|
|
1481
|
+
* refused or no answer came in 3 s. A stop may keep that bound where a message may not: it is
|
|
1482
|
+
* idempotent - a stop a frozen tab takes late stops the run it was meant for, and asking again
|
|
1483
|
+
* stops it once.
|
|
1484
|
+
*/
|
|
1525
1485
|
stop(): Promise<boolean>;
|
|
1526
|
-
/** Stop watching. */
|
|
1486
|
+
/** Stop watching. A message still waiting for its answer resolves `false`. */
|
|
1527
1487
|
close(): void;
|
|
1528
1488
|
}
|
|
1529
1489
|
/**
|
|
@@ -2618,6 +2578,33 @@ interface IMediaConfig {
|
|
|
2618
2578
|
* a call with `images` makes the picture from the text alone and its result says so.
|
|
2619
2579
|
*/
|
|
2620
2580
|
imageInputs?: boolean;
|
|
2581
|
+
/**
|
|
2582
|
+
* Make a reference picture that is over the bounds (over 4096 px on its longer side, over 8 MiB,
|
|
2583
|
+
* or the pictures of a call over 12 MiB together) small enough to send, instead of refusing it.
|
|
2584
|
+
* Called with a COPY of the picture's bytes and its size in pixels, only for a PNG / JPEG / WebP
|
|
2585
|
+
* of the workspace within the source bounds (50 MiB, 200 MP - read from its header, so nothing
|
|
2586
|
+
* larger is ever decoded); its answer is checked again by the same guards. The file in the
|
|
2587
|
+
* workspace is never changed. `fitReferenceImage` does it with the browser's own codecs; run it
|
|
2588
|
+
* in a Web Worker (`fitReferenceInWorker`) so the page never waits on an encode. Default: none -
|
|
2589
|
+
* a picture over the bounds is refused.
|
|
2590
|
+
*/
|
|
2591
|
+
fitReference?: MediaFitReference;
|
|
2592
|
+
/** One call of `fitReference`, in ms (its `signal` is aborted then). Default 30 000. */
|
|
2593
|
+
fitTimeoutMs?: number;
|
|
2594
|
+
/**
|
|
2595
|
+
* Show the executor's model the picture `generate_image` made, ONCE, in the request right after
|
|
2596
|
+
* the call (an image part of that tool result), so it can check it against the request, make a
|
|
2597
|
+
* wrong one again, and say later what it drew. Default: on where the step's model reads
|
|
2598
|
+
* pictures (`inputs.images` / `vision`, else `supportsImages`; unknown = no) and its adapter
|
|
2599
|
+
* carries a picture in a tool result (Gemini, Claude, OpenAI's Responses API, xAI, DeepSeek);
|
|
2600
|
+
* `true`: on for any model whose adapter carries it; `false`: off, the path alone as before.
|
|
2601
|
+
* Never for an adapter that would send it as text (OpenAI's Chat Completions, an
|
|
2602
|
+
* OpenAI-compatible endpoint), nor in the prompted tool mode. A picture over 1568 px or
|
|
2603
|
+
* 3.75 MiB is shown as a smaller copy made by `fitReference`, or not at all. About
|
|
2604
|
+
* 1 100-1 600 input tokens a picture. The bytes reach the model call only: never an event, the
|
|
2605
|
+
* trace, a checkpoint, memory or the result.
|
|
2606
|
+
*/
|
|
2607
|
+
viewGenerated?: boolean;
|
|
2621
2608
|
/** Mounts `generate_speech` (text becomes an audio file in the workspace). */
|
|
2622
2609
|
speechModel?: MediaSpeechModel | IMediaModelSpec;
|
|
2623
2610
|
/**
|
|
@@ -2660,6 +2647,11 @@ interface IMediaFile {
|
|
|
2660
2647
|
* paths, and - when they were not - the sentence the model reads. Absent without `images`.
|
|
2661
2648
|
*/
|
|
2662
2649
|
references?: IReferenceResult;
|
|
2650
|
+
/**
|
|
2651
|
+
* `generate_image` on a step whose model is shown pictures, when this one is NOT shown (too
|
|
2652
|
+
* large and not made smaller): the sentence the model reads. Absent otherwise.
|
|
2653
|
+
*/
|
|
2654
|
+
pictureNote?: string;
|
|
2663
2655
|
}
|
|
2664
2656
|
/** What `transcribe_audio` returns. */
|
|
2665
2657
|
interface ITranscription {
|
|
@@ -2680,12 +2672,21 @@ interface IMediaRun {
|
|
|
2680
2672
|
/** The run's usage so far: the cap counts the media calls in it (a resumed run's included). */
|
|
2681
2673
|
usage?: () => IUsage;
|
|
2682
2674
|
runId?: string;
|
|
2675
|
+
/** The run's pictures for its model (`media.viewGenerated`). */
|
|
2676
|
+
pictures?: IGeneratedPictures;
|
|
2683
2677
|
}
|
|
2684
2678
|
interface IMedia {
|
|
2685
2679
|
/** The tools the configured models switch on (maybe none). */
|
|
2686
2680
|
tools: AgentToolSet;
|
|
2687
2681
|
/** True when audio attachments are transcribed (a transcription model, not switched off). */
|
|
2688
2682
|
transcribes: boolean;
|
|
2683
|
+
/**
|
|
2684
|
+
* Set when `generate_image`'s pictures may be shown to the executor's model: the host's
|
|
2685
|
+
* `media.viewGenerated` (undefined = by the model). The runner gives each run its pictures.
|
|
2686
|
+
*/
|
|
2687
|
+
pictures?: {
|
|
2688
|
+
setting: boolean | undefined;
|
|
2689
|
+
};
|
|
2689
2690
|
/**
|
|
2690
2691
|
* Transcribe the audio among a run's attachments: the goal with the transcripts under it, and
|
|
2691
2692
|
* the attachments that are left for the language model.
|
|
@@ -3477,6 +3478,16 @@ interface AgentContext {
|
|
|
3477
3478
|
plannerMode: ToolCallMode;
|
|
3478
3479
|
/** Tool-mode for the executor (from the executor model). */
|
|
3479
3480
|
executorMode: ToolCallMode;
|
|
3481
|
+
/**
|
|
3482
|
+
* Set when `generate_image`'s pictures may be shown to the executor's model
|
|
3483
|
+
* (`media.viewGenerated` not off): the run's pictures, the host's setting, and whether a model
|
|
3484
|
+
* is known to read pictures (the same answer the attachments get).
|
|
3485
|
+
*/
|
|
3486
|
+
pictures?: {
|
|
3487
|
+
desk: IGeneratedPictures;
|
|
3488
|
+
setting: boolean | undefined;
|
|
3489
|
+
readsImages: (model: LanguageModel) => boolean | undefined;
|
|
3490
|
+
};
|
|
3480
3491
|
/** The run's tools (host + MCP + built-ins), already wrapped by the consent gate. */
|
|
3481
3492
|
tools: AgentToolSet;
|
|
3482
3493
|
/** The catalogue as the planner sees it (condensed in search mode). */
|
|
@@ -3627,6 +3638,14 @@ interface RunResult {
|
|
|
3627
3638
|
* stopped or ended). Send them as the next run. Empty when everything was delivered.
|
|
3628
3639
|
*/
|
|
3629
3640
|
undelivered?: string[];
|
|
3641
|
+
/**
|
|
3642
|
+
* The runner's record of what the run DID - `[done: ...]`: each tool it called and how the calls
|
|
3643
|
+
* ended, the files written or deleted, the media made (and whether generate_image's reference
|
|
3644
|
+
* pictures were used), the helpers, whether a question was answered - as the session memory keeps
|
|
3645
|
+
* it on the assistant's message (see `withActionRecord`). Absent when no tool ran. A stopped or
|
|
3646
|
+
* failed run has it too: what it did before it ended.
|
|
3647
|
+
*/
|
|
3648
|
+
actionRecord?: string;
|
|
3630
3649
|
}
|
|
3631
3650
|
interface CompactOptions {
|
|
3632
3651
|
/** Session to compact (default: the config's sessionId). */
|
|
@@ -4319,6 +4338,7 @@ declare const fileToolBindingOf: (t: unknown) => FileToolBinding | undefined;
|
|
|
4319
4338
|
* Tools that give the agent the virtual file system: list, read, write and
|
|
4320
4339
|
* delete. Listing and reading are marked read-only, so the `ask-writes`
|
|
4321
4340
|
* consent mode lets them through and asks before writes and deletes.
|
|
4341
|
+
* `fs_read` takes an optional line range (`startLine` / `endLine`) for part of a long file.
|
|
4322
4342
|
*/
|
|
4323
4343
|
declare const createFileTools: (vfs: VirtualFileSystem, opts?: FileToolsOptions) => ToolSet;
|
|
4324
4344
|
|
|
@@ -4645,6 +4665,11 @@ interface ToolLoopOptions {
|
|
|
4645
4665
|
messages?: ModelMessage[];
|
|
4646
4666
|
/** In native mode: the callable tools. In prompted mode: used to dispatch salvaged calls. */
|
|
4647
4667
|
tools: ToolSet;
|
|
4668
|
+
/**
|
|
4669
|
+
* Native mode, `media.viewGenerated`: the run's pictures - each one generate_image leaves is put
|
|
4670
|
+
* into the next round's request (its call's result) and taken out of every round after it.
|
|
4671
|
+
*/
|
|
4672
|
+
pictures?: IGeneratedPictures;
|
|
4648
4673
|
/**
|
|
4649
4674
|
* Restrict callable tools to these names (plan-narrowed / search). Native mode
|
|
4650
4675
|
* passes them to the SDK's `activeTools`; prompted mode bounds `dispatch` to
|
|
@@ -4876,6 +4901,11 @@ interface ToolRunContext {
|
|
|
4876
4901
|
* helper the run starts shares it, and a subagent the host defined asks through it too.
|
|
4877
4902
|
*/
|
|
4878
4903
|
askUser?: AskUserChannel;
|
|
4904
|
+
/**
|
|
4905
|
+
* Internal - the run's pictures for its model (`media.viewGenerated`): `generate_image` leaves
|
|
4906
|
+
* the picture it made here for the executor to show its model once. Absent when off.
|
|
4907
|
+
*/
|
|
4908
|
+
pictures?: IGeneratedPictures;
|
|
4879
4909
|
}
|
|
4880
4910
|
/** Read the run context the agent passes to a tool's execute (undefined outside a run). */
|
|
4881
4911
|
declare const toolRunContextOf: (options: unknown) => ToolRunContext | undefined;
|
|
@@ -4912,12 +4942,40 @@ declare class IndexedDBStore implements ContextStore {
|
|
|
4912
4942
|
constructor(opts?: IndexedDBStoreOptions);
|
|
4913
4943
|
load(sessionId: string): Promise<StoredMessage[]>;
|
|
4914
4944
|
replace(sessionId: string, messages: StoredMessage[]): Promise<void>;
|
|
4945
|
+
/**
|
|
4946
|
+
* Read the session and write it with `message` added in ONE readwrite transaction: two appends
|
|
4947
|
+
* (a message the user sent during a run, written without waiting, and the answer after it)
|
|
4948
|
+
* cannot both read the same transcript and drop each other's message. They land in the order
|
|
4949
|
+
* they were made.
|
|
4950
|
+
*/
|
|
4915
4951
|
append(sessionId: string, message: StoredMessage): Promise<void>;
|
|
4916
4952
|
clear(sessionId: string): Promise<void>;
|
|
4917
4953
|
/** List all stored session ids. */
|
|
4918
4954
|
listSessions(): Promise<string[]>;
|
|
4919
4955
|
}
|
|
4920
4956
|
|
|
4957
|
+
/** The whole record at most, in characters (UTF-16 code units, as `.length` counts them). */
|
|
4958
|
+
declare const ACTION_RECORD_MAX_CHARS = 300;
|
|
4959
|
+
/**
|
|
4960
|
+
* The one sentence a stage reads with a conversation that carries a record. In the USER prompt,
|
|
4961
|
+
* next to the conversation, and only when a record is in it: a system prompt stays as it was.
|
|
4962
|
+
*/
|
|
4963
|
+
declare const ACTION_RECORD_NOTE = "NOTE: a \"[done: ...]\" line at the end of an assistant message (or of a summary) is the runner's own record of what that turn actually did - the tools it called and how each call ended, the files it wrote or deleted, the media it made and whether reference pictures were used; it outweighs anything an answer said about that turn.";
|
|
4964
|
+
/**
|
|
4965
|
+
* A text kept in the conversation - a model's answer, a summary, the user's message - with every
|
|
4966
|
+
* "[done:" in it made "(done:": only the runner's own record has the mark's shape.
|
|
4967
|
+
*/
|
|
4968
|
+
declare const neutralizeActionRecords: (text: string) => string;
|
|
4969
|
+
/**
|
|
4970
|
+
* What the conversation keeps of an assistant's turn: its answer - with any look-alike made
|
|
4971
|
+
* harmless - and the runner's record on the last line. A turn without an answer (`text` empty:
|
|
4972
|
+
* the run was stopped, or failed) keeps a fixed sentence saying so above its record. Without a
|
|
4973
|
+
* record (no tool ran) it is the answer alone; `record` must be the runner's (`[done: ...]`).
|
|
4974
|
+
*/
|
|
4975
|
+
declare const withActionRecord: (text: string, record?: string, ended?: "stopped" | "failed") => string;
|
|
4976
|
+
/** The record of a run's result, or of the error a run threw (the Node package): or undefined. */
|
|
4977
|
+
declare const actionRecordOf: (value: unknown) => string | undefined;
|
|
4978
|
+
|
|
4921
4979
|
interface RunStoreOptions {
|
|
4922
4980
|
/**
|
|
4923
4981
|
* Keep the snapshot of a run that completed (default false). A completed run has
|
|
@@ -5035,5 +5093,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
|
|
|
5035
5093
|
*/
|
|
5036
5094
|
declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
|
|
5037
5095
|
|
|
5038
|
-
export { APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL,
|
|
5039
|
-
export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy,
|
|
5096
|
+
export { ACTION_RECORD_MAX_CHARS, ACTION_RECORD_NOTE, APP_SAMPLING_MAX_IMAGES, APP_SAMPLING_MAX_IMAGE_BYTES, APP_SAMPLING_MAX_INPUT_CHARS, APP_SAMPLING_MAX_MESSAGES, APP_SAMPLING_MAX_SYSTEM_CHARS, APP_SAMPLING_MAX_TOKENS, APP_SAMPLING_PER_APP, APP_SAMPLING_PER_MINUTE, APP_SAMPLING_REASONING_TOKENS, APP_SAMPLING_RPC_CODES, ASK_USER_DESCRIPTION_MAX_CHARS, ASK_USER_LABEL_MAX_CHARS, ASK_USER_MAX_OPTIONS, ASK_USER_MAX_PER_RUN, ASK_USER_MIN_OPTIONS, ASK_USER_OTHER_MAX_CHARS, ASK_USER_QUESTION_MAX_CHARS, ASK_USER_TIMEOUT_MAX_MS, ASK_USER_TIMEOUT_MS, ASK_USER_TOOL, AgentTool, AgentToolSet, AppSamplingError, AskUserInputError, AttachmentsNotSupportedError, ContextWindowExceededError, CredentialStore, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, IReferenceUse, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaFitReference, MemoryRunStore, MemorySkillStore, MemoryStore, NO_ATTACHMENT_NOTE, PipelineDefinition, PipelineEvent, PipelineNode, PipelineNodeRunner, PipelineResult, PlanSchema, PlanStepSchema, RELAY_MAX_REPLAYS_PER_SECOND, RELAY_MAX_SENDS, RELAY_MAX_SEND_CHARS, RELAY_MAX_STRING, REPLAY_NOTE, RUNS_STORE, ReplanSchema, SAVE_SKILL_TOOL, SEARCH_API_BASE_URL, SEARCH_DEFAULT_MAX_RESULTS, SEARCH_GOOGLE_DEFAULT_MODEL, SEARCH_GOOGLE_NOTE, SEARCH_MAX_NOTE_CHARS, SEARCH_MAX_QUERY_CHARS, SEARCH_MAX_RESULTS, SEARCH_MAX_SNIPPET_CHARS, SEARCH_MAX_SUMMARY_CHARS, SEARCH_MAX_TITLE_CHARS, SEARCH_MAX_TOTAL_CHARS, SEARCH_MAX_URL_CHARS, SEARCH_PROVIDERS, SECRETS_STORE, SESSIONS_STORE, SESSION_LOCK_MODES, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, STORAGE_CHANGE_KINDS, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, SessionBusyError, SubagentSpawnError, TOOL_APPROVAL_MODES, TOOL_APPROVAL_TIMEOUT_MS, TOOL_SEARCH_WINDOW_SHARE, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, actionRecordOf, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkAskUserAnswer, checkAskUserInput, checkEgressUrl, checkLimits, classifyAddress, cleanAskUserText, compactHistory, compactSteps, compressHistory, contextOverflowOf, contextWindowOf, createAgent, createAppSamplingLimiter, createEgressTools, createFileTools, createFindToolsTool, createGuardedFetch, createLearning, createLogger, createMedia, createPipeline, createPlan, createRunControl, createSearchTools, createSkillTools, createSubagentTool, createToolResultClearer, createWebFetchTool, createWebLLMModel, createWebSearchTool, decideReplan, decideToolPermission, decisionEgressPolicy, decisionModelFromAiSdk, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mergeProviderOptions, mimeFromPath, neutralizeActionRecords, nextStrongerTier, nodeResolver, normalizePath, normalizeSkillName, normalizeSteps, normalizeUsage, onStorageChange, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, postStorageChange, preloadWebLLMModel, renderActiveSkills, renderCatalog, renderSearchCatalog, renderSkillIndex, replanWanted, resolveAppSampling, resolveBudgets, resolveCaching, resolveCompaction, resolveConfig, resolveDecisionModel, resolveDynamicSubagents, resolveEgressPolicy, resolveEscalation, resolveModel, resolveResume, resolveStage, resolveThinking, runToolLoop, sanitizeSearchResults, schemaHintOf, searchEgressPolicy, searchEngineAnswer, searchStatusMessage, searchToolResult, searchTools, searchUsageOf, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withActionRecord, withRollingBreakpoint, withSystem, withWebLLMContextWindow };
|
|
5097
|
+
export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AskUserAction, AskUserAnswer, AskUserCheckedAnswer, AskUserConfig, AskUserContext, AskUserHandler, AskUserOption, AskUserQuestion, AskUserReason, AskUserRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EscalationConfig, EscalationReason, ExecutorPromptContext, ExecutorResult, FileToolBinding, FileToolsOptions, GenerateOptions, GuardedFetch, IAiSdkDecisionOptions, IDecisionAnswer, IDecisionCallOptions, IDecisionConfig, IDecisionEvent, IDecisionModel, IDecisionModelSpec, IDecisionOption, IDecisionOutcome, IDecisionQuestion, IDynamicSubagentsConfig, IEgressPolicy, IMedia, IMediaConfig, IMediaFile, IMediaModelSpec, IMediaOptions, IMediaRun, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchEngineAnswer, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaModelKind, MediaSpeechModel, MediaTranscriptionModel, MessageEndpoint, ModelInput, ModelTier, NodeResolverOptions, OutputCap, ParentToWorker, Phase, PhaseBudgets, Pipeline, PipelineOptions, PipelineRouteOptions, PipelineRouteResult, PipelineRunOptions, PlanShape, PlannerPromptContext, PlannerResult, PromptCachingSetting, PromptParts, Prompts, ProviderModelSpec, ProviderOptionsMap, ProviderType, ProxiedToolSpec, RawAction, ReplanDecision, ReplanMode, ReplanShape, ReplanTrigger, ReplannerPromptContext, ReplannerResult, ResolvedCaching, ResolvedCompaction, ResolvedConfig, ResolvedStage, ResolvedThinking, RunControl, RunFile, RunImage, RunOptions, RunPersistence, RunResult, RunSnapshot, RunStatus, RunStoreOptions, SandboxConfig, SandboxWorkerLike, SaveSkillInput, SearchEngine, SearchFreshness, SearchProvider, SearchToolsOptions, ServeSubagentOptions, SessionHolder, SessionLockMode, SessionRunState, SessionWatch, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, StorageChange, StorageChangeKind, StorageChangeOp, StoredMessage, StructuredResult, SubagentDefaultTools, SubagentInfo, SubagentProfile, SubagentToolOptions, SubagentWorkerConfig, SynthesizerPromptContext, ThinkingConfig, ThinkingLevel, ThinkingSetting, ThinkingStage, TierReason, TokenLimits, ToolApprovalApp, ToolApprovalConfig, ToolApprovalContext, ToolApprovalDecision, ToolApprovalMode, ToolApprovalRequest, ToolCallMode, ToolCatalogEntry, ToolLoopCallbacks, ToolLoopOptions, ToolLoopResult, ToolMode, ToolPermission, ToolResultClearing, ToolRunContext, ToolSelectionStrategy, UsagePhase, VfsListener, VirtualFile, VirtualFileInfo, VirtualFileSystemOptions, WatchSessionOptions, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
|