@webskill/sdk 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +3 -3
- package/dist/browser.d.ts +225 -7
- package/dist/browser.js +659 -47
- package/dist/{catalogComponents-BgAJN0p8-CYEXSk45.js → catalogComponents-BgAJN0p8-Cr55ouOg.js} +2 -2
- package/dist/{dist-ExSQky4C.js → dist-Bfga1TmS.js} +45 -5
- package/dist/{dist-GK6dtjRv.js → dist-BnqAkSS6.js} +940 -49
- package/dist/{dist-DqcL6jKO.js → dist-CiaDIqkV.js} +2 -2
- package/dist/{dist-Bev6i6Ip.js → dist-D5YhlCdY.js} +59 -1
- package/dist/governance.d.ts +3 -3
- package/dist/governance.js +2 -2
- package/dist/{index-DkvBhJQy.d.ts → index-CWoKOFBP.d.ts} +47 -3
- package/dist/{index-iBm9tJL_.d.ts → index-DQwGvHAI.d.ts} +389 -9
- package/dist/{index-C3XdItd_.d.ts → index-sd-gVKey.d.ts} +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/dist/mcp.d.ts +56 -3
- package/dist/mcp.js +36 -3
- package/dist/{memoryArtifactStore-52Zn9npI-LbCQaqyx.js → memoryArtifactStore-52Zn9npI-BxtUkrgV.js} +1 -1
- package/dist/node.d.ts +3 -3
- package/dist/node.js +6 -6
- package/dist/{openUiLibrary-BKXW7Iwx-CWWBVOkE.js → openUiLibrary-BKXW7Iwx-DjvEnMlJ.js} +2 -2
- package/dist/{skillVersionStore-D-qHk9ZE-DheTIwAB.d.ts → skillVersionStore-D-qHk9ZE-C0OFDTQY.d.ts} +1 -1
- package/dist/{testing-WPTyXQYt.js → testing-Cm8MseLF.js} +2 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/{types-DLctJep_-B5G4uk2u.d.ts → types-C3V6lAeO-BgeOvc1Y.d.ts} +63 -4
- package/dist/ui-react.d.ts +2 -2
- package/dist/ui-react.js +5 -5
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/{webskillLitCatalog-D_zCqeQF-C9lrvvMr.js → webskillLitCatalog-D_zCqeQF-swXsWoAe.js} +1 -1
- package/package.json +1 -1
package/dist/{catalogComponents-BgAJN0p8-CYEXSk45.js → catalogComponents-BgAJN0p8-Cr55ouOg.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as __require, i as __reExport, n as __esmMin, o as __toCommonJS, r as __exportAll$2, s as __toESM$1, t as __commonJSMin$1 } from "./rolldown-runtime-BOF7iYI8.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Ct as resolveSurfaceFormTexts, E as collectScopedValues, H as qualifyFieldName, I as gaugePercent, T as collectFormScopes, at as DEFAULT_CHART_FONT_SIZES, ct as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, gt as chartSpecFromProps, j as evaluateFieldCondition, st as DEFAULT_SURFACE_FORM_TEXTS, wt as resolveSurfaceHostControlTexts, xt as resolveChartFontSizes, yt as mountEchart } from "./dist-
|
|
2
|
+
import { b as WebSkillError } from "./dist-D5YhlCdY.js";
|
|
3
|
+
import { Ct as resolveSurfaceFormTexts, E as collectScopedValues, H as qualifyFieldName, I as gaugePercent, T as collectFormScopes, at as DEFAULT_CHART_FONT_SIZES, ct as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, gt as chartSpecFromProps, j as evaluateFieldCondition, st as DEFAULT_SURFACE_FORM_TEXTS, wt as resolveSurfaceHostControlTexts, xt as resolveChartFontSizes, yt as mountEchart } from "./dist-CiaDIqkV.js";
|
|
4
4
|
import minpath$1 from "node:path";
|
|
5
5
|
import { fileURLToPath as urlToPath$1 } from "node:url";
|
|
6
6
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as textParts, i as rejectUnsupportedPart, n as partsToText, o as validateLlmMessages, r as promptText, t as MemoryArtifactStore } from "./memoryArtifactStore-52Zn9npI-
|
|
1
|
+
import { B as messageOf, C as assertSafePathSegment, H as parseSkillMarkdown, K as renderAvailableSkillsXml, S as assertRemoteUrlAllowed, T as buildCatalog, Y as resolveInsideRoot, _ as SkillDiscovery, b as WebSkillError, et as validateSkills, v as SkillReader, w as atomicWriteText } from "./dist-D5YhlCdY.js";
|
|
2
|
+
import { a as textParts, i as rejectUnsupportedPart, n as partsToText, o as validateLlmMessages, r as promptText, t as MemoryArtifactStore } from "./memoryArtifactStore-52Zn9npI-BxtUkrgV.js";
|
|
3
3
|
|
|
4
4
|
//#region ../runtime/dist/index.js
|
|
5
5
|
/** 与正常工具结果同构:模型读到的是「这次调用被中断了」,而不是一个凭空消失的调用 */
|
|
@@ -2959,6 +2959,17 @@ const MODEL_IMAGE_MIME_TYPES = /* @__PURE__ */ new Set([
|
|
|
2959
2959
|
"image/webp",
|
|
2960
2960
|
"image/gif"
|
|
2961
2961
|
]);
|
|
2962
|
+
/**
|
|
2963
|
+
* 数据源清单里的出处标注(0.14.0 分册 21,FR-21.6)。
|
|
2964
|
+
*
|
|
2965
|
+
* 措辞必须说出「这段说明来自页面、可能不准确」:`description` 已在候选层剥掉换行与控制字符,
|
|
2966
|
+
* 它无法把自己伪装成上下文里的新一行指令——**剥换行与这句标注是一对,只做一件都不够**。
|
|
2967
|
+
*/
|
|
2968
|
+
const DATA_SOURCE_PROVENANCE_NOTE = {
|
|
2969
|
+
"": "",
|
|
2970
|
+
"page-declared": " [declared by the current site; this description comes from the page and may be inaccurate]",
|
|
2971
|
+
"tool-projection": " [projected from a tool the current site registered; this description comes from the page and may be inaccurate]"
|
|
2972
|
+
};
|
|
2962
2973
|
/** 分片是不是 PDF;mime 允许带参数与大小写差异,与 FR-11.1 的判定同口径 */
|
|
2963
2974
|
const isPdfPart = (part) => part.type === "file" && part.mimeType.split(";")[0]?.trim().toLowerCase() === SUPPORTED_DOCUMENT_MIME.pdf;
|
|
2964
2975
|
/**
|
|
@@ -4008,7 +4019,7 @@ var AgentLoop = class {
|
|
|
4008
4019
|
const source = resolution.kind === "script" ? void 0 : (this.#deps.externalTools ?? []).find((s) => s.canHandle(call.name));
|
|
4009
4020
|
if (source === void 0 && !this.#checkToolAccess(state, call.name)) result = this.#deniedToolError(state, call.name);
|
|
4010
4021
|
else if (resolution.kind === "script") result = await this.#handleScriptTool(call, resolution.skillName, resolution.scriptName, state);
|
|
4011
|
-
else if (source) result = await source.call(call.name, call.arguments);
|
|
4022
|
+
else if (source) result = await source.call(call.name, call.arguments, { runId: state.runId });
|
|
4012
4023
|
else {
|
|
4013
4024
|
if (resolution.kind === "not-found") state.unknownToolCalls += 1;
|
|
4014
4025
|
result = toolError(resolution.code, resolution.message, resolution.kind === "not-found" ? resolution.data : void 0);
|
|
@@ -4789,7 +4800,9 @@ var AgentLoop = class {
|
|
|
4789
4800
|
}
|
|
4790
4801
|
const head = text.slice(0, Math.floor(max * .6));
|
|
4791
4802
|
const tail = text.slice(-Math.floor(max * .3));
|
|
4792
|
-
|
|
4803
|
+
const omitted = text.length - head.length - tail.length;
|
|
4804
|
+
state.trace.record("run.warning", { message: `Tool result for "${call.name}" exceeded ${String(max)} chars and was truncated in the middle; ${String(omitted)} chars omitted (${note}).` });
|
|
4805
|
+
return `${head}\n...[truncated ${omitted} chars; ${note}]...\n${tail}`;
|
|
4793
4806
|
}
|
|
4794
4807
|
/** SkillStateGuard 判定(无注入默认全放行;仅显式 false 拦截) */
|
|
4795
4808
|
async #guardDenied(kind, skillName) {
|
|
@@ -4858,6 +4871,7 @@ var AgentLoop = class {
|
|
|
4858
4871
|
if (!root) return "";
|
|
4859
4872
|
let allowedTools;
|
|
4860
4873
|
let dependencies = [];
|
|
4874
|
+
let declaredSources = [];
|
|
4861
4875
|
try {
|
|
4862
4876
|
const { metadata } = parseSkillMarkdown(skillMdText ?? await this.#deps.fs.readText(`${root}/SKILL.md`));
|
|
4863
4877
|
const rawDeps = metadata["dependencies"];
|
|
@@ -4868,6 +4882,9 @@ var AgentLoop = class {
|
|
|
4868
4882
|
state.skillAllowedTools.set(skillName, allowedTools);
|
|
4869
4883
|
this.#warnUnmatchedToolPatterns(state, skillName, allowedTools);
|
|
4870
4884
|
} else state.trace.record("run.warning", { message: `Skill "${skillName}" has a non-array "allowed-tools" metadata entry; ignored` });
|
|
4885
|
+
const rawSources = metadata["data-sources"];
|
|
4886
|
+
if (rawSources !== void 0) if (Array.isArray(rawSources)) declaredSources = rawSources.filter((e) => typeof e === "string");
|
|
4887
|
+
else state.trace.record("run.warning", { message: `Skill "${skillName}" has a non-array "data-sources" metadata entry; ignored` });
|
|
4871
4888
|
} catch (e) {
|
|
4872
4889
|
state.trace.record("run.warning", { message: `Failed to read or parse SKILL.md of skill "${skillName}": ${messageOf(e)}` });
|
|
4873
4890
|
}
|
|
@@ -4903,6 +4920,7 @@ var AgentLoop = class {
|
|
|
4903
4920
|
}
|
|
4904
4921
|
}
|
|
4905
4922
|
let note = (loaded.length ? `\n\nActivated tools: ${loaded.join(", ")}` : "") + formatSkillScriptManifest(scripts);
|
|
4923
|
+
note += this.#dataSourceNotice(skillName, declaredSources, state);
|
|
4906
4924
|
for (const dep of dependencies) {
|
|
4907
4925
|
if (state.activated.has(dep)) continue;
|
|
4908
4926
|
if (!this.#deps.skillIndex.has(dep)) {
|
|
@@ -4914,6 +4932,26 @@ var AgentLoop = class {
|
|
|
4914
4932
|
return note;
|
|
4915
4933
|
}
|
|
4916
4934
|
/**
|
|
4935
|
+
* 0.14.0 分册 19:技能声明的源在本宿主缺失时,把「缺哪些 / 有哪些」写进激活回执与 trace。
|
|
4936
|
+
* 宿主没注入清单时一个字不说——那是「未知」,不是「没有」。
|
|
4937
|
+
*
|
|
4938
|
+
* 0.14.0 分册 21(DV-7):「有哪些」由 id 列表升级为 `<id> — <description>`,
|
|
4939
|
+
* 并对非宿主声明的条目附出处标注。`description` 可能来自页面,
|
|
4940
|
+
* 因此标注必须与它同时出现——只写说明不写出处,等于让站点以宿主口吻讲话。
|
|
4941
|
+
*/
|
|
4942
|
+
#dataSourceNotice(skillName, declared, state) {
|
|
4943
|
+
const declaredSources = this.#deps.dataSources;
|
|
4944
|
+
const available = typeof declaredSources === "function" ? declaredSources() : declaredSources;
|
|
4945
|
+
if (declared.length === 0 || available === void 0) return "";
|
|
4946
|
+
const have = new Set(available.map((source) => source.id));
|
|
4947
|
+
const missing = declared.filter((id) => !have.has(id));
|
|
4948
|
+
if (missing.length === 0) return "";
|
|
4949
|
+
const listed = available.map((source) => `\n- ${source.id} — ${source.description}${DATA_SOURCE_PROVENANCE_NOTE[source.provenance ?? ""] ?? ""}`).join("");
|
|
4950
|
+
const message = `Skill "${skillName}" declares data source(s) this host does not provide: ${missing.join(", ")}. Available here:${listed || " (none)"}\nDo not retry them or invent their values; tell the user which data source is missing.`;
|
|
4951
|
+
state.trace.record("run.warning", { message });
|
|
4952
|
+
return `\n\n${message}`;
|
|
4953
|
+
}
|
|
4954
|
+
/**
|
|
4917
4955
|
* D2 Schema 兜底链(同一 run 内激活时只算一次):
|
|
4918
4956
|
* 显式 inputSchema > sidecar scripts/<name>.schema.json > schemaInferer 推导 > schemaUnavailable
|
|
4919
4957
|
* 返回值即最终来源,进技能清单告诉模型该信谁(FR-18.1)。
|
|
@@ -5428,6 +5466,7 @@ var WebSkillRuntime = class {
|
|
|
5428
5466
|
skillIntegrityGuard: this.#deps.skillIntegrityGuard,
|
|
5429
5467
|
skillOutcomeReporter: this.#deps.skillOutcomeReporter,
|
|
5430
5468
|
fetchData: this.#deps.fetchData,
|
|
5469
|
+
dataSources: this.#deps.dataSources,
|
|
5431
5470
|
linkedDocuments: this.#deps.linkedDocuments,
|
|
5432
5471
|
docxExtractor: this.#deps.docxExtractor,
|
|
5433
5472
|
xlsxExtractor: this.#deps.xlsxExtractor,
|
|
@@ -5556,6 +5595,7 @@ var WebSkillRuntime = class {
|
|
|
5556
5595
|
skillIntegrityGuard: this.#deps.skillIntegrityGuard,
|
|
5557
5596
|
skillOutcomeReporter: this.#deps.skillOutcomeReporter,
|
|
5558
5597
|
fetchData: this.#deps.fetchData,
|
|
5598
|
+
dataSources: this.#deps.dataSources,
|
|
5559
5599
|
linkedDocuments: this.#deps.linkedDocuments,
|
|
5560
5600
|
docxExtractor: this.#deps.docxExtractor,
|
|
5561
5601
|
xlsxExtractor: this.#deps.xlsxExtractor,
|
|
@@ -6838,4 +6878,4 @@ var FsToolStepStore = class {
|
|
|
6838
6878
|
};
|
|
6839
6879
|
|
|
6840
6880
|
//#endregion
|
|
6841
|
-
export { bridgeError as $, ProgressiveRouter as A, refineUserProfile as At, SUPPORTED_DOCUMENT_MIME as B,
|
|
6881
|
+
export { bridgeError as $, ProgressiveRouter as A, refineUserProfile as At, SUPPORTED_DOCUMENT_MIME as B, toBase64 as Bt, FsSessionStore as C, normalizeToolError as Ct, HookRunner as D, readProfileEntries as Dt, GoogleGenAiClient as E, readBehaviorRecords as Et, READ_SKILL_FILE_TOOL_NAME as F, schemaToForm as Ft, USER_PROFILE_EXPORT_VERSION as G, validateUiSpecNode as Gt, TEXT_BUDGETED_CONTENT_TYPES as H, toRecordDigests as Ht, RUN_SNAPSHOT_SCHEMA_VERSION as I, scriptToolName as It, USER_PROFILE_PROMPT_HEADER as J, USER_PROFILE_KEY as K, RUN_TRACE_SCHEMA_VERSION as L, sealToolCallPairs as Lt, READ_LINKED_DOCUMENT_TOOL_NAME as M, resolveToolName as Mt, READ_SKILL_FILE_INPUT_SCHEMA as N, sampleBehaviorRecords as Nt, MAX_TOOL_STEP_ARG_BYTES as O, readUserProfile as Ot, READ_SKILL_FILE_TOOL as P, schemaSourceLabel as Pt, applyUserProfileImport as Q, SENSITIVE_ANNOTATION as R, summarizeRunUsage as Rt, FsRunTraceStore as S, normalizeToolContent as St, FullDisclosureRouter as T, parseUserProfileExport as Tt, TraceRecorder as U, toVercelToolSpecs as Ut, SerializingMemoryStore as V, toLlmToolSpec as Vt, UNSUPPORTED_DOCUMENT_MESSAGE as W, validateUiSpecEvent as Wt, WebSkillRuntime as X, USER_PROFILE_REFINE_PROMPT as Y, appendBehaviorRecords as Z, EventBus as _, mergeCatalogEntries as _t, ASK_USER_TOOL as a, extractChartSpec as at, FsMemoryStore as b, networkUrlHost as bt, AnthropicClient as c, extractUiSpecEvents as ct, DEFAULT_LOOP_LIMITS as d, fromVercelResult as dt, buildRenderResult as et, DEFAULT_MAX_DATA_SOURCE_BYTES as f, fromVercelStreamPart as ft, EMPTY_USER_PROFILE as g, listSkillScripts as gt, DEFAULT_USER_PROFILE_LIMITS as h, isUnsupportedRunSnapshot as ht, ASK_USER_MAX_FIELDS as i, exportUserProfile as it, READ_LINKED_DOCUMENT_TOOL as j, renderUserProfileContext as jt, OpenAiCompatibleClient as k, redactToolStepArgs as kt, BEHAVIOR_RECORDS_KEY as l, findUnpairedToolCalls as lt, DEFAULT_MAX_DOCUMENT_TEXT_BYTES as m, isNetworkAllowed as mt, ASK_USER_FIELD_TYPES as n, createWebSkillApi as nt, ASK_USER_TOOL_NAME as o, extractSkillCandidate as ot, DEFAULT_MAX_DOCUMENT_BYTES as p, interruptedToolResult as pt, USER_PROFILE_NO_INVENTION_RULE as q, ASK_USER_INPUT_SCHEMA as r, diffUserProfile as rt, AgentLoop as s, extractTodoTraceEvents as st, ALLOWED_TOOLS_EXCLUSION_REASON as t, createScriptContext as tt, CapabilityApproval as u, formatSkillScriptManifest as ut, FS_SESSION_PAGE_SIZE as v, mergeProfileEntries as vt, FsToolStepStore as w, parseBridgeRequest as wt, FsRunSnapshotStore as x, normalizeErrorCode as xt, FsArtifactStore as y, networkPolicyLibSource as yt, SESSION_SCHEMA_VERSION as z, summarizeToolCalls as zt };
|