@dudko.dev/agent-web 0.0.42 → 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 +95 -2
- package/dist/agent-web.js +130 -130
- package/dist/agent-web.js.map +1 -1
- package/dist/index.cjs +201 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -200
- package/dist/index.d.ts +74 -200
- package/dist/index.js +195 -20
- package/dist/index.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/package.json +13 -3
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,8 @@ import { V as VaultOptions, M as McpSkillSource, a as McpSkillConsent, b as McpS
|
|
|
3
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.cjs';
|
|
4
4
|
import { A as AgentToolSet, a as AgentTool } from './types-DwSMj_Xs.cjs';
|
|
5
5
|
export { p as promptHintOf } from './types-DwSMj_Xs.cjs';
|
|
6
|
+
import { PipelineEvent, PipelineNode, PipelineDefinition, PipelineResult, PipelineNodeRunner } from './pipeline-engine.cjs';
|
|
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.cjs';
|
|
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.
|
|
@@ -1043,7 +1061,7 @@ declare const SPAWN_INPUT_SCHEMA: {
|
|
|
1043
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.";
|
|
1044
1062
|
};
|
|
1045
1063
|
};
|
|
1046
|
-
readonly required:
|
|
1064
|
+
readonly required: string[];
|
|
1047
1065
|
readonly additionalProperties: false;
|
|
1048
1066
|
};
|
|
1049
1067
|
interface ISpawnTokenLimits {
|
|
@@ -1455,201 +1473,6 @@ interface IAiSdkDecisionOptions {
|
|
|
1455
1473
|
}
|
|
1456
1474
|
declare const decisionModelFromAiSdk: (model: Experimental_DecisionModel, options?: IAiSdkDecisionOptions) => IDecisionModel;
|
|
1457
1475
|
|
|
1458
|
-
interface PipelineDefinition {
|
|
1459
|
-
version: 1;
|
|
1460
|
-
name?: string;
|
|
1461
|
-
entry: string;
|
|
1462
|
-
nodes: PipelineNode[];
|
|
1463
|
-
edges: PipelineEdge[];
|
|
1464
|
-
limits?: {
|
|
1465
|
-
maxNodeVisits?: number;
|
|
1466
|
-
maxRuns?: number;
|
|
1467
|
-
};
|
|
1468
|
-
}
|
|
1469
|
-
interface PipelineNode {
|
|
1470
|
-
id: string;
|
|
1471
|
-
name?: string;
|
|
1472
|
-
instructions?: string;
|
|
1473
|
-
model?: string;
|
|
1474
|
-
skills?: string[];
|
|
1475
|
-
tools?: string[];
|
|
1476
|
-
mcpServers?: string[];
|
|
1477
|
-
routes?: PipelineRoute[];
|
|
1478
|
-
join?: 'all' | 'any';
|
|
1479
|
-
settings?: Record<string, unknown>;
|
|
1480
|
-
position?: {
|
|
1481
|
-
x: number;
|
|
1482
|
-
y: number;
|
|
1483
|
-
};
|
|
1484
|
-
}
|
|
1485
|
-
interface PipelineRoute {
|
|
1486
|
-
label: string;
|
|
1487
|
-
description?: string;
|
|
1488
|
-
}
|
|
1489
|
-
type PipelineCondition = {
|
|
1490
|
-
kind: 'always';
|
|
1491
|
-
} | {
|
|
1492
|
-
kind: 'contains';
|
|
1493
|
-
text: string;
|
|
1494
|
-
caseSensitive?: boolean;
|
|
1495
|
-
} | {
|
|
1496
|
-
kind: 'matches';
|
|
1497
|
-
pattern: string;
|
|
1498
|
-
flags?: string;
|
|
1499
|
-
} | {
|
|
1500
|
-
kind: 'route';
|
|
1501
|
-
label: string;
|
|
1502
|
-
} | {
|
|
1503
|
-
kind: 'otherwise';
|
|
1504
|
-
};
|
|
1505
|
-
interface PipelineEdge {
|
|
1506
|
-
id?: string;
|
|
1507
|
-
from: string;
|
|
1508
|
-
to: string;
|
|
1509
|
-
when?: PipelineCondition;
|
|
1510
|
-
}
|
|
1511
|
-
declare const PIPELINE_LIMITS: {
|
|
1512
|
-
readonly maxNodeVisits: 3;
|
|
1513
|
-
readonly maxRuns: 25;
|
|
1514
|
-
readonly maxNodeVisitsCeiling: 100;
|
|
1515
|
-
readonly maxRunsCeiling: 1000;
|
|
1516
|
-
readonly maxNodes: 200;
|
|
1517
|
-
readonly maxEdges: 1000;
|
|
1518
|
-
readonly maxRoutes: 20;
|
|
1519
|
-
readonly maxPatternLength: 500;
|
|
1520
|
-
readonly maxPatternProgram: 1000;
|
|
1521
|
-
readonly conditionInputChars: 50000;
|
|
1522
|
-
};
|
|
1523
|
-
interface PipelineUsage {
|
|
1524
|
-
inputTokens: number;
|
|
1525
|
-
outputTokens: number;
|
|
1526
|
-
totalTokens: number;
|
|
1527
|
-
reasoningTokens?: number;
|
|
1528
|
-
cachedInputTokens?: number;
|
|
1529
|
-
cacheWriteTokens?: number;
|
|
1530
|
-
}
|
|
1531
|
-
interface PipelineNodeSource {
|
|
1532
|
-
nodeId: string;
|
|
1533
|
-
name?: string;
|
|
1534
|
-
text: string;
|
|
1535
|
-
}
|
|
1536
|
-
interface PipelineNodeInput {
|
|
1537
|
-
request: string;
|
|
1538
|
-
from: PipelineNodeSource[];
|
|
1539
|
-
visit: number;
|
|
1540
|
-
}
|
|
1541
|
-
interface PipelineNodeOutput {
|
|
1542
|
-
text: string;
|
|
1543
|
-
usage?: PipelineUsage;
|
|
1544
|
-
route?: string;
|
|
1545
|
-
}
|
|
1546
|
-
interface PipelineNodeContext<E = never> {
|
|
1547
|
-
signal: AbortSignal;
|
|
1548
|
-
pipeline: PipelineDefinition;
|
|
1549
|
-
emit: (event: E) => void;
|
|
1550
|
-
}
|
|
1551
|
-
type PipelineNodeRunner<E = never> = (node: PipelineNode, input: PipelineNodeInput, ctx: PipelineNodeContext<E>) => Promise<PipelineNodeOutput>;
|
|
1552
|
-
type PipelineStop = 'maxRuns' | 'maxNodeVisits' | 'aborted';
|
|
1553
|
-
type PipelineEvent = {
|
|
1554
|
-
type: 'pipeline.started';
|
|
1555
|
-
pipeline?: string;
|
|
1556
|
-
} | {
|
|
1557
|
-
type: 'pipeline.node.started';
|
|
1558
|
-
nodeId: string;
|
|
1559
|
-
visit: number;
|
|
1560
|
-
from: string[];
|
|
1561
|
-
} | {
|
|
1562
|
-
type: 'pipeline.node.finished';
|
|
1563
|
-
nodeId: string;
|
|
1564
|
-
visit: number;
|
|
1565
|
-
text: string;
|
|
1566
|
-
route?: string;
|
|
1567
|
-
usage?: PipelineUsage;
|
|
1568
|
-
} | {
|
|
1569
|
-
type: 'pipeline.node.failed';
|
|
1570
|
-
nodeId: string;
|
|
1571
|
-
visit: number;
|
|
1572
|
-
error: string;
|
|
1573
|
-
} | {
|
|
1574
|
-
type: 'pipeline.node.skipped';
|
|
1575
|
-
nodeId: string;
|
|
1576
|
-
from: string[];
|
|
1577
|
-
reason: 'maxRuns' | 'maxNodeVisits';
|
|
1578
|
-
} | {
|
|
1579
|
-
type: 'pipeline.edge';
|
|
1580
|
-
from: string;
|
|
1581
|
-
to: string;
|
|
1582
|
-
edgeId: string;
|
|
1583
|
-
visit: number;
|
|
1584
|
-
fired: boolean;
|
|
1585
|
-
} | {
|
|
1586
|
-
type: 'pipeline.finished';
|
|
1587
|
-
stoppedBy?: PipelineStop;
|
|
1588
|
-
runs: number;
|
|
1589
|
-
};
|
|
1590
|
-
type PipelineTraceEntry = {
|
|
1591
|
-
type: 'node';
|
|
1592
|
-
nodeId: string;
|
|
1593
|
-
visit: number;
|
|
1594
|
-
wave: number;
|
|
1595
|
-
from: string[];
|
|
1596
|
-
text: string;
|
|
1597
|
-
route?: string;
|
|
1598
|
-
usage?: PipelineUsage;
|
|
1599
|
-
} | {
|
|
1600
|
-
type: 'edge';
|
|
1601
|
-
from: string;
|
|
1602
|
-
to: string;
|
|
1603
|
-
edgeId: string;
|
|
1604
|
-
visit: number;
|
|
1605
|
-
fired: boolean;
|
|
1606
|
-
} | {
|
|
1607
|
-
type: 'dropped';
|
|
1608
|
-
nodeId: string;
|
|
1609
|
-
from: string[];
|
|
1610
|
-
reason: 'maxRuns' | 'maxNodeVisits';
|
|
1611
|
-
};
|
|
1612
|
-
interface PipelineResult {
|
|
1613
|
-
text: string;
|
|
1614
|
-
outputs: Record<string, {
|
|
1615
|
-
visit: number;
|
|
1616
|
-
text: string;
|
|
1617
|
-
route?: string;
|
|
1618
|
-
}[]>;
|
|
1619
|
-
trace: PipelineTraceEntry[];
|
|
1620
|
-
usage: PipelineUsage;
|
|
1621
|
-
stoppedBy?: PipelineStop;
|
|
1622
|
-
runs: number;
|
|
1623
|
-
}
|
|
1624
|
-
interface PipelineIssue {
|
|
1625
|
-
code: string;
|
|
1626
|
-
message: string;
|
|
1627
|
-
nodeId?: string;
|
|
1628
|
-
edgeId?: string;
|
|
1629
|
-
edgeIndex?: number;
|
|
1630
|
-
}
|
|
1631
|
-
interface PipelineValidation {
|
|
1632
|
-
ok: boolean;
|
|
1633
|
-
errors: PipelineIssue[];
|
|
1634
|
-
warnings: PipelineIssue[];
|
|
1635
|
-
}
|
|
1636
|
-
declare class PipelineValidationError extends Error {
|
|
1637
|
-
errors: PipelineIssue[];
|
|
1638
|
-
constructor(errors: PipelineIssue[]);
|
|
1639
|
-
}
|
|
1640
|
-
declare class PipelineNodeError extends Error {
|
|
1641
|
-
nodeId: string;
|
|
1642
|
-
visit: number;
|
|
1643
|
-
constructor(nodeId: string, visit: number, cause: unknown);
|
|
1644
|
-
}
|
|
1645
|
-
declare const testPipelineCondition: (when: PipelineCondition | undefined, output: {
|
|
1646
|
-
text: string;
|
|
1647
|
-
route?: string;
|
|
1648
|
-
}, matcher?: (text: string) => boolean) => boolean;
|
|
1649
|
-
declare const normalizePipeline: (definition: PipelineDefinition) => PipelineDefinition;
|
|
1650
|
-
declare const validatePipeline: (definition: PipelineDefinition) => PipelineValidation;
|
|
1651
|
-
declare const renderPipelineNodeInput: (input: PipelineNodeInput) => string;
|
|
1652
|
-
|
|
1653
1476
|
/**
|
|
1654
1477
|
* Tool consent. Every tool call passes a gate that decides allow / ask / deny:
|
|
1655
1478
|
*
|
|
@@ -2194,10 +2017,20 @@ type AgentEventBody =
|
|
|
2194
2017
|
/** A pipeline's own events (`createPipeline`): the run, each node visit, each edge decision. */
|
|
2195
2018
|
| PipelineEvent;
|
|
2196
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
|
+
*
|
|
2197
2028
|
* `nodeId` / `visit` are set on the events a pipeline forwards from a node's agent (and on the
|
|
2198
2029
|
* `pipeline.node.*` events themselves).
|
|
2199
2030
|
*/
|
|
2200
2031
|
type AgentEvent = AgentEventBody & {
|
|
2032
|
+
seq?: number;
|
|
2033
|
+
attempt?: number;
|
|
2201
2034
|
nodeId?: string;
|
|
2202
2035
|
visit?: number;
|
|
2203
2036
|
};
|
|
@@ -3204,6 +3037,14 @@ interface RunOptions {
|
|
|
3204
3037
|
* planning again. Attachments are not stored: pass them again if the run needs them.
|
|
3205
3038
|
*/
|
|
3206
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;
|
|
3207
3048
|
/**
|
|
3208
3049
|
* Steer the run while it goes: `control.send(text)` puts a message in front of the model
|
|
3209
3050
|
* at the next boundary, `control.stopSubagent(id)` stops one subagent. Make it with
|
|
@@ -3608,7 +3449,9 @@ findings?: string[]) => Promise<{
|
|
|
3608
3449
|
/**
|
|
3609
3450
|
* A pipeline: a graph of agents with conditions and loops, described in plain JSON. The graph
|
|
3610
3451
|
* engine (validation, conditions, scheduling) is `engine.ts`, the same file as the Node
|
|
3611
|
-
* 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`).
|
|
3612
3455
|
*/
|
|
3613
3456
|
interface PipelineOptions {
|
|
3614
3457
|
/** The seam: run a node yourself. When given, the pipeline knows nothing about agents. */
|
|
@@ -3636,6 +3479,33 @@ interface Pipeline {
|
|
|
3636
3479
|
/** Drop the node agents. The pipeline can run again: agents are created anew. */
|
|
3637
3480
|
close: () => Promise<void>;
|
|
3638
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>;
|
|
3639
3509
|
declare const createPipeline: (definition: PipelineDefinition, options: PipelineOptions) => Pipeline;
|
|
3640
3510
|
interface NodeResolverOptions {
|
|
3641
3511
|
/**
|
|
@@ -4532,6 +4402,8 @@ declare class MemoryRunStore implements RunPersistence {
|
|
|
4532
4402
|
constructor(opts?: RunStoreOptions);
|
|
4533
4403
|
onRunStart(snapshot: RunSnapshot): void;
|
|
4534
4404
|
onStepComplete(snapshot: RunSnapshot): void;
|
|
4405
|
+
/** A resume started: its attempt is on record before any of its events. */
|
|
4406
|
+
onRunResume(snapshot: RunSnapshot): void;
|
|
4535
4407
|
onRunComplete(snapshot: RunSnapshot): void;
|
|
4536
4408
|
loadRun(runId: string): RunSnapshot | null;
|
|
4537
4409
|
/** Runs that can still be resumed (executing, stopped or failed), newest first. */
|
|
@@ -4564,6 +4436,8 @@ declare class IndexedDBRunStore implements RunPersistence {
|
|
|
4564
4436
|
private put;
|
|
4565
4437
|
onRunStart(snapshot: RunSnapshot): Promise<void>;
|
|
4566
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>;
|
|
4567
4441
|
onRunComplete(snapshot: RunSnapshot): Promise<void>;
|
|
4568
4442
|
loadRun(runId: string): Promise<RunSnapshot | null>;
|
|
4569
4443
|
/** Runs that can still be resumed (executing, stopped or failed), newest first. */
|
|
@@ -4574,5 +4448,5 @@ declare class IndexedDBRunStore implements RunPersistence {
|
|
|
4574
4448
|
clear(): Promise<void>;
|
|
4575
4449
|
}
|
|
4576
4450
|
|
|
4577
|
-
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,
|
|
4578
|
-
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 };
|