@webskill/sdk 0.12.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 +28 -5
- package/dist/browser.js +624 -74
- package/dist/{catalogComponents-BgAJN0p8-C3K8klJd.js → catalogComponents-BgAJN0p8-CYEXSk45.js} +346 -12
- package/dist/{dist-sdKFgERo.js → dist-ExSQky4C.js} +324 -30
- package/dist/{dist-DU9KDAuR.js → dist-GK6dtjRv.js} +29 -4
- package/dist/governance.d.ts +1 -1
- package/dist/{index-3fCHc1mQ.d.ts → index-C3XdItd_.d.ts} +1 -1
- package/dist/{index-C9pzXLKy.d.ts → index-DkvBhJQy.d.ts} +40 -3
- package/dist/{index-DFhU1uks.d.ts → index-iBm9tJL_.d.ts} +60 -15
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/mcp.d.ts +23 -2
- package/dist/mcp.js +43 -2
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/{openUiLibrary-BKXW7Iwx-DaymVubt.js → openUiLibrary-BKXW7Iwx-CWWBVOkE.js} +1 -1
- package/dist/ui-react.d.ts +1 -1
- package/dist/ui-react.js +11 -9
- package/dist/ui.d.ts +2 -2
- package/dist/ui.js +1 -1
- package/package.json +2 -1
|
@@ -557,7 +557,13 @@ type TraceEventType = 'skill.routed' | 'skill.activated' | 'skill.integrity-fail
|
|
|
557
557
|
/** 一轮模型调用产出的一段思考正文(data.text;每轮至多一条,UI-UX5 #32) */
|
|
558
558
|
'llm.thinking' |
|
|
559
559
|
/** 一轮模型调用的 token 用量(data.inputTokens/outputTokens;上游不回报则无此事件,UI-UX5 #47) */
|
|
560
|
-
'llm.usage' | 'tool.started' | 'tool.completed' | 'tool.failed' | 'tool.denied' |
|
|
560
|
+
'llm.usage' | 'tool.started' | 'tool.completed' | 'tool.failed' | 'tool.denied' |
|
|
561
|
+
/**
|
|
562
|
+
* 按需披露的工具本轮未被任何已激活技能点名,因此没写进 tool spec(分册 19)。
|
|
563
|
+
* **不是拒绝**:它照样调得动。与 `tool.denied` 分开是因为排查方向相反——
|
|
564
|
+
* `denied` 指向「技能清单写错了」,`withheld` 指向「该激活的技能还没激活」。
|
|
565
|
+
*/
|
|
566
|
+
'tool.withheld' | 'artifact.created' | 'ui.requested' | 'ui.resumed' | 'ui.surface-action.requested' | 'ui.surface-action.resolved' | 'ui.rendered' | 'ui.degraded' | 'todo.created' | 'todo.updated' | 'todo.cleared' | 'run.warning' | 'run.completed' | 'run.cancelled' | 'run.failed' | 'run.resumed';
|
|
561
567
|
interface TraceEvent {
|
|
562
568
|
id: string;
|
|
563
569
|
runId: string;
|
|
@@ -1313,15 +1319,24 @@ declare const READ_LINKED_DOCUMENT_TOOL_NAME = "read_linked_document";
|
|
|
1313
1319
|
declare const SUPPORTED_DOCUMENT_MIME: {
|
|
1314
1320
|
readonly pdf: "application/pdf";
|
|
1315
1321
|
readonly docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
1322
|
+
readonly xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
1316
1323
|
};
|
|
1317
1324
|
/** docx 抽取实现由宿主注入(`DOMParser` 是浏览器 API,Node 没有;备案 D55) */
|
|
1318
1325
|
type DocxTextExtractor = (bytes: Uint8Array) => Promise<string>;
|
|
1326
|
+
/** xlsx 抽取实现由宿主注入(0.13.0 FR-12.5;限制与 docx 相同) */
|
|
1327
|
+
type XlsxTextExtractor = (bytes: Uint8Array) => Promise<string>;
|
|
1328
|
+
/**
|
|
1329
|
+
* PDF → 文本(0.13.0 FR-22.1)。**只用于直传被端点拒后的回退**,
|
|
1330
|
+
* 不改变 PDF 默认直传的路径。SDK 不带实现:正确取到文本层要处理
|
|
1331
|
+
* xref / 对象流 / FlateDecode / ToUnicode CMap,自写即 AGENTS.md §6 禁止的手写协议解析器。
|
|
1332
|
+
*/
|
|
1333
|
+
type PdfTextExtractor = (bytes: Uint8Array) => Promise<string>;
|
|
1319
1334
|
/** 引擎侧固定流程(§2.3)用到的错误文案,集中一处便于判据引用 */
|
|
1320
1335
|
declare const UNSUPPORTED_DOCUMENT_MESSAGE: string;
|
|
1321
1336
|
/**
|
|
1322
1337
|
* 内建工具:读页面链接指向的文档。
|
|
1323
1338
|
*
|
|
1324
|
-
* **始终注册**(只要宿主装配了 reader):docx 与纯文本这条路对所有模型成立。
|
|
1339
|
+
* **始终注册**(只要宿主装配了 reader):docx / xlsx 与纯文本这条路对所有模型成立。
|
|
1325
1340
|
* PDF 目标在模型不支持文档时**取数后拒绝**,而不是入口就拦 ——
|
|
1326
1341
|
* 入口拦会误伤 docx,它抽成文本后根本不需要文档能力。
|
|
1327
1342
|
*/
|
|
@@ -1392,6 +1407,11 @@ declare class FsToolStepStore implements ToolStepStore {
|
|
|
1392
1407
|
}
|
|
1393
1408
|
//#endregion
|
|
1394
1409
|
//#region src/engine/external.d.ts
|
|
1410
|
+
/**
|
|
1411
|
+
* 工具披露层级(分册 19)。`on-demand` 只影响工具写不写进 LLM tool spec,
|
|
1412
|
+
* **不影响可执行性**——要限制访问的宿主应当使用禁用(各来源自己的 enabled 通道)。
|
|
1413
|
+
*/
|
|
1414
|
+
type ToolDisclosure = 'always' | 'on-demand';
|
|
1395
1415
|
/**
|
|
1396
1416
|
* 外部工具来源(runtime 扩展点,mcp 包实现并插入)。
|
|
1397
1417
|
* LLM 可见名为已消毒名(如 endpoint__greet / mcp__search)。
|
|
@@ -1399,6 +1419,13 @@ declare class FsToolStepStore implements ToolStepStore {
|
|
|
1399
1419
|
interface ExternalToolSource {
|
|
1400
1420
|
readonly kind: string;
|
|
1401
1421
|
listToolSpecs(): Promise<LlmToolSpec[]>;
|
|
1422
|
+
/**
|
|
1423
|
+
* 该工具的披露层级(分册 19 / FR-19.2)。**不实现 ⇒ 该源全部工具按 `always`**(存量来源行为不变)。
|
|
1424
|
+
*
|
|
1425
|
+
* 每轮实时求值,不写进 `LlmToolSpec` 字段:spec 只在 run 起点与 resume 各收集一次,
|
|
1426
|
+
* 凝固进 spec 会让宿主中途改配置整轮不生效。
|
|
1427
|
+
*/
|
|
1428
|
+
disclosure?(llmToolName: string): ToolDisclosure;
|
|
1402
1429
|
/**
|
|
1403
1430
|
* 可选:向 run 的 system 消息追加一段说明(组件 catalog 之类的大段规格)。
|
|
1404
1431
|
*
|
|
@@ -1561,6 +1588,12 @@ interface AgentLoopDeps {
|
|
|
1561
1588
|
linkedDocuments?: LinkedDocumentReader;
|
|
1562
1589
|
/** docx → 文本;`DOMParser` 是浏览器 API,因此由宿主注入(Node 侧无此能力,备案 D55) */
|
|
1563
1590
|
docxExtractor?: DocxTextExtractor;
|
|
1591
|
+
xlsxExtractor?: XlsxTextExtractor;
|
|
1592
|
+
/**
|
|
1593
|
+
* PDF → 文本(FR-22.1)。**只在直传被端点拒后用作回退**,不改变 PDF 默认直传。
|
|
1594
|
+
* 不注入即没有回退能力,失败照报——与 docx / xlsx「不注入即没这个能力」同款。
|
|
1595
|
+
*/
|
|
1596
|
+
pdfExtractor?: PdfTextExtractor;
|
|
1564
1597
|
/** 文档读取留痕出口(FR-22.6);不注入即不留痕,装配方要自己承担这个选择 */
|
|
1565
1598
|
documentAudit?: {
|
|
1566
1599
|
append(event: {
|
|
@@ -1741,6 +1774,10 @@ interface WebSkillRuntimeDeps {
|
|
|
1741
1774
|
linkedDocuments?: LinkedDocumentReader;
|
|
1742
1775
|
/** docx → 文本;不注入即 Word 文档明确报「本环境不支持」(FR-23.8) */
|
|
1743
1776
|
docxExtractor?: DocxTextExtractor;
|
|
1777
|
+
/** xlsx → 文本;不注入即 Excel 工作簿明确报「本环境不支持」(FR-12.5) */
|
|
1778
|
+
xlsxExtractor?: XlsxTextExtractor;
|
|
1779
|
+
/** PDF → 文本;**只在直传被端点拒后做回退**,不注入即没有回退能力(FR-22.1) */
|
|
1780
|
+
pdfExtractor?: PdfTextExtractor;
|
|
1744
1781
|
/** 文档读取留痕出口(FR-22.6) */
|
|
1745
1782
|
documentAudit?: {
|
|
1746
1783
|
append(event: {
|
|
@@ -2111,4 +2148,4 @@ interface RedactedArgs {
|
|
|
2111
2148
|
*/
|
|
2112
2149
|
declare function redactToolStepArgs(args: Record<string, unknown>, schema: JsonSchema | undefined, trust: ToolStepTrust): RedactedArgs;
|
|
2113
2150
|
//#endregion
|
|
2114
|
-
export { LifecycleHook as $,
|
|
2151
|
+
export { LifecycleHook as $, fromVercelStreamPart as $n, SkillOutcomeReporter as $t, DocxTextExtractor as A, UserProfileEntry as An, toRecordDigests as Ar, RunTraceStore as At, FsRunTraceStore as B, applyUserProfileImport as Bn, SchemaInferer as Bt, CapabilityApproval as C, USER_PROFILE_EXPORT_VERSION as Cn, schemaToForm as Cr, RunSnapshotListEntry as Ct, DEFAULT_MAX_DOCUMENT_BYTES as D, USER_PROFILE_REFINE_PROMPT as Dn, summarizeToolCalls as Dr, RunTraceFile as Dt, DEFAULT_MAX_DATA_SOURCE_BYTES as E, USER_PROFILE_PROMPT_HEADER as En, summarizeRunUsage as Er, RunToolCall as Et, ExternalToolSource as F, WebSkillApi as Fn, RuntimeSession as Ft, GoogleGenAiClientConfig as G, diffUserProfile as Gn, SealResult as Gt, FsToolStepStore as H, buildRenderResult as Hn, ScriptExecutor as Ht, FS_SESSION_PAGE_SIZE as I, WebSkillRuntime as In, RuntimeSessionHandle as It, InstalledSkillManifest as J, extractTodoTraceEvents as Jn, SessionMeta as Jt, HookRunner as K, exportUserProfile as Kn, SerializingMemoryStore as Kt, FsArtifactStore as L, WebSkillRuntimeDeps as Ln, SENSITIVE_ANNOTATION as Lt, EventBus as M, UserProfileImportDiff as Mn, validateUiSpecEvent as Mr, RunUsageSummary as Mt, ExecuteLifecycleData as N, UserProfileLimits as Nn, validateUiSpecNode as Nr, RuntimePhase as Nt, DEFAULT_MAX_DOCUMENT_TEXT_BYTES as O, UnsupportedRunSnapshot as On, textParts as Or, RunTraceFilter as Ot, ExternalSkillProvider as P, VercelToolSpec as Pn, RuntimeRun as Pt, LifecycleEventInit as Q, fromVercelResult as Qn, SkillIntegrityGuard as Qt, FsMemoryStore as R, XlsxTextExtractor as Rn, SESSION_SCHEMA_VERSION as Rt, BridgeResponse as S, UNSUPPORTED_DOCUMENT_MESSAGE as Sn, schemaSourceLabel as Sr, RunSnapshot as St, DEFAULT_LOOP_LIMITS as T, USER_PROFILE_NO_INVENTION_RULE as Tn, sealToolCallPairs as Tr, RunTerminationReason as Tt, FullDisclosureRouter as U, createScriptContext as Un, SealOptions as Ut, FsSessionStore as V, bridgeError as Vn, ScriptExecutionContext as Vt, GoogleGenAiClient as W, createWebSkillApi as Wn, SealRecord as Wt, InteractLifecycleData as X, findUnpairedToolCalls as Xn, SessionStore as Xt, IntegrityVerdict as Y, extractUiSpecEvents as Yn, SessionRecord as Yt, LifecycleEvent as Z, formatSkillScriptManifest as Zn, SkillFailureReport as Zt, BehaviorRecordKind as _, ToolStepTrust as _n, redactToolStepArgs as _r, RefineUserProfileInput as _t, ASK_USER_TOOL as a, TEXT_BUDGETED_CONTENT_TYPES as an, mergeProfileEntries as ar, OpenAiCompatibleClient as at, BridgeCapability as b, TraceEventType as bn, resolveToolName as br, RunLimitErrorDetails as bt, AgentLoop as c, TodoTraceEvent as cn, normalizeErrorCode as cr, ProgressiveRouter as ct, AnthropicClient as d, ToolDisclosure as dn, parseBridgeRequest as dr, READ_SKILL_FILE_INPUT_SCHEMA as dt, SkillRouter as en, interruptedToolResult as er, LifecycleHookContext as et, AnthropicClientConfig as f, ToolResolution as fn, parseUserProfileExport as fr, READ_SKILL_FILE_TOOL as ft, BehaviorRecord as g, ToolStepStore as gn, readUserProfile as gr, RedactedArgs as gt, BEHAVIOR_RECORDS_KEY as h, ToolStepRecord as hn, readProfileEntries as hr, RUN_TRACE_SCHEMA_VERSION as ht, ASK_USER_MAX_FIELDS as i, SkillSuccessReport as in, mergeCatalogEntries as ir, NetworkPolicy as it, EMPTY_USER_PROFILE as j, UserProfileExport as jn, toVercelToolSpecs as jr, RunTraceSummary as jt, DEFAULT_USER_PROFILE_LIMITS as k, UserProfile as kn, toLlmToolSpec as kr, RunTraceMetrics as kt, AgentLoopConfig as l, ToolContent as ln, normalizeToolContent as lr, READ_LINKED_DOCUMENT_TOOL as lt, ApprovalScope as m, ToolStepReader as mn, readBehaviorRecords as mr, RUN_SNAPSHOT_SCHEMA_VERSION as mt, ASK_USER_FIELD_TYPES as n, SkillScriptSchemaSource as nn, isUnsupportedRunSnapshot as nr, LinkedDocumentReader as nt, ASK_USER_TOOL_NAME as o, TerminalLifecycleData as on, networkPolicyLibSource as or, OpenAiCompatibleClientConfig as ot, ApprovalDecision as p, ToolResult as pn, partsToText as pr, READ_SKILL_FILE_TOOL_NAME as pt, HookRunnerOptions as q, extractChartSpec as qn, SessionListPage as qt, ASK_USER_INPUT_SCHEMA as r, SkillStateGuard as rn, listSkillScripts as rr, MAX_TOOL_STEP_ARG_BYTES as rt, ActivateLifecycleData as s, TextualToolContent as sn, networkUrlHost as sr, PdfTextExtractor as st, ALLOWED_TOOLS_EXCLUSION_REASON as t, SkillScriptDescriptor as tn, isNetworkAllowed as tr, LifecycleListener as tt, AgentLoopDeps as u, ToolDefinition as un, normalizeToolError as ur, READ_LINKED_DOCUMENT_TOOL_NAME as ut, BehaviorScene as v, TraceClock as vn, refineUserProfile as vr, RouteLifecycleData as vt, CapabilityMode as w, USER_PROFILE_KEY as wn, scriptToolName as wr, RunSnapshotStore as wt, BridgeRequest as x, TraceRecorder as xn, sampleBehaviorRecords as xr, RunResult as xt, BridgeCapabilities as y, TraceEvent as yn, renderUserProfileContext as yr, RouteResult as yt, FsRunSnapshotStore as z, appendBehaviorRecords as zn, SUPPORTED_DOCUMENT_MIME as zt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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,
|
|
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) */
|
|
@@ -341,16 +341,19 @@ interface PerceptionScope {
|
|
|
341
341
|
exclude?: readonly string[];
|
|
342
342
|
}
|
|
343
343
|
/**
|
|
344
|
-
* 一个帧内的可感知范围(FR-24.1)。
|
|
344
|
+
* 一个帧内的可感知范围(FR-24.1 / 分册 18 FR-18.1)。
|
|
345
345
|
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
346
|
+
* 嵌套帧写**自外向内的选择器数组**:第 1 项在主文档里求值,
|
|
347
|
+
* 第 n+1 项在第 n 项解析出的文档里求值。逐层写出来是有意的——
|
|
348
|
+
* 授权面覆盖了哪几层,配置里要能一眼看出来,不允许靠自动发现下钻。
|
|
349
349
|
* @experimental
|
|
350
350
|
*/
|
|
351
351
|
interface FrameScope {
|
|
352
|
-
/**
|
|
353
|
-
|
|
352
|
+
/**
|
|
353
|
+
* 主文档写 `'self'`;单层 iframe 写主文档里定位该 `<iframe>` 的选择器;
|
|
354
|
+
* 多层嵌套写逐层选择器数组(空数组等价于 `'self'`)。
|
|
355
|
+
*/
|
|
356
|
+
frame: 'self' | string | readonly string[];
|
|
354
357
|
include: readonly string[];
|
|
355
358
|
exclude?: readonly string[];
|
|
356
359
|
}
|
|
@@ -373,6 +376,7 @@ type PerceptionScopeInput = PerceptionScope | {
|
|
|
373
376
|
declare function toFrameScopes(scope: PerceptionScopeInput): readonly FrameScope[];
|
|
374
377
|
/** 某个帧未能读取的原因(FR-24.2 / FR-24.3);不静默跳过 @experimental */
|
|
375
378
|
interface FrameNote {
|
|
379
|
+
/** 帧路径的展示串(`frameLabel` 的产出,分册 18 FR-18.2) */
|
|
376
380
|
frame: string;
|
|
377
381
|
reason: 'cross-origin' | 'origin-changed' | 'not-found';
|
|
378
382
|
/** 面向模型的英文说明,同时也是说明节点的 name */
|
|
@@ -403,13 +407,16 @@ interface PerceivedNode {
|
|
|
403
407
|
imageNote?: string;
|
|
404
408
|
/**
|
|
405
409
|
* 不透明元素句柄(S10)。**仅当该节点可被操作时出现**:
|
|
406
|
-
*
|
|
407
|
-
*
|
|
410
|
+
* 它落在宿主声明的操作范围内、且是可交互角色。由 reader 生成,模型不得构造或推断。
|
|
411
|
+
*
|
|
412
|
+
* **跨感知保留,直到元素离开文档**(分册 18 FR-18.5)。它不是安全边界——
|
|
413
|
+
* 「页面变了不能点到别的东西」由执行前的实时校验承担,不由句柄寿命承担。
|
|
408
414
|
*/
|
|
409
415
|
ref?: string;
|
|
410
416
|
/**
|
|
411
|
-
* 该节点来自哪个帧(FR-24.4
|
|
412
|
-
*
|
|
417
|
+
* 该节点来自哪个帧(FR-24.4),取值是帧路径的展示串(`frameLabel`)。
|
|
418
|
+
* **主文档节点不带这个字段**——否则旧宿主的断言会凭空变化。
|
|
419
|
+
* 跨帧后会出现同名控件,不标帧模型会点错。
|
|
413
420
|
*/
|
|
414
421
|
frame?: string;
|
|
415
422
|
/**
|
|
@@ -447,6 +454,11 @@ interface PerceptionCaptureOptions {
|
|
|
447
454
|
images: boolean;
|
|
448
455
|
maxImageBytes: number;
|
|
449
456
|
maxImages: number;
|
|
457
|
+
/**
|
|
458
|
+
* 小于该面积(平方像素)的元素视作图标,不占取像名额(0.13.0 FR-20.3)。
|
|
459
|
+
* 可选是为了不破坏既有 reader 实现;缺省与 0 都表示不过滤。
|
|
460
|
+
*/
|
|
461
|
+
minImageArea?: number;
|
|
450
462
|
}
|
|
451
463
|
/**
|
|
452
464
|
* reader 的完整产物。只实现文本的 reader 可以继续返回节点数组。
|
|
@@ -568,6 +580,8 @@ interface ImageCaptureBudget {
|
|
|
568
580
|
enabled: boolean;
|
|
569
581
|
maxImageBytes: number;
|
|
570
582
|
maxImages: number;
|
|
583
|
+
/** 小于该面积(平方像素)的元素视作图标;缺省与 0 都表示不过滤(0.13.0 FR-20.3) */
|
|
584
|
+
minImageArea?: number;
|
|
571
585
|
}
|
|
572
586
|
/**
|
|
573
587
|
* 把只读感知接到既有工具协议上。**本工具源不导出任何写入动作**(FR-10.7):
|
|
@@ -579,6 +593,25 @@ interface ImageCaptureBudget {
|
|
|
579
593
|
*/
|
|
580
594
|
declare function createPagePerceptionToolSource(options: PagePerceptionToolSourceOptions): ExternalToolSource;
|
|
581
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
|
|
582
615
|
//#region src/prompts/perception.d.ts
|
|
583
616
|
/**
|
|
584
617
|
* 页面只读感知的策略提示词(设计 09 §1)。
|
|
@@ -704,15 +737,18 @@ interface PageActionScope {
|
|
|
704
737
|
exclude?: readonly string[];
|
|
705
738
|
}
|
|
706
739
|
/**
|
|
707
|
-
* 一个帧内的可操作范围(FR-24.1)。
|
|
740
|
+
* 一个帧内的可操作范围(FR-24.1 / 分册 18 FR-18.1)。
|
|
708
741
|
*
|
|
709
742
|
* 与感知侧的 `FrameScope` 同构但**独立声明**,理由同上:合并成一个类型会让
|
|
710
743
|
* 「一份配置同时当感知范围和操作范围用」在类型层面合法。
|
|
711
744
|
* @experimental
|
|
712
745
|
*/
|
|
713
746
|
interface ActionFrameScope {
|
|
714
|
-
/**
|
|
715
|
-
|
|
747
|
+
/**
|
|
748
|
+
* 主文档写 `'self'`;单层 iframe 写主文档里定位该 `<iframe>` 的选择器;
|
|
749
|
+
* 多层嵌套写逐层选择器数组(空数组等价于 `'self'`)。
|
|
750
|
+
*/
|
|
751
|
+
frame: 'self' | string | readonly string[];
|
|
716
752
|
include: readonly string[];
|
|
717
753
|
exclude?: readonly string[];
|
|
718
754
|
}
|
|
@@ -770,6 +806,15 @@ interface PageActionOutcome {
|
|
|
770
806
|
noop?: boolean;
|
|
771
807
|
/** 本次操作新打开的模态的可访问名;授权面临时扩大要在留痕里看得见(FR-25.6) */
|
|
772
808
|
elevatedModal?: string;
|
|
809
|
+
/**
|
|
810
|
+
* 本次操作后目标所在帧的地址变了(帧内跳转 / SPA 路由,分册 18 FR-18.6)。
|
|
811
|
+
* 没变时**不带**该字段:带个 `false` 会让旧宿主的断言凭空变化。
|
|
812
|
+
*
|
|
813
|
+
* 真正的跨文档导航会销毁执行上下文,那种情况拿不到本字段——固有限制,不假装。
|
|
814
|
+
*/
|
|
815
|
+
navigated?: boolean;
|
|
816
|
+
/** 变更后的地址;仅 `navigated` 时带 */
|
|
817
|
+
documentUrl?: string;
|
|
773
818
|
/** 失败原因(英文) */
|
|
774
819
|
reason?: string;
|
|
775
820
|
}
|
|
@@ -896,4 +941,4 @@ declare function createPageActionToolSource(options: PageActionToolSourceOptions
|
|
|
896
941
|
*/
|
|
897
942
|
declare const PAGE_ACTION_SYSTEM_PROMPT: string;
|
|
898
943
|
//#endregion
|
|
899
|
-
export { PerceptionScope as $, PageActionKind as A, PageActionUi as B, MANAGE_TODO_TOOL as C, createPageActionToolSource as Ct, PERCEIVE_PAGE_TOOL as D,
|
|
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
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
|
|
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, 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, 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 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, 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 };
|
|
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 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-
|
|
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 bridgeError, A as ProgressiveRouter, At as refineUserProfile, B as
|
|
|
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
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
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
|
|
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,15 @@ 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;
|
|
307
323
|
}
|
|
308
324
|
/**
|
|
309
325
|
* 参数留存的宿主侧信任声明(分册 30 / FR-30.6)。
|
|
@@ -338,6 +354,11 @@ declare class McpRuntimePlugin implements ExternalToolSource {
|
|
|
338
354
|
/** endpoint 不可用时的告警出口(默认 console.warn) */
|
|
339
355
|
onWarning?(message: string): void;
|
|
340
356
|
});
|
|
357
|
+
/**
|
|
358
|
+
* 工具的披露层级(分册 19 / FR-19.2)。本方法只**如实回答层级**,不做过滤——
|
|
359
|
+
* 「有没有技能点名」是 run 状态,mcp 包看不到,过滤发生在 agentLoop 的暴露点。
|
|
360
|
+
*/
|
|
361
|
+
disclosure(llmToolName: string): McpToolDisclosure;
|
|
341
362
|
/**
|
|
342
363
|
* 参数留存的信任判定(分册 30 / FR-30.6)。
|
|
343
364
|
* 只按宿主配置里的 endpoint / sourceId 判,服务器传回的内容进不了这条路径。
|
|
@@ -494,4 +515,4 @@ interface RemoteEndpointHandle {
|
|
|
494
515
|
*/
|
|
495
516
|
declare function connectRemoteEndpoint(registry: EndpointRegistry<McpClientLike>, config: RemoteEndpointConfig): Promise<RemoteEndpointHandle>;
|
|
496
517
|
//#endregion
|
|
497
|
-
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, 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 { St as normalizeToolContent, _t as mergeCatalogEntries } from "./dist-
|
|
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,
|
|
@@ -626,6 +638,35 @@ var McpRuntimePlugin = class {
|
|
|
626
638
|
}
|
|
627
639
|
}
|
|
628
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
|
+
/**
|
|
629
670
|
* 参数留存的信任判定(分册 30 / FR-30.6)。
|
|
630
671
|
* 只按宿主配置里的 endpoint / sourceId 判,服务器传回的内容进不了这条路径。
|
|
631
672
|
*/
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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 {
|
|
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
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";
|
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { B as resolveArchiveLimits, D as exportSkills, F as parseSkillPackManifest, G as unzipWithLimits, I as readResponseWithLimit, J as verifySkillSignature, K as validateSkills, L as readSkillSignature, M as messageOf, O as isAtomicTempPath, P as parseSkillMarkdown, V as resolveInsideRoot, _ as assertSafePathSegment, b as buildManifest, c as SKILL_MANIFEST_FILE, d as SKILL_PACK_FILE, g as assertRemoteUrlAllowed, h as WebSkillError, i as MANIFEST_EXCLUDED_FILES, k as isValidSkillName, q as verifyManifest, s as SKILLS_LOCKFILE, v as atomicWriteText } from "./dist-Bev6i6Ip.js";
|
|
2
|
-
import { $ as bridgeError, Ct as normalizeToolError, St as normalizeToolContent, X as WebSkillRuntime, b as FsMemoryStore, tt as createScriptContext, u as CapabilityApproval, wt as parseBridgeRequest, y as FsArtifactStore, yt as networkPolicyLibSource } from "./dist-
|
|
2
|
+
import { $ as bridgeError, Ct as normalizeToolError, St as normalizeToolContent, X as WebSkillRuntime, b as FsMemoryStore, tt as createScriptContext, u as CapabilityApproval, wt as parseBridgeRequest, y as FsArtifactStore, yt as networkPolicyLibSource } from "./dist-ExSQky4C.js";
|
|
3
3
|
import { i as probeLlmCapabilities } from "./env-8cY40DXB-CGnEVZby.js";
|
|
4
4
|
import { t as AUDIT_EVENT_TYPES } from "./eventTypes-FllCrX-Z-DNDeHWoG.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dt as uiCatalog } from "./dist-DqcL6jKO.js";
|
|
2
|
-
import { t as CatalogNode } from "./catalogComponents-BgAJN0p8-
|
|
2
|
+
import { t as CatalogNode } from "./catalogComponents-BgAJN0p8-CYEXSk45.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Component, Fragment, createContext, useCallback, useContext, useEffect, useInsertionEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/ui-react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as UiSpecActionCapability, D as UiSpecSnapshot, O as UiSurfaceActionRequest, S as UiBridge, T as UiSpecEvent, b as RenderResultRequest, bt as UiSpecNode, c as InteractionResponse, k as UiSurfaceActionResponse, s as InteractionRequest, w as UiSpecDrafts } from "./types-DLctJep_-B5G4uk2u.js";
|
|
2
|
-
import { J as SurfaceHostControlTexts, P as InteractionSpecLabels, q as SurfaceFormTexts, v as ChartFontSizes } from "./index-
|
|
2
|
+
import { J as SurfaceHostControlTexts, P as InteractionSpecLabels, q as SurfaceFormTexts, v as ChartFontSizes } from "./index-C3XdItd_.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import React$1, { ComponentType, ReactNode } from "react";
|
|
5
5
|
import "react/jsx-runtime";
|
package/dist/ui-react.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as __exportAll$1 } from "./rolldown-runtime-BOF7iYI8.js";
|
|
2
2
|
import { h as WebSkillError } from "./dist-Bev6i6Ip.js";
|
|
3
|
-
import { Ut as validateUiSpecEvent, Wt as validateUiSpecNode } from "./dist-
|
|
3
|
+
import { Ut as validateUiSpecEvent, Wt as validateUiSpecNode } from "./dist-ExSQky4C.js";
|
|
4
4
|
import { C as applySuggestion, Dt as uiCatalog, K as resolveColumnWidths, L as interactionToUiSpec, O as collectValues, Tt as shapeInteractionValue, V as normalizeColumnWidths, W as renderMiniChart, X as toOpenUiSpecLang, Y as toJsonRenderSpec, bt as renderMiniMarkdown, gt as chartSpecFromProps, vt as interactionToFormModel } from "./dist-DqcL6jKO.js";
|
|
5
|
-
import { A as useSurfaceForm, C as cardLayoutProps, D as surfaceThemeOf, E as str, F as DataTable, I as Markdown, L as Separator, M as useSurfaceHostControlTexts, N as Badge, O as useCatalogSurfaceForm, P as Button, S as SurfaceFormTextsProvider, T as paletteClass, _ as SpecTimeline, a as SpecAccordion, b as SurfaceFieldArray, c as SpecGauge, d as SpecImage, f as SpecKeyValue, g as SpecTabs, h as SpecSplit, i as EChart, j as useSurfaceFormTexts, k as useChartFontSizes, l as SpecGrid, m as SpecQuote, n as CatalogSurfaceProvider, o as SpecCallout, p as SpecProgress, r as ChartFontSizesProvider, s as SpecCarousel, u as SpecIcon, v as SurfaceButton, w as catalogComponentImpls, x as SurfaceFormButtons, y as SurfaceField } from "./catalogComponents-BgAJN0p8-
|
|
5
|
+
import { A as useSurfaceForm, C as cardLayoutProps, D as surfaceThemeOf, E as str, F as DataTable, I as Markdown, L as Separator, M as useSurfaceHostControlTexts, N as Badge, O as useCatalogSurfaceForm, P as Button, S as SurfaceFormTextsProvider, T as paletteClass, _ as SpecTimeline, a as SpecAccordion, b as SurfaceFieldArray, c as SpecGauge, d as SpecImage, f as SpecKeyValue, g as SpecTabs, h as SpecSplit, i as EChart, j as useSurfaceFormTexts, k as useChartFontSizes, l as SpecGrid, m as SpecQuote, n as CatalogSurfaceProvider, o as SpecCallout, p as SpecProgress, r as ChartFontSizesProvider, s as SpecCarousel, u as SpecIcon, v as SurfaceButton, w as catalogComponentImpls, x as SurfaceFormButtons, y as SurfaceField } from "./catalogComponents-BgAJN0p8-CYEXSk45.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import * as React$1 from "react";
|
|
8
8
|
import React, { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
@@ -6852,8 +6852,6 @@ function SurfaceDegradationNote({ degradations }) {
|
|
|
6852
6852
|
}
|
|
6853
6853
|
/** 容器宽度未测出(jsdom / 首帧)时的最小列宽兜底:与 SPEC_TABLE_MIN_COLUMN_WIDTH.desktop(8rem @16px)一致 */
|
|
6854
6854
|
const FALLBACK_MIN_COLUMN_PX = 128;
|
|
6855
|
-
/** ScrollArea 容器的左右边框合计宽度(视觉契约,测量可用宽时扣除) */
|
|
6856
|
-
const SCROLL_AREA_BORDER_RESERVE = 2;
|
|
6857
6855
|
/**
|
|
6858
6856
|
* catalog `Table` 节点的渲染实现:排序 / 分页 / 虚拟滚动。
|
|
6859
6857
|
* 这些是宿主侧的呈现能力,不进 catalog props——模型只声明 columns 与 rows。
|
|
@@ -6875,17 +6873,21 @@ function SpecTable({ columns, rows, label, columnWidths, onDegraded }) {
|
|
|
6875
6873
|
useEffect(() => {
|
|
6876
6874
|
const frame = frameRef.current;
|
|
6877
6875
|
if (!frame || typeof ResizeObserver === "undefined") return;
|
|
6876
|
+
const scroller = frame.querySelector("[data-webskill-data-table]");
|
|
6877
|
+
if (!scroller) return;
|
|
6878
6878
|
const measure = () => {
|
|
6879
6879
|
const th = frame.querySelector("th");
|
|
6880
6880
|
const probe = th === null ? NaN : Number.parseFloat(getComputedStyle(th).minWidth);
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6881
|
+
const available = Math.max(0, scroller.clientWidth);
|
|
6882
|
+
const minCol = Number.isFinite(probe) && probe > 0 ? probe : FALLBACK_MIN_COLUMN_PX;
|
|
6883
|
+
setMeasured((prev) => prev?.available === available && prev.minCol === minCol ? prev : {
|
|
6884
|
+
available,
|
|
6885
|
+
minCol
|
|
6884
6886
|
});
|
|
6885
6887
|
};
|
|
6886
6888
|
measure();
|
|
6887
6889
|
const observer = new ResizeObserver(measure);
|
|
6888
|
-
observer.observe(
|
|
6890
|
+
observer.observe(scroller);
|
|
6889
6891
|
return () => observer.disconnect();
|
|
6890
6892
|
}, []);
|
|
6891
6893
|
const table = useReactTable({
|
|
@@ -7505,7 +7507,7 @@ function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }) {
|
|
|
7505
7507
|
const [unavailable, setUnavailable] = useState(false);
|
|
7506
7508
|
useEffect(() => {
|
|
7507
7509
|
let cancelled = false;
|
|
7508
|
-
import("./openUiLibrary-BKXW7Iwx-
|
|
7510
|
+
import("./openUiLibrary-BKXW7Iwx-CWWBVOkE.js").then((loaded) => {
|
|
7509
7511
|
if (!cancelled) setModule(loaded);
|
|
7510
7512
|
}).catch(() => {
|
|
7511
7513
|
if (!cancelled) setUnavailable(true);
|