@webskill/sdk 0.2.7 → 0.3.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/README.md +42 -0
- package/dist/browser.d.ts +13 -4
- package/dist/browser.js +19 -10
- package/dist/{catalogComponents-C_V39rbF-B94i0fW7.js → catalogComponents-C_V39rbF-BOHveMWa.js} +254 -9090
- package/dist/client-BCM6Z3yq-qUQNkKrK.js +7787 -0
- package/dist/{dist-BQzncxXg.js → dist-8oQRa8Xz.js} +212 -13
- package/dist/{dist-CtBLBbEz.js → dist-ZKaM8j06.js} +2 -2
- package/dist/{dist-BdOW8N4V.js → dist-rorEJsNi.js} +596 -59
- package/dist/governance.d.ts +30 -197
- package/dist/governance.js +38 -199
- package/dist/{index-BpIK7tJM.d.ts → index-8d-oEDww.d.ts} +215 -2
- package/dist/{index-BNQNSDKg.d.ts → index-wiV5X8Rz.d.ts} +21 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{jsonRenderRegistry-9GrWP_hE-CMkryt1H.js → jsonRenderRegistry-9GrWP_hE-U6Do3Kid.js} +2 -2
- package/dist/mcp.d.ts +5 -3
- package/dist/mcp.js +10 -5
- package/dist/node.d.ts +338 -4
- package/dist/node.js +2338 -4
- package/dist/{openUiLibrary-B8-Cvou9-Cu1QZqoT.js → openUiLibrary-B8-Cvou9-BbpNTXS3.js} +2 -2
- package/dist/sandboxWorkerEntry.js +12 -3
- package/dist/skillVersionStore-DOEI9ptb-BxbYL70B.d.ts +127 -0
- package/dist/stdio-CFMoANJJ-BxrTeXh7.js +31 -0
- package/dist/{testing-BUoXvm1u.js → testing-CsrG3XLz.js} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/{types-7fnqDVrf-BnRQjVU3.d.ts → types-AmKCKJn_-VGabeXK4.d.ts} +140 -3
- package/dist/types-WovEf4ED-CZSDiiBU.js +6215 -0
- package/dist/ui-react.d.ts +2 -2
- package/dist/ui-react.js +6 -6
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/{webskillLitCatalog-CNaUpasU-CfSRvqCZ.js → webskillLitCatalog-CNaUpasU-BslMcxRZ.js} +1 -1
- package/package.json +4 -7
- package/dist/dist-CcMIUXeZ.js +0 -1896
- package/dist/index-BHL5FWGw.d.ts +0 -240
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as SkillInstallSource, C as UiSurfaceDrafts, I as JsonSchema, M as DiscoveryResult, P as FileSystemProvider, Q as SkillDocument, X as SkillCatalogEntry, Y as SkillCatalog, Z as SkillDiscovery, _ as RenderResultRequest, a as InteractionPolicy, c as LlmClient, d as LlmResponse, f as LlmStreamEvent, g as RenderBlock, gt as WebSkillErrorCode, h as MemoryStore, i as FormField, l as LlmCompleteInput, m as LlmToolSpec, n as ArtifactStore, o as InteractionRequest, pt as ValidationReport, r as ChartSpec, rt as SkillManifest, t as Artifact, u as LlmMessage, v as UiBridge, w as UiSurfaceEvent, x as UiSurfaceActionRequest, y as UiSurface } from "./types-AmKCKJn_-VGabeXK4.js";
|
|
2
2
|
//#region ../runtime/dist/index.d.ts
|
|
3
3
|
//#region src/llm/openAiCompatibleClient.d.ts
|
|
4
4
|
interface OpenAiCompatibleClientConfig {
|
|
@@ -428,6 +428,7 @@ declare class FsMemoryStore implements MemoryStore {
|
|
|
428
428
|
constructor(deps: {
|
|
429
429
|
root: string;
|
|
430
430
|
fs: FileSystemProvider;
|
|
431
|
+
onWarning?: (message: string) => void;
|
|
431
432
|
});
|
|
432
433
|
get(scope: string, key: string): Promise<unknown>;
|
|
433
434
|
set(scope: string, key: string, value: unknown): Promise<void>;
|
|
@@ -472,6 +473,7 @@ declare class FsArtifactStore implements ArtifactStore {
|
|
|
472
473
|
constructor(deps: {
|
|
473
474
|
root: string;
|
|
474
475
|
fs: FileSystemProvider;
|
|
476
|
+
onWarning?: (message: string) => void;
|
|
475
477
|
});
|
|
476
478
|
createTextArtifact(input: {
|
|
477
479
|
runId: string;
|
|
@@ -557,6 +559,18 @@ type NetworkPolicy = 'deny-all' | 'allow-all' | {
|
|
|
557
559
|
declare function isNetworkAllowed(policy: NetworkPolicy, url: string): boolean;
|
|
558
560
|
/** 阻断 trace 用的脱敏 host(解析失败返回占位,不记录完整 URL) */
|
|
559
561
|
declare function networkUrlHost(url: string): string;
|
|
562
|
+
/**
|
|
563
|
+
* 网络策略判定逻辑的可注入源码(单一来源)。
|
|
564
|
+
*
|
|
565
|
+
* 0.2.8 C4:此前各注入点直接拼 `isNetworkAllowed.toString()`,依赖**函数名在产物里保持不变**。
|
|
566
|
+
* SDK 自身不压缩,但消费方一旦跑生产构建,打包器会把导出函数改名(`function Ke(...)`),
|
|
567
|
+
* 注入后的沙箱里 `isNetworkAllowed` 就是 undefined —— 沙箱内任何 fetch 直接
|
|
568
|
+
* TOOL_EXECUTION_FAILED,网络白名单形同虚设。dev server 不压缩,所以只在真实产物上暴露。
|
|
569
|
+
*
|
|
570
|
+
* 因此改为把函数源码绑定到**固定的变量名**上:`var isNetworkAllowed = function Ke(...) {…};`
|
|
571
|
+
* ——名字随便压缩,绑定名恒定。两个函数都自包含(不引用模块内其它符号),故可独立绑定。
|
|
572
|
+
*/
|
|
573
|
+
declare function networkPolicyLibSource(): string;
|
|
560
574
|
//#endregion
|
|
561
575
|
//#region src/sandbox/errorCodes.d.ts
|
|
562
576
|
/**
|
|
@@ -656,6 +670,8 @@ interface RunSnapshot {
|
|
|
656
670
|
activeSkillNames: string[];
|
|
657
671
|
/** 已注册脚本工具定义(恢复后免重新激活) */
|
|
658
672
|
activatedTools: ToolDefinition[];
|
|
673
|
+
/** 声明了 allowed-tools 的技能 → 其清单(D10;旧快照缺省视为无人声明) */
|
|
674
|
+
skillAllowedTools?: Record<string, string[]>;
|
|
659
675
|
/** 等待中的旧交互(恢复时重新发起,表单重新渲染) */
|
|
660
676
|
pendingInteraction?: InteractionRequest;
|
|
661
677
|
/** 等待中的 surface action;其工具结果已入消息历史,无需重跑工具。 */
|
|
@@ -867,4 +883,201 @@ declare class WebSkillRuntime {
|
|
|
867
883
|
cancel(runId: string): boolean;
|
|
868
884
|
}
|
|
869
885
|
//#endregion
|
|
870
|
-
|
|
886
|
+
//#region src/engine/runTrace.d.ts
|
|
887
|
+
declare const RUN_TRACE_SCHEMA_VERSION = 1;
|
|
888
|
+
/**
|
|
889
|
+
* 一次运行的完整 trace 落盘格式。
|
|
890
|
+
*
|
|
891
|
+
* 0.0.1 时代 chatbot 与 console 各写了一份同形状的私有类型,靠注释「字段名不得
|
|
892
|
+
* 擅自变更」维系——本类型把那条口头约定升级为受 api:check 守护的公开契约。
|
|
893
|
+
* 刻意**不留开放扩展位**:演进手段是 `schemaVersion`,`extra?: Record<…>` 会让
|
|
894
|
+
* 快照对字段变更完全失明。
|
|
895
|
+
* @stable
|
|
896
|
+
*/
|
|
897
|
+
interface RunTraceFile {
|
|
898
|
+
/** 缺省视为 0(0.0.1 时代文件) */
|
|
899
|
+
schemaVersion: number;
|
|
900
|
+
runId: string;
|
|
901
|
+
sessionId?: string;
|
|
902
|
+
startedAt: string;
|
|
903
|
+
endedAt?: string;
|
|
904
|
+
/** completed | failed | cancelled;读取侧原样透传 */
|
|
905
|
+
status: string;
|
|
906
|
+
activeSkills: string[];
|
|
907
|
+
events: TraceEvent[];
|
|
908
|
+
}
|
|
909
|
+
/**
|
|
910
|
+
* 运行列表行。由写入侧一次算好,读取侧不再扫描事件。
|
|
911
|
+
* @stable
|
|
912
|
+
*/
|
|
913
|
+
interface RunTraceSummary {
|
|
914
|
+
runId: string;
|
|
915
|
+
sessionId?: string;
|
|
916
|
+
startedAt: string;
|
|
917
|
+
endedAt?: string;
|
|
918
|
+
status: string;
|
|
919
|
+
activeSkills: string[];
|
|
920
|
+
/** 终止原因,取自 run.completed/cancelled/failed 事件的 data.reason */
|
|
921
|
+
endReason?: string;
|
|
922
|
+
eventCount: number;
|
|
923
|
+
/** llm.request 事件数(指标里的「轮次」) */
|
|
924
|
+
turnCount: number;
|
|
925
|
+
/** endedAt - startedAt,无 endedAt 或时间戳不可解析时缺省 */
|
|
926
|
+
durationMs?: number;
|
|
927
|
+
}
|
|
928
|
+
/** @stable */
|
|
929
|
+
interface RunTraceFilter {
|
|
930
|
+
/** 状态精确匹配 */
|
|
931
|
+
status?: string;
|
|
932
|
+
/** 大小写不敏感子串:匹配 runId 或任一激活技能名 */
|
|
933
|
+
search?: string;
|
|
934
|
+
limit?: number;
|
|
935
|
+
offset?: number;
|
|
936
|
+
}
|
|
937
|
+
/** @stable */
|
|
938
|
+
interface RunTraceMetrics {
|
|
939
|
+
totalRuns: number;
|
|
940
|
+
succeeded: number;
|
|
941
|
+
failed: number;
|
|
942
|
+
/** succeeded / totalRuns(无 run 时为 0) */
|
|
943
|
+
successRate: number;
|
|
944
|
+
/** turnCount 均值(无可用 run 时为 0) */
|
|
945
|
+
avgTurns: number;
|
|
946
|
+
/** 摘要不可解析、已排除在统计外的 run 数(正常为 0) */
|
|
947
|
+
skippedRuns: number;
|
|
948
|
+
/** 有 durationMs 的 run 的均值 ms(无则 0) */
|
|
949
|
+
avgDurationMs: number;
|
|
950
|
+
/** 近期失败(status === 'failed',按 startedAt 降序,至多 5 条) */
|
|
951
|
+
recentFailures: RunTraceSummary[];
|
|
952
|
+
}
|
|
953
|
+
/** @stable */
|
|
954
|
+
interface RunTraceStore {
|
|
955
|
+
put(run: RuntimeRun): Promise<void>;
|
|
956
|
+
get(runId: string): Promise<RunTraceFile>;
|
|
957
|
+
list(filter?: RunTraceFilter): Promise<RunTraceSummary[]>;
|
|
958
|
+
metrics(filter?: RunTraceFilter): Promise<RunTraceMetrics>;
|
|
959
|
+
}
|
|
960
|
+
/**
|
|
961
|
+
* `FileSystemProvider` 后端:`<root>/<runId>.json` 存全量 trace,
|
|
962
|
+
* `<root>/index.jsonl` 是 append-only 的摘要旁路索引。
|
|
963
|
+
*
|
|
964
|
+
* 索引存在的唯一理由是**读次数**:0.0.1 的实现为了拼一份列表要整读每个 trace
|
|
965
|
+
* 文件,点一次指标再来一遍。有了索引,`list()` 与 `metrics()` 各只读一个文件。
|
|
966
|
+
*
|
|
967
|
+
* 索引与 trace 目录发散(写完 trace 崩在追加前)的检测不引入新的读放大:
|
|
968
|
+
* 目录列举本来就要做,比较 `*.json` 个数与索引行数即可;不等则整体重建。
|
|
969
|
+
* @stable
|
|
970
|
+
*/
|
|
971
|
+
declare class FsRunTraceStore implements RunTraceStore {
|
|
972
|
+
#private;
|
|
973
|
+
constructor(deps: {
|
|
974
|
+
root: string;
|
|
975
|
+
fs: FileSystemProvider;
|
|
976
|
+
/** 落盘失败的降级处理;默认 console.warn,保持「写失败不阻断对话」的产品语义 */
|
|
977
|
+
onError?: (error: unknown, run: RuntimeRun) => void;
|
|
978
|
+
});
|
|
979
|
+
put(run: RuntimeRun): Promise<void>;
|
|
980
|
+
get(runId: string): Promise<RunTraceFile>;
|
|
981
|
+
list(filter?: RunTraceFilter): Promise<RunTraceSummary[]>;
|
|
982
|
+
metrics(filter?: RunTraceFilter): Promise<RunTraceMetrics>;
|
|
983
|
+
}
|
|
984
|
+
//#endregion
|
|
985
|
+
//#region src/engine/toolCalls.d.ts
|
|
986
|
+
/**
|
|
987
|
+
* 一次工具调用的终态摘要(completed / failed)。
|
|
988
|
+
* @stable
|
|
989
|
+
*/
|
|
990
|
+
interface RunToolCall {
|
|
991
|
+
callId: string;
|
|
992
|
+
name: string;
|
|
993
|
+
status: 'completed' | 'failed';
|
|
994
|
+
/** 参数摘要(JSON 截断 100 字符) */
|
|
995
|
+
args?: string;
|
|
996
|
+
/** 执行耗时 ms */
|
|
997
|
+
durationMs?: number;
|
|
998
|
+
}
|
|
999
|
+
/**
|
|
1000
|
+
* 从 run 的 trace 推导终态工具调用列表。
|
|
1001
|
+
*
|
|
1002
|
+
* 消费者过去要靠自己遍历 trace 才能拿到这份列表,而遍历 trace 的同一段代码
|
|
1003
|
+
* 又顺手承担了「补发漏掉的 live 事件」的职责——两件事绑在一起,谁也删不掉。
|
|
1004
|
+
* 幂等归 runtime(见 `AgentLoop` 的 per-run 已发集合)之后,
|
|
1005
|
+
* 推导终态列表就是纯函数,独立导出。
|
|
1006
|
+
* @stable
|
|
1007
|
+
*/
|
|
1008
|
+
declare function summarizeToolCalls(run: RuntimeRun): RunToolCall[];
|
|
1009
|
+
//#endregion
|
|
1010
|
+
//#region src/engine/session.d.ts
|
|
1011
|
+
declare const SESSION_SCHEMA_VERSION = 1;
|
|
1012
|
+
/** 会话列表行:不含消息正文,`list()` 的返回元素 */
|
|
1013
|
+
interface SessionMeta {
|
|
1014
|
+
id: string;
|
|
1015
|
+
createdAt: string;
|
|
1016
|
+
title?: string;
|
|
1017
|
+
/** 用户已手动重命名:调用方不应再用首条消息覆盖标题 */
|
|
1018
|
+
titleLocked?: boolean;
|
|
1019
|
+
/** 归档标记:默认 `list()` 不返回 */
|
|
1020
|
+
archived?: boolean;
|
|
1021
|
+
messageCount: number;
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* 会话落盘形态。`schemaVersion` 反映**磁盘上的实际值**:
|
|
1025
|
+
* 0.0.1 时代的文件没有该字段,读出来是 0(写回时一律升到当前版本,不做读时原地升级)。
|
|
1026
|
+
*/
|
|
1027
|
+
interface SessionRecord<TMessage = unknown> extends SessionMeta {
|
|
1028
|
+
schemaVersion: number;
|
|
1029
|
+
messages: TMessage[];
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* 会话持久化端口。消息载荷对 runtime 不透明——`ChatMessage` 是 chatbot 的 UI 类型,
|
|
1033
|
+
* runtime 不能认识它,所以泛型默认 `unknown`(只读消费方直接用默认参数即可)。
|
|
1034
|
+
*/
|
|
1035
|
+
interface SessionStore<TMessage = unknown> {
|
|
1036
|
+
list(options?: {
|
|
1037
|
+
includeArchived?: boolean;
|
|
1038
|
+
}): Promise<SessionMeta[]>;
|
|
1039
|
+
get(id: string): Promise<SessionRecord<TMessage> | undefined>;
|
|
1040
|
+
create(init?: {
|
|
1041
|
+
id?: string;
|
|
1042
|
+
title?: string;
|
|
1043
|
+
}): Promise<SessionMeta>;
|
|
1044
|
+
/** 追加消息;同一 id 的并发调用互相串行,不丢消息 */
|
|
1045
|
+
appendMessages(id: string, messages: readonly TMessage[]): Promise<void>;
|
|
1046
|
+
/** 整体替换消息列表(删除单条 / 编辑重发截断历史用;破坏性,不与 append 竞争) */
|
|
1047
|
+
replaceMessages(id: string, messages: readonly TMessage[]): Promise<void>;
|
|
1048
|
+
setTitle(id: string, title: string, options?: {
|
|
1049
|
+
lock?: boolean;
|
|
1050
|
+
}): Promise<void>;
|
|
1051
|
+
setArchived(id: string, archived: boolean): Promise<void>;
|
|
1052
|
+
delete(id: string): Promise<void>;
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* `FileSystemProvider` 后端的会话存储:`<root>/<id>.json`。
|
|
1056
|
+
*
|
|
1057
|
+
* 所有变更操作按 id 串到一条 promise 链上:会话文件是整读整写的,
|
|
1058
|
+
* 两个并发 `appendMessages` 若都先读后写,后写的会覆盖先写的那条消息。
|
|
1059
|
+
*/
|
|
1060
|
+
declare class FsSessionStore<TMessage = unknown> implements SessionStore<TMessage> {
|
|
1061
|
+
#private;
|
|
1062
|
+
constructor(deps: {
|
|
1063
|
+
root: string;
|
|
1064
|
+
fs: FileSystemProvider;
|
|
1065
|
+
});
|
|
1066
|
+
list(options?: {
|
|
1067
|
+
includeArchived?: boolean;
|
|
1068
|
+
}): Promise<SessionMeta[]>;
|
|
1069
|
+
get(id: string): Promise<SessionRecord<TMessage> | undefined>;
|
|
1070
|
+
create(init?: {
|
|
1071
|
+
id?: string;
|
|
1072
|
+
title?: string;
|
|
1073
|
+
}): Promise<SessionMeta>;
|
|
1074
|
+
appendMessages(id: string, messages: readonly TMessage[]): Promise<void>;
|
|
1075
|
+
replaceMessages(id: string, messages: readonly TMessage[]): Promise<void>;
|
|
1076
|
+
setTitle(id: string, title: string, options?: {
|
|
1077
|
+
lock?: boolean;
|
|
1078
|
+
}): Promise<void>;
|
|
1079
|
+
setArchived(id: string, archived: boolean): Promise<void>;
|
|
1080
|
+
delete(id: string): Promise<void>;
|
|
1081
|
+
}
|
|
1082
|
+
//#endregion
|
|
1083
|
+
export { RunTraceStore as $, InstalledSkillManifest as A, extractChartSpec as At, READ_SKILL_FILE_TOOL as B, normalizeToolError as Bt, FsRunTraceStore as C, WebSkillApi as Ct, GoogleGenAiClientConfig as D, buildRenderResult as Dt, GoogleGenAiClient as E, bridgeError as Et, NetworkPolicy as F, mergeCatalogEntries as Ft, RunResult as G, toLlmToolSpec as Gt, RUN_SNAPSHOT_SCHEMA_VERSION as H, resolveToolName as Ht, OpenAiCompatibleClient as I, networkPolicyLibSource as It, RunTerminationReason as J, validateUiSurfaceEvent as Jt, RunSnapshot as K, toVercelToolSpecs as Kt, OpenAiCompatibleClientConfig as L, networkUrlHost as Lt, LifecycleHook as M, fromVercelResult as Mt, LifecycleHookContext as N, fromVercelStreamPart as Nt, HookRunner as O, createScriptContext as Ot, LifecycleListener as P, isNetworkAllowed as Pt, RunTraceMetrics as Q, ProgressiveRouter as R, normalizeErrorCode as Rt, FsRunSnapshotStore as S, VercelToolSpec as St, FullDisclosureRouter as T, WebSkillRuntimeDeps as Tt, RUN_TRACE_SCHEMA_VERSION as U, schemaToForm as Ut, READ_SKILL_FILE_TOOL_NAME as V, parseBridgeRequest as Vt, RouteResult as W, summarizeToolCalls as Wt, RunTraceFile as X, RunToolCall as Y, RunTraceFilter as Z, EventBus as _, ToolResult as _t, AgentLoopConfig as a, SESSION_SCHEMA_VERSION as at, FsArtifactStore as b, TraceEventType as bt, AnthropicClientConfig as c, ScriptExecutor as ct, BridgeCapabilities as d, SessionRecord as dt, RunTraceSummary as et, BridgeCapability as f, SessionStore as ft, CapabilityMode as g, ToolResolution as gt, CapabilityApproval as h, ToolDefinition as ht, AgentLoop as i, RuntimeSessionHandle as it, LifecycleEvent as j, extractUiSurfaceEvents as jt, HookRunnerOptions as k, createWebSkillApi as kt, ApprovalDecision as l, SerializingMemoryStore as lt, BridgeResponse as m, SkillStateGuard as mt, ASK_USER_TOOL as n, RuntimeRun as nt, AgentLoopDeps as o, SchemaInferer as ot, BridgeRequest as p, SkillRouter as pt, RunSnapshotStore as q, validateUiSurface as qt, ASK_USER_TOOL_NAME as r, RuntimeSession as rt, AnthropicClient as s, ScriptExecutionContext as st, ASK_USER_INPUT_SCHEMA as t, RuntimePhase as tt, ApprovalScope as u, SessionMeta as ut, ExternalSkillProvider as v, TraceClock as vt, FsSessionStore as w, WebSkillRuntime as wt, FsMemoryStore as x, TraceRecorder as xt, ExternalToolSource as y, TraceEvent as yt, READ_SKILL_FILE_INPUT_SCHEMA as z, normalizeToolContent as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as UiSurfaceSnapshot,
|
|
2
|
-
import { y as ExternalToolSource } from "./index-
|
|
1
|
+
import { D as UiSurfaceSnapshot, I as JsonSchema, _ as RenderResultRequest, b as UiSurfaceAction, g as RenderBlock, o as InteractionRequest, r as ChartSpec, s as InteractionResponse, v as UiBridge, y as UiSurface } from "./types-AmKCKJn_-VGabeXK4.js";
|
|
2
|
+
import { y as ExternalToolSource } from "./index-8d-oEDww.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ComponentType, ReactNode } from "react";
|
|
5
5
|
//#region ../ui/dist/index.d.ts
|
|
@@ -499,6 +499,23 @@ declare class LitRendererBridge implements UiBridge {
|
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region src/a2uiRuntime/loadLitCatalog.d.ts
|
|
502
|
+
/** catalog 里单个组件的最小可见面(A2UI `LitComponentApi` 的结构子集) */
|
|
503
|
+
interface A2uiCatalogComponent {
|
|
504
|
+
readonly name: string;
|
|
505
|
+
readonly tagName: string;
|
|
506
|
+
readonly schema: unknown;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* A2UI catalog 句柄的最小结构契约。
|
|
510
|
+
*
|
|
511
|
+
* 与 optionalPeers/openUiRuntime.ts 同一约定:**不引用** `@a2ui/*` 的包类型。
|
|
512
|
+
* 它们是 optional peer,写进签名后会原样进入已发布的 `.d.ts`,
|
|
513
|
+
* 未安装 A2UI 的消费方 `tsc --noEmit` 会撞 TS2307(install-smoke 的类型探针实测)。
|
|
514
|
+
*/
|
|
515
|
+
interface A2uiCatalogHandle {
|
|
516
|
+
readonly id: string;
|
|
517
|
+
readonly components: ReadonlyMap<string, A2uiCatalogComponent>;
|
|
518
|
+
}
|
|
502
519
|
/**
|
|
503
520
|
* BYOC Lit 元素的加载入口。
|
|
504
521
|
*
|
|
@@ -506,7 +523,7 @@ declare class LitRendererBridge implements UiBridge {
|
|
|
506
523
|
* 因此只能经动态 import 进来:未用 A2UI 档的应用不为这段体积买单,
|
|
507
524
|
* 缺依赖时给出带安装提示的 `UI_UNAVAILABLE`,而不是一个空白 surface。
|
|
508
525
|
*/
|
|
509
|
-
declare function loadWebSkillLitCatalog(): Promise<
|
|
526
|
+
declare function loadWebSkillLitCatalog(): Promise<A2uiCatalogHandle>;
|
|
510
527
|
//#endregion
|
|
511
528
|
//#region src/optionalPeers/openUiRuntime.d.ts
|
|
512
529
|
/**
|
|
@@ -577,4 +594,4 @@ interface LoadedOpenUiPeers {
|
|
|
577
594
|
*/
|
|
578
595
|
declare function loadOpenUiPeers(): Promise<LoadedOpenUiPeers>;
|
|
579
596
|
//#endregion
|
|
580
|
-
export {
|
|
597
|
+
export { WEBSKILL_SURFACE_ACTION as $, SurfaceRendererProvenance as A, toA2uiSurfaceAction as At, UiSpecNode as B, toVercelToolInvocation as Bt, OPENUI_AUTHORIZE_ACTION as C, renderBlocks as Ct, OpenUiRendererProps as D, shapeInteractionValue as Dt, OPENUI_SURFACE_ACTION as E, renderRenderResult as Et, UiCatalogInput as F, toOpenUiSurfaceLang as Ft, VERCEL_INTERACTION_TOOL_NAME as G, UiSpecValidation as H, UiCatalogPromptOptions as I, toSurface as It, VercelSurfaceDataPart as J, VERCEL_SURFACE_ACTION_DATA_PART_TYPE as K, UiCatalogToolSourceOptions as L, toUiSurfaceActionDispatch as Lt, UI_SPEC_COMPONENT as M, toJsonRenderSpec as Mt, UiActionDef as N, toOpenUiLang as Nt, OpenUiRuntime as O, toA2uiMessages as Ot, UiCatalog as P, toOpenUiSpecLang as Pt, WEBSKILL_STYLES_CSS as Q, UiComponentDef as R, toUiSurfaceDescriptor as Rt, LoadedOpenUiPeers as S, loadWebSkillLitCatalog as St, OPENUI_SUBMIT_ACTION as T, renderMiniMarkdown as Tt, UiSurfaceActionDispatch as U, UiSpecSurfaceProps as V, uiCatalog as Vt, UiSurfaceDescriptor as W, VercelUiBridge as X, VercelToolInvocation as Y, WEBSKILL_A2UI_CATALOG_ID as Z, CollectedValues as _, fromVercelSurfaceAction as _t, A2UI_SPEC_FORM_PATH as a, chartToTable as at, JsonRenderSpec as b, isUiSpecSurface as bt, A2UI_VERSION as c, decodeInteractionResponse as ct, A2uiCatalogHandle as d, fromA2uiAction as dt, WebFormBridge as et, A2uiComponentShape as f, fromA2uiSpecAction as ft, CHART_PALETTE as g, fromUiSurfaceActionDispatch as gt, A2uiSpecMessageOptions as h, fromOpenUiSurfaceAction as ht, A2UI_SPEC_ACTION as i, buildA2uiCatalogDefinition as it, UI_CATALOG_GROUPS as j, toA2uiSurfaceMessages as jt, RENDER_UI_TOOL as k, toA2uiSpecMessages as kt, A2uiCatalogComponent as l, defineUiCatalog as lt, A2uiSpecActionEvent as m, fromOpenUiAction as mt, A2UI_CANCEL_ACTION as n, a2uiComponentSchema as nt, A2UI_SUBMIT_ACTION as o, collectValues as ot, A2uiMessage as p, fromA2uiSurfaceAction as pt, VERCEL_SURFACE_DATA_PART_TYPE as q, A2UI_COMMON_TYPES as r, a2uiComponentShapes as rt, A2UI_SURFACE_ACTION as s, createUiCatalogToolSource as st, A2UI_BASIC_CATALOG_ID as t, ZodRuntime as tt, A2uiCatalogDefinition as u, ensureStyles as ut, ControlModel as v, fromVercelToolResult as vt, OPENUI_CANCEL_ACTION as w, renderMiniChart as wt, LitRendererBridge as x, loadOpenUiPeers as xt, FormModel as y, interactionToFormModel as yt, UiSpecIssue as z, toVercelSurfaceDataPart 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, DEFAULT_ARCHIVE_LIMITS, type DiscoveryResult, EventBus, type ExternalSkillProvider, type ExternalToolSource, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, 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, 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, type RemoteUrlPolicy, type RenderBlock, type RenderResultRequest, type RouteResult, type RunResult, type RunSnapshot, type RunSnapshotStore, type RunTerminationReason, type RuntimePhase, type RuntimeRun, type RuntimeSession, type RuntimeSessionHandle, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, SerializingMemoryStore, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillInstallSource, type SkillIssue, type SkillLocation, type SkillManifest, type SkillMetadata, type SkillPackManifest, SkillReader, type SkillRouter, type SkillSource, type SkillStateGuard, type SkillsLockfile, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type UiBridge, type UiSurface, type UiSurfaceAction, type UiSurfaceActionRequest, type UiSurfaceActionResponse, type UiSurfaceDrafts, type UiSurfaceEvent, type UiSurfaceFormField, type UiSurfacePatch, type UiSurfaceSnapshot, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, extractUiSurfaceEvents, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, messageOf, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, readResponseWithLimit, renderAvailableSkillsXml, renderCatalogJson, resolveArchiveLimits, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSurface, validateUiSurfaceEvent, verifyManifest, xmlRenderer };
|
|
1
|
+
import { $ as SkillInstallSource, A as CryptoKeyLike, At as messageOf, B as SIGNATURE_SCHEMA_VERSION, Bt as signSkill, C as UiSurfaceDrafts, Ct as checkSkillRules, D as UiSurfaceSnapshot, Dt as isValidSkillName, E as UiSurfacePatch, Et as exportSkills, F as FsTrustedKeyStore, Ft as readSkillSignature, G as SKILL_PACK_FILE, Gt as verifySkillSignature, H as SKILL_MANIFEST_FILE, Ht as unzipWithLimits, I as JsonSchema, It as renderAvailableSkillsXml, J as SignatureVerdict, K as SKILL_SIGNATURE_FILE, Kt as xmlRenderer, L as MANIFEST_EXCLUDED_FILES, Lt as renderCatalogJson, M as DiscoveryResult, Mt as parseSkillMarkdown, N as FileStat, Nt as parseSkillPackManifest, O as ArchiveLimits, Ot as jsonRenderer, P as FileSystemProvider, Pt as readResponseWithLimit, Q as SkillDocument, R as MemoryFS, Rt as resolveArchiveLimits, S as UiSurfaceActionResponse, St as checkDependencyCycles, T as UiSurfaceFormField, Tt as escapeXml, U as SKILL_NAME_MAX_LENGTH, Ut as validateSkills, V as SKILLS_LOCKFILE, Vt as signaturePayloadBytes, W as SKILL_NAME_PATTERN, Wt as verifyManifest, X as SkillCatalogEntry, Y as SkillCatalog, Z as SkillDiscovery, _ as RenderResultRequest, _t as assertRemoteUrlAllowed, a as InteractionPolicy, at as SkillPackManifest, b as UiSurfaceAction, bt as buildCatalog, c as LlmClient, ct as SkillSource, d as LlmResponse, dt as TrustedKeyStore, et as SkillIssue, f as LlmStreamEvent, ft as UnsignedPolicy, g as RenderBlock, gt as WebSkillErrorCode, h as MemoryStore, ht as WebSkillError, i as FormField, it as SkillMetadata, j as DEFAULT_ARCHIVE_LIMITS, jt as normalizePath, k as CatalogRenderer, kt as keyIdOf, l as LlmCompleteInput, lt as SkillsLockfile, m as LlmToolSpec, mt as VerifyResult, n as ArtifactStore, nt as SkillManagerPort, o as InteractionRequest, ot as SkillReader, p as LlmToolCall, pt as ValidationReport, q as SignatureAuditSink, r as ChartSpec, rt as SkillManifest, s as InteractionResponse, st as SkillSignature, t as Artifact, tt as SkillLocation, u as LlmMessage, ut as TrustedKey, v as UiBridge, vt as assertSafePathSegment, w as UiSurfaceEvent, wt as computeDigest, x as UiSurfaceActionRequest, xt as buildManifest, y as UiSurface, yt as atomicWriteText, z as RemoteUrlPolicy, zt as resolveInsideRoot } from "./types-AmKCKJn_-VGabeXK4.js";
|
|
2
|
+
import { $ as RunTraceStore, A as InstalledSkillManifest, At as extractChartSpec, B as READ_SKILL_FILE_TOOL, Bt as normalizeToolError, C as FsRunTraceStore, Ct as WebSkillApi, D as GoogleGenAiClientConfig, Dt as buildRenderResult, E as GoogleGenAiClient, Et as bridgeError, F as NetworkPolicy, Ft as mergeCatalogEntries, G as RunResult, Gt as toLlmToolSpec, H as RUN_SNAPSHOT_SCHEMA_VERSION, Ht as resolveToolName, I as OpenAiCompatibleClient, It as networkPolicyLibSource, J as RunTerminationReason, Jt as validateUiSurfaceEvent, K as RunSnapshot, Kt as toVercelToolSpecs, L as OpenAiCompatibleClientConfig, Lt as networkUrlHost, M as LifecycleHook, Mt as fromVercelResult, N as LifecycleHookContext, Nt as fromVercelStreamPart, O as HookRunner, Ot as createScriptContext, P as LifecycleListener, Pt as isNetworkAllowed, Q as RunTraceMetrics, R as ProgressiveRouter, Rt as normalizeErrorCode, S as FsRunSnapshotStore, St as VercelToolSpec, T as FullDisclosureRouter, Tt as WebSkillRuntimeDeps, U as RUN_TRACE_SCHEMA_VERSION, Ut as schemaToForm, V as READ_SKILL_FILE_TOOL_NAME, Vt as parseBridgeRequest, W as RouteResult, Wt as summarizeToolCalls, X as RunTraceFile, Y as RunToolCall, Z as RunTraceFilter, _ as EventBus, _t as ToolResult, a as AgentLoopConfig, at as SESSION_SCHEMA_VERSION, b as FsArtifactStore, bt as TraceEventType, c as AnthropicClientConfig, ct as ScriptExecutor, d as BridgeCapabilities, dt as SessionRecord, et as RunTraceSummary, f as BridgeCapability, ft as SessionStore, g as CapabilityMode, gt as ToolResolution, h as CapabilityApproval, ht as ToolDefinition, i as AgentLoop, it as RuntimeSessionHandle, j as LifecycleEvent, jt as extractUiSurfaceEvents, k as HookRunnerOptions, kt as createWebSkillApi, l as ApprovalDecision, lt as SerializingMemoryStore, m as BridgeResponse, mt as SkillStateGuard, n as ASK_USER_TOOL, nt as RuntimeRun, o as AgentLoopDeps, ot as SchemaInferer, p as BridgeRequest, pt as SkillRouter, q as RunSnapshotStore, qt as validateUiSurface, r as ASK_USER_TOOL_NAME, rt as RuntimeSession, s as AnthropicClient, st as ScriptExecutionContext, t as ASK_USER_INPUT_SCHEMA, tt as RuntimePhase, u as ApprovalScope, ut as SessionMeta, v as ExternalSkillProvider, vt as TraceClock, w as FsSessionStore, wt as WebSkillRuntime, x as FsMemoryStore, xt as TraceRecorder, y as ExternalToolSource, yt as TraceEvent, z as READ_SKILL_FILE_INPUT_SCHEMA, zt as normalizeToolContent } from "./index-8d-oEDww.js";
|
|
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 UiSurface, type UiSurfaceAction, type UiSurfaceActionRequest, type UiSurfaceActionResponse, type UiSurfaceDrafts, type UiSurfaceEvent, type UiSurfaceFormField, type UiSurfacePatch, type UiSurfaceSnapshot, type UnsignedPolicy, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, extractUiSurfaceEvents, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, keyIdOf, mergeCatalogEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, readResponseWithLimit, readSkillSignature, renderAvailableSkillsXml, renderCatalogJson, resolveArchiveLimits, resolveInsideRoot, resolveToolName, schemaToForm, signSkill, signaturePayloadBytes, summarizeToolCalls, toLlmToolSpec, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSurface, validateUiSurfaceEvent, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as
|
|
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 { A as createWebSkillApi, B as normalizeToolContent, C as SESSION_SCHEMA_VERSION, D as bridgeError, E as WebSkillRuntime, F as isNetworkAllowed, G as summarizeToolCalls, H as parseBridgeRequest, I as mergeCatalogEntries, J as validateUiSurface, K as toLlmToolSpec, L as networkPolicyLibSource, M as extractUiSurfaceEvents, N as fromVercelResult, O as buildRenderResult, P as fromVercelStreamPart, R as networkUrlHost, S as RUN_TRACE_SCHEMA_VERSION, T as TraceRecorder, U as resolveToolName, V as normalizeToolError, W as schemaToForm, Y as validateUiSurfaceEvent, _ as ProgressiveRouter, a as AnthropicClient, b as READ_SKILL_FILE_TOOL_NAME, c as FsArtifactStore, d as FsRunTraceStore, f as FsSessionStore, g as OpenAiCompatibleClient, h as HookRunner, i as AgentLoop, j as extractChartSpec, k as createScriptContext, l as FsMemoryStore, m as GoogleGenAiClient, n as ASK_USER_TOOL, o as CapabilityApproval, p as FullDisclosureRouter, q as toVercelToolSpecs, r as ASK_USER_TOOL_NAME, s as EventBus, t as ASK_USER_INPUT_SCHEMA, u as FsRunSnapshotStore, v as READ_SKILL_FILE_INPUT_SCHEMA, w as SerializingMemoryStore, x as RUN_SNAPSHOT_SCHEMA_VERSION, y as READ_SKILL_FILE_TOOL, z as normalizeErrorCode } from "./dist-rorEJsNi.js";
|
|
3
3
|
|
|
4
|
-
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, AnthropicClient, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, EventBus, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SerializingMemoryStore, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, extractUiSurfaceEvents, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, messageOf, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, readResponseWithLimit, renderAvailableSkillsXml, renderCatalogJson, resolveArchiveLimits, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSurface, validateUiSurfaceEvent, verifyManifest, xmlRenderer };
|
|
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, extractUiSurfaceEvents, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, keyIdOf, mergeCatalogEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, readResponseWithLimit, readSkillSignature, renderAvailableSkillsXml, renderCatalogJson, resolveArchiveLimits, resolveInsideRoot, resolveToolName, schemaToForm, signSkill, signaturePayloadBytes, summarizeToolCalls, toLlmToolSpec, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSurface, validateUiSurfaceEvent, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/{jsonRenderRegistry-9GrWP_hE-CMkryt1H.js → jsonRenderRegistry-9GrWP_hE-U6Do3Kid.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ft as uiCatalog } from "./dist-
|
|
2
|
-
import { n as catalogComponentImpls } from "./catalogComponents-C_V39rbF-
|
|
1
|
+
import { ft as uiCatalog } from "./dist-ZKaM8j06.js";
|
|
2
|
+
import { n as catalogComponentImpls } from "./catalogComponents-C_V39rbF-BOHveMWa.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { I as JsonSchema, Q as SkillDocument, X as SkillCatalogEntry, m as LlmToolSpec } from "./types-AmKCKJn_-VGabeXK4.js";
|
|
2
|
+
import { Ft as mergeCatalogEntries, _t as ToolResult, v as ExternalSkillProvider, y as ExternalToolSource } from "./index-8d-oEDww.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";
|
|
@@ -214,7 +214,7 @@ declare class ExperimentalWebMcpAdapter {
|
|
|
214
214
|
enabled?: boolean;
|
|
215
215
|
});
|
|
216
216
|
isAvailable(): boolean;
|
|
217
|
-
/** 工具清单(listTools
|
|
217
|
+
/** 工具清单(listTools 缺失时返回 undefined;调用失败时告警后返回 undefined) */
|
|
218
218
|
listTools(): Promise<WebMcpToolDescriptor[] | undefined>;
|
|
219
219
|
/** 工具名清单(listTools 缺失/失败时返回 undefined) */
|
|
220
220
|
listToolNames(): Promise<string[] | undefined>;
|
|
@@ -235,6 +235,8 @@ declare class McpRuntimePlugin implements ExternalToolSource {
|
|
|
235
235
|
resolver?: McpToolResolver;
|
|
236
236
|
/** 已知的 endpoint 名(注销后仍按 MCP_ENDPOINT_UNAVAILABLE 响应,而非 TOOL_NOT_FOUND) */
|
|
237
237
|
endpoints?: string[];
|
|
238
|
+
/** endpoint 不可用时的告警出口(默认 console.warn) */
|
|
239
|
+
onWarning?(message: string): void;
|
|
238
240
|
});
|
|
239
241
|
listToolSpecs(): Promise<LlmToolSpec[]>;
|
|
240
242
|
canHandle(llmToolName: string): boolean;
|
package/dist/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { O as messageOf, h as assertRemoteUrlAllowed, m as WebSkillError } from "./dist-8oQRa8Xz.js";
|
|
2
|
+
import { B as normalizeToolContent, I as mergeCatalogEntries } from "./dist-rorEJsNi.js";
|
|
3
3
|
|
|
4
4
|
//#region ../mcp/dist/index.js
|
|
5
5
|
/**
|
|
@@ -418,13 +418,14 @@ var ExperimentalWebMcpAdapter = class {
|
|
|
418
418
|
isAvailable() {
|
|
419
419
|
return this.#enabled && typeof this.#resolveApi()?.executeTool === "function";
|
|
420
420
|
}
|
|
421
|
-
/** 工具清单(listTools
|
|
421
|
+
/** 工具清单(listTools 缺失时返回 undefined;调用失败时告警后返回 undefined) */
|
|
422
422
|
async listTools() {
|
|
423
423
|
const api = this.#resolveApi();
|
|
424
424
|
if (typeof api?.listTools !== "function") return void 0;
|
|
425
425
|
try {
|
|
426
426
|
return extractToolDescriptors(await api.listTools());
|
|
427
|
-
} catch {
|
|
427
|
+
} catch (e) {
|
|
428
|
+
console.warn(`[webskill] navigator.modelContext.listTools() failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
428
429
|
return;
|
|
429
430
|
}
|
|
430
431
|
}
|
|
@@ -460,11 +461,13 @@ var McpRuntimePlugin = class {
|
|
|
460
461
|
#resolver;
|
|
461
462
|
#webMcp;
|
|
462
463
|
#configuredEndpoints;
|
|
464
|
+
#onWarning;
|
|
463
465
|
constructor(deps) {
|
|
464
466
|
this.#registry = deps.registry;
|
|
465
467
|
this.#resolver = deps.resolver ?? new McpToolResolver(deps.registry);
|
|
466
468
|
this.#webMcp = deps.webMcp;
|
|
467
469
|
this.#configuredEndpoints = deps.endpoints ?? [];
|
|
470
|
+
this.#onWarning = deps.onWarning ?? ((message) => console.warn(message));
|
|
468
471
|
}
|
|
469
472
|
#endpoints() {
|
|
470
473
|
return [.../* @__PURE__ */ new Set([...this.#configuredEndpoints, ...this.#registry.endpoints()])];
|
|
@@ -481,7 +484,9 @@ var McpRuntimePlugin = class {
|
|
|
481
484
|
properties: {}
|
|
482
485
|
}
|
|
483
486
|
});
|
|
484
|
-
} catch {
|
|
487
|
+
} catch (e) {
|
|
488
|
+
this.#onWarning(`[webskill] MCP endpoint "${endpoint}" is unavailable; its tools are omitted from this turn: ${e instanceof Error ? e.message : String(e)}`);
|
|
489
|
+
}
|
|
485
490
|
if (this.#webMcp?.isAvailable()) {
|
|
486
491
|
const tools = await this.#webMcp.listTools();
|
|
487
492
|
for (const tool of tools ?? []) specs.push({
|