@webskill/sdk 0.26.1 → 0.27.1

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/README.md CHANGED
@@ -30,7 +30,9 @@ governance.
30
30
  stripped in the worker entry (0.2.3); other host-shared surfaces are NOT
31
31
  defended — use `ProcessSandboxExecutor` for untrusted skills.
32
32
  - **`navigator.webskill`** — a browser facade (`discover` / `read` / `validate` /
33
- `run` / `install` / `uninstall`) assembled explicitly in one call.
33
+ `run` / `install` / `uninstall`) assembled explicitly in one call. For a
34
+ native-preserving compatibility package with ESM and standalone IIFE builds,
35
+ see [`@webskill/polyfill`](../polyfill).
34
36
  - **MCP** — call page-provided tools and consume page-declared dynamic skills
35
37
  over standard MCP transports (MessageChannel).
36
38
  - **Governance** — LLM-generated skill candidates with mandatory review,
package/dist/agent.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { D as DEFAULT_MAX_DATA_SOURCE_BYTES } from "./index-D6eSrEi5.js";
2
- import { $ as DownloadedFileEntry, $n as SkillBinaryPayload, $r as XlsxTableReader, $t as PERCEPTION_PAGING_DEFAULTS, A as DataSourceRecord, Ai as isRangeTopLeft, An as PerceptionAuditSink, Ar as TemplateFillRejection, At as FILL_TEMPLATE_TOOL, B as DocumentFileSource, Bi as toFrameScopes, Bn as QUERY_TABLE_TOOL, Br as TodoItem, Bt as LIST_PAGE_TABS_TOOL, C as DataSourceCandidateRecord, Ci as dwgPickView, Cn as ParentBudget, Cr as TabWorksetToolSourceOptions, Ct as DwgView, D as DataSourcePolicy, Di as frameLabel, Dn as PdfTextQuality, Dr as TableWorkbook, Dt as EMU_PER_TWIP, E as DataSourceKind, Ei as formatCellAddress, En as PdfPageImage, Er as TableSource, Et as EMU_PER_POINT, F as DelegationRequest, Fi as rangeContains, Fn as PerceptionScope, Fr as TemplateSheetBlanks, Ft as GeneratedSkillDraft, G as DocumentToolSourceOptions, Gn as RemoteImageResult, Gr as TodoToolSourceOptions, Gt as OpenedTabSignal, H as DocumentImageRole, Hn as READ_DOWNLOADED_FILE_TOOL, Hr as TodoListener, Ht as MAX_DIGIT_WIDTH, I as DelegationResult, Ii as readImageSize, In as PerceptionScopeInput, Ir as TemplateSheetSkeleton, It as HttpDataSourceOptions, J as DocxTemplateEngine, Jn as SCROLL_DIRECTIONS, Jr as WorksetTabView, Jt as PAGE_ACTION_TOOL, K as DocxDocumentContent, Kn as RemoteImageToolSourceOptions, Kr as VIEW_DWG_TOOL, Kt as PAGE_ACTION_KINDS, L as DelegationToolSourceOptions, Li as sniffDocumentFormat, Ln as PptxDocumentContent, Lr as TemplateTableCellSkeleton, Lt as INSPECT_TEMPLATE_TOOL, M as DelegationBudget, Mi as parseCellAddress, Mn as PerceptionPagingBudget, Mr as TemplateImageBytes, Mt as FrameNote, N as DelegationOrchestrator, Ni as parseCellRange, Nn as PerceptionRecord, Nr as TemplateImageResolver, Nt as FrameScope, O as DataSourcePolicyOptions, Oi as frameSteps, On as PerceivedImage, Or as TemplateCellSkeleton, Ot as EXPORT_SPREADSHEET_TOOL, P as DelegationOrchestratorOptions, Pi as profileTable, Pn as PerceptionResult, Pr as TemplateParagraphSkeleton, Pt as GENERATE_SKILL_TOOL, Q as DownloadedFileConsent, Qn as SkillAttachmentBytes, Qr as XlsxSheetContent, Qt as PERCEIVE_PAGE_TOOL, R as DocumentBlock, Ri as takesImage, Rn as PptxDocumentReader, Rr as TemplateToolSourceOptions, Rt as ImageCaptureBudget, S as DataSourceCandidatePolicyOptions, Si as defersImage, Sn as PagePerceptionToolSourceOptions, Sr as TabWorksetPort, St as DwgUnits, T as DataSourceDef, Ti as fitWithin, Tn as PdfDocumentReader, Tr as TableSheet, Tt as EMU_PER_PIXEL, U as DocumentReadBudget, Un as RemoteImageFetch, Ur as TodoStatus, Ut as NestedFrameRef, V as DocumentFormat, Vi as withDelegationOrigin, Vn as READ_DOCUMENT_TOOL, Vr as TodoList, Vt as MANAGE_TODO_TOOL, W as DocumentReadMode, Wn as RemoteImageFetchFailure, Wr as TodoStore, Wt as OpenedPageInfo, X as DocxTemplateSkeleton, Xn as ScrollDirection, Xr as XlsxDocumentReader, Xt as PDF_GARBLED_RATIO, Y as DocxTemplateFillSpec, Yn as SKILL_GENERATION_SYSTEM_PROMPT, Yr as XlsxDocumentContent, Yt as PAGE_DOCUMENT_REF, Z as DownloadedFileAction, Zn as Size, Zr as XlsxFillOutcome, Zt as PDF_LARGE_IMAGE_RATIO, _ as DWG_MODEL_VIEW_ID, _i as createSpreadsheetToolSource, _n as PageImageResult, _r as TEMPLATE_INSPECT_BUDGET, _t as DwgOmission, a as ActionTabWindow, ai as clampWorksetMax, an as PageActionPolicy, ar as SkillGenerator, at as DownloadedFileRecord, b as DataSourceCandidateAuditSink, bi as createTemplateToolSource, bn as PagePerceptionPolicyOptions, br as TabWorksetPolicy, bt as DwgProjection, c as CellAddress, ci as createDocumentToolSource, cn as PageActionRequest, cr as SkillTraceEvidenceStep, ct as DwgComponent, d as DELEGATE_TASK_TOOL, di as createHttpDataSourceTransport, dn as PageActionTarget, dr as SubAgentRunner, dt as DwgEntity, ei as XlsxTemplateEngine, en as PERCEPTION_SYSTEM_PROMPT, er as SkillCandidateSink, et as DownloadedFileListing, f as DELEGATION_SYSTEM_PROMPT, fi as createPageActionToolSource, fn as PageActionToolSourceOptions, fr as SubtreeRejection, ft as DwgFill, g as DOWNLOAD_WAIT_MIN_MS, gi as createSkillGenerationToolSource, gn as PageImageFailure, gr as TAB_WORKSET_SYSTEM_PROMPT, gt as DwgLoadedDrawing, h as DOWNLOAD_WAIT_MAX_MS, hi as createRemoteImageToolSource, hn as PageImageCapture, hr as TAB_WORKSET_MIN_MAX, ht as DwgLayer, i as ActionTabWatcher, ii as clampDownloadWaitMs, in as PageActionOutcome, ir as SkillGenerationToolSourceOptions, it as DownloadedFileReader, j as DataSourceTransport, ji as measurePdfTextQuality, jn as PerceptionCaptureOptions, jr as TemplateFillWarning, jt as FOCUS_PAGE_TAB_TOOL, k as DataSourceProvenance, ki as isPdfTextTrustworthy, kn as PerceivedNode, kr as TemplateFileSource, kt as FETCH_REMOTE_IMAGE_TOOL, l as CellRange, li as createDownloadedFileToolSource, ln as PageActionScope, lr as SpreadsheetToolSourceOptions, lt as DwgDocumentContent, m as DOWNLOAD_WAIT_DEFAULT_MS, mi as createPagePerceptionToolSource, mn as PageAuditSink, mr as TAB_WORKSET_MAX_MAX, mt as DwgGeometry, n as ActionDownloadWindow, ni as XlsxTemplateSkeleton, nn as PageActionExecutor, nr as SkillGenerationOutcome, nt as DownloadedFilePolicyOptions, o as CAPTURE_PAGE_IMAGE_TOOL, oi as columnWidthToPixels, on as PageActionPolicyOptions, or as SkillGeneratorOptions, ot as DownloadedFileToolSourceOptions, p as DOCUMENT_READ_BUDGET, pi as createPageImageToolSource, pn as PageActionUi, pr as TAB_WORKSET_DEFAULT_MAX, pt as DwgFont, q as DocxDocumentReader, qn as RenderedImage, qr as WorksetTab, qt as PAGE_ACTION_SYSTEM_PROMPT, r as ActionFrameScope, ri as asReadMode, rn as PageActionKind, rr as SkillGenerationPolicy, rt as DownloadedFileReadResult, s as CLOSE_PAGE_TAB_TOOL, si as createDelegationToolSource, sn as PageActionRecord, sr as SkillTraceEvidence, st as DwgBounds, t as ActionDownloadWatcher, ti as XlsxTemplateFillSpec, tn as PageActionConsent, tr as SkillGenerationMessages, tt as DownloadedFilePolicy, u as ConsentUi, ui as createDwgToolSource, un as PageActionScopeInput, ur as SubAgentRunInput, ut as DwgDocumentReader, v as DataSourceAuditSink, vi as createTabWorksetToolSource, vn as PageImageToolSourceOptions, vr as TODO_SYSTEM_PROMPT, vt as DwgPoint, w as DataSourceCandidateStore, wi as dwgViewsOf, wn as PdfDocumentHandle, wr as TableQueryToolSourceOptions, wt as DwgViewport, x as DataSourceCandidatePolicy, xi as createTodoToolSource, xn as PagePerceptionReader, xr as TabWorksetPolicyOptions, xt as DwgToolSourceOptions, y as DataSourceCandidate, yi as createTableQueryToolSource, yn as PagePerceptionPolicy, yr as TabAdmission, yt as DwgProjectedDrawing, z as DocumentFileBytes, zi as toActionFrameScopes, zn as PptxSlideContent, zr as TodoEvent, zt as LIST_DOWNLOADED_FILES_TOOL } from "./index-L5JaAkLd.js";
2
+ import { $ as DownloadedFileEntry, $n as SkillBinaryPayload, $r as XlsxTableReader, $t as PERCEPTION_PAGING_DEFAULTS, A as DataSourceRecord, Ai as isRangeTopLeft, An as PerceptionAuditSink, Ar as TemplateFillRejection, At as FILL_TEMPLATE_TOOL, B as DocumentFileSource, Bi as toFrameScopes, Bn as QUERY_TABLE_TOOL, Br as TodoItem, Bt as LIST_PAGE_TABS_TOOL, C as DataSourceCandidateRecord, Ci as dwgPickView, Cn as ParentBudget, Cr as TabWorksetToolSourceOptions, Ct as DwgView, D as DataSourcePolicy, Di as frameLabel, Dn as PdfTextQuality, Dr as TableWorkbook, Dt as EMU_PER_TWIP, E as DataSourceKind, Ei as formatCellAddress, En as PdfPageImage, Er as TableSource, Et as EMU_PER_POINT, F as DelegationRequest, Fi as rangeContains, Fn as PerceptionScope, Fr as TemplateSheetBlanks, Ft as GeneratedSkillDraft, G as DocumentToolSourceOptions, Gn as RemoteImageResult, Gr as TodoToolSourceOptions, Gt as OpenedTabSignal, H as DocumentImageRole, Hn as READ_DOWNLOADED_FILE_TOOL, Hr as TodoListener, Ht as MAX_DIGIT_WIDTH, I as DelegationResult, Ii as readImageSize, In as PerceptionScopeInput, Ir as TemplateSheetSkeleton, It as HttpDataSourceOptions, J as DocxTemplateEngine, Jn as SCROLL_DIRECTIONS, Jr as WorksetTabView, Jt as PAGE_ACTION_TOOL, K as DocxDocumentContent, Kn as RemoteImageToolSourceOptions, Kr as VIEW_DWG_TOOL, Kt as PAGE_ACTION_KINDS, L as DelegationToolSourceOptions, Li as sniffDocumentFormat, Ln as PptxDocumentContent, Lr as TemplateTableCellSkeleton, Lt as INSPECT_TEMPLATE_TOOL, M as DelegationBudget, Mi as parseCellAddress, Mn as PerceptionPagingBudget, Mr as TemplateImageBytes, Mt as FrameNote, N as DelegationOrchestrator, Ni as parseCellRange, Nn as PerceptionRecord, Nr as TemplateImageResolver, Nt as FrameScope, O as DataSourcePolicyOptions, Oi as frameSteps, On as PerceivedImage, Or as TemplateCellSkeleton, Ot as EXPORT_SPREADSHEET_TOOL, P as DelegationOrchestratorOptions, Pi as profileTable, Pn as PerceptionResult, Pr as TemplateParagraphSkeleton, Pt as GENERATE_SKILL_TOOL, Q as DownloadedFileConsent, Qn as SkillAttachmentBytes, Qr as XlsxSheetContent, Qt as PERCEIVE_PAGE_TOOL, R as DocumentBlock, Ri as takesImage, Rn as PptxDocumentReader, Rr as TemplateToolSourceOptions, Rt as ImageCaptureBudget, S as DataSourceCandidatePolicyOptions, Si as defersImage, Sn as PagePerceptionToolSourceOptions, Sr as TabWorksetPort, St as DwgUnits, T as DataSourceDef, Ti as fitWithin, Tn as PdfDocumentReader, Tr as TableSheet, Tt as EMU_PER_PIXEL, U as DocumentReadBudget, Un as RemoteImageFetch, Ur as TodoStatus, Ut as NestedFrameRef, V as DocumentFormat, Vi as withDelegationOrigin, Vn as READ_DOCUMENT_TOOL, Vr as TodoList, Vt as MANAGE_TODO_TOOL, W as DocumentReadMode, Wn as RemoteImageFetchFailure, Wr as TodoStore, Wt as OpenedPageInfo, X as DocxTemplateSkeleton, Xn as ScrollDirection, Xr as XlsxDocumentReader, Xt as PDF_GARBLED_RATIO, Y as DocxTemplateFillSpec, Yn as SKILL_GENERATION_SYSTEM_PROMPT, Yr as XlsxDocumentContent, Yt as PAGE_DOCUMENT_REF, Z as DownloadedFileAction, Zn as Size, Zr as XlsxFillOutcome, Zt as PDF_LARGE_IMAGE_RATIO, _ as DWG_MODEL_VIEW_ID, _i as createSpreadsheetToolSource, _n as PageImageResult, _r as TEMPLATE_INSPECT_BUDGET, _t as DwgOmission, a as ActionTabWindow, ai as clampWorksetMax, an as PageActionPolicy, ar as SkillGenerator, at as DownloadedFileRecord, b as DataSourceCandidateAuditSink, bi as createTemplateToolSource, bn as PagePerceptionPolicyOptions, br as TabWorksetPolicy, bt as DwgProjection, c as CellAddress, ci as createDocumentToolSource, cn as PageActionRequest, cr as SkillTraceEvidenceStep, ct as DwgComponent, d as DELEGATE_TASK_TOOL, di as createHttpDataSourceTransport, dn as PageActionTarget, dr as SubAgentRunner, dt as DwgEntity, ei as XlsxTemplateEngine, en as PERCEPTION_SYSTEM_PROMPT, er as SkillCandidateSink, et as DownloadedFileListing, f as DELEGATION_SYSTEM_PROMPT, fi as createPageActionToolSource, fn as PageActionToolSourceOptions, fr as SubtreeRejection, ft as DwgFill, g as DOWNLOAD_WAIT_MIN_MS, gi as createSkillGenerationToolSource, gn as PageImageFailure, gr as TAB_WORKSET_SYSTEM_PROMPT, gt as DwgLoadedDrawing, h as DOWNLOAD_WAIT_MAX_MS, hi as createRemoteImageToolSource, hn as PageImageCapture, hr as TAB_WORKSET_MIN_MAX, ht as DwgLayer, i as ActionTabWatcher, ii as clampDownloadWaitMs, in as PageActionOutcome, ir as SkillGenerationToolSourceOptions, it as DownloadedFileReader, j as DataSourceTransport, ji as measurePdfTextQuality, jn as PerceptionCaptureOptions, jr as TemplateFillWarning, jt as FOCUS_PAGE_TAB_TOOL, k as DataSourceProvenance, ki as isPdfTextTrustworthy, kn as PerceivedNode, kr as TemplateFileSource, kt as FETCH_REMOTE_IMAGE_TOOL, l as CellRange, li as createDownloadedFileToolSource, ln as PageActionScope, lr as SpreadsheetToolSourceOptions, lt as DwgDocumentContent, m as DOWNLOAD_WAIT_DEFAULT_MS, mi as createPagePerceptionToolSource, mn as PageAuditSink, mr as TAB_WORKSET_MAX_MAX, mt as DwgGeometry, n as ActionDownloadWindow, ni as XlsxTemplateSkeleton, nn as PageActionExecutor, nr as SkillGenerationOutcome, nt as DownloadedFilePolicyOptions, o as CAPTURE_PAGE_IMAGE_TOOL, oi as columnWidthToPixels, on as PageActionPolicyOptions, or as SkillGeneratorOptions, ot as DownloadedFileToolSourceOptions, p as DOCUMENT_READ_BUDGET, pi as createPageImageToolSource, pn as PageActionUi, pr as TAB_WORKSET_DEFAULT_MAX, pt as DwgFont, q as DocxDocumentReader, qn as RenderedImage, qr as WorksetTab, qt as PAGE_ACTION_SYSTEM_PROMPT, r as ActionFrameScope, ri as asReadMode, rn as PageActionKind, rr as SkillGenerationPolicy, rt as DownloadedFileReadResult, s as CLOSE_PAGE_TAB_TOOL, si as createDelegationToolSource, sn as PageActionRecord, sr as SkillTraceEvidence, st as DwgBounds, t as ActionDownloadWatcher, ti as XlsxTemplateFillSpec, tn as PageActionConsent, tr as SkillGenerationMessages, tt as DownloadedFilePolicy, u as ConsentUi, ui as createDwgToolSource, un as PageActionScopeInput, ur as SubAgentRunInput, ut as DwgDocumentReader, v as DataSourceAuditSink, vi as createTabWorksetToolSource, vn as PageImageToolSourceOptions, vr as TODO_SYSTEM_PROMPT, vt as DwgPoint, w as DataSourceCandidateStore, wi as dwgViewsOf, wn as PdfDocumentHandle, wr as TableQueryToolSourceOptions, wt as DwgViewport, x as DataSourceCandidatePolicy, xi as createTodoToolSource, xn as PagePerceptionReader, xr as TabWorksetPolicyOptions, xt as DwgToolSourceOptions, y as DataSourceCandidate, yi as createTableQueryToolSource, yn as PagePerceptionPolicy, yr as TabAdmission, yt as DwgProjectedDrawing, z as DocumentFileBytes, zi as toActionFrameScopes, zn as PptxSlideContent, zr as TodoEvent, zt as LIST_DOWNLOADED_FILES_TOOL } from "./index--GvzV6Lq.js";
3
3
  export { type ActionDownloadWatcher, type ActionDownloadWindow, type ActionFrameScope, type ActionTabWatcher, type ActionTabWindow, CAPTURE_PAGE_IMAGE_TOOL, CLOSE_PAGE_TAB_TOOL, type CellAddress, type CellRange, type ConsentUi, DEFAULT_MAX_DATA_SOURCE_BYTES, DELEGATE_TASK_TOOL, DELEGATION_SYSTEM_PROMPT, DOCUMENT_READ_BUDGET, DOWNLOAD_WAIT_DEFAULT_MS, DOWNLOAD_WAIT_MAX_MS, DOWNLOAD_WAIT_MIN_MS, DWG_MODEL_VIEW_ID, 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 DocumentBlock, type DocumentFileBytes, type DocumentFileSource, type DocumentFormat, type DocumentImageRole, type DocumentReadBudget, type DocumentReadMode, type DocumentToolSourceOptions, type DocxDocumentContent, type DocxDocumentReader, type DocxTemplateEngine, type DocxTemplateFillSpec, type DocxTemplateSkeleton, type DownloadedFileAction, type DownloadedFileConsent, type DownloadedFileEntry, type DownloadedFileListing, DownloadedFilePolicy, type DownloadedFilePolicyOptions, type DownloadedFileReadResult, type DownloadedFileReader, type DownloadedFileRecord, type DownloadedFileToolSourceOptions, type DwgBounds, type DwgComponent, type DwgDocumentContent, type DwgDocumentReader, type DwgEntity, type DwgFill, type DwgFont, type DwgGeometry, type DwgLayer, type DwgLoadedDrawing, type DwgOmission, type DwgPoint, type DwgProjectedDrawing, type DwgProjection, type DwgToolSourceOptions, type DwgUnits, type DwgView, type DwgViewport, EMU_PER_PIXEL, EMU_PER_POINT, EMU_PER_TWIP, EXPORT_SPREADSHEET_TOOL, FETCH_REMOTE_IMAGE_TOOL, FILL_TEMPLATE_TOOL, FOCUS_PAGE_TAB_TOOL, type FrameNote, type FrameScope, GENERATE_SKILL_TOOL, type GeneratedSkillDraft, type HttpDataSourceOptions, INSPECT_TEMPLATE_TOOL, type ImageCaptureBudget, LIST_DOWNLOADED_FILES_TOOL, LIST_PAGE_TABS_TOOL, MANAGE_TODO_TOOL, MAX_DIGIT_WIDTH, type NestedFrameRef, type OpenedPageInfo, type OpenedTabSignal, PAGE_ACTION_KINDS, PAGE_ACTION_SYSTEM_PROMPT, PAGE_ACTION_TOOL, PAGE_DOCUMENT_REF, PDF_GARBLED_RATIO, PDF_LARGE_IMAGE_RATIO, 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, type PageImageCapture, type PageImageFailure, type PageImageResult, type PageImageToolSourceOptions, PagePerceptionPolicy, type PagePerceptionPolicyOptions, type PagePerceptionReader, type PagePerceptionToolSourceOptions, type ParentBudget, type PdfDocumentHandle, type PdfDocumentReader, type PdfPageImage, type PdfTextQuality, type PerceivedImage, type PerceivedNode, type PerceptionAuditSink, type PerceptionCaptureOptions, type PerceptionPagingBudget, type PerceptionRecord, type PerceptionResult, type PerceptionScope, type PerceptionScopeInput, type PptxDocumentContent, type PptxDocumentReader, type PptxSlideContent, QUERY_TABLE_TOOL, READ_DOCUMENT_TOOL, READ_DOWNLOADED_FILE_TOOL, type RemoteImageFetch, type RemoteImageFetchFailure, type RemoteImageResult, type RemoteImageToolSourceOptions, type RenderedImage, SCROLL_DIRECTIONS, SKILL_GENERATION_SYSTEM_PROMPT, type ScrollDirection, type Size, type SkillAttachmentBytes, type SkillBinaryPayload, type SkillCandidateSink, type SkillGenerationMessages, type SkillGenerationOutcome, type SkillGenerationPolicy, type SkillGenerationToolSourceOptions, SkillGenerator, type SkillGeneratorOptions, type SkillTraceEvidence, type SkillTraceEvidenceStep, type SpreadsheetToolSourceOptions, type SubAgentRunInput, type SubAgentRunner, type SubtreeRejection, TAB_WORKSET_DEFAULT_MAX, TAB_WORKSET_MAX_MAX, TAB_WORKSET_MIN_MAX, TAB_WORKSET_SYSTEM_PROMPT, TEMPLATE_INSPECT_BUDGET, TODO_SYSTEM_PROMPT, type TabAdmission, TabWorksetPolicy, type TabWorksetPolicyOptions, type TabWorksetPort, type TabWorksetToolSourceOptions, type TableQueryToolSourceOptions, type TableSheet, type TableSource, type TableWorkbook, type TemplateCellSkeleton, type TemplateFileSource, type TemplateFillRejection, type TemplateFillWarning, type TemplateImageBytes, type TemplateImageResolver, type TemplateParagraphSkeleton, type TemplateSheetBlanks, type TemplateSheetSkeleton, type TemplateTableCellSkeleton, type TemplateToolSourceOptions, type TodoEvent, type TodoItem, type TodoList, type TodoListener, type TodoStatus, TodoStore, type TodoToolSourceOptions, VIEW_DWG_TOOL, type WorksetTab, type WorksetTabView, type XlsxDocumentContent, type XlsxDocumentReader, type XlsxFillOutcome, type XlsxSheetContent, type XlsxTableReader, type XlsxTemplateEngine, type XlsxTemplateFillSpec, type XlsxTemplateSkeleton, asReadMode, clampDownloadWaitMs, clampWorksetMax, columnWidthToPixels, createDelegationToolSource, createDocumentToolSource, createDownloadedFileToolSource, createDwgToolSource, createHttpDataSourceTransport, createPageActionToolSource, createPageImageToolSource, createPagePerceptionToolSource, createRemoteImageToolSource, createSkillGenerationToolSource, createSpreadsheetToolSource, createTabWorksetToolSource, createTableQueryToolSource, createTemplateToolSource, createTodoToolSource, defersImage, dwgPickView, dwgViewsOf, fitWithin, formatCellAddress, frameLabel, frameSteps, isPdfTextTrustworthy, isRangeTopLeft, measurePdfTextQuality, parseCellAddress, parseCellRange, profileTable, rangeContains, readImageSize, sniffDocumentFormat, takesImage, toActionFrameScopes, toFrameScopes, withDelegationOrigin };
package/dist/agent.js CHANGED
@@ -4,7 +4,7 @@ import { t as assertRemoteUrlAllowed } from "./urlSafety-CiSuCJvX.js";
4
4
  import { n as sanitizeUntrustedLine, t as UNTRUSTED_LINE_LIMIT } from "./untrustedText-BIaRvPZK.js";
5
5
  import { d as extractedDocumentFormat, f as formatAttachmentText, u as classifyAttachment } from "./kind-Dc8x0HWz.js";
6
6
  import { c as toBase64, d as SPREADSHEET_LIMITS, f as SPREADSHEET_MIME_TYPE, l as encodeSpreadsheet, m as DEFAULT_MAX_DATA_SOURCE_BYTES, u as SPREADSHEET_EXTENSION } from "./linkedDocument-0iiVPd5t.js";
7
- import { A as frameSteps, C as DOCUMENT_READ_BUDGET, D as SCROLL_DIRECTIONS, E as toActionFrameScopes, O as toFrameScopes, S as sniffDocumentFormat, T as PAGE_DOCUMENT_REF, _ as defersImage, a as columnWidthToPixels, b as isPdfTextTrustworthy, c as isRangeTopLeft, d as rangeContains, f as readImageSize, g as asReadMode, h as createDocumentToolSource, i as MAX_DIGIT_WIDTH, k as frameLabel, l as parseCellAddress, m as READ_DOCUMENT_TOOL, n as EMU_PER_POINT, o as fitWithin, p as PDF_LARGE_IMAGE_RATIO, r as EMU_PER_TWIP, s as formatCellAddress, t as EMU_PER_PIXEL, u as parseCellRange, v as takesImage, w as PAGE_ACTION_KINDS, x as measurePdfTextQuality, y as PDF_GARBLED_RATIO } from "./geometry-CRhuySKV.js";
7
+ import { A as frameSteps, C as DOCUMENT_READ_BUDGET, D as SCROLL_DIRECTIONS, E as toActionFrameScopes, O as toFrameScopes, S as sniffDocumentFormat, T as PAGE_DOCUMENT_REF, _ as defersImage, a as columnWidthToPixels, b as isPdfTextTrustworthy, c as isRangeTopLeft, d as rangeContains, f as readImageSize, g as asReadMode, h as createDocumentToolSource, i as MAX_DIGIT_WIDTH, k as frameLabel, l as parseCellAddress, m as READ_DOCUMENT_TOOL, n as EMU_PER_POINT, o as fitWithin, p as PDF_LARGE_IMAGE_RATIO, r as EMU_PER_TWIP, s as formatCellAddress, t as EMU_PER_PIXEL, u as parseCellRange, v as takesImage, w as PAGE_ACTION_KINDS, x as measurePdfTextQuality, y as PDF_GARBLED_RATIO } from "./geometry-BXMPNuM6.js";
8
8
 
9
9
  //#region ../agent/src/todo/store.ts
10
10
  const STATUSES = [
@@ -257,7 +257,8 @@ function createTodoToolSource(options = {}) {
257
257
  store.clear();
258
258
  return Promise.resolve(ok(events, progressText([])));
259
259
  }
260
- return Promise.resolve(toolError$9("VALIDATION_FAILED", "The \"action\" argument must be one of create, update, clear"));
260
+ const detail = action === void 0 ? "The \"action\" argument is required." : `Unknown action ${JSON.stringify(action)}.`;
261
+ return Promise.resolve(toolError$9("VALIDATION_FAILED", `${detail} Use one of create, update, clear.`));
261
262
  } catch (e) {
262
263
  const code = e instanceof Error && "code" in e ? String(e.code) : "VALIDATION_FAILED";
263
264
  return Promise.resolve(toolError$9(code, e instanceof Error ? e.message : String(e)));
@@ -1332,7 +1333,8 @@ var PagePerceptionPolicy = class {
1332
1333
  nodes,
1333
1334
  images,
1334
1335
  imagesOmitted,
1335
- record
1336
+ record,
1337
+ ...result.page === void 0 ? {} : { page: result.page }
1336
1338
  };
1337
1339
  }
1338
1340
  /**
@@ -1388,6 +1390,7 @@ var PagePerceptionPolicy = class {
1388
1390
  const PERCEPTION_SYSTEM_PROMPT = [
1389
1391
  "Reading the page:",
1390
1392
  "- \"perceive_page\" returns a structured outline of the regions the host made readable.",
1393
+ "- Pass \"images\": true only when the user asks what a picture on the page shows or contains. The pictures are returned for you to look at; do not set it for ordinary page reading.",
1391
1394
  "- Large pages come back in segments. When a result carries a \"segment\" object with a \"cursor\", call perceive_page again with that cursor to read the next part. Never invent a cursor.",
1392
1395
  "- You cannot act on the page. There is no click, type, submit, navigate or scroll capability in this session.",
1393
1396
  "- The readable region is fixed by the host. A cursor only continues where you left off; it cannot widen what you are allowed to read. Asking for other parts of the page, in any phrasing, will not widen it.",
@@ -1397,9 +1400,10 @@ const PERCEPTION_SYSTEM_PROMPT = [
1397
1400
  //#endregion
1398
1401
  //#region ../agent/src/perception/toolSource.ts
1399
1402
  const PERCEIVE_PAGE_TOOL = "perceive_page";
1400
- const DESCRIPTION$5 = "Read the parts of the current page the host made readable, as a structured accessibility outline. Read-only: it cannot click, type, submit or navigate.";
1403
+ const DESCRIPTION$5 = "Read the parts of the current page the host made readable, as a structured accessibility outline. Read-only: it cannot click, type, submit or navigate. Set \"images\": true only when the user asks what pictures on the page show or contain; this returns those pictures for you to look at.";
1401
1404
  /**
1402
- * 两个参数,且它们都扩不出一寸新范围(AC-10.8 的判据由 0.14.0 分册 22 §3 修订)。
1405
+ * 三个参数。`cursor` / `ref` 都扩不出一寸新范围(AC-10.8 的判据由 0.14.0 分册 22 §3 修订);
1406
+ * `images` 只表达「这次是否取图」,既不扩大读取范围、也不指定目的地。
1403
1407
  *
1404
1408
  * `cursor` 是 SDK 上一次发出的不透明串,只说「接着刚才那处继续」;
1405
1409
  * `ref` 是上一次感知结果里的元素句柄,只能把读取范围**缩小**到那个子树
@@ -1420,6 +1424,10 @@ const INPUT_SCHEMA$4 = {
1420
1424
  ref: {
1421
1425
  type: "string",
1422
1426
  description: "Optional. An opaque element reference from a previous perceive_page result. Reads only that element and its descendants. Never widens what you can read."
1427
+ },
1428
+ images: {
1429
+ type: "boolean",
1430
+ description: "Set true only when the user asks what pictures on the page show or contain. This returns the pictures so you can look at them; leave it out for ordinary page reading."
1423
1431
  }
1424
1432
  },
1425
1433
  additionalProperties: false
@@ -1431,16 +1439,22 @@ const SUBTREE_CODES = /* @__PURE__ */ new Set([
1431
1439
  "PERCEPTION_SUBTREE_OUT_OF_SCOPE",
1432
1440
  "PERCEPTION_SUBTREE_UNKNOWN_REF"
1433
1441
  ]);
1434
- function toolError$6(code, message) {
1442
+ function toolError$6(code, message, data) {
1435
1443
  return {
1436
1444
  ok: false,
1437
1445
  content: [],
1438
1446
  error: {
1439
1447
  code,
1440
- message
1448
+ message,
1449
+ ...data !== void 0 ? { data } : {}
1441
1450
  }
1442
1451
  };
1443
1452
  }
1453
+ /** 失效游标不是总能有“当前有效游标”:只有同一 run 的 pending 快照才有。 */
1454
+ function cursorError(options) {
1455
+ if (options.paged && options.pending !== void 0 && options.pending.runId === options.runId) return toolError$6("PERCEPTION_CURSOR_INVALID", CURSOR_REJECTED, { cursors: [...options.pending.cursors.keys()] });
1456
+ return toolError$6("PERCEPTION_CURSOR_INVALID", CURSOR_REJECTED, { restart: true });
1457
+ }
1444
1458
  /**
1445
1459
  * 游标 id。**不以随机性作为安全依据**:猜中一个游标,模型也只能拿到同一份快照的
1446
1460
  * 另一段——那本来就是宿主授权它读的内容。授权自始至终由 `scope` 承担(设计 §5.2)。
@@ -1541,24 +1555,37 @@ function createPagePerceptionToolSource(options) {
1541
1555
  if (ref !== void 0 && typeof ref !== "string") return toolError$6("PERCEPTION_REF_INVALID", "perceive_page needs \"ref\" to be a string when it is present.");
1542
1556
  if (cursor !== void 0) {
1543
1557
  const index = typeof cursor === "string" ? pending?.cursors.get(cursor) : void 0;
1544
- if (!paged || pending === void 0 || index === void 0 || pending.runId !== context?.runId) return toolError$6("PERCEPTION_CURSOR_INVALID", CURSOR_REJECTED);
1545
- if (ref !== void 0 && ref !== pending.subtreeRef) return toolError$6("PERCEPTION_CURSOR_INVALID", CURSOR_REJECTED);
1558
+ if (!paged || pending === void 0 || index === void 0 || pending.runId !== context?.runId) return cursorError({
1559
+ pending,
1560
+ paged,
1561
+ runId: context?.runId
1562
+ });
1563
+ if (ref !== void 0 && ref !== pending.subtreeRef) return cursorError({
1564
+ pending,
1565
+ paged: true,
1566
+ runId: context?.runId
1567
+ });
1546
1568
  return resultOf(pending, index);
1547
1569
  }
1570
+ const imagesArg = args["images"];
1571
+ if (imagesArg !== void 0 && typeof imagesArg !== "boolean") return toolError$6("VALIDATION_FAILED", "perceive_page needs \"images\" to be a boolean when present.");
1572
+ const wantsImages = imagesArg === true;
1548
1573
  try {
1549
- const image = await options.imageCapture?.();
1574
+ const image = wantsImages ? await options.imageCaptureForRequest?.() : await options.imageCapture?.();
1550
1575
  const capture = {
1551
1576
  images: image?.enabled === true,
1552
1577
  maxImageBytes: image?.maxImageBytes ?? 0,
1553
1578
  maxImages: image?.maxImages ?? 0,
1554
1579
  minImageArea: image?.minImageArea ?? 0
1555
1580
  };
1556
- const { nodes, images, imagesOmitted, record } = await policy.perceive(capture, ref === void 0 ? void 0 : { ref });
1581
+ const { nodes, images, imagesOmitted, record, page } = await policy.perceive(capture, ref === void 0 ? void 0 : { ref });
1557
1582
  const data = {
1583
+ ...page === void 0 ? {} : { page },
1558
1584
  scope: record.include,
1559
1585
  excluded: record.exclude,
1560
1586
  nodes
1561
1587
  };
1588
+ if (wantsImages && image?.enabled !== true) data["imagesUnavailable"] = image?.unavailableReason ?? "Page pictures were not returned. The host has page image capture off, or no image-capable model is configured. Do not describe the pictures from the surrounding text; tell the user what is missing.";
1562
1589
  if (imagesOmitted > 0) data["imagesOmitted"] = imagesOmitted;
1563
1590
  if ((record.imageFailures ?? 0) > 0) data["imageFailures"] = record.imageFailures;
1564
1591
  const { segments, nodesTotal } = segmentPerception(nodes, budget);
@@ -2434,7 +2461,10 @@ var TabWorksetPolicy = class {
2434
2461
  page: pageOf(tab),
2435
2462
  ...from !== void 0 ? { from } : {}
2436
2463
  });
2437
- return { focused: handle };
2464
+ return {
2465
+ focused: handle,
2466
+ ...tab.url !== void 0 ? { url: tab.url } : {}
2467
+ };
2438
2468
  }
2439
2469
  async close(handle) {
2440
2470
  const tabs = await this.#options.port.list();
@@ -2529,7 +2559,7 @@ function pageOf(tab) {
2529
2559
  */
2530
2560
  const TAB_WORKSET_SYSTEM_PROMPT = `You can work across several pages within one task.
2531
2561
 
2532
- - \`list_page_tabs\` shows the pages available to you. The first one is the user's own page; you can read and act on it, but you can never close it.
2562
+ - \`list_page_tabs\` shows the pages available to you, each with its current address. The first one is the user's own page; you can read and act on it, but you can never close it. When a task asks you to share a link to a page you are on, take that address from this list — you cannot type an address yourself.
2533
2563
  - \`focus_page_tab\` decides which page \`perceive_page\` and \`act_on_page\` talk to next. Element references are per-page: a reference from one page will be rejected on another, so perceive after every switch.
2534
2564
  - New pages only join this set when an action you took opened them. You cannot open a page by URL, and pages the user opens on their own are not yours to touch.
2535
2565
  - Close a detail page with \`close_page_tab\` once you have read what you needed. Leaving them open uses up the page budget and will eventually block new ones.
@@ -2571,7 +2601,7 @@ const TAB_SCHEMA = {
2571
2601
  const SPECS = [
2572
2602
  {
2573
2603
  name: LIST_PAGE_TABS_TOOL,
2574
- description: "List the pages available to this task. The first entry is the user's own page and cannot be closed. Takes no arguments.",
2604
+ description: "List the pages available to this task, with each page's current address. The first entry is the user's own page and cannot be closed. Takes no arguments.",
2575
2605
  inputSchema: LIST_SCHEMA
2576
2606
  },
2577
2607
  {
@@ -4752,7 +4782,7 @@ function json(data) {
4752
4782
  //#endregion
4753
4783
  //#region ../agent/src/pageImage/toolSource.ts
4754
4784
  const CAPTURE_PAGE_IMAGE_TOOL = "capture_page_image";
4755
- const DESCRIPTION$1 = "Save a picture that is already on the page as a run artifact, so a skill can place it in a document.";
4785
+ const DESCRIPTION$1 = "Save a picture that is already on the page as a run artifact, so a skill can place it in a document. To see what a picture shows, use perceive_page with images: true instead.";
4756
4786
  const INPUT_SCHEMA$1 = {
4757
4787
  type: "object",
4758
4788
  properties: {
@@ -4768,7 +4798,7 @@ const INPUT_SCHEMA$1 = {
4768
4798
  required: ["ref"],
4769
4799
  additionalProperties: false
4770
4800
  };
4771
- const SYSTEM_PROMPT$2 = "Use capture_page_image when a picture on the current page belongs in a document you are about to produce. It returns a reference, never the picture itself — pass that reference to the skill, do not try to read it back. Capturing does not tell you what the picture shows; ask for a page perception with images if you need that. Capture one picture per call, and only for nodes the page perception marked as capturable. Do not list the captured references back to the user. They are working material for the document, not a deliverable; say how many pictures went in and leave it at that.";
4801
+ const SYSTEM_PROMPT$2 = "Use capture_page_image when a picture on the current page belongs in a document you are about to produce. It returns a reference, never the picture itself — pass that reference to the skill, do not try to read it back. To see what a picture shows, call perceive_page with images: true; capturing here only saves it for a document and does not tell you what it shows. Capture one picture per call, and only for nodes the page perception marked as capturable. Do not list the captured references back to the user. They are working material for the document, not a deliverable; say how many pictures went in and leave it at that.";
4772
4802
  const isFailure$1 = (result) => "reason" in result;
4773
4803
  /**
4774
4804
  * 页面取像工具(0.22.0 分册 12)。
@@ -1412,6 +1412,7 @@ var AgentLoop = class {
1412
1412
  maxTurns: this.#config.maxTurns,
1413
1413
  totalTimeoutMs: this.#config.totalTimeoutMs,
1414
1414
  externalToolSchemas: /* @__PURE__ */ new Map(),
1415
+ exposeReadSkillFile: true,
1415
1416
  controller: new AbortController()
1416
1417
  };
1417
1418
  this.#controllers.set(runId, state.controller);
@@ -1424,6 +1425,7 @@ var AgentLoop = class {
1424
1425
  strategy: route.strategy,
1425
1426
  skillCount: route.catalog.entries.length
1426
1427
  } });
1428
+ state.exposeReadSkillFile = route.catalog.entries.length > 0 || (this.#deps.skillProviders?.length ?? 0) > 0;
1427
1429
  await this.#lifecycle({
1428
1430
  phase: "route",
1429
1431
  data: {
@@ -1572,7 +1574,7 @@ var AgentLoop = class {
1572
1574
  const externalToolSpecs = externalSpecs.filter((spec) => this.#disclosed(state, spec.name));
1573
1575
  const skillToolSpecs = [...scriptToolSpecs, ...externalToolSpecs];
1574
1576
  const toolSpecs = this.#config.toolCallingDisabled ? [] : [
1575
- toLlmToolSpec(READ_SKILL_FILE_TOOL),
1577
+ ...state.exposeReadSkillFile ? [toLlmToolSpec(READ_SKILL_FILE_TOOL)] : [],
1576
1578
  ...this.#deps.uiBridge ? [toLlmToolSpec(ASK_USER_TOOL)] : [],
1577
1579
  ...this.#deps.linkedDocuments ? [toLlmToolSpec(READ_LINKED_DOCUMENT_TOOL)] : [],
1578
1580
  ...skillToolSpecs
@@ -1871,6 +1873,7 @@ var AgentLoop = class {
1871
1873
  maxTurns: snapshot.config.maxTurns,
1872
1874
  totalTimeoutMs: snapshot.config.totalTimeoutMs,
1873
1875
  externalToolSchemas: /* @__PURE__ */ new Map(),
1876
+ exposeReadSkillFile: true,
1874
1877
  controller: new AbortController()
1875
1878
  };
1876
1879
  this.#controllers.set(runId, state.controller);
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { G as FileStat, It as VerifyResult, K as FileSystemProvider, Lt as WebSkillError, N as ArchiveLimits, Ot as SkillsLockfile, Pt as UnsignedPolicy, S as UiBridge, St as SkillManifest, b as RenderResultRequest, c as InteractionResponse, jt as TrustedKeyStore, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, q as FileWriteStream, s as InteractionRequest, u as LlmCompleteInput, v as MemoryStore, vt as SkillInstallSource } from "./types-CpDRZ0rA-CFQ-vdKz.js";
2
2
  import { $ as ImageOmission, B as ExternalToolSource, C as BridgeResponse, N as DocumentSurfaceHost, Pn as ToolResult, S as BridgeRequest, Sr as bridgeError, Yr as parseBridgeRequest, b as BridgeCapabilities, ct as LinkedDocumentReader, en as ScriptExecutionContext, jn as ToolDefinition, m as ApprovalScope, mr as WebSkillApi, sr as ViewerImageFact, tn as ScriptExecutor, ut as NetworkPolicy, z as ExternalSkillProvider } from "./index-D6eSrEi5.js";
3
- import { $r as XlsxTableReader, In as PerceptionScopeInput, K as DocxDocumentContent, Ln as PptxDocumentContent, Pn as PerceptionResult, Rn as PptxDocumentReader, Tn as PdfDocumentReader, Ut as NestedFrameRef, Xr as XlsxDocumentReader, Yr as XlsxDocumentContent, cn as PageActionRequest, dn as PageActionTarget, fr as SubtreeRejection, in as PageActionOutcome, jn as PerceptionCaptureOptions, kn as PerceivedNode, mn as PageAuditSink, nn as PageActionExecutor, q as DocxDocumentReader, u as ConsentUi, un as PageActionScopeInput, xn as PagePerceptionReader, yn as PagePerceptionPolicy } from "./index-L5JaAkLd.js";
3
+ import { $r as XlsxTableReader, In as PerceptionScopeInput, K as DocxDocumentContent, Ln as PptxDocumentContent, Pn as PerceptionResult, Rn as PptxDocumentReader, Tn as PdfDocumentReader, Ut as NestedFrameRef, Xr as XlsxDocumentReader, Yr as XlsxDocumentContent, cn as PageActionRequest, dn as PageActionTarget, fr as SubtreeRejection, in as PageActionOutcome, jn as PerceptionCaptureOptions, kn as PerceivedNode, mn as PageAuditSink, nn as PageActionExecutor, q as DocxDocumentReader, u as ConsentUi, un as PageActionScopeInput, xn as PagePerceptionReader, yn as PagePerceptionPolicy } from "./index--GvzV6Lq.js";
4
4
  //#region ../browser/dist/index.d.ts
5
5
  //#region src/fs/featureDetection.d.ts
6
6
  /** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
@@ -1636,9 +1636,9 @@ declare function readDocxBlocks(bytes: Uint8Array): Promise<DocxDocumentContent>
1636
1636
  * 图不是浮在表外的附件,它压着某几行几列——按锚点插回行流里,
1637
1637
  * 模型才知道「这张图说的是上面那几行」。
1638
1638
  */
1639
- /** 值得单独烧一次多模态的图:至少跨 2 列、3 行(FR-22.11) @experimental */
1639
+ /** @experimental @deprecated 0.27.0 起不再按跨度过滤图片;保留导出仅为兼容既有调用。 */
1640
1640
  declare const XLSX_IMAGE_MIN_COLUMNS = 2;
1641
- /** @experimental */
1641
+ /** @experimental @deprecated 0.27.0 起不再按跨度过滤图片;保留导出仅为兼容既有调用。 */
1642
1642
  declare const XLSX_IMAGE_MIN_ROWS = 3;
1643
1643
  /** @experimental */
1644
1644
  declare function createXlsxBlockReader(): XlsxDocumentReader;