@webskill/sdk 0.26.0 → 0.27.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/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
- import { D as DEFAULT_MAX_DATA_SOURCE_BYTES } from "./index-DRkI7M3z.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-Bb9kBiF0.js";
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-QKiMepxO.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
@@ -3,8 +3,8 @@ import { b as parseSkillMarkdown, y as isValidSkillName } from "./skill-WSUDp6A1
3
3
  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
- 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-CZZOl9cO.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";
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-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
  /**
@@ -1431,16 +1433,22 @@ const SUBTREE_CODES = /* @__PURE__ */ new Set([
1431
1433
  "PERCEPTION_SUBTREE_OUT_OF_SCOPE",
1432
1434
  "PERCEPTION_SUBTREE_UNKNOWN_REF"
1433
1435
  ]);
1434
- function toolError$6(code, message) {
1436
+ function toolError$6(code, message, data) {
1435
1437
  return {
1436
1438
  ok: false,
1437
1439
  content: [],
1438
1440
  error: {
1439
1441
  code,
1440
- message
1442
+ message,
1443
+ ...data !== void 0 ? { data } : {}
1441
1444
  }
1442
1445
  };
1443
1446
  }
1447
+ /** 失效游标不是总能有“当前有效游标”:只有同一 run 的 pending 快照才有。 */
1448
+ function cursorError(options) {
1449
+ 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()] });
1450
+ return toolError$6("PERCEPTION_CURSOR_INVALID", CURSOR_REJECTED, { restart: true });
1451
+ }
1444
1452
  /**
1445
1453
  * 游标 id。**不以随机性作为安全依据**:猜中一个游标,模型也只能拿到同一份快照的
1446
1454
  * 另一段——那本来就是宿主授权它读的内容。授权自始至终由 `scope` 承担(设计 §5.2)。
@@ -1541,8 +1549,16 @@ function createPagePerceptionToolSource(options) {
1541
1549
  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
1550
  if (cursor !== void 0) {
1543
1551
  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);
1552
+ if (!paged || pending === void 0 || index === void 0 || pending.runId !== context?.runId) return cursorError({
1553
+ pending,
1554
+ paged,
1555
+ runId: context?.runId
1556
+ });
1557
+ if (ref !== void 0 && ref !== pending.subtreeRef) return cursorError({
1558
+ pending,
1559
+ paged: true,
1560
+ runId: context?.runId
1561
+ });
1546
1562
  return resultOf(pending, index);
1547
1563
  }
1548
1564
  try {
@@ -1553,8 +1569,9 @@ function createPagePerceptionToolSource(options) {
1553
1569
  maxImages: image?.maxImages ?? 0,
1554
1570
  minImageArea: image?.minImageArea ?? 0
1555
1571
  };
1556
- const { nodes, images, imagesOmitted, record } = await policy.perceive(capture, ref === void 0 ? void 0 : { ref });
1572
+ const { nodes, images, imagesOmitted, record, page } = await policy.perceive(capture, ref === void 0 ? void 0 : { ref });
1557
1573
  const data = {
1574
+ ...page === void 0 ? {} : { page },
1558
1575
  scope: record.include,
1559
1576
  excluded: record.exclude,
1560
1577
  nodes
@@ -2434,7 +2451,10 @@ var TabWorksetPolicy = class {
2434
2451
  page: pageOf(tab),
2435
2452
  ...from !== void 0 ? { from } : {}
2436
2453
  });
2437
- return { focused: handle };
2454
+ return {
2455
+ focused: handle,
2456
+ ...tab.url !== void 0 ? { url: tab.url } : {}
2457
+ };
2438
2458
  }
2439
2459
  async close(handle) {
2440
2460
  const tabs = await this.#options.port.list();
@@ -2529,7 +2549,7 @@ function pageOf(tab) {
2529
2549
  */
2530
2550
  const TAB_WORKSET_SYSTEM_PROMPT = `You can work across several pages within one task.
2531
2551
 
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.
2552
+ - \`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
2553
  - \`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
2554
  - 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
2555
  - 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 +2591,7 @@ const TAB_SCHEMA = {
2571
2591
  const SPECS = [
2572
2592
  {
2573
2593
  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.",
2594
+ 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
2595
  inputSchema: LIST_SCHEMA
2576
2596
  },
2577
2597
  {
@@ -4323,7 +4343,7 @@ const TEMPLATE_INSPECT_BUDGET = {
4323
4343
  const BLANK_RANGE_LIMIT = 100;
4324
4344
  const INSPECT_DESCRIPTION = "Look inside an Excel (.xlsx) or Word (.docx) template the user attached, and report where things are: sheet names, cell addresses and their current text, merged regions; for Word, paragraph indexes and table/row/column coordinates. For Excel it also reports what the template is waiting for: \"blankRanges\" are empty cells the template reserved — that is where the data goes, and leaving them empty is the most common way to get this wrong. \"coveredRanges\" are swallowed by a merged region: writing there shows nothing, write the top-left cell instead. \"headerRows\" are the template's own headings; do not overwrite them. A cell reported with a \"formula\" is worked out by the template itself — fill the cells that formula reads. Those cells are often absent from this listing because the template never styled them; they are still writable. Call this before fill_template — you cannot guess a template's layout.";
4325
4345
  const FILL_DESCRIPTION = "Fill an Excel (.xlsx) or Word (.docx) template the user attached and hand the result back as a downloadable file. Everything the template already contains — styling, column widths, merged cells, formulas, headers and footers — is kept exactly as it was; only the places you name are written. Cells that cannot be written come back one by one in \"rejected\" while every other cell is still written, so fix just those and call again. \"stillBlank\" lists cells the template is still waiting for — if it is not empty the template is not finished. The one exception is VBA macros: if the template is a macro-enabled workbook or document, the result is a plain .xlsx or .docx and its macros are dropped. Say so when you hand the file over.";
4326
- const TEMPLATE_ID = "The attachment id, or the id from list_downloaded_files.";
4346
+ const TEMPLATE_ID = "The id (or file name) of a file the user attached to any message in this conversation, or the id from list_downloaded_files.";
4327
4347
  function inspectSchema(idHint) {
4328
4348
  return {
4329
4349
  type: "object",
@@ -4562,7 +4582,7 @@ function createTemplateToolSource(options) {
4562
4582
  async function load(raw, tool, context) {
4563
4583
  if (typeof raw !== "string" || raw === "") throw new WebSkillError("TOOL_UNSUPPORTED", `${tool} requires the "template" id of an attachment or download.`);
4564
4584
  const file = await files.read(raw, context);
4565
- if (file === void 0) throw new WebSkillError("TOOL_UNSUPPORTED", `No readable file with id "${raw}". It is either not an attachment of the current message, or a download id that has since expired — list the downloads again to get a fresh one.`);
4585
+ if (file === void 0) throw new WebSkillError("TOOL_UNSUPPORTED", `No readable file with id "${raw}". It is neither an attachment of this conversation nor a download id that is still valid — a download id may have expired; list the downloads again to get a fresh one.`);
4566
4586
  const format = sniffDocumentFormat(file.bytes, file.name);
4567
4587
  if (format !== "xlsx" && format !== "docx") throw new WebSkillError("TEMPLATE_UNSUPPORTED", `"${file.name}" is not an Excel (.xlsx) or Word (.docx) file, so it cannot be used as a template.`);
4568
4588
  if ((format === "xlsx" ? xlsx : docx) === void 0) throw new WebSkillError("TEMPLATE_UNSUPPORTED", `This environment cannot fill ${format} templates.`);
@@ -3,7 +3,7 @@ import { b as parseSkillMarkdown, i as buildCatalog, n as SkillDiscovery, r as S
3
3
  import { o as atomicWriteText, r as resolveInsideRoot, t as assertSafePathSegment } from "./pathSecurity-CirkQwWP.js";
4
4
  import { t as assertRemoteUrlAllowed } from "./urlSafety-CiSuCJvX.js";
5
5
  import { c as findUnpairedToolCalls, d as partsToText, f as promptText, l as interruptedToolResult, p as textParts, u as sealToolCallPairs } from "./llm-eIQNO9tr.js";
6
- import { a as UNSUPPORTED_DOCUMENT_MESSAGE, c as toBase64, f as SPREADSHEET_MIME_TYPE, g as DEFAULT_MAX_DOCUMENT_TEXT_BYTES, h as DEFAULT_MAX_DOCUMENT_BYTES, i as SUPPORTED_DOCUMENT_MIME, l as encodeSpreadsheet, n as READ_LINKED_DOCUMENT_TOOL, o as fromBase64, r as READ_LINKED_DOCUMENT_TOOL_NAME, s as isBytesOnlyDocument, v as TEXT_BUDGETED_CONTENT_TYPES } from "./linkedDocument-CZZOl9cO.js";
6
+ import { a as UNSUPPORTED_DOCUMENT_MESSAGE, c as toBase64, f as SPREADSHEET_MIME_TYPE, g as DEFAULT_MAX_DOCUMENT_TEXT_BYTES, h as DEFAULT_MAX_DOCUMENT_BYTES, i as SUPPORTED_DOCUMENT_MIME, l as encodeSpreadsheet, n as READ_LINKED_DOCUMENT_TOOL, o as fromBase64, r as READ_LINKED_DOCUMENT_TOOL_NAME, s as isBytesOnlyDocument, v as TEXT_BUDGETED_CONTENT_TYPES } from "./linkedDocument-0iiVPd5t.js";
7
7
  import { t as mergeCatalogEntries } from "./external-_ZRQe-V9.js";
8
8
  import { i as isArtifactCardHidden, n as extractChartSpec, r as admitArtifactMetadata, t as buildRenderResult } from "./renderResult-D9Q-Vu2x.js";
9
9
  import { t as extractUiSpecEvents } from "./surface-DVGiCmwq.js";
@@ -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
- 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-DRkI7M3z.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-Bb9kBiF0.js";
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-QKiMepxO.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;