@dudko.dev/agent-web 0.0.44 → 0.0.46
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 +3 -2
- package/dist/agent-web.js +161 -151
- package/dist/agent-web.js.map +1 -1
- package/dist/{chunk-236RCVAZ.js → chunk-PTJA7V23.js} +3 -2
- package/dist/chunk-PTJA7V23.js.map +1 -0
- package/dist/index.cjs +789 -129
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +312 -10
- package/dist/index.d.ts +312 -10
- package/dist/index.js +742 -101
- package/dist/index.js.map +1 -1
- package/dist/{sandbox-7CGSIIIZ.js → sandbox-ZXWD5IWZ.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-236RCVAZ.js.map +0 -1
- /package/dist/{sandbox-7CGSIIIZ.js.map → sandbox-ZXWD5IWZ.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -177,6 +177,8 @@ interface RunSnapshot {
|
|
|
177
177
|
escalations?: number;
|
|
178
178
|
/** Helpers the model started so far (counts against `subagents.dynamic.maxChildren` on resume). */
|
|
179
179
|
subagentsSpawned?: number;
|
|
180
|
+
/** Questions `ask_user` put to the person so far (counts against `askUser.maxPerRun` on resume). */
|
|
181
|
+
questionsAsked?: number;
|
|
180
182
|
/**
|
|
181
183
|
* The attempt that wrote the snapshot: 1 for the run as first started, one more for every
|
|
182
184
|
* resume - the `attempt` of its events. A resume records its attempt BEFORE any of its events
|
|
@@ -683,6 +685,146 @@ declare const decideToolPermission: (opts: {
|
|
|
683
685
|
mcpSkills?: readonly string[];
|
|
684
686
|
}) => ToolPermission;
|
|
685
687
|
|
|
688
|
+
declare const ASK_USER_TOOL = "ask_user";
|
|
689
|
+
/** How long one question waits for the person, by default: a human is reading it. */
|
|
690
|
+
declare const ASK_USER_TIMEOUT_MS = 300000;
|
|
691
|
+
/**
|
|
692
|
+
* The longest wait a timer holds (2^31 - 1 ms, about 24.8 days). `setTimeout` fires a longer one -
|
|
693
|
+
* Infinity included - after about 1 ms, so a `timeoutMs` past it is taken as no limit at all.
|
|
694
|
+
*/
|
|
695
|
+
declare const ASK_USER_TIMEOUT_MAX_MS = 2147483647;
|
|
696
|
+
/** The most questions one run may ask, by default (its helpers' and subagents' included). */
|
|
697
|
+
declare const ASK_USER_MAX_PER_RUN = 3;
|
|
698
|
+
/** A question offers at least this many options... */
|
|
699
|
+
declare const ASK_USER_MIN_OPTIONS = 2;
|
|
700
|
+
/** ...and at most this many. */
|
|
701
|
+
declare const ASK_USER_MAX_OPTIONS = 6;
|
|
702
|
+
/** The longest question, in characters (after cleaning). */
|
|
703
|
+
declare const ASK_USER_QUESTION_MAX_CHARS = 500;
|
|
704
|
+
/** The longest option label. */
|
|
705
|
+
declare const ASK_USER_LABEL_MAX_CHARS = 80;
|
|
706
|
+
/** The longest option description. */
|
|
707
|
+
declare const ASK_USER_DESCRIPTION_MAX_CHARS = 200;
|
|
708
|
+
/** The most of a person's own words (`{ other }`) the model is given; the rest is cut. */
|
|
709
|
+
declare const ASK_USER_OTHER_MAX_CHARS = 2000;
|
|
710
|
+
/** One option of a question, as the person is shown it. Both strings are the MODEL's, cleaned. */
|
|
711
|
+
interface AskUserOption {
|
|
712
|
+
label: string;
|
|
713
|
+
description?: string;
|
|
714
|
+
}
|
|
715
|
+
/** A question as checked and cleaned: what a host shows and an event carries. */
|
|
716
|
+
interface AskUserQuestion {
|
|
717
|
+
question: string;
|
|
718
|
+
options: AskUserOption[];
|
|
719
|
+
/** The person may pick several options. */
|
|
720
|
+
multiple: boolean;
|
|
721
|
+
/** The person may answer in their own words instead of picking. */
|
|
722
|
+
allowOther: boolean;
|
|
723
|
+
}
|
|
724
|
+
/** What the host's `onQuestion` is given. Every string in it is the model's text, cleaned. */
|
|
725
|
+
interface AskUserRequest$1<TStep = unknown> extends AskUserQuestion {
|
|
726
|
+
/** Unique per question; the same id is in the two events. */
|
|
727
|
+
id: string;
|
|
728
|
+
/** The plan step whose tool call asks. */
|
|
729
|
+
step?: TStep;
|
|
730
|
+
runId?: string;
|
|
731
|
+
/** Set when a helper or a subagent of the run asks, not the run itself: its id and depth. */
|
|
732
|
+
subagent?: {
|
|
733
|
+
id: string;
|
|
734
|
+
depth: number;
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* The person's answer: the labels they picked (exactly as offered; one unless `multiple`), their
|
|
739
|
+
* own words (only when `allowOther`), or that they would rather not answer.
|
|
740
|
+
*/
|
|
741
|
+
type AskUserAnswer = {
|
|
742
|
+
choice: string[];
|
|
743
|
+
} | {
|
|
744
|
+
other: string;
|
|
745
|
+
} | {
|
|
746
|
+
declined: true;
|
|
747
|
+
};
|
|
748
|
+
interface AskUserContext {
|
|
749
|
+
/**
|
|
750
|
+
* Aborted when the question ends WITHOUT the host's answer: no answer within `timeoutMs`
|
|
751
|
+
* (`signal.reason` is an Error named 'TimeoutError'), the run was stopped, or the handler
|
|
752
|
+
* failed. Take the prompt down then: an answer given later is ignored. Never aborted once the
|
|
753
|
+
* host has answered.
|
|
754
|
+
*/
|
|
755
|
+
signal: AbortSignal;
|
|
756
|
+
}
|
|
757
|
+
/** `askUser` beside `onQuestion`, resolved: `timeoutMs` 0 = no limit of its own. */
|
|
758
|
+
interface AskUserSettings {
|
|
759
|
+
timeoutMs: number;
|
|
760
|
+
maxPerRun: number;
|
|
761
|
+
}
|
|
762
|
+
/** How a question ended. `automatic`: nobody decided (a time limit, a stop, a failed handler). */
|
|
763
|
+
type AskUserAction = 'choice' | 'other' | 'declined' | 'timeout' | 'stopped';
|
|
764
|
+
/** Why a question was closed as `declined` without the person deciding. */
|
|
765
|
+
type AskUserReason = 'handler-error' | 'invalid-answer' | 'cannot-park';
|
|
766
|
+
/** The two events of a question. Neither ever carries the person's own words. */
|
|
767
|
+
type AskUserEvent<TStep = unknown> = {
|
|
768
|
+
type: 'user.question-asked';
|
|
769
|
+
id: string;
|
|
770
|
+
question: string;
|
|
771
|
+
options: AskUserOption[];
|
|
772
|
+
multiple: boolean;
|
|
773
|
+
allowOther: boolean;
|
|
774
|
+
step?: TStep;
|
|
775
|
+
subagent?: {
|
|
776
|
+
id: string;
|
|
777
|
+
depth: number;
|
|
778
|
+
};
|
|
779
|
+
} | {
|
|
780
|
+
type: 'user.question-answered';
|
|
781
|
+
id: string;
|
|
782
|
+
action: AskUserAction;
|
|
783
|
+
/** true when nobody decided: a time limit, a stop, a failed handler, an unusable answer. */
|
|
784
|
+
automatic: boolean;
|
|
785
|
+
/** Action 'choice': the labels picked. Never the text of an `other` answer. */
|
|
786
|
+
choice?: string[];
|
|
787
|
+
/** Action 'declined' with `automatic`: why. */
|
|
788
|
+
reason?: AskUserReason;
|
|
789
|
+
};
|
|
790
|
+
/** A bad `ask_user` input: the tool call fails with this message, which says what to fix. */
|
|
791
|
+
declare class AskUserInputError extends Error {
|
|
792
|
+
constructor(message: string);
|
|
793
|
+
toJSON(): string;
|
|
794
|
+
}
|
|
795
|
+
/** The model's text as a person may be shown it: a string, invisible characters removed, trimmed. */
|
|
796
|
+
declare const cleanAskUserText: (raw: unknown, oneLine?: boolean) => string;
|
|
797
|
+
/**
|
|
798
|
+
* Check and clean the model's `ask_user` arguments: 2-6 options, no two labels alike (letter case
|
|
799
|
+
* and spaces aside), each label 1-80 characters, a description at most 200, a question of 1-500 -
|
|
800
|
+
* all measured after cleaning. An option may be given as a bare string (its label). Throws
|
|
801
|
+
* {@link AskUserInputError} with what to fix.
|
|
802
|
+
*/
|
|
803
|
+
declare const checkAskUserInput: (raw: unknown) => AskUserQuestion;
|
|
804
|
+
/** An answer as checked: what the model is told. */
|
|
805
|
+
type AskUserCheckedAnswer = {
|
|
806
|
+
kind: 'choice';
|
|
807
|
+
choice: string[];
|
|
808
|
+
} | {
|
|
809
|
+
kind: 'other';
|
|
810
|
+
text: string;
|
|
811
|
+
} | {
|
|
812
|
+
kind: 'declined';
|
|
813
|
+
};
|
|
814
|
+
/**
|
|
815
|
+
* Check the host's answer against the question: exactly one of `choice` (labels that were
|
|
816
|
+
* offered, no repeats, one unless `multiple`), `other` (a non-empty text, only when `allowOther`;
|
|
817
|
+
* cleaned and cut at {@link ASK_USER_OTHER_MAX_CHARS}) or `declined: true`. Anything else is not
|
|
818
|
+
* an answer.
|
|
819
|
+
*/
|
|
820
|
+
declare const checkAskUserAnswer: (q: AskUserQuestion, raw: unknown) => {
|
|
821
|
+
ok: true;
|
|
822
|
+
value: AskUserCheckedAnswer;
|
|
823
|
+
} | {
|
|
824
|
+
ok: false;
|
|
825
|
+
reason: string;
|
|
826
|
+
};
|
|
827
|
+
|
|
686
828
|
type ReplanMode = 'continue' | 'revise' | 'finish';
|
|
687
829
|
type Phase = 'plan' | 'execute' | 'replan' | 'synthesize';
|
|
688
830
|
/**
|
|
@@ -951,6 +1093,18 @@ type AgentEventBody =
|
|
|
951
1093
|
reason?: string;
|
|
952
1094
|
automatic: boolean;
|
|
953
1095
|
}
|
|
1096
|
+
/**
|
|
1097
|
+
* The model asked the person a question (`ask_user`, `config.askUser`): `onQuestion` is being
|
|
1098
|
+
* called. `question` and the options are the MODEL's text, cleaned - show them as plain text.
|
|
1099
|
+
* `subagent`: a helper or a subagent of the run asks. Followed by `user.question-answered` with
|
|
1100
|
+
* the same id - unless the run parked on it (the Node package only).
|
|
1101
|
+
*
|
|
1102
|
+
* `user.question-answered`: how it ended - `action` 'choice' (with the labels picked in
|
|
1103
|
+
* `choice`), 'other' (the person's own words: they go to the model as the tool's result and
|
|
1104
|
+
* NEVER into an event), 'declined', 'timeout' or 'stopped'. `automatic`: nobody decided (a time
|
|
1105
|
+
* limit, a stop, a failed handler - `reason` - or an answer that did not fit the question).
|
|
1106
|
+
*/
|
|
1107
|
+
| AskUserEvent<IPlanStep>
|
|
954
1108
|
/**
|
|
955
1109
|
* An MCP server asked the user for input during a tool call (the connection's `onElicitation`
|
|
956
1110
|
* is being called). `message`, `requestedSchema` and `url` are the SERVER's text: cleaned and
|
|
@@ -1104,10 +1258,19 @@ type AgentEventBody =
|
|
|
1104
1258
|
waitedMs: number;
|
|
1105
1259
|
} | {
|
|
1106
1260
|
type: 'stopped';
|
|
1107
|
-
}
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* `code`, when set, names a failure a host may want to say in its own words (and language):
|
|
1264
|
+
* `'no-plan'` - the planner returned nothing that could be read as a plan (no text, or text cut
|
|
1265
|
+
* off; `error` says by what); `'no-answer'` - the model wrote no answer to a message that
|
|
1266
|
+
* needed no tool. Both end the run (phase `'run'`, no `final` event), and `error` is the
|
|
1267
|
+
* result's `final`.
|
|
1268
|
+
*/
|
|
1269
|
+
| {
|
|
1108
1270
|
type: 'error';
|
|
1109
1271
|
phase: Phase | 'run';
|
|
1110
1272
|
error: string;
|
|
1273
|
+
code?: 'no-plan' | 'no-answer';
|
|
1111
1274
|
}
|
|
1112
1275
|
/** A pipeline's own events (`createPipeline`): the run, each node visit, each edge decision. */
|
|
1113
1276
|
| PipelineEvent;
|
|
@@ -1418,6 +1581,11 @@ interface PlannerPromptContext {
|
|
|
1418
1581
|
role: string;
|
|
1419
1582
|
content: string;
|
|
1420
1583
|
}[];
|
|
1584
|
+
/**
|
|
1585
|
+
* Set when this message carries no file but an earlier message of the session did: a sentence
|
|
1586
|
+
* saying so, so that the model does not take an earlier picture for one it can see now.
|
|
1587
|
+
*/
|
|
1588
|
+
attachments?: string;
|
|
1421
1589
|
/** "- name: description" index of the configured skills, when any. */
|
|
1422
1590
|
skills?: string;
|
|
1423
1591
|
/** The catalogue is condensed and the executor can search the rest (large catalogues). */
|
|
@@ -1426,6 +1594,11 @@ interface PlannerPromptContext {
|
|
|
1426
1594
|
sandbox?: string;
|
|
1427
1595
|
/** Set while `spawn_subagent` is callable (`subagents.dynamic`): when a helper is worth a step. */
|
|
1428
1596
|
subagents?: string;
|
|
1597
|
+
/**
|
|
1598
|
+
* Set while `ask_user` is callable (`config.askUser`): when a step may ask the user - the one
|
|
1599
|
+
* exception to "never plan a step that asks the user something".
|
|
1600
|
+
*/
|
|
1601
|
+
askUser?: string;
|
|
1429
1602
|
/** Set when `config.executorTiers` is on: the planner rates every step's complexity. */
|
|
1430
1603
|
tiers?: boolean;
|
|
1431
1604
|
}
|
|
@@ -1455,6 +1628,10 @@ interface ExecutorPromptContext {
|
|
|
1455
1628
|
sandbox?: string;
|
|
1456
1629
|
/** Set while `spawn_subagent` is callable (`subagents.dynamic`): when to hand work to a helper. */
|
|
1457
1630
|
subagents?: string;
|
|
1631
|
+
/** Set while `ask_user` is callable (`config.askUser`): when to ask the user, and how. */
|
|
1632
|
+
askUser?: string;
|
|
1633
|
+
/** See `PlannerPromptContext.attachments`: this message carries no file, an earlier one did. */
|
|
1634
|
+
attachments?: string;
|
|
1458
1635
|
}
|
|
1459
1636
|
interface ReplannerPromptContext {
|
|
1460
1637
|
goal: string;
|
|
@@ -1481,6 +1658,19 @@ interface SynthesizerPromptContext {
|
|
|
1481
1658
|
updates?: string[];
|
|
1482
1659
|
/** Set when `config.sandbox` is on: the output of code is reported only when `run_js` returned it. */
|
|
1483
1660
|
sandbox?: string;
|
|
1661
|
+
/**
|
|
1662
|
+
* Set when the plan was EMPTY (a greeting, small talk, a question that needs no tool): no step
|
|
1663
|
+
* ran, `done` and `findings` are empty, and this call writes the whole answer to the user's
|
|
1664
|
+
* message. A custom builder must handle it: it is the only answer the user gets.
|
|
1665
|
+
*/
|
|
1666
|
+
direct?: true;
|
|
1667
|
+
/** With `direct`: prior session messages (oldest first), the conversation the answer continues. */
|
|
1668
|
+
history?: {
|
|
1669
|
+
role: string;
|
|
1670
|
+
content: string;
|
|
1671
|
+
}[];
|
|
1672
|
+
/** See `PlannerPromptContext.attachments`: this message carries no file, an earlier one did. */
|
|
1673
|
+
attachments?: string;
|
|
1484
1674
|
}
|
|
1485
1675
|
interface Prompts {
|
|
1486
1676
|
planner(ctx: PlannerPromptContext): PromptParts;
|
|
@@ -1488,6 +1678,12 @@ interface Prompts {
|
|
|
1488
1678
|
replanner(ctx: ReplannerPromptContext): PromptParts;
|
|
1489
1679
|
synthesizer(ctx: SynthesizerPromptContext): PromptParts;
|
|
1490
1680
|
}
|
|
1681
|
+
/**
|
|
1682
|
+
* What a stage is told when THIS message carries no file but an earlier one did. Memory keeps
|
|
1683
|
+
* the names of a turn's files, not the files: without this a model reads "[attached: a.png]" in
|
|
1684
|
+
* the conversation and answers as if it saw a picture now.
|
|
1685
|
+
*/
|
|
1686
|
+
declare const NO_ATTACHMENT_NOTE = "NOTE: nothing is attached to THIS message. The files of earlier messages (marked \"[attached: ...]\" in the conversation) are not visible to you now - only what was said about them then is. If this message is about a file you cannot see, say so and ask the user to attach it again; never describe a file you cannot see.";
|
|
1491
1687
|
declare const defaultPrompts: Prompts;
|
|
1492
1688
|
/** Prepend a host-supplied systemPrompt to a phase system prompt, if present. */
|
|
1493
1689
|
declare const withSystem: (base: string, extra?: string) => string;
|
|
@@ -2466,6 +2662,56 @@ declare const decisionEgressPolicy: (spec: IDecisionModelSpec) => IEgressPolicy;
|
|
|
2466
2662
|
*/
|
|
2467
2663
|
declare const resolveDecisionModel: (input: IDecisionModel | IDecisionModelSpec | undefined, credentials?: CredentialStore) => Promise<IDecisionModel | undefined>;
|
|
2468
2664
|
|
|
2665
|
+
/**
|
|
2666
|
+
* `config.askUser`: the `ask_user` tool, with which the MODEL asks the person one closed question
|
|
2667
|
+
* with 2-6 options (the rules and the bounds are `ask-user-shared.ts`, the same file as the Node
|
|
2668
|
+
* package's). This file is the browser's wiring: the tool reads its run through `agentRun`
|
|
2669
|
+
* (`ToolRunContext.askUser`), a helper the model started asks through its caller's channel
|
|
2670
|
+
* (`SpawnSeed.askUser`), and a subagent the HOST defined (`createSubagentTool`, in-process) asks
|
|
2671
|
+
* through the run that called it (`routeAskUser`).
|
|
2672
|
+
*/
|
|
2673
|
+
/** What `onQuestion` is given: the model's question and options, cleaned (see the shared file). */
|
|
2674
|
+
type AskUserRequest = AskUserRequest$1<IPlanStep>;
|
|
2675
|
+
/**
|
|
2676
|
+
* Answers the agent's question: `{ choice: [label, ...] }` (labels exactly as offered; one unless
|
|
2677
|
+
* `multiple`), `{ other: text }` (only when `allowOther`) or `{ declined: true }`. The host decides,
|
|
2678
|
+
* never the model. A handler that throws, or answers with anything else, counts as "not answered".
|
|
2679
|
+
*/
|
|
2680
|
+
type AskUserHandler = (request: AskUserRequest, ctx: AskUserContext) => AskUserAnswer | Promise<AskUserAnswer>;
|
|
2681
|
+
interface AskUserConfig {
|
|
2682
|
+
/**
|
|
2683
|
+
* Who answers. Without it there is no tool - unless the agent runs as a subagent of a run that
|
|
2684
|
+
* has one (`createSubagentTool`, in-process): it then asks through that run.
|
|
2685
|
+
*/
|
|
2686
|
+
onQuestion?: AskUserHandler;
|
|
2687
|
+
/**
|
|
2688
|
+
* How long one question waits for an answer. Default 300 000 (5 minutes). `0` or `Infinity`: no
|
|
2689
|
+
* limit of its own - the question waits until the run is stopped; so does a value above
|
|
2690
|
+
* 2^31 - 1. Negative or NaN: `createAgent` throws. The step's `chatTimeoutMs` (and a subagent's
|
|
2691
|
+
* `timeoutMs`) stop while a question waits.
|
|
2692
|
+
*/
|
|
2693
|
+
timeoutMs?: number;
|
|
2694
|
+
/** Questions one run may ask, its helpers' and subagents' included. Default 3. */
|
|
2695
|
+
maxPerRun?: number;
|
|
2696
|
+
}
|
|
2697
|
+
/**
|
|
2698
|
+
* Internal - one run's way to the person (the run the host started makes it; its helpers share
|
|
2699
|
+
* it; a subagent the host defined is given its caller's, marked with `subagent`).
|
|
2700
|
+
*/
|
|
2701
|
+
interface AskUserChannel {
|
|
2702
|
+
handler: AskUserHandler;
|
|
2703
|
+
settings: AskUserSettings;
|
|
2704
|
+
/** The questions asked so far in the run the host started. */
|
|
2705
|
+
asked: {
|
|
2706
|
+
count: number;
|
|
2707
|
+
};
|
|
2708
|
+
/** Set for a subagent the host defined: every question it asks says so. */
|
|
2709
|
+
subagent?: {
|
|
2710
|
+
id: string;
|
|
2711
|
+
depth: number;
|
|
2712
|
+
};
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2469
2715
|
/**
|
|
2470
2716
|
* MCP Apps: a completion an app asks the HOST's model for (`sampling/createMessage` sent by the
|
|
2471
2717
|
* view, the extension's draft revision; the request is MCP's own `CreateMessageRequest`).
|
|
@@ -2741,6 +2987,19 @@ interface BrowserAgentConfig {
|
|
|
2741
2987
|
toolSearchThreshold?: number;
|
|
2742
2988
|
/** Consent policy for tool calls: autopilot, ask before writes, ask always, read-only. */
|
|
2743
2989
|
toolApproval?: ToolApprovalConfig;
|
|
2990
|
+
/**
|
|
2991
|
+
* Let the MODEL ask the person a closed question with buttons (the `ask_user` tool: one short
|
|
2992
|
+
* question, 2-6 options, optionally several picks or an answer in their own words) instead of
|
|
2993
|
+
* guessing. Off unless set: with it off there is no tool and no prompt mentions it. The tool
|
|
2994
|
+
* exists only when someone can answer - `onQuestion`, or (for a subagent `createSubagentTool`
|
|
2995
|
+
* runs in-process) the run that called it; `true` / `{}` without a handler is "on, the handler
|
|
2996
|
+
* comes later" (`useAgent` supplies one). The host decides, never the model; at most
|
|
2997
|
+
* `maxPerRun` questions per run (default 3), each bounded by `timeoutMs` (default 5 minutes;
|
|
2998
|
+
* the step's time limit stops while it waits), a stop ends the wait at once. The question and
|
|
2999
|
+
* options are the MODEL's text, cleaned: show them as plain text. See docs/capabilities.md,
|
|
3000
|
+
* "Asking the user".
|
|
3001
|
+
*/
|
|
3002
|
+
askUser?: boolean | AskUserConfig;
|
|
2744
3003
|
/**
|
|
2745
3004
|
* MCP Apps asking this agent's model for a completion (`Agent.sampleForApp`, the app's
|
|
2746
3005
|
* `sampling/createMessage`): the caps - `maxTokens` per request (1024), `maxRequestsPerMinute`
|
|
@@ -2918,13 +3177,17 @@ interface OutputCap {
|
|
|
2918
3177
|
/** true when it came from the window, false when the host set it (or turned it off with 0). */
|
|
2919
3178
|
derived: boolean;
|
|
2920
3179
|
}
|
|
3180
|
+
/** True once a call of `stage` reported reasoning tokens (see `observeReasoning`). */
|
|
3181
|
+
declare const stageReasons: (c: BrowserAgentConfig, stage: ThinkingStage) => boolean;
|
|
2921
3182
|
/**
|
|
2922
3183
|
* The output cap of one call of `stage` — the same rules as the Node sibling's `stageOutputCap`.
|
|
2923
3184
|
* What the host set (`limits.perCall`, then the legacy `budgets`) wins, and `0` is an explicit
|
|
2924
3185
|
* "no cap". Otherwise a share of the context window — except for a stage that thinks: on OpenAI
|
|
2925
3186
|
* and Gemini the reasoning counts against the cap, so a default sized for the answer alone would
|
|
2926
3187
|
* leave a thinking model no room to write it (or to finish a tool call's arguments). A stage that
|
|
2927
|
-
* thinks keeps the provider's own limit unless the host sets one.
|
|
3188
|
+
* thinks keeps the provider's own limit unless the host sets one. A stage thinks when the config
|
|
3189
|
+
* says so (`thinking` / `stageThinking`) or when a call of it was seen to (`observeReasoning`: a
|
|
3190
|
+
* model that reasons by default).
|
|
2928
3191
|
*/
|
|
2929
3192
|
declare const stageOutputCap: (c: BrowserAgentConfig, stage: ThinkingStage, contextWindowTokens: number) => OutputCap;
|
|
2930
3193
|
/**
|
|
@@ -3184,6 +3447,11 @@ interface AgentContext {
|
|
|
3184
3447
|
* the executor's prompts say when a helper is worth it.
|
|
3185
3448
|
*/
|
|
3186
3449
|
subagents?: true;
|
|
3450
|
+
/**
|
|
3451
|
+
* Set while `ask_user` is among the tools (`config.askUser`): the planner's and the executor's
|
|
3452
|
+
* prompts say when a question is worth it (the one exception to "never ask the user").
|
|
3453
|
+
*/
|
|
3454
|
+
askUser?: true;
|
|
3187
3455
|
/**
|
|
3188
3456
|
* The rendered instructions of the MCP servers whose tools are mounted (`renderMcpInstructions`);
|
|
3189
3457
|
* absent when none sent any or `config.mcpInstructions` is false. Built once, when the agent is
|
|
@@ -3204,6 +3472,12 @@ interface AgentContext {
|
|
|
3204
3472
|
setCurrentStep?: (step: IPlanStep | undefined) => void;
|
|
3205
3473
|
/** Images / PDFs / files the user sent with this run's goal. */
|
|
3206
3474
|
images?: RunFile[];
|
|
3475
|
+
/**
|
|
3476
|
+
* Set when this message carries no file but an earlier one of the session did: the sentence
|
|
3477
|
+
* the planner and the direct answer are given, so that a model does not take an earlier
|
|
3478
|
+
* message's picture for one it can see now.
|
|
3479
|
+
*/
|
|
3480
|
+
attachmentsNote?: string;
|
|
3207
3481
|
/** Everything the user said while the run was going (`RunControl.send`), oldest first. */
|
|
3208
3482
|
userUpdates?: () => string[];
|
|
3209
3483
|
/**
|
|
@@ -3494,13 +3768,21 @@ interface PlanOutcome {
|
|
|
3494
3768
|
usage: IUsage;
|
|
3495
3769
|
/** Names of configured skills the planner picked (validated). */
|
|
3496
3770
|
skills: string[];
|
|
3771
|
+
/**
|
|
3772
|
+
* Set when the planner produced NO plan at all - nothing to parse after every attempt (no
|
|
3773
|
+
* text, or text cut off before any of it could be read): why. Not the same as an empty plan,
|
|
3774
|
+
* which is the planner's decision that the message needs no tool.
|
|
3775
|
+
*/
|
|
3776
|
+
failed?: string;
|
|
3497
3777
|
}
|
|
3498
3778
|
/**
|
|
3499
3779
|
* Build the initial plan. Native mode uses generateStructured(PlanSchema); prompted
|
|
3500
3780
|
* mode salvages `{ reply, plan }` from plain text. Native failures (a weak model
|
|
3501
3781
|
* that can't satisfy the schema) fall back to the prompted parse rather than
|
|
3502
3782
|
* throwing, so the run degrades gracefully. An empty `steps` list signals the
|
|
3503
|
-
* runner to answer directly (greeting / small talk)
|
|
3783
|
+
* runner to answer directly (greeting / small talk / a question that needs no tool): the answer
|
|
3784
|
+
* is then written by the answering stage, never taken from `thought`. A call the default output
|
|
3785
|
+
* cap cut off while the model reasoned is repeated once without it (`withReasoningRoom`).
|
|
3504
3786
|
*/
|
|
3505
3787
|
declare const createPlan: (ctx: AgentContext, goal: string,
|
|
3506
3788
|
/** Extra instruction appended to the goal (used by the empty-plan retry). */
|
|
@@ -3631,19 +3913,34 @@ declare const decideReplan: (ctx: AgentContext, goal: string, done: string[], re
|
|
|
3631
3913
|
/** How many of the user's latest messages (`ctx.userUpdates()`) the plan has not been weighed against yet. */
|
|
3632
3914
|
newUpdates?: number) => Promise<ReplanOutcome>;
|
|
3633
3915
|
|
|
3916
|
+
/** How an answer is written. */
|
|
3917
|
+
interface SynthesizeOptions {
|
|
3918
|
+
/**
|
|
3919
|
+
* The plan was empty: no tool ran, and this call writes the whole answer to the user's message
|
|
3920
|
+
* (from the conversation, the state, the attachments and general knowledge).
|
|
3921
|
+
*/
|
|
3922
|
+
direct?: boolean;
|
|
3923
|
+
}
|
|
3924
|
+
interface SynthesizedAnswer {
|
|
3925
|
+
/** The answer; '' when the model wrote nothing usable (see `empty`). */
|
|
3926
|
+
text: string;
|
|
3927
|
+
usage: IUsage;
|
|
3928
|
+
/** Why there is no text, when there is none: the cap that cut the call off, or the finish reason. */
|
|
3929
|
+
empty?: string;
|
|
3930
|
+
}
|
|
3634
3931
|
/**
|
|
3635
3932
|
* Write the final natural-language answer of the run, streaming it as
|
|
3636
3933
|
* `final.text-delta` events (and thoughts as `final.reasoning-delta`). Plain
|
|
3637
3934
|
* text only (parsePlainText strips any stray JSON; deltas are suppressed
|
|
3638
3935
|
* entirely when the model drifts into JSON, so raw structure never reaches a
|
|
3639
|
-
* UI).
|
|
3936
|
+
* UI). With `direct` it is the answering path of an empty plan. A call the default output cap
|
|
3937
|
+
* cut off while the model reasoned, before any of the answer was shown, is made once more
|
|
3938
|
+
* without the cap. A model that returns nothing usable gives `text: ''` and the reason in
|
|
3939
|
+
* `empty` - never a stock sentence.
|
|
3640
3940
|
*/
|
|
3641
3941
|
declare const synthesizeAnswer: (ctx: AgentContext, goal: string, done: string[],
|
|
3642
3942
|
/** Excerpts of what the tools returned — the data the answer is made of. */
|
|
3643
|
-
findings?: string[]) => Promise<
|
|
3644
|
-
text: string;
|
|
3645
|
-
usage: IUsage;
|
|
3646
|
-
}>;
|
|
3943
|
+
findings?: string[], options?: SynthesizeOptions) => Promise<SynthesizedAnswer>;
|
|
3647
3944
|
|
|
3648
3945
|
/**
|
|
3649
3946
|
* A pipeline: a graph of agents with conditions and loops, described in plain JSON. The graph
|
|
@@ -4552,6 +4849,11 @@ interface ToolRunContext {
|
|
|
4552
4849
|
* in-process subagent runs under them rather than wait for its own parent.
|
|
4553
4850
|
*/
|
|
4554
4851
|
sessionLocks?: () => readonly string[];
|
|
4852
|
+
/**
|
|
4853
|
+
* Internal - the run's way to the person (`config.askUser`): `ask_user` asks through it, a
|
|
4854
|
+
* helper the run starts shares it, and a subagent the host defined asks through it too.
|
|
4855
|
+
*/
|
|
4856
|
+
askUser?: AskUserChannel;
|
|
4555
4857
|
}
|
|
4556
4858
|
/** Read the run context the agent passes to a tool's execute (undefined outside a run). */
|
|
4557
4859
|
declare const toolRunContextOf: (options: unknown) => ToolRunContext | undefined;
|
|
@@ -4708,5 +5010,5 @@ declare const postStorageChange: (dbName: string | undefined, change: StorageCha
|
|
|
4708
5010
|
*/
|
|
4709
5011
|
declare const onStorageChange: (dbName: string | undefined, listener: (change: StorageChange) => void) => (() => void);
|
|
4710
5012
|
|
|
4711
|
-
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, AgentTool, AgentToolSet, AppSamplingError, AttachmentsNotSupportedError, ContextWindowExceededError, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError, MemoryCredentialStore, MemoryRunStore, MemorySkillStore, MemoryStore, 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_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, TRANSCRIBE_AUDIO_TOOL, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VaultCredentialStore, VaultOptions, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, acceptMedia, adoptSubagentEvent, appSamplingRequestOf, appSamplingText, askDecisionModel, attachmentKind, buildMediaModelFromSpec, buildModelFromStage, buildSearchRequest, bytesToBase64, checkEgressUrl, checkLimits, classifyAddress, 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, decryptJSON, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, encryptJSON, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, getOrCreateVaultKey, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mediaUsageOf, mergeProviderOptions, mimeFromPath, 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, searchStatusMessage, searchToolResult, searchTools, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, sniffMediaType, splitBlocker, stageOutputCap, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
|
|
4712
|
-
export type { Agent, AgentContext, AgentEvent, AgentEventHandler, AgentLogger, AgentLoggerSink, AgentWebDBOptions, AppSamplingErrorCode, AppSamplingImage, AppSamplingMessage, AppSamplingOptions, AppSamplingRequest, AppSamplingResult, AppSamplingSettings, AppSamplingView, AppToolCallRequest, AttachmentKind, BrowserAgentConfig, ClearedInfo, CompactOptions, CompactResult, CompactionConfig, CompressOptions, ContextStore, CredentialStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EncryptedBlob, 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, IMediaUsage, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaKind, 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 };
|
|
5013
|
+
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, DECISION_PROVIDERS, DEFAULT_COMPACTION_THRESHOLD_RATIO, DEFAULT_DECISION_CONFIDENCE_THRESHOLD, DEFAULT_DECISION_TIMEOUT_MS, EgressError, FILES_STORE, FIND_TOOLS_NAME, FORGET_SKILL_TOOL, GENERATE_IMAGE_TOOL, GENERATE_SPEECH_TOOL, ImagesNotSupportedError, IndexedDBRunStore, IndexedDBStore, KEYS_STORE, MEDIA_AUDIO_TYPES, MEDIA_DEFAULT_MAX_CALLS, MEDIA_FOLDER, MEDIA_IMAGE_TYPES, MEDIA_MAX_ATTACHED_AUDIO, MEDIA_MAX_AUDIO_INPUT_BYTES, MEDIA_MAX_IMAGE_BYTES, MEDIA_MAX_PROMPT_CHARS, MEDIA_MAX_SPEECH_BYTES, MEDIA_MAX_SPEECH_CHARS, MEDIA_MAX_TRANSCRIPT_CHARS, MEDIA_TIMEOUT_MS, MODEL_TIERS, McpAppToolResult, McpElicitationReason, McpElicitationSchema, McpSkillConsent, McpSkillConsentView, MediaBudgetError, MediaError, MemoryCredentialStore, 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_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, TRANSCRIBE_AUDIO_TOOL, TieredPlanSchema, TieredPlanStepSchema, ToolBudgetError, ToolDeniedError, VaultCredentialStore, VaultOptions, VfsSkillStore, VirtualFileSystem, WEBLLM_DEFAULT_CONTEXT_WINDOW, WEB_FETCH_TOOL, WEB_SEARCH_TOOL, acceptMedia, 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, decryptJSON, defaultPrompts, defineSkill, defineTool, directBrowserOk, dispatch, encryptJSON, escalationReasonOf, messageTokens as estimateMessagesTokens, estimateTokens, executeStep, fileToolBindingOf, findSecret, fitCompactionToWindow, generate, generateStructured, getOrCreateVaultKey, hostMatches, htmlToText, isAttachmentRefusal, isCodeExecutionTool, isDirectModel, isEscalatableError, isImageRefusal, isProviderSpec, isReadOnlyTool, isReplayedToolOutput, isTextMime, isWebGPUAvailable, learnedPreamble, limitModelOutput, loadSkillFromUrl, looksLikeJson, markCodeExecution, markReadOnly, matchRule, mediaTypeOf, mediaUsageOf, mergeProviderOptions, mimeFromPath, 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, searchStatusMessage, searchToolResult, searchTools, selectToolMode, serveSubagentWorker, shouldReplan, skillPreamble, sniffMediaType, splitBlocker, stageOutputCap, stageReasons, stream, supportsImages, supportsNativeTools, supportsPdf, supportsStructuredOutput, synthesizeAnswer, thinkingFor, toFilePart, toImagePart, tokenize, toolCatalogOf, toolDefinitionTokens, toolRunContextOf, unloadWebLLMModel, watchSession, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
|
|
5014
|
+
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, CredentialStore, DecisionFallbackReason, DecisionPoint, EffectiveToolStrategy, EgressErrorCode, EncryptedBlob, 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, IMediaUsage, IPlan, IPlanStep, IResolvedDynamicSubagents, IResolvedEgressPolicy, ISandboxConfig, ISandboxError, ISandboxLimits, ISandboxResult, ISanitizedSearch, ISearchAnswer, ISearchConfig, ISearchOptions, ISearchRequest, ISearchResult, ISearchToolResult, ISearchUsage, IStepEscalation, IStepResult, ISubagentsConfig, IToolCall, ITranscription, IUsage, IWebFetchOptions, IWebSearchOptions, IndexedDBRunStoreOptions, IndexedDBStoreOptions, Learning, LearningConfig, LimitBreach, LimitKind, LoadSkillOptions, LogLevel, McpSkillOrigin, MediaImageModel, MediaKind, 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 };
|