@webskill/sdk 0.3.0 → 0.5.0
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/dist/agent.d.ts +2 -0
- package/dist/agent.js +867 -0
- package/dist/browser.d.ts +137 -4
- package/dist/browser.js +458 -22
- package/dist/{catalogComponents-C_V39rbF-BOHveMWa.js → catalogComponents-DV7cPpUm-C77AEEx9.js} +477 -157
- package/dist/{dist-rorEJsNi.js → dist-6C03DShK.js} +654 -298
- package/dist/{dist-ZKaM8j06.js → dist-bewtXYlO.js} +1061 -807
- package/dist/governance.d.ts +87 -10
- package/dist/governance.js +194 -24
- package/dist/{index-wiV5X8Rz.d.ts → index-Bsqg4ftU.d.ts} +151 -143
- package/dist/index-D_7ZZjkl.d.ts +411 -0
- package/dist/{index-8d-oEDww.d.ts → index-vBz_FC9w.d.ts} +289 -24
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +1 -1
- package/dist/memoryArtifactStore-BtOeB_hm-tj3fC5ip.js +78 -0
- package/dist/node.d.ts +8 -4
- package/dist/node.js +1 -1
- package/dist/{openUiLibrary-B8-Cvou9-BbpNTXS3.js → openUiLibrary-W3Ce896k-ClFTRZFs.js} +6 -5
- package/dist/{skillVersionStore-DOEI9ptb-BxbYL70B.d.ts → skillVersionStore-BzLbzFOL-CxwIewHJ.d.ts} +43 -11
- package/dist/{testing-CsrG3XLz.js → testing-DDCJWvgA.js} +7 -5
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/{types-AmKCKJn_-VGabeXK4.d.ts → types-D_hoCri8-BnNPiZCi.d.ts} +111 -72
- package/dist/ui-react.d.ts +352 -20
- package/dist/ui-react.js +3804 -3478
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +25 -6
- package/dist/ui.d.ts +4 -3
- package/dist/ui.js +3 -3
- package/dist/{webskillLitCatalog-CNaUpasU-BslMcxRZ.js → webskillLitCatalog-_mugzRHx-DiuJpCuf.js} +398 -122
- package/package.json +6 -1
- package/dist/jsonRenderRegistry-9GrWP_hE-U6Do3Kid.js +0 -2468
- package/dist/memoryArtifactStore-C9lFVqPF-yFz6yJj0.js +0 -48
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as SkillDiscovery, B as PageQuery, C as UiSpecEvent, E as UiSurfaceActionRequest, I as JsonSchema, M as DiscoveryResult, P as FileSystemProvider, Q as SkillCatalogEntry, S as UiSpecDrafts, Z as SkillCatalog, _ as MemoryStore, at as SkillManifest, b as UiBridge, d as LlmContentPart, et as SkillDocument, f as LlmMessage, g as LlmToolSpec, gt as ValidationReport, i as FormField, l as LlmClient, m as LlmStreamEvent, mt as UiSpecNode, n as ArtifactStore, o as InteractionPolicy, p as LlmResponse, r as ChartSpec, s as InteractionRequest, t as Artifact, tt as SkillInstallSource, u as LlmCompleteInput, v as RenderBlock, y as RenderResultRequest, yt as WebSkillErrorCode, z as Page } from "./types-D_hoCri8-BnNPiZCi.js";
|
|
2
2
|
//#region ../runtime/dist/index.d.ts
|
|
3
|
+
//#region src/llm/parts.d.ts
|
|
4
|
+
/** 纯文本消息内容的构造快捷方式(引擎内部绝大多数消息仍是纯文本) */
|
|
5
|
+
declare const textParts: (text: string) => LlmContentPart[];
|
|
6
|
+
/** 取出 parts 中的文本(非文本分片在纯文本语境下无法表达,此处按丢弃处理——调用方须先校验) */
|
|
7
|
+
declare const partsToText: (parts: readonly LlmContentPart[] | undefined) => string;
|
|
8
|
+
//#endregion
|
|
3
9
|
//#region src/llm/openAiCompatibleClient.d.ts
|
|
4
10
|
interface OpenAiCompatibleClientConfig {
|
|
5
11
|
baseUrl?: string;
|
|
@@ -231,13 +237,100 @@ declare function createScriptContext(deps: {
|
|
|
231
237
|
//#endregion
|
|
232
238
|
//#region src/lifecycle/types.d.ts
|
|
233
239
|
type RuntimePhase = 'discover' | 'route' | 'activate' | 'prepare' | 'execute' | 'observe' | 'interact' | 'complete' | 'fail';
|
|
234
|
-
|
|
235
|
-
|
|
240
|
+
/** 路由完成:策略与本次可见的技能候选 */
|
|
241
|
+
interface RouteLifecycleData {
|
|
242
|
+
strategy: string;
|
|
243
|
+
candidates: string[];
|
|
244
|
+
}
|
|
245
|
+
/** 技能激活:每激活一个技能一次事件(不是一次性的技能集合) */
|
|
246
|
+
interface ActivateLifecycleData {
|
|
247
|
+
skillName: string;
|
|
248
|
+
source: 'local' | 'external';
|
|
249
|
+
/** 级联激活时的来源技能名(顶层激活没有) */
|
|
250
|
+
via?: string;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* execute 相位有五种发生场合,用 `kind` 区分。
|
|
254
|
+
* 0.3.0 时它们各写各的键(`{turn}` / `{resumed}` / `{surfaceAction}` /
|
|
255
|
+
* `{type:'tool'}` / `{type:'llm.delta'}`),消费方只能靠猜哪个键存在。
|
|
256
|
+
*/
|
|
257
|
+
type ExecuteLifecycleData = {
|
|
258
|
+
kind: 'turn';
|
|
259
|
+
turn: number;
|
|
260
|
+
} | {
|
|
261
|
+
kind: 'tool';
|
|
262
|
+
status: 'started' | 'completed' | 'failed';
|
|
263
|
+
name: string;
|
|
264
|
+
callId: string;
|
|
265
|
+
args: string;
|
|
266
|
+
/**
|
|
267
|
+
* failed 时的结构化错误码(如 `TOOL_NOT_ALLOWED`)。
|
|
268
|
+
* “被策略拦下”与“执行出错”在 UI 上是两件事,消费方不应靠解析文案区分。
|
|
269
|
+
*/
|
|
270
|
+
errorCode?: string;
|
|
271
|
+
} | {
|
|
272
|
+
kind: 'llm-delta';
|
|
273
|
+
delta: string;
|
|
274
|
+
} | {
|
|
275
|
+
kind: 'interaction-resumed';
|
|
276
|
+
interactionId: string;
|
|
277
|
+
} | {
|
|
278
|
+
kind: 'surface-action-resumed';
|
|
279
|
+
surfaceId: string;
|
|
280
|
+
actionId: string;
|
|
281
|
+
};
|
|
282
|
+
/** interact 相位:脚本发起的交互请求,或声明式 surface 上的动作等待 */
|
|
283
|
+
type InteractLifecycleData = {
|
|
284
|
+
kind: 'interaction';
|
|
285
|
+
interactionId: string;
|
|
286
|
+
interactionType: InteractionRequest['type'];
|
|
287
|
+
} | {
|
|
288
|
+
kind: 'surface-action';
|
|
289
|
+
surfaceId: string;
|
|
290
|
+
actionId: string;
|
|
291
|
+
nonce: string;
|
|
292
|
+
resumed: boolean;
|
|
293
|
+
};
|
|
294
|
+
/** complete / fail:终态原因 */
|
|
295
|
+
interface TerminalLifecycleData {
|
|
296
|
+
reason: RunTerminationReason;
|
|
297
|
+
}
|
|
298
|
+
interface LifecycleEventBase {
|
|
236
299
|
runId: string;
|
|
237
300
|
sessionId: string;
|
|
238
301
|
ts: string;
|
|
239
|
-
data?: Record<string, unknown>;
|
|
240
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* 按 `phase` 判别的联合:每个相位的 `data` 键已穷举,没有 `[k: string]: unknown` 兜底。
|
|
305
|
+
* 留兜底则新增字段不会让 `pnpm api:check` 变红,快照护栏形同虚设。
|
|
306
|
+
*
|
|
307
|
+
* `discover` / `prepare` / `observe` 的 `data?: never` 不是「暂时没有」:
|
|
308
|
+
* 这三个相位当前没有任何发射点(`RuntimePhase` 保留它们供 `RuntimeRun.phase` 使用),
|
|
309
|
+
* 将来要带负载就是一次公开表面变更,走正常流程。
|
|
310
|
+
*/
|
|
311
|
+
type LifecycleEvent = (LifecycleEventBase & {
|
|
312
|
+
phase: 'route';
|
|
313
|
+
data: RouteLifecycleData;
|
|
314
|
+
}) | (LifecycleEventBase & {
|
|
315
|
+
phase: 'activate';
|
|
316
|
+
data: ActivateLifecycleData;
|
|
317
|
+
}) | (LifecycleEventBase & {
|
|
318
|
+
phase: 'execute';
|
|
319
|
+
data: ExecuteLifecycleData;
|
|
320
|
+
}) | (LifecycleEventBase & {
|
|
321
|
+
phase: 'interact';
|
|
322
|
+
data: InteractLifecycleData;
|
|
323
|
+
}) | (LifecycleEventBase & {
|
|
324
|
+
phase: 'complete' | 'fail';
|
|
325
|
+
data: TerminalLifecycleData;
|
|
326
|
+
}) | (LifecycleEventBase & {
|
|
327
|
+
phase: 'discover' | 'prepare' | 'observe';
|
|
328
|
+
data?: never;
|
|
329
|
+
});
|
|
330
|
+
/** 分配式 Omit:直接 `Omit` 会把联合折叠成一个交叉对象,判别性就没了 */
|
|
331
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
332
|
+
/** 发射方只提供相位与负载,`runId` / `sessionId` / `ts` 由 runtime 填 */
|
|
333
|
+
type LifecycleEventInit = DistributiveOmit<LifecycleEvent, 'runId' | 'sessionId' | 'ts'>;
|
|
241
334
|
interface LifecycleHookContext {
|
|
242
335
|
event: LifecycleEvent;
|
|
243
336
|
run: RuntimeRun;
|
|
@@ -247,7 +340,7 @@ type LifecycleHook = (ctx: LifecycleHookContext) => Promise<void | {
|
|
|
247
340
|
}>;
|
|
248
341
|
//#endregion
|
|
249
342
|
//#region src/trace/types.d.ts
|
|
250
|
-
type TraceEventType = 'skill.routed' | 'skill.activated' | 'llm.request' | 'llm.response' | 'tool.started' | 'tool.completed' | 'tool.failed' | 'artifact.created' | 'ui.requested' | 'ui.resumed' | 'ui.surface-action.requested' | 'ui.surface-action.resolved' | 'ui.rendered' | 'run.warning' | 'run.completed' | 'run.cancelled' | 'run.failed' | 'run.resumed';
|
|
343
|
+
type TraceEventType = 'skill.routed' | 'skill.activated' | 'skill.integrity-failed' | 'llm.request' | 'llm.response' | 'tool.started' | 'tool.completed' | 'tool.failed' | 'tool.denied' | 'artifact.created' | 'ui.requested' | 'ui.resumed' | 'ui.surface-action.requested' | 'ui.surface-action.resolved' | 'ui.rendered' | 'todo.created' | 'todo.updated' | 'todo.cleared' | 'run.warning' | 'run.completed' | 'run.cancelled' | 'run.failed' | 'run.resumed';
|
|
251
344
|
interface TraceEvent {
|
|
252
345
|
id: string;
|
|
253
346
|
runId: string;
|
|
@@ -272,6 +365,8 @@ interface AgentLoopConfig {
|
|
|
272
365
|
toolResultMaxBytes?: number;
|
|
273
366
|
/** session paramHistory 保留条数上限(默认 50,超出裁最旧) */
|
|
274
367
|
paramHistoryLimit?: number;
|
|
368
|
+
/** 跨会话表单填写值的字段数上限(默认 100,超出裁最旧) */
|
|
369
|
+
formValueLimit?: number;
|
|
275
370
|
}
|
|
276
371
|
/** 技能状态拦截 port(治理装配;无注入默认全放行) */
|
|
277
372
|
interface SkillStateGuard {
|
|
@@ -279,6 +374,52 @@ interface SkillStateGuard {
|
|
|
279
374
|
canActivate?(skillName: string): boolean | Promise<boolean>;
|
|
280
375
|
canExecute?(skillName: string): boolean | Promise<boolean>;
|
|
281
376
|
}
|
|
377
|
+
/** 激活期完整性校验结论(D3) */
|
|
378
|
+
interface IntegrityVerdict {
|
|
379
|
+
ok: boolean;
|
|
380
|
+
/** 通过时的技能内容摘要(`manifest.integrity.digest`);进 trace,便于事后对账 */
|
|
381
|
+
digest?: string;
|
|
382
|
+
/** 失败原因(英文):实现方须写清哪些文件不一致,否则宿主无法向用户解释 */
|
|
383
|
+
reason?: string;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* 激活期完整性校验 port(治理装配;**不注入即关闭**——需求 §3 验收 3 要的开关就是它)。
|
|
387
|
+
*
|
|
388
|
+
* 与 `SkillStateGuard` 分开而不是塞进去:后者三个方法返回 `boolean`,语义是
|
|
389
|
+
* 「状态是否允许」;完整性校验要带回失败原因,且失败要驱动状态变更(→ `quarantined`)。
|
|
390
|
+
*
|
|
391
|
+
* 置 `quarantined` 与写审计由**实现方**负责(`SkillStatePolicy.toSkillIntegrityGuard`):
|
|
392
|
+
* runtime 不能写治理状态,也不能 import `@webskill/node` 去调 `verifyIntegrity`。
|
|
393
|
+
*/
|
|
394
|
+
interface SkillIntegrityGuard {
|
|
395
|
+
verifyOnActivate?(skillName: string): Promise<IntegrityVerdict>;
|
|
396
|
+
}
|
|
397
|
+
/** 技能脚本执行失败的上报负载 */
|
|
398
|
+
interface SkillFailureReport {
|
|
399
|
+
skillName: string;
|
|
400
|
+
runId: string;
|
|
401
|
+
/** 结构化错误码(执行器返回 `ok:false` 时取其错误码,抛错时取 `WebSkillError.code`,否则 `TOOL_EXECUTION_FAILED`) */
|
|
402
|
+
code: string;
|
|
403
|
+
/** 英文失败说明;上报方须能据此向用户解释,不要传空串 */
|
|
404
|
+
message: string;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* 技能执行结果上报 port(治理 `SkillStatePolicy.toSkillOutcomeReporter` 装配;**不注入即关闭**)。
|
|
408
|
+
*
|
|
409
|
+
* 与 `SkillStateGuard` / `SkillIntegrityGuard` 同形而不合并:那两个是**读**侧
|
|
410
|
+
* (「状态是否允许」「内容是否可信」),这个是**写**侧——把一次真实失败喂给治理的计数器。
|
|
411
|
+
*
|
|
412
|
+
* 0.4.0 F1 之前这条链路是断的:runtime 只把失败记进 memory 的 `skill:{name}` / `stats`,
|
|
413
|
+
* 而 `SkillStatePolicy` 的失败计数存在 `states.json` 里且没有任何生产调用方,
|
|
414
|
+
* 于是「失败达阈值自动隔离」在任何真实部署里都不会触发。
|
|
415
|
+
*
|
|
416
|
+
* runtime 不能反向依赖 `@webskill/governance`,所以只留 port,装配点在宿主。
|
|
417
|
+
* 实现方抛出的错误由 runtime 吞掉并降级为 `run.warning`:上报失败不该把一次
|
|
418
|
+
* 本来只是工具出错的 run 变成崩溃。
|
|
419
|
+
*/
|
|
420
|
+
interface SkillOutcomeReporter {
|
|
421
|
+
onSkillFailed?(report: SkillFailureReport): Promise<void>;
|
|
422
|
+
}
|
|
282
423
|
interface RuntimeSession {
|
|
283
424
|
id: string;
|
|
284
425
|
createdAt: string;
|
|
@@ -323,20 +464,23 @@ declare function extractChartSpec(data: unknown): ChartSpec | undefined;
|
|
|
323
464
|
declare function buildRenderResult(run: RuntimeRun, output: string, renderBlocks?: RenderBlock[]): RenderResultRequest;
|
|
324
465
|
//#endregion
|
|
325
466
|
//#region src/interaction/surface.d.ts
|
|
326
|
-
/** Validates the allowlisted, data-only
|
|
327
|
-
declare function
|
|
467
|
+
/** Validates the allowlisted, data-only node tree accepted by a UI surface renderer. @experimental */
|
|
468
|
+
declare function validateUiSpecNode(value: unknown): UiSpecNode;
|
|
328
469
|
/** Validates an individual event in the framework-neutral surface stream. @experimental */
|
|
329
|
-
declare function
|
|
470
|
+
declare function validateUiSpecEvent(value: unknown): UiSpecEvent;
|
|
330
471
|
/** Extracts validated surface stream events from structured tool output. @experimental */
|
|
331
|
-
declare function
|
|
472
|
+
declare function extractUiSpecEvents(data: unknown): UiSpecEvent[];
|
|
332
473
|
//#endregion
|
|
333
474
|
//#region src/interaction/schemaToForm.d.ts
|
|
334
475
|
/**
|
|
335
476
|
* JsonSchema → 表单模型:按 properties 生成字段,required 标记必填;
|
|
336
477
|
* providedArgs 已有的值作为 defaultValue 预填(表单只为补齐缺失项服务)。
|
|
337
478
|
* type 映射:string→text、number/integer→number、boolean→boolean、enum→select、其余→textarea。
|
|
479
|
+
* 传入 skillName 时给每个字段带上跨会话稳定的 `fieldKey`(FR-5.6)。
|
|
338
480
|
*/
|
|
339
|
-
declare function schemaToForm(schema: JsonSchema, providedArgs?: Record<string, unknown
|
|
481
|
+
declare function schemaToForm(schema: JsonSchema, providedArgs?: Record<string, unknown>, options?: {
|
|
482
|
+
skillName?: string;
|
|
483
|
+
}): FormField[];
|
|
340
484
|
//#endregion
|
|
341
485
|
//#region src/facade/types.d.ts
|
|
342
486
|
/**
|
|
@@ -409,11 +553,17 @@ interface HookRunnerOptions {
|
|
|
409
553
|
/** 受控钩子执行器:逐个执行,超时/异常默认降级为 warning,可切严格模式 */
|
|
410
554
|
declare class HookRunner {
|
|
411
555
|
#private;
|
|
412
|
-
|
|
413
|
-
|
|
556
|
+
/** 宿主可在装配后按 RuntimeConfig 调整(console Settings › Agent Runtime 即经此生效) */
|
|
557
|
+
timeoutMs: number;
|
|
558
|
+
failOnHookError: boolean;
|
|
414
559
|
onWarning?: (message: string) => void;
|
|
415
560
|
constructor(options?: HookRunnerOptions);
|
|
416
561
|
register(phase: RuntimePhase | '*', hook: LifecycleHook): this;
|
|
562
|
+
/**
|
|
563
|
+
* 已注册钩子的**计数**,按注册相位分组(`'*'` 为全相位钩子)。
|
|
564
|
+
* 刻意不返回函数引用:那会给 UI 一条调用宿主钩子的执行路径,而面板只需要「装没装上」。
|
|
565
|
+
*/
|
|
566
|
+
listRegisteredHooks(): ReadonlyMap<RuntimePhase | '*', number>;
|
|
417
567
|
run(phase: RuntimePhase, ctx: LifecycleHookContext): Promise<void>;
|
|
418
568
|
}
|
|
419
569
|
//#endregion
|
|
@@ -462,6 +612,36 @@ declare class SerializingMemoryStore implements MemoryStore {
|
|
|
462
612
|
transaction<T>(scope: string, fn: (inner: MemoryStore) => Promise<T>): Promise<T>;
|
|
463
613
|
}
|
|
464
614
|
//#endregion
|
|
615
|
+
//#region src/memory/formValues.d.ts
|
|
616
|
+
/** 跨会话表单填写值在 `user:{userId}` scope 下的 key(FR-5.7) @experimental */
|
|
617
|
+
declare const FORM_VALUES_KEY = "formValues";
|
|
618
|
+
/**
|
|
619
|
+
* 跨会话稳定的字段标识(FR-5.6)。必须带技能名:
|
|
620
|
+
* 只有字段名时,两个技能各自的 `email` 会互相串号。
|
|
621
|
+
* @experimental
|
|
622
|
+
*/
|
|
623
|
+
declare function formFieldKey(skillName: string, fieldName: string): string;
|
|
624
|
+
/** 某个字段最近一次的填写值 @experimental */
|
|
625
|
+
interface FormValueRecord {
|
|
626
|
+
value: unknown;
|
|
627
|
+
/** 写入时刻(epoch ms);超上限裁剪时按它排序 */
|
|
628
|
+
ts: number;
|
|
629
|
+
}
|
|
630
|
+
/** fieldKey → 最近一次填写值(**只留最近一次**,不是历史序列) @experimental */
|
|
631
|
+
type FormValueMap = Record<string, FormValueRecord>;
|
|
632
|
+
/** memory 里的原始值形状不受控(宿主可能手改文件),逐条过滤而不是整体信任 @experimental */
|
|
633
|
+
declare function readFormValues(raw: unknown): FormValueMap;
|
|
634
|
+
/** 合并本次提交并按上限裁剪最旧(FR-5.12) @experimental */
|
|
635
|
+
declare function putFormValues(current: FormValueMap, updates: FormValueMap, limit: number): FormValueMap;
|
|
636
|
+
/** 清除单个字段;不传 fieldKey 即全部清除(FR-5.11) @experimental */
|
|
637
|
+
declare function clearFormValues(current: FormValueMap, fieldKey?: string): FormValueMap;
|
|
638
|
+
/**
|
|
639
|
+
* 宿主侧的清除入口(FR-5.11):设置面板的「清除填写历史」直接调它,
|
|
640
|
+
* 不必自己知道 scope 与 key 的约定。
|
|
641
|
+
* @experimental
|
|
642
|
+
*/
|
|
643
|
+
declare function clearStoredFormValues(memory: MemoryStore, userId: string, fieldKey?: string): Promise<void>;
|
|
644
|
+
//#endregion
|
|
465
645
|
//#region src/artifacts/fsArtifactStore.d.ts
|
|
466
646
|
/**
|
|
467
647
|
* 基于 FileSystemProvider 的 ArtifactStore:产物落盘 <root>/<runId>/<path>,
|
|
@@ -628,6 +808,20 @@ declare class TraceRecorder {
|
|
|
628
808
|
list(): TraceEvent[];
|
|
629
809
|
}
|
|
630
810
|
//#endregion
|
|
811
|
+
//#region src/trace/todoMarker.d.ts
|
|
812
|
+
interface TodoTraceEvent {
|
|
813
|
+
type: TraceEventType;
|
|
814
|
+
data: Record<string, unknown>;
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* `$todo` 约定的形状校验:JSON content 的 data 含 `$todo` 键(单条或数组)→ trace 事件。
|
|
818
|
+
*
|
|
819
|
+
* 与 `$chart` / `$surface` 同一条既有通道——待办清单的状态机全部在 `@webskill/agent`,
|
|
820
|
+
* runtime 只认这三个事件类型名,不含任何计划态逻辑。畸形条目忽略不炸。
|
|
821
|
+
* @experimental
|
|
822
|
+
*/
|
|
823
|
+
declare function extractTodoTraceEvents(data: unknown): TodoTraceEvent[];
|
|
824
|
+
//#endregion
|
|
631
825
|
//#region src/engine/external.d.ts
|
|
632
826
|
/**
|
|
633
827
|
* 外部工具来源(runtime 扩展点,mcp 包实现并插入)。
|
|
@@ -636,6 +830,14 @@ declare class TraceRecorder {
|
|
|
636
830
|
interface ExternalToolSource {
|
|
637
831
|
readonly kind: string;
|
|
638
832
|
listToolSpecs(): Promise<LlmToolSpec[]>;
|
|
833
|
+
/**
|
|
834
|
+
* 可选:向 run 的 system 消息追加一段说明(组件 catalog 之类的大段规格)。
|
|
835
|
+
*
|
|
836
|
+
* 为什么不塞进工具的 `description`:description 的长度上限与截断行为是
|
|
837
|
+
* **provider 相关且静默的**——被截断后模型看到的是半份规格,而请求照样成功。
|
|
838
|
+
* system 消息没有这个隐患,也不必和工具选择耦合在一起。
|
|
839
|
+
*/
|
|
840
|
+
systemPrompt?(): Promise<string | undefined>;
|
|
639
841
|
canHandle(llmToolName: string): boolean;
|
|
640
842
|
call(llmToolName: string, args: Record<string, unknown>): Promise<ToolResult>;
|
|
641
843
|
}
|
|
@@ -652,13 +854,13 @@ interface ExternalSkillProvider {
|
|
|
652
854
|
declare function mergeCatalogEntries(localEntries: SkillCatalogEntry[], providerEntries: SkillCatalogEntry[]): SkillCatalogEntry[];
|
|
653
855
|
//#endregion
|
|
654
856
|
//#region src/engine/snapshot.d.ts
|
|
655
|
-
declare const RUN_SNAPSHOT_SCHEMA_VERSION =
|
|
857
|
+
declare const RUN_SNAPSHOT_SCHEMA_VERSION = 2;
|
|
656
858
|
/**
|
|
657
859
|
* interrupted(等待用户)状态点的可恢复快照(D3 收窄版)
|
|
658
860
|
* @experimental
|
|
659
861
|
*/
|
|
660
862
|
interface RunSnapshot {
|
|
661
|
-
schemaVersion:
|
|
863
|
+
schemaVersion: 2;
|
|
662
864
|
runId: string;
|
|
663
865
|
sessionId: string;
|
|
664
866
|
userPrompt: string;
|
|
@@ -677,11 +879,11 @@ interface RunSnapshot {
|
|
|
677
879
|
/** 等待中的 surface action;其工具结果已入消息历史,无需重跑工具。 */
|
|
678
880
|
pendingSurfaceAction?: UiSurfaceActionRequest;
|
|
679
881
|
/** 未提交的 surface form values;仅在 interrupted surface action 等待期间保存。 */
|
|
680
|
-
surfaceDrafts?:
|
|
882
|
+
surfaceDrafts?: UiSpecDrafts;
|
|
681
883
|
/** $chart 等内容收集的渲染块(0.2.0 起跨 resume 保留;旧快照缺省视为空) */
|
|
682
884
|
renderBlocks?: RenderBlock[];
|
|
683
885
|
/** 已成功渲染的 surface 事件;resume 时按原序重放(旧快照缺省视为空) */
|
|
684
|
-
surfaceEvents?:
|
|
886
|
+
surfaceEvents?: UiSpecEvent[];
|
|
685
887
|
/** 交互 id 序号(resume 后续算,避免 id 冲突;旧快照缺省从 0 起) */
|
|
686
888
|
interactionSeq?: number;
|
|
687
889
|
/** Runtime 注入的 surface action nonce 序号(resume 后续算;旧快照缺省从 0 起) */
|
|
@@ -700,12 +902,30 @@ interface RunSnapshot {
|
|
|
700
902
|
};
|
|
701
903
|
snapshotAt: string;
|
|
702
904
|
}
|
|
905
|
+
/**
|
|
906
|
+
* schema 版本不受支持的快照:文件是好的,但本版本读不了。
|
|
907
|
+
* 仅用于列表的只读展示,不可恢复。
|
|
908
|
+
* @experimental
|
|
909
|
+
*/
|
|
910
|
+
interface UnsupportedRunSnapshot {
|
|
911
|
+
unsupported: true;
|
|
912
|
+
schemaVersion: number;
|
|
913
|
+
runId: string;
|
|
914
|
+
sessionId?: string;
|
|
915
|
+
userPrompt?: string;
|
|
916
|
+
snapshotAt: string;
|
|
917
|
+
interactionExpiresAt?: string;
|
|
918
|
+
}
|
|
919
|
+
/** @experimental */
|
|
920
|
+
type RunSnapshotListEntry = RunSnapshot | UnsupportedRunSnapshot;
|
|
921
|
+
/** @experimental */
|
|
922
|
+
declare function isUnsupportedRunSnapshot(entry: RunSnapshotListEntry): entry is UnsupportedRunSnapshot;
|
|
703
923
|
/** @experimental */
|
|
704
924
|
interface RunSnapshotStore {
|
|
705
925
|
save(snapshot: RunSnapshot): Promise<void>;
|
|
706
926
|
load(runId: string): Promise<RunSnapshot | undefined>;
|
|
707
927
|
delete(runId: string): Promise<void>;
|
|
708
|
-
list(): Promise<
|
|
928
|
+
list(): Promise<RunSnapshotListEntry[]>;
|
|
709
929
|
}
|
|
710
930
|
/**
|
|
711
931
|
* FileSystemProvider 后端的快照存储:<root>/<runId>.snapshot.json。
|
|
@@ -725,7 +945,7 @@ declare class FsRunSnapshotStore implements RunSnapshotStore {
|
|
|
725
945
|
save(snapshot: RunSnapshot): Promise<void>;
|
|
726
946
|
load(runId: string): Promise<RunSnapshot | undefined>;
|
|
727
947
|
delete(runId: string): Promise<void>;
|
|
728
|
-
list(): Promise<
|
|
948
|
+
list(): Promise<RunSnapshotListEntry[]>;
|
|
729
949
|
}
|
|
730
950
|
//#endregion
|
|
731
951
|
//#region src/engine/agentLoop.d.ts
|
|
@@ -753,6 +973,14 @@ interface AgentLoopDeps {
|
|
|
753
973
|
enabled: true;
|
|
754
974
|
userId: string;
|
|
755
975
|
};
|
|
976
|
+
/**
|
|
977
|
+
* 跨会话表单自动填充(FR-5.7);**不注入即关闭**,关闭时不查也不写。
|
|
978
|
+
* 与 `longTerm` 分开:后者存的是技能使用统计,本项存的是用户亲手填的内容,
|
|
979
|
+
* 两者的开关语义不同(AC-5.7)。
|
|
980
|
+
*/
|
|
981
|
+
formAutofill?: {
|
|
982
|
+
userId: string;
|
|
983
|
+
};
|
|
756
984
|
/** 外部工具来源(mcp 插件等);specs 在 run 开始时并入每轮 tools */
|
|
757
985
|
externalTools?: ExternalToolSource[];
|
|
758
986
|
/** 外部技能提供者(页面动态技能等) */
|
|
@@ -761,6 +989,10 @@ interface AgentLoopDeps {
|
|
|
761
989
|
catalogFilter?: (entries: SkillCatalogEntry[]) => SkillCatalogEntry[] | Promise<SkillCatalogEntry[]>;
|
|
762
990
|
/** 技能状态拦截(read/activate/execute 三入口一致执行;无注入默认全放行) */
|
|
763
991
|
skillStateGuard?: SkillStateGuard;
|
|
992
|
+
/** D3 激活期完整性校验 port(治理装配;无注入即关闭) */
|
|
993
|
+
skillIntegrityGuard?: SkillIntegrityGuard;
|
|
994
|
+
/** F1 技能执行失败上报 port(治理装配;无注入即关闭) */
|
|
995
|
+
skillOutcomeReporter?: SkillOutcomeReporter;
|
|
764
996
|
/** D3:interrupt 点快照存储(无配置则行为与现状完全一致) */
|
|
765
997
|
snapshotStore?: RunSnapshotStore;
|
|
766
998
|
}
|
|
@@ -818,6 +1050,10 @@ interface WebSkillRuntimeDeps {
|
|
|
818
1050
|
enabled: true;
|
|
819
1051
|
userId: string;
|
|
820
1052
|
};
|
|
1053
|
+
/** 跨会话表单自动填充(FR-5.7);不注入即关闭,关闭时不查也不写 */
|
|
1054
|
+
formAutofill?: {
|
|
1055
|
+
userId: string;
|
|
1056
|
+
};
|
|
821
1057
|
/** 外部工具来源(mcp 插件等) */
|
|
822
1058
|
externalTools?: ExternalToolSource[];
|
|
823
1059
|
/** 外部技能提供者(页面动态技能等);Catalog 合并同名本地优先 */
|
|
@@ -833,6 +1069,10 @@ interface WebSkillRuntimeDeps {
|
|
|
833
1069
|
snapshotStore?: RunSnapshotStore;
|
|
834
1070
|
/** 技能状态拦截 port(治理 SkillStatePolicy.toSkillStateGuard 装配;无注入默认全放行) */
|
|
835
1071
|
skillStateGuard?: SkillStateGuard;
|
|
1072
|
+
/** D3 激活期完整性校验 port(治理 SkillStatePolicy.toSkillIntegrityGuard 装配;无注入即关闭) */
|
|
1073
|
+
skillIntegrityGuard?: SkillIntegrityGuard;
|
|
1074
|
+
/** F1 技能执行失败上报 port(治理 SkillStatePolicy.toSkillOutcomeReporter 装配;无注入即关闭) */
|
|
1075
|
+
skillOutcomeReporter?: SkillOutcomeReporter;
|
|
836
1076
|
}
|
|
837
1077
|
/**
|
|
838
1078
|
* runtime 门面:组合 discovery / router / agent loop / lifecycle
|
|
@@ -866,11 +1106,11 @@ declare class WebSkillRuntime {
|
|
|
866
1106
|
sessionId?: string;
|
|
867
1107
|
history?: LlmMessage[];
|
|
868
1108
|
}): Promise<RunResult>;
|
|
869
|
-
/** D3
|
|
870
|
-
listInterruptedRuns(): Promise<
|
|
1109
|
+
/** D3:列出 interrupted run(供 UI 展示"未完成任务");版本不受支持的项带 unsupported 标记 */
|
|
1110
|
+
listInterruptedRuns(): Promise<RunSnapshotListEntry[]>;
|
|
871
1111
|
/**
|
|
872
1112
|
* D3 恢复 interrupted run:
|
|
873
|
-
* 不存在 → RUN_SNAPSHOT_NOT_FOUND;
|
|
1113
|
+
* 不存在 → RUN_SNAPSHOT_NOT_FOUND;schema 版本不受支持 → RUN_SNAPSHOT_SCHEMA_UNSUPPORTED(由 store 抛出,不删文件);
|
|
874
1114
|
* 已过期 → interaction-timeout 终态并删快照;否则重建 LoopState 重新发起交互续跑。
|
|
875
1115
|
* @experimental
|
|
876
1116
|
*/
|
|
@@ -995,6 +1235,13 @@ interface RunToolCall {
|
|
|
995
1235
|
args?: string;
|
|
996
1236
|
/** 执行耗时 ms */
|
|
997
1237
|
durationMs?: number;
|
|
1238
|
+
/**
|
|
1239
|
+
* failed 时的结构化错误码(如 `TOOL_NOT_ALLOWED`)。
|
|
1240
|
+
* 消费方据此区分「被策略拒绝」与「执行出错」,不必解析 message 文案。
|
|
1241
|
+
*/
|
|
1242
|
+
errorCode?: string;
|
|
1243
|
+
/** failed 时的错误说明(trace 事件的 message) */
|
|
1244
|
+
errorMessage?: string;
|
|
998
1245
|
}
|
|
999
1246
|
/**
|
|
1000
1247
|
* 从 run 的 trace 推导终态工具调用列表。
|
|
@@ -1009,6 +1256,8 @@ declare function summarizeToolCalls(run: RuntimeRun): RunToolCall[];
|
|
|
1009
1256
|
//#endregion
|
|
1010
1257
|
//#region src/engine/session.d.ts
|
|
1011
1258
|
declare const SESSION_SCHEMA_VERSION = 1;
|
|
1259
|
+
/** `FsSessionStore` 的缺省页长。缺省值属于实现,不属于调用方——否则「下推」只推了一半 */
|
|
1260
|
+
declare const FS_SESSION_PAGE_SIZE = 50;
|
|
1012
1261
|
/** 会话列表行:不含消息正文,`list()` 的返回元素 */
|
|
1013
1262
|
interface SessionMeta {
|
|
1014
1263
|
id: string;
|
|
@@ -1033,10 +1282,21 @@ interface SessionRecord<TMessage = unknown> extends SessionMeta {
|
|
|
1033
1282
|
* runtime 不能认识它,所以泛型默认 `unknown`(只读消费方直接用默认参数即可)。
|
|
1034
1283
|
*/
|
|
1035
1284
|
interface SessionStore<TMessage = unknown> {
|
|
1285
|
+
/**
|
|
1286
|
+
* 会话列表页。翻页方向固定为**从新到旧**(聊天 UI 的「加载更多」总是向历史走),
|
|
1287
|
+
* 页内元素仍按 `createdAt` 升序,与 0.3.0 的全量 `list()` 同序。
|
|
1288
|
+
*/
|
|
1036
1289
|
list(options?: {
|
|
1037
1290
|
includeArchived?: boolean;
|
|
1038
|
-
}): Promise<SessionMeta
|
|
1291
|
+
} & PageQuery): Promise<Page<SessionMeta>>;
|
|
1039
1292
|
get(id: string): Promise<SessionRecord<TMessage> | undefined>;
|
|
1293
|
+
/**
|
|
1294
|
+
* 消息分页读。与 `list()` 同方向:无游标时给**最后**一页(最新的 `limit` 条),
|
|
1295
|
+
* `nextCursor` 指向更早的历史。页内元素按时间升序,UI 直接前插即可。
|
|
1296
|
+
*
|
|
1297
|
+
* 存在的理由是 `get()` 拿的是全量:长会话下 UI 只需要末尾几十条。
|
|
1298
|
+
*/
|
|
1299
|
+
listMessages(id: string, options?: PageQuery): Promise<Page<TMessage>>;
|
|
1040
1300
|
create(init?: {
|
|
1041
1301
|
id?: string;
|
|
1042
1302
|
title?: string;
|
|
@@ -1065,7 +1325,12 @@ declare class FsSessionStore<TMessage = unknown> implements SessionStore<TMessag
|
|
|
1065
1325
|
});
|
|
1066
1326
|
list(options?: {
|
|
1067
1327
|
includeArchived?: boolean;
|
|
1068
|
-
}): Promise<SessionMeta
|
|
1328
|
+
} & PageQuery): Promise<Page<SessionMeta>>;
|
|
1329
|
+
/**
|
|
1330
|
+
* 整文件读后切片。磁盘 I/O 复杂度没有改善(备案 D25),
|
|
1331
|
+
* 但**跨出端口的记录数**已是常量——这正是分页对上层的意义。
|
|
1332
|
+
*/
|
|
1333
|
+
listMessages(id: string, options?: PageQuery): Promise<Page<TMessage>>;
|
|
1069
1334
|
get(id: string): Promise<SessionRecord<TMessage> | undefined>;
|
|
1070
1335
|
create(init?: {
|
|
1071
1336
|
id?: string;
|
|
@@ -1080,4 +1345,4 @@ declare class FsSessionStore<TMessage = unknown> implements SessionStore<TMessag
|
|
|
1080
1345
|
delete(id: string): Promise<void>;
|
|
1081
1346
|
}
|
|
1082
1347
|
//#endregion
|
|
1083
|
-
export {
|
|
1348
|
+
export { RouteLifecycleData as $, fromVercelResult as $t, FsSessionStore as A, TodoTraceEvent as At, LifecycleEventInit as B, WebSkillApi as Bt, FS_SESSION_PAGE_SIZE as C, SessionStore as Ct, FsMemoryStore as D, SkillRouter as Dt, FsArtifactStore as E, SkillOutcomeReporter as Et, HookRunnerOptions as F, TraceEvent as Ft, OpenAiCompatibleClient as G, clearFormValues as Gt, LifecycleHookContext as H, WebSkillRuntimeDeps as Ht, InstalledSkillManifest as I, TraceEventType as It, READ_SKILL_FILE_INPUT_SCHEMA as J, createWebSkillApi as Jt, OpenAiCompatibleClientConfig as K, clearStoredFormValues as Kt, IntegrityVerdict as L, TraceRecorder as Lt, GoogleGenAiClient as M, ToolResolution as Mt, GoogleGenAiClientConfig as N, ToolResult as Nt, FsRunSnapshotStore as O, SkillStateGuard as Ot, HookRunner as P, TraceClock as Pt, RUN_TRACE_SCHEMA_VERSION as Q, formFieldKey as Qt, InteractLifecycleData as R, UnsupportedRunSnapshot as Rt, FORM_VALUES_KEY as S, SessionRecord as St, FormValueRecord as T, SkillIntegrityGuard as Tt, LifecycleListener as U, bridgeError as Ut, LifecycleHook as V, WebSkillRuntime as Vt, NetworkPolicy as W, buildRenderResult as Wt, READ_SKILL_FILE_TOOL_NAME as X, extractTodoTraceEvents as Xt, READ_SKILL_FILE_TOOL as Y, extractChartSpec as Yt, RUN_SNAPSHOT_SCHEMA_VERSION as Z, extractUiSpecEvents as Zt, CapabilityMode as _, toLlmToolSpec as _n, SchemaInferer as _t, AgentLoop as a, networkUrlHost as an, RunTerminationReason as at, ExternalSkillProvider as b, validateUiSpecNode as bn, SerializingMemoryStore as bt, AnthropicClient as c, normalizeToolError as cn, RunTraceFilter as ct, ApprovalScope as d, putFormValues as dn, RunTraceSummary as dt, fromVercelStreamPart as en, RouteResult as et, BridgeCapabilities as f, readFormValues as fn, RuntimePhase as ft, CapabilityApproval as g, textParts as gn, SESSION_SCHEMA_VERSION as gt, BridgeResponse as h, summarizeToolCalls as hn, RuntimeSessionHandle as ht, ActivateLifecycleData as i, networkPolicyLibSource as in, RunSnapshotStore as it, FullDisclosureRouter as j, ToolDefinition as jt, FsRunTraceStore as k, TerminalLifecycleData as kt, AnthropicClientConfig as l, parseBridgeRequest as ln, RunTraceMetrics as lt, BridgeRequest as m, schemaToForm as mn, RuntimeSession as mt, ASK_USER_TOOL as n, isUnsupportedRunSnapshot as nn, RunSnapshot as nt, AgentLoopConfig as o, normalizeErrorCode as on, RunToolCall as ot, BridgeCapability as p, resolveToolName as pn, RuntimeRun as pt, ProgressiveRouter as q, createScriptContext as qt, ASK_USER_TOOL_NAME as r, mergeCatalogEntries as rn, RunSnapshotListEntry as rt, AgentLoopDeps as s, normalizeToolContent as sn, RunTraceFile as st, ASK_USER_INPUT_SCHEMA as t, isNetworkAllowed as tn, RunResult as tt, ApprovalDecision as u, partsToText as un, RunTraceStore as ut, EventBus as v, toVercelToolSpecs as vn, ScriptExecutionContext as vt, FormValueMap as w, SkillFailureReport as wt, ExternalToolSource as x, SessionMeta as xt, ExecuteLifecycleData as y, validateUiSpecEvent as yn, ScriptExecutor as yt, LifecycleEvent as z, VercelToolSpec as zt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { $ as
|
|
3
|
-
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, AnthropicClient, type AnthropicClientConfig, type ApprovalDecision, type ApprovalScope, type ArchiveLimits, type Artifact, type ArtifactStore, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type ChartSpec, type CryptoKeyLike, DEFAULT_ARCHIVE_LIMITS, type DiscoveryResult, EventBus, type ExternalSkillProvider, type ExternalToolSource, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, type GoogleGenAiClientConfig, HookRunner, type HookRunnerOptions, type InstalledSkillManifest, type InteractionPolicy, type InteractionRequest, type InteractionResponse, type JsonSchema, type LifecycleEvent, type LifecycleHook, type LifecycleHookContext, type LifecycleListener, type LlmClient, type LlmCompleteInput, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmToolCall, type LlmToolSpec, MANIFEST_EXCLUDED_FILES, MemoryFS, type MemoryStore, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, type RemoteUrlPolicy, type RenderBlock, type RenderResultRequest, type RouteResult, type RunResult, type RunSnapshot, type RunSnapshotStore, type RunTerminationReason, type RunToolCall, type RunTraceFile, type RunTraceFilter, type RunTraceMetrics, type RunTraceStore, type RunTraceSummary, type RuntimePhase, type RuntimeRun, type RuntimeSession, type RuntimeSessionHandle, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, SerializingMemoryStore, type SessionMeta, type SessionRecord, type SessionStore, type SignatureAuditSink, type SignatureVerdict, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillInstallSource, type SkillIssue, type SkillLocation, type SkillManagerPort, type SkillManifest, type SkillMetadata, type SkillPackManifest, SkillReader, type SkillRouter, type SkillSignature, type SkillSource, type SkillStateGuard, type SkillsLockfile, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type TrustedKey, type TrustedKeyStore, type UiBridge, type
|
|
1
|
+
import { $ as SkillDiscovery, A as CryptoKeyLike, At as isValidSkillName, B as PageQuery, Bt as renderCatalogJson, C as UiSpecEvent, Ct as buildCatalog, D as UiSurfaceActionResponse, Dt as computeDigest, E as UiSurfaceActionRequest, Et as checkSkillRules, F as FsTrustedKeyStore, Ft as parseSkillMarkdown, G as SKILL_NAME_MAX_LENGTH, Gt as unzipWithLimits, H as SIGNATURE_SCHEMA_VERSION, Ht as resolveInsideRoot, I as JsonSchema, It as parseSkillPackManifest, J as SKILL_SIGNATURE_FILE, Jt as verifySkillSignature, K as SKILL_NAME_PATTERN, Kt as validateSkills, L as MANIFEST_EXCLUDED_FILES, Lt as readResponseWithLimit, M as DiscoveryResult, Mt as keyIdOf, N as FileStat, Nt as messageOf, O as ArchiveLimits, Ot as escapeXml, P as FileSystemProvider, Pt as normalizePath, Q as SkillCatalogEntry, R as MemoryFS, Rt as readSkillSignature, S as UiSpecDrafts, St as atomicWriteText, T as UiSpecSnapshot, Tt as checkDependencyCycles, U as SKILLS_LOCKFILE, Ut as signSkill, V as RemoteUrlPolicy, Vt as resolveArchiveLimits, W as SKILL_MANIFEST_FILE, Wt as signaturePayloadBytes, X as SignatureVerdict, Y as SignatureAuditSink, Yt as xmlRenderer, Z as SkillCatalog, _ as MemoryStore, _t as VerifyResult, a as InteractionOrigin, at as SkillManifest, b as UiBridge, bt as assertRemoteUrlAllowed, c as InteractionResponse, ct as SkillReader, d as LlmContentPart, dt as SkillsLockfile, et as SkillDocument, f as LlmMessage, ft as TrustedKey, g as LlmToolSpec, gt as ValidationReport, h as LlmToolCall, ht as UnsignedPolicy, i as FormField, it as SkillManagerPort, j as DEFAULT_ARCHIVE_LIMITS, jt as jsonRenderer, k as CatalogRenderer, kt as exportSkills, l as LlmClient, lt as SkillSignature, m as LlmStreamEvent, mt as UiSpecNode, n as ArtifactStore, nt as SkillIssue, o as InteractionPolicy, ot as SkillMetadata, p as LlmResponse, pt as TrustedKeyStore, q as SKILL_PACK_FILE, qt as verifyManifest, r as ChartSpec, rt as SkillLocation, s as InteractionRequest, st as SkillPackManifest, t as Artifact, tt as SkillInstallSource, u as LlmCompleteInput, ut as SkillSource, v as RenderBlock, vt as WebSkillError, w as UiSpecPatch, wt as buildManifest, x as UiSpecActionCapability, xt as assertSafePathSegment, y as RenderResultRequest, yt as WebSkillErrorCode, z as Page, zt as renderAvailableSkillsXml } from "./types-D_hoCri8-BnNPiZCi.js";
|
|
2
|
+
import { $ as RouteLifecycleData, $t as fromVercelResult, A as FsSessionStore, At as TodoTraceEvent, B as LifecycleEventInit, Bt as WebSkillApi, C as FS_SESSION_PAGE_SIZE, Ct as SessionStore, D as FsMemoryStore, Dt as SkillRouter, E as FsArtifactStore, Et as SkillOutcomeReporter, F as HookRunnerOptions, Ft as TraceEvent, G as OpenAiCompatibleClient, Gt as clearFormValues, H as LifecycleHookContext, Ht as WebSkillRuntimeDeps, I as InstalledSkillManifest, It as TraceEventType, J as READ_SKILL_FILE_INPUT_SCHEMA, Jt as createWebSkillApi, K as OpenAiCompatibleClientConfig, Kt as clearStoredFormValues, L as IntegrityVerdict, Lt as TraceRecorder, M as GoogleGenAiClient, Mt as ToolResolution, N as GoogleGenAiClientConfig, Nt as ToolResult, O as FsRunSnapshotStore, Ot as SkillStateGuard, P as HookRunner, Pt as TraceClock, Q as RUN_TRACE_SCHEMA_VERSION, Qt as formFieldKey, R as InteractLifecycleData, Rt as UnsupportedRunSnapshot, S as FORM_VALUES_KEY, St as SessionRecord, T as FormValueRecord, Tt as SkillIntegrityGuard, U as LifecycleListener, Ut as bridgeError, V as LifecycleHook, Vt as WebSkillRuntime, W as NetworkPolicy, Wt as buildRenderResult, X as READ_SKILL_FILE_TOOL_NAME, Xt as extractTodoTraceEvents, Y as READ_SKILL_FILE_TOOL, Yt as extractChartSpec, Z as RUN_SNAPSHOT_SCHEMA_VERSION, Zt as extractUiSpecEvents, _ as CapabilityMode, _n as toLlmToolSpec, _t as SchemaInferer, a as AgentLoop, an as networkUrlHost, at as RunTerminationReason, b as ExternalSkillProvider, bn as validateUiSpecNode, bt as SerializingMemoryStore, c as AnthropicClient, cn as normalizeToolError, ct as RunTraceFilter, d as ApprovalScope, dn as putFormValues, dt as RunTraceSummary, en as fromVercelStreamPart, et as RouteResult, f as BridgeCapabilities, fn as readFormValues, ft as RuntimePhase, g as CapabilityApproval, gn as textParts, gt as SESSION_SCHEMA_VERSION, h as BridgeResponse, hn as summarizeToolCalls, ht as RuntimeSessionHandle, i as ActivateLifecycleData, in as networkPolicyLibSource, it as RunSnapshotStore, j as FullDisclosureRouter, jt as ToolDefinition, k as FsRunTraceStore, kt as TerminalLifecycleData, l as AnthropicClientConfig, ln as parseBridgeRequest, lt as RunTraceMetrics, m as BridgeRequest, mn as schemaToForm, mt as RuntimeSession, n as ASK_USER_TOOL, nn as isUnsupportedRunSnapshot, nt as RunSnapshot, o as AgentLoopConfig, on as normalizeErrorCode, ot as RunToolCall, p as BridgeCapability, pn as resolveToolName, pt as RuntimeRun, q as ProgressiveRouter, qt as createScriptContext, r as ASK_USER_TOOL_NAME, rn as mergeCatalogEntries, rt as RunSnapshotListEntry, s as AgentLoopDeps, sn as normalizeToolContent, st as RunTraceFile, t as ASK_USER_INPUT_SCHEMA, tn as isNetworkAllowed, tt as RunResult, u as ApprovalDecision, un as partsToText, ut as RunTraceStore, v as EventBus, vn as toVercelToolSpecs, vt as ScriptExecutionContext, w as FormValueMap, wt as SkillFailureReport, x as ExternalToolSource, xt as SessionMeta, y as ExecuteLifecycleData, yn as validateUiSpecEvent, yt as ScriptExecutor, z as LifecycleEvent, zt as VercelToolSpec } from "./index-vBz_FC9w.js";
|
|
3
|
+
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, type ActivateLifecycleData, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, AnthropicClient, type AnthropicClientConfig, type ApprovalDecision, type ApprovalScope, type ArchiveLimits, type Artifact, type ArtifactStore, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type ChartSpec, type CryptoKeyLike, DEFAULT_ARCHIVE_LIMITS, type DiscoveryResult, EventBus, type ExecuteLifecycleData, type ExternalSkillProvider, type ExternalToolSource, FORM_VALUES_KEY, FS_SESSION_PAGE_SIZE, type FileStat, type FileSystemProvider, type FormField, type FormValueMap, type FormValueRecord, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, type GoogleGenAiClientConfig, HookRunner, type HookRunnerOptions, type InstalledSkillManifest, type IntegrityVerdict, type InteractLifecycleData, type InteractionOrigin, type InteractionPolicy, type InteractionRequest, type InteractionResponse, type JsonSchema, type LifecycleEvent, type LifecycleEventInit, type LifecycleHook, type LifecycleHookContext, type LifecycleListener, type LlmClient, type LlmCompleteInput, type LlmContentPart, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmToolCall, type LlmToolSpec, MANIFEST_EXCLUDED_FILES, MemoryFS, type MemoryStore, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, type Page, type PageQuery, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, type RemoteUrlPolicy, type RenderBlock, type RenderResultRequest, type RouteLifecycleData, type RouteResult, type RunResult, type RunSnapshot, type RunSnapshotListEntry, type RunSnapshotStore, type RunTerminationReason, type RunToolCall, type RunTraceFile, type RunTraceFilter, type RunTraceMetrics, type RunTraceStore, type RunTraceSummary, type RuntimePhase, type RuntimeRun, type RuntimeSession, type RuntimeSessionHandle, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, SerializingMemoryStore, type SessionMeta, type SessionRecord, type SessionStore, type SignatureAuditSink, type SignatureVerdict, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillFailureReport, type SkillInstallSource, type SkillIntegrityGuard, type SkillIssue, type SkillLocation, type SkillManagerPort, type SkillManifest, type SkillMetadata, type SkillOutcomeReporter, type SkillPackManifest, SkillReader, type SkillRouter, type SkillSignature, type SkillSource, type SkillStateGuard, type SkillsLockfile, type TerminalLifecycleData, type TodoTraceEvent, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type TrustedKey, type TrustedKeyStore, type UiBridge, type UiSpecActionCapability, type UiSpecDrafts, type UiSpecEvent, type UiSpecNode, type UiSpecPatch, type UiSpecSnapshot, type UiSurfaceActionRequest, type UiSurfaceActionResponse, type UnsignedPolicy, type UnsupportedRunSnapshot, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, clearFormValues, clearStoredFormValues, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, extractTodoTraceEvents, extractUiSpecEvents, formFieldKey, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, mergeCatalogEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, partsToText, putFormValues, readFormValues, readResponseWithLimit, readSkillSignature, renderAvailableSkillsXml, renderCatalogJson, resolveArchiveLimits, resolveInsideRoot, resolveToolName, schemaToForm, signSkill, signaturePayloadBytes, summarizeToolCalls, textParts, toLlmToolSpec, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { A as parseSkillMarkdown, B as unzipWithLimits, C as escapeXml, D as keyIdOf, E as jsonRenderer, F as renderCatalogJson, H as verifyManifest, I as resolveArchiveLimits, L as resolveInsideRoot, M as readResponseWithLimit, N as readSkillSignature, O as messageOf, P as renderAvailableSkillsXml, R as signSkill, S as computeDigest, T as isValidSkillName, U as verifySkillSignature, V as validateSkills, W as xmlRenderer, _ as atomicWriteText, a as SIGNATURE_SCHEMA_VERSION, b as checkDependencyCycles, c as SKILL_NAME_MAX_LENGTH, d as SKILL_SIGNATURE_FILE, f as SkillDiscovery, g as assertSafePathSegment, h as assertRemoteUrlAllowed, i as MemoryFS, j as parseSkillPackManifest, k as normalizePath, l as SKILL_NAME_PATTERN, m as WebSkillError, n as FsTrustedKeyStore, o as SKILLS_LOCKFILE, p as SkillReader, r as MANIFEST_EXCLUDED_FILES, s as SKILL_MANIFEST_FILE, t as DEFAULT_ARCHIVE_LIMITS, u as SKILL_PACK_FILE, v as buildCatalog, w as exportSkills, x as checkSkillRules, y as buildManifest, z as signaturePayloadBytes } from "./dist-8oQRa8Xz.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as textParts, n as partsToText } from "./memoryArtifactStore-BtOeB_hm-tj3fC5ip.js";
|
|
3
|
+
import { $ as schemaToForm, A as buildRenderResult, B as fromVercelStreamPart, C as RUN_SNAPSHOT_SCHEMA_VERSION, D as TraceRecorder, E as SerializingMemoryStore, F as extractChartSpec, G as networkUrlHost, H as isUnsupportedRunSnapshot, I as extractTodoTraceEvents, J as normalizeToolError, K as normalizeErrorCode, L as extractUiSpecEvents, M as clearStoredFormValues, N as createScriptContext, O as WebSkillRuntime, P as createWebSkillApi, Q as resolveToolName, R as formFieldKey, S as READ_SKILL_FILE_TOOL_NAME, T as SESSION_SCHEMA_VERSION, U as mergeCatalogEntries, V as isNetworkAllowed, W as networkPolicyLibSource, X as putFormValues, Y as parseBridgeRequest, Z as readFormValues, _ as HookRunner, a as AnthropicClient, b as READ_SKILL_FILE_INPUT_SCHEMA, c as FORM_VALUES_KEY, d as FsMemoryStore, et as summarizeToolCalls, f as FsRunSnapshotStore, g as GoogleGenAiClient, h as FullDisclosureRouter, i as AgentLoop, it as validateUiSpecNode, j as clearFormValues, k as bridgeError, l as FS_SESSION_PAGE_SIZE, m as FsSessionStore, n as ASK_USER_TOOL, nt as toVercelToolSpecs, o as CapabilityApproval, p as FsRunTraceStore, q as normalizeToolContent, r as ASK_USER_TOOL_NAME, rt as validateUiSpecEvent, s as EventBus, t as ASK_USER_INPUT_SCHEMA, tt as toLlmToolSpec, u as FsArtifactStore, v as OpenAiCompatibleClient, w as RUN_TRACE_SCHEMA_VERSION, x as READ_SKILL_FILE_TOOL, y as ProgressiveRouter, z as fromVercelResult } from "./dist-6C03DShK.js";
|
|
3
4
|
|
|
4
|
-
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, AnthropicClient, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, EventBus, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, MANIFEST_EXCLUDED_FILES, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SerializingMemoryStore, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec,
|
|
5
|
+
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, AnthropicClient, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, EventBus, FORM_VALUES_KEY, FS_SESSION_PAGE_SIZE, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, MANIFEST_EXCLUDED_FILES, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SerializingMemoryStore, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, clearFormValues, clearStoredFormValues, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, extractTodoTraceEvents, extractUiSpecEvents, formFieldKey, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, mergeCatalogEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, partsToText, putFormValues, readFormValues, readResponseWithLimit, readSkillSignature, renderAvailableSkillsXml, renderCatalogJson, resolveArchiveLimits, resolveInsideRoot, resolveToolName, schemaToForm, signSkill, signaturePayloadBytes, summarizeToolCalls, textParts, toLlmToolSpec, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as JsonSchema, Q as
|
|
2
|
-
import {
|
|
1
|
+
import { I as JsonSchema, Q as SkillCatalogEntry, et as SkillDocument, g as LlmToolSpec } from "./types-D_hoCri8-BnNPiZCi.js";
|
|
2
|
+
import { Nt as ToolResult, b as ExternalSkillProvider, rn as mergeCatalogEntries, x as ExternalToolSource } from "./index-vBz_FC9w.js";
|
|
3
3
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
4
4
|
import { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
package/dist/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { O as messageOf, h as assertRemoteUrlAllowed, m as WebSkillError } from "./dist-8oQRa8Xz.js";
|
|
2
|
-
import {
|
|
2
|
+
import { U as mergeCatalogEntries, q as normalizeToolContent } from "./dist-6C03DShK.js";
|
|
3
3
|
|
|
4
4
|
//#region ../mcp/dist/index.js
|
|
5
5
|
/**
|