@dudko.dev/agent-web 0.0.41 → 0.0.43
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 +102 -5
- package/dist/agent-web.js +140 -140
- package/dist/agent-web.js.map +1 -1
- package/dist/{chunk-4FBTBE74.js → chunk-2MLHZ6LQ.js} +2 -2
- package/dist/{chunk-L7Y3QRAM.js → chunk-DAREMCXF.js} +2 -2
- package/dist/{chunk-YUA2BHRM.js → chunk-ZSZSSJS4.js} +402 -13
- package/dist/chunk-ZSZSSJS4.js.map +1 -0
- package/dist/{elicitation-BA1knkdA.d.cts → elicitation-DS-84_bF.d.cts} +123 -9
- package/dist/{elicitation-BA1knkdA.d.ts → elicitation-DS-84_bF.d.ts} +123 -9
- package/dist/index.cjs +346 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +78 -202
- package/dist/index.d.ts +78 -202
- package/dist/index.js +264 -43
- package/dist/index.js.map +1 -1
- package/dist/mcp.cjs +352 -9
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.d.cts +12 -6
- package/dist/mcp.d.ts +12 -6
- package/dist/mcp.js +8 -3
- package/dist/mcp.js.map +1 -1
- package/dist/pipeline-engine.cjs +1130 -0
- package/dist/pipeline-engine.cjs.map +1 -0
- package/dist/pipeline-engine.d.cts +226 -0
- package/dist/pipeline-engine.d.ts +226 -0
- package/dist/pipeline-engine.js +1094 -0
- package/dist/pipeline-engine.js.map +1 -0
- package/dist/{sandbox-ZDQIIZS7.js → sandbox-3VRX47UY.js} +3 -3
- package/package.json +13 -3
- package/dist/chunk-YUA2BHRM.js.map +0 -1
- /package/dist/{chunk-4FBTBE74.js.map → chunk-2MLHZ6LQ.js.map} +0 -0
- /package/dist/{chunk-L7Y3QRAM.js.map → chunk-DAREMCXF.js.map} +0 -0
- /package/dist/{sandbox-ZDQIIZS7.js.map → sandbox-3VRX47UY.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { LanguageModel, ToolSet, Experimental_DecisionModel, Tool, FilePart, ImageModel, SpeechModel, TranscriptionModel, SystemModelMessage, ModelMessage, generateText, streamText } from 'ai';
|
|
2
|
-
import { V as VaultOptions, M as McpSkillSource, a as McpSkillConsent, b as McpSkillGrants, c as McpSkillRunConsent, d as McpSkillConsentView, e as
|
|
3
|
-
export { I as IndexedDBVault,
|
|
2
|
+
import { V as VaultOptions, M as McpSkillSource, a as McpSkillConsent, b as McpSkillGrants, c as McpSkillRunConsent, d as McpSkillConsentView, e as McpSkillSnapshotMemory, f as McpElicitationSchema, g as McpElicitationReason, h as McpAppToolResult } from './elicitation-DS-84_bF.js';
|
|
3
|
+
export { I as IndexedDBVault, i as MCP_APPS_EXTENSION, j as MCP_APP_MAX_HTML_CHARS, k as MCP_APP_MAX_RESULT_CHARS, l as MCP_APP_MIME_TYPE, m as MCP_SKILLS_EXTENSION, n as MCP_SKILLS_MAX_PER_SERVER, o as MCP_SKILLS_MAX_TOTAL, p as MCP_SKILL_BODY_MAX_CHARS, q as MCP_SKILL_CONSENTS, r as MCP_SKILL_CONSENT_DEFAULT, s as MCP_SKILL_DESCRIPTION_MAX_CHARS, t as MCP_SKILL_DIRECTORY_ENTRIES_MAX, u as MCP_SKILL_FILE_MAX_CHARS, v as MCP_SKILL_MAX_RESOURCES, w as MCP_SKILL_MAX_TOTAL_BYTES, x as MCP_SKILL_SNAPSHOTS_MAX_BYTES, y as MCP_SKILL_SNAPSHOT_MAX_DEPTH, z as MCP_SKILL_SNAPSHOT_MAX_DIRECTORIES, A as MCP_SKILL_URI_MAX_CHARS, B as McpAppCsp, C as McpAppPermissions, D as McpAppResource, E as McpAppVisibility, F as McpElicitationFieldSchema, G as McpSkillsOptions, H as McpSkillsSetting, S as SkillDirectoryListing, J as mcpAppOrigin, K as mcpSkillEntryRefusal, L as mcpSkillPreamble, N as mcpSkillUriRefusal } from './elicitation-DS-84_bF.js';
|
|
4
4
|
import { A as AgentToolSet, a as AgentTool } from './types-DwSMj_Xs.js';
|
|
5
5
|
export { p as promptHintOf } from './types-DwSMj_Xs.js';
|
|
6
|
+
import { PipelineEvent, PipelineNode, PipelineDefinition, PipelineResult, PipelineNodeRunner } from './pipeline-engine.js';
|
|
7
|
+
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.js';
|
|
6
8
|
import { z, ZodType } from 'zod';
|
|
7
9
|
import { IDBPDatabase } from 'idb';
|
|
8
10
|
|
|
@@ -117,7 +119,8 @@ interface IStepResult {
|
|
|
117
119
|
* stored — pass them again to `run()` when resuming.
|
|
118
120
|
*
|
|
119
121
|
* Persistence is observability, not a correctness boundary: a hook that throws is
|
|
120
|
-
* logged and the run carries on.
|
|
122
|
+
* logged and the run carries on. The one exception is `onRunResume`: a resume whose attempt
|
|
123
|
+
* cannot be put on record is refused (see `recordResume`).
|
|
121
124
|
*/
|
|
122
125
|
type RunStatus = 'executing' | 'complete' | 'failed' | 'cancelled';
|
|
123
126
|
/** Everything needed to continue a run from the end of an iteration. */
|
|
@@ -172,6 +175,13 @@ interface RunSnapshot {
|
|
|
172
175
|
escalations?: number;
|
|
173
176
|
/** Helpers the model started so far (counts against `subagents.dynamic.maxChildren` on resume). */
|
|
174
177
|
subagentsSpawned?: number;
|
|
178
|
+
/**
|
|
179
|
+
* The attempt that wrote the snapshot: 1 for the run as first started, one more for every
|
|
180
|
+
* resume - the `attempt` of its events. A resume records its attempt BEFORE any of its events
|
|
181
|
+
* (`onRunResume`), so a crash at any point never lets two attempts share a number. Absent on a
|
|
182
|
+
* snapshot written before the field existed: read as 1.
|
|
183
|
+
*/
|
|
184
|
+
attempt?: number;
|
|
175
185
|
/** Final answer (status `complete`). */
|
|
176
186
|
text?: string;
|
|
177
187
|
/** What ended the run (status `failed`). */
|
|
@@ -185,6 +195,14 @@ interface RunPersistence {
|
|
|
185
195
|
onStepComplete?: (snapshot: RunSnapshot) => void | Promise<void>;
|
|
186
196
|
/** The run resolved: `complete`, `failed` (it threw) or `cancelled` (it was stopped). */
|
|
187
197
|
onRunComplete?: (snapshot: RunSnapshot) => void | Promise<void>;
|
|
198
|
+
/**
|
|
199
|
+
* A resume is starting: the loaded snapshot with the NEW `attempt` (status `executing`),
|
|
200
|
+
* written before the resumed run emits anything, so that a crash before its first checkpoint
|
|
201
|
+
* still leaves the attempt on record. Without it the same write goes to `onStepComplete`.
|
|
202
|
+
* Unlike the other write hooks this one is NOT best-effort: a throw fails the resume (nothing
|
|
203
|
+
* ran) - an attempt that is not on record would be reused by the next resume.
|
|
204
|
+
*/
|
|
205
|
+
onRunResume?: (snapshot: RunSnapshot) => void | Promise<void>;
|
|
188
206
|
/**
|
|
189
207
|
* What `run(goal, { resumeFromRunId })` reads. Return `null` when there is none.
|
|
190
208
|
* An implementation that does not want to support resume can leave it out.
|
|
@@ -849,6 +867,8 @@ interface SkillToolsMcp {
|
|
|
849
867
|
sources: readonly McpSkillSource[];
|
|
850
868
|
/** The run's consent scope: a person is asked through the agent's approval gate. */
|
|
851
869
|
scope?: McpSkillConsentScope;
|
|
870
|
+
/** What the agent's snapshots of generated skills hold (a skill added by URI counts there). */
|
|
871
|
+
memory?: McpSkillSnapshotMemory;
|
|
852
872
|
}
|
|
853
873
|
/**
|
|
854
874
|
* The built-in `load_skill` / `read_skill_file` tools. `onLoad` fires when a
|
|
@@ -1041,7 +1061,7 @@ declare const SPAWN_INPUT_SCHEMA: {
|
|
|
1041
1061
|
readonly description: "Optional: the names of YOUR tools the helper may use. Only tools you have can be named. Omit it for the default set; pass [] for a helper that only reasons.";
|
|
1042
1062
|
};
|
|
1043
1063
|
};
|
|
1044
|
-
readonly required:
|
|
1064
|
+
readonly required: string[];
|
|
1045
1065
|
readonly additionalProperties: false;
|
|
1046
1066
|
};
|
|
1047
1067
|
interface ISpawnTokenLimits {
|
|
@@ -1453,201 +1473,6 @@ interface IAiSdkDecisionOptions {
|
|
|
1453
1473
|
}
|
|
1454
1474
|
declare const decisionModelFromAiSdk: (model: Experimental_DecisionModel, options?: IAiSdkDecisionOptions) => IDecisionModel;
|
|
1455
1475
|
|
|
1456
|
-
interface PipelineDefinition {
|
|
1457
|
-
version: 1;
|
|
1458
|
-
name?: string;
|
|
1459
|
-
entry: string;
|
|
1460
|
-
nodes: PipelineNode[];
|
|
1461
|
-
edges: PipelineEdge[];
|
|
1462
|
-
limits?: {
|
|
1463
|
-
maxNodeVisits?: number;
|
|
1464
|
-
maxRuns?: number;
|
|
1465
|
-
};
|
|
1466
|
-
}
|
|
1467
|
-
interface PipelineNode {
|
|
1468
|
-
id: string;
|
|
1469
|
-
name?: string;
|
|
1470
|
-
instructions?: string;
|
|
1471
|
-
model?: string;
|
|
1472
|
-
skills?: string[];
|
|
1473
|
-
tools?: string[];
|
|
1474
|
-
mcpServers?: string[];
|
|
1475
|
-
routes?: PipelineRoute[];
|
|
1476
|
-
join?: 'all' | 'any';
|
|
1477
|
-
settings?: Record<string, unknown>;
|
|
1478
|
-
position?: {
|
|
1479
|
-
x: number;
|
|
1480
|
-
y: number;
|
|
1481
|
-
};
|
|
1482
|
-
}
|
|
1483
|
-
interface PipelineRoute {
|
|
1484
|
-
label: string;
|
|
1485
|
-
description?: string;
|
|
1486
|
-
}
|
|
1487
|
-
type PipelineCondition = {
|
|
1488
|
-
kind: 'always';
|
|
1489
|
-
} | {
|
|
1490
|
-
kind: 'contains';
|
|
1491
|
-
text: string;
|
|
1492
|
-
caseSensitive?: boolean;
|
|
1493
|
-
} | {
|
|
1494
|
-
kind: 'matches';
|
|
1495
|
-
pattern: string;
|
|
1496
|
-
flags?: string;
|
|
1497
|
-
} | {
|
|
1498
|
-
kind: 'route';
|
|
1499
|
-
label: string;
|
|
1500
|
-
} | {
|
|
1501
|
-
kind: 'otherwise';
|
|
1502
|
-
};
|
|
1503
|
-
interface PipelineEdge {
|
|
1504
|
-
id?: string;
|
|
1505
|
-
from: string;
|
|
1506
|
-
to: string;
|
|
1507
|
-
when?: PipelineCondition;
|
|
1508
|
-
}
|
|
1509
|
-
declare const PIPELINE_LIMITS: {
|
|
1510
|
-
readonly maxNodeVisits: 3;
|
|
1511
|
-
readonly maxRuns: 25;
|
|
1512
|
-
readonly maxNodeVisitsCeiling: 100;
|
|
1513
|
-
readonly maxRunsCeiling: 1000;
|
|
1514
|
-
readonly maxNodes: 200;
|
|
1515
|
-
readonly maxEdges: 1000;
|
|
1516
|
-
readonly maxRoutes: 20;
|
|
1517
|
-
readonly maxPatternLength: 500;
|
|
1518
|
-
readonly maxPatternProgram: 1000;
|
|
1519
|
-
readonly conditionInputChars: 50000;
|
|
1520
|
-
};
|
|
1521
|
-
interface PipelineUsage {
|
|
1522
|
-
inputTokens: number;
|
|
1523
|
-
outputTokens: number;
|
|
1524
|
-
totalTokens: number;
|
|
1525
|
-
reasoningTokens?: number;
|
|
1526
|
-
cachedInputTokens?: number;
|
|
1527
|
-
cacheWriteTokens?: number;
|
|
1528
|
-
}
|
|
1529
|
-
interface PipelineNodeSource {
|
|
1530
|
-
nodeId: string;
|
|
1531
|
-
name?: string;
|
|
1532
|
-
text: string;
|
|
1533
|
-
}
|
|
1534
|
-
interface PipelineNodeInput {
|
|
1535
|
-
request: string;
|
|
1536
|
-
from: PipelineNodeSource[];
|
|
1537
|
-
visit: number;
|
|
1538
|
-
}
|
|
1539
|
-
interface PipelineNodeOutput {
|
|
1540
|
-
text: string;
|
|
1541
|
-
usage?: PipelineUsage;
|
|
1542
|
-
route?: string;
|
|
1543
|
-
}
|
|
1544
|
-
interface PipelineNodeContext<E = never> {
|
|
1545
|
-
signal: AbortSignal;
|
|
1546
|
-
pipeline: PipelineDefinition;
|
|
1547
|
-
emit: (event: E) => void;
|
|
1548
|
-
}
|
|
1549
|
-
type PipelineNodeRunner<E = never> = (node: PipelineNode, input: PipelineNodeInput, ctx: PipelineNodeContext<E>) => Promise<PipelineNodeOutput>;
|
|
1550
|
-
type PipelineStop = 'maxRuns' | 'maxNodeVisits' | 'aborted';
|
|
1551
|
-
type PipelineEvent = {
|
|
1552
|
-
type: 'pipeline.started';
|
|
1553
|
-
pipeline?: string;
|
|
1554
|
-
} | {
|
|
1555
|
-
type: 'pipeline.node.started';
|
|
1556
|
-
nodeId: string;
|
|
1557
|
-
visit: number;
|
|
1558
|
-
from: string[];
|
|
1559
|
-
} | {
|
|
1560
|
-
type: 'pipeline.node.finished';
|
|
1561
|
-
nodeId: string;
|
|
1562
|
-
visit: number;
|
|
1563
|
-
text: string;
|
|
1564
|
-
route?: string;
|
|
1565
|
-
usage?: PipelineUsage;
|
|
1566
|
-
} | {
|
|
1567
|
-
type: 'pipeline.node.failed';
|
|
1568
|
-
nodeId: string;
|
|
1569
|
-
visit: number;
|
|
1570
|
-
error: string;
|
|
1571
|
-
} | {
|
|
1572
|
-
type: 'pipeline.node.skipped';
|
|
1573
|
-
nodeId: string;
|
|
1574
|
-
from: string[];
|
|
1575
|
-
reason: 'maxRuns' | 'maxNodeVisits';
|
|
1576
|
-
} | {
|
|
1577
|
-
type: 'pipeline.edge';
|
|
1578
|
-
from: string;
|
|
1579
|
-
to: string;
|
|
1580
|
-
edgeId: string;
|
|
1581
|
-
visit: number;
|
|
1582
|
-
fired: boolean;
|
|
1583
|
-
} | {
|
|
1584
|
-
type: 'pipeline.finished';
|
|
1585
|
-
stoppedBy?: PipelineStop;
|
|
1586
|
-
runs: number;
|
|
1587
|
-
};
|
|
1588
|
-
type PipelineTraceEntry = {
|
|
1589
|
-
type: 'node';
|
|
1590
|
-
nodeId: string;
|
|
1591
|
-
visit: number;
|
|
1592
|
-
wave: number;
|
|
1593
|
-
from: string[];
|
|
1594
|
-
text: string;
|
|
1595
|
-
route?: string;
|
|
1596
|
-
usage?: PipelineUsage;
|
|
1597
|
-
} | {
|
|
1598
|
-
type: 'edge';
|
|
1599
|
-
from: string;
|
|
1600
|
-
to: string;
|
|
1601
|
-
edgeId: string;
|
|
1602
|
-
visit: number;
|
|
1603
|
-
fired: boolean;
|
|
1604
|
-
} | {
|
|
1605
|
-
type: 'dropped';
|
|
1606
|
-
nodeId: string;
|
|
1607
|
-
from: string[];
|
|
1608
|
-
reason: 'maxRuns' | 'maxNodeVisits';
|
|
1609
|
-
};
|
|
1610
|
-
interface PipelineResult {
|
|
1611
|
-
text: string;
|
|
1612
|
-
outputs: Record<string, {
|
|
1613
|
-
visit: number;
|
|
1614
|
-
text: string;
|
|
1615
|
-
route?: string;
|
|
1616
|
-
}[]>;
|
|
1617
|
-
trace: PipelineTraceEntry[];
|
|
1618
|
-
usage: PipelineUsage;
|
|
1619
|
-
stoppedBy?: PipelineStop;
|
|
1620
|
-
runs: number;
|
|
1621
|
-
}
|
|
1622
|
-
interface PipelineIssue {
|
|
1623
|
-
code: string;
|
|
1624
|
-
message: string;
|
|
1625
|
-
nodeId?: string;
|
|
1626
|
-
edgeId?: string;
|
|
1627
|
-
edgeIndex?: number;
|
|
1628
|
-
}
|
|
1629
|
-
interface PipelineValidation {
|
|
1630
|
-
ok: boolean;
|
|
1631
|
-
errors: PipelineIssue[];
|
|
1632
|
-
warnings: PipelineIssue[];
|
|
1633
|
-
}
|
|
1634
|
-
declare class PipelineValidationError extends Error {
|
|
1635
|
-
errors: PipelineIssue[];
|
|
1636
|
-
constructor(errors: PipelineIssue[]);
|
|
1637
|
-
}
|
|
1638
|
-
declare class PipelineNodeError extends Error {
|
|
1639
|
-
nodeId: string;
|
|
1640
|
-
visit: number;
|
|
1641
|
-
constructor(nodeId: string, visit: number, cause: unknown);
|
|
1642
|
-
}
|
|
1643
|
-
declare const testPipelineCondition: (when: PipelineCondition | undefined, output: {
|
|
1644
|
-
text: string;
|
|
1645
|
-
route?: string;
|
|
1646
|
-
}, matcher?: (text: string) => boolean) => boolean;
|
|
1647
|
-
declare const normalizePipeline: (definition: PipelineDefinition) => PipelineDefinition;
|
|
1648
|
-
declare const validatePipeline: (definition: PipelineDefinition) => PipelineValidation;
|
|
1649
|
-
declare const renderPipelineNodeInput: (input: PipelineNodeInput) => string;
|
|
1650
|
-
|
|
1651
1476
|
/**
|
|
1652
1477
|
* Tool consent. Every tool call passes a gate that decides allow / ask / deny:
|
|
1653
1478
|
*
|
|
@@ -2192,10 +2017,20 @@ type AgentEventBody =
|
|
|
2192
2017
|
/** A pipeline's own events (`createPipeline`): the run, each node visit, each edge decision. */
|
|
2193
2018
|
| PipelineEvent;
|
|
2194
2019
|
/**
|
|
2020
|
+
* `seq` / `attempt` order a run's events, across crashes and resumes: `attempt` is 1 for a fresh
|
|
2021
|
+
* run and one more for every resume, `seq` counts the events of one attempt from 1. Ordered by
|
|
2022
|
+
* (attempt, seq) the events of a run are a total order. Delivery is at-least-once: the step a
|
|
2023
|
+
* crash interrupted runs again under the next attempt, so its events come again with that
|
|
2024
|
+
* attempt's numbers. A `subagent.event` envelope is numbered in the parent run; the child event
|
|
2025
|
+
* inside keeps its own numbers. Events outside a run (a pipeline's own `pipeline.*` events,
|
|
2026
|
+
* `approveAppToolCall`, `sampleForApp`) carry none.
|
|
2027
|
+
*
|
|
2195
2028
|
* `nodeId` / `visit` are set on the events a pipeline forwards from a node's agent (and on the
|
|
2196
2029
|
* `pipeline.node.*` events themselves).
|
|
2197
2030
|
*/
|
|
2198
2031
|
type AgentEvent = AgentEventBody & {
|
|
2032
|
+
seq?: number;
|
|
2033
|
+
attempt?: number;
|
|
2199
2034
|
nodeId?: string;
|
|
2200
2035
|
visit?: number;
|
|
2201
2036
|
};
|
|
@@ -3202,6 +3037,14 @@ interface RunOptions {
|
|
|
3202
3037
|
* planning again. Attachments are not stored: pass them again if the run needs them.
|
|
3203
3038
|
*/
|
|
3204
3039
|
resumeFromRunId?: string;
|
|
3040
|
+
/**
|
|
3041
|
+
* A fresh run's id, in place of a random one: a host that keys runs by ids of its own (a
|
|
3042
|
+
* session and a turn) gives one, so that a retry finds the same run. 1-128 letters, digits,
|
|
3043
|
+
* `_` or `-`, as every run id. Refused - thrown before anything of the run - together with
|
|
3044
|
+
* `resumeFromRunId`, and when `persistence.loadRun` has a snapshot for it (resume that run
|
|
3045
|
+
* instead): a run on record is never written over.
|
|
3046
|
+
*/
|
|
3047
|
+
runId?: string;
|
|
3205
3048
|
/**
|
|
3206
3049
|
* Steer the run while it goes: `control.send(text)` puts a message in front of the model
|
|
3207
3050
|
* at the next boundary, `control.stopSubagent(id)` stops one subagent. Make it with
|
|
@@ -3606,7 +3449,9 @@ findings?: string[]) => Promise<{
|
|
|
3606
3449
|
/**
|
|
3607
3450
|
* A pipeline: a graph of agents with conditions and loops, described in plain JSON. The graph
|
|
3608
3451
|
* engine (validation, conditions, scheduling) is `engine.ts`, the same file as the Node
|
|
3609
|
-
* sibling's; this file is the adapter that runs a node with this package's createAgent
|
|
3452
|
+
* sibling's; this file is the adapter that runs a node with this package's createAgent, and the
|
|
3453
|
+
* route call after it (`pickPipelineRoute`, public for hosts that run the graph themselves with
|
|
3454
|
+
* `runPipelineGraph`).
|
|
3610
3455
|
*/
|
|
3611
3456
|
interface PipelineOptions {
|
|
3612
3457
|
/** The seam: run a node yourself. When given, the pipeline knows nothing about agents. */
|
|
@@ -3634,6 +3479,33 @@ interface Pipeline {
|
|
|
3634
3479
|
/** Drop the node agents. The pipeline can run again: agents are created anew. */
|
|
3635
3480
|
close: () => Promise<void>;
|
|
3636
3481
|
}
|
|
3482
|
+
interface PipelineRouteOptions {
|
|
3483
|
+
/**
|
|
3484
|
+
* The node's agent: its planner model picks the route (structured output, then plain text), its
|
|
3485
|
+
* decision model (`config.decisionModel`, resolved) is asked first.
|
|
3486
|
+
*/
|
|
3487
|
+
agent: Agent;
|
|
3488
|
+
/** The config that agent was built from: the budget, temperature, timeout and `decision`. */
|
|
3489
|
+
config: BrowserAgentConfig;
|
|
3490
|
+
signal?: AbortSignal;
|
|
3491
|
+
/** A decision model's `usage` and `decision` events. A handler that throws breaks nothing. */
|
|
3492
|
+
onEvent?: AgentEventHandler;
|
|
3493
|
+
}
|
|
3494
|
+
interface PipelineRouteResult {
|
|
3495
|
+
/** One of the node's labels, or undefined: no route. */
|
|
3496
|
+
route?: string;
|
|
3497
|
+
/** What the call cost, a failed attempt and a decision model's question included. */
|
|
3498
|
+
usage: IUsage;
|
|
3499
|
+
}
|
|
3500
|
+
/**
|
|
3501
|
+
* The route call createPipeline makes after a node with routes answered, as a function of its
|
|
3502
|
+
* own: a host that runs the graph itself (`runPipelineGraph`) calls it wherever the node ran, with
|
|
3503
|
+
* the node's answer. The node's decision model first, when it is confident of a label; otherwise
|
|
3504
|
+
* the node's planner model (structured output, then plain text). An answer that is not one of the
|
|
3505
|
+
* labels, or a call that fails, is no route (`route` undefined); an abort rejects with an
|
|
3506
|
+
* AbortError. A node without routes costs nothing.
|
|
3507
|
+
*/
|
|
3508
|
+
declare const pickPipelineRoute: (node: PipelineNode, text: string, options: PipelineRouteOptions) => Promise<PipelineRouteResult>;
|
|
3637
3509
|
declare const createPipeline: (definition: PipelineDefinition, options: PipelineOptions) => Pipeline;
|
|
3638
3510
|
interface NodeResolverOptions {
|
|
3639
3511
|
/**
|
|
@@ -4530,6 +4402,8 @@ declare class MemoryRunStore implements RunPersistence {
|
|
|
4530
4402
|
constructor(opts?: RunStoreOptions);
|
|
4531
4403
|
onRunStart(snapshot: RunSnapshot): void;
|
|
4532
4404
|
onStepComplete(snapshot: RunSnapshot): void;
|
|
4405
|
+
/** A resume started: its attempt is on record before any of its events. */
|
|
4406
|
+
onRunResume(snapshot: RunSnapshot): void;
|
|
4533
4407
|
onRunComplete(snapshot: RunSnapshot): void;
|
|
4534
4408
|
loadRun(runId: string): RunSnapshot | null;
|
|
4535
4409
|
/** Runs that can still be resumed (executing, stopped or failed), newest first. */
|
|
@@ -4562,6 +4436,8 @@ declare class IndexedDBRunStore implements RunPersistence {
|
|
|
4562
4436
|
private put;
|
|
4563
4437
|
onRunStart(snapshot: RunSnapshot): Promise<void>;
|
|
4564
4438
|
onStepComplete(snapshot: RunSnapshot): Promise<void>;
|
|
4439
|
+
/** A resume started: its attempt is on record before any of its events. */
|
|
4440
|
+
onRunResume(snapshot: RunSnapshot): Promise<void>;
|
|
4565
4441
|
onRunComplete(snapshot: RunSnapshot): Promise<void>;
|
|
4566
4442
|
loadRun(runId: string): Promise<RunSnapshot | null>;
|
|
4567
4443
|
/** Runs that can still be resumed (executing, stopped or failed), newest first. */
|
|
@@ -4572,5 +4448,5 @@ declare class IndexedDBRunStore implements RunPersistence {
|
|
|
4572
4448
|
clear(): Promise<void>;
|
|
4573
4449
|
}
|
|
4574
4450
|
|
|
4575
|
-
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,
|
|
4576
|
-
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,
|
|
4451
|
+
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, 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, SKILL_TOOL_NAMES, SPAWN_INPUT_SCHEMA, SPAWN_SUBAGENT_TOOL, SUBAGENT_DEFAULTS, SUBAGENT_MAX_DEPTH_LIMIT, 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, openAgentWebDB, outputCapNotice, parseExecutorResponse, parsePlainText, parsePlannerResponse, parseReplannerResponse, parseSearchResponse, parseSkillMarkdown, pickPipelineRoute, pickTier, 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, webLLMContextWindow, withRollingBreakpoint, withSystem, withWebLLMContextWindow, wrapTranscript };
|
|
4452
|
+
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, Skill, SkillOrigin, SkillStore, StageInput, StageOverride, StepComplexity, 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, WebLLMAppConfigLike, WebLLMModelOptions, WorkerLike, WorkerToParent };
|