@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
|
@@ -40,9 +40,15 @@ declare class IndexedDBVault {
|
|
|
40
40
|
* (`selectMcpSkills`), the files of a loaded skill the model may read (`resolveMcpSkillFile`),
|
|
41
41
|
* the preamble a skill's text is loaded under, the mark that carries a server's skills on its
|
|
42
42
|
* tools (`markMcpSkills` / `collectMcpSkillSources`), a skill the model names by URI
|
|
43
|
-
* (`mcpSkillUriRefusal`, `resolveMcpSkillServer`: `skills/get` to that one server only)
|
|
43
|
+
* (`mcpSkillUriRefusal`, `resolveMcpSkillServer`: `skills/get` to that one server only), the
|
|
44
44
|
* person's consent before a skill's text enters the model's context (`decideMcpSkillConsent`,
|
|
45
|
-
* `mcpSkillConsentView`)
|
|
45
|
+
* `mcpSkillConsentView`) and a directory of a skill (`skillDirectoryOf`, `resolveMcpSkillPath`,
|
|
46
|
+
* `skillDirectoryListing` - for every kind of skill - and, for a server that serves
|
|
47
|
+
* `resources/directory/read`, `compareMcpSkillDirectory`) and, for a server the host trusts with
|
|
48
|
+
* its generated skills (`skills: { dynamic: true }`), the snapshot such a skill is read into
|
|
49
|
+
* before anyone is asked (`startMcpSkillWalk`, `takeMcpSkillWalkListing`,
|
|
50
|
+
* `mcpSkillSnapshotBytesRefusal`, `mcpSkillSnapshotEntry`). Pure, no imports (a digest is
|
|
51
|
+
* computed with the platform's WebCrypto, `globalThis.crypto.subtle`, or a function passed in).
|
|
46
52
|
*
|
|
47
53
|
* A server's skills are third-party text. They reach the model only as knowledge, under
|
|
48
54
|
* `mcpSkillPreamble`, and - unless the host vetted the server (`consent: 'never'`) - only after a
|
|
@@ -95,13 +101,19 @@ interface McpSkillEntryLike {
|
|
|
95
101
|
* naming rules;
|
|
96
102
|
* - a description to show in the catalog;
|
|
97
103
|
* - `resources` is the complete list of its files (Resources): `"dynamic"` content is declined
|
|
98
|
-
* (a host MAY: there is nothing to verify it against
|
|
104
|
+
* (a host MAY: there is nothing to verify it against, and a consent could not bind to its
|
|
105
|
+
* content) - unless `options.dynamic` (the server's `skills: { dynamic: true }`: the host
|
|
106
|
+
* trusts that server with its generated skills, which are then read into a snapshot before
|
|
107
|
+
* anyone is asked, see {@link mcpSkillSnapshotEntry}); anything else is invalid;
|
|
99
108
|
* - every file is `SKILL.md` or a file inside the skill's directory, listed once, with a
|
|
100
109
|
* `sha256:` digest and a byte size, and `SKILL.md` is listed;
|
|
101
110
|
* - at most {@link MCP_SKILL_MAX_RESOURCES} files and {@link MCP_SKILL_MAX_TOTAL_BYTES} bytes
|
|
102
|
-
* (Limits: "both limits are checkable from the entry alone"
|
|
111
|
+
* (Limits: "both limits are checkable from the entry alone"; a generated skill's are counted
|
|
112
|
+
* on what its snapshot reads).
|
|
103
113
|
*/
|
|
104
|
-
declare const mcpSkillEntryRefusal: (entry: unknown
|
|
114
|
+
declare const mcpSkillEntryRefusal: (entry: unknown, options?: {
|
|
115
|
+
dynamic?: boolean;
|
|
116
|
+
}) => string | undefined;
|
|
105
117
|
/** One skill of a server, as the agent's catalog holds it (the entry stays with the connection). */
|
|
106
118
|
interface McpSkillRecord {
|
|
107
119
|
/** The `SKILL.md` URI: with the server, the skill's identity. */
|
|
@@ -114,6 +126,11 @@ interface McpSkillRecord {
|
|
|
114
126
|
path: string[];
|
|
115
127
|
/** Its files other than `SKILL.md`, by their path inside the skill, sorted. */
|
|
116
128
|
files: string[];
|
|
129
|
+
/**
|
|
130
|
+
* Generated by the server (`"resources": "dynamic"`, taken with `skills: { dynamic: true }`):
|
|
131
|
+
* no files are known until its snapshot is read, and there are no checksums.
|
|
132
|
+
*/
|
|
133
|
+
dynamic?: true;
|
|
117
134
|
}
|
|
118
135
|
/**
|
|
119
136
|
* How a skill of a server is introduced wherever its text is shown to the model (its
|
|
@@ -121,6 +138,44 @@ interface McpSkillRecord {
|
|
|
121
138
|
* wording is the guard.
|
|
122
139
|
*/
|
|
123
140
|
declare const mcpSkillPreamble: (server: string, uri: string) => string;
|
|
141
|
+
/**
|
|
142
|
+
* The most entries of one `resources/directory/read` answer looked at: the specification's 512
|
|
143
|
+
* files per skill, and room for the directories among them. The rest are not looked at.
|
|
144
|
+
*/
|
|
145
|
+
declare const MCP_SKILL_DIRECTORY_ENTRIES_MAX: number;
|
|
146
|
+
/**
|
|
147
|
+
* What a server's live view of a directory says against the entry a skill was loaded with
|
|
148
|
+
* ({@link compareMcpSkillDirectory}): a count and paths of that entry - nothing of the server's
|
|
149
|
+
* own listing.
|
|
150
|
+
*/
|
|
151
|
+
interface McpSkillDirectoryDrift {
|
|
152
|
+
/** Children the server lists that the entry does not hold: counted, never named. */
|
|
153
|
+
extra: number;
|
|
154
|
+
/** Children the entry holds (paths inside the skill) that the server does not list, sorted. */
|
|
155
|
+
notServed: string[];
|
|
156
|
+
/**
|
|
157
|
+
* The server listed more than {@link MCP_SKILL_DIRECTORY_ENTRIES_MAX} entries: only those were
|
|
158
|
+
* looked at - `extra` is at least what it says, and `notServed` is left empty (unknown).
|
|
159
|
+
*/
|
|
160
|
+
truncated: boolean;
|
|
161
|
+
}
|
|
162
|
+
/** What `read_skill_file` answers for a directory of a skill (every path inside the skill). */
|
|
163
|
+
interface SkillDirectoryListing {
|
|
164
|
+
/** The skill's name in the catalog. */
|
|
165
|
+
name: string;
|
|
166
|
+
/** The directory: `.` for the skill's root, else its path inside the skill. */
|
|
167
|
+
directory: string;
|
|
168
|
+
/** Its files (each read with `read_skill_file`), sorted. */
|
|
169
|
+
files: string[];
|
|
170
|
+
/** Its subdirectories (each listed the same way), sorted. */
|
|
171
|
+
directories: string[];
|
|
172
|
+
/** How many more it holds than the two lists show ({@link MCP_SKILL_FILES_SHOWN_MAX} in all). */
|
|
173
|
+
more?: number;
|
|
174
|
+
/** Shown above, but no longer listed by the skill's MCP server: a read of them will fail. */
|
|
175
|
+
notServed?: string[];
|
|
176
|
+
/** The skill changed on its MCP server since it was loaded ({@link mcpSkillDirectoryNote}). */
|
|
177
|
+
note?: string;
|
|
178
|
+
}
|
|
124
179
|
/** The longest URI `load_skill` sends to a server, in characters. */
|
|
125
180
|
declare const MCP_SKILL_URI_MAX_CHARS = 512;
|
|
126
181
|
/**
|
|
@@ -150,6 +205,16 @@ interface McpSkillsOptions {
|
|
|
150
205
|
* vetted (its skills load as soon as the model asks). Whatever the approval mode says.
|
|
151
206
|
*/
|
|
152
207
|
consent?: McpSkillConsent;
|
|
208
|
+
/**
|
|
209
|
+
* `true`: also take this server's GENERATED skills (`"resources": "dynamic"` - no checksums;
|
|
210
|
+
* declined by default). When one would enter the model's context, the agent first reads all
|
|
211
|
+
* of it - `SKILL.md` and, if the server serves `resources/directory/read`, every file its
|
|
212
|
+
* directories list, within the specification's limits - computes each file's digest itself,
|
|
213
|
+
* and holds that copy in memory: the person approves that copy (the consent binds to its
|
|
214
|
+
* digests), and the model is given only that copy, never a later read. Per server, for a
|
|
215
|
+
* server you trust with this; there is no agent-wide switch.
|
|
216
|
+
*/
|
|
217
|
+
dynamic?: boolean;
|
|
153
218
|
}
|
|
154
219
|
/** `skills` on a server's config: `true`, or options (on, with them); `false` / absent: off. */
|
|
155
220
|
type McpSkillsSetting = boolean | McpSkillsOptions;
|
|
@@ -196,9 +261,33 @@ interface McpSkillConsentView {
|
|
|
196
261
|
byUri?: true;
|
|
197
262
|
/** It sits inside this skill of the same server, whose approval does not cover it. */
|
|
198
263
|
nestedIn?: string;
|
|
264
|
+
/**
|
|
265
|
+
* Generated by the server (`"resources": "dynamic"`, taken with `skills: { dynamic: true }`):
|
|
266
|
+
* there are no checksums. The size, the files and the text are those of the copy the agent just
|
|
267
|
+
* read (its snapshot), and only that copy is used - say so.
|
|
268
|
+
*/
|
|
269
|
+
dynamic?: true;
|
|
270
|
+
/**
|
|
271
|
+
* (with `dynamic`) The server cannot list the skill's files (no `resources/directory/read`): the
|
|
272
|
+
* copy is its `SKILL.md` alone, and no other file of it can be read.
|
|
273
|
+
*/
|
|
274
|
+
noFileListing?: true;
|
|
199
275
|
/** Asked for this run only (`'ask'`) or, on a yes, for the agent's life (`'once-per-skill'`). */
|
|
200
276
|
consent: Exclude<McpSkillConsent, 'never'>;
|
|
201
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* The most directories one snapshot reads (`resources/directory/read`, the skill's root
|
|
280
|
+
* included). One read is one directory, its pages walked by the SDK (bounded by its own page cap).
|
|
281
|
+
*/
|
|
282
|
+
declare const MCP_SKILL_SNAPSHOT_MAX_DIRECTORIES = 64;
|
|
283
|
+
/** The deepest directory of a skill a snapshot reads: its root is 0, `templates` 1, ... */
|
|
284
|
+
declare const MCP_SKILL_SNAPSHOT_MAX_DEPTH = 8;
|
|
285
|
+
/** The most bytes the snapshots of one agent hold in memory together. */
|
|
286
|
+
declare const MCP_SKILL_SNAPSHOTS_MAX_BYTES: number;
|
|
287
|
+
/** What the snapshots of one agent hold in memory, in bytes ({@link MCP_SKILL_SNAPSHOTS_MAX_BYTES}). */
|
|
288
|
+
interface McpSkillSnapshotMemory {
|
|
289
|
+
used: number;
|
|
290
|
+
}
|
|
202
291
|
/** A loaded skill: its instructions, and the entry its files are read against (opaque). */
|
|
203
292
|
interface McpSkillLoaded {
|
|
204
293
|
readonly uri: string;
|
|
@@ -208,6 +297,16 @@ interface McpSkillLoaded {
|
|
|
208
297
|
readonly files: readonly string[];
|
|
209
298
|
/** The entry it was loaded with (the "held entry"): what a consent is bound to and shows. */
|
|
210
299
|
readonly entry: McpSkillEntryLike;
|
|
300
|
+
/**
|
|
301
|
+
* A generated skill's snapshot: `entry` is the manifest of the copy the agent read, which is
|
|
302
|
+
* held in memory and the only one used. `bytes`: what it holds (counted against the agent's
|
|
303
|
+
* {@link McpSkillSnapshotMemory}); `listed`: the server listed its files (`directoryRead`) -
|
|
304
|
+
* without, the copy is `SKILL.md` alone.
|
|
305
|
+
*/
|
|
306
|
+
readonly snapshot?: {
|
|
307
|
+
readonly bytes: number;
|
|
308
|
+
readonly listed: boolean;
|
|
309
|
+
};
|
|
211
310
|
}
|
|
212
311
|
/**
|
|
213
312
|
* The skills of one connected server, for the agent (a connection with `skills` on, to a server
|
|
@@ -234,18 +333,33 @@ interface McpSkillSource {
|
|
|
234
333
|
}) => Promise<McpSkillRecord>;
|
|
235
334
|
/**
|
|
236
335
|
* Read the skill's `SKILL.md` and verify it against its entry (size, digest, frontmatter);
|
|
237
|
-
* throws - and gives nothing - when it does not match.
|
|
336
|
+
* throws - and gives nothing - when it does not match. A generated skill (`dynamic`) is read
|
|
337
|
+
* into a snapshot instead (see {@link mcpSkillSnapshotEntry}), its bytes counted against
|
|
338
|
+
* `options.memory` (the agent's; a fresh one without); throws - logged - when it passes a bound.
|
|
238
339
|
*/
|
|
239
340
|
load: (uri: string, options?: {
|
|
240
341
|
signal?: AbortSignal;
|
|
342
|
+
memory?: McpSkillSnapshotMemory;
|
|
241
343
|
}) => Promise<McpSkillLoaded>;
|
|
242
344
|
/**
|
|
243
345
|
* Read one file of a loaded skill - a path its entry lists - and verify it against the entry
|
|
244
|
-
* the skill was loaded with
|
|
346
|
+
* the skill was loaded with; a snapshot's file is served from the snapshot, never read again.
|
|
347
|
+
* Text only; throws for anything else.
|
|
245
348
|
*/
|
|
246
349
|
readFile: (loaded: McpSkillLoaded, path: string, options?: {
|
|
247
350
|
signal?: AbortSignal;
|
|
248
351
|
}) => Promise<string>;
|
|
352
|
+
/**
|
|
353
|
+
* Only for a server that declared `directoryRead`: its live view of a directory of a loaded
|
|
354
|
+
* skill (`resources/directory/read` to THIS server, of the skill's root or `<root>/<dir>`),
|
|
355
|
+
* compared with the entry the skill was loaded with ({@link compareMcpSkillDirectory}) - a
|
|
356
|
+
* count and paths of that entry, nothing of the server's listing. `undefined` when the read
|
|
357
|
+
* failed (logged): the directory is then listed from the entry alone. Throws when `dir` is no
|
|
358
|
+
* directory of that entry (before any request), or when `options.signal` aborted the read.
|
|
359
|
+
*/
|
|
360
|
+
readDirectory?: (loaded: McpSkillLoaded, dir: string, options?: {
|
|
361
|
+
signal?: AbortSignal;
|
|
362
|
+
}) => Promise<McpSkillDirectoryDrift | undefined>;
|
|
249
363
|
}
|
|
250
364
|
|
|
251
365
|
/**
|
|
@@ -562,5 +676,5 @@ declare const normalizeMcpElicitationSchema: (raw: unknown) => Checked<McpElicit
|
|
|
562
676
|
*/
|
|
563
677
|
declare const validateMcpElicitationContent: (schema: McpElicitationSchema, content: unknown) => Checked<McpElicitationContent>;
|
|
564
678
|
|
|
565
|
-
export {
|
|
566
|
-
export type {
|
|
679
|
+
export { MCP_SKILL_URI_MAX_CHARS as A, IndexedDBVault as I, mcpAppOrigin as J, mcpSkillEntryRefusal as K, mcpSkillPreamble as L, mcpSkillUriRefusal as N, MCP_APP_DEFAULT_VISIBILITY as R, MCP_APP_MAX_DOMAINS as T, MCP_APP_MAX_DOWNLOAD_BYTES as U, MCP_ELICITATION_MAX_PER_RUN as W, MCP_ELICITATION_MAX_PER_TOOL_CALL as X, MCP_ELICITATION_TIMEOUT_MS as Y, McpAppResourceError as Z, isMcpAppMimeType as a4, isMcpAppUri as a5, mcpAppCspOf as a6, mcpAppDownloadOf as a7, mcpAppPermissionsOf as a8, mcpAppResourceOf as a9, mcpAppToolMeta as aa, mcpAppToolResultOf as ab, mcpAppsModeOf as ac, normalizeMcpElicitationSchema as ad, validateMcpElicitationContent as ae, MCP_APPS_EXTENSION as i, MCP_APP_MAX_HTML_CHARS as j, MCP_APP_MAX_RESULT_CHARS as k, MCP_APP_MIME_TYPE as l, MCP_SKILLS_EXTENSION as m, MCP_SKILLS_MAX_PER_SERVER as n, MCP_SKILLS_MAX_TOTAL as o, MCP_SKILL_BODY_MAX_CHARS as p, MCP_SKILL_CONSENTS as q, MCP_SKILL_CONSENT_DEFAULT as r, MCP_SKILL_DESCRIPTION_MAX_CHARS as s, MCP_SKILL_DIRECTORY_ENTRIES_MAX as t, MCP_SKILL_FILE_MAX_CHARS as u, MCP_SKILL_MAX_RESOURCES as v, MCP_SKILL_MAX_TOTAL_BYTES as w, MCP_SKILL_SNAPSHOTS_MAX_BYTES as x, MCP_SKILL_SNAPSHOT_MAX_DEPTH as y, MCP_SKILL_SNAPSHOT_MAX_DIRECTORIES as z };
|
|
680
|
+
export type { McpAppsMode as $, McpAppCsp as B, McpAppPermissions as C, McpAppResource as D, McpAppVisibility as E, McpElicitationFieldSchema as F, McpSkillsOptions as G, McpSkillsSetting as H, McpSkillSource as M, McpElicitationHandler as O, McpElicitationOptions as P, McpAppDownloadResource as Q, SkillDirectoryListing as S, VaultOptions as V, McpAppToolMeta as _, McpSkillConsent as a, McpElicitationContent as a0, McpElicitationContext as a1, McpElicitationRequest as a2, McpElicitationResult as a3, McpSkillGrants as b, McpSkillRunConsent as c, McpSkillConsentView as d, McpSkillSnapshotMemory as e, McpElicitationSchema as f, McpElicitationReason as g, McpAppToolResult as h };
|