@webskill/sdk 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +4 -4
- package/dist/{approval-BnLLCOG0.js → approval-CBPnGPIm.js} +57 -4
- package/dist/browser.d.ts +79 -5
- package/dist/browser.js +166 -19
- package/dist/governance.d.ts +3 -3
- package/dist/{index-BLfnO7sz.d.ts → index-1sQZ4VBN.d.ts} +5 -5
- package/dist/{index-DbVqg2V3.d.ts → index-BDyXe-a5.d.ts} +1 -1
- package/dist/{index-DeXgdtHa.d.ts → index-CaLsVI-m.d.ts} +7 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/mcp.d.ts +2 -2
- package/dist/node.d.ts +3 -3
- package/dist/node.js +13 -7
- package/dist/{openUiLibrary-BWEBU9P-.js → openUiLibrary-BJtCG5B1.js} +1 -1
- package/dist/{openUiSpecLang-BIK6CWlW.js → openUiSpecLang-B4QQ9Tfo.js} +3 -2
- package/dist/{skillVersionStore-B24Jjjry-CsbzF7Oe.d.ts → skillVersionStore-B24Jjjry-v2CCU0Xo.d.ts} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{types-C3V6lAeO-BUpcRLER.d.ts → types-Btpdd1y--BcxQ10Fa.d.ts} +9 -3
- package/dist/ui-react.d.ts +3 -3
- package/dist/ui-react.js +2 -2
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/{webSkillApi-DOOyz2G5.js → webSkillApi-Ce2OO5S5.js} +1 -1
- package/dist/{webskillLitCatalog-poL1qhBp.js → webskillLitCatalog-BBkQjKuN.js} +1 -1
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { E as DEFAULT_MAX_DATA_SOURCE_BYTES } from "./index-
|
|
2
|
-
import { $ as NestedFrameRef, $t as TAB_WORKSET_MIN_MAX, A as DelegationRequest, An as withDelegationOrigin, At as PerceptionAuditSink, B as DownloadedFileReader, Bt as SkillGenerationMessages, C as DataSourcePolicyOptions, Cn as createSkillGenerationToolSource, Ct as PagePerceptionPolicy, D as DelegationBudget, Dn as frameSteps, Dt as ParentBudget, E as DataSourceTransport, En as frameLabel, Et as PagePerceptionToolSourceOptions, F as DownloadedFileEntry, Ft as PerceptionScope, G as FrameScope, Gt as SkillGeneratorOptions, H as DownloadedFileToolSourceOptions, Ht as SkillGenerationPolicy, I as DownloadedFileListing, It as PerceptionScopeInput, J as HttpDataSourceOptions, Jt as SubAgentRunInput, K as GENERATE_SKILL_TOOL, Kt as SkillTraceEvidence, L as DownloadedFilePolicy, Lt as READ_DOWNLOADED_FILE_TOOL, M as DelegationToolSourceOptions, Mt as PerceptionPagingBudget, N as DownloadedFileAction, Nt as PerceptionRecord, O as DelegationOrchestrator, On as toActionFrameScopes, Ot as PerceivedImage, P as DownloadedFileConsent, Pt as PerceptionResult, Q as MANAGE_TODO_TOOL, Qt as TAB_WORKSET_MAX_MAX, R as DownloadedFilePolicyOptions, Rt as SKILL_GENERATION_SYSTEM_PROMPT, S as DataSourcePolicy, Sn as createPagePerceptionToolSource, St as PageAuditSink, T as DataSourceRecord, Tn as createTodoToolSource, Tt as PagePerceptionReader, U as FOCUS_PAGE_TAB_TOOL, Ut as SkillGenerationToolSourceOptions, V as DownloadedFileRecord, Vt as SkillGenerationOutcome, W as FrameNote, Wt as SkillGenerator, X as LIST_DOWNLOADED_FILES_TOOL, Xt as SubtreeRejection, Y as ImageCaptureBudget, Yt as SubAgentRunner, Z as LIST_PAGE_TABS_TOOL, Zt as TAB_WORKSET_DEFAULT_MAX, _ as DataSourceCandidatePolicyOptions, _n as clampWorksetMax, _t as PageActionScope, a as ActionTabWindow, an as TabWorksetPort, at as PAGE_DOCUMENT_REF, b as DataSourceDef, bn as createHttpDataSourceTransport, bt as PageActionToolSourceOptions, c as DELEGATE_TASK_TOOL, cn as TodoItem, ct as PERCEPTION_SYSTEM_PROMPT, d as DOWNLOAD_WAIT_MAX_MS, dn as TodoStatus, dt as PageActionKind, en as TAB_WORKSET_SYSTEM_PROMPT, et as OpenedPageInfo, f as DOWNLOAD_WAIT_MIN_MS, fn as TodoStore, ft as PageActionOutcome, g as DataSourceCandidatePolicy, gn as clampDownloadWaitMs, gt as PageActionRequest, h as DataSourceCandidateAuditSink, hn as WorksetTabView, ht as PageActionRecord, i as ActionTabWatcher, in as TabWorksetPolicyOptions, it as PAGE_ACTION_TOOL, j as DelegationResult, jt as PerceptionCaptureOptions, k as DelegationOrchestratorOptions, kn as toFrameScopes, kt as PerceivedNode, l as DELEGATION_SYSTEM_PROMPT, ln as TodoList, lt as PageActionConsent, m as DataSourceCandidate, mn as WorksetTab, mt as PageActionPolicyOptions, n as ActionDownloadWindow, nn as TabAdmission, nt as PAGE_ACTION_KINDS, o as CLOSE_PAGE_TAB_TOOL, on as TabWorksetToolSourceOptions, ot as PERCEIVE_PAGE_TOOL, p as DataSourceAuditSink, pn as TodoToolSourceOptions, pt as PageActionPolicy, q as GeneratedSkillDraft, qt as SkillTraceEvidenceStep, r as ActionFrameScope, rn as TabWorksetPolicy, rt as PAGE_ACTION_SYSTEM_PROMPT, s as ConsentUi, sn as TodoEvent, st as PERCEPTION_PAGING_DEFAULTS, t as ActionDownloadWatcher, tn as TODO_SYSTEM_PROMPT, tt as OpenedTabSignal, u as DOWNLOAD_WAIT_DEFAULT_MS, un as TodoListener, ut as PageActionExecutor, v as DataSourceCandidateRecord, vn as createDelegationToolSource, vt as PageActionScopeInput, w as DataSourceProvenance, wn as createTabWorksetToolSource, wt as PagePerceptionPolicyOptions, x as DataSourceKind, xn as createPageActionToolSource, xt as PageActionUi, y as DataSourceCandidateStore, yn as createDownloadedFileToolSource, yt as PageActionTarget, z as DownloadedFileReadResult, zt as SkillCandidateSink } from "./index-
|
|
1
|
+
import { E as DEFAULT_MAX_DATA_SOURCE_BYTES } from "./index-BDyXe-a5.js";
|
|
2
|
+
import { $ as NestedFrameRef, $t as TAB_WORKSET_MIN_MAX, A as DelegationRequest, An as withDelegationOrigin, At as PerceptionAuditSink, B as DownloadedFileReader, Bt as SkillGenerationMessages, C as DataSourcePolicyOptions, Cn as createSkillGenerationToolSource, Ct as PagePerceptionPolicy, D as DelegationBudget, Dn as frameSteps, Dt as ParentBudget, E as DataSourceTransport, En as frameLabel, Et as PagePerceptionToolSourceOptions, F as DownloadedFileEntry, Ft as PerceptionScope, G as FrameScope, Gt as SkillGeneratorOptions, H as DownloadedFileToolSourceOptions, Ht as SkillGenerationPolicy, I as DownloadedFileListing, It as PerceptionScopeInput, J as HttpDataSourceOptions, Jt as SubAgentRunInput, K as GENERATE_SKILL_TOOL, Kt as SkillTraceEvidence, L as DownloadedFilePolicy, Lt as READ_DOWNLOADED_FILE_TOOL, M as DelegationToolSourceOptions, Mt as PerceptionPagingBudget, N as DownloadedFileAction, Nt as PerceptionRecord, O as DelegationOrchestrator, On as toActionFrameScopes, Ot as PerceivedImage, P as DownloadedFileConsent, Pt as PerceptionResult, Q as MANAGE_TODO_TOOL, Qt as TAB_WORKSET_MAX_MAX, R as DownloadedFilePolicyOptions, Rt as SKILL_GENERATION_SYSTEM_PROMPT, S as DataSourcePolicy, Sn as createPagePerceptionToolSource, St as PageAuditSink, T as DataSourceRecord, Tn as createTodoToolSource, Tt as PagePerceptionReader, U as FOCUS_PAGE_TAB_TOOL, Ut as SkillGenerationToolSourceOptions, V as DownloadedFileRecord, Vt as SkillGenerationOutcome, W as FrameNote, Wt as SkillGenerator, X as LIST_DOWNLOADED_FILES_TOOL, Xt as SubtreeRejection, Y as ImageCaptureBudget, Yt as SubAgentRunner, Z as LIST_PAGE_TABS_TOOL, Zt as TAB_WORKSET_DEFAULT_MAX, _ as DataSourceCandidatePolicyOptions, _n as clampWorksetMax, _t as PageActionScope, a as ActionTabWindow, an as TabWorksetPort, at as PAGE_DOCUMENT_REF, b as DataSourceDef, bn as createHttpDataSourceTransport, bt as PageActionToolSourceOptions, c as DELEGATE_TASK_TOOL, cn as TodoItem, ct as PERCEPTION_SYSTEM_PROMPT, d as DOWNLOAD_WAIT_MAX_MS, dn as TodoStatus, dt as PageActionKind, en as TAB_WORKSET_SYSTEM_PROMPT, et as OpenedPageInfo, f as DOWNLOAD_WAIT_MIN_MS, fn as TodoStore, ft as PageActionOutcome, g as DataSourceCandidatePolicy, gn as clampDownloadWaitMs, gt as PageActionRequest, h as DataSourceCandidateAuditSink, hn as WorksetTabView, ht as PageActionRecord, i as ActionTabWatcher, in as TabWorksetPolicyOptions, it as PAGE_ACTION_TOOL, j as DelegationResult, jt as PerceptionCaptureOptions, k as DelegationOrchestratorOptions, kn as toFrameScopes, kt as PerceivedNode, l as DELEGATION_SYSTEM_PROMPT, ln as TodoList, lt as PageActionConsent, m as DataSourceCandidate, mn as WorksetTab, mt as PageActionPolicyOptions, n as ActionDownloadWindow, nn as TabAdmission, nt as PAGE_ACTION_KINDS, o as CLOSE_PAGE_TAB_TOOL, on as TabWorksetToolSourceOptions, ot as PERCEIVE_PAGE_TOOL, p as DataSourceAuditSink, pn as TodoToolSourceOptions, pt as PageActionPolicy, q as GeneratedSkillDraft, qt as SkillTraceEvidenceStep, r as ActionFrameScope, rn as TabWorksetPolicy, rt as PAGE_ACTION_SYSTEM_PROMPT, s as ConsentUi, sn as TodoEvent, st as PERCEPTION_PAGING_DEFAULTS, t as ActionDownloadWatcher, tn as TODO_SYSTEM_PROMPT, tt as OpenedTabSignal, u as DOWNLOAD_WAIT_DEFAULT_MS, un as TodoListener, ut as PageActionExecutor, v as DataSourceCandidateRecord, vn as createDelegationToolSource, vt as PageActionScopeInput, w as DataSourceProvenance, wn as createTabWorksetToolSource, wt as PagePerceptionPolicyOptions, x as DataSourceKind, xn as createPageActionToolSource, xt as PageActionUi, y as DataSourceCandidateStore, yn as createDownloadedFileToolSource, yt as PageActionTarget, z as DownloadedFileReadResult, zt as SkillCandidateSink } from "./index-1sQZ4VBN.js";
|
|
3
3
|
export { type ActionDownloadWatcher, type ActionDownloadWindow, type ActionFrameScope, type ActionTabWatcher, type ActionTabWindow, CLOSE_PAGE_TAB_TOOL, type ConsentUi, DEFAULT_MAX_DATA_SOURCE_BYTES, DELEGATE_TASK_TOOL, DELEGATION_SYSTEM_PROMPT, DOWNLOAD_WAIT_DEFAULT_MS, DOWNLOAD_WAIT_MAX_MS, DOWNLOAD_WAIT_MIN_MS, type DataSourceAuditSink, type DataSourceCandidate, type DataSourceCandidateAuditSink, DataSourceCandidatePolicy, type DataSourceCandidatePolicyOptions, type DataSourceCandidateRecord, type DataSourceCandidateStore, type DataSourceDef, type DataSourceKind, DataSourcePolicy, type DataSourcePolicyOptions, type DataSourceProvenance, type DataSourceRecord, type DataSourceTransport, type DelegationBudget, DelegationOrchestrator, type DelegationOrchestratorOptions, type DelegationRequest, type DelegationResult, type DelegationToolSourceOptions, type DownloadedFileAction, type DownloadedFileConsent, type DownloadedFileEntry, type DownloadedFileListing, DownloadedFilePolicy, type DownloadedFilePolicyOptions, type DownloadedFileReadResult, type DownloadedFileReader, type DownloadedFileRecord, type DownloadedFileToolSourceOptions, FOCUS_PAGE_TAB_TOOL, type FrameNote, type FrameScope, GENERATE_SKILL_TOOL, type GeneratedSkillDraft, type HttpDataSourceOptions, type ImageCaptureBudget, LIST_DOWNLOADED_FILES_TOOL, LIST_PAGE_TABS_TOOL, MANAGE_TODO_TOOL, type NestedFrameRef, type OpenedPageInfo, type OpenedTabSignal, PAGE_ACTION_KINDS, PAGE_ACTION_SYSTEM_PROMPT, PAGE_ACTION_TOOL, PAGE_DOCUMENT_REF, PERCEIVE_PAGE_TOOL, PERCEPTION_PAGING_DEFAULTS, PERCEPTION_SYSTEM_PROMPT, type PageActionConsent, type PageActionExecutor, type PageActionKind, type PageActionOutcome, PageActionPolicy, type PageActionPolicyOptions, type PageActionRecord, type PageActionRequest, type PageActionScope, type PageActionScopeInput, type PageActionTarget, type PageActionToolSourceOptions, type PageActionUi, type PageAuditSink, PagePerceptionPolicy, type PagePerceptionPolicyOptions, type PagePerceptionReader, type PagePerceptionToolSourceOptions, type ParentBudget, type PerceivedImage, type PerceivedNode, type PerceptionAuditSink, type PerceptionCaptureOptions, type PerceptionPagingBudget, type PerceptionRecord, type PerceptionResult, type PerceptionScope, type PerceptionScopeInput, READ_DOWNLOADED_FILE_TOOL, SKILL_GENERATION_SYSTEM_PROMPT, type SkillCandidateSink, type SkillGenerationMessages, type SkillGenerationOutcome, type SkillGenerationPolicy, type SkillGenerationToolSourceOptions, SkillGenerator, type SkillGeneratorOptions, type SkillTraceEvidence, type SkillTraceEvidenceStep, type SubAgentRunInput, type SubAgentRunner, type SubtreeRejection, TAB_WORKSET_DEFAULT_MAX, TAB_WORKSET_MAX_MAX, TAB_WORKSET_MIN_MAX, TAB_WORKSET_SYSTEM_PROMPT, TODO_SYSTEM_PROMPT, type TabAdmission, TabWorksetPolicy, type TabWorksetPolicyOptions, type TabWorksetPort, type TabWorksetToolSourceOptions, type TodoEvent, type TodoItem, type TodoList, type TodoListener, type TodoStatus, TodoStore, type TodoToolSourceOptions, type WorksetTab, type WorksetTabView, clampDownloadWaitMs, clampWorksetMax, createDelegationToolSource, createDownloadedFileToolSource, createHttpDataSourceTransport, createPageActionToolSource, createPagePerceptionToolSource, createSkillGenerationToolSource, createTabWorksetToolSource, createTodoToolSource, frameLabel, frameSteps, toActionFrameScopes, toFrameScopes, withDelegationOrigin };
|
package/dist/agent.js
CHANGED
|
@@ -2220,11 +2220,11 @@ function createPageActionToolSource(options) {
|
|
|
2220
2220
|
|
|
2221
2221
|
//#endregion
|
|
2222
2222
|
//#region ../agent/src/tabs/policy.ts
|
|
2223
|
-
/**
|
|
2224
|
-
const TAB_WORKSET_DEFAULT_MAX =
|
|
2223
|
+
/** 工作集容量缺省(分册 18);一屏索引视图的行数就是它要盖住的量,撞 `workset-full` 时模型没有任何入口能要更多 */
|
|
2224
|
+
const TAB_WORKSET_DEFAULT_MAX = 32;
|
|
2225
2225
|
/** 地板:2 的含义是「起点页 + 至少一个详情页」,低于它工作集这个概念就没有意义 */
|
|
2226
2226
|
const TAB_WORKSET_MIN_MAX = 2;
|
|
2227
|
-
/** 天花板:宿主写错一个 0
|
|
2227
|
+
/** 天花板:宿主写错一个 0 不该让一轮任务铺开几百个标签页。与缺省同值,宿主只调得低不调得高 */
|
|
2228
2228
|
const TAB_WORKSET_MAX_MAX = 32;
|
|
2229
2229
|
/**
|
|
2230
2230
|
* 夹取工作集容量(FR-11.5 / D-11-3)。
|
|
@@ -2234,7 +2234,7 @@ const TAB_WORKSET_MAX_MAX = 32;
|
|
|
2234
2234
|
* @experimental
|
|
2235
2235
|
*/
|
|
2236
2236
|
function clampWorksetMax(value) {
|
|
2237
|
-
if (value === void 0 || !Number.isFinite(value)) return
|
|
2237
|
+
if (value === void 0 || !Number.isFinite(value)) return 32;
|
|
2238
2238
|
return Math.min(32, Math.max(2, Math.trunc(value)));
|
|
2239
2239
|
}
|
|
2240
2240
|
const UNKNOWN_MESSAGE = "That page is not in this task's page set.";
|
|
@@ -1051,6 +1051,7 @@ const DATA_SOURCE_PROVENANCE_NOTE = {
|
|
|
1051
1051
|
};
|
|
1052
1052
|
/** 分片是不是 PDF;mime 允许带参数与大小写差异,与 FR-11.1 的判定同口径 */
|
|
1053
1053
|
const isPdfPart = (part) => part.type === "file" && part.mimeType.split(";")[0]?.trim().toLowerCase() === SUPPORTED_DOCUMENT_MIME.pdf;
|
|
1054
|
+
const isImagePart = (part) => part.type === "image";
|
|
1054
1055
|
/**
|
|
1055
1056
|
* LLM 客户端在 HTTP 失败时放进 `details` 的状态码(FR-22.2)。
|
|
1056
1057
|
* 判不出来返回 undefined——网络层异常没有状态码,回退对它没有意义。
|
|
@@ -1227,6 +1228,7 @@ var AgentLoop = class {
|
|
|
1227
1228
|
externalToolSources: /* @__PURE__ */ new Map(),
|
|
1228
1229
|
withheldTools: /* @__PURE__ */ new Set(),
|
|
1229
1230
|
pdfFallbackDone: false,
|
|
1231
|
+
imageFallbackDone: false,
|
|
1230
1232
|
integrityVerdicts: /* @__PURE__ */ new Map(),
|
|
1231
1233
|
toolTimeoutMs: this.#config.toolTimeoutMs,
|
|
1232
1234
|
now,
|
|
@@ -1441,8 +1443,12 @@ var AgentLoop = class {
|
|
|
1441
1443
|
turn--;
|
|
1442
1444
|
continue;
|
|
1443
1445
|
}
|
|
1446
|
+
if (this.#dropRejectedImages(state, e)) {
|
|
1447
|
+
turn--;
|
|
1448
|
+
continue;
|
|
1449
|
+
}
|
|
1444
1450
|
const code = e instanceof WebSkillError && LLM_TURN_CODES.has(e.code) ? e.code : "LLM_REQUEST_FAILED";
|
|
1445
|
-
const hint = state.pdfFallbackDone ? " The attached PDF was re-sent as extracted text after the endpoint rejected the original file, and that attempt failed as well." : messages.some((message) => message.content.some(isPdfPart)) ? " This turn attached a document; the selected model may not accept document input. Try another model, or link a Word or text file instead." : "";
|
|
1451
|
+
const hint = state.pdfFallbackDone ? " The attached PDF was re-sent as extracted text after the endpoint rejected the original file, and that attempt failed as well." : messages.some((message) => message.content.some(isPdfPart)) ? " This turn attached a document; the selected model may not accept document input. Try another model, or link a Word or text file instead." : state.imageFallbackDone ? " The images were dropped after the endpoint rejected them, and the retry failed as well." : "";
|
|
1446
1452
|
return finish("failed", "llm-error", `${messageOf(e)}${hint}`, code);
|
|
1447
1453
|
}
|
|
1448
1454
|
if (response.thinking !== void 0 && response.thinking !== "") {
|
|
@@ -1678,6 +1684,7 @@ var AgentLoop = class {
|
|
|
1678
1684
|
externalToolSources: /* @__PURE__ */ new Map(),
|
|
1679
1685
|
withheldTools: /* @__PURE__ */ new Set(),
|
|
1680
1686
|
pdfFallbackDone: false,
|
|
1687
|
+
imageFallbackDone: false,
|
|
1681
1688
|
integrityVerdicts: /* @__PURE__ */ new Map(),
|
|
1682
1689
|
toolTimeoutMs: snapshot.config.toolTimeoutMs,
|
|
1683
1690
|
now,
|
|
@@ -2745,6 +2752,44 @@ var AgentLoop = class {
|
|
|
2745
2752
|
});
|
|
2746
2753
|
return converted > 0;
|
|
2747
2754
|
}
|
|
2755
|
+
/**
|
|
2756
|
+
* 端点拒收本轮携带的图片后,把 image 分片换成一条说明让本轮可以重发(分册 15 FR-15.1)。
|
|
2757
|
+
* 返回 true 表示已改写、调用方应重试本轮。
|
|
2758
|
+
*
|
|
2759
|
+
* **不去解析端点指了哪一张**:`.messages[64].image[1]` 这类指针是提供方私有的,
|
|
2760
|
+
* 而重试预算只有一次——留一张没换的,重发还是被同一个端点拒。
|
|
2761
|
+
* 判据与 PDF 回退同口径:本轮真的带了图这个**事实**,不是猜错误文案。
|
|
2762
|
+
*
|
|
2763
|
+
* 图是感知结果的补充,结构化大纲仍在上下文里,去掉图这一轮仍然做得下去;
|
|
2764
|
+
* 而现状是一张解不开的图把整次扇出—汇聚打死。
|
|
2765
|
+
*/
|
|
2766
|
+
#dropRejectedImages(state, cause) {
|
|
2767
|
+
if (state.imageFallbackDone) return false;
|
|
2768
|
+
const status = httpStatusOf(cause);
|
|
2769
|
+
if (status === void 0 || status < 400 || status >= 500) return false;
|
|
2770
|
+
if (!state.messages.some((message) => message.content.some(isImagePart))) return false;
|
|
2771
|
+
state.imageFallbackDone = true;
|
|
2772
|
+
let dropped = 0;
|
|
2773
|
+
for (const message of state.messages) {
|
|
2774
|
+
const kept = message.content.filter((part) => !isImagePart(part));
|
|
2775
|
+
const removed = message.content.length - kept.length;
|
|
2776
|
+
if (removed === 0) continue;
|
|
2777
|
+
dropped += removed;
|
|
2778
|
+
kept.push({
|
|
2779
|
+
type: "text",
|
|
2780
|
+
text: `${removed === 1 ? "An image" : `${removed} images`} attached here could not be read by this endpoint and ${removed === 1 ? "was" : "were"} removed. Work from the text description instead, and say so if the answer depends on what ${removed === 1 ? "the picture shows" : "the pictures show"}.`
|
|
2781
|
+
});
|
|
2782
|
+
message.content = kept;
|
|
2783
|
+
}
|
|
2784
|
+
state.trace.record("run.warning", {
|
|
2785
|
+
message: `The endpoint rejected this turn with HTTP ${status} while it carried ${dropped} image(s); they were dropped and the turn was retried. Original error: ${messageOf(cause)}`,
|
|
2786
|
+
data: {
|
|
2787
|
+
dropped,
|
|
2788
|
+
status
|
|
2789
|
+
}
|
|
2790
|
+
});
|
|
2791
|
+
return dropped > 0;
|
|
2792
|
+
}
|
|
2748
2793
|
/** 单个 PDF 分片 → 文本;包装形态与 chatEngine 的附件标签同口径(FR-22.3 / FR-22.4) */
|
|
2749
2794
|
async #pdfAsText(state, part, extract) {
|
|
2750
2795
|
const name = part.name ?? "document.pdf";
|
|
@@ -3255,12 +3300,20 @@ var AgentLoop = class {
|
|
|
3255
3300
|
}
|
|
3256
3301
|
try {
|
|
3257
3302
|
return await this.#interact(state, {
|
|
3258
|
-
type: "
|
|
3303
|
+
type: "authorize",
|
|
3259
3304
|
id: this.#nextInteractionId(state),
|
|
3305
|
+
capability: "readUploadFile",
|
|
3260
3306
|
message: `Let skill "${skillName}" read the file you uploaded: ${file.name} (${file.contentType}, ${file.size} bytes)?`,
|
|
3261
|
-
|
|
3307
|
+
details: {
|
|
3308
|
+
skill: skillName,
|
|
3309
|
+
file: {
|
|
3310
|
+
name: file.name,
|
|
3311
|
+
contentType: file.contentType,
|
|
3312
|
+
size: file.size
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3262
3315
|
}, {
|
|
3263
|
-
kind: "
|
|
3316
|
+
kind: "authorize",
|
|
3264
3317
|
uploadFile: file.id
|
|
3265
3318
|
}) === true;
|
|
3266
3319
|
} catch (e) {
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ct as SkillsLockfile, Et as TrustedKeyStore, H as FileStat, Mt as WebSkillError, N as ArchiveLimits, S as UiBridge, U as FileSystemProvider, _t as SkillManifest, b as RenderResultRequest, c as InteractionResponse, jt as VerifyResult, kt as UnsignedPolicy, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, pt as SkillInstallSource, s as InteractionRequest, u as LlmCompleteInput, v as MemoryStore } from "./types-
|
|
2
|
-
import { Kt as ScriptExecutionContext, M as DocumentSurfaceHost, R as ExternalSkillProvider, S as BridgeResponse, Un as WebSkillApi, Yn as bridgeError, ct as NetworkPolicy, gn as ToolDefinition, m as ApprovalScope, ot as LinkedDocumentReader, qt as ScriptExecutor, x as BridgeRequest, y as BridgeCapabilities, yn as ToolResult, yr as parseBridgeRequest, z as ExternalToolSource } from "./index-
|
|
3
|
-
import { $ as NestedFrameRef, Ct as PagePerceptionPolicy, It as PerceptionScopeInput, Pt as PerceptionResult, Tt as PagePerceptionReader, Xt as SubtreeRejection, ft as PageActionOutcome, gt as PageActionRequest, jt as PerceptionCaptureOptions, kt as PerceivedNode, ut as PageActionExecutor, vt as PageActionScopeInput, yt as PageActionTarget } from "./index-
|
|
1
|
+
import { Ct as SkillsLockfile, Et as TrustedKeyStore, H as FileStat, Mt as WebSkillError, N as ArchiveLimits, S as UiBridge, U as FileSystemProvider, _t as SkillManifest, b as RenderResultRequest, c as InteractionResponse, jt as VerifyResult, kt as UnsignedPolicy, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, pt as SkillInstallSource, s as InteractionRequest, u as LlmCompleteInput, v as MemoryStore } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
|
+
import { Kt as ScriptExecutionContext, M as DocumentSurfaceHost, R as ExternalSkillProvider, S as BridgeResponse, Un as WebSkillApi, Yn as bridgeError, ct as NetworkPolicy, gn as ToolDefinition, m as ApprovalScope, ot as LinkedDocumentReader, qt as ScriptExecutor, x as BridgeRequest, y as BridgeCapabilities, yn as ToolResult, yr as parseBridgeRequest, z as ExternalToolSource } from "./index-BDyXe-a5.js";
|
|
3
|
+
import { $ as NestedFrameRef, Ct as PagePerceptionPolicy, It as PerceptionScopeInput, Pt as PerceptionResult, Tt as PagePerceptionReader, Xt as SubtreeRejection, ft as PageActionOutcome, gt as PageActionRequest, jt as PerceptionCaptureOptions, kt as PerceivedNode, ut as PageActionExecutor, vt as PageActionScopeInput, yt as PageActionTarget } from "./index-1sQZ4VBN.js";
|
|
4
4
|
//#region ../browser/dist/index.d.ts
|
|
5
5
|
//#region src/fs/featureDetection.d.ts
|
|
6
6
|
/** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
|
|
@@ -382,6 +382,78 @@ declare function checkDictationAvailability(): DictationAvailability;
|
|
|
382
382
|
*/
|
|
383
383
|
declare function startDictation(options: DictationOptions): DictationSession;
|
|
384
384
|
//#endregion
|
|
385
|
+
//#region src/media/camera.d.ts
|
|
386
|
+
/**
|
|
387
|
+
* 摄像头的可用性(分册 14 FR-14.2),口径与 `checkDictationAvailability` 一致:
|
|
388
|
+
* 按钮必须在**渲染期**就知道自己能不能用,不允许「点了才失败」。
|
|
389
|
+
* @experimental
|
|
390
|
+
*/
|
|
391
|
+
type CameraAvailability = {
|
|
392
|
+
available: true;
|
|
393
|
+
} | {
|
|
394
|
+
available: false;
|
|
395
|
+
reason: 'api-missing' | 'insecure-context';
|
|
396
|
+
};
|
|
397
|
+
/** @experimental */
|
|
398
|
+
interface CameraOptions {
|
|
399
|
+
/**
|
|
400
|
+
* 期望的最长边像素(FR-14.3)。只是 `ideal`:约束写成 `exact` 时,
|
|
401
|
+
* 任何拿不到该分辨率的设备会直接 `OverconstrainedError`,等于把相机关死。
|
|
402
|
+
*/
|
|
403
|
+
maxDimension?: number;
|
|
404
|
+
/** 优先使用的摄像头;同样只作偏好,设备没有对应朝向时浏览器会给别的 */
|
|
405
|
+
facingMode?: 'user' | 'environment';
|
|
406
|
+
}
|
|
407
|
+
/** 一次取景会话的句柄;`close()` 后轨道全部停止,指示灯随之熄灭 @experimental */
|
|
408
|
+
interface CameraSession {
|
|
409
|
+
readonly stream: MediaStream;
|
|
410
|
+
/** 轨道实际生效的分辨率;浏览器给不到 ideal 时与请求值不同 */
|
|
411
|
+
resolution(): {
|
|
412
|
+
width: number;
|
|
413
|
+
height: number;
|
|
414
|
+
};
|
|
415
|
+
close(): void;
|
|
416
|
+
}
|
|
417
|
+
/** @experimental */
|
|
418
|
+
interface CapturePhotoOptions {
|
|
419
|
+
/** 输出文件名;缺省由调用时刻生成 */
|
|
420
|
+
fileName?: string;
|
|
421
|
+
/** 输出 MIME;缺省 `image/jpeg`(同分辨率下比 PNG 小一个量级) */
|
|
422
|
+
type?: string;
|
|
423
|
+
/** JPEG/WebP 质量,0~1;缺省 0.92 */
|
|
424
|
+
quality?: number;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* 默认最长边:宿主要「最大分辨率」,给一个远超当前消费级摄像头的 ideal 让浏览器自己贴顶
|
|
428
|
+
* @experimental
|
|
429
|
+
*/
|
|
430
|
+
declare const DEFAULT_CAMERA_MAX_DIMENSION = 5000;
|
|
431
|
+
/**
|
|
432
|
+
* 渲染期调用(FR-14.2):不可用时按钮置灰并说明原因。
|
|
433
|
+
*
|
|
434
|
+
* 顺序与语音一致——`getUserMedia` 压根不存在时谈安全上下文没有意义;
|
|
435
|
+
* API 在但站点是 http,取流一定会被浏览器拒绝,这条原因用户能自己解决。
|
|
436
|
+
* @experimental
|
|
437
|
+
*/
|
|
438
|
+
declare function checkCameraAvailability(): CameraAvailability;
|
|
439
|
+
/**
|
|
440
|
+
* 打开摄像头取景(FR-14.1)。
|
|
441
|
+
*
|
|
442
|
+
* **只能由用户手势调用**(FR-14.4)。设计上的保证是它不进工具列表:
|
|
443
|
+
* agent 拿不到「打开摄像头」这个动作,因此不存在自主开摄像头的路径。
|
|
444
|
+
* @experimental
|
|
445
|
+
*/
|
|
446
|
+
declare function openCamera(options?: CameraOptions): Promise<CameraSession>;
|
|
447
|
+
/**
|
|
448
|
+
* 把取景元素的**当前一帧**编码成文件(FR-14.5)。
|
|
449
|
+
*
|
|
450
|
+
* 尺寸取 `videoWidth`/`videoHeight`(轨道原生分辨率),不取 CSS 尺寸——
|
|
451
|
+
* 预览区被布局缩到 320px 宽,照着画出来的就是 320px 的照片。
|
|
452
|
+
* 编码交给平台的 canvas,不手写编码器(AGENTS.md §6)。
|
|
453
|
+
* @experimental
|
|
454
|
+
*/
|
|
455
|
+
declare function capturePhoto(video: HTMLVideoElement, options?: CapturePhotoOptions): Promise<File>;
|
|
456
|
+
//#endregion
|
|
385
457
|
//#region src/media/compressImage.d.ts
|
|
386
458
|
/** 图片压缩结果;`originalBytes`/`compressedBytes` 供 UI 显示「3.2 MB → 1.8 MB」(FR-11.3 可见性) */
|
|
387
459
|
interface CompressResult {
|
|
@@ -657,8 +729,10 @@ interface RemoteTargetRegistry {
|
|
|
657
729
|
* 它**不是** FR-11.5 那个容量闸门:那一条管的是「同时有几个**标签页**可操作」,
|
|
658
730
|
* 触顶硬拒绝,落在 `TabWorksetPolicy`。这里管的是同一个标签页里连续跳页攒下的历史分片,
|
|
659
731
|
* 那些本来就该失效,按最久未使用逐出即可,逐出不构成对模型的拒绝。
|
|
732
|
+
* 软上限必须宽于 `TAB_WORKSET_MAX_MAX`(分册 18),否则工作集里**还活着**的页
|
|
733
|
+
* 会因为别的页新发分片而被逐出;64 = 天花板 32 × 每页两代历史。
|
|
660
734
|
*/
|
|
661
|
-
declare const SHARD_SOFT_LIMIT =
|
|
735
|
+
declare const SHARD_SOFT_LIMIT = 64;
|
|
662
736
|
/**
|
|
663
737
|
* 把解析结果翻译成给模型看的补充说明(分册 11 / FR-11.6);
|
|
664
738
|
* 接到 `PageActionPolicyOptions.diagnose` 上即可:
|
|
@@ -1514,4 +1588,4 @@ declare function watchBlockedResources(host: ViewerBlockedHost, notice: ViewerBl
|
|
|
1514
1588
|
/** 提示文案的单一来源;判据直接引用,不各写一份字面量 */
|
|
1515
1589
|
declare function blockedMessage(origins: readonly string[]): string;
|
|
1516
1590
|
//#endregion
|
|
1517
|
-
export { type BlockedEventLike, type BridgeCapabilities, type BridgeRequest, type BridgeResponse, type BrowserHostBundle, type BrowserHostOptions, type BrowserHostOverrides, BrowserSkillManager, BrowserWorkerScriptExecutor, type CaptureFailure, type CaptureLevel, type CapturedImage, type ChromeBuiltinAvailability, ChromeBuiltinLlmClient, type CompressResult, type ConfiguredLlmClient, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, type DictationAvailability, type DictationOptions, type DictationSession, type DocumentLocationView, type DocumentSurfaceAudit, type DocumentSurfaceOptions, type DomPageActionExecutor, type DomPageActionOptions, type DomPerceptionReader, type DomPerceptionReaderOptions, type FetchLinkedDocumentOptions, type FrameBudget, type FrameDelivery, type FrameDispatcher, type FrameResolveContext, type FrameRouter, type FrameRouterOptions, HOST_PORT_MATRIX, type HandleKind, type HostChatbotAdapterShape, type HostConnectFacadeShape, type HostConsoleBackendShape, type HostKind, type HostSurface, type IframeSandboxOptions, IframeWorkerLike, type InspectHostWiringInput, type LlmClientConfig, type LlmEntryConfig, type MainToWorkerMessage, type OpenDocumentInput, OpfsProvider, type PageAgentHandler, type PageAgentHandlerOptions, type PageAgentReply, type PageAgentRequest, type PageAgentTargetEntry, type PageAgentTransport, type PageDocumentIdentity, type PortApplicability, type PortReport, type PortSpec, type PortStatus, type RemotePageActionExecutorOptions, type RemotePerceptionReaderOptions, type RemoteTargetRegistry, type RemoteTargetRegistryOptions, type RoleHint, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, type SandboxMode, type SerializedError, type TargetResolution, TsTranspiler, type TypeScriptSupportOptions, VIEWER_SANDBOX_TOKENS, type ViewerBlockedHost, type ViewerBlockedNotice, type ViewerBlockedResult, type ViewerCspOptions, type ViewerDocument, type ViewerShellHost, type ViewerShellMount, type ViewerShellResult, WORKER_BOOTSTRAP_SOURCE, type WindowLike, type WorkerEvent, type WorkerFactory, type WorkerLike, type WorkerRequest, WorkerRuntimeClient, type WorkerRuntimeClientDeps, type WorkerRuntimeHostOverrides, type WorkerScopeLike, WorkerUiBridge, XLSX_UNEXTRACTED, blockedMessage, bridgeError, captureElementImage, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDocumentSurfaceHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, documentKey, explainResolution, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
|
|
1591
|
+
export { type BlockedEventLike, type BridgeCapabilities, type BridgeRequest, type BridgeResponse, type BrowserHostBundle, type BrowserHostOptions, type BrowserHostOverrides, BrowserSkillManager, BrowserWorkerScriptExecutor, type CameraAvailability, type CameraOptions, type CameraSession, type CaptureFailure, type CaptureLevel, type CapturePhotoOptions, type CapturedImage, type ChromeBuiltinAvailability, ChromeBuiltinLlmClient, type CompressResult, type ConfiguredLlmClient, DEFAULT_CAMERA_MAX_DIMENSION, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, type DictationAvailability, type DictationOptions, type DictationSession, type DocumentLocationView, type DocumentSurfaceAudit, type DocumentSurfaceOptions, type DomPageActionExecutor, type DomPageActionOptions, type DomPerceptionReader, type DomPerceptionReaderOptions, type FetchLinkedDocumentOptions, type FrameBudget, type FrameDelivery, type FrameDispatcher, type FrameResolveContext, type FrameRouter, type FrameRouterOptions, HOST_PORT_MATRIX, type HandleKind, type HostChatbotAdapterShape, type HostConnectFacadeShape, type HostConsoleBackendShape, type HostKind, type HostSurface, type IframeSandboxOptions, IframeWorkerLike, type InspectHostWiringInput, type LlmClientConfig, type LlmEntryConfig, type MainToWorkerMessage, type OpenDocumentInput, OpfsProvider, type PageAgentHandler, type PageAgentHandlerOptions, type PageAgentReply, type PageAgentRequest, type PageAgentTargetEntry, type PageAgentTransport, type PageDocumentIdentity, type PortApplicability, type PortReport, type PortSpec, type PortStatus, type RemotePageActionExecutorOptions, type RemotePerceptionReaderOptions, type RemoteTargetRegistry, type RemoteTargetRegistryOptions, type RoleHint, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, type SandboxMode, type SerializedError, type TargetResolution, TsTranspiler, type TypeScriptSupportOptions, VIEWER_SANDBOX_TOKENS, type ViewerBlockedHost, type ViewerBlockedNotice, type ViewerBlockedResult, type ViewerCspOptions, type ViewerDocument, type ViewerShellHost, type ViewerShellMount, type ViewerShellResult, WORKER_BOOTSTRAP_SOURCE, type WindowLike, type WorkerEvent, type WorkerFactory, type WorkerLike, type WorkerRequest, WorkerRuntimeClient, type WorkerRuntimeClientDeps, type WorkerRuntimeHostOverrides, type WorkerScopeLike, WorkerUiBridge, XLSX_UNEXTRACTED, blockedMessage, bridgeError, captureElementImage, capturePhoto, checkCameraAvailability, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDocumentSurfaceHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, documentKey, explainResolution, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openCamera, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
|
package/dist/browser.js
CHANGED
|
@@ -2,10 +2,10 @@ import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
|
2
2
|
import { A as SKILL_MANIFEST_FILE, D as verifySkillSignature, M as buildManifest, O as MANIFEST_EXCLUDED_FILES, P as verifyManifest, b as parseSkillMarkdown, c as unzipWithLimits, f as SKILL_PACK_FILE, i as buildCatalog, k as SKILLS_LOCKFILE, m as parseSkillPackManifest, n as SkillDiscovery, o as readResponseWithLimit, p as exportSkills, t as validateSkills, u as detectSkillArchiveShapeFromFs, w as readSkillSignature, y as isValidSkillName } from "./skill-CAJMsLod.js";
|
|
3
3
|
import { a as atomicWriteText, o as isAtomicTempPath, r as resolveInsideRoot } from "./pathSecurity-B1owvJAF.js";
|
|
4
4
|
import { t as assertRemoteUrlAllowed } from "./urlSafety-CiSuCJvX.js";
|
|
5
|
-
import { a as networkPolicyLibSource, c as bridgeError, d as FsMemoryStore, g as FsRunSnapshotStore, l as parseBridgeRequest, nt as ProgressiveRouter, p as AgentLoop, r as normalizeToolError, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, u as FsArtifactStore } from "./approval-
|
|
5
|
+
import { a as networkPolicyLibSource, c as bridgeError, d as FsMemoryStore, g as FsRunSnapshotStore, l as parseBridgeRequest, nt as ProgressiveRouter, p as AgentLoop, r as normalizeToolError, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, u as FsArtifactStore } from "./approval-CBPnGPIm.js";
|
|
6
6
|
import { a as GoogleGenAiClient, o as AnthropicClient, s as OpenAiCompatibleClient, t as MockLlmClient } from "./llm-B7lLH0ZI.js";
|
|
7
7
|
import { n as normalizeToolContent, t as mergeCatalogEntries } from "./external-_ZRQe-V9.js";
|
|
8
|
-
import { t as createWebSkillApi } from "./webSkillApi-
|
|
8
|
+
import { t as createWebSkillApi } from "./webSkillApi-Ce2OO5S5.js";
|
|
9
9
|
import { a as frameLabel, i as toFrameScopes, o as frameSteps, r as toActionFrameScopes } from "./types-BuacBov_.js";
|
|
10
10
|
|
|
11
11
|
//#region ../browser/src/fs/featureDetection.ts
|
|
@@ -1355,13 +1355,16 @@ var BrowserWorkerScriptExecutor = class {
|
|
|
1355
1355
|
}
|
|
1356
1356
|
/** 能力桥宿主侧处理:能力关闭/授权拒绝即 TOOL_UNSUPPORTED;判定逻辑共用 runtime/sandbox/approval */
|
|
1357
1357
|
async #handleBridge(request, context) {
|
|
1358
|
-
const gate = async (capability, message, details) => {
|
|
1358
|
+
const gate = async (capability, message, details = {}) => {
|
|
1359
1359
|
const decision = await this.#approval.authorize({
|
|
1360
1360
|
runId: context.runId,
|
|
1361
1361
|
capability,
|
|
1362
1362
|
mode: this.#capabilities[capability],
|
|
1363
1363
|
message,
|
|
1364
|
-
|
|
1364
|
+
details: {
|
|
1365
|
+
skill: context.skillName,
|
|
1366
|
+
...details
|
|
1367
|
+
}
|
|
1365
1368
|
});
|
|
1366
1369
|
if (decision === "allowed") return void 0;
|
|
1367
1370
|
return bridgeError(request.id, "TOOL_UNSUPPORTED", decision === "disabled" ? `Capability "${capability}" is disabled by the sandbox capability settings` : `Capability "${capability}" was denied by the user`);
|
|
@@ -1419,7 +1422,7 @@ var BrowserWorkerScriptExecutor = class {
|
|
|
1419
1422
|
}
|
|
1420
1423
|
case "confirm": {
|
|
1421
1424
|
if (!context.confirm) return bridgeError(request.id, "TOOL_UNSUPPORTED", "Capability \"confirm\" is disabled");
|
|
1422
|
-
const denied = await gate("confirm", `Script "${context.skillName}" asks for confirmation: ${request.message}
|
|
1425
|
+
const denied = await gate("confirm", `Script "${context.skillName}" asks for confirmation: ${request.message}`, { question: request.message });
|
|
1423
1426
|
if (denied) return denied;
|
|
1424
1427
|
return {
|
|
1425
1428
|
id: request.id,
|
|
@@ -1677,7 +1680,7 @@ function checkDictationAvailability() {
|
|
|
1677
1680
|
return { available: true };
|
|
1678
1681
|
}
|
|
1679
1682
|
/** 浏览器的 error 码 → 稳定错误码;权限被拒要单独区分,UI 的降级提示不一样(FR-7.6) */
|
|
1680
|
-
function toError(code, message) {
|
|
1683
|
+
function toError$1(code, message) {
|
|
1681
1684
|
if (code === "not-allowed" || code === "service-not-allowed") return new WebSkillError("DICTATION_PERMISSION_DENIED", "Microphone access was denied. Voice input is unavailable until you allow it in the browser.", { reason: code });
|
|
1682
1685
|
return new WebSkillError("DICTATION_FAILED", message ?? `Speech recognition failed: ${code}`, { reason: code });
|
|
1683
1686
|
}
|
|
@@ -1713,7 +1716,7 @@ function startDictation(options) {
|
|
|
1713
1716
|
recognition.onerror = (event) => {
|
|
1714
1717
|
if (stopped) return;
|
|
1715
1718
|
if (event.error === "no-speech" || event.error === "aborted") return;
|
|
1716
|
-
options.onError(toError(event.error, event.message));
|
|
1719
|
+
options.onError(toError$1(event.error, event.message));
|
|
1717
1720
|
};
|
|
1718
1721
|
try {
|
|
1719
1722
|
recognition.start();
|
|
@@ -1730,6 +1733,107 @@ function startDictation(options) {
|
|
|
1730
1733
|
} };
|
|
1731
1734
|
}
|
|
1732
1735
|
|
|
1736
|
+
//#endregion
|
|
1737
|
+
//#region ../browser/src/media/camera.ts
|
|
1738
|
+
/**
|
|
1739
|
+
* 默认最长边:宿主要「最大分辨率」,给一个远超当前消费级摄像头的 ideal 让浏览器自己贴顶
|
|
1740
|
+
* @experimental
|
|
1741
|
+
*/
|
|
1742
|
+
const DEFAULT_CAMERA_MAX_DIMENSION = 5e3;
|
|
1743
|
+
function mediaDevices() {
|
|
1744
|
+
return globalThis.navigator?.mediaDevices;
|
|
1745
|
+
}
|
|
1746
|
+
/**
|
|
1747
|
+
* 渲染期调用(FR-14.2):不可用时按钮置灰并说明原因。
|
|
1748
|
+
*
|
|
1749
|
+
* 顺序与语音一致——`getUserMedia` 压根不存在时谈安全上下文没有意义;
|
|
1750
|
+
* API 在但站点是 http,取流一定会被浏览器拒绝,这条原因用户能自己解决。
|
|
1751
|
+
* @experimental
|
|
1752
|
+
*/
|
|
1753
|
+
function checkCameraAvailability() {
|
|
1754
|
+
if (typeof mediaDevices()?.getUserMedia !== "function") return {
|
|
1755
|
+
available: false,
|
|
1756
|
+
reason: "api-missing"
|
|
1757
|
+
};
|
|
1758
|
+
if (globalThis.isSecureContext === false) return {
|
|
1759
|
+
available: false,
|
|
1760
|
+
reason: "insecure-context"
|
|
1761
|
+
};
|
|
1762
|
+
return { available: true };
|
|
1763
|
+
}
|
|
1764
|
+
/** DOMException 的 name → 稳定错误码;权限被拒要单独区分,UI 的降级提示不一样(FR-14.6) */
|
|
1765
|
+
function toError(e) {
|
|
1766
|
+
const raw = e?.name;
|
|
1767
|
+
const name = typeof raw === "string" ? raw : "";
|
|
1768
|
+
if (name === "NotAllowedError" || name === "SecurityError") return new WebSkillError("CAMERA_PERMISSION_DENIED", "Camera access was denied. Photo capture is unavailable until you allow it in the browser.", { reason: name });
|
|
1769
|
+
const message = e?.message;
|
|
1770
|
+
return new WebSkillError("CAMERA_UNAVAILABLE", `The camera could not be opened: ${typeof message === "string" && message !== "" ? message : String(e)}`, { ...name !== "" ? { reason: name } : {} });
|
|
1771
|
+
}
|
|
1772
|
+
/**
|
|
1773
|
+
* 打开摄像头取景(FR-14.1)。
|
|
1774
|
+
*
|
|
1775
|
+
* **只能由用户手势调用**(FR-14.4)。设计上的保证是它不进工具列表:
|
|
1776
|
+
* agent 拿不到「打开摄像头」这个动作,因此不存在自主开摄像头的路径。
|
|
1777
|
+
* @experimental
|
|
1778
|
+
*/
|
|
1779
|
+
async function openCamera(options = {}) {
|
|
1780
|
+
const devices = mediaDevices();
|
|
1781
|
+
if (typeof devices?.getUserMedia !== "function") throw new WebSkillError("CAMERA_UNAVAILABLE", "Camera capture is not available in this browser.");
|
|
1782
|
+
const max = options.maxDimension ?? 5e3;
|
|
1783
|
+
let stream;
|
|
1784
|
+
try {
|
|
1785
|
+
stream = await devices.getUserMedia({
|
|
1786
|
+
video: {
|
|
1787
|
+
width: { ideal: max },
|
|
1788
|
+
height: { ideal: max },
|
|
1789
|
+
...options.facingMode !== void 0 ? { facingMode: options.facingMode } : {}
|
|
1790
|
+
},
|
|
1791
|
+
audio: false
|
|
1792
|
+
});
|
|
1793
|
+
} catch (e) {
|
|
1794
|
+
throw toError(e);
|
|
1795
|
+
}
|
|
1796
|
+
return {
|
|
1797
|
+
stream,
|
|
1798
|
+
resolution() {
|
|
1799
|
+
const settings = stream.getVideoTracks()[0]?.getSettings();
|
|
1800
|
+
return {
|
|
1801
|
+
width: settings?.width ?? 0,
|
|
1802
|
+
height: settings?.height ?? 0
|
|
1803
|
+
};
|
|
1804
|
+
},
|
|
1805
|
+
close() {
|
|
1806
|
+
for (const track of stream.getTracks()) track.stop();
|
|
1807
|
+
}
|
|
1808
|
+
};
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* 把取景元素的**当前一帧**编码成文件(FR-14.5)。
|
|
1812
|
+
*
|
|
1813
|
+
* 尺寸取 `videoWidth`/`videoHeight`(轨道原生分辨率),不取 CSS 尺寸——
|
|
1814
|
+
* 预览区被布局缩到 320px 宽,照着画出来的就是 320px 的照片。
|
|
1815
|
+
* 编码交给平台的 canvas,不手写编码器(AGENTS.md §6)。
|
|
1816
|
+
* @experimental
|
|
1817
|
+
*/
|
|
1818
|
+
async function capturePhoto(video, options = {}) {
|
|
1819
|
+
const width = video.videoWidth;
|
|
1820
|
+
const height = video.videoHeight;
|
|
1821
|
+
if (width === 0 || height === 0) throw new WebSkillError("CAMERA_CAPTURE_FAILED", "The camera has not produced a frame yet.");
|
|
1822
|
+
const type = options.type ?? "image/jpeg";
|
|
1823
|
+
const canvas = document.createElement("canvas");
|
|
1824
|
+
canvas.width = width;
|
|
1825
|
+
canvas.height = height;
|
|
1826
|
+
const context = canvas.getContext("2d");
|
|
1827
|
+
if (context === null) throw new WebSkillError("CAMERA_CAPTURE_FAILED", "This browser did not provide a 2D canvas context.");
|
|
1828
|
+
context.drawImage(video, 0, 0, width, height);
|
|
1829
|
+
const blob = await new Promise((resolve) => {
|
|
1830
|
+
canvas.toBlob(resolve, type, options.quality ?? .92);
|
|
1831
|
+
});
|
|
1832
|
+
if (blob === null) throw new WebSkillError("CAMERA_CAPTURE_FAILED", `The captured frame could not be encoded as ${type}.`);
|
|
1833
|
+
const name = options.fileName ?? `photo-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.jpg`;
|
|
1834
|
+
return new File([blob], name, { type: blob.type === "" ? type : blob.type });
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1733
1837
|
//#endregion
|
|
1734
1838
|
//#region ../browser/src/media/compressImage.ts
|
|
1735
1839
|
/** 动图无法在不丢帧的前提下走单帧编码管线,超限直接拒绝(裁决 D-2) */
|
|
@@ -2013,6 +2117,17 @@ function isAnimatedWebp(bytes) {
|
|
|
2013
2117
|
].every((byte, index) => bytes[12 + index] === byte) && ((bytes[20] ?? 0) & 2) !== 0;
|
|
2014
2118
|
}
|
|
2015
2119
|
/**
|
|
2120
|
+
* APNG:`acTL` 块。规范要求它排在第一个 `IDAT` 之前,所以嗅探头部就够。
|
|
2121
|
+
* 魔数与静态 PNG 完全相同,只看魔数会让加载动画这类素材当作静态图原样发出去。
|
|
2122
|
+
*/
|
|
2123
|
+
function isAnimatedPng(bytes) {
|
|
2124
|
+
for (let i = 8; i + 4 <= bytes.length; i += 1) {
|
|
2125
|
+
if (bytes[i] === 73 && bytes[i + 1] === 68 && bytes[i + 2] === 65 && bytes[i + 3] === 84) return false;
|
|
2126
|
+
if (bytes[i] === 97 && bytes[i + 1] === 99 && bytes[i + 2] === 84 && bytes[i + 3] === 76) return true;
|
|
2127
|
+
}
|
|
2128
|
+
return false;
|
|
2129
|
+
}
|
|
2130
|
+
/**
|
|
2016
2131
|
* 按魔数认图片类型(服务端声明只作兜底)。
|
|
2017
2132
|
*
|
|
2018
2133
|
* 图片接口常年是「无扩展名 + `application/octet-stream`」这种组合(查询串带 file id 的尤其多),
|
|
@@ -2065,7 +2180,7 @@ async function rasterizeToPng(blob) {
|
|
|
2065
2180
|
* 照抄声明会让端点解码失败并连累整次请求(一张图 400,37 张全废)。
|
|
2066
2181
|
*
|
|
2067
2182
|
* 魔数对得上也不等于发得出去,还有两类会被端点整次拒收,必须重编码成单帧位图:
|
|
2068
|
-
* - **动图**(GIF 天然多帧,WebP 看 `VP8X`
|
|
2183
|
+
* - **动图**(GIF 天然多帧,WebP 看 `VP8X` 的动画位,PNG 看 `acTL` 块):图片通道普遍只收静态图;
|
|
2069
2184
|
* - **超长边**:横幅类素材常见 7680×120 这种尺寸,字节数却很小,
|
|
2070
2185
|
* 纯按字节压缩的预算根本不会触发,原样发出去就撞上端点的边长上限。
|
|
2071
2186
|
*
|
|
@@ -2077,7 +2192,7 @@ async function toDeliverableBlob(blob, oversized = false) {
|
|
|
2077
2192
|
const sniffed = sniffImageMime(head);
|
|
2078
2193
|
if (sniffed !== void 0 && DELIVERABLE_IMAGE_MIME_TYPES.has(sniffed)) {
|
|
2079
2194
|
const typed = sniffed === declared ? blob : new Blob([blob], { type: sniffed });
|
|
2080
|
-
const animated = sniffed === "image/gif" || sniffed === "image/webp" && isAnimatedWebp(head);
|
|
2195
|
+
const animated = sniffed === "image/gif" || sniffed === "image/webp" && isAnimatedWebp(head) || sniffed === "image/png" && isAnimatedPng(head);
|
|
2081
2196
|
return oversized || animated ? await rasterizeToPng(typed) : typed;
|
|
2082
2197
|
}
|
|
2083
2198
|
const mimeType = sniffed ?? (declared.startsWith("image/") ? declared : void 0);
|
|
@@ -2158,11 +2273,20 @@ const ROUTE_ATTRIBUTES = [
|
|
|
2158
2273
|
"data-href",
|
|
2159
2274
|
"data-url"
|
|
2160
2275
|
];
|
|
2161
|
-
/**
|
|
2276
|
+
/**
|
|
2277
|
+
* 可被启发式信号提升的角色:其余角色要么本就能发句柄,要么带着不该被覆盖的语义(D-15-3)。
|
|
2278
|
+
*
|
|
2279
|
+
* `listitem` 在列表里本该只是结构,但 `<ul><li>` 是自绘下拉 / 菜单的主流写法,
|
|
2280
|
+
* 选项往往就是不带 role 的 `<li>`(0.17.0 分册 11)。它与另外三个一样受
|
|
2281
|
+
* 「有可操作后代就不提升」约束,所以真正的语义列表不会被误伤。
|
|
2282
|
+
*
|
|
2283
|
+
* 这张白名单**只约束启发式信号**。宿主探针点名的元素走另一条路(分册 12)。
|
|
2284
|
+
*/
|
|
2162
2285
|
const PROMOTABLE_ROLES = /* @__PURE__ */ new Set([
|
|
2163
2286
|
"generic",
|
|
2164
2287
|
"img",
|
|
2165
|
-
"cell"
|
|
2288
|
+
"cell",
|
|
2289
|
+
"listitem"
|
|
2166
2290
|
]);
|
|
2167
2291
|
/** 合成名的前缀,必须让模型看得出「这不是页面上的字,别拿它去搜」(FR-15.4 第 3 级) */
|
|
2168
2292
|
const SYNTHETIC_NAME_PREFIX = "unlabeled control";
|
|
@@ -2264,10 +2388,11 @@ function synthesizeName(element, nameOf) {
|
|
|
2264
2388
|
}
|
|
2265
2389
|
/** 提升后的角色与导航目标;未提升时返回 undefined */
|
|
2266
2390
|
function promoteRole(input) {
|
|
2267
|
-
const { element, role, doc, hasActionableDescendant, context } = input;
|
|
2391
|
+
const { element, role, doc, hasActionableDescendant, selfActionable, context } = input;
|
|
2268
2392
|
const hinted = hintedRoleOf(element, context.roleHints);
|
|
2269
2393
|
if (hinted !== void 0) return { role: hinted };
|
|
2270
|
-
if (
|
|
2394
|
+
if (selfActionable) return void 0;
|
|
2395
|
+
if (!(context.interactiveHint?.(element) === true) && !PROMOTABLE_ROLES.has(role)) return void 0;
|
|
2271
2396
|
if (hasActionableDescendant && role !== "img") return void 0;
|
|
2272
2397
|
if (!looksInteractive(element, context)) return void 0;
|
|
2273
2398
|
const href = navigationTargetOf(element, doc);
|
|
@@ -2495,6 +2620,7 @@ function describe(element, excluded, doc, view, capture, handles, frame, provena
|
|
|
2495
2620
|
role,
|
|
2496
2621
|
doc,
|
|
2497
2622
|
hasActionableDescendant: children.some((child) => child.ref !== void 0 && handles?.isAction(child.ref) === true),
|
|
2623
|
+
selfActionable: ACTIONABLE_ROLES.has(role),
|
|
2498
2624
|
context: promotion
|
|
2499
2625
|
});
|
|
2500
2626
|
if (promoted !== void 0) {
|
|
@@ -3154,6 +3280,19 @@ function fillValue(element, value) {
|
|
|
3154
3280
|
}
|
|
3155
3281
|
const norm = (text) => (text ?? "").replace(/\s+/g, " ").trim().toLowerCase();
|
|
3156
3282
|
/**
|
|
3283
|
+
* 激活一个元素。
|
|
3284
|
+
*
|
|
3285
|
+
* `click()` 只定义在 `HTMLElement` 上:内联 `<svg>`(以及其它外来命名空间的元素)
|
|
3286
|
+
* 拿到的是 `undefined`,直接调会抛 `TypeError`,整次操作倒在最后一步。
|
|
3287
|
+
* 图标把监听器挂在 `<svg>` 本体上是常见写法,所以这条路径必须通。
|
|
3288
|
+
* 退路是派发一个真正的 `click` 事件:它照样冒泡,祖先 `<a>` 的激活行为也照样跑。
|
|
3289
|
+
*/
|
|
3290
|
+
function activate(element, init) {
|
|
3291
|
+
const native = element.click;
|
|
3292
|
+
if (typeof native === "function") native.call(element);
|
|
3293
|
+
else element.dispatchEvent(new MouseEvent("click", init));
|
|
3294
|
+
}
|
|
3295
|
+
/**
|
|
3157
3296
|
* 一次「像人一样」的点击。
|
|
3158
3297
|
*
|
|
3159
3298
|
* `HTMLElement.click()` **只**派发 `click`,不派发指针/鼠标序列,也不移动焦点。
|
|
@@ -3199,7 +3338,7 @@ function press(element) {
|
|
|
3199
3338
|
...base,
|
|
3200
3339
|
buttons: 0
|
|
3201
3340
|
}));
|
|
3202
|
-
element
|
|
3341
|
+
activate(element, base);
|
|
3203
3342
|
}
|
|
3204
3343
|
/** 轮询等待,上限固定:等不到就失败,不能无限挂着一次工具调用 */
|
|
3205
3344
|
async function waitFor(probe, timeoutMs = 2e3) {
|
|
@@ -3244,7 +3383,13 @@ async function selectOption(element, value) {
|
|
|
3244
3383
|
if (listbox === null || listbox === void 0) return fail("The options panel did not open.");
|
|
3245
3384
|
const option = [...listbox.querySelectorAll("[role=option], [role=gridcell], [role=menuitem], option")].find((candidate) => norm(accessibleName(candidate)) === norm(value));
|
|
3246
3385
|
if (option === void 0) return fail(`No option named "${value}" is available.`);
|
|
3247
|
-
option
|
|
3386
|
+
activate(option, {
|
|
3387
|
+
bubbles: true,
|
|
3388
|
+
cancelable: true,
|
|
3389
|
+
composed: true,
|
|
3390
|
+
detail: 1,
|
|
3391
|
+
button: 0
|
|
3392
|
+
});
|
|
3248
3393
|
return await waitFor(() => {
|
|
3249
3394
|
const shown = `${accessibleName(element) ?? ""} ${element.value ?? ""}`;
|
|
3250
3395
|
return norm(shown).includes(norm(value)) ? true : void 0;
|
|
@@ -3370,7 +3515,7 @@ function createDomPageActionExecutor(options) {
|
|
|
3370
3515
|
target,
|
|
3371
3516
|
reason
|
|
3372
3517
|
});
|
|
3373
|
-
if (reader.handleKindOf(request.ref) === "anchor") return fail("That reference points at a container, which cannot be acted on. Use it with perceive_page to read inside it, then act on an element
|
|
3518
|
+
if (reader.handleKindOf(request.ref) === "anchor") return fail("That reference points at a container, which cannot be acted on. Use it with perceive_page to read inside it, then act on an element that carries its own reference. If nothing inside it has one, this part of the page offers no action and retrying here will not help.");
|
|
3374
3519
|
if (reader.modalStateOf(element) === "unelevated") return fail("That dialog is not in the authorized scope because it was opened manually. Ask me to open it, or add it to the host allowlist.");
|
|
3375
3520
|
if (reader.modalStateOf(element) !== "elevated" && !reader.inActionScope(element)) return fail("The element is no longer inside the actionable scope.");
|
|
3376
3521
|
if (hidden(element)) return fail("The element is not visible.");
|
|
@@ -3463,8 +3608,10 @@ function createDomPageActionExecutor(options) {
|
|
|
3463
3608
|
* 它**不是** FR-11.5 那个容量闸门:那一条管的是「同时有几个**标签页**可操作」,
|
|
3464
3609
|
* 触顶硬拒绝,落在 `TabWorksetPolicy`。这里管的是同一个标签页里连续跳页攒下的历史分片,
|
|
3465
3610
|
* 那些本来就该失效,按最久未使用逐出即可,逐出不构成对模型的拒绝。
|
|
3611
|
+
* 软上限必须宽于 `TAB_WORKSET_MAX_MAX`(分册 18),否则工作集里**还活着**的页
|
|
3612
|
+
* 会因为别的页新发分片而被逐出;64 = 天花板 32 × 每页两代历史。
|
|
3466
3613
|
*/
|
|
3467
|
-
const SHARD_SOFT_LIMIT =
|
|
3614
|
+
const SHARD_SOFT_LIMIT = 64;
|
|
3468
3615
|
/** 不给 `shard` 时用的分片键;单分片宿主全程待在这一个分片里 */
|
|
3469
3616
|
const DEFAULT_SHARD = "";
|
|
3470
3617
|
/**
|
|
@@ -3486,7 +3633,7 @@ function explainResolution(resolution) {
|
|
|
3486
3633
|
}
|
|
3487
3634
|
/** @experimental */
|
|
3488
3635
|
function createRemoteTargetRegistry(options = {}) {
|
|
3489
|
-
const maxShards = Math.max(1, Math.trunc(options.maxShards ??
|
|
3636
|
+
const maxShards = Math.max(1, Math.trunc(options.maxShards ?? 64));
|
|
3490
3637
|
let shards = /* @__PURE__ */ new Map();
|
|
3491
3638
|
let refIndex = /* @__PURE__ */ new Map();
|
|
3492
3639
|
let focused = DEFAULT_SHARD;
|
|
@@ -5444,4 +5591,4 @@ function originOf(blockedURI) {
|
|
|
5444
5591
|
}
|
|
5445
5592
|
|
|
5446
5593
|
//#endregion
|
|
5447
|
-
export { BrowserSkillManager, BrowserWorkerScriptExecutor, ChromeBuiltinLlmClient, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, HOST_PORT_MATRIX, IframeWorkerLike, OpfsProvider, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, TsTranspiler, VIEWER_SANDBOX_TOKENS, WORKER_BOOTSTRAP_SOURCE, WorkerRuntimeClient, WorkerUiBridge, XLSX_UNEXTRACTED, blockedMessage, bridgeError, captureElementImage, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDocumentSurfaceHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, documentKey, explainResolution, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
|
|
5594
|
+
export { BrowserSkillManager, BrowserWorkerScriptExecutor, ChromeBuiltinLlmClient, DEFAULT_CAMERA_MAX_DIMENSION, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_UNEXTRACTED, HOST_PORT_MATRIX, IframeWorkerLike, OpfsProvider, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, TsTranspiler, VIEWER_SANDBOX_TOKENS, WORKER_BOOTSTRAP_SOURCE, WorkerRuntimeClient, WorkerUiBridge, XLSX_UNEXTRACTED, blockedMessage, bridgeError, captureElementImage, capturePhoto, checkCameraAvailability, checkDictationAvailability, compressImageToBudget, createBrowserChatbotHost, createDocumentSurfaceHost, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createRemotePageActionExecutor, createRemotePerceptionReader, createRemoteTargetRegistry, deleteMemoryEncryptionKey, documentKey, explainResolution, extractDocxText, extractXlsxText, extractZipWeb, generateMemoryEncryptionKey, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, missingPorts, openCamera, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, viewerCspHeader, watchBlockedResources };
|
package/dist/governance.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as UiBridge, U as FileSystemProvider, X as PageQuery, Y as Page, f as LlmMessage, ft as SkillDocument, gt as SkillManagerPort, l as LlmClient, ut as SkillCatalogEntry } from "./types-
|
|
2
|
-
import { $ as IntegrityVerdict, Wn as WebSkillRuntime, cn as SkillStateGuard, in as SkillOutcomeReporter, rn as SkillIntegrityGuard, zt as RuntimeRun } from "./index-
|
|
3
|
-
import { _ as SkillState, a as AuditLog, b as SkillVersionStore, c as CandidateFile, d as CandidateSkill, f as CandidateSource, g as SKILL_VERSION_PAGE_SIZE, h as CompositeApprovalPolicy, i as AuditEvent, l as CandidatePage, m as CandidateStore, n as ApprovalDecision, o as AuditQueryFilter, p as CandidateStatus, r as ApprovalPolicy, s as CANDIDATE_PAGE_SIZE, t as AlwaysHumanApprovalPolicy, u as CandidateRisk, v as SkillVersion, x as candidateToCatalogEntry, y as SkillVersionPage } from "./skillVersionStore-B24Jjjry-
|
|
1
|
+
import { S as UiBridge, U as FileSystemProvider, X as PageQuery, Y as Page, f as LlmMessage, ft as SkillDocument, gt as SkillManagerPort, l as LlmClient, ut as SkillCatalogEntry } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
|
+
import { $ as IntegrityVerdict, Wn as WebSkillRuntime, cn as SkillStateGuard, in as SkillOutcomeReporter, rn as SkillIntegrityGuard, zt as RuntimeRun } from "./index-BDyXe-a5.js";
|
|
3
|
+
import { _ as SkillState, a as AuditLog, b as SkillVersionStore, c as CandidateFile, d as CandidateSkill, f as CandidateSource, g as SKILL_VERSION_PAGE_SIZE, h as CompositeApprovalPolicy, i as AuditEvent, l as CandidatePage, m as CandidateStore, n as ApprovalDecision, o as AuditQueryFilter, p as CandidateStatus, r as ApprovalPolicy, s as CANDIDATE_PAGE_SIZE, t as AlwaysHumanApprovalPolicy, u as CandidateRisk, v as SkillVersion, x as candidateToCatalogEntry, y as SkillVersionPage } from "./skillVersionStore-B24Jjjry-v2CCU0Xo.js";
|
|
4
4
|
//#region ../governance/dist/index.d.ts
|
|
5
5
|
//#region src/candidate/candidateNormalizer.d.ts
|
|
6
6
|
/** 剥 markdown fence 与 <think> 块、截取首尾 {};非对象 → CANDIDATE_INVALID */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as ChatAttachmentKind, Nt as WebSkillErrorCode, S as UiBridge, Z as RemoteUrlPolicy, a as InteractionOrigin, c as InteractionResponse, s as InteractionRequest } from "./types-
|
|
2
|
-
import { Kn as XlsxTextExtractor, P as DocxTextExtractor, bn as ToolStepReader, j as DataSourceInfo, z as ExternalToolSource } from "./index-
|
|
1
|
+
import { I as ChatAttachmentKind, Nt as WebSkillErrorCode, S as UiBridge, Z as RemoteUrlPolicy, a as InteractionOrigin, c as InteractionResponse, s as InteractionRequest } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
|
+
import { Kn as XlsxTextExtractor, P as DocxTextExtractor, bn as ToolStepReader, j as DataSourceInfo, z as ExternalToolSource } from "./index-BDyXe-a5.js";
|
|
3
3
|
//#region ../agent/dist/index.d.ts
|
|
4
4
|
//#region src/todo/types.d.ts
|
|
5
5
|
/** 待办条目状态:未开始 / 进行中 / 已完成(FR-3.1) */
|
|
@@ -1464,11 +1464,11 @@ declare function createPageActionToolSource(options: PageActionToolSourceOptions
|
|
|
1464
1464
|
declare const PAGE_ACTION_SYSTEM_PROMPT: string;
|
|
1465
1465
|
//#endregion
|
|
1466
1466
|
//#region src/tabs/policy.d.ts
|
|
1467
|
-
/**
|
|
1468
|
-
declare const TAB_WORKSET_DEFAULT_MAX =
|
|
1467
|
+
/** 工作集容量缺省(分册 18);一屏索引视图的行数就是它要盖住的量,撞 `workset-full` 时模型没有任何入口能要更多 */
|
|
1468
|
+
declare const TAB_WORKSET_DEFAULT_MAX = 32;
|
|
1469
1469
|
/** 地板:2 的含义是「起点页 + 至少一个详情页」,低于它工作集这个概念就没有意义 */
|
|
1470
1470
|
declare const TAB_WORKSET_MIN_MAX = 2;
|
|
1471
|
-
/** 天花板:宿主写错一个 0
|
|
1471
|
+
/** 天花板:宿主写错一个 0 不该让一轮任务铺开几百个标签页。与缺省同值,宿主只调得低不调得高 */
|
|
1472
1472
|
declare const TAB_WORKSET_MAX_MAX = 32;
|
|
1473
1473
|
/**
|
|
1474
1474
|
* 夹取工作集容量(FR-11.5 / D-11-3)。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as ValidationReport, B as DiscoveryResult, K as JsonSchema, Nt as WebSkillErrorCode, O as UiSurfaceActionRequest, Ot as UiSpecNode, S as UiBridge, T as UiSpecEvent, U as FileSystemProvider, X as PageQuery, Y as Page, Z as RemoteUrlPolicy, _ as LlmToolSpec, _t as SkillManifest, b as RenderResultRequest, d as LlmContentPart, dt as SkillDiscovery, f as LlmMessage, ft as SkillDocument, g as LlmToolCall, h as LlmTokenUsage, i as FormField, l as LlmClient, lt as SkillCatalog, m as LlmStreamEvent, n as ArtifactStore, o as InteractionPolicy, p as LlmResponse, pt as SkillInstallSource, r as ChartSpec, s as InteractionRequest, t as Artifact, u as LlmCompleteInput, ut as SkillCatalogEntry, v as MemoryStore, w as UiSpecDrafts, y as RenderBlock } from "./types-
|
|
1
|
+
import { At as ValidationReport, B as DiscoveryResult, K as JsonSchema, Nt as WebSkillErrorCode, O as UiSurfaceActionRequest, Ot as UiSpecNode, S as UiBridge, T as UiSpecEvent, U as FileSystemProvider, X as PageQuery, Y as Page, Z as RemoteUrlPolicy, _ as LlmToolSpec, _t as SkillManifest, b as RenderResultRequest, d as LlmContentPart, dt as SkillDiscovery, f as LlmMessage, ft as SkillDocument, g as LlmToolCall, h as LlmTokenUsage, i as FormField, l as LlmClient, lt as SkillCatalog, m as LlmStreamEvent, n as ArtifactStore, o as InteractionPolicy, p as LlmResponse, pt as SkillInstallSource, r as ChartSpec, s as InteractionRequest, t as Artifact, u as LlmCompleteInput, ut as SkillCatalogEntry, v as MemoryStore, w as UiSpecDrafts, y as RenderBlock } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
2
|
//#region ../runtime/dist/index.d.ts
|
|
3
3
|
//#region src/llm/parts.d.ts
|
|
4
4
|
/** 纯文本消息内容的构造快捷方式(引擎内部绝大多数消息仍是纯文本) */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as UiSpecActionCapability, D as UiSpecSnapshot, K as JsonSchema, Ot as UiSpecNode, S as UiBridge, b as RenderResultRequest, c as InteractionResponse, r as ChartSpec, s as InteractionRequest, y as RenderBlock } from "./types-
|
|
2
|
-
import { z as ExternalToolSource } from "./index-
|
|
1
|
+
import { C as UiSpecActionCapability, D as UiSpecSnapshot, K as JsonSchema, Ot as UiSpecNode, S as UiBridge, b as RenderResultRequest, c as InteractionResponse, r as ChartSpec, s as InteractionRequest, y as RenderBlock } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
|
+
import { z as ExternalToolSource } from "./index-BDyXe-a5.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ComponentType, ReactNode } from "react";
|
|
5
5
|
//#region ../ui/dist/index.d.ts
|
|
@@ -668,6 +668,11 @@ interface InteractionSpecLabels {
|
|
|
668
668
|
title?: string;
|
|
669
669
|
submitLabel?: string;
|
|
670
670
|
cancelLabel?: string;
|
|
671
|
+
/**
|
|
672
|
+
* 正文覆写(分册 19 FR-19.1)。runtime 拼的英文原句是无字典层的正确产物,
|
|
673
|
+
* 但持有字典的宿主要能把它换成本地化文案;空串表示不渲染正文(同 `title`)。
|
|
674
|
+
*/
|
|
675
|
+
message?: string;
|
|
671
676
|
}
|
|
672
677
|
/**
|
|
673
678
|
* 五类 `InteractionRequest` → catalog 声明树。
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { $ as SKILLS_LOCKFILE, $t as messageOf, A as extractSkillCandidate, At as ValidationReport, B as DiscoveryResult, Bt as checkDependencyCycles, C as UiSpecActionCapability, Ct as SkillsLockfile, D as UiSpecSnapshot, Dt as UNTRUSTED_LINE_LIMIT, E as UiSpecPatch, Et as TrustedKeyStore, F as CatalogRenderer, Ft as assertRemoteUrlAllowed, G as IMAGE_MIME_TYPES, Gt as detectSkillArchiveShapeFromFs, H as FileStat, Ht as classifyAttachment, I as ChatAttachmentKind, It as assertSafePathSegment, J as MemoryFS, Jt as formatAttachmentText, K as JsonSchema, Kt as escapeXml, L as CryptoKeyLike, Lt as atomicWriteText, M as ATTACHMENT_TEXT_LIMIT, Mt as WebSkillError, N as ArchiveLimits, Nt as WebSkillErrorCode, O as UiSurfaceActionRequest, Ot as UiSpecNode, P as AttachmentTextInput, Pt as XLSX_MIME, Q as SIGNATURE_SCHEMA_VERSION, Qt as keyIdOf, R as DEFAULT_ARCHIVE_LIMITS, Rt as buildCatalog, S as UiBridge, St as SkillSource, T as UiSpecEvent, Tt as TrustedKey, U as FileSystemProvider, Ut as computeDigest, V as FILE_MIME_TYPES, Vt as checkSkillRules, W as FsTrustedKeyStore, Wt as detectSkillArchiveShape, X as PageQuery, Xt as isValidSkillName, Y as Page, Yt as isAtomicTempPath, Z as RemoteUrlPolicy, Zt as jsonRenderer, _ as LlmToolSpec, _n as xmlRenderer, _t as SkillManifest, a as InteractionOrigin, an as renderAvailableSkillsXml, at as SignatureAuditSink, b as RenderResultRequest, bt as SkillReader, c as InteractionResponse, cn as resolveInsideRoot, ct as SkillArchiveShape, d as LlmContentPart, dn as signaturePayloadBytes, dt as SkillDiscovery, en as normalizePath, et as SKILL_MANIFEST_FILE, f as LlmMessage, fn as stripArchiveRoot, ft as SkillDocument, g as LlmToolCall, gn as verifySkillSignature, gt as SkillManagerPort, h as LlmTokenUsage, hn as verifyManifest, ht as SkillLocation, i as FormField, in as readSkillSignature, it as SKILL_SIGNATURE_FILE, j as ATOMIC_TMP_SUFFIX_PATTERN, jt as VerifyResult, k as UiSurfaceActionResponse, kt as UnsignedPolicy, l as LlmClient, ln as sanitizeUntrustedLine, lt as SkillCatalog, m as LlmStreamEvent, mn as validateSkills, mt as SkillIssue, n as ArtifactStore, nn as parseSkillPackManifest, nt as SKILL_NAME_PATTERN, o as InteractionPolicy, on as renderCatalogJson, ot as SignatureVerdict, p as LlmResponse, pn as unzipWithLimits, pt as SkillInstallSource, q as MANIFEST_EXCLUDED_FILES, qt as exportSkills, r as ChartSpec, rn as readResponseWithLimit, rt as SKILL_PACK_FILE, s as InteractionRequest, sn as resolveArchiveLimits, st as SkillArchiveDetection, t as Artifact, tn as parseSkillMarkdown, tt as SKILL_NAME_MAX_LENGTH, u as LlmCompleteInput, un as signSkill, ut as SkillCatalogEntry, v as MemoryStore, vt as SkillMetadata, w as UiSpecDrafts, wt as TEXT_EXTENSIONS, x as SkillCandidateMarker, xt as SkillSignature, y as RenderBlock, yt as SkillPackManifest, z as DOCX_MIME, zt as buildManifest } from "./types-
|
|
2
|
-
import { $ as IntegrityVerdict, $n as diffUserProfile, $t as SessionMeta, A as DEFAULT_USER_PROFILE_LIMITS, An as USER_PROFILE_EXPORT_VERSION, Ar as schemaSourceLabel, At as RunToolCall, B as FS_SESSION_PAGE_SIZE, Bn as UserProfileImportDiff, Br as toVercelToolSpecs, Bt as RuntimeSession, C as CapabilityApproval, Cn as ToolStepTrust, Cr as readProfileEntries, Ct as RouteResult, D as DEFAULT_MAX_DOCUMENT_BYTES, Dn as TraceRecorder, Dr as renderUserProfileContext, Dt as RunSnapshotListEntry, E as DEFAULT_MAX_DATA_SOURCE_BYTES, En as TraceEventType, Er as refineUserProfile, Et as RunSnapshot, F as EMPTY_USER_PROFILE, Fn as UnsupportedRunSnapshot, Fr as summarizeToolCalls, Ft as RunTraceSummary, G as FsSessionStore, Gn as WebSkillRuntimeDeps, Gt as SchemaInferer, H as FsMemoryStore, Hn as VercelToolSpec, Hr as validateUiSpecNode, Ht as SENSITIVE_ANNOTATION, I as EventBus, In as UploadFileInfo, Ir as textParts, It as RunUploadFiles, J as GoogleGenAiClient, Jn as applyUserProfileImport, Jt as SealOptions, K as FsToolStepStore, Kn as XlsxTextExtractor, Kt as ScriptExecutionContext, L as ExecuteLifecycleData, Ln as UserProfile, Lr as toBase64, Lt as RunUsageSummary, M as DocumentSurfaceHost, Mn as USER_PROFILE_NO_INVENTION_RULE, Mr as scriptToolName, Mt as RunTraceFilter, N as DocumentSurfacePort, Nn as USER_PROFILE_PROMPT_HEADER, Nr as sealToolCallPairs, Nt as RunTraceMetrics, O as DEFAULT_MAX_DOCUMENT_TEXT_BYTES, On as UNSUPPORTED_DOCUMENT_MESSAGE, Or as resolveToolName, Ot as RunSnapshotStore, P as DocxTextExtractor, Pn as USER_PROFILE_REFINE_PROMPT, Pr as summarizeRunUsage, Pt as RunTraceStore, Q as InstalledSkillManifest, Qn as createWebSkillApi, Qt as SessionListPage, R as ExternalSkillProvider, Rn as UserProfileEntry, Rr as toLlmToolSpec, Rt as RuntimePhase, S as BridgeResponse, Sn as ToolStepStore, Sr as readBehaviorRecords, St as RouteLifecycleData, T as DEFAULT_LOOP_LIMITS, Tn as TraceEvent, Tr as redactToolStepArgs, Tt as RunResult, U as FsRunSnapshotStore, Un as WebSkillApi, Ut as SESSION_SCHEMA_VERSION, V as FsArtifactStore, Vn as UserProfileLimits, Vr as validateUiSpecEvent, Vt as RuntimeSessionHandle, W as FsRunTraceStore, Wn as WebSkillRuntime, Wt as SUPPORTED_DOCUMENT_MIME, X as HookRunner, Xn as buildRenderResult, Xt as SealResult, Y as GoogleGenAiClientConfig, Yn as bridgeError, Yt as SealRecord, Z as HookRunnerOptions, Zn as createScriptContext, Zt as SerializingMemoryStore, _ as BehaviorRecordKind, _n as ToolDisclosure, _r as normalizeToolContent, _t as READ_SKILL_FILE_TOOL_NAME, a as ASK_USER_TOOL, an as SkillRouter, ar as formatSkillScriptManifest, at as LifecycleListener, b as BridgeCapability, bn as ToolStepReader, br as parseUserProfileExport, bt as RedactedArgs, c as AgentLoop, cn as SkillStateGuard, cr as interruptedToolResult, ct as NetworkPolicy, d as AnthropicClient, dn as TerminalLifecycleData, dr as listSkillScripts, dt as PdfTextExtractor, en as SessionRecord, er as exportUserProfile, et as InteractLifecycleData, f as AnthropicClientConfig, fn as TextualToolContent, fr as mergeCatalogEntries, ft as ProgressiveRouter, g as BehaviorRecord, gn as ToolDefinition, gr as normalizeErrorCode, gt as READ_SKILL_FILE_TOOL, h as BEHAVIOR_RECORDS_KEY, hn as ToolContent, hr as networkUrlHost, ht as READ_SKILL_FILE_INPUT_SCHEMA, i as ASK_USER_MAX_FIELDS, in as SkillOutcomeReporter, ir as findUnpairedToolCalls, it as LifecycleHookContext, j as DataSourceInfo, jn as USER_PROFILE_KEY, jr as schemaToForm, jt as RunTraceFile, k as DEFAULT_MAX_UPLOAD_FILE_BYTES, kn as UPLOAD_FILES_UNAVAILABLE, kr as sampleBehaviorRecords, kt as RunTerminationReason, l as AgentLoopConfig, ln as SkillSuccessReport, lr as isNetworkAllowed, lt as OpenAiCompatibleClient, m as ApprovalScope, mn as ToolCallContext, mr as networkPolicyLibSource, mt as READ_LINKED_DOCUMENT_TOOL_NAME, n as ASK_USER_FIELD_TYPES, nn as SkillFailureReport, nr as extractTodoTraceEvents, nt as LifecycleEventInit, o as ASK_USER_TOOL_NAME, on as SkillScriptDescriptor, or as fromVercelResult, ot as LinkedDocumentReader, p as ApprovalDecision, pn as TodoTraceEvent, pr as mergeProfileEntries, pt as READ_LINKED_DOCUMENT_TOOL, q as FullDisclosureRouter, qn as appendBehaviorRecords, qt as ScriptExecutor, r as ASK_USER_INPUT_SCHEMA, rn as SkillIntegrityGuard, rr as extractUiSpecEvents, rt as LifecycleHook, s as ActivateLifecycleData, sn as SkillScriptSchemaSource, sr as fromVercelStreamPart, st as MAX_TOOL_STEP_ARG_BYTES, t as ALLOWED_TOOLS_EXCLUSION_REASON, tn as SessionStore, tr as extractChartSpec, tt as LifecycleEvent, u as AgentLoopDeps, un as TEXT_BUDGETED_CONTENT_TYPES, ur as isUnsupportedRunSnapshot, ut as OpenAiCompatibleClientConfig, v as BehaviorScene, vn as ToolResolution, vr as normalizeToolError, vt as RUN_SNAPSHOT_SCHEMA_VERSION, w as CapabilityMode, wn as TraceClock, wr as readUserProfile, wt as RunLimitErrorDetails, x as BridgeRequest, xn as ToolStepRecord, xr as partsToText, xt as RefineUserProfileInput, y as BridgeCapabilities, yn as ToolResult, yr as parseBridgeRequest, yt as RUN_TRACE_SCHEMA_VERSION, z as ExternalToolSource, zn as UserProfileExport, zr as toRecordDigests, zt as RuntimeRun } from "./index-
|
|
1
|
+
import { $ as SKILLS_LOCKFILE, $t as messageOf, A as extractSkillCandidate, At as ValidationReport, B as DiscoveryResult, Bt as checkDependencyCycles, C as UiSpecActionCapability, Ct as SkillsLockfile, D as UiSpecSnapshot, Dt as UNTRUSTED_LINE_LIMIT, E as UiSpecPatch, Et as TrustedKeyStore, F as CatalogRenderer, Ft as assertRemoteUrlAllowed, G as IMAGE_MIME_TYPES, Gt as detectSkillArchiveShapeFromFs, H as FileStat, Ht as classifyAttachment, I as ChatAttachmentKind, It as assertSafePathSegment, J as MemoryFS, Jt as formatAttachmentText, K as JsonSchema, Kt as escapeXml, L as CryptoKeyLike, Lt as atomicWriteText, M as ATTACHMENT_TEXT_LIMIT, Mt as WebSkillError, N as ArchiveLimits, Nt as WebSkillErrorCode, O as UiSurfaceActionRequest, Ot as UiSpecNode, P as AttachmentTextInput, Pt as XLSX_MIME, Q as SIGNATURE_SCHEMA_VERSION, Qt as keyIdOf, R as DEFAULT_ARCHIVE_LIMITS, Rt as buildCatalog, S as UiBridge, St as SkillSource, T as UiSpecEvent, Tt as TrustedKey, U as FileSystemProvider, Ut as computeDigest, V as FILE_MIME_TYPES, Vt as checkSkillRules, W as FsTrustedKeyStore, Wt as detectSkillArchiveShape, X as PageQuery, Xt as isValidSkillName, Y as Page, Yt as isAtomicTempPath, Z as RemoteUrlPolicy, Zt as jsonRenderer, _ as LlmToolSpec, _n as xmlRenderer, _t as SkillManifest, a as InteractionOrigin, an as renderAvailableSkillsXml, at as SignatureAuditSink, b as RenderResultRequest, bt as SkillReader, c as InteractionResponse, cn as resolveInsideRoot, ct as SkillArchiveShape, d as LlmContentPart, dn as signaturePayloadBytes, dt as SkillDiscovery, en as normalizePath, et as SKILL_MANIFEST_FILE, f as LlmMessage, fn as stripArchiveRoot, ft as SkillDocument, g as LlmToolCall, gn as verifySkillSignature, gt as SkillManagerPort, h as LlmTokenUsage, hn as verifyManifest, ht as SkillLocation, i as FormField, in as readSkillSignature, it as SKILL_SIGNATURE_FILE, j as ATOMIC_TMP_SUFFIX_PATTERN, jt as VerifyResult, k as UiSurfaceActionResponse, kt as UnsignedPolicy, l as LlmClient, ln as sanitizeUntrustedLine, lt as SkillCatalog, m as LlmStreamEvent, mn as validateSkills, mt as SkillIssue, n as ArtifactStore, nn as parseSkillPackManifest, nt as SKILL_NAME_PATTERN, o as InteractionPolicy, on as renderCatalogJson, ot as SignatureVerdict, p as LlmResponse, pn as unzipWithLimits, pt as SkillInstallSource, q as MANIFEST_EXCLUDED_FILES, qt as exportSkills, r as ChartSpec, rn as readResponseWithLimit, rt as SKILL_PACK_FILE, s as InteractionRequest, sn as resolveArchiveLimits, st as SkillArchiveDetection, t as Artifact, tn as parseSkillMarkdown, tt as SKILL_NAME_MAX_LENGTH, u as LlmCompleteInput, un as signSkill, ut as SkillCatalogEntry, v as MemoryStore, vt as SkillMetadata, w as UiSpecDrafts, wt as TEXT_EXTENSIONS, x as SkillCandidateMarker, xt as SkillSignature, y as RenderBlock, yt as SkillPackManifest, z as DOCX_MIME, zt as buildManifest } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
|
+
import { $ as IntegrityVerdict, $n as diffUserProfile, $t as SessionMeta, A as DEFAULT_USER_PROFILE_LIMITS, An as USER_PROFILE_EXPORT_VERSION, Ar as schemaSourceLabel, At as RunToolCall, B as FS_SESSION_PAGE_SIZE, Bn as UserProfileImportDiff, Br as toVercelToolSpecs, Bt as RuntimeSession, C as CapabilityApproval, Cn as ToolStepTrust, Cr as readProfileEntries, Ct as RouteResult, D as DEFAULT_MAX_DOCUMENT_BYTES, Dn as TraceRecorder, Dr as renderUserProfileContext, Dt as RunSnapshotListEntry, E as DEFAULT_MAX_DATA_SOURCE_BYTES, En as TraceEventType, Er as refineUserProfile, Et as RunSnapshot, F as EMPTY_USER_PROFILE, Fn as UnsupportedRunSnapshot, Fr as summarizeToolCalls, Ft as RunTraceSummary, G as FsSessionStore, Gn as WebSkillRuntimeDeps, Gt as SchemaInferer, H as FsMemoryStore, Hn as VercelToolSpec, Hr as validateUiSpecNode, Ht as SENSITIVE_ANNOTATION, I as EventBus, In as UploadFileInfo, Ir as textParts, It as RunUploadFiles, J as GoogleGenAiClient, Jn as applyUserProfileImport, Jt as SealOptions, K as FsToolStepStore, Kn as XlsxTextExtractor, Kt as ScriptExecutionContext, L as ExecuteLifecycleData, Ln as UserProfile, Lr as toBase64, Lt as RunUsageSummary, M as DocumentSurfaceHost, Mn as USER_PROFILE_NO_INVENTION_RULE, Mr as scriptToolName, Mt as RunTraceFilter, N as DocumentSurfacePort, Nn as USER_PROFILE_PROMPT_HEADER, Nr as sealToolCallPairs, Nt as RunTraceMetrics, O as DEFAULT_MAX_DOCUMENT_TEXT_BYTES, On as UNSUPPORTED_DOCUMENT_MESSAGE, Or as resolveToolName, Ot as RunSnapshotStore, P as DocxTextExtractor, Pn as USER_PROFILE_REFINE_PROMPT, Pr as summarizeRunUsage, Pt as RunTraceStore, Q as InstalledSkillManifest, Qn as createWebSkillApi, Qt as SessionListPage, R as ExternalSkillProvider, Rn as UserProfileEntry, Rr as toLlmToolSpec, Rt as RuntimePhase, S as BridgeResponse, Sn as ToolStepStore, Sr as readBehaviorRecords, St as RouteLifecycleData, T as DEFAULT_LOOP_LIMITS, Tn as TraceEvent, Tr as redactToolStepArgs, Tt as RunResult, U as FsRunSnapshotStore, Un as WebSkillApi, Ut as SESSION_SCHEMA_VERSION, V as FsArtifactStore, Vn as UserProfileLimits, Vr as validateUiSpecEvent, Vt as RuntimeSessionHandle, W as FsRunTraceStore, Wn as WebSkillRuntime, Wt as SUPPORTED_DOCUMENT_MIME, X as HookRunner, Xn as buildRenderResult, Xt as SealResult, Y as GoogleGenAiClientConfig, Yn as bridgeError, Yt as SealRecord, Z as HookRunnerOptions, Zn as createScriptContext, Zt as SerializingMemoryStore, _ as BehaviorRecordKind, _n as ToolDisclosure, _r as normalizeToolContent, _t as READ_SKILL_FILE_TOOL_NAME, a as ASK_USER_TOOL, an as SkillRouter, ar as formatSkillScriptManifest, at as LifecycleListener, b as BridgeCapability, bn as ToolStepReader, br as parseUserProfileExport, bt as RedactedArgs, c as AgentLoop, cn as SkillStateGuard, cr as interruptedToolResult, ct as NetworkPolicy, d as AnthropicClient, dn as TerminalLifecycleData, dr as listSkillScripts, dt as PdfTextExtractor, en as SessionRecord, er as exportUserProfile, et as InteractLifecycleData, f as AnthropicClientConfig, fn as TextualToolContent, fr as mergeCatalogEntries, ft as ProgressiveRouter, g as BehaviorRecord, gn as ToolDefinition, gr as normalizeErrorCode, gt as READ_SKILL_FILE_TOOL, h as BEHAVIOR_RECORDS_KEY, hn as ToolContent, hr as networkUrlHost, ht as READ_SKILL_FILE_INPUT_SCHEMA, i as ASK_USER_MAX_FIELDS, in as SkillOutcomeReporter, ir as findUnpairedToolCalls, it as LifecycleHookContext, j as DataSourceInfo, jn as USER_PROFILE_KEY, jr as schemaToForm, jt as RunTraceFile, k as DEFAULT_MAX_UPLOAD_FILE_BYTES, kn as UPLOAD_FILES_UNAVAILABLE, kr as sampleBehaviorRecords, kt as RunTerminationReason, l as AgentLoopConfig, ln as SkillSuccessReport, lr as isNetworkAllowed, lt as OpenAiCompatibleClient, m as ApprovalScope, mn as ToolCallContext, mr as networkPolicyLibSource, mt as READ_LINKED_DOCUMENT_TOOL_NAME, n as ASK_USER_FIELD_TYPES, nn as SkillFailureReport, nr as extractTodoTraceEvents, nt as LifecycleEventInit, o as ASK_USER_TOOL_NAME, on as SkillScriptDescriptor, or as fromVercelResult, ot as LinkedDocumentReader, p as ApprovalDecision, pn as TodoTraceEvent, pr as mergeProfileEntries, pt as READ_LINKED_DOCUMENT_TOOL, q as FullDisclosureRouter, qn as appendBehaviorRecords, qt as ScriptExecutor, r as ASK_USER_INPUT_SCHEMA, rn as SkillIntegrityGuard, rr as extractUiSpecEvents, rt as LifecycleHook, s as ActivateLifecycleData, sn as SkillScriptSchemaSource, sr as fromVercelStreamPart, st as MAX_TOOL_STEP_ARG_BYTES, t as ALLOWED_TOOLS_EXCLUSION_REASON, tn as SessionStore, tr as extractChartSpec, tt as LifecycleEvent, u as AgentLoopDeps, un as TEXT_BUDGETED_CONTENT_TYPES, ur as isUnsupportedRunSnapshot, ut as OpenAiCompatibleClientConfig, v as BehaviorScene, vn as ToolResolution, vr as normalizeToolError, vt as RUN_SNAPSHOT_SCHEMA_VERSION, w as CapabilityMode, wn as TraceClock, wr as readUserProfile, wt as RunLimitErrorDetails, x as BridgeRequest, xn as ToolStepRecord, xr as partsToText, xt as RefineUserProfileInput, y as BridgeCapabilities, yn as ToolResult, yr as parseBridgeRequest, yt as RUN_TRACE_SCHEMA_VERSION, z as ExternalToolSource, zn as UserProfileExport, zr as toRecordDigests, zt as RuntimeRun } from "./index-BDyXe-a5.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.17.0";
|
|
10
10
|
//#endregion
|
|
11
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, ATTACHMENT_TEXT_LIMIT, type ActivateLifecycleData, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, AnthropicClient, type AnthropicClientConfig, type ApprovalDecision, type ApprovalScope, type ArchiveLimits, type Artifact, type ArtifactStore, type AttachmentTextInput, 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 ChatAttachmentKind, type CryptoKeyLike, DEFAULT_ARCHIVE_LIMITS, DEFAULT_LOOP_LIMITS, DEFAULT_MAX_DATA_SOURCE_BYTES, DEFAULT_MAX_DOCUMENT_BYTES, DEFAULT_MAX_DOCUMENT_TEXT_BYTES, DEFAULT_MAX_UPLOAD_FILE_BYTES, DEFAULT_USER_PROFILE_LIMITS, DOCX_MIME, type DataSourceInfo, type DiscoveryResult, type DocumentSurfaceHost, type DocumentSurfacePort, type DocxTextExtractor, EMPTY_USER_PROFILE, EventBus, type ExecuteLifecycleData, type ExternalSkillProvider, type ExternalToolSource, FILE_MIME_TYPES, FS_SESSION_PAGE_SIZE, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsToolStepStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, type GoogleGenAiClientConfig, HookRunner, type HookRunnerOptions, IMAGE_MIME_TYPES, 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 RunUploadFiles, 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, TEXT_EXTENSIONS, type TerminalLifecycleData, type TextualToolContent, type TodoTraceEvent, type ToolCallContext, 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, UNTRUSTED_LINE_LIMIT, UPLOAD_FILES_UNAVAILABLE, 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 UploadFileInfo, type UserProfile, type UserProfileEntry, type UserProfileExport, type UserProfileImportDiff, type UserProfileLimits, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, XLSX_MIME, type XlsxTextExtractor, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, classifyAttachment, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatAttachmentText, 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, sanitizeUntrustedLine, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeRunUsage, summarizeToolCalls, textParts, toBase64, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/index.js
CHANGED
|
@@ -3,13 +3,13 @@ import { A as SKILL_MANIFEST_FILE, C as keyIdOf, D as verifySkillSignature, E as
|
|
|
3
3
|
import { a as atomicWriteText, i as ATOMIC_TMP_SUFFIX_PATTERN, n as normalizePath, o as isAtomicTempPath, r as resolveInsideRoot, t as assertSafePathSegment } from "./pathSecurity-B1owvJAF.js";
|
|
4
4
|
import { t as assertRemoteUrlAllowed } from "./urlSafety-CiSuCJvX.js";
|
|
5
5
|
import { a as TEXT_EXTENSIONS, c as formatAttachmentText, i as IMAGE_MIME_TYPES, l as UNTRUSTED_LINE_LIMIT, n as DOCX_MIME, o as XLSX_MIME, r as FILE_MIME_TYPES, s as classifyAttachment, t as ATTACHMENT_TEXT_LIMIT, u as sanitizeUntrustedLine } from "./kind-DxgS8LM-.js";
|
|
6
|
-
import { $ as scriptToolName, A as readUserProfile, B as createScriptContext, C as TraceRecorder, D as mergeProfileEntries, E as appendBehaviorRecords, F as DEFAULT_USER_PROFILE_LIMITS, G as ASK_USER_TOOL_NAME, H as ASK_USER_INPUT_SCHEMA, I as EMPTY_USER_PROFILE, J as READ_SKILL_FILE_TOOL_NAME, K as READ_SKILL_FILE_INPUT_SCHEMA, L as SerializingMemoryStore, M as USER_PROFILE_NO_INVENTION_RULE, N as USER_PROFILE_PROMPT_HEADER, O as readBehaviorRecords, P as renderUserProfileContext, Q as schemaSourceLabel, R as EventBus, S as extractTodoTraceEvents, T as USER_PROFILE_KEY, U as ASK_USER_MAX_FIELDS, V as ASK_USER_FIELD_TYPES, W as ASK_USER_TOOL, X as formatSkillScriptManifest, Y as ALLOWED_TOOLS_EXCLUSION_REASON, Z as listSkillScripts, _ as RUN_SNAPSHOT_SCHEMA_VERSION, a as networkPolicyLibSource, at as xmlRenderer, b as MAX_TOOL_STEP_ARG_BYTES, c as bridgeError, d as FsMemoryStore, et as resolveToolName, f as WebSkillRuntime, g as FsRunSnapshotStore, h as redactToolStepArgs, i as isNetworkAllowed, it as renderAvailableSkillsXml, j as sampleBehaviorRecords, k as readProfileEntries, l as parseBridgeRequest, m as SENSITIVE_ANNOTATION, n as normalizeErrorCode, nt as ProgressiveRouter, o as networkUrlHost, p as AgentLoop, q as READ_SKILL_FILE_TOOL, r as normalizeToolError, rt as escapeXml, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, tt as toLlmToolSpec, u as FsArtifactStore, v as isUnsupportedRunSnapshot, w as BEHAVIOR_RECORDS_KEY, x as extractSkillCandidate, y as DEFAULT_LOOP_LIMITS, z as schemaToForm } from "./approval-
|
|
6
|
+
import { $ as scriptToolName, A as readUserProfile, B as createScriptContext, C as TraceRecorder, D as mergeProfileEntries, E as appendBehaviorRecords, F as DEFAULT_USER_PROFILE_LIMITS, G as ASK_USER_TOOL_NAME, H as ASK_USER_INPUT_SCHEMA, I as EMPTY_USER_PROFILE, J as READ_SKILL_FILE_TOOL_NAME, K as READ_SKILL_FILE_INPUT_SCHEMA, L as SerializingMemoryStore, M as USER_PROFILE_NO_INVENTION_RULE, N as USER_PROFILE_PROMPT_HEADER, O as readBehaviorRecords, P as renderUserProfileContext, Q as schemaSourceLabel, R as EventBus, S as extractTodoTraceEvents, T as USER_PROFILE_KEY, U as ASK_USER_MAX_FIELDS, V as ASK_USER_FIELD_TYPES, W as ASK_USER_TOOL, X as formatSkillScriptManifest, Y as ALLOWED_TOOLS_EXCLUSION_REASON, Z as listSkillScripts, _ as RUN_SNAPSHOT_SCHEMA_VERSION, a as networkPolicyLibSource, at as xmlRenderer, b as MAX_TOOL_STEP_ARG_BYTES, c as bridgeError, d as FsMemoryStore, et as resolveToolName, f as WebSkillRuntime, g as FsRunSnapshotStore, h as redactToolStepArgs, i as isNetworkAllowed, it as renderAvailableSkillsXml, j as sampleBehaviorRecords, k as readProfileEntries, l as parseBridgeRequest, m as SENSITIVE_ANNOTATION, n as normalizeErrorCode, nt as ProgressiveRouter, o as networkUrlHost, p as AgentLoop, q as READ_SKILL_FILE_TOOL, r as normalizeToolError, rt as escapeXml, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, tt as toLlmToolSpec, u as FsArtifactStore, v as isUnsupportedRunSnapshot, w as BEHAVIOR_RECORDS_KEY, x as extractSkillCandidate, y as DEFAULT_LOOP_LIMITS, z as schemaToForm } from "./approval-CBPnGPIm.js";
|
|
7
7
|
import { a as GoogleGenAiClient, c as findUnpairedToolCalls, d as partsToText, f as promptText, i as toVercelToolSpecs, l as interruptedToolResult, n as fromVercelResult, o as AnthropicClient, p as textParts, r as fromVercelStreamPart, s as OpenAiCompatibleClient, u as sealToolCallPairs } from "./llm-B7lLH0ZI.js";
|
|
8
8
|
import { c as DEFAULT_MAX_DOCUMENT_BYTES, d as TEXT_BUDGETED_CONTENT_TYPES, i as UNSUPPORTED_DOCUMENT_MESSAGE, l as DEFAULT_MAX_DOCUMENT_TEXT_BYTES, n as READ_LINKED_DOCUMENT_TOOL_NAME, o as toBase64, r as SUPPORTED_DOCUMENT_MIME, s as DEFAULT_MAX_DATA_SOURCE_BYTES, t as READ_LINKED_DOCUMENT_TOOL, u as DEFAULT_MAX_UPLOAD_FILE_BYTES } from "./linkedDocument-xNXF-z8n.js";
|
|
9
9
|
import { n as normalizeToolContent, t as mergeCatalogEntries } from "./external-_ZRQe-V9.js";
|
|
10
10
|
import { n as extractChartSpec, t as buildRenderResult } from "./renderResult-D9Q-Vu2x.js";
|
|
11
11
|
import { n as validateUiSpecEvent, r as validateUiSpecNode, t as extractUiSpecEvents } from "./surface-DVGiCmwq.js";
|
|
12
|
-
import { t as createWebSkillApi } from "./webSkillApi-
|
|
12
|
+
import { t as createWebSkillApi } from "./webSkillApi-Ce2OO5S5.js";
|
|
13
13
|
|
|
14
14
|
//#region ../core/src/fs/memoryFs.ts
|
|
15
15
|
const ROOT = "/";
|
|
@@ -1004,7 +1004,7 @@ var FsToolStepStore = class {
|
|
|
1004
1004
|
* Version of the published `@webskill/sdk` package, injected at build time.
|
|
1005
1005
|
* @stable
|
|
1006
1006
|
*/
|
|
1007
|
-
const SDK_VERSION = "0.
|
|
1007
|
+
const SDK_VERSION = "0.17.0";
|
|
1008
1008
|
|
|
1009
1009
|
//#endregion
|
|
1010
1010
|
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, ATTACHMENT_TEXT_LIMIT, 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_MAX_UPLOAD_FILE_BYTES, DEFAULT_USER_PROFILE_LIMITS, DOCX_MIME, EMPTY_USER_PROFILE, EventBus, FILE_MIME_TYPES, FS_SESSION_PAGE_SIZE, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsToolStepStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, IMAGE_MIME_TYPES, 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, TEXT_EXTENSIONS, TraceRecorder, UNSUPPORTED_DOCUMENT_MESSAGE, UNTRUSTED_LINE_LIMIT, UPLOAD_FILES_UNAVAILABLE, USER_PROFILE_EXPORT_VERSION, USER_PROFILE_KEY, USER_PROFILE_NO_INVENTION_RULE, USER_PROFILE_PROMPT_HEADER, USER_PROFILE_REFINE_PROMPT, WebSkillError, WebSkillRuntime, XLSX_MIME, appendBehaviorRecords, applyUserProfileImport, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, classifyAttachment, computeDigest, createScriptContext, createWebSkillApi, detectSkillArchiveShape, detectSkillArchiveShapeFromFs, diffUserProfile, escapeXml, exportSkills, exportUserProfile, extractChartSpec, extractSkillCandidate, extractTodoTraceEvents, extractUiSpecEvents, findUnpairedToolCalls, formatAttachmentText, 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, sanitizeUntrustedLine, schemaSourceLabel, schemaToForm, scriptToolName, sealToolCallPairs, signSkill, signaturePayloadBytes, stripArchiveRoot, summarizeRunUsage, summarizeToolCalls, textParts, toBase64, toLlmToolSpec, toRecordDigests, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { K as JsonSchema, _ as LlmToolSpec, ft as SkillDocument, ut as SkillCatalogEntry } from "./types-
|
|
2
|
-
import { R as ExternalSkillProvider, _n as ToolDisclosure, fr as mergeCatalogEntries, yn as ToolResult, z as ExternalToolSource } from "./index-
|
|
1
|
+
import { K as JsonSchema, _ as LlmToolSpec, ft as SkillDocument, ut as SkillCatalogEntry } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
|
+
import { R as ExternalSkillProvider, _n as ToolDisclosure, fr as mergeCatalogEntries, yn as ToolResult, z as ExternalToolSource } from "./index-BDyXe-a5.js";
|
|
3
3
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
4
4
|
import { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as SKILLS_LOCKFILE, Ct as SkillsLockfile, Et as TrustedKeyStore, H as FileStat, K as JsonSchema, N as ArchiveLimits, S as UiBridge, U as FileSystemProvider, _t as SkillManifest, at as SignatureAuditSink, b as RenderResultRequest, c as InteractionResponse, et as SKILL_MANIFEST_FILE, gt as SkillManagerPort, jt as VerifyResult, kt as UnsignedPolicy, pt as SkillInstallSource, s as InteractionRequest } from "./types-
|
|
2
|
-
import { Gn as WebSkillRuntimeDeps, Gt as SchemaInferer, H as FsMemoryStore, Kt as ScriptExecutionContext, V as FsArtifactStore, Wn as WebSkillRuntime, Zn as createScriptContext, ct as NetworkPolicy, gn as ToolDefinition, m as ApprovalScope, qt as ScriptExecutor, y as BridgeCapabilities, yn as ToolResult } from "./index-
|
|
3
|
-
import { a as AuditLog, b as SkillVersionStore, d as CandidateSkill, m as CandidateStore, r as ApprovalPolicy } from "./skillVersionStore-B24Jjjry-
|
|
1
|
+
import { $ as SKILLS_LOCKFILE, Ct as SkillsLockfile, Et as TrustedKeyStore, H as FileStat, K as JsonSchema, N as ArchiveLimits, S as UiBridge, U as FileSystemProvider, _t as SkillManifest, at as SignatureAuditSink, b as RenderResultRequest, c as InteractionResponse, et as SKILL_MANIFEST_FILE, gt as SkillManagerPort, jt as VerifyResult, kt as UnsignedPolicy, pt as SkillInstallSource, s as InteractionRequest } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
|
+
import { Gn as WebSkillRuntimeDeps, Gt as SchemaInferer, H as FsMemoryStore, Kt as ScriptExecutionContext, V as FsArtifactStore, Wn as WebSkillRuntime, Zn as createScriptContext, ct as NetworkPolicy, gn as ToolDefinition, m as ApprovalScope, qt as ScriptExecutor, y as BridgeCapabilities, yn as ToolResult } from "./index-BDyXe-a5.js";
|
|
3
|
+
import { a as AuditLog, b as SkillVersionStore, d as CandidateSkill, m as CandidateStore, r as ApprovalPolicy } from "./skillVersionStore-B24Jjjry-v2CCU0Xo.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
|
package/dist/node.js
CHANGED
|
@@ -2,7 +2,7 @@ import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
|
2
2
|
import { A as SKILL_MANIFEST_FILE, D as verifySkillSignature, M as buildManifest, O as MANIFEST_EXCLUDED_FILES, P as verifyManifest, b as parseSkillMarkdown, c as unzipWithLimits, f as SKILL_PACK_FILE, k as SKILLS_LOCKFILE, m as parseSkillPackManifest, o as readResponseWithLimit, p as exportSkills, s as resolveArchiveLimits, t as validateSkills, w as readSkillSignature, y as isValidSkillName } from "./skill-CAJMsLod.js";
|
|
3
3
|
import { a as atomicWriteText, o as isAtomicTempPath, r as resolveInsideRoot, t as assertSafePathSegment } from "./pathSecurity-B1owvJAF.js";
|
|
4
4
|
import { t as assertRemoteUrlAllowed } from "./urlSafety-CiSuCJvX.js";
|
|
5
|
-
import { B as createScriptContext, a as networkPolicyLibSource, c as bridgeError, d as FsMemoryStore, f as WebSkillRuntime, l as parseBridgeRequest, r as normalizeToolError, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, u as FsArtifactStore } from "./approval-
|
|
5
|
+
import { B as createScriptContext, a as networkPolicyLibSource, c as bridgeError, d as FsMemoryStore, f as WebSkillRuntime, l as parseBridgeRequest, r as normalizeToolError, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, u as FsArtifactStore } from "./approval-CBPnGPIm.js";
|
|
6
6
|
import { n as normalizeToolContent } from "./external-_ZRQe-V9.js";
|
|
7
7
|
import { i as probeLlmCapabilities } from "./env-Bj1MI2Ww.js";
|
|
8
8
|
import { t as AUDIT_EVENT_TYPES } from "./eventTypes-CwciaqCU.js";
|
|
@@ -500,13 +500,16 @@ var SandboxedScriptExecutor = class {
|
|
|
500
500
|
}
|
|
501
501
|
/** 能力桥宿主侧处理:能力关闭/授权拒绝即 TOOL_UNSUPPORTED;判定逻辑共用 runtime/sandbox/approval */
|
|
502
502
|
async #handleBridge(request, context) {
|
|
503
|
-
const gate = async (capability, message, details) => {
|
|
503
|
+
const gate = async (capability, message, details = {}) => {
|
|
504
504
|
const decision = await this.#approval.authorize({
|
|
505
505
|
runId: context.runId,
|
|
506
506
|
capability,
|
|
507
507
|
mode: this.#capabilities[capability],
|
|
508
508
|
message,
|
|
509
|
-
|
|
509
|
+
details: {
|
|
510
|
+
skill: context.skillName,
|
|
511
|
+
...details
|
|
512
|
+
}
|
|
510
513
|
});
|
|
511
514
|
if (decision === "allowed") return void 0;
|
|
512
515
|
return bridgeError(request.id, "TOOL_UNSUPPORTED", decision === "disabled" ? `Capability "${capability}" is disabled by the sandbox capability settings` : `Capability "${capability}" was denied by the user`);
|
|
@@ -564,7 +567,7 @@ var SandboxedScriptExecutor = class {
|
|
|
564
567
|
}
|
|
565
568
|
case "confirm": {
|
|
566
569
|
if (!context.confirm) return bridgeError(request.id, "TOOL_UNSUPPORTED", "Capability \"confirm\" is disabled");
|
|
567
|
-
const denied = await gate("confirm", `Script "${context.skillName}" asks for confirmation: ${request.message}
|
|
570
|
+
const denied = await gate("confirm", `Script "${context.skillName}" asks for confirmation: ${request.message}`, { question: request.message });
|
|
568
571
|
if (denied) return denied;
|
|
569
572
|
return {
|
|
570
573
|
id: request.id,
|
|
@@ -895,13 +898,16 @@ var ProcessSandboxExecutor = class {
|
|
|
895
898
|
}
|
|
896
899
|
/** 能力桥宿主侧处理:与 worker_threads 沙箱同一判定(runtime/sandbox/approval 单一来源) */
|
|
897
900
|
async #handleBridge(request, context) {
|
|
898
|
-
const gate = async (capability, message, details) => {
|
|
901
|
+
const gate = async (capability, message, details = {}) => {
|
|
899
902
|
const decision = await this.#approval.authorize({
|
|
900
903
|
runId: context.runId,
|
|
901
904
|
capability,
|
|
902
905
|
mode: this.#capabilities[capability],
|
|
903
906
|
message,
|
|
904
|
-
|
|
907
|
+
details: {
|
|
908
|
+
skill: context.skillName,
|
|
909
|
+
...details
|
|
910
|
+
}
|
|
905
911
|
});
|
|
906
912
|
if (decision === "allowed") return void 0;
|
|
907
913
|
return bridgeError(request.id, "TOOL_UNSUPPORTED", decision === "disabled" ? `Capability "${capability}" is disabled by the sandbox capability settings` : `Capability "${capability}" was denied by the user`);
|
|
@@ -959,7 +965,7 @@ var ProcessSandboxExecutor = class {
|
|
|
959
965
|
}
|
|
960
966
|
case "confirm": {
|
|
961
967
|
if (!context.confirm) return bridgeError(request.id, "TOOL_UNSUPPORTED", "Capability \"confirm\" is disabled");
|
|
962
|
-
const denied = await gate("confirm", `Script "${context.skillName}" asks for confirmation: ${request.message}
|
|
968
|
+
const denied = await gate("confirm", `Script "${context.skillName}" asks for confirmation: ${request.message}`, { question: request.message });
|
|
963
969
|
if (denied) return denied;
|
|
964
970
|
return {
|
|
965
971
|
id: request.id,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as uiCatalog } from "./openUiSpecLang-
|
|
1
|
+
import { h as uiCatalog } from "./openUiSpecLang-B4QQ9Tfo.js";
|
|
2
2
|
import { t as CatalogNode } from "./ui-react.js";
|
|
3
3
|
import { Renderer, createLibrary, defineComponent } from "./dist-CTsxblSD.js";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -1800,12 +1800,13 @@ function interactionToUiSpec(request, labels = {}) {
|
|
|
1800
1800
|
},
|
|
1801
1801
|
children: model.controls.map(toField)
|
|
1802
1802
|
};
|
|
1803
|
-
|
|
1803
|
+
const message = labels.message ?? model.message;
|
|
1804
|
+
if (model.controls.length > 0 || !message) return form;
|
|
1804
1805
|
return {
|
|
1805
1806
|
component: "Stack",
|
|
1806
1807
|
children: [{
|
|
1807
1808
|
component: "Text",
|
|
1808
|
-
props: { text:
|
|
1809
|
+
props: { text: message }
|
|
1809
1810
|
}, form]
|
|
1810
1811
|
};
|
|
1811
1812
|
}
|
package/dist/{skillVersionStore-B24Jjjry-CsbzF7Oe.d.ts → skillVersionStore-B24Jjjry-v2CCU0Xo.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as FileSystemProvider, X as PageQuery, Y as Page, _t as SkillManifest, ut as SkillCatalogEntry } from "./types-
|
|
1
|
+
import { U as FileSystemProvider, X as PageQuery, Y as Page, _t as SkillManifest, ut as SkillCatalogEntry } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
2
|
//#region ../governance/dist/skillVersionStore-B24Jjjry.d.ts
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
type CandidateStatus = 'draft' | 'pending-review' | 'approved' | 'published' | 'rejected';
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as UiBridge, c as InteractionResponse, l as LlmClient, m as LlmStreamEvent, n as ArtifactStore, p as LlmResponse, s as InteractionRequest, t as Artifact, u as LlmCompleteInput, v as MemoryStore } from "./types-
|
|
1
|
+
import { S as UiBridge, c as InteractionResponse, l as LlmClient, m as LlmStreamEvent, n as ArtifactStore, p as LlmResponse, s as InteractionRequest, t as Artifact, u as LlmCompleteInput, v as MemoryStore } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
2
|
import { a as loadGoogleConfigFromEnv, i as loadAnthropicConfigFromEnv, n as LlmEnvConfig, o as loadLlmConfigFromEnv, r as ProviderEnvConfig } from "./env-AK3cSMEA-Dli6QU5E.js";
|
|
3
3
|
//#region ../runtime/dist/testing.d.ts
|
|
4
4
|
//#region src/llm/mockLlmClient.d.ts
|
|
@@ -17,7 +17,7 @@ type WebSkillErrorCode = 'FS_NOT_FOUND' | 'FS_PATH_OUTSIDE_ROOT' | 'SKILL_NOT_FO
|
|
|
17
17
|
/** 0.11.0 分册 18:用户拒绝把数据交给文档投放面 */
|
|
18
18
|
'DOCUMENT_SURFACE_DECLINED' |
|
|
19
19
|
/** 0.11.0 分册 18:viewer 未在期限内回报就绪(路由挂了 / 外壳脚本没跑起来) */
|
|
20
|
-
'DOCUMENT_SURFACE_UNAVAILABLE' | 'TS_RESOURCE_URL_REJECTED' | 'TS_TRANSPILER_UNAVAILABLE' | 'TS_TRANSPILE_FAILED' | 'TODO_LIST_INVALID' | 'TODO_ITEM_NOT_FOUND' | 'SKILL_GENERATION_DISABLED' | 'SKILL_GENERATION_LIMIT_EXCEEDED' | 'SKILL_GENERATION_VALIDATION_FAILED' | 'DELEGATION_UNAVAILABLE' | 'DELEGATION_IN_PROGRESS' | 'DELEGATION_BUDGET_EXCEEDED' | 'PROFILE_IMPORT_INVALID' | 'PROFILE_IMPORT_VERSION_UNSUPPORTED' | 'PROFILE_IMPORT_CREDENTIAL_REJECTED' | 'PROFILE_KEY_UNAVAILABLE' | 'DICTATION_UNAVAILABLE' | 'DICTATION_PERMISSION_DENIED' | 'DICTATION_FAILED' | 'PERCEPTION_NOT_ENABLED' | 'PERCEPTION_FAILED' | 'MODEL_IMAGE_UNSUPPORTED' | 'MODEL_DOCUMENT_UNSUPPORTED' | 'MODEL_TOOLS_UNSUPPORTED' | 'ATTACHMENT_TOO_LARGE' | 'ATTACHMENT_TYPE_REJECTED' |
|
|
20
|
+
'DOCUMENT_SURFACE_UNAVAILABLE' | 'TS_RESOURCE_URL_REJECTED' | 'TS_TRANSPILER_UNAVAILABLE' | 'TS_TRANSPILE_FAILED' | 'TODO_LIST_INVALID' | 'TODO_ITEM_NOT_FOUND' | 'SKILL_GENERATION_DISABLED' | 'SKILL_GENERATION_LIMIT_EXCEEDED' | 'SKILL_GENERATION_VALIDATION_FAILED' | 'DELEGATION_UNAVAILABLE' | 'DELEGATION_IN_PROGRESS' | 'DELEGATION_BUDGET_EXCEEDED' | 'PROFILE_IMPORT_INVALID' | 'PROFILE_IMPORT_VERSION_UNSUPPORTED' | 'PROFILE_IMPORT_CREDENTIAL_REJECTED' | 'PROFILE_KEY_UNAVAILABLE' | 'DICTATION_UNAVAILABLE' | 'DICTATION_PERMISSION_DENIED' | 'DICTATION_FAILED' | 'CAMERA_UNAVAILABLE' | 'CAMERA_PERMISSION_DENIED' | 'CAMERA_CAPTURE_FAILED' | 'PERCEPTION_NOT_ENABLED' | 'PERCEPTION_FAILED' | 'MODEL_IMAGE_UNSUPPORTED' | 'MODEL_DOCUMENT_UNSUPPORTED' | 'MODEL_TOOLS_UNSUPPORTED' | 'ATTACHMENT_TOO_LARGE' | 'ATTACHMENT_TYPE_REJECTED' |
|
|
21
21
|
/** 脚本取了宿主未声明的数据源;拒绝发生在发出任何请求之前(0.11.0 分册 16) */
|
|
22
22
|
'DATA_SOURCE_NOT_FOUND' |
|
|
23
23
|
/** 取数结果超预算。与 ATTACHMENT_TOO_LARGE 同口径:拒绝而不截断 */
|
|
@@ -716,7 +716,7 @@ declare function escapeXml(text: string): string;
|
|
|
716
716
|
declare function renderAvailableSkillsXml(catalog: SkillCatalog): string;
|
|
717
717
|
declare const xmlRenderer: CatalogRenderer;
|
|
718
718
|
//#endregion
|
|
719
|
-
//#region ../runtime/dist/types-
|
|
719
|
+
//#region ../runtime/dist/types-Btpdd1y-.d.ts
|
|
720
720
|
//#region src/llm/streamTypes.d.ts
|
|
721
721
|
/** 流式 LLM 事件(OpenAI SSE / Vercel fullStream 统一映射) */
|
|
722
722
|
type LlmStreamEvent = {
|
|
@@ -939,8 +939,14 @@ type InteractionRequest = {
|
|
|
939
939
|
id: string;
|
|
940
940
|
capability: 'readReference' | 'readAsset' | 'writeArtifact' | 'confirm' | 'fetchData' | 'pageAction' | 'readLinkedDocument' |
|
|
941
941
|
/** 读取本机下载目录(0.14.0 分册 20) */
|
|
942
|
-
'readDownloadedFile'
|
|
942
|
+
'readDownloadedFile' |
|
|
943
|
+
/** 读取本轮上传的文件(0.15.0 分册 17;0.17.0 分册 19 从 `confirm` 改到这里) */
|
|
944
|
+
'readUploadFile';
|
|
943
945
|
message: string;
|
|
946
|
+
/**
|
|
947
|
+
* 结构化载荷。`message` 是无字典层的英文兜底,持有字典的宿主据本字段重写正文
|
|
948
|
+
* (分册 19 FR-19.6):只发散文的话,本地化在渲染层无从下手。
|
|
949
|
+
*/
|
|
944
950
|
details?: unknown;
|
|
945
951
|
});
|
|
946
952
|
interface InteractionResponse {
|
package/dist/ui-react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as UiSpecActionCapability, D as UiSpecSnapshot, O as UiSurfaceActionRequest, Ot as UiSpecNode, S as UiBridge, T as UiSpecEvent, b as RenderResultRequest, c as InteractionResponse, k as UiSurfaceActionResponse, s as InteractionRequest, w as UiSpecDrafts } from "./types-
|
|
2
|
-
import { N as DocumentSurfacePort } from "./index-
|
|
3
|
-
import { J as SurfaceHostControlTexts, P as InteractionSpecLabels, q as SurfaceFormTexts, v as ChartFontSizes } from "./index-
|
|
1
|
+
import { C as UiSpecActionCapability, D as UiSpecSnapshot, O as UiSurfaceActionRequest, Ot as UiSpecNode, S as UiBridge, T as UiSpecEvent, b as RenderResultRequest, c as InteractionResponse, k as UiSurfaceActionResponse, s as InteractionRequest, w as UiSpecDrafts } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
|
+
import { N as DocumentSurfacePort } from "./index-BDyXe-a5.js";
|
|
3
|
+
import { J as SurfaceHostControlTexts, P as InteractionSpecLabels, q as SurfaceFormTexts, v as ChartFontSizes } from "./index-CaLsVI-m.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import React$1, { ComponentType, ReactNode } from "react";
|
|
6
6
|
import "react/jsx-runtime";
|
package/dist/ui-react.js
CHANGED
|
@@ -2,7 +2,7 @@ import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __
|
|
|
2
2
|
import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
3
3
|
import { n as validateUiSpecEvent, r as validateUiSpecNode } from "./surface-DVGiCmwq.js";
|
|
4
4
|
import { a as applySuggestion, c as DEFAULT_SURFACE_FORM_TEXTS, f as resolveSurfaceFormTexts, i as renderMiniMarkdown, l as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, m as shapeInteractionValue, o as collectValues, p as resolveSurfaceHostControlTexts, r as renderMiniChart, u as interactionToFormModel } from "./miniChart-lauNtZu8.js";
|
|
5
|
-
import { C as chartSpecFromProps, S as DEFAULT_CHART_FONT_SIZES, T as resolveChartFontSizes, d as collectScopedValues, f as qualifyFieldName, h as uiCatalog, l as evaluateFieldCondition, n as interactionToUiSpec, o as normalizeColumnWidths, r as toJsonRenderSpec, s as resolveColumnWidths, t as toOpenUiSpecLang, u as collectFormScopes, w as mountEchart, x as gaugePercent } from "./openUiSpecLang-
|
|
5
|
+
import { C as chartSpecFromProps, S as DEFAULT_CHART_FONT_SIZES, T as resolveChartFontSizes, d as collectScopedValues, f as qualifyFieldName, h as uiCatalog, l as evaluateFieldCondition, n as interactionToUiSpec, o as normalizeColumnWidths, r as toJsonRenderSpec, s as resolveColumnWidths, t as toOpenUiSpecLang, u as collectFormScopes, w as mountEchart, x as gaugePercent } from "./openUiSpecLang-B4QQ9Tfo.js";
|
|
6
6
|
import minpath from "node:path";
|
|
7
7
|
import { fileURLToPath as urlToPath } from "node:url";
|
|
8
8
|
import { z } from "zod";
|
|
@@ -131337,7 +131337,7 @@ function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }) {
|
|
|
131337
131337
|
const [unavailable, setUnavailable] = useState(false);
|
|
131338
131338
|
useEffect(() => {
|
|
131339
131339
|
let cancelled = false;
|
|
131340
|
-
import("./openUiLibrary-
|
|
131340
|
+
import("./openUiLibrary-BJtCG5B1.js").then((loaded) => {
|
|
131341
131341
|
if (!cancelled) setModule(loaded);
|
|
131342
131342
|
}).catch(() => {
|
|
131343
131343
|
if (!cancelled) setUnavailable(true);
|
package/dist/ui-vue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as UiBridge, b as RenderResultRequest, c as InteractionResponse, s as InteractionRequest } from "./types-
|
|
1
|
+
import { S as UiBridge, b as RenderResultRequest, c as InteractionResponse, s as InteractionRequest } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
2
|
import { PropType } from "vue";
|
|
3
3
|
//#region ../ui-vue/dist/index.d.ts
|
|
4
4
|
//#region src/bridgeState.d.ts
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ot as UiSpecNode } from "./types-
|
|
2
|
-
import { Xn as buildRenderResult } from "./index-
|
|
3
|
-
import { $ as UiActionDef, $t as qualifyFieldName, A as EvaluateFieldConditionOptions, At as buildA2uiCatalogDefinition, B as OpenUiRendererProps, Bt as evaluateFieldCondition, C as DEFAULT_INTERACTION_TEXTS, Ct as WEBSKILL_STYLES_CSS, D as DOCUMENT_COMPONENTS, Dt as a2uiComponentSchema, E as DESCRIBE_UI_PRESET_TOOL, Et as ZodRuntime, F as InteractionTexts, Ft as collectSpecActions, G as SPEC_TABLE_MIN_COLUMN_WIDTH, Gt as gaugePercent, H as PLANNED_INCREMENT, Ht as fromA2uiSurfaceAction, I as JsonRenderSpec, It as collectValues, J as SurfaceHostControlTexts, Jt as loadOpenUiPeers, K as SpecColumnMeta, Kt as interactionToFormModel, L as LoadedOpenUiPeers, Lt as createUiCatalogToolSource, M as FieldConditionResult, Mt as chartToTable, N as FormModel, Nt as collectFormScopes, O as DocumentComponentName, Ot as a2uiComponentShapes, P as InteractionSpecLabels, Pt as collectScopedValues, Q as UI_PRESET_NAMES, Qt as normalizeColumnWidths, R as MAX_CONDITION_DEPTH, Rt as defineUiCatalog, S as DEFAULT_CHART_FONT_SIZES, St as WEBSKILL_A2UI_CATALOG_ID, T as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, Tt as WebFormBridge, U as RENDER_UI_TOOL, Ut as fromUiSurfaceActionDispatch, V as OpenUiRuntime, Vt as fromA2uiSpecAction, W as SPEC_TABLE_MIN_COLUMN_VAR, Wt as fromVercelToolResult, X as UI_CATALOG_PROMPT_BUDGET_BYTES, Xt as mountEchart, Y as UI_CATALOG_GROUPS, Yt as loadWebSkillLitCatalog, Z as UI_PRESETS, Zt as mountViewerComponents, _ as CHART_PALETTE, _n as uiCatalog, _t as VIEWER_PROPS_ATTR, a as A2UI_SURFACE_ACTION, an as resolveColumnWidths, at as UiFormScope, b as ColumnWidthsRejection, bt as ViewerComponentsHandle, c as A2uiCatalogDefinition, cn as resolveSurfaceHostControlTexts, ct as UiSpecDegradation, d as A2uiMessage, dn as toA2uiSurfaceAction, dt as UiSpecSanitization, en as renderBlocks, et as UiCatalog, f as A2uiSpecActionEvent, fn as toEchartsOption, ft as UiSpecValidation, g as CATALOG_SCHEMA_MAX, gn as toVercelToolInvocation, gt as VIEWER_FALLBACK_ATTR, h as CATALOG_PROMPT_MAX, hn as toUiSurfaceActionDispatch, ht as VIEWER_COMPONENT_ATTR, i as A2UI_SPEC_FORM_PATH, in as resolveChartFontSizes, it as UiComponentDef, j as FieldCondition, jt as chartSpecFromProps, k as EchartHandle, kt as applySuggestion, l as A2uiCatalogHandle, ln as shapeInteractionValue, lt as UiSpecDegradationCode, m as CATALOG_BUDGET_STAGE, mn as toOpenUiSpecLang, mt as VERCEL_INTERACTION_TOOL_NAME, n as A2UI_COMMON_TYPES, nn as renderMiniMarkdown, nt as UiCatalogPromptOptions, o as A2UI_VERSION, on as resolveInteractionTexts, ot as UiPreset, p as A2uiSpecMessageOptions, pn as toJsonRenderSpec, pt as UiSurfaceActionDispatch, q as SurfaceFormTexts, qt as interactionToUiSpec, r as A2UI_SPEC_ACTION, rn as renderRenderResult, rt as UiCatalogToolSourceOptions, s as A2uiCatalogComponent, sn as resolveSurfaceFormTexts, st as UiPresetName, t as A2UI_BASIC_CATALOG_ID, tn as renderMiniChart, tt as UiCatalogInput, u as A2uiComponentShape, un as toA2uiSpecMessages, ut as UiSpecIssue, v as ChartFontSizes, vn as uiPreset, vt as VercelToolInvocation, w as DEFAULT_SURFACE_FORM_TEXTS, wt as WEBSKILL_SURFACE_ACTION, x as ControlModel, xt as ViewerComponentsOptions, y as CollectedValues, yt as VercelUiBridge, z as NormalizedColumnWidths, zt as ensureStyles } from "./index-
|
|
1
|
+
import { Ot as UiSpecNode } from "./types-Btpdd1y--BcxQ10Fa.js";
|
|
2
|
+
import { Xn as buildRenderResult } from "./index-BDyXe-a5.js";
|
|
3
|
+
import { $ as UiActionDef, $t as qualifyFieldName, A as EvaluateFieldConditionOptions, At as buildA2uiCatalogDefinition, B as OpenUiRendererProps, Bt as evaluateFieldCondition, C as DEFAULT_INTERACTION_TEXTS, Ct as WEBSKILL_STYLES_CSS, D as DOCUMENT_COMPONENTS, Dt as a2uiComponentSchema, E as DESCRIBE_UI_PRESET_TOOL, Et as ZodRuntime, F as InteractionTexts, Ft as collectSpecActions, G as SPEC_TABLE_MIN_COLUMN_WIDTH, Gt as gaugePercent, H as PLANNED_INCREMENT, Ht as fromA2uiSurfaceAction, I as JsonRenderSpec, It as collectValues, J as SurfaceHostControlTexts, Jt as loadOpenUiPeers, K as SpecColumnMeta, Kt as interactionToFormModel, L as LoadedOpenUiPeers, Lt as createUiCatalogToolSource, M as FieldConditionResult, Mt as chartToTable, N as FormModel, Nt as collectFormScopes, O as DocumentComponentName, Ot as a2uiComponentShapes, P as InteractionSpecLabels, Pt as collectScopedValues, Q as UI_PRESET_NAMES, Qt as normalizeColumnWidths, R as MAX_CONDITION_DEPTH, Rt as defineUiCatalog, S as DEFAULT_CHART_FONT_SIZES, St as WEBSKILL_A2UI_CATALOG_ID, T as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, Tt as WebFormBridge, U as RENDER_UI_TOOL, Ut as fromUiSurfaceActionDispatch, V as OpenUiRuntime, Vt as fromA2uiSpecAction, W as SPEC_TABLE_MIN_COLUMN_VAR, Wt as fromVercelToolResult, X as UI_CATALOG_PROMPT_BUDGET_BYTES, Xt as mountEchart, Y as UI_CATALOG_GROUPS, Yt as loadWebSkillLitCatalog, Z as UI_PRESETS, Zt as mountViewerComponents, _ as CHART_PALETTE, _n as uiCatalog, _t as VIEWER_PROPS_ATTR, a as A2UI_SURFACE_ACTION, an as resolveColumnWidths, at as UiFormScope, b as ColumnWidthsRejection, bt as ViewerComponentsHandle, c as A2uiCatalogDefinition, cn as resolveSurfaceHostControlTexts, ct as UiSpecDegradation, d as A2uiMessage, dn as toA2uiSurfaceAction, dt as UiSpecSanitization, en as renderBlocks, et as UiCatalog, f as A2uiSpecActionEvent, fn as toEchartsOption, ft as UiSpecValidation, g as CATALOG_SCHEMA_MAX, gn as toVercelToolInvocation, gt as VIEWER_FALLBACK_ATTR, h as CATALOG_PROMPT_MAX, hn as toUiSurfaceActionDispatch, ht as VIEWER_COMPONENT_ATTR, i as A2UI_SPEC_FORM_PATH, in as resolveChartFontSizes, it as UiComponentDef, j as FieldCondition, jt as chartSpecFromProps, k as EchartHandle, kt as applySuggestion, l as A2uiCatalogHandle, ln as shapeInteractionValue, lt as UiSpecDegradationCode, m as CATALOG_BUDGET_STAGE, mn as toOpenUiSpecLang, mt as VERCEL_INTERACTION_TOOL_NAME, n as A2UI_COMMON_TYPES, nn as renderMiniMarkdown, nt as UiCatalogPromptOptions, o as A2UI_VERSION, on as resolveInteractionTexts, ot as UiPreset, p as A2uiSpecMessageOptions, pn as toJsonRenderSpec, pt as UiSurfaceActionDispatch, q as SurfaceFormTexts, qt as interactionToUiSpec, r as A2UI_SPEC_ACTION, rn as renderRenderResult, rt as UiCatalogToolSourceOptions, s as A2uiCatalogComponent, sn as resolveSurfaceFormTexts, st as UiPresetName, t as A2UI_BASIC_CATALOG_ID, tn as renderMiniChart, tt as UiCatalogInput, u as A2uiComponentShape, un as toA2uiSpecMessages, ut as UiSpecIssue, v as ChartFontSizes, vn as uiPreset, vt as VercelToolInvocation, w as DEFAULT_SURFACE_FORM_TEXTS, wt as WEBSKILL_SURFACE_ACTION, x as ControlModel, xt as ViewerComponentsOptions, y as CollectedValues, yt as VercelUiBridge, z as NormalizedColumnWidths, zt as ensureStyles } from "./index-CaLsVI-m.js";
|
|
4
4
|
export { A2UI_BASIC_CATALOG_ID, A2UI_COMMON_TYPES, A2UI_SPEC_ACTION, A2UI_SPEC_FORM_PATH, A2UI_SURFACE_ACTION, A2UI_VERSION, type A2uiCatalogComponent, type A2uiCatalogDefinition, type A2uiCatalogHandle, type A2uiComponentShape, type A2uiMessage, type A2uiSpecActionEvent, type A2uiSpecMessageOptions, CATALOG_BUDGET_STAGE, CATALOG_PROMPT_MAX, CATALOG_SCHEMA_MAX, CHART_PALETTE, type ChartFontSizes, type CollectedValues, type ColumnWidthsRejection, type ControlModel, DEFAULT_CHART_FONT_SIZES, DEFAULT_INTERACTION_TEXTS, DEFAULT_SURFACE_FORM_TEXTS, DEFAULT_SURFACE_HOST_CONTROL_TEXTS, DESCRIBE_UI_PRESET_TOOL, DOCUMENT_COMPONENTS, type DocumentComponentName, type EchartHandle, type EvaluateFieldConditionOptions, type FieldCondition, type FieldConditionResult, type FormModel, type InteractionSpecLabels, type InteractionTexts, type JsonRenderSpec, type LoadedOpenUiPeers, MAX_CONDITION_DEPTH, type NormalizedColumnWidths, type OpenUiRendererProps, type OpenUiRuntime, PLANNED_INCREMENT, RENDER_UI_TOOL, SPEC_TABLE_MIN_COLUMN_VAR, SPEC_TABLE_MIN_COLUMN_WIDTH, type SpecColumnMeta, type SurfaceFormTexts, type SurfaceHostControlTexts, UI_CATALOG_GROUPS, UI_CATALOG_PROMPT_BUDGET_BYTES, UI_PRESETS, UI_PRESET_NAMES, type UiActionDef, type UiCatalog, type UiCatalogInput, type UiCatalogPromptOptions, type UiCatalogToolSourceOptions, type UiComponentDef, type UiFormScope, type UiPreset, type UiPresetName, type UiSpecDegradation, type UiSpecDegradationCode, type UiSpecIssue, type UiSpecNode, type UiSpecSanitization, type UiSpecValidation, type UiSurfaceActionDispatch, VERCEL_INTERACTION_TOOL_NAME, VIEWER_COMPONENT_ATTR, VIEWER_FALLBACK_ATTR, VIEWER_PROPS_ATTR, type VercelToolInvocation, VercelUiBridge, type ViewerComponentsHandle, type ViewerComponentsOptions, WEBSKILL_A2UI_CATALOG_ID, WEBSKILL_STYLES_CSS, WEBSKILL_SURFACE_ACTION, WebFormBridge, type ZodRuntime, a2uiComponentSchema, a2uiComponentShapes, applySuggestion, buildA2uiCatalogDefinition, buildRenderResult, chartSpecFromProps, chartToTable, collectFormScopes, collectScopedValues, collectSpecActions, collectValues, createUiCatalogToolSource, defineUiCatalog, ensureStyles, evaluateFieldCondition, fromA2uiSpecAction, fromA2uiSurfaceAction, fromUiSurfaceActionDispatch, fromVercelToolResult, gaugePercent, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, mountEchart, mountViewerComponents, normalizeColumnWidths, qualifyFieldName, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, resolveChartFontSizes, resolveColumnWidths, resolveInteractionTexts, resolveSurfaceFormTexts, resolveSurfaceHostControlTexts, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toEchartsOption, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
package/dist/ui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
2
2
|
import { t as buildRenderResult } from "./renderResult-D9Q-Vu2x.js";
|
|
3
3
|
import { a as applySuggestion, c as DEFAULT_SURFACE_FORM_TEXTS, d as resolveInteractionTexts, f as resolveSurfaceFormTexts, i as renderMiniMarkdown, l as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, m as shapeInteractionValue, n as chartToTable, o as collectValues, p as resolveSurfaceHostControlTexts, r as renderMiniChart, s as DEFAULT_INTERACTION_TEXTS, t as CHART_PALETTE, u as interactionToFormModel } from "./miniChart-lauNtZu8.js";
|
|
4
|
-
import { C as chartSpecFromProps, E as toEchartsOption, S as DEFAULT_CHART_FONT_SIZES, T as resolveChartFontSizes, _ as CATALOG_BUDGET_STAGE, a as SPEC_TABLE_MIN_COLUMN_WIDTH, b as PLANNED_INCREMENT, c as MAX_CONDITION_DEPTH, d as collectScopedValues, f as qualifyFieldName, g as defineUiCatalog, h as uiCatalog, i as SPEC_TABLE_MIN_COLUMN_VAR, l as evaluateFieldCondition, m as UI_CATALOG_PROMPT_BUDGET_BYTES, n as interactionToUiSpec, o as normalizeColumnWidths, p as UI_CATALOG_GROUPS, r as toJsonRenderSpec, s as resolveColumnWidths, t as toOpenUiSpecLang, u as collectFormScopes, v as CATALOG_PROMPT_MAX, w as mountEchart, x as gaugePercent, y as CATALOG_SCHEMA_MAX } from "./openUiSpecLang-
|
|
4
|
+
import { C as chartSpecFromProps, E as toEchartsOption, S as DEFAULT_CHART_FONT_SIZES, T as resolveChartFontSizes, _ as CATALOG_BUDGET_STAGE, a as SPEC_TABLE_MIN_COLUMN_WIDTH, b as PLANNED_INCREMENT, c as MAX_CONDITION_DEPTH, d as collectScopedValues, f as qualifyFieldName, g as defineUiCatalog, h as uiCatalog, i as SPEC_TABLE_MIN_COLUMN_VAR, l as evaluateFieldCondition, m as UI_CATALOG_PROMPT_BUDGET_BYTES, n as interactionToUiSpec, o as normalizeColumnWidths, p as UI_CATALOG_GROUPS, r as toJsonRenderSpec, s as resolveColumnWidths, t as toOpenUiSpecLang, u as collectFormScopes, v as CATALOG_PROMPT_MAX, w as mountEchart, x as gaugePercent, y as CATALOG_SCHEMA_MAX } from "./openUiSpecLang-B4QQ9Tfo.js";
|
|
5
5
|
|
|
6
6
|
//#region ../ui/src/web/resultRenderer.ts
|
|
7
7
|
/** RenderBlock → DOM(markdown/json/table/image/file/chart 六种) */
|
|
@@ -1224,7 +1224,7 @@ function fromA2uiSpecAction(event) {
|
|
|
1224
1224
|
*/
|
|
1225
1225
|
async function loadWebSkillLitCatalog() {
|
|
1226
1226
|
try {
|
|
1227
|
-
const { webskillLitCatalog } = await import("./webskillLitCatalog-
|
|
1227
|
+
const { webskillLitCatalog } = await import("./webskillLitCatalog-BBkQjKuN.js");
|
|
1228
1228
|
return webskillLitCatalog();
|
|
1229
1229
|
} catch (cause) {
|
|
1230
1230
|
throw new WebSkillError("UI_UNAVAILABLE", "The WebSkill A2UI catalog is unavailable; install @a2ui/lit, @a2ui/web_core and lit to render catalog surfaces with A2UI", cause);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
2
2
|
import { b as parseSkillMarkdown, i as buildCatalog, n as SkillDiscovery, t as validateSkills } from "./skill-CAJMsLod.js";
|
|
3
|
-
import { f as WebSkillRuntime } from "./approval-
|
|
3
|
+
import { f as WebSkillRuntime } from "./approval-CBPnGPIm.js";
|
|
4
4
|
|
|
5
5
|
//#region ../runtime/src/facade/webSkillApi.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as DEFAULT_SURFACE_FORM_TEXTS, i as renderMiniMarkdown } from "./miniChart-lauNtZu8.js";
|
|
2
|
-
import { C as chartSpecFromProps, h as uiCatalog, w as mountEchart } from "./openUiSpecLang-
|
|
2
|
+
import { C as chartSpecFromProps, h as uiCatalog, w as mountEchart } from "./openUiSpecLang-B4QQ9Tfo.js";
|
|
3
3
|
import { WEBSKILL_A2UI_CATALOG_ID, a2uiComponentShapes, t as A2UI_CHILDREN_PROP } from "./ui.js";
|
|
4
4
|
import { A2uiController, A2uiLitElement } from "@a2ui/lit/v0_9";
|
|
5
5
|
import { Catalog } from "@a2ui/web_core/v0_9";
|