@webskill/sdk 0.11.0 → 0.13.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 +3 -3
- package/dist/agent.js +3 -3
- package/dist/browser.d.ts +29 -6
- package/dist/browser.js +629 -75
- package/dist/{catalogComponents-BFoqpT1v-CjUBZ3bc.js → catalogComponents-BgAJN0p8-CYEXSk45.js} +606 -926
- package/dist/{dist-DTHZS2k1.js → dist-DqcL6jKO.js} +155 -39
- package/dist/{dist-B-cOu08W.js → dist-ExSQky4C.js} +754 -69
- package/dist/{dist-qnlI2Iup.js → dist-GK6dtjRv.js} +222 -9
- package/dist/{echarts-DhNm2ene.js → echarts-De78wXqV.js} +599 -61
- package/dist/governance.d.ts +3 -3
- package/dist/{index-DACk2_XZ.d.ts → index-C3XdItd_.d.ts} +92 -8
- package/dist/{index-D3mONFHD.d.ts → index-DkvBhJQy.d.ts} +187 -6
- package/dist/{index-DWbs58LF.d.ts → index-iBm9tJL_.d.ts} +122 -23
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/mcp.d.ts +47 -3
- package/dist/mcp.js +79 -2
- package/dist/node.d.ts +3 -3
- package/dist/node.js +9 -3
- package/dist/{openUiLibrary-D5u8oIvx-BLOAQCho.js → openUiLibrary-BKXW7Iwx-CWWBVOkE.js} +3 -3
- package/dist/processSandboxEntry.js +2 -1
- package/dist/sandboxWorkerEntry.js +2 -1
- package/dist/{skillVersionStore-D-qHk9ZE-BcmFLykd.d.ts → skillVersionStore-D-qHk9ZE-DheTIwAB.d.ts} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{types-C26b05fW-CdrRCRDb.d.ts → types-DLctJep_-B5G4uk2u.d.ts} +3 -2
- package/dist/ui-react.d.ts +13 -4
- package/dist/ui-react.js +77 -259
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +3 -3
- package/dist/{webskillLitCatalog-DME6PBkV-CmYNLlIT.js → webskillLitCatalog-D_zCqeQF-C9lrvvMr.js} +2 -2
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as RemoteUrlPolicy, S as UiBridge, Tt as WebSkillErrorCode, a as InteractionOrigin, c as InteractionResponse, s as InteractionRequest } from "./types-
|
|
2
|
-
import { F as ExternalToolSource } from "./index-
|
|
1
|
+
import { G as RemoteUrlPolicy, S as UiBridge, Tt as WebSkillErrorCode, a as InteractionOrigin, c as InteractionResponse, s as InteractionRequest } from "./types-DLctJep_-B5G4uk2u.js";
|
|
2
|
+
import { F as ExternalToolSource, mn as ToolStepReader } from "./index-DkvBhJQy.js";
|
|
3
3
|
//#region ../agent/dist/index.d.ts
|
|
4
4
|
//#region src/todo/types.d.ts
|
|
5
5
|
/** 待办条目状态:未开始 / 进行中 / 已完成(FR-3.1) */
|
|
@@ -94,6 +94,16 @@ interface GeneratedSkillDraft {
|
|
|
94
94
|
path: string;
|
|
95
95
|
content: string;
|
|
96
96
|
}[];
|
|
97
|
+
/**
|
|
98
|
+
* 模型声称这个技能会执行的工具调用(分册 30 / FR-30.4)。
|
|
99
|
+
*
|
|
100
|
+
* 做成结构化入参而不是从 `content` 正文里扫工具名:正文是自由文本,
|
|
101
|
+
* 扫描既会漏(模型写「点击提交按钮」而不写工具名)又会误命中(提到但没执行)。
|
|
102
|
+
*/
|
|
103
|
+
steps?: readonly {
|
|
104
|
+
tool: string;
|
|
105
|
+
args?: Record<string, unknown>;
|
|
106
|
+
}[];
|
|
97
107
|
}
|
|
98
108
|
/**
|
|
99
109
|
* 候选收货端口。实现由宿主注入——`@webskill/agent` 不依赖 `@webskill/governance`
|
|
@@ -136,12 +146,34 @@ interface SkillGeneratorOptions {
|
|
|
136
146
|
now?: () => Date;
|
|
137
147
|
/** 界面文案注入口:生成器与语言无关,字典在宿主手里(UI-UX5 #9) */
|
|
138
148
|
messages?: SkillGenerationMessages;
|
|
149
|
+
/**
|
|
150
|
+
* 本会话的运行轨迹(分册 30)。**不注入即不校验、不展示证据**,行为与 0.11.0 一致——
|
|
151
|
+
* 这既让本册可分步落地,也给 AC-30.14 的反向对照留了现成的造法。
|
|
152
|
+
*/
|
|
153
|
+
steps?: ToolStepReader;
|
|
139
154
|
}
|
|
140
155
|
/** 生成器面向用户的文案;缺省全部为英文模板 */
|
|
141
156
|
interface SkillGenerationMessages {
|
|
142
157
|
/** 授权确认卡的正文(含技能名与描述插值由实现方完成) */
|
|
143
158
|
confirmSkill?(draft: GeneratedSkillDraft): string;
|
|
144
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* 确认卡上的一步(分册 30 / FR-30.5)。
|
|
162
|
+
* `evidence` 区分「这一步在本会话真的跑过」与「模型自己补写的」。
|
|
163
|
+
*/
|
|
164
|
+
interface SkillTraceEvidenceStep {
|
|
165
|
+
tool: string;
|
|
166
|
+
evidence: 'trace' | 'model';
|
|
167
|
+
/** 轨迹里的原始参数(已脱敏);无背书时缺省 */
|
|
168
|
+
traceArgs?: Record<string, unknown>;
|
|
169
|
+
/** 模型在草稿里写的参数 */
|
|
170
|
+
draftArgs?: Record<string, unknown>;
|
|
171
|
+
/** 轨迹里被脱敏掉的字段路径 */
|
|
172
|
+
redacted?: readonly string[];
|
|
173
|
+
}
|
|
174
|
+
interface SkillTraceEvidence {
|
|
175
|
+
steps: readonly SkillTraceEvidenceStep[];
|
|
176
|
+
}
|
|
145
177
|
/**
|
|
146
178
|
* 技能自动生成策略。生成动作是策略而不是内核:它不进入 `AgentLoop`,
|
|
147
179
|
* 而是经既有的 `ExternalToolSource` 扩展点接入(设计 02 §0)。
|
|
@@ -309,16 +341,19 @@ interface PerceptionScope {
|
|
|
309
341
|
exclude?: readonly string[];
|
|
310
342
|
}
|
|
311
343
|
/**
|
|
312
|
-
* 一个帧内的可感知范围(FR-24.1)。
|
|
344
|
+
* 一个帧内的可感知范围(FR-24.1 / 分册 18 FR-18.1)。
|
|
313
345
|
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
346
|
+
* 嵌套帧写**自外向内的选择器数组**:第 1 项在主文档里求值,
|
|
347
|
+
* 第 n+1 项在第 n 项解析出的文档里求值。逐层写出来是有意的——
|
|
348
|
+
* 授权面覆盖了哪几层,配置里要能一眼看出来,不允许靠自动发现下钻。
|
|
317
349
|
* @experimental
|
|
318
350
|
*/
|
|
319
351
|
interface FrameScope {
|
|
320
|
-
/**
|
|
321
|
-
|
|
352
|
+
/**
|
|
353
|
+
* 主文档写 `'self'`;单层 iframe 写主文档里定位该 `<iframe>` 的选择器;
|
|
354
|
+
* 多层嵌套写逐层选择器数组(空数组等价于 `'self'`)。
|
|
355
|
+
*/
|
|
356
|
+
frame: 'self' | string | readonly string[];
|
|
322
357
|
include: readonly string[];
|
|
323
358
|
exclude?: readonly string[];
|
|
324
359
|
}
|
|
@@ -341,6 +376,7 @@ type PerceptionScopeInput = PerceptionScope | {
|
|
|
341
376
|
declare function toFrameScopes(scope: PerceptionScopeInput): readonly FrameScope[];
|
|
342
377
|
/** 某个帧未能读取的原因(FR-24.2 / FR-24.3);不静默跳过 @experimental */
|
|
343
378
|
interface FrameNote {
|
|
379
|
+
/** 帧路径的展示串(`frameLabel` 的产出,分册 18 FR-18.2) */
|
|
344
380
|
frame: string;
|
|
345
381
|
reason: 'cross-origin' | 'origin-changed' | 'not-found';
|
|
346
382
|
/** 面向模型的英文说明,同时也是说明节点的 name */
|
|
@@ -371,13 +407,16 @@ interface PerceivedNode {
|
|
|
371
407
|
imageNote?: string;
|
|
372
408
|
/**
|
|
373
409
|
* 不透明元素句柄(S10)。**仅当该节点可被操作时出现**:
|
|
374
|
-
*
|
|
375
|
-
*
|
|
410
|
+
* 它落在宿主声明的操作范围内、且是可交互角色。由 reader 生成,模型不得构造或推断。
|
|
411
|
+
*
|
|
412
|
+
* **跨感知保留,直到元素离开文档**(分册 18 FR-18.5)。它不是安全边界——
|
|
413
|
+
* 「页面变了不能点到别的东西」由执行前的实时校验承担,不由句柄寿命承担。
|
|
376
414
|
*/
|
|
377
415
|
ref?: string;
|
|
378
416
|
/**
|
|
379
|
-
* 该节点来自哪个帧(FR-24.4
|
|
380
|
-
*
|
|
417
|
+
* 该节点来自哪个帧(FR-24.4),取值是帧路径的展示串(`frameLabel`)。
|
|
418
|
+
* **主文档节点不带这个字段**——否则旧宿主的断言会凭空变化。
|
|
419
|
+
* 跨帧后会出现同名控件,不标帧模型会点错。
|
|
381
420
|
*/
|
|
382
421
|
frame?: string;
|
|
383
422
|
/**
|
|
@@ -415,6 +454,11 @@ interface PerceptionCaptureOptions {
|
|
|
415
454
|
images: boolean;
|
|
416
455
|
maxImageBytes: number;
|
|
417
456
|
maxImages: number;
|
|
457
|
+
/**
|
|
458
|
+
* 小于该面积(平方像素)的元素视作图标,不占取像名额(0.13.0 FR-20.3)。
|
|
459
|
+
* 可选是为了不破坏既有 reader 实现;缺省与 0 都表示不过滤。
|
|
460
|
+
*/
|
|
461
|
+
minImageArea?: number;
|
|
418
462
|
}
|
|
419
463
|
/**
|
|
420
464
|
* reader 的完整产物。只实现文本的 reader 可以继续返回节点数组。
|
|
@@ -536,6 +580,8 @@ interface ImageCaptureBudget {
|
|
|
536
580
|
enabled: boolean;
|
|
537
581
|
maxImageBytes: number;
|
|
538
582
|
maxImages: number;
|
|
583
|
+
/** 小于该面积(平方像素)的元素视作图标;缺省与 0 都表示不过滤(0.13.0 FR-20.3) */
|
|
584
|
+
minImageArea?: number;
|
|
539
585
|
}
|
|
540
586
|
/**
|
|
541
587
|
* 把只读感知接到既有工具协议上。**本工具源不导出任何写入动作**(FR-10.7):
|
|
@@ -547,6 +593,25 @@ interface ImageCaptureBudget {
|
|
|
547
593
|
*/
|
|
548
594
|
declare function createPagePerceptionToolSource(options: PagePerceptionToolSourceOptions): ExternalToolSource;
|
|
549
595
|
//#endregion
|
|
596
|
+
//#region src/frame.d.ts
|
|
597
|
+
/**
|
|
598
|
+
* 帧指称的展示形式(分册 18 FR-18.2)。
|
|
599
|
+
*
|
|
600
|
+
* 感知与操作两侧各自声明自己的 scope 类型(那是刻意的,见各自 types.ts),
|
|
601
|
+
* 但「一条帧路径写成给人看的字符串」只能有一份实现——
|
|
602
|
+
* 两处各写一遍,审计里的帧名和确认卡里的帧名就会慢慢对不上。
|
|
603
|
+
*/
|
|
604
|
+
/**
|
|
605
|
+
* 帧路径的稳定展示串:`'self'` / `'#a'` / `'#a >>> #b'`。
|
|
606
|
+
*
|
|
607
|
+
* `>>>` **只是展示分隔符**:CSS 选择器里可以合法出现任意字符,
|
|
608
|
+
* 反向解析这个串取回路径是不成立的,实现层一律传原始形状(D-18-1)。
|
|
609
|
+
* @experimental
|
|
610
|
+
*/
|
|
611
|
+
declare function frameLabel(frame: string | readonly string[]): string;
|
|
612
|
+
/** 把两种形状归一成逐层选择器数组;`'self'` 与空数组都归一成空数组 @experimental */
|
|
613
|
+
declare function frameSteps(frame: string | readonly string[]): readonly string[];
|
|
614
|
+
//#endregion
|
|
550
615
|
//#region src/prompts/perception.d.ts
|
|
551
616
|
/**
|
|
552
617
|
* 页面只读感知的策略提示词(设计 09 §1)。
|
|
@@ -672,15 +737,18 @@ interface PageActionScope {
|
|
|
672
737
|
exclude?: readonly string[];
|
|
673
738
|
}
|
|
674
739
|
/**
|
|
675
|
-
* 一个帧内的可操作范围(FR-24.1)。
|
|
740
|
+
* 一个帧内的可操作范围(FR-24.1 / 分册 18 FR-18.1)。
|
|
676
741
|
*
|
|
677
742
|
* 与感知侧的 `FrameScope` 同构但**独立声明**,理由同上:合并成一个类型会让
|
|
678
743
|
* 「一份配置同时当感知范围和操作范围用」在类型层面合法。
|
|
679
744
|
* @experimental
|
|
680
745
|
*/
|
|
681
746
|
interface ActionFrameScope {
|
|
682
|
-
/**
|
|
683
|
-
|
|
747
|
+
/**
|
|
748
|
+
* 主文档写 `'self'`;单层 iframe 写主文档里定位该 `<iframe>` 的选择器;
|
|
749
|
+
* 多层嵌套写逐层选择器数组(空数组等价于 `'self'`)。
|
|
750
|
+
*/
|
|
751
|
+
frame: 'self' | string | readonly string[];
|
|
684
752
|
include: readonly string[];
|
|
685
753
|
exclude?: readonly string[];
|
|
686
754
|
}
|
|
@@ -738,9 +806,32 @@ interface PageActionOutcome {
|
|
|
738
806
|
noop?: boolean;
|
|
739
807
|
/** 本次操作新打开的模态的可访问名;授权面临时扩大要在留痕里看得见(FR-25.6) */
|
|
740
808
|
elevatedModal?: string;
|
|
809
|
+
/**
|
|
810
|
+
* 本次操作后目标所在帧的地址变了(帧内跳转 / SPA 路由,分册 18 FR-18.6)。
|
|
811
|
+
* 没变时**不带**该字段:带个 `false` 会让旧宿主的断言凭空变化。
|
|
812
|
+
*
|
|
813
|
+
* 真正的跨文档导航会销毁执行上下文,那种情况拿不到本字段——固有限制,不假装。
|
|
814
|
+
*/
|
|
815
|
+
navigated?: boolean;
|
|
816
|
+
/** 变更后的地址;仅 `navigated` 时带 */
|
|
817
|
+
documentUrl?: string;
|
|
741
818
|
/** 失败原因(英文) */
|
|
742
819
|
reason?: string;
|
|
743
820
|
}
|
|
821
|
+
/**
|
|
822
|
+
* 执行器对一个句柄的描述。确认卡的措辞、留痕与分册 30 的参数留存共用这一份——
|
|
823
|
+
* 句柄本身是本次感知产出的不透明串,离开这次运行就没有意义。
|
|
824
|
+
* @experimental
|
|
825
|
+
*/
|
|
826
|
+
interface PageActionTarget {
|
|
827
|
+
role: string;
|
|
828
|
+
name?: string;
|
|
829
|
+
/** 密码类控件:确认卡打掩码,参数留存整次调用不留明文 */
|
|
830
|
+
secret?: boolean;
|
|
831
|
+
frame?: string;
|
|
832
|
+
/** 目标在本次任务临时打开的对话框里,授权面被扩大过 */
|
|
833
|
+
elevated?: boolean;
|
|
834
|
+
}
|
|
744
835
|
/**
|
|
745
836
|
* 页面操作执行器。与 `PagePerceptionReader` 对称,同样不含 DOM 概念。
|
|
746
837
|
* 实现方负责校验句柄有效性、元素可交互性,以及目标是否仍在操作范围内。
|
|
@@ -749,13 +840,7 @@ interface PageActionOutcome {
|
|
|
749
840
|
interface PageActionExecutor {
|
|
750
841
|
execute(request: PageActionRequest): Promise<PageActionOutcome> | PageActionOutcome;
|
|
751
842
|
/** 目标的角色与可访问名称,供确认卡在**执行前**说清将要做什么(FR-23.2) */
|
|
752
|
-
describe(ref: string):
|
|
753
|
-
role: string;
|
|
754
|
-
name?: string;
|
|
755
|
-
secret?: boolean;
|
|
756
|
-
frame?: string;
|
|
757
|
-
elevated?: boolean;
|
|
758
|
-
} | undefined;
|
|
843
|
+
describe(ref: string): PageActionTarget | undefined;
|
|
759
844
|
}
|
|
760
845
|
/** 一次页面操作的留痕(FR-23.3 的五项字段) @experimental */
|
|
761
846
|
interface PageActionRecord {
|
|
@@ -816,6 +901,20 @@ declare class PageActionPolicy {
|
|
|
816
901
|
get scope(): PageActionScopeInput;
|
|
817
902
|
/** 最近的操作记录(只读展示用),新的在前 */
|
|
818
903
|
get records(): readonly PageActionRecord[];
|
|
904
|
+
/**
|
|
905
|
+
* 目标是不是密码类控件(分册 30)。与确认卡上把值打成掩码用的是**同一个判定**,
|
|
906
|
+
* 不另立一套敏感字段清单。
|
|
907
|
+
*
|
|
908
|
+
* 读的是 `act()` 当时记下的结论而不是事后重查:提交或重绘后句柄会失效,
|
|
909
|
+
* 重查就会把一次普通填写误判成敏感、把内容丢掉。没操作过的句柄才现查,
|
|
910
|
+
* 查不到按敏感:不知道就别留存。
|
|
911
|
+
*/
|
|
912
|
+
isSecretTarget(ref: string): boolean;
|
|
913
|
+
/**
|
|
914
|
+
* `act()` 当时看到的目标身份(分册 30)。句柄只在本次感知内有效,
|
|
915
|
+
* 只留句柄等于留了一个换次运行就失效的引用;角色与可访问名才是可重放的那部分。
|
|
916
|
+
*/
|
|
917
|
+
rememberedTarget(ref: string): PageActionTarget | undefined;
|
|
819
918
|
act(request: PageActionRequest): Promise<PageActionOutcome>;
|
|
820
919
|
}
|
|
821
920
|
//#endregion
|
|
@@ -842,4 +941,4 @@ declare function createPageActionToolSource(options: PageActionToolSourceOptions
|
|
|
842
941
|
*/
|
|
843
942
|
declare const PAGE_ACTION_SYSTEM_PROMPT: string;
|
|
844
943
|
//#endregion
|
|
845
|
-
export {
|
|
944
|
+
export { PerceptionScope as $, PageActionKind as A, toFrameScopes as At, PageActionUi as B, MANAGE_TODO_TOOL as C, createPageActionToolSource as Ct, PERCEIVE_PAGE_TOOL as D, frameLabel as Dt, PAGE_ACTION_TOOL as E, createTodoToolSource as Et, PageActionRequest as F, PagePerceptionToolSourceOptions as G, PagePerceptionPolicy as H, PageActionScope as I, PerceivedNode as J, ParentBudget as K, PageActionScopeInput as L, PageActionPolicy as M, PageActionPolicyOptions as N, PERCEPTION_SYSTEM_PROMPT as O, frameSteps as Ot, PageActionRecord as P, PerceptionResult as Q, PageActionTarget as R, ImageCaptureBudget as S, createHttpDataSourceTransport as St, PAGE_ACTION_SYSTEM_PROMPT as T, createSkillGenerationToolSource as Tt, PagePerceptionPolicyOptions as U, PageAuditSink as V, PagePerceptionReader as W, PerceptionCaptureOptions as X, PerceptionAuditSink as Y, PerceptionRecord as Z, FrameNote as _, TodoListener as _t, DataSourceDef as a, SkillGenerationPolicy as at, GeneratedSkillDraft as b, TodoToolSourceOptions as bt, DataSourcePolicyOptions as c, SkillGeneratorOptions as ct, DelegationBudget as d, SubAgentRunInput as dt, PerceptionScopeInput as et, DelegationOrchestrator as f, SubAgentRunner as ft, DelegationToolSourceOptions as g, TodoList as gt, DelegationResult as h, TodoItem as ht, DataSourceAuditSink as i, SkillGenerationOutcome as it, PageActionOutcome as j, withDelegationOrigin as jt, PageActionExecutor as k, toActionFrameScopes as kt, DataSourceRecord as l, SkillTraceEvidence as lt, DelegationRequest as m, TodoEvent as mt, DELEGATE_TASK_TOOL as n, SkillCandidateSink as nt, DataSourceKind as o, SkillGenerationToolSourceOptions as ot, DelegationOrchestratorOptions as p, TODO_SYSTEM_PROMPT as pt, PerceivedImage as q, DELEGATION_SYSTEM_PROMPT as r, SkillGenerationMessages as rt, DataSourcePolicy as s, SkillGenerator as st, ActionFrameScope as t, SKILL_GENERATION_SYSTEM_PROMPT as tt, DataSourceTransport as u, SkillTraceEvidenceStep as ut, FrameScope as v, TodoStatus as vt, PAGE_ACTION_KINDS as w, createPagePerceptionToolSource as wt, HttpDataSourceOptions as x, createDelegationToolSource as xt, GENERATE_SKILL_TOOL as y, TodoStore as yt, PageActionToolSourceOptions as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { $ as SignatureAuditSink, $t as signaturePayloadBytes, A as extractSkillCandidate, At as buildManifest, B as JsonSchema, Bt as jsonRenderer, C as UiSpecActionCapability, Ct as VerifyResult, D as UiSpecSnapshot, Dt as assertSafePathSegment, E as UiSpecPatch, Et as assertRemoteUrlAllowed, F as DEFAULT_ARCHIVE_LIMITS, Ft as detectSkillArchiveShapeFromFs, G as RemoteUrlPolicy, Gt as parseSkillPackManifest, H as MemoryFS, Ht as messageOf, I as DiscoveryResult, It as escapeXml, J as SKILL_MANIFEST_FILE, Jt as renderAvailableSkillsXml, K as SIGNATURE_SCHEMA_VERSION, Kt as readResponseWithLimit, L as FileStat, Lt as exportSkills, M as ArchiveLimits, Mt as checkSkillRules, N as CatalogRenderer, Nt as computeDigest, O as UiSurfaceActionRequest, Ot as atomicWriteText, P as CryptoKeyLike, Pt as detectSkillArchiveShape, Q as SKILL_SIGNATURE_FILE, Qt as signSkill, R as FileSystemProvider, Rt as isAtomicTempPath, S as UiBridge, St as ValidationReport, T as UiSpecEvent, Tt as WebSkillErrorCode, U as Page, Ut as normalizePath, V as MANIFEST_EXCLUDED_FILES, Vt as keyIdOf, W as PageQuery, Wt as parseSkillMarkdown, X as SKILL_NAME_PATTERN, Xt as resolveArchiveLimits, Y as SKILL_NAME_MAX_LENGTH, Yt as renderCatalogJson, Z as SKILL_PACK_FILE, Zt as resolveInsideRoot, _ as LlmToolSpec, _t as SkillsLockfile, a as InteractionOrigin, an as xmlRenderer, at as SkillDiscovery, b as RenderResultRequest, bt as UiSpecNode, c as InteractionResponse, ct as SkillIssue, d as LlmContentPart, dt as SkillManifest, en as stripArchiveRoot, et as SignatureVerdict, f as LlmMessage, ft as SkillMetadata, g as LlmToolCall, gt as SkillSource, h as LlmTokenUsage, ht as SkillSignature, i as FormField, in as verifySkillSignature, it as SkillCatalogEntry, j as ATOMIC_TMP_SUFFIX_PATTERN, jt as checkDependencyCycles, k as UiSurfaceActionResponse, kt as buildCatalog, l as LlmClient, lt as SkillLocation, m as LlmStreamEvent, mt as SkillReader, n as ArtifactStore, nn as validateSkills, nt as SkillArchiveShape, o as InteractionPolicy, ot as SkillDocument, p as LlmResponse, pt as SkillPackManifest, q as SKILLS_LOCKFILE, qt as readSkillSignature, r as ChartSpec, rn as verifyManifest, rt as SkillCatalog, s as InteractionRequest, st as SkillInstallSource, t as Artifact, tn as unzipWithLimits, tt as SkillArchiveDetection, u as LlmCompleteInput, ut as SkillManagerPort, v as MemoryStore, vt as TrustedKey, w as UiSpecDrafts, wt as WebSkillError, x as SkillCandidateMarker, xt as UnsignedPolicy, y as RenderBlock, yt as TrustedKeyStore, z as FsTrustedKeyStore, zt as isValidSkillName } from "./types-
|
|
2
|
-
import { $ as
|
|
1
|
+
import { $ as SignatureAuditSink, $t as signaturePayloadBytes, A as extractSkillCandidate, At as buildManifest, B as JsonSchema, Bt as jsonRenderer, C as UiSpecActionCapability, Ct as VerifyResult, D as UiSpecSnapshot, Dt as assertSafePathSegment, E as UiSpecPatch, Et as assertRemoteUrlAllowed, F as DEFAULT_ARCHIVE_LIMITS, Ft as detectSkillArchiveShapeFromFs, G as RemoteUrlPolicy, Gt as parseSkillPackManifest, H as MemoryFS, Ht as messageOf, I as DiscoveryResult, It as escapeXml, J as SKILL_MANIFEST_FILE, Jt as renderAvailableSkillsXml, K as SIGNATURE_SCHEMA_VERSION, Kt as readResponseWithLimit, L as FileStat, Lt as exportSkills, M as ArchiveLimits, Mt as checkSkillRules, N as CatalogRenderer, Nt as computeDigest, O as UiSurfaceActionRequest, Ot as atomicWriteText, P as CryptoKeyLike, Pt as detectSkillArchiveShape, Q as SKILL_SIGNATURE_FILE, Qt as signSkill, R as FileSystemProvider, Rt as isAtomicTempPath, S as UiBridge, St as ValidationReport, T as UiSpecEvent, Tt as WebSkillErrorCode, U as Page, Ut as normalizePath, V as MANIFEST_EXCLUDED_FILES, Vt as keyIdOf, W as PageQuery, Wt as parseSkillMarkdown, X as SKILL_NAME_PATTERN, Xt as resolveArchiveLimits, Y as SKILL_NAME_MAX_LENGTH, Yt as renderCatalogJson, Z as SKILL_PACK_FILE, Zt as resolveInsideRoot, _ as LlmToolSpec, _t as SkillsLockfile, a as InteractionOrigin, an as xmlRenderer, at as SkillDiscovery, b as RenderResultRequest, bt as UiSpecNode, c as InteractionResponse, ct as SkillIssue, d as LlmContentPart, dt as SkillManifest, en as stripArchiveRoot, et as SignatureVerdict, f as LlmMessage, ft as SkillMetadata, g as LlmToolCall, gt as SkillSource, h as LlmTokenUsage, ht as SkillSignature, i as FormField, in as verifySkillSignature, it as SkillCatalogEntry, j as ATOMIC_TMP_SUFFIX_PATTERN, jt as checkDependencyCycles, k as UiSurfaceActionResponse, kt as buildCatalog, l as LlmClient, lt as SkillLocation, m as LlmStreamEvent, mt as SkillReader, n as ArtifactStore, nn as validateSkills, nt as SkillArchiveShape, o as InteractionPolicy, ot as SkillDocument, p as LlmResponse, pt as SkillPackManifest, q as SKILLS_LOCKFILE, qt as readSkillSignature, r as ChartSpec, rn as verifyManifest, rt as SkillCatalog, s as InteractionRequest, st as SkillInstallSource, t as Artifact, tn as unzipWithLimits, tt as SkillArchiveDetection, u as LlmCompleteInput, ut as SkillManagerPort, v as MemoryStore, vt as TrustedKey, w as UiSpecDrafts, wt as WebSkillError, x as SkillCandidateMarker, xt as UnsignedPolicy, y as RenderBlock, yt as TrustedKeyStore, z as FsTrustedKeyStore, zt as isValidSkillName } from "./types-DLctJep_-B5G4uk2u.js";
|
|
2
|
+
import { $ as LifecycleHook, $n as fromVercelStreamPart, $t as SkillOutcomeReporter, A as DocxTextExtractor, An as UserProfileEntry, Ar as toRecordDigests, At as RunTraceStore, B as FsRunTraceStore, Bn as applyUserProfileImport, Bt as SchemaInferer, C as CapabilityApproval, Cn as USER_PROFILE_EXPORT_VERSION, Cr as schemaToForm, Ct as RunSnapshotListEntry, D as DEFAULT_MAX_DOCUMENT_BYTES, Dn as USER_PROFILE_REFINE_PROMPT, Dr as summarizeToolCalls, Dt as RunTraceFile, E as DEFAULT_MAX_DATA_SOURCE_BYTES, En as USER_PROFILE_PROMPT_HEADER, Er as summarizeRunUsage, Et as RunToolCall, F as ExternalToolSource, Fn as WebSkillApi, Ft as RuntimeSession, G as GoogleGenAiClientConfig, Gn as diffUserProfile, Gt as SealResult, H as FsToolStepStore, Hn as buildRenderResult, Ht as ScriptExecutor, I as FS_SESSION_PAGE_SIZE, In as WebSkillRuntime, It as RuntimeSessionHandle, J as InstalledSkillManifest, Jn as extractTodoTraceEvents, Jt as SessionMeta, K as HookRunner, Kn as exportUserProfile, Kt as SerializingMemoryStore, L as FsArtifactStore, Ln as WebSkillRuntimeDeps, Lt as SENSITIVE_ANNOTATION, M as EventBus, Mn as UserProfileImportDiff, Mr as validateUiSpecEvent, Mt as RunUsageSummary, N as ExecuteLifecycleData, Nn as UserProfileLimits, Nr as validateUiSpecNode, Nt as RuntimePhase, O as DEFAULT_MAX_DOCUMENT_TEXT_BYTES, On as UnsupportedRunSnapshot, Or as textParts, Ot as RunTraceFilter, P as ExternalSkillProvider, Pn as VercelToolSpec, Pt as RuntimeRun, Q as LifecycleEventInit, Qn as fromVercelResult, Qt as SkillIntegrityGuard, R as FsMemoryStore, Rn as XlsxTextExtractor, Rt as SESSION_SCHEMA_VERSION, S as BridgeResponse, Sn as UNSUPPORTED_DOCUMENT_MESSAGE, Sr as schemaSourceLabel, St as RunSnapshot, T as DEFAULT_LOOP_LIMITS, Tn as USER_PROFILE_NO_INVENTION_RULE, Tr as sealToolCallPairs, Tt as RunTerminationReason, U as FullDisclosureRouter, Un as createScriptContext, Ut as SealOptions, V as FsSessionStore, Vn as bridgeError, Vt as ScriptExecutionContext, W as GoogleGenAiClient, Wn as createWebSkillApi, Wt as SealRecord, X as InteractLifecycleData, Xn as findUnpairedToolCalls, Xt as SessionStore, Y as IntegrityVerdict, Yn as extractUiSpecEvents, Yt as SessionRecord, Z as LifecycleEvent, Zn as formatSkillScriptManifest, Zt as SkillFailureReport, _ as BehaviorRecordKind, _n as ToolStepTrust, _r as redactToolStepArgs, _t as RefineUserProfileInput, a as ASK_USER_TOOL, an as TEXT_BUDGETED_CONTENT_TYPES, ar as mergeProfileEntries, at as OpenAiCompatibleClient, b as BridgeCapability, bn as TraceEventType, br as resolveToolName, bt as RunLimitErrorDetails, c as AgentLoop, cn as TodoTraceEvent, cr as normalizeErrorCode, ct as ProgressiveRouter, d as AnthropicClient, dn as ToolDisclosure, dr as parseBridgeRequest, dt as READ_SKILL_FILE_INPUT_SCHEMA, en as SkillRouter, er as interruptedToolResult, et as LifecycleHookContext, f as AnthropicClientConfig, fn as ToolResolution, fr as parseUserProfileExport, ft as READ_SKILL_FILE_TOOL, g as BehaviorRecord, gn as ToolStepStore, gr as readUserProfile, gt as RedactedArgs, h as BEHAVIOR_RECORDS_KEY, hn as ToolStepRecord, hr as readProfileEntries, ht as RUN_TRACE_SCHEMA_VERSION, i as ASK_USER_MAX_FIELDS, in as SkillSuccessReport, ir as mergeCatalogEntries, it as NetworkPolicy, j as EMPTY_USER_PROFILE, jn as UserProfileExport, jr as toVercelToolSpecs, jt as RunTraceSummary, k as DEFAULT_USER_PROFILE_LIMITS, kn as UserProfile, kr as toLlmToolSpec, kt as RunTraceMetrics, l as AgentLoopConfig, ln as ToolContent, lr as normalizeToolContent, lt as READ_LINKED_DOCUMENT_TOOL, m as ApprovalScope, mn as ToolStepReader, mr as readBehaviorRecords, mt as RUN_SNAPSHOT_SCHEMA_VERSION, n as ASK_USER_FIELD_TYPES, nn as SkillScriptSchemaSource, nr as isUnsupportedRunSnapshot, nt as LinkedDocumentReader, o as ASK_USER_TOOL_NAME, on as TerminalLifecycleData, or as networkPolicyLibSource, ot as OpenAiCompatibleClientConfig, p as ApprovalDecision, pn as ToolResult, pr as partsToText, pt as READ_SKILL_FILE_TOOL_NAME, q as HookRunnerOptions, qn as extractChartSpec, qt as SessionListPage, r as ASK_USER_INPUT_SCHEMA, rn as SkillStateGuard, rr as listSkillScripts, rt as MAX_TOOL_STEP_ARG_BYTES, s as ActivateLifecycleData, sn as TextualToolContent, sr as networkUrlHost, st as PdfTextExtractor, t as ALLOWED_TOOLS_EXCLUSION_REASON, tn as SkillScriptDescriptor, tr as isNetworkAllowed, tt as LifecycleListener, u as AgentLoopDeps, un as ToolDefinition, ur as normalizeToolError, ut as READ_LINKED_DOCUMENT_TOOL_NAME, v as BehaviorScene, vn as TraceClock, vr as refineUserProfile, vt as RouteLifecycleData, w as CapabilityMode, wn as USER_PROFILE_KEY, wr as scriptToolName, wt as RunSnapshotStore, x as BridgeRequest, xn as TraceRecorder, xr as sampleBehaviorRecords, xt as RunResult, y as BridgeCapabilities, yn as TraceEvent, yr as renderUserProfileContext, yt as RouteResult, z as FsRunSnapshotStore, zn as appendBehaviorRecords, zt as SUPPORTED_DOCUMENT_MIME } from "./index-DkvBhJQy.js";
|
|
3
3
|
//#region src/version.d.ts
|
|
4
4
|
/** Generated by scripts/syncVersionConstant.mjs from packages/sdk/package.json. Do not edit by hand. */
|
|
5
5
|
/**
|
|
6
6
|
* Version of the published `@webskill/sdk` package, injected at build time.
|
|
7
7
|
* @stable
|
|
8
8
|
*/
|
|
9
|
-
declare const SDK_VERSION = "0.
|
|
9
|
+
declare const SDK_VERSION = "0.13.0";
|
|
10
10
|
//#endregion
|
|
11
|
-
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_FIELD_TYPES, ASK_USER_INPUT_SCHEMA, ASK_USER_MAX_FIELDS, ASK_USER_TOOL, ASK_USER_TOOL_NAME, ATOMIC_TMP_SUFFIX_PATTERN, type ActivateLifecycleData, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, AnthropicClient, type AnthropicClientConfig, type ApprovalDecision, type ApprovalScope, type ArchiveLimits, type Artifact, type ArtifactStore, BEHAVIOR_RECORDS_KEY, type BehaviorRecord, type BehaviorRecordKind, type BehaviorScene, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type ChartSpec, type CryptoKeyLike, DEFAULT_ARCHIVE_LIMITS, DEFAULT_LOOP_LIMITS, DEFAULT_MAX_DATA_SOURCE_BYTES, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_DOCUMENT_TEXT_BYTES, DEFAULT_USER_PROFILE_LIMITS, type DiscoveryResult, type DocxTextExtractor, EMPTY_USER_PROFILE, EventBus, type ExecuteLifecycleData, type ExternalSkillProvider, type ExternalToolSource, FS_SESSION_PAGE_SIZE, type FileStat, type FileSystemProvider, type FormField, 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 LinkedDocumentReader, type LlmClient, type LlmCompleteInput, type LlmContentPart, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmTokenUsage, type LlmToolCall, type LlmToolSpec, MANIFEST_EXCLUDED_FILES, MemoryFS, type MemoryStore, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, type Page, type PageQuery, ProgressiveRouter, READ_LINKED_DOCUMENT_TOOL, READ_LINKED_DOCUMENT_TOOL_NAME, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, type RefineUserProfileInput, type RemoteUrlPolicy, type RenderBlock, type RenderResultRequest, type RouteLifecycleData, type RouteResult, type RunLimitErrorDetails, type RunResult, type RunSnapshot, type RunSnapshotListEntry, type RunSnapshotStore, type RunTerminationReason, type RunToolCall, type RunTraceFile, type RunTraceFilter, type RunTraceMetrics, type RunTraceStore, type RunTraceSummary, type RunUsageSummary, type RuntimePhase, type RuntimeRun, type RuntimeSession, type RuntimeSessionHandle, SDK_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, SUPPORTED_DOCUMENT_MIME, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, type SealOptions, type SealRecord, type SealResult, SerializingMemoryStore, type SessionListPage, type SessionMeta, type SessionRecord, type SessionStore, type SignatureAuditSink, type SignatureVerdict, type SkillArchiveDetection, type SkillArchiveShape, type SkillCandidateMarker, 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 SkillScriptDescriptor, type SkillScriptSchemaSource, type SkillSignature, type SkillSource, type SkillStateGuard, type SkillSuccessReport, type SkillsLockfile, TEXT_BUDGETED_CONTENT_TYPES, type TerminalLifecycleData, type TextualToolContent, type TodoTraceEvent, type ToolContent, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type TrustedKey, type TrustedKeyStore, UNSUPPORTED_DOCUMENT_MESSAGE, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, type UiBridge, type UiSpecActionCapability, type UiSpecDrafts, type UiSpecEvent, type UiSpecNode, type UiSpecPatch, type UiSpecSnapshot, type UiSurfaceActionRequest, type UiSurfaceActionResponse, type UnsignedPolicy, type UnsupportedRunSnapshot, type UserProfile, type UserProfileEntry, type UserProfileExport, type UserProfileImportDiff, type UserProfileLimits, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, interruptedToolResult, isAtomicTempPath, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeRunUsage, summarizeToolCalls, textParts, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
|
11
|
+
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_FIELD_TYPES, ASK_USER_INPUT_SCHEMA, ASK_USER_MAX_FIELDS, ASK_USER_TOOL, ASK_USER_TOOL_NAME, ATOMIC_TMP_SUFFIX_PATTERN, type ActivateLifecycleData, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, AnthropicClient, type AnthropicClientConfig, type ApprovalDecision, type ApprovalScope, type ArchiveLimits, type Artifact, type ArtifactStore, BEHAVIOR_RECORDS_KEY, type BehaviorRecord, type BehaviorRecordKind, type BehaviorScene, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type ChartSpec, type CryptoKeyLike, DEFAULT_ARCHIVE_LIMITS, DEFAULT_LOOP_LIMITS, DEFAULT_MAX_DATA_SOURCE_BYTES, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_DOCUMENT_TEXT_BYTES, DEFAULT_USER_PROFILE_LIMITS, type DiscoveryResult, type DocxTextExtractor, EMPTY_USER_PROFILE, EventBus, type ExecuteLifecycleData, type ExternalSkillProvider, type ExternalToolSource, FS_SESSION_PAGE_SIZE, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsToolStepStore, 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 LinkedDocumentReader, type LlmClient, type LlmCompleteInput, type LlmContentPart, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmTokenUsage, type LlmToolCall, type LlmToolSpec, MANIFEST_EXCLUDED_FILES, MAX_TOOL_STEP_ARG_BYTES, MemoryFS, type MemoryStore, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, type Page, type PageQuery, type PdfTextExtractor, ProgressiveRouter, READ_LINKED_DOCUMENT_TOOL, READ_LINKED_DOCUMENT_TOOL_NAME, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, type RedactedArgs, type RefineUserProfileInput, type RemoteUrlPolicy, type RenderBlock, type RenderResultRequest, type RouteLifecycleData, type RouteResult, type RunLimitErrorDetails, type RunResult, type RunSnapshot, type RunSnapshotListEntry, type RunSnapshotStore, type RunTerminationReason, type RunToolCall, type RunTraceFile, type RunTraceFilter, type RunTraceMetrics, type RunTraceStore, type RunTraceSummary, type RunUsageSummary, type RuntimePhase, type RuntimeRun, type RuntimeSession, type RuntimeSessionHandle, SDK_VERSION, SENSITIVE_ANNOTATION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SUPPORTED_DOCUMENT_MIME, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, type SealOptions, type SealRecord, type SealResult, SerializingMemoryStore, type SessionListPage, type SessionMeta, type SessionRecord, type SessionStore, type SignatureAuditSink, type SignatureVerdict, type SkillArchiveDetection, type SkillArchiveShape, type SkillCandidateMarker, 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 SkillScriptDescriptor, type SkillScriptSchemaSource, type SkillSignature, type SkillSource, type SkillStateGuard, type SkillSuccessReport, type SkillsLockfile, TEXT_BUDGETED_CONTENT_TYPES, type TerminalLifecycleData, type TextualToolContent, type TodoTraceEvent, type ToolContent, type ToolDefinition, type ToolDisclosure, type ToolResolution, type ToolResult, type ToolStepReader, type ToolStepRecord, type ToolStepStore, type ToolStepTrust, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type TrustedKey, type TrustedKeyStore, UNSUPPORTED_DOCUMENT_MESSAGE, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, type UiBridge, type UiSpecActionCapability, type UiSpecDrafts, type UiSpecEvent, type UiSpecNode, type UiSpecPatch, type UiSpecSnapshot, type UiSurfaceActionRequest, type UiSurfaceActionResponse, type UnsignedPolicy, type UnsupportedRunSnapshot, type UserProfile, type UserProfileEntry, type UserProfileExport, type UserProfileImportDiff, type UserProfileLimits, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, type XlsxTextExtractor, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, interruptedToolResult, isAtomicTempPath, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, redactToolStepArgs, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeRunUsage, summarizeToolCalls, textParts, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as jsonRenderer, B as resolveArchiveLimits, C as computeDigest, D as exportSkills, E as escapeXml, F as parseSkillPackManifest, G as unzipWithLimits, H as signSkill, I as readResponseWithLimit, J as verifySkillSignature, K as validateSkills, L as readSkillSignature, M as messageOf, N as normalizePath, O as isAtomicTempPath, P as parseSkillMarkdown, R as renderAvailableSkillsXml, S as checkSkillRules, T as detectSkillArchiveShapeFromFs, U as signaturePayloadBytes, V as resolveInsideRoot, W as stripArchiveRoot, Y as xmlRenderer, _ as assertSafePathSegment, a as MemoryFS, b as buildManifest, c as SKILL_MANIFEST_FILE, d as SKILL_PACK_FILE, f as SKILL_SIGNATURE_FILE, g as assertRemoteUrlAllowed, h as WebSkillError, i as MANIFEST_EXCLUDED_FILES, j as keyIdOf, k as isValidSkillName, l as SKILL_NAME_MAX_LENGTH, m as SkillReader, n as DEFAULT_ARCHIVE_LIMITS, o as SIGNATURE_SCHEMA_VERSION, p as SkillDiscovery, q as verifyManifest, r as FsTrustedKeyStore, s as SKILLS_LOCKFILE, t as ATOMIC_TMP_SUFFIX_PATTERN, u as SKILL_NAME_PATTERN, v as atomicWriteText, w as detectSkillArchiveShape, x as checkDependencyCycles, y as buildCatalog, z as renderCatalogJson } from "./dist-Bev6i6Ip.js";
|
|
2
2
|
import { a as textParts, n as partsToText } from "./memoryArtifactStore-52Zn9npI-LbCQaqyx.js";
|
|
3
|
-
import { $ as
|
|
3
|
+
import { $ as bridgeError, A as ProgressiveRouter, At as refineUserProfile, B as SUPPORTED_DOCUMENT_MIME, Bt as toLlmToolSpec, C as FsSessionStore, Ct as normalizeToolError, D as HookRunner, Dt as readProfileEntries, E as GoogleGenAiClient, Et as readBehaviorRecords, F as READ_SKILL_FILE_TOOL_NAME, Ft as schemaToForm, G as USER_PROFILE_EXPORT_VERSION, H as TEXT_BUDGETED_CONTENT_TYPES, Ht as toVercelToolSpecs, I as RUN_SNAPSHOT_SCHEMA_VERSION, It as scriptToolName, J as USER_PROFILE_PROMPT_HEADER, K as USER_PROFILE_KEY, L as RUN_TRACE_SCHEMA_VERSION, Lt as sealToolCallPairs, M as READ_LINKED_DOCUMENT_TOOL_NAME, Mt as resolveToolName, N as READ_SKILL_FILE_INPUT_SCHEMA, Nt as sampleBehaviorRecords, O as MAX_TOOL_STEP_ARG_BYTES, Ot as readUserProfile, P as READ_SKILL_FILE_TOOL, Pt as schemaSourceLabel, Q as applyUserProfileImport, R as SENSITIVE_ANNOTATION, Rt as summarizeRunUsage, S as FsRunTraceStore, St as normalizeToolContent, T as FullDisclosureRouter, Tt as parseUserProfileExport, U as TraceRecorder, Ut as validateUiSpecEvent, V as SerializingMemoryStore, Vt as toRecordDigests, W as UNSUPPORTED_DOCUMENT_MESSAGE, Wt as validateUiSpecNode, X as WebSkillRuntime, Y as USER_PROFILE_REFINE_PROMPT, Z as appendBehaviorRecords, _ as EventBus, _t as mergeCatalogEntries, a as ASK_USER_TOOL, at as extractChartSpec, b as FsMemoryStore, bt as networkUrlHost, c as AnthropicClient, ct as extractUiSpecEvents, d as DEFAULT_LOOP_LIMITS, dt as fromVercelResult, et as buildRenderResult, f as DEFAULT_MAX_DATA_SOURCE_BYTES, ft as fromVercelStreamPart, g as EMPTY_USER_PROFILE, gt as listSkillScripts, h as DEFAULT_USER_PROFILE_LIMITS, ht as isUnsupportedRunSnapshot, i as ASK_USER_MAX_FIELDS, it as exportUserProfile, j as READ_LINKED_DOCUMENT_TOOL, jt as renderUserProfileContext, k as OpenAiCompatibleClient, kt as redactToolStepArgs, l as BEHAVIOR_RECORDS_KEY, lt as findUnpairedToolCalls, m as DEFAULT_MAX_DOCUMENT_TEXT_BYTES, mt as isNetworkAllowed, n as ASK_USER_FIELD_TYPES, nt as createWebSkillApi, o as ASK_USER_TOOL_NAME, ot as extractSkillCandidate, p as DEFAULT_MAX_DOCUMENT_BYTES, pt as interruptedToolResult, q as USER_PROFILE_NO_INVENTION_RULE, r as ASK_USER_INPUT_SCHEMA, rt as diffUserProfile, s as AgentLoop, st as extractTodoTraceEvents, t as ALLOWED_TOOLS_EXCLUSION_REASON, tt as createScriptContext, u as CapabilityApproval, ut as formatSkillScriptManifest, v as FS_SESSION_PAGE_SIZE, vt as mergeProfileEntries, w as FsToolStepStore, wt as parseBridgeRequest, x as FsRunSnapshotStore, xt as normalizeErrorCode, y as FsArtifactStore, yt as networkPolicyLibSource, z as SESSION_SCHEMA_VERSION, zt as summarizeToolCalls } from "./dist-ExSQky4C.js";
|
|
4
4
|
|
|
5
5
|
//#region src/version.ts
|
|
6
6
|
/** Generated by scripts/syncVersionConstant.mjs from packages/sdk/package.json. Do not edit by hand. */
|
|
@@ -8,7 +8,7 @@ import { $ as createWebSkillApi, A as READ_LINKED_DOCUMENT_TOOL_NAME, At as sche
|
|
|
8
8
|
* Version of the published `@webskill/sdk` package, injected at build time.
|
|
9
9
|
* @stable
|
|
10
10
|
*/
|
|
11
|
-
const SDK_VERSION = "0.
|
|
11
|
+
const SDK_VERSION = "0.13.0";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
|
-
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_FIELD_TYPES, ASK_USER_INPUT_SCHEMA, ASK_USER_MAX_FIELDS, ASK_USER_TOOL, ASK_USER_TOOL_NAME, ATOMIC_TMP_SUFFIX_PATTERN, AgentLoop, AnthropicClient, BEHAVIOR_RECORDS_KEY, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, DEFAULT_LOOP_LIMITS, DEFAULT_MAX_DATA_SOURCE_BYTES, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_DOCUMENT_TEXT_BYTES, DEFAULT_USER_PROFILE_LIMITS, EMPTY_USER_PROFILE, EventBus, FS_SESSION_PAGE_SIZE, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, MANIFEST_EXCLUDED_FILES, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_LINKED_DOCUMENT_TOOL, READ_LINKED_DOCUMENT_TOOL_NAME, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, SDK_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, SUPPORTED_DOCUMENT_MIME, SerializingMemoryStore, SkillDiscovery, SkillReader, TEXT_BUDGETED_CONTENT_TYPES, TraceRecorder, UNSUPPORTED_DOCUMENT_MESSAGE, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, WebSkillError, WebSkillRuntime, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, interruptedToolResult, isAtomicTempPath, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeRunUsage, summarizeToolCalls, textParts, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
|
14
|
+
export { ALLOWED_TOOLS_EXCLUSION_REASON, ASK_USER_FIELD_TYPES, ASK_USER_INPUT_SCHEMA, ASK_USER_MAX_FIELDS, ASK_USER_TOOL, ASK_USER_TOOL_NAME, ATOMIC_TMP_SUFFIX_PATTERN, AgentLoop, AnthropicClient, BEHAVIOR_RECORDS_KEY, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, DEFAULT_LOOP_LIMITS, DEFAULT_MAX_DATA_SOURCE_BYTES, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_DOCUMENT_TEXT_BYTES, DEFAULT_USER_PROFILE_LIMITS, EMPTY_USER_PROFILE, EventBus, FS_SESSION_PAGE_SIZE, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsToolStepStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, MANIFEST_EXCLUDED_FILES, MAX_TOOL_STEP_ARG_BYTES, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_LINKED_DOCUMENT_TOOL, READ_LINKED_DOCUMENT_TOOL_NAME, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, SDK_VERSION, SENSITIVE_ANNOTATION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SUPPORTED_DOCUMENT_MIME, SerializingMemoryStore, SkillDiscovery, SkillReader, TEXT_BUDGETED_CONTENT_TYPES, TraceRecorder, UNSUPPORTED_DOCUMENT_MESSAGE, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, WebSkillError, WebSkillRuntime, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatSkillScriptManifest, fromVercelResult, fromVercelStreamPart, interruptedToolResult, isAtomicTempPath, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, listSkillScripts, mergeCatalogEntries, mergeProfileEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, parseUserProfileExport, partsToText, readBehaviorRecords, readProfileEntries, readResponseWithLimit, readSkillSignature, readUserProfile, redactToolStepArgs, refineUserProfile, renderAvailableSkillsXml, renderCatalogJson, renderUserProfileContext, resolveArchiveLimits, resolveInsideRoot, resolveToolName, sampleBehaviorRecords, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeRunUsage, summarizeToolCalls, textParts, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as JsonSchema, _ as LlmToolSpec, it as SkillCatalogEntry, ot as SkillDocument } from "./types-
|
|
2
|
-
import { F as ExternalToolSource, P as ExternalSkillProvider,
|
|
1
|
+
import { B as JsonSchema, _ as LlmToolSpec, it as SkillCatalogEntry, ot as SkillDocument } from "./types-DLctJep_-B5G4uk2u.js";
|
|
2
|
+
import { F as ExternalToolSource, P as ExternalSkillProvider, dn as ToolDisclosure, ir as mergeCatalogEntries, pn as ToolResult } from "./index-DkvBhJQy.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";
|
|
@@ -288,6 +288,13 @@ declare class ExperimentalWebMcpAdapter {
|
|
|
288
288
|
}
|
|
289
289
|
//#endregion
|
|
290
290
|
//#region src/plugin/mcpRuntimePlugin.d.ts
|
|
291
|
+
/**
|
|
292
|
+
* 披露层级(分册 19)。与 runtime 的 `ToolDisclosure` 同义,保留 mcp 侧命名以便宿主按包对齐。
|
|
293
|
+
*
|
|
294
|
+
* 它与启停(`McpToolVisibility` 的三个 boolean 回调)作用面不同:
|
|
295
|
+
* 禁用同时管暴露与调用,`on-demand` **只管暴露**——没被点名的按需工具照样调得动。
|
|
296
|
+
*/
|
|
297
|
+
type McpToolDisclosure = ToolDisclosure;
|
|
291
298
|
/**
|
|
292
299
|
* 工具可见性策略(0.10.0 UI-UX5 #50.3):端点禁用 ∨ 工具禁用 ⇒ 不进 LLM tool spec,
|
|
293
300
|
* 调用侧同样拦截(模型找不到这些工具)。各判定缺省视为启用。
|
|
@@ -304,6 +311,28 @@ interface McpToolVisibility {
|
|
|
304
311
|
* 宿主按来源关 → 该组全灭;按工具关 → 只灭一个。
|
|
305
312
|
*/
|
|
306
313
|
isWebMcpToolEnabled?(tool: string, sourceId?: string): boolean;
|
|
314
|
+
/**
|
|
315
|
+
* 端点级披露层级(分册 19 / FR-19.1);该端点全部工具的默认值。
|
|
316
|
+
* 返回 `undefined` = 不表态(最终落到 `always`)。
|
|
317
|
+
*/
|
|
318
|
+
endpointDisclosure?(endpoint: string): McpToolDisclosure | undefined;
|
|
319
|
+
/** 端点工具级披露层级;返回 `undefined` 才继承端点级(就近覆盖) */
|
|
320
|
+
endpointToolDisclosure?(endpoint: string, tool: string): McpToolDisclosure | undefined;
|
|
321
|
+
/** WebMCP 工具级披露层级;`sourceId` 为空即未命名来源 */
|
|
322
|
+
webMcpToolDisclosure?(tool: string, sourceId?: string): McpToolDisclosure | undefined;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* 参数留存的宿主侧信任声明(分册 30 / FR-30.6)。
|
|
326
|
+
*
|
|
327
|
+
* 声明只吃 endpoint / sourceId 这两个**宿主配置里的标识**,
|
|
328
|
+
* 不读工具 schema、不读工具描述、不读服务器元数据——服务器自称可信不算数。
|
|
329
|
+
* 缺省不信任;信任只影响脱敏判定,不影响可见性与审批。
|
|
330
|
+
*/
|
|
331
|
+
interface McpSourceTrust {
|
|
332
|
+
/** 宿主声明「这台端点的工具 schema 我审查过」 */
|
|
333
|
+
isEndpointTrusted?(endpoint: string): boolean;
|
|
334
|
+
/** WebMCP 来源同款;`sourceId` 为空即未命名的那一个 */
|
|
335
|
+
isWebMcpSourceTrusted?(sourceId: string | undefined): boolean;
|
|
307
336
|
}
|
|
308
337
|
/**
|
|
309
338
|
* runtime 扩展点实现:endpoint 注册表 + WebMCP adapter 一处装配。
|
|
@@ -318,11 +347,26 @@ declare class McpRuntimePlugin implements ExternalToolSource {
|
|
|
318
347
|
resolver?: McpToolResolver;
|
|
319
348
|
/** 工具可见性策略(端点/工具级启停);缺省全部可见 */
|
|
320
349
|
visibility?: McpToolVisibility;
|
|
350
|
+
/** 参数留存的信任声明(分册 30);**缺省不信任** */
|
|
351
|
+
trust?: McpSourceTrust;
|
|
321
352
|
/** 已知的 endpoint 名(注销后仍按 MCP_ENDPOINT_UNAVAILABLE 响应,而非 TOOL_NOT_FOUND) */
|
|
322
353
|
endpoints?: string[];
|
|
323
354
|
/** endpoint 不可用时的告警出口(默认 console.warn) */
|
|
324
355
|
onWarning?(message: string): void;
|
|
325
356
|
});
|
|
357
|
+
/**
|
|
358
|
+
* 工具的披露层级(分册 19 / FR-19.2)。本方法只**如实回答层级**,不做过滤——
|
|
359
|
+
* 「有没有技能点名」是 run 状态,mcp 包看不到,过滤发生在 agentLoop 的暴露点。
|
|
360
|
+
*/
|
|
361
|
+
disclosure(llmToolName: string): McpToolDisclosure;
|
|
362
|
+
/**
|
|
363
|
+
* 参数留存的信任判定(分册 30 / FR-30.6)。
|
|
364
|
+
* 只按宿主配置里的 endpoint / sourceId 判,服务器传回的内容进不了这条路径。
|
|
365
|
+
*/
|
|
366
|
+
argCaptureTrust(llmToolName: string): {
|
|
367
|
+
tier: 'host-trusted';
|
|
368
|
+
declaredBy?: string;
|
|
369
|
+
} | undefined;
|
|
326
370
|
listToolSpecs(): Promise<LlmToolSpec[]>;
|
|
327
371
|
canHandle(llmToolName: string): boolean;
|
|
328
372
|
call(llmToolName: string, args: Record<string, unknown>): Promise<ToolResult>;
|
|
@@ -471,4 +515,4 @@ interface RemoteEndpointHandle {
|
|
|
471
515
|
*/
|
|
472
516
|
declare function connectRemoteEndpoint(registry: EndpointRegistry<McpClientLike>, config: RemoteEndpointConfig): Promise<RemoteEndpointHandle>;
|
|
473
517
|
//#endregion
|
|
474
|
-
export { type BrowserModelContextLike, EndpointRegistry, ExperimentalWebMcpAdapter, type McpClientLike, type McpOAuthClient, type McpOAuthConfig, type McpOAuthHandshake, type McpOAuthHandshakeStore, type McpOAuthProvider, type McpOAuthStage, type McpOAuthTokenStore, type McpOAuthTokens, McpRuntimePlugin, McpToolResolver, type McpToolVisibility, MessageChannelTransport, type MessageChannelTransportOptions, type MessagePortLike, type RemoteEndpointConfig, type RemoteEndpointHandle, type ServedSkill, TemporarySkillProvider, type TransportState, WEB_MCP_SOURCE_ID_MAX, type WebMcpToolDescriptor, type WebMcpToolLike, catalogMerge, connectRemoteEndpoint, createMemoryOAuthStores, createOAuthProvider, endpointToolLlmName, parseEndpointToolLlmName, parseWebMcpToolLlmName, serveSkillAsMcp, validateJsonRpcMessage, webMcpToolLlmName };
|
|
518
|
+
export { type BrowserModelContextLike, EndpointRegistry, ExperimentalWebMcpAdapter, type McpClientLike, type McpOAuthClient, type McpOAuthConfig, type McpOAuthHandshake, type McpOAuthHandshakeStore, type McpOAuthProvider, type McpOAuthStage, type McpOAuthTokenStore, type McpOAuthTokens, McpRuntimePlugin, type McpSourceTrust, type McpToolDisclosure, McpToolResolver, type McpToolVisibility, MessageChannelTransport, type MessageChannelTransportOptions, type MessagePortLike, type RemoteEndpointConfig, type RemoteEndpointHandle, type ServedSkill, TemporarySkillProvider, type TransportState, WEB_MCP_SOURCE_ID_MAX, type WebMcpToolDescriptor, type WebMcpToolLike, catalogMerge, connectRemoteEndpoint, createMemoryOAuthStores, createOAuthProvider, endpointToolLlmName, parseEndpointToolLlmName, parseWebMcpToolLlmName, serveSkillAsMcp, validateJsonRpcMessage, webMcpToolLlmName };
|
package/dist/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { M as messageOf, g as assertRemoteUrlAllowed, h as WebSkillError } from "./dist-Bev6i6Ip.js";
|
|
2
|
-
import {
|
|
2
|
+
import { St as normalizeToolContent, _t as mergeCatalogEntries } from "./dist-ExSQky4C.js";
|
|
3
3
|
|
|
4
4
|
//#region ../mcp/dist/index.js
|
|
5
5
|
/**
|
|
@@ -311,6 +311,15 @@ const textOfContent = (content) => {
|
|
|
311
311
|
return "";
|
|
312
312
|
};
|
|
313
313
|
/**
|
|
314
|
+
* 端点不提供 prompts 等于「没有临时技能」,不是加载失败。
|
|
315
|
+
* 两条路径都要认:客户端本地能力断言,以及服务端回的 JSON-RPC -32601。
|
|
316
|
+
*/
|
|
317
|
+
const isPromptsUnsupported = (e) => {
|
|
318
|
+
if (typeof e !== "object" || e === null) return false;
|
|
319
|
+
if (e.code === -32601) return true;
|
|
320
|
+
return /does not support prompts/i.test(messageOf(e));
|
|
321
|
+
};
|
|
322
|
+
/**
|
|
314
323
|
* 消费端:endpoint 的 prompts → 临时技能(source:'mcp',随 endpoint 生灭);
|
|
315
324
|
* resources → 可读 references(readFile 的 path 即 resource URI)。
|
|
316
325
|
*/
|
|
@@ -329,7 +338,10 @@ var TemporarySkillProvider = class {
|
|
|
329
338
|
} catch {
|
|
330
339
|
return [];
|
|
331
340
|
}
|
|
332
|
-
const { prompts } = await client.listPrompts()
|
|
341
|
+
const { prompts } = await client.listPrompts().catch((e) => {
|
|
342
|
+
if (isPromptsUnsupported(e)) return { prompts: [] };
|
|
343
|
+
throw e;
|
|
344
|
+
});
|
|
333
345
|
const resources = await client.listResources().catch(() => ({ resources: [] }));
|
|
334
346
|
return prompts.map((p) => ({
|
|
335
347
|
name: p.name,
|
|
@@ -580,6 +592,7 @@ var McpRuntimePlugin = class {
|
|
|
580
592
|
*/
|
|
581
593
|
#webMcp;
|
|
582
594
|
#visibility;
|
|
595
|
+
#trust;
|
|
583
596
|
#configuredEndpoints;
|
|
584
597
|
#onWarning;
|
|
585
598
|
constructor(deps) {
|
|
@@ -587,6 +600,7 @@ var McpRuntimePlugin = class {
|
|
|
587
600
|
this.#resolver = deps.resolver ?? new McpToolResolver(deps.registry);
|
|
588
601
|
this.#webMcp = deps.webMcp ?? [];
|
|
589
602
|
this.#visibility = deps.visibility;
|
|
603
|
+
this.#trust = deps.trust;
|
|
590
604
|
this.#configuredEndpoints = deps.endpoints ?? [];
|
|
591
605
|
this.#onWarning = deps.onWarning ?? ((message) => console.warn(message));
|
|
592
606
|
}
|
|
@@ -610,6 +624,69 @@ var McpRuntimePlugin = class {
|
|
|
610
624
|
return true;
|
|
611
625
|
}
|
|
612
626
|
}
|
|
627
|
+
/**
|
|
628
|
+
* 信任回调统一求值。**刻意不复用 `#visible()`**:两者的失败代价不对称。
|
|
629
|
+
* 可见性判不出来最坏是工具从列表里消失;信任判不出来而放行,落盘的就是明文。
|
|
630
|
+
* 因此这里缺省 false、异常也按 false,并同样走 onWarning。
|
|
631
|
+
*/
|
|
632
|
+
#trusted(probe) {
|
|
633
|
+
try {
|
|
634
|
+
return probe() === true;
|
|
635
|
+
} catch (e) {
|
|
636
|
+
this.#onWarning(`[webskill] MCP trust callback failed; treating the source as untrusted: ${e instanceof Error ? e.message : String(e)}`);
|
|
637
|
+
return false;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* 披露层级求值。**刻意不复用 `#visible()`**:那个的返回值同时喂给 `listToolSpecs` 与 `call`,
|
|
642
|
+
* 合并会让按需工具被 `disabledResult()` 拦住——把「只省 token」变成「限制访问」。
|
|
643
|
+
*
|
|
644
|
+
* 返回 `undefined` = 该级不表态,交由上一级决定;异常直接按 `always` 定案(不再回落),
|
|
645
|
+
* 判不出来时多给一个工具,比整轮工具集塌陷、模型转而幻觉的代价小。
|
|
646
|
+
*/
|
|
647
|
+
#disclosureOf(probe) {
|
|
648
|
+
try {
|
|
649
|
+
return probe();
|
|
650
|
+
} catch (e) {
|
|
651
|
+
this.#onWarning(`[webskill] MCP disclosure callback failed; treating the tool as always disclosed: ${e instanceof Error ? e.message : String(e)}`);
|
|
652
|
+
return "always";
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* 工具的披露层级(分册 19 / FR-19.2)。本方法只**如实回答层级**,不做过滤——
|
|
657
|
+
* 「有没有技能点名」是 run 状态,mcp 包看不到,过滤发生在 agentLoop 的暴露点。
|
|
658
|
+
*/
|
|
659
|
+
disclosure(llmToolName) {
|
|
660
|
+
const parsed = parseWebMcpToolLlmName(llmToolName, this.#sourceIds());
|
|
661
|
+
if (parsed !== void 0) return this.#disclosureOf(() => this.#visibility?.webMcpToolDisclosure?.(parsed.toolName, parsed.sourceId)) ?? "always";
|
|
662
|
+
for (const endpoint of this.#endpoints()) {
|
|
663
|
+
const toolName = parseEndpointToolLlmName(endpoint, llmToolName);
|
|
664
|
+
if (toolName === void 0) continue;
|
|
665
|
+
return this.#disclosureOf(() => this.#visibility?.endpointToolDisclosure?.(endpoint, toolName)) ?? this.#disclosureOf(() => this.#visibility?.endpointDisclosure?.(endpoint)) ?? "always";
|
|
666
|
+
}
|
|
667
|
+
return "always";
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* 参数留存的信任判定(分册 30 / FR-30.6)。
|
|
671
|
+
* 只按宿主配置里的 endpoint / sourceId 判,服务器传回的内容进不了这条路径。
|
|
672
|
+
*/
|
|
673
|
+
argCaptureTrust(llmToolName) {
|
|
674
|
+
const parsed = parseWebMcpToolLlmName(llmToolName, this.#sourceIds());
|
|
675
|
+
if (parsed !== void 0) {
|
|
676
|
+
if (!this.#trusted(() => this.#trust?.isWebMcpSourceTrusted?.(parsed.sourceId))) return void 0;
|
|
677
|
+
return {
|
|
678
|
+
tier: "host-trusted",
|
|
679
|
+
declaredBy: `webmcp:${parsed.sourceId ?? ""}`
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
const endpoint = this.#endpoints().find((name) => parseEndpointToolLlmName(name, llmToolName) !== void 0);
|
|
683
|
+
if (endpoint === void 0) return void 0;
|
|
684
|
+
if (!this.#trusted(() => this.#trust?.isEndpointTrusted?.(endpoint))) return void 0;
|
|
685
|
+
return {
|
|
686
|
+
tier: "host-trusted",
|
|
687
|
+
declaredBy: endpoint
|
|
688
|
+
};
|
|
689
|
+
}
|
|
613
690
|
async listToolSpecs() {
|
|
614
691
|
const specs = [];
|
|
615
692
|
for (const endpoint of this.#endpoints()) {
|
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as SignatureAuditSink, B as JsonSchema, Ct as VerifyResult, J as SKILL_MANIFEST_FILE, L as FileStat, M as ArchiveLimits, R as FileSystemProvider, S as UiBridge, _t as SkillsLockfile, b as RenderResultRequest, c as InteractionResponse, dt as SkillManifest, q as SKILLS_LOCKFILE, s as InteractionRequest, st as SkillInstallSource, ut as SkillManagerPort, xt as UnsignedPolicy, yt as TrustedKeyStore } from "./types-
|
|
2
|
-
import {
|
|
3
|
-
import { a as AuditLog, b as SkillVersionStore, d as CandidateSkill, m as CandidateStore, r as ApprovalPolicy } from "./skillVersionStore-D-qHk9ZE-
|
|
1
|
+
import { $ as SignatureAuditSink, B as JsonSchema, Ct as VerifyResult, J as SKILL_MANIFEST_FILE, L as FileStat, M as ArchiveLimits, R as FileSystemProvider, S as UiBridge, _t as SkillsLockfile, b as RenderResultRequest, c as InteractionResponse, dt as SkillManifest, q as SKILLS_LOCKFILE, s as InteractionRequest, st as SkillInstallSource, ut as SkillManagerPort, xt as UnsignedPolicy, yt as TrustedKeyStore } from "./types-DLctJep_-B5G4uk2u.js";
|
|
2
|
+
import { Bt as SchemaInferer, Ht as ScriptExecutor, In as WebSkillRuntime, L as FsArtifactStore, Ln as WebSkillRuntimeDeps, R as FsMemoryStore, Un as createScriptContext, Vt as ScriptExecutionContext, it as NetworkPolicy, m as ApprovalScope, pn as ToolResult, un as ToolDefinition, y as BridgeCapabilities } from "./index-DkvBhJQy.js";
|
|
3
|
+
import { a as AuditLog, b as SkillVersionStore, d as CandidateSkill, m as CandidateStore, r as ApprovalPolicy } from "./skillVersionStore-D-qHk9ZE-DheTIwAB.js";
|
|
4
4
|
import { n as LlmEnvConfig, s as probeLlmCapabilities, t as LlmCapabilities } from "./env-AK3cSMEA-Dli6QU5E.js";
|
|
5
5
|
import { Readable, Writable } from "node:stream";
|
|
6
6
|
//#region ../node/dist/index.d.ts
|