@webskill/sdk 0.9.0 → 0.10.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.
Files changed (33) hide show
  1. package/dist/agent.d.ts +2 -2
  2. package/dist/agent.js +5 -1
  3. package/dist/browser.d.ts +5 -3
  4. package/dist/browser.js +15 -7
  5. package/dist/{catalogComponents-DfxxfUvn-T7Ic8QFV.js → catalogComponents-DTcYfpLQ-CcoOaz-Z.js} +1354 -415
  6. package/dist/{dist-BQe1uglQ.js → dist-1OFC-zax.js} +6 -4
  7. package/dist/{dist-CFmkV45C.js → dist-BViUeszk.js} +349 -32
  8. package/dist/{eventTypes-DbOpAECr-BjcjZVms.js → eventTypes-s2uwAcLG-Go3l_dUe.js} +5 -2
  9. package/dist/governance.d.ts +29 -6
  10. package/dist/governance.js +45 -7
  11. package/dist/{index-DXNTIa-6.d.ts → index-B0QPLWPZ.d.ts} +6 -2
  12. package/dist/{index-lLcCpHE-.d.ts → index-BF4E1a9j.d.ts} +10 -3
  13. package/dist/{index-znZjobkr.d.ts → index-DtFdMKBX.d.ts} +63 -6
  14. package/dist/index.d.ts +4 -4
  15. package/dist/index.js +3 -3
  16. package/dist/mcp.d.ts +18 -3
  17. package/dist/mcp.js +62 -21
  18. package/dist/node.d.ts +3 -3
  19. package/dist/node.js +2 -2
  20. package/dist/{openUiLibrary-DURlAxjk-Do_yqg3u.js → openUiLibrary-CIrV--Ad-B8zG_91e.js} +3 -3
  21. package/dist/{skillVersionStore-Bl-ElD45-dMJ8Ybhb.d.ts → skillVersionStore-D-qHk9ZE-DBsYYCWn.d.ts} +13 -5
  22. package/dist/{testing-Csg5ljNm.js → testing-WPTyXQYt.js} +26 -3
  23. package/dist/testing.d.ts +1 -1
  24. package/dist/testing.js +1 -1
  25. package/dist/{types-B3n0cMZu-BDhheIhX.d.ts → types-CrRcT-LM-DZAp8sWv.d.ts} +36 -3
  26. package/dist/ui-react.d.ts +11 -2
  27. package/dist/ui-react.js +119 -38
  28. package/dist/ui-vue.d.ts +1 -1
  29. package/dist/ui-vue.js +1 -1
  30. package/dist/ui.d.ts +3 -3
  31. package/dist/ui.js +2 -2
  32. package/dist/{webskillLitCatalog-DwTwSBFt-BG7kL-Es.js → webskillLitCatalog-BJrphK0y-SGmRXaaO.js} +2 -2
  33. package/package.json +1 -1
package/dist/agent.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as TodoListener, A as PagePerceptionReader, B as SKILL_GENERATION_SYSTEM_PROMPT, C as PageActionRequest, D as PageAuditSink, E as PageActionUi, F as PerceptionAuditSink, G as SkillGenerator, H as SkillGenerationOutcome, I as PerceptionCaptureOptions, J as SubAgentRunner, K as SkillGeneratorOptions, L as PerceptionRecord, M as ParentBudget, N as PerceivedImage, O as PagePerceptionPolicy, P as PerceivedNode, Q as TodoList, R as PerceptionResult, S as PageActionRecord, T as PageActionToolSourceOptions, U as SkillGenerationPolicy, V as SkillCandidateSink, W as SkillGenerationToolSourceOptions, X as TodoEvent, Y as TODO_SYSTEM_PROMPT, Z as TodoItem, _ as PageActionExecutor, a as DelegationOrchestratorOptions, at as createPagePerceptionToolSource, b as PageActionPolicy, c as DelegationToolSourceOptions, ct as withDelegationOrigin, d as ImageCaptureBudget, et as TodoStatus, f as MANAGE_TODO_TOOL, g as PERCEPTION_SYSTEM_PROMPT, h as PERCEIVE_PAGE_TOOL, i as DelegationOrchestrator, it as createPageActionToolSource, j as PagePerceptionToolSourceOptions, k as PagePerceptionPolicyOptions, l as GENERATE_SKILL_TOOL, m as PAGE_ACTION_TOOL, n as DELEGATION_SYSTEM_PROMPT, nt as TodoToolSourceOptions, o as DelegationRequest, ot as createSkillGenerationToolSource, p as PAGE_ACTION_SYSTEM_PROMPT, q as SubAgentRunInput, r as DelegationBudget, rt as createDelegationToolSource, s as DelegationResult, st as createTodoToolSource, t as DELEGATE_TASK_TOOL, tt as TodoStore, u as GeneratedSkillDraft, v as PageActionKind, w as PageActionScope, x as PageActionPolicyOptions, y as PageActionOutcome, z as PerceptionScope } from "./index-lLcCpHE-.js";
2
- export { DELEGATE_TASK_TOOL, DELEGATION_SYSTEM_PROMPT, type DelegationBudget, DelegationOrchestrator, type DelegationOrchestratorOptions, type DelegationRequest, type DelegationResult, type DelegationToolSourceOptions, GENERATE_SKILL_TOOL, type GeneratedSkillDraft, type ImageCaptureBudget, MANAGE_TODO_TOOL, PAGE_ACTION_SYSTEM_PROMPT, PAGE_ACTION_TOOL, PERCEIVE_PAGE_TOOL, PERCEPTION_SYSTEM_PROMPT, type PageActionExecutor, type PageActionKind, type PageActionOutcome, PageActionPolicy, type PageActionPolicyOptions, type PageActionRecord, type PageActionRequest, type PageActionScope, type PageActionToolSourceOptions, type PageActionUi, type PageAuditSink, PagePerceptionPolicy, type PagePerceptionPolicyOptions, type PagePerceptionReader, type PagePerceptionToolSourceOptions, type ParentBudget, type PerceivedImage, type PerceivedNode, type PerceptionAuditSink, type PerceptionCaptureOptions, type PerceptionRecord, type PerceptionResult, type PerceptionScope, SKILL_GENERATION_SYSTEM_PROMPT, type SkillCandidateSink, type SkillGenerationOutcome, type SkillGenerationPolicy, type SkillGenerationToolSourceOptions, SkillGenerator, type SkillGeneratorOptions, type SubAgentRunInput, type SubAgentRunner, TODO_SYSTEM_PROMPT, type TodoEvent, type TodoItem, type TodoList, type TodoListener, type TodoStatus, TodoStore, type TodoToolSourceOptions, createDelegationToolSource, createPageActionToolSource, createPagePerceptionToolSource, createSkillGenerationToolSource, createTodoToolSource, withDelegationOrigin };
1
+ import { $ as TodoList, A as PagePerceptionReader, B as SKILL_GENERATION_SYSTEM_PROMPT, C as PageActionRequest, D as PageAuditSink, E as PageActionUi, F as PerceptionAuditSink, G as SkillGenerationToolSourceOptions, H as SkillGenerationMessages, I as PerceptionCaptureOptions, J as SubAgentRunInput, K as SkillGenerator, L as PerceptionRecord, M as ParentBudget, N as PerceivedImage, O as PagePerceptionPolicy, P as PerceivedNode, Q as TodoItem, R as PerceptionResult, S as PageActionRecord, T as PageActionToolSourceOptions, U as SkillGenerationOutcome, V as SkillCandidateSink, W as SkillGenerationPolicy, X as TODO_SYSTEM_PROMPT, Y as SubAgentRunner, Z as TodoEvent, _ as PageActionExecutor, a as DelegationOrchestratorOptions, at as createPageActionToolSource, b as PageActionPolicy, c as DelegationToolSourceOptions, ct as createTodoToolSource, d as ImageCaptureBudget, et as TodoListener, f as MANAGE_TODO_TOOL, g as PERCEPTION_SYSTEM_PROMPT, h as PERCEIVE_PAGE_TOOL, i as DelegationOrchestrator, it as createDelegationToolSource, j as PagePerceptionToolSourceOptions, k as PagePerceptionPolicyOptions, l as GENERATE_SKILL_TOOL, lt as withDelegationOrigin, m as PAGE_ACTION_TOOL, n as DELEGATION_SYSTEM_PROMPT, nt as TodoStore, o as DelegationRequest, ot as createPagePerceptionToolSource, p as PAGE_ACTION_SYSTEM_PROMPT, q as SkillGeneratorOptions, r as DelegationBudget, rt as TodoToolSourceOptions, s as DelegationResult, st as createSkillGenerationToolSource, t as DELEGATE_TASK_TOOL, tt as TodoStatus, u as GeneratedSkillDraft, v as PageActionKind, w as PageActionScope, x as PageActionPolicyOptions, y as PageActionOutcome, z as PerceptionScope } from "./index-BF4E1a9j.js";
2
+ export { DELEGATE_TASK_TOOL, DELEGATION_SYSTEM_PROMPT, type DelegationBudget, DelegationOrchestrator, type DelegationOrchestratorOptions, type DelegationRequest, type DelegationResult, type DelegationToolSourceOptions, GENERATE_SKILL_TOOL, type GeneratedSkillDraft, type ImageCaptureBudget, MANAGE_TODO_TOOL, PAGE_ACTION_SYSTEM_PROMPT, PAGE_ACTION_TOOL, PERCEIVE_PAGE_TOOL, PERCEPTION_SYSTEM_PROMPT, type PageActionExecutor, type PageActionKind, type PageActionOutcome, PageActionPolicy, type PageActionPolicyOptions, type PageActionRecord, type PageActionRequest, type PageActionScope, type PageActionToolSourceOptions, type PageActionUi, type PageAuditSink, PagePerceptionPolicy, type PagePerceptionPolicyOptions, type PagePerceptionReader, type PagePerceptionToolSourceOptions, type ParentBudget, type PerceivedImage, type PerceivedNode, type PerceptionAuditSink, type PerceptionCaptureOptions, type PerceptionRecord, type PerceptionResult, type PerceptionScope, SKILL_GENERATION_SYSTEM_PROMPT, type SkillCandidateSink, type SkillGenerationMessages, type SkillGenerationOutcome, type SkillGenerationPolicy, type SkillGenerationToolSourceOptions, SkillGenerator, type SkillGeneratorOptions, type SubAgentRunInput, type SubAgentRunner, TODO_SYSTEM_PROMPT, type TodoEvent, type TodoItem, type TodoList, type TodoListener, type TodoStatus, TodoStore, type TodoToolSourceOptions, createDelegationToolSource, createPageActionToolSource, createPagePerceptionToolSource, createSkillGenerationToolSource, createTodoToolSource, withDelegationOrigin };
package/dist/agent.js CHANGED
@@ -276,6 +276,10 @@ function ok(events, text) {
276
276
  }
277
277
  const DEFAULT_MAX_PER_SESSION = 3;
278
278
  const SCRIPT_EXTENSIONS = [".ts", ".js"];
279
+ /** 缺省英文模板:与 0.9.0 之前硬编码的正文逐字一致 */
280
+ function defaultConfirmSkill(draft) {
281
+ return `Save this conversation as the skill "${draft.name}"? ${draft.description}\nIt will be submitted for review, not activated. Please check the preview below for anything that must not be stored.`;
282
+ }
279
283
  function fail(message, details) {
280
284
  throw new WebSkillError("SKILL_GENERATION_VALIDATION_FAILED", message, details);
281
285
  }
@@ -338,7 +342,7 @@ var SkillGenerator = class {
338
342
  type: "authorize",
339
343
  id: `skill-generation-${this.#requestSeq}`,
340
344
  capability: "confirm",
341
- message: `Save this conversation as the skill "${draft.name}"? ${draft.description}\nIt will be submitted for review, not activated. Please check the preview below for anything that must not be stored.`,
345
+ message: this.#options.messages?.confirmSkill?.(draft) ?? defaultConfirmSkill(draft),
342
346
  details: { preview: previewOf(draft) }
343
347
  });
344
348
  if (response.cancelled === true || response.value === false) return { status: "declined" };
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Ct as WebSkillError, I as FileStat, L as FileSystemProvider, St as VerifyResult, _ as MemoryStore, bt as UnsignedPolicy, c as InteractionResponse, gt as SkillsLockfile, j as ArchiveLimits, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, ot as SkillInstallSource, p as LlmResponse, s as InteractionRequest, u as LlmCompleteInput, ut as SkillManifest, vt as TrustedKeyStore, x as UiBridge, y as RenderResultRequest } from "./types-B3n0cMZu-BDhheIhX.js";
2
- import { Et as ScriptExecutor, O as ExternalSkillProvider, Tt as ScriptExecutionContext, Vn as parseBridgeRequest, Y as NetworkPolicy, Yt as ToolResult, _ as BridgeCapabilities, _n as bridgeError, b as BridgeResponse, f as ApprovalScope, fn as WebSkillApi, k as ExternalToolSource, qt as ToolDefinition, y as BridgeRequest } from "./index-znZjobkr.js";
3
- import { A as PagePerceptionReader, C as PageActionRequest, I as PerceptionCaptureOptions, O as PagePerceptionPolicy, P as PerceivedNode, R as PerceptionResult, _ as PageActionExecutor, w as PageActionScope, y as PageActionOutcome, z as PerceptionScope } from "./index-lLcCpHE-.js";
1
+ import { Ct as VerifyResult, L as FileStat, M as ArchiveLimits, R as FileSystemProvider, S as UiBridge, _t as SkillsLockfile, b as RenderResultRequest, c as InteractionResponse, dt as SkillManifest, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, s as InteractionRequest, st as SkillInstallSource, u as LlmCompleteInput, v as MemoryStore, wt as WebSkillError, xt as UnsignedPolicy, yt as TrustedKeyStore } from "./types-CrRcT-LM-DZAp8sWv.js";
2
+ import { Dt as ScriptExecutor, Et as ScriptExecutionContext, Hn as parseBridgeRequest, Jt as ToolDefinition, O as ExternalSkillProvider, Xt as ToolResult, Y as NetworkPolicy, _ as BridgeCapabilities, b as BridgeResponse, f as ApprovalScope, k as ExternalToolSource, pn as WebSkillApi, vn as bridgeError, y as BridgeRequest } from "./index-DtFdMKBX.js";
3
+ import { A as PagePerceptionReader, C as PageActionRequest, I as PerceptionCaptureOptions, O as PagePerceptionPolicy, P as PerceivedNode, R as PerceptionResult, _ as PageActionExecutor, w as PageActionScope, y as PageActionOutcome, z as PerceptionScope } from "./index-BF4E1a9j.js";
4
4
  //#region ../browser/dist/index.d.ts
5
5
  //#region src/fs/featureDetection.d.ts
6
6
  /** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
@@ -290,6 +290,8 @@ interface LlmEntryConfig {
290
290
  apiKey?: string;
291
291
  model: string;
292
292
  requestTimeoutMs?: number;
293
+ /** Anthropic extended thinking 预算(0.10.0 遗留项 #1);仅 anthropic 档消费。undefined=默认开,0=关(0.10.0 #40.4) */
294
+ thinkingBudgetTokens?: number;
293
295
  }
294
296
  /** 四档客户端都能自查可达性,所以工厂的返回类型直接把探测能力算进契约 */
295
297
  type ConfiguredLlmClient = LlmClient & {
package/dist/browser.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { D as exportSkills, F as parseSkillPackManifest, G as unzipWithLimits, I as readResponseWithLimit, J as verifySkillSignature, K as validateSkills, L as readSkillSignature, M as messageOf, O as isAtomicTempPath, P as parseSkillMarkdown, T as detectSkillArchiveShapeFromFs, V as resolveInsideRoot, b as buildManifest, c as SKILL_MANIFEST_FILE, d as SKILL_PACK_FILE, g as assertRemoteUrlAllowed, h as WebSkillError, i as MANIFEST_EXCLUDED_FILES, k as isValidSkillName, p as SkillDiscovery, q as verifyManifest, s as SKILLS_LOCKFILE, v as atomicWriteText, y as buildCatalog } from "./dist-Bev6i6Ip.js";
2
- import { B as bridgeError, C as ProgressiveRouter, S as OpenAiCompatibleClient, U as createWebSkillApi, a as AgentLoop, b as GoogleGenAiClient, c as CapabilityApproval, dt as parseBridgeRequest, g as FsRunSnapshotStore, h as FsMemoryStore, it as mergeCatalogEntries, lt as normalizeToolContent, m as FsArtifactStore, o as AnthropicClient, ot as networkPolicyLibSource, ut as normalizeToolError } from "./dist-CFmkV45C.js";
3
- import { n as MockLlmClient } from "./testing-Csg5ljNm.js";
2
+ import { B as bridgeError, C as ProgressiveRouter, S as OpenAiCompatibleClient, U as createWebSkillApi, a as AgentLoop, b as GoogleGenAiClient, c as CapabilityApproval, dt as parseBridgeRequest, g as FsRunSnapshotStore, h as FsMemoryStore, it as mergeCatalogEntries, lt as normalizeToolContent, m as FsArtifactStore, o as AnthropicClient, ot as networkPolicyLibSource, ut as normalizeToolError } from "./dist-BViUeszk.js";
3
+ import { n as MockLlmClient } from "./testing-WPTyXQYt.js";
4
4
 
5
5
  //#region ../browser/dist/index.js
6
6
  /** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
@@ -1397,11 +1397,15 @@ function createLlmClient(config) {
1397
1397
  ...config.requestTimeoutMs !== void 0 ? { requestTimeoutMs: config.requestTimeoutMs } : {}
1398
1398
  };
1399
1399
  const apiKey = config.apiKey?.trim() ?? "";
1400
- if (config.provider === "anthropic") return new AnthropicClient({
1401
- ...common,
1402
- apiKey,
1403
- model: config.model
1404
- });
1400
+ if (config.provider === "anthropic") {
1401
+ const thinkingBudgetTokens = config.thinkingBudgetTokens ?? 1e4;
1402
+ return new AnthropicClient({
1403
+ ...common,
1404
+ apiKey,
1405
+ model: config.model,
1406
+ ...thinkingBudgetTokens > 0 ? { thinkingBudgetTokens } : {}
1407
+ });
1408
+ }
1405
1409
  if (config.provider === "google") return new GoogleGenAiClient({
1406
1410
  ...common,
1407
1411
  apiKey,
@@ -1773,6 +1777,10 @@ function valueOf(element) {
1773
1777
  const value = element.value;
1774
1778
  return value === "" ? void 0 : clip(value);
1775
1779
  }
1780
+ if (element.getAttribute("role") === "combobox") {
1781
+ const value = element.getAttribute("data-value");
1782
+ return value === null || value === "" ? void 0 : clip(value);
1783
+ }
1776
1784
  }
1777
1785
  /**
1778
1786
  * 隐藏节点不进结果:屏幕上看不见的东西,用户没有机会发现它被读走了。