@webskill/sdk 0.22.0 → 0.24.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 (32) hide show
  1. package/dist/agent.d.ts +3 -3
  2. package/dist/agent.js +200 -54
  3. package/dist/{approval-DWQlDPbY.js → approval-7CuZS3Z4.js} +3 -3
  4. package/dist/browser.d.ts +52 -7
  5. package/dist/browser.js +615 -59
  6. package/dist/{geometry-wx5ZTYzi.js → geometry-CRhuySKV.js} +8 -1
  7. package/dist/governance.d.ts +22 -4
  8. package/dist/governance.js +112 -12
  9. package/dist/{index-CjwdZQOS.d.ts → index-B3rMAUWB.d.ts} +138 -19
  10. package/dist/{index-YPd8ZSEa.d.ts → index-Bq299VnF.d.ts} +6 -3
  11. package/dist/{index-BiO9_XRk.d.ts → index-mKgZU7cG.d.ts} +62 -5
  12. package/dist/index.d.ts +4 -4
  13. package/dist/index.js +10 -8
  14. package/dist/{linkedDocument-CIuh_Yp0.js → linkedDocument-CZZOl9cO.js} +44 -4
  15. package/dist/mcp.d.ts +2 -2
  16. package/dist/node.d.ts +3 -3
  17. package/dist/node.js +12 -5
  18. package/dist/{openUiLibrary-B7j3rLrm.js → openUiLibrary-CxtrnX54.js} +1 -1
  19. package/dist/{openUiSpecLang-BSYYnjay.js → openUiSpecLang-DIcLcybq.js} +148 -13
  20. package/dist/{pathSecurity-B1owvJAF.js → pathSecurity-CirkQwWP.js} +12 -1
  21. package/dist/{skill-CAJMsLod.js → skill-WSUDp6A1.js} +1 -1
  22. package/dist/{skillVersionStore-B24Jjjry-BY1H7Krp.d.ts → skillVersionStore-S4_HJ_Fl-Ds97pwm5.d.ts} +35 -4
  23. package/dist/testing.d.ts +1 -1
  24. package/dist/{types-CpDRZ0rA-BM5FI9oN.d.ts → types-CpDRZ0rA-CFQ-vdKz.d.ts} +12 -1
  25. package/dist/ui-react.d.ts +11 -4
  26. package/dist/ui-react.js +76 -25
  27. package/dist/ui-vue.d.ts +1 -1
  28. package/dist/ui.d.ts +4 -4
  29. package/dist/ui.js +6 -6
  30. package/dist/{webSkillApi-Dy-Zjv0y.js → webSkillApi-D5VMUnrv.js} +2 -2
  31. package/dist/{webskillLitCatalog-D5BCiMCU.js → webskillLitCatalog-BPyjYuRT.js} +1 -1
  32. package/package.json +1 -1
package/dist/agent.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { D as DEFAULT_MAX_DATA_SOURCE_BYTES } from "./index-YPd8ZSEa.js";
2
- import { $ as DownloadedFileEntry, $n as SkillGenerationToolSourceOptions, $r as createPageImageToolSource, $t as PERCEPTION_PAGING_DEFAULTS, A as DataSourceRecord, An as PerceptionAuditSink, Ar as TodoListener, At as FILL_TEMPLATE_TOOL, B as DocumentFileSource, Bn as READ_DOCUMENT_TOOL, Br as XlsxTemplateEngine, Bt as LIST_PAGE_TABS_TOOL, C as DataSourceCandidateRecord, Ci as toActionFrameScopes, Cn as ParentBudget, Cr as TemplateParagraphSkeleton, Ct as DwgView, D as DataSourcePolicy, Dn as PdfTextQuality, Dr as TodoEvent, Dt as EMU_PER_TWIP, E as DataSourceKind, En as PdfPageImage, Er as TemplateToolSourceOptions, Et as EMU_PER_POINT, F as DelegationRequest, Fn as PerceptionScope, Fr as WorksetTab, Ft as GeneratedSkillDraft, G as DocumentToolSourceOptions, Gn as RemoteImageToolSourceOptions, Gr as clampWorksetMax, Gt as OpenedTabSignal, H as DocumentImageRole, Hn as RemoteImageFetch, Hr as XlsxTemplateSkeleton, Ht as MAX_DIGIT_WIDTH, I as DelegationResult, In as PerceptionScopeInput, Ir as WorksetTabView, It as HttpDataSourceOptions, J as DocxTemplateEngine, Jn as Size, Jr as createDocumentToolSource, Jt as PAGE_ACTION_TOOL, K as DocxDocumentContent, Kn as RenderedImage, Kr as columnWidthToPixels, Kt as PAGE_ACTION_KINDS, L as DelegationToolSourceOptions, Ln as PptxDocumentContent, Lr as XlsxDocumentContent, Lt as INSPECT_TEMPLATE_TOOL, M as DelegationBudget, Mn as PerceptionPagingBudget, Mr as TodoStore, Mt as FrameNote, N as DelegationOrchestrator, Nn as PerceptionRecord, Nr as TodoToolSourceOptions, Nt as FrameScope, O as DataSourcePolicyOptions, On as PerceivedImage, Or as TodoItem, Ot as EXPORT_SPREADSHEET_TOOL, P as DelegationOrchestratorOptions, Pn as PerceptionResult, Pr as VIEW_DWG_TOOL, Pt as GENERATE_SKILL_TOOL, Q as DownloadedFileConsent, Qn as SkillGenerationPolicy, Qr as createPageActionToolSource, Qt as PERCEIVE_PAGE_TOOL, R as DocumentBlock, Rn as PptxDocumentReader, Rr as XlsxDocumentReader, Rt as ImageCaptureBudget, S as DataSourceCandidatePolicyOptions, Si as takesImage, Sn as PagePerceptionToolSourceOptions, Sr as TemplateImageResolver, St as DwgUnits, T as DataSourceDef, Ti as withDelegationOrigin, Tn as PdfDocumentReader, Tr as TemplateTableCellSkeleton, Tt as EMU_PER_PIXEL, U as DocumentReadBudget, Un as RemoteImageFetchFailure, Ur as asReadMode, Ut as NestedFrameRef, V as DocumentFormat, Vn as READ_DOWNLOADED_FILE_TOOL, Vr as XlsxTemplateFillSpec, Vt as MANAGE_TODO_TOOL, W as DocumentReadMode, Wn as RemoteImageResult, Wr as clampDownloadWaitMs, Wt as OpenedPageInfo, X as DocxTemplateSkeleton, Xn as SkillGenerationMessages, Xr as createDwgToolSource, Xt as PDF_GARBLED_RATIO, Y as DocxTemplateFillSpec, Yn as SkillCandidateSink, Yr as createDownloadedFileToolSource, Yt as PAGE_DOCUMENT_REF, Z as DownloadedFileAction, Zn as SkillGenerationOutcome, Zr as createHttpDataSourceTransport, Zt as PDF_LARGE_IMAGE_RATIO, _ as DWG_MODEL_VIEW_ID, _i as parseCellAddress, _n as PageImageResult, _r as TabWorksetPort, _t as DwgOmission, a as ActionTabWindow, ai as createTemplateToolSource, an as PageActionPolicy, ar as SubAgentRunInput, at as DownloadedFileRecord, b as DataSourceCandidateAuditSink, bi as readImageSize, bn as PagePerceptionPolicyOptions, br as TemplateFileSource, bt as DwgProjection, c as CellAddress, ci as dwgPickView, cn as PageActionRequest, cr as TAB_WORKSET_DEFAULT_MAX, ct as DwgComponent, d as DELEGATE_TASK_TOOL, di as formatCellAddress, dn as PageActionTarget, dr as TAB_WORKSET_SYSTEM_PROMPT, dt as DwgEntity, ei as createPagePerceptionToolSource, en as PERCEPTION_SYSTEM_PROMPT, er as SkillGenerator, et as DownloadedFileListing, f as DELEGATION_SYSTEM_PROMPT, fi as frameLabel, fn as PageActionToolSourceOptions, fr as TEMPLATE_INSPECT_BUDGET, ft as DwgFill, g as DOWNLOAD_WAIT_MIN_MS, gi as measurePdfTextQuality, gn as PageImageFailure, gr as TabWorksetPolicyOptions, gt as DwgLoadedDrawing, h as DOWNLOAD_WAIT_MAX_MS, hi as isRangeTopLeft, hn as PageImageCapture, hr as TabWorksetPolicy, ht as DwgLayer, i as ActionTabWatcher, ii as createTabWorksetToolSource, in as PageActionOutcome, ir as SpreadsheetToolSourceOptions, it as DownloadedFileReader, j as DataSourceTransport, jn as PerceptionCaptureOptions, jr as TodoStatus, jt as FOCUS_PAGE_TAB_TOOL, k as DataSourceProvenance, kn as PerceivedNode, kr as TodoList, kt as FETCH_REMOTE_IMAGE_TOOL, l as CellRange, li as dwgViewsOf, ln as PageActionScope, lr as TAB_WORKSET_MAX_MAX, lt as DwgDocumentContent, m as DOWNLOAD_WAIT_DEFAULT_MS, mi as isPdfTextTrustworthy, mn as PageAuditSink, mr as TabAdmission, mt as DwgGeometry, n as ActionDownloadWindow, ni as createSkillGenerationToolSource, nn as PageActionExecutor, nr as SkillTraceEvidence, nt as DownloadedFilePolicyOptions, o as CAPTURE_PAGE_IMAGE_TOOL, oi as createTodoToolSource, on as PageActionPolicyOptions, or as SubAgentRunner, ot as DownloadedFileToolSourceOptions, p as DOCUMENT_READ_BUDGET, pi as frameSteps, pn as PageActionUi, pr as TODO_SYSTEM_PROMPT, pt as DwgFont, q as DocxDocumentReader, qn as SKILL_GENERATION_SYSTEM_PROMPT, qr as createDelegationToolSource, qt as PAGE_ACTION_SYSTEM_PROMPT, r as ActionFrameScope, ri as createSpreadsheetToolSource, rn as PageActionKind, rr as SkillTraceEvidenceStep, rt as DownloadedFileReadResult, s as CLOSE_PAGE_TAB_TOOL, si as defersImage, sn as PageActionRecord, sr as SubtreeRejection, st as DwgBounds, t as ActionDownloadWatcher, ti as createRemoteImageToolSource, tn as PageActionConsent, tr as SkillGeneratorOptions, tt as DownloadedFilePolicy, u as ConsentUi, ui as fitWithin, un as PageActionScopeInput, ur as TAB_WORKSET_MIN_MAX, ut as DwgDocumentReader, v as DataSourceAuditSink, vi as parseCellRange, vn as PageImageToolSourceOptions, vr as TabWorksetToolSourceOptions, vt as DwgPoint, w as DataSourceCandidateStore, wi as toFrameScopes, wn as PdfDocumentHandle, wr as TemplateSheetSkeleton, wt as DwgViewport, x as DataSourceCandidatePolicy, xi as sniffDocumentFormat, xn as PagePerceptionReader, xr as TemplateImageBytes, xt as DwgToolSourceOptions, y as DataSourceCandidate, yi as rangeContains, yn as PagePerceptionPolicy, yr as TemplateCellSkeleton, yt as DwgProjectedDrawing, z as DocumentFileBytes, zn as PptxSlideContent, zr as XlsxSheetContent, zt as LIST_DOWNLOADED_FILES_TOOL } from "./index-CjwdZQOS.js";
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, READ_DOCUMENT_TOOL, READ_DOWNLOADED_FILE_TOOL, type RemoteImageFetch, type RemoteImageFetchFailure, type RemoteImageResult, type RemoteImageToolSourceOptions, type RenderedImage, SKILL_GENERATION_SYSTEM_PROMPT, type Size, 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 TemplateCellSkeleton, type TemplateFileSource, type TemplateImageBytes, type TemplateImageResolver, type TemplateParagraphSkeleton, 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 XlsxSheetContent, type XlsxTemplateEngine, type XlsxTemplateFillSpec, type XlsxTemplateSkeleton, asReadMode, clampDownloadWaitMs, clampWorksetMax, columnWidthToPixels, createDelegationToolSource, createDocumentToolSource, createDownloadedFileToolSource, createDwgToolSource, createHttpDataSourceTransport, createPageActionToolSource, createPageImageToolSource, createPagePerceptionToolSource, createRemoteImageToolSource, createSkillGenerationToolSource, createSpreadsheetToolSource, createTabWorksetToolSource, createTemplateToolSource, createTodoToolSource, defersImage, dwgPickView, dwgViewsOf, fitWithin, formatCellAddress, frameLabel, frameSteps, isPdfTextTrustworthy, isRangeTopLeft, measurePdfTextQuality, parseCellAddress, parseCellRange, rangeContains, readImageSize, sniffDocumentFormat, takesImage, toActionFrameScopes, toFrameScopes, withDelegationOrigin };
1
+ import { D as DEFAULT_MAX_DATA_SOURCE_BYTES } from "./index-Bq299VnF.js";
2
+ import { $ as DownloadedFileEntry, $n as SkillCandidateSink, $r as clampWorksetMax, $t as PERCEPTION_PAGING_DEFAULTS, A as DataSourceRecord, Ai as takesImage, An as PerceptionAuditSink, Ar as TemplateSheetBlanks, At as FILL_TEMPLATE_TOOL, B as DocumentFileSource, Bn as READ_DOCUMENT_TOOL, Br as TodoToolSourceOptions, Bt as LIST_PAGE_TABS_TOOL, C as DataSourceCandidateRecord, Ci as isRangeTopLeft, Cn as ParentBudget, Cr as TemplateCellSkeleton, Ct as DwgView, D as DataSourcePolicy, Di as rangeContains, Dn as PdfTextQuality, Dr as TemplateImageBytes, Dt as EMU_PER_TWIP, E as DataSourceKind, Ei as parseCellRange, En as PdfPageImage, Er as TemplateFillWarning, Et as EMU_PER_POINT, F as DelegationRequest, Fn as PerceptionScope, Fr as TodoItem, Ft as GeneratedSkillDraft, G as DocumentToolSourceOptions, Gn as RemoteImageToolSourceOptions, Gr as XlsxDocumentReader, Gt as OpenedTabSignal, H as DocumentImageRole, Hn as RemoteImageFetch, Hr as WorksetTab, Ht as MAX_DIGIT_WIDTH, I as DelegationResult, In as PerceptionScopeInput, Ir as TodoList, It as HttpDataSourceOptions, J as DocxTemplateEngine, Jn as SKILL_GENERATION_SYSTEM_PROMPT, Jr as XlsxTemplateEngine, Jt as PAGE_ACTION_TOOL, K as DocxDocumentContent, Kn as RenderedImage, Kr as XlsxFillOutcome, Kt as PAGE_ACTION_KINDS, L as DelegationToolSourceOptions, Ln as PptxDocumentContent, Lr as TodoListener, Lt as INSPECT_TEMPLATE_TOOL, M as DelegationBudget, Mi as toFrameScopes, Mn as PerceptionPagingBudget, Mr as TemplateTableCellSkeleton, Mt as FrameNote, N as DelegationOrchestrator, Ni as withDelegationOrigin, Nn as PerceptionRecord, Nr as TemplateToolSourceOptions, Nt as FrameScope, O as DataSourcePolicyOptions, Oi as readImageSize, On as PerceivedImage, Or as TemplateImageResolver, Ot as EXPORT_SPREADSHEET_TOOL, P as DelegationOrchestratorOptions, Pn as PerceptionResult, Pr as TodoEvent, Pt as GENERATE_SKILL_TOOL, Q as DownloadedFileConsent, Qn as SkillBinaryPayload, Qr as clampDownloadWaitMs, Qt as PERCEIVE_PAGE_TOOL, R as DocumentBlock, Rn as PptxDocumentReader, Rr as TodoStatus, Rt as ImageCaptureBudget, S as DataSourceCandidatePolicyOptions, Si as isPdfTextTrustworthy, Sn as PagePerceptionToolSourceOptions, Sr as TabWorksetToolSourceOptions, St as DwgUnits, T as DataSourceDef, Ti as parseCellAddress, Tn as PdfDocumentReader, Tr as TemplateFillRejection, Tt as EMU_PER_PIXEL, U as DocumentReadBudget, Un as RemoteImageFetchFailure, Ur as WorksetTabView, Ut as NestedFrameRef, V as DocumentFormat, Vn as READ_DOWNLOADED_FILE_TOOL, Vr as VIEW_DWG_TOOL, Vt as MANAGE_TODO_TOOL, W as DocumentReadMode, Wn as RemoteImageResult, Wr as XlsxDocumentContent, Wt as OpenedPageInfo, X as DocxTemplateSkeleton, Xn as Size, Xr as XlsxTemplateSkeleton, Xt as PDF_GARBLED_RATIO, Y as DocxTemplateFillSpec, Yn as ScrollDirection, Yr as XlsxTemplateFillSpec, Yt as PAGE_DOCUMENT_REF, Z as DownloadedFileAction, Zn as SkillAttachmentBytes, Zr as asReadMode, Zt as PDF_LARGE_IMAGE_RATIO, _ as DWG_MODEL_VIEW_ID, _i as dwgViewsOf, _n as PageImageResult, _r as TODO_SYSTEM_PROMPT, _t as DwgOmission, a as ActionTabWindow, ai as createHttpDataSourceTransport, an as PageActionPolicy, ar as SkillGeneratorOptions, at as DownloadedFileRecord, b as DataSourceCandidateAuditSink, bi as frameLabel, bn as PagePerceptionPolicyOptions, br as TabWorksetPolicyOptions, bt as DwgProjection, c as CellAddress, ci as createPagePerceptionToolSource, cn as PageActionRequest, cr as SpreadsheetToolSourceOptions, ct as DwgComponent, d as DELEGATE_TASK_TOOL, di as createSpreadsheetToolSource, dn as PageActionTarget, dr as SubtreeRejection, dt as DwgEntity, ei as columnWidthToPixels, en as PERCEPTION_SYSTEM_PROMPT, er as SkillGenerationMessages, et as DownloadedFileListing, f as DELEGATION_SYSTEM_PROMPT, fi as createTabWorksetToolSource, fn as PageActionToolSourceOptions, fr as TAB_WORKSET_DEFAULT_MAX, ft as DwgFill, g as DOWNLOAD_WAIT_MIN_MS, gi as dwgPickView, gn as PageImageFailure, gr as TEMPLATE_INSPECT_BUDGET, gt as DwgLoadedDrawing, h as DOWNLOAD_WAIT_MAX_MS, hi as defersImage, hn as PageImageCapture, hr as TAB_WORKSET_SYSTEM_PROMPT, ht as DwgLayer, i as ActionTabWatcher, ii as createDwgToolSource, in as PageActionOutcome, ir as SkillGenerator, it as DownloadedFileReader, j as DataSourceTransport, ji as toActionFrameScopes, jn as PerceptionCaptureOptions, jr as TemplateSheetSkeleton, jt as FOCUS_PAGE_TAB_TOOL, k as DataSourceProvenance, ki as sniffDocumentFormat, kn as PerceivedNode, kr as TemplateParagraphSkeleton, kt as FETCH_REMOTE_IMAGE_TOOL, l as CellRange, li as createRemoteImageToolSource, ln as PageActionScope, lr as SubAgentRunInput, lt as DwgDocumentContent, m as DOWNLOAD_WAIT_DEFAULT_MS, mi as createTodoToolSource, mn as PageAuditSink, mr as TAB_WORKSET_MIN_MAX, mt as DwgGeometry, n as ActionDownloadWindow, ni as createDocumentToolSource, nn as PageActionExecutor, nr as SkillGenerationPolicy, nt as DownloadedFilePolicyOptions, o as CAPTURE_PAGE_IMAGE_TOOL, oi as createPageActionToolSource, on as PageActionPolicyOptions, or as SkillTraceEvidence, ot as DownloadedFileToolSourceOptions, p as DOCUMENT_READ_BUDGET, pi as createTemplateToolSource, pn as PageActionUi, pr as TAB_WORKSET_MAX_MAX, pt as DwgFont, q as DocxDocumentReader, qn as SCROLL_DIRECTIONS, qr as XlsxSheetContent, qt as PAGE_ACTION_SYSTEM_PROMPT, r as ActionFrameScope, ri as createDownloadedFileToolSource, rn as PageActionKind, rr as SkillGenerationToolSourceOptions, rt as DownloadedFileReadResult, s as CLOSE_PAGE_TAB_TOOL, si as createPageImageToolSource, sn as PageActionRecord, sr as SkillTraceEvidenceStep, st as DwgBounds, t as ActionDownloadWatcher, ti as createDelegationToolSource, tn as PageActionConsent, tr as SkillGenerationOutcome, tt as DownloadedFilePolicy, u as ConsentUi, ui as createSkillGenerationToolSource, un as PageActionScopeInput, ur as SubAgentRunner, ut as DwgDocumentReader, v as DataSourceAuditSink, vi as fitWithin, vn as PageImageToolSourceOptions, vr as TabAdmission, vt as DwgPoint, w as DataSourceCandidateStore, wi as measurePdfTextQuality, wn as PdfDocumentHandle, wr as TemplateFileSource, wt as DwgViewport, x as DataSourceCandidatePolicy, xi as frameSteps, xn as PagePerceptionReader, xr as TabWorksetPort, xt as DwgToolSourceOptions, y as DataSourceCandidate, yi as formatCellAddress, yn as PagePerceptionPolicy, yr as TabWorksetPolicy, yt as DwgProjectedDrawing, z as DocumentFileBytes, zn as PptxSlideContent, zr as TodoStore, zt as LIST_DOWNLOADED_FILES_TOOL } from "./index-B3rMAUWB.js";
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, 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 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 XlsxTemplateEngine, type XlsxTemplateFillSpec, type XlsxTemplateSkeleton, asReadMode, clampDownloadWaitMs, clampWorksetMax, columnWidthToPixels, createDelegationToolSource, createDocumentToolSource, createDownloadedFileToolSource, createDwgToolSource, createHttpDataSourceTransport, createPageActionToolSource, createPageImageToolSource, createPagePerceptionToolSource, createRemoteImageToolSource, createSkillGenerationToolSource, createSpreadsheetToolSource, createTabWorksetToolSource, createTemplateToolSource, createTodoToolSource, defersImage, dwgPickView, dwgViewsOf, fitWithin, formatCellAddress, frameLabel, frameSteps, isPdfTextTrustworthy, isRangeTopLeft, measurePdfTextQuality, parseCellAddress, parseCellRange, rangeContains, readImageSize, sniffDocumentFormat, takesImage, toActionFrameScopes, toFrameScopes, withDelegationOrigin };
package/dist/agent.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
2
- import { b as parseSkillMarkdown, y as isValidSkillName } from "./skill-CAJMsLod.js";
2
+ import { b as parseSkillMarkdown, y as isValidSkillName } from "./skill-WSUDp6A1.js";
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-CIuh_Yp0.js";
7
- import { C as DOCUMENT_READ_BUDGET, D as toFrameScopes, E as toActionFrameScopes, O as frameLabel, 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 frameSteps, 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-wx5ZTYzi.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";
8
8
 
9
9
  //#region ../agent/src/todo/store.ts
10
10
  const STATUSES = [
@@ -66,13 +66,18 @@ var TodoStore = class {
66
66
  /**
67
67
  * 更新单条。置为 `in-progress` 时其余进行中条目降级为 `pending`,
68
68
  * 每条降级各发一次 `todo.updated`,事件序列与状态变化一一对应。
69
+ *
70
+ * `options.concurrent` 由**编排器**在并发委派时传(0.23.0 分册 19 FR-19.9):
71
+ * 几个子 agent 真的在同时跑,把别人降级回 `pending` 是在界面上说谎。
72
+ * 模型经 `manage_todo` 的写入不传它,仍维持「同时只有一条进行中」——
73
+ * 那条约束针对的是模型乱标(名义并行、实则一件事),不是真并发。
69
74
  */
70
- update(id, patch) {
75
+ update(id, patch, options) {
71
76
  const target = this.#items.find((item) => item.id === id);
72
77
  if (!target) throw new WebSkillError("TODO_ITEM_NOT_FOUND", `Todo item "${id}" does not exist in the current list`);
73
78
  if (patch.status !== void 0 && !STATUSES.includes(patch.status)) throw new WebSkillError("TODO_LIST_INVALID", `Todo item "${id}" has an unknown status; expected one of ${STATUSES.join(", ")}`);
74
79
  const demoted = [];
75
- if (patch.status === "in-progress") for (const item of this.#items) {
80
+ if (patch.status === "in-progress" && options?.concurrent !== true) for (const item of this.#items) {
76
81
  if (item.id === id || item.status !== "in-progress") continue;
77
82
  item.status = "pending";
78
83
  demoted.push(item);
@@ -291,6 +296,9 @@ function ok(events, text) {
291
296
  //#endregion
292
297
  //#region ../agent/src/skillGeneration/generator.ts
293
298
  const DEFAULT_MAX_PER_SESSION = 3;
299
+ /** 缺省体积闸门(0.23.0 分册 20 FR-20.12):宿主可经 policy 覆盖 */
300
+ const DEFAULT_MAX_BINARY_BYTES = 10 * 1024 * 1024;
301
+ const DEFAULT_MAX_TOTAL_BINARY_BYTES = 25 * 1024 * 1024;
294
302
  const SCRIPT_EXTENSIONS = [".ts", ".js"];
295
303
  /** 缺省英文模板:与 0.9.0 之前硬编码的正文逐字一致 */
296
304
  function defaultConfirmSkill(draft) {
@@ -322,11 +330,66 @@ function validateDraft(draft) {
322
330
  }
323
331
  }
324
332
  /** 确认面板正文:完整 SKILL.md + 附带文件,供用户逐字检查(FR-9.4 风险缓解) */
325
- function previewOf(draft) {
333
+ function previewOf(draft, binaries) {
326
334
  const sections = [`SKILL.md\n${"─".repeat(32)}\n${draft.content}`];
327
- for (const file of draft.files ?? []) sections.push(`${file.path}\n${"─".repeat(32)}\n${file.content}`);
335
+ for (const file of draft.files ?? []) {
336
+ const binary = binaries.get(file.path);
337
+ const body = binary === void 0 ? file.content : `[binary ${binary.size} bytes from "${binary.sourceName}"]\nsha256: ${binary.sha256}`;
338
+ sections.push(`${file.path}\n${"─".repeat(32)}\n${body}`);
339
+ }
328
340
  return sections.join("\n\n");
329
341
  }
342
+ /** 环境无关 sha256(WebCrypto;Node ≥17 与浏览器均有 globalThis.crypto.subtle) */
343
+ async function sha256Hex(bytes) {
344
+ const copy = new ArrayBuffer(bytes.byteLength);
345
+ new Uint8Array(copy).set(bytes);
346
+ const digest = await globalThis.crypto.subtle.digest("SHA-256", copy);
347
+ return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, "0")).join("");
348
+ }
349
+ /**
350
+ * 把模型指认的附件变成字节(0.23.0 分册 20 §2.4)。
351
+ *
352
+ * 排在用户确认**之前**:「那个附件取不到」「超出上限」这类失败与用户当时正在做的事
353
+ * 直接相关,拖到提交时才报,用户已经点完同意、等完一轮审核了。
354
+ * 上限也在这里判——**拒绝必须发生在写盘之前**,先复制再检查会把超限的字节先落一遍磁盘。
355
+ */
356
+ async function materializeBinaries(draft, options) {
357
+ const claimed = (draft.files ?? []).filter((file) => file.attachmentId !== void 0);
358
+ const out = /* @__PURE__ */ new Map();
359
+ if (claimed.length === 0) return out;
360
+ const resolve = options.resolveAttachment;
361
+ if (resolve === void 0) fail("This host cannot put uploaded files into a skill. Remove \"attachmentId\" from the file entries and write their contents instead.");
362
+ const maxOne = options.policy?.maxBinaryBytes ?? DEFAULT_MAX_BINARY_BYTES;
363
+ const maxTotal = options.policy?.maxTotalBinaryBytes ?? DEFAULT_MAX_TOTAL_BINARY_BYTES;
364
+ let total = 0;
365
+ for (const file of claimed) {
366
+ const id = file.attachmentId;
367
+ const attachment = await resolve(id);
368
+ if (attachment === void 0) fail(`No file with attachment id "${id}" was uploaded in this conversation, so "${file.path}" cannot be added to the skill.`, {
369
+ attachmentId: id,
370
+ path: file.path
371
+ });
372
+ const size = attachment.bytes.byteLength;
373
+ if (size > maxOne) fail(`The attached file "${attachment.name}" is ${size} bytes, above the ${maxOne} byte limit for one file.`, {
374
+ path: file.path,
375
+ size,
376
+ limit: maxOne
377
+ });
378
+ total += size;
379
+ if (total > maxTotal) fail(`The attached files add up to ${total} bytes, above the ${maxTotal} byte limit for one skill.`, {
380
+ path: file.path,
381
+ total,
382
+ limit: maxTotal
383
+ });
384
+ out.set(file.path, {
385
+ bytes: attachment.bytes,
386
+ size,
387
+ sha256: await sha256Hex(attachment.bytes),
388
+ sourceName: attachment.name
389
+ });
390
+ }
391
+ return out;
392
+ }
330
393
  /**
331
394
  * 工具名硬校(FR-30.4 / AC-30.8)。
332
395
  *
@@ -422,6 +485,7 @@ var SkillGenerator = class {
422
485
  assertStepsAreNotTruncated(draft, trace.records);
423
486
  }
424
487
  this.#used += 1;
488
+ const binaries = await materializeBinaries(draft, this.#options);
425
489
  const evidence = trace.available ? buildTraceEvidence(draft, trace.records) : void 0;
426
490
  this.#requestSeq += 1;
427
491
  const response = await this.#options.ui.request({
@@ -430,7 +494,7 @@ var SkillGenerator = class {
430
494
  capability: "confirm",
431
495
  message: this.#options.messages?.confirmSkill?.(draft) ?? defaultConfirmSkill(draft),
432
496
  details: {
433
- preview: previewOf(draft),
497
+ preview: previewOf(draft, binaries),
434
498
  ...evidence !== void 0 ? { traceEvidence: evidence } : {}
435
499
  }
436
500
  });
@@ -439,7 +503,8 @@ var SkillGenerator = class {
439
503
  const { id } = await sink.submit({
440
504
  draft,
441
505
  confirmedAt,
442
- ...sessionId !== void 0 ? { sessionId } : {}
506
+ ...sessionId !== void 0 ? { sessionId } : {},
507
+ ...binaries.size > 0 ? { binaries } : {}
443
508
  });
444
509
  return {
445
510
  status: "submitted",
@@ -491,6 +556,10 @@ const SKILL_GENERATION_SYSTEM_PROMPT = [
491
556
  "- `content` must be a complete SKILL.md: YAML frontmatter with `name` and `description`,",
492
557
  " then the instructions as Markdown. The frontmatter `name` must equal the `name` argument.",
493
558
  "- Put helper scripts under `scripts/` and use the `.ts` or `.js` extension.",
559
+ "- A file shipped with the skill (a template spreadsheet, a reference document) is addressed",
560
+ " from inside SKILL.md as `skill:<the skill name>/<the path you gave it>`, for example",
561
+ " `skill:monthly-report/assets/template.xlsx`. Write that, never the attachment id of this",
562
+ " conversation — that id is gone by the time anyone uses the skill.",
494
563
  "- Never copy credentials, tokens or personal data into the skill.",
495
564
  "- The user has to confirm every candidate, and the candidate stays unusable until a reviewer",
496
565
  " approves it. Say so instead of promising the skill is ready."
@@ -517,17 +586,24 @@ const INPUT_SCHEMA$5 = {
517
586
  },
518
587
  files: {
519
588
  type: "array",
520
- description: "Optional helper scripts or reference files shipped with the skill",
589
+ description: "Optional helper scripts or reference files shipped with the skill. To ship a file the user uploaded in this conversation (a spreadsheet or document used as a template), give its attachment id instead of \"content\" — the skill then carries the real file and the user never has to upload it again. Do not retype an uploaded file's contents: you only ever saw text extracted from it, so what you write would not be the same file.",
521
590
  items: {
522
591
  type: "object",
523
592
  properties: {
524
593
  path: {
525
594
  type: "string",
526
- description: "Relative path, e.g. \"scripts/check.ts\""
595
+ description: "Relative path, e.g. \"scripts/check.ts\" or \"references/template.xlsx\""
596
+ },
597
+ content: {
598
+ type: "string",
599
+ description: "The file contents. Omit when \"attachmentId\" is given."
527
600
  },
528
- content: { type: "string" }
601
+ attachmentId: {
602
+ type: "string",
603
+ description: "Id of a file uploaded in this conversation. Its bytes are copied into the skill as-is. Omit when \"content\" is given. This id exists only in this conversation, so SKILL.md must address the shipped file as \"skill:<the skill name>/<its path in this list>\" instead."
604
+ }
529
605
  },
530
- required: ["path", "content"],
606
+ required: ["path"],
531
607
  additionalProperties: false
532
608
  }
533
609
  },
@@ -585,10 +661,22 @@ function readDraft(args) {
585
661
  for (const entry of rawFiles) {
586
662
  if (typeof entry !== "object" || entry === null) return "Every entry in \"files\" must be an object";
587
663
  const record = entry;
588
- if (typeof record["path"] !== "string" || typeof record["content"] !== "string") return "Every attached file needs string \"path\" and \"content\"";
664
+ if (typeof record["path"] !== "string") return "Every attached file needs a string \"path\"";
665
+ const attachmentId = record["attachmentId"];
666
+ if (attachmentId !== void 0 && (typeof attachmentId !== "string" || attachmentId.trim() === "")) return "An attached file's \"attachmentId\" must be a non-empty string";
667
+ if (attachmentId === void 0) {
668
+ if (typeof record["content"] !== "string") return "Every attached file needs string \"content\", or an \"attachmentId\" pointing at an uploaded file";
669
+ files.push({
670
+ path: record["path"],
671
+ content: record["content"]
672
+ });
673
+ continue;
674
+ }
675
+ if (typeof record["content"] === "string" && record["content"] !== "") return "An attached file takes either \"content\" or \"attachmentId\", not both";
589
676
  files.push({
590
677
  path: record["path"],
591
- content: record["content"]
678
+ content: "",
679
+ attachmentId
592
680
  });
593
681
  }
594
682
  return {
@@ -670,13 +758,12 @@ function createSkillGenerationToolSource(options) {
670
758
 
671
759
  //#endregion
672
760
  //#region ../agent/src/delegation/orchestrator.ts
673
- const DEFAULT_MAX_TURNS = 8;
674
761
  /**
675
- * 串行委派编排器(设计 03 §13–§16)。
762
+ * 委派编排器(设计 03 §13–§16,并发改造见 0.23.0 分册 19)。
676
763
  *
677
- * 严格串行由**内部互斥**保证而不是调用方自觉:并发委派会产生并发待决交互,
678
- * 而当前交互模型是单一待决 nonce,届时表现为「点了没反应」。
679
- * 放开并发必须显式改这里的守卫,不会悄悄发生。
764
+ * 并发放开的前提是**并行的是执行、不是提问**:待决交互仍然一次只呈现一张,
765
+ * `ReactBridgeState` / `specInteractionChannel` 的队列保证。
766
+ * 若要在别处复用本编排器,那两处的排队语义是它的前置条件。
680
767
  *
681
768
  * 上下文隔离靠回值形状达成:只有 `summary` 回到父 agent,
682
769
  * 子 agent 的消息历史根本不经过本对象。
@@ -684,34 +771,62 @@ const DEFAULT_MAX_TURNS = 8;
684
771
  */
685
772
  var DelegationOrchestrator = class {
686
773
  #options;
687
- #running;
774
+ /** 正在跑的子 run:id → 任务描述 */
775
+ #running = /* @__PURE__ */ new Map();
776
+ /** 等名额的委派,先进先出 */
777
+ #waiting = [];
778
+ /**
779
+ * 此刻在跑的子 run 已领走的轮数之和(FR-19.7)。
780
+ * 父级的 `remainingTurns` 不会因子 run 而减少(子 run 跑在独立 runtime 上),
781
+ * 不自己记账的话两个并发委派会各自读到同一个剩余值,把同一份额度花两遍。
782
+ */
783
+ #claimedTurns = 0;
784
+ #seq = 0;
688
785
  constructor(options) {
689
786
  this.#options = options;
690
787
  }
691
- /** 当前正在执行的委派任务;无则 undefined */
788
+ /** 正在执行的委派任务之一;全部空闲则 undefined。仅供诊断 */
692
789
  get running() {
693
- return this.#running;
790
+ for (const request of this.#running.values()) return request.task;
791
+ }
792
+ #limit() {
793
+ const raw = this.#options.concurrencyLimit?.() ?? 1;
794
+ return Number.isFinite(raw) && raw >= 1 ? Math.floor(raw) : 1;
795
+ }
796
+ /** 让出一个名额并唤醒队首。必须在 finally 里调用,否则一次异常会把名额永久吞掉 */
797
+ #release(id, claimed) {
798
+ this.#running.delete(id);
799
+ this.#claimedTurns = Math.max(0, this.#claimedTurns - claimed);
800
+ this.#waiting.shift()?.();
694
801
  }
695
802
  async delegate(request) {
696
803
  const runner = this.#options.runner;
697
804
  if (!runner) throw new WebSkillError("DELEGATION_UNAVAILABLE", "Delegation is enabled but this host did not provide a sub-agent runner");
698
- if (this.#running !== void 0) throw new WebSkillError("DELEGATION_IN_PROGRESS", `Only one sub-agent may run at a time; "${this.#running}" has not finished yet`);
699
805
  if (request.task.trim() === "") throw new WebSkillError("DELEGATION_UNAVAILABLE", "A delegated task must not be empty");
806
+ while (this.#running.size >= this.#limit()) await new Promise((resolve) => this.#waiting.push(resolve));
807
+ const id = `d${this.#seq += 1}`;
700
808
  const parent = this.#options.parentBudget();
809
+ const availableTurns = Math.max(0, parent.remainingTurns - this.#claimedTurns);
810
+ const idleSlots = Math.max(1, this.#limit() - this.#running.size);
811
+ const share = Math.floor(availableTurns / idleSlots);
701
812
  const budget = {
702
- maxTurns: Math.min(this.#options.policy?.maxTurns ?? DEFAULT_MAX_TURNS, parent.remainingTurns),
813
+ maxTurns: Math.min(this.#options.policy?.maxTurns ?? Number.POSITIVE_INFINITY, share),
703
814
  timeoutMs: Math.min(this.#options.policy?.timeoutMs ?? Number.POSITIVE_INFINITY, parent.remainingTimeoutMs)
704
815
  };
705
- if (budget.maxTurns < 1 || budget.timeoutMs <= 0) return {
706
- todoId: request.todoId,
707
- outcome: "failed",
708
- summary: `The parent run has no budget left to delegate "${request.task}" (${parent.remainingTurns} turns and ${parent.remainingTimeoutMs} ms remaining).`
709
- };
710
- this.#running = request.task;
816
+ if (budget.maxTurns < 1 || budget.timeoutMs <= 0) {
817
+ this.#waiting.shift()?.();
818
+ return {
819
+ todoId: request.todoId,
820
+ outcome: "failed",
821
+ summary: `The parent run has no budget left to delegate "${request.task}" (${availableTurns} turns and ${parent.remainingTimeoutMs} ms remaining).`
822
+ };
823
+ }
824
+ this.#running.set(id, request);
825
+ this.#claimedTurns += budget.maxTurns;
711
826
  this.#options.todos?.update(request.todoId, {
712
827
  status: "in-progress",
713
828
  delegatedTo: request.task
714
- });
829
+ }, { concurrent: true });
715
830
  const controller = new AbortController();
716
831
  let timedOut = false;
717
832
  const timer = setTimeout(() => {
@@ -744,7 +859,7 @@ var DelegationOrchestrator = class {
744
859
  };
745
860
  } finally {
746
861
  clearTimeout(timer);
747
- this.#running = void 0;
862
+ this.#release(id, budget.maxTurns);
748
863
  }
749
864
  }
750
865
  };
@@ -752,24 +867,26 @@ var DelegationOrchestrator = class {
752
867
  //#endregion
753
868
  //#region ../agent/src/prompts/delegation.ts
754
869
  /**
755
- * 串行委派的策略提示词(设计 03 §13)。
870
+ * 委派的策略提示词(设计 03 §13;并发改造见 0.23.0 分册 19)。
756
871
  *
757
- * 「一次只能有一个」是编排器的硬约束,这里写进提示词是为了让模型不去
758
- * 尝试并行委派——被拒绝的调用会浪费一轮,而不是产生并发。
872
+ * 并发数那两句是**建议**而非约束:真正拦住数量的是编排器的排队与宿主硬上限。
873
+ * 写在这里是为了让模型按任务真实需要给值,而不是一口气派出一大批。
759
874
  */
760
875
  const DELEGATION_SYSTEM_PROMPT = [
761
876
  "Delegating sub-tasks:",
762
877
  "- Delegate a task only when it is self-contained and its details do not need to stay in this conversation.",
763
- "- Delegate one task at a time and wait for the result. A second delegation while one is running is rejected.",
878
+ "- Several delegations may run at the same time. Only delegate work that is genuinely independent: sub-agents cannot see each other and cannot exchange results.",
879
+ "- Keep the number of parallel sub-agents small. Use \"suggestedConcurrency\" to state how many this task really needs; the user picks the final number and the host may cap it lower.",
764
880
  "- Every delegation must reference an existing task-list item via \"todoId\".",
765
881
  "- You receive only the sub-agent summary, never its intermediate steps. If you need details, ask for them in the task description.",
766
- "- If a delegation fails, decide yourself whether to retry with a narrower task or to continue without it."
882
+ "- If a delegation fails, decide yourself whether to retry with a narrower task or to continue without it.",
883
+ "- If the user declines delegation, do the work yourself in this conversation and do not delegate again."
767
884
  ].join("\n");
768
885
 
769
886
  //#endregion
770
887
  //#region ../agent/src/delegation/toolSource.ts
771
888
  const DELEGATE_TASK_TOOL = "delegate_task";
772
- const DELEGATE_TOOL_DESCRIPTION = "Hand one self-contained sub-task to a sub-agent and wait for its summary. One delegation at a time.";
889
+ const DELEGATE_TOOL_DESCRIPTION = "Hand one self-contained sub-task to a sub-agent and wait for its summary. Several delegations may run in parallel, up to a limit the user picks.";
773
890
  const INPUT_SCHEMA$4 = {
774
891
  type: "object",
775
892
  properties: {
@@ -785,6 +902,11 @@ const INPUT_SCHEMA$4 = {
785
902
  type: "array",
786
903
  description: "Optional subset of tool names the sub-agent may use; omit to inherit the current set",
787
904
  items: { type: "string" }
905
+ },
906
+ suggestedConcurrency: {
907
+ type: "integer",
908
+ minimum: 1,
909
+ description: "How many sub-agents this task genuinely needs to run at once. The user confirms the final number and the host may cap it lower; omit if one at a time is enough"
788
910
  }
789
911
  },
790
912
  required: ["todoId", "task"],
@@ -1867,6 +1989,7 @@ function clampDownloadWaitMs(ms) {
1867
1989
 
1868
1990
  //#endregion
1869
1991
  //#region ../agent/src/pageAction/policy.ts
1992
+ const scrollDirectionOf = (value) => SCROLL_DIRECTIONS.includes(value) ? value : "down";
1870
1993
  const declineReason = "Page action was declined by the user.";
1871
1994
  /** 目标记忆的上限;它在 `act()` 之后立刻就被读走,容量只为防无界增长 */
1872
1995
  const TARGET_MEMO_LIMIT = 200;
@@ -2001,7 +2124,7 @@ var PageActionPolicy = class {
2001
2124
  const where = target.frame === void 0 ? "on the page" : `in the embedded frame "${target.frame}"`;
2002
2125
  const scopeNote = target.elevated === true ? " This dialog is outside the usual allowlist; it was opened by this task." : "";
2003
2126
  const scopeLabel = rememberable ? this.#options.consent?.describeScope?.(target, request.action) : void 0;
2004
- const message = request.action === "back" ? `Allow the assistant to go back to the previous page${target.name === void 0 ? "" : ` on "${target.name}"`}?${scopeNote}` : request.action === "scroll" ? `Allow the assistant to scroll ${request.value === "up" ? "up" : "down"} the area around "${target.name ?? target.role}" ${where}?${scopeNote}` : `Allow the assistant to ${request.action} "${target.name ?? target.role}" ${where}?${scopeNote}`;
2127
+ const message = request.action === "back" ? `Allow the assistant to go back to the previous page${target.name === void 0 ? "" : ` on "${target.name}"`}?${scopeNote}` : request.action === "scroll" ? `Allow the assistant to scroll ${scrollDirectionOf(request.value)} the area around "${target.name ?? target.role}" ${where}?${scopeNote}` : `Allow the assistant to ${request.action} "${target.name ?? target.role}" ${where}?${scopeNote}`;
2005
2128
  const response = await this.#options.ui.request({
2006
2129
  type: "authorize",
2007
2130
  id: `page-action-${this.#seq}`,
@@ -2018,7 +2141,7 @@ var PageActionPolicy = class {
2018
2141
  ...rememberable ? { rememberable: true } : {},
2019
2142
  ...scopeLabel !== void 0 ? { rememberLabel: scopeLabel } : {},
2020
2143
  ...request.action === "fill" && request.value !== void 0 ? { value: target.secret === true ? "••••••" : request.value } : {},
2021
- ...request.action === "scroll" ? { direction: request.value === "up" ? "up" : "down" } : {}
2144
+ ...request.action === "scroll" ? { direction: scrollDirectionOf(request.value) } : {}
2022
2145
  }
2023
2146
  });
2024
2147
  if (response.cancelled === true || response.value === false) return false;
@@ -2049,7 +2172,7 @@ var PageActionPolicy = class {
2049
2172
  ok: outcome.ok,
2050
2173
  ...request.action === "fill" && request.value !== void 0 && !secret ? { value: request.value } : {},
2051
2174
  ...request.action === "scroll" && outcome.scrolled !== void 0 ? { scrolled: {
2052
- direction: request.value === "up" ? "up" : "down",
2175
+ direction: scrollDirectionOf(request.value),
2053
2176
  ...outcome.scrolled
2054
2177
  } } : {},
2055
2178
  ...outcome.reason !== void 0 ? { reason: outcome.reason } : {}
@@ -2093,6 +2216,8 @@ var PageActionPolicy = class {
2093
2216
  * 措辞刻意保守:提示词里的鼓励性表述会直接抬高模型尝试操作的频率,
2094
2217
  * 而每一次尝试都要打断用户去点确认。
2095
2218
  */
2219
+ /** 与 toolSource 的校验失败文案同源:模型看到的取值集合必须就是被校验的那个集合 */
2220
+ const DIRECTIONS = SCROLL_DIRECTIONS.map((d) => `"${d}"`).join(" / ");
2096
2221
  const PAGE_ACTION_SYSTEM_PROMPT = [
2097
2222
  "You can act on the current page, but only within the regions the host made actionable.",
2098
2223
  "Targets must come from the \"ref\" values in a fresh perceive_page result — you cannot construct them, and CSS selectors are rejected.",
@@ -2100,7 +2225,7 @@ const PAGE_ACTION_SYSTEM_PROMPT = [
2100
2225
  "A reference expires as soon as the page is perceived again; perceive first, then act.",
2101
2226
  "After an action, the result tells you where it led. \"openedTab\" means a new page opened — switch to it with focus_page_tab to read it. \"navigated\" means this page itself moved to a new address. \"elevatedModal\" means a dialog opened on this page. If none of the three appear, the page did not change.",
2102
2227
  "Use the \"back\" action to return to the previous page in this page's history. It takes no \"ref\" and no \"value\", and it only affects the page you are currently on. After going back, always perceive_page again: every reference from before the action is dead.",
2103
- "Use the \"scroll\" action only when the page itself says there is more than you can see (for example a list that says it has 20 rows but shows 13). Pass the \"ref\" of any element inside the region you want to scroll and a \"value\" of \"down\" or \"up\"; the region is found for you, so do not look for a reference to the scrollbar or the container. The result carries \"scrolled\": when \"atEnd\" is true there is nothing further in that direction — stop scrolling and answer with what you have. Perceive the page again after each scroll: rows that left the screen no longer exist and their references are dead.",
2228
+ "Use the \"scroll\" action only when the page itself says there is more than you can see (for example a list that says it has 20 rows but shows 13). Pass the \"ref\" of any element inside the region you want to scroll and a \"value\" of " + DIRECTIONS + "; the region is found for you, so do not look for a reference to the scrollbar or the container. Use \"left\" / \"right\" when a region is wider than it can show — a table whose columns run off the side, for example. The result carries \"scrolled\": when \"atEnd\" is true there is nothing further in that direction — stop scrolling and answer with what you have. Perceive the page again after each scroll: rows that left the screen no longer exist and their references are dead.",
2104
2229
  "Use the \"hover\" action when a menu, tooltip or icon only appears while the pointer rests on something — a dropdown that ignores clicks, or a table header whose filter icon is invisible until hovered. Pass the \"ref\" of the thing to hover over and no \"value\". Then perceive_page again: whatever appeared is new and has no reference until you read it. If the result says \"noop\": true, nothing on the page reacted, and hovering again will not help — some pages reveal those panels through a pure CSS effect that only a real pointer can trigger. Say so and offer another route instead of retrying.",
2105
2230
  "Use the \"drag\" action to drag one element onto another — reordering a list by its drag handle, for example. Pass the \"ref\" of what you are dragging and a \"value\" holding the ref of where it should land. Both must come from a perceive_page result, so perceive first and make sure the destination is actually on screen. You can only express a start and an end; there is no path, speed or pause in between."
2106
2231
  ].join("\n");
@@ -2127,7 +2252,7 @@ const INPUT_SCHEMA$2 = {
2127
2252
  },
2128
2253
  value: {
2129
2254
  type: "string",
2130
- description: "Text for \"fill\", the option name for \"select\", \"true\"/\"false\" for \"set\", \"down\"/\"up\" for \"scroll\", or the destination ref for \"drag\". Not used by \"hover\" or \"attach\"."
2255
+ description: "Text for \"fill\", the option name for \"select\", \"true\"/\"false\" for \"set\", one of \"down\"/\"up\"/\"left\"/\"right\" for \"scroll\", or the destination ref for \"drag\". Not used by \"hover\" or \"attach\". After a scroll, call perceive_page again: content that was outside the viewport may not have existed in the page at all until you scrolled to it."
2131
2256
  }
2132
2257
  },
2133
2258
  required: ["action"],
@@ -2218,7 +2343,7 @@ function createPageActionToolSource(options) {
2218
2343
  "select",
2219
2344
  "set"
2220
2345
  ].includes(action) && typeof value !== "string") return toolError$4("VALIDATION_FAILED", `act_on_page needs a "value" string when the action is "${action}".`);
2221
- if (action === "scroll" && value !== "down" && value !== "up") return toolError$4("VALIDATION_FAILED", "act_on_page with \"scroll\" needs a \"value\" of \"down\" or \"up\".");
2346
+ if (action === "scroll" && !SCROLL_DIRECTIONS.includes(value)) return toolError$4("VALIDATION_FAILED", `act_on_page with "scroll" needs a "value" of ${SCROLL_DIRECTIONS.map((d) => `"${d}"`).join(" / ")}.`);
2222
2347
  return await run({
2223
2348
  ref,
2224
2349
  action,
@@ -3153,8 +3278,13 @@ const TEMPLATE_INSPECT_BUDGET = {
3153
3278
  cells: 400,
3154
3279
  chars: 2e4
3155
3280
  };
3156
- 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. A cell reported with a \"formula\" is worked out by the template itself; fill the cells it reads instead. Call this before fill_template — you cannot guess a template's layout.";
3157
- 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.";
3281
+ /**
3282
+ * 待填区/只读区最多列几条。不导出、不并进 `TEMPLATE_INSPECT_BUDGET`——
3283
+ * 给那个 `as const` 常量加字段,会把一处纯内部的预算决定变成公开契约。
3284
+ */
3285
+ const BLANK_RANGE_LIMIT = 100;
3286
+ 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.";
3287
+ 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.";
3158
3288
  const TEMPLATE_ID = "The attachment id, or the id from list_downloaded_files.";
3159
3289
  function inspectSchema(idHint) {
3160
3290
  return {
@@ -3198,7 +3328,7 @@ function fillSchema(withImages, idHint) {
3198
3328
  },
3199
3329
  cells: {
3200
3330
  type: "array",
3201
- description: "Excel only. Each entry writes one cell. Never write to a cell that inspect_template reported with a \"formula\" — an amount or a total is the template's own calculation, and overwriting it produces a sheet that no longer adds up when anything changes.",
3331
+ description: "Excel only. Each entry writes one cell. Write every address listed in \"blankRanges\" that your data covers — those are the cells the template reserved. Never write to a cell that inspect_template reported with a \"formula\" — an amount or a total is the template's own calculation, and overwriting it produces a sheet that no longer adds up when anything changes.",
3202
3332
  items: {
3203
3333
  type: "object",
3204
3334
  properties: {
@@ -3324,7 +3454,7 @@ function fillSchema(withImages, idHint) {
3324
3454
  };
3325
3455
  }
3326
3456
  function systemPrompt(withImages) {
3327
- return "When the user gives you a form, a table or a report template and asks you to produce a filled-in copy, fill that template — do not build a new file from scratch and do not describe what to type where. Always call inspect_template first: the addresses and coordinates come from it, never from guesswork, and a wrong address is a wrong file. fill_template returns only a summary; the file is delivered to the user as a card, so do not read it back. The template is left untouched — everything it already contains is preserved, and you only name the places that change. When the template has too few detail rows for the data, insert rows instead of overwriting the rows below." + (withImages ? " A template that reserves space for a photo takes one: reference the picture as \"artifact:<name>\" or \"upload:<id or name>\" and give the cell it belongs in. Do not hand the picture over separately and ask the user to paste it." : "");
3457
+ return "When the user gives you a form, a table or a report template and asks you to produce a filled-in copy, fill that template — do not build a new file from scratch and do not describe what to type where. Always call inspect_template first: the addresses and coordinates come from it, never from guesswork, and a wrong address is a wrong file. fill_template returns only a summary; the file is delivered to the user as a card, so do not read it back. The template is left untouched — everything it already contains is preserved, and you only name the places that change. When the template has too few detail rows for the data, insert rows instead of overwriting the rows below. Read what fill_template gives back: anything in \"rejected\" was not written and needs a different address, and anything in \"stillBlank\" is a cell the template is still waiting for. Fill those in and call again before telling the user the file is ready." + (withImages ? " A template that reserves space for a photo takes one: reference the picture as \"artifact:<name>\" or \"upload:<id or name>\" and give the cell it belongs in. Do not hand the picture over separately and ask the user to paste it." : "");
3328
3458
  }
3329
3459
  function toolError(e) {
3330
3460
  return {
@@ -3418,6 +3548,9 @@ function createTemplateToolSource(options) {
3418
3548
  const cells = sheet.cells.slice(0, Math.max(left, 0));
3419
3549
  if (cells.length < sheet.cells.length) truncated = true;
3420
3550
  left -= cells.length;
3551
+ const blankRanges = (sheet.blanks ?? []).slice(0, BLANK_RANGE_LIMIT);
3552
+ const coveredRanges = (sheet.covered ?? []).slice(0, BLANK_RANGE_LIMIT);
3553
+ if (blankRanges.length < (sheet.blanks ?? []).length) truncated = true;
3421
3554
  return {
3422
3555
  name: sheet.name,
3423
3556
  range: sheet.range,
@@ -3427,6 +3560,9 @@ function createTemplateToolSource(options) {
3427
3560
  ...cell.formula === void 0 ? {} : { formula: cell.formula }
3428
3561
  })),
3429
3562
  ...sheet.merges.length > 0 ? { merges: [...sheet.merges] } : {},
3563
+ ...blankRanges.length > 0 ? { blankRanges } : {},
3564
+ ...coveredRanges.length > 0 ? { coveredRanges } : {},
3565
+ ...sheet.headerRows !== void 0 && sheet.headerRows.length > 0 ? { headerRows: [...sheet.headerRows] } : {},
3430
3566
  ...cells.length < sheet.cells.length ? { omittedCells: sheet.cells.length - cells.length } : {}
3431
3567
  };
3432
3568
  });
@@ -3483,14 +3619,24 @@ function createTemplateToolSource(options) {
3483
3619
  };
3484
3620
  }) } : {}
3485
3621
  };
3486
- const bytes = await xlsx.fill(template.bytes, spec);
3487
- const artifact = await writeArtifact(fileName, bytes, XLSX_MIME, context);
3622
+ const outcome = await xlsx.fill(template.bytes, spec);
3623
+ const artifact = await writeArtifact(fileName, outcome.bytes, XLSX_MIME, context);
3488
3624
  return json({
3489
3625
  path: artifact.path,
3490
3626
  size: artifact.size,
3491
- filledCount: spec.cells?.length ?? 0,
3627
+ filledCount: outcome.filled,
3492
3628
  insertedRows: (spec.rows ?? []).reduce((total, row) => total + row.count, 0),
3493
- ...images.length > 0 ? { imageCount: images.length } : {}
3629
+ ...images.length > 0 ? { imageCount: images.length } : {},
3630
+ ...outcome.rejected.length > 0 ? { rejected: outcome.rejected.map(({ sheet, address, reason }) => ({
3631
+ sheet,
3632
+ address,
3633
+ reason
3634
+ })) } : {},
3635
+ ...outcome.warnings.length > 0 ? { warnings: [...outcome.warnings] } : {},
3636
+ ...outcome.stillBlank.length > 0 ? { stillBlank: outcome.stillBlank.map(({ sheet, ranges }) => ({
3637
+ sheet,
3638
+ ranges: [...ranges]
3639
+ })) } : {}
3494
3640
  });
3495
3641
  }
3496
3642
  const spec = {
@@ -3945,4 +4091,4 @@ function createDwgToolSource(options) {
3945
4091
  }
3946
4092
 
3947
4093
  //#endregion
3948
- export { CAPTURE_PAGE_IMAGE_TOOL, CLOSE_PAGE_TAB_TOOL, 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, DataSourceCandidatePolicy, DataSourcePolicy, DelegationOrchestrator, DownloadedFilePolicy, EMU_PER_PIXEL, EMU_PER_POINT, EMU_PER_TWIP, EXPORT_SPREADSHEET_TOOL, FETCH_REMOTE_IMAGE_TOOL, FILL_TEMPLATE_TOOL, FOCUS_PAGE_TAB_TOOL, GENERATE_SKILL_TOOL, INSPECT_TEMPLATE_TOOL, LIST_DOWNLOADED_FILES_TOOL, LIST_PAGE_TABS_TOOL, MANAGE_TODO_TOOL, MAX_DIGIT_WIDTH, 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, PageActionPolicy, PagePerceptionPolicy, READ_DOCUMENT_TOOL, READ_DOWNLOADED_FILE_TOOL, SKILL_GENERATION_SYSTEM_PROMPT, SkillGenerator, TAB_WORKSET_DEFAULT_MAX, TAB_WORKSET_MAX_MAX, TAB_WORKSET_MIN_MAX, TAB_WORKSET_SYSTEM_PROMPT, TEMPLATE_INSPECT_BUDGET, TODO_SYSTEM_PROMPT, TabWorksetPolicy, TodoStore, VIEW_DWG_TOOL, asReadMode, clampDownloadWaitMs, clampWorksetMax, columnWidthToPixels, createDelegationToolSource, createDocumentToolSource, createDownloadedFileToolSource, createDwgToolSource, createHttpDataSourceTransport, createPageActionToolSource, createPageImageToolSource, createPagePerceptionToolSource, createRemoteImageToolSource, createSkillGenerationToolSource, createSpreadsheetToolSource, createTabWorksetToolSource, createTemplateToolSource, createTodoToolSource, defersImage, dwgPickView, dwgViewsOf, fitWithin, formatCellAddress, frameLabel, frameSteps, isPdfTextTrustworthy, isRangeTopLeft, measurePdfTextQuality, parseCellAddress, parseCellRange, rangeContains, readImageSize, sniffDocumentFormat, takesImage, toActionFrameScopes, toFrameScopes, withDelegationOrigin };
4094
+ export { CAPTURE_PAGE_IMAGE_TOOL, CLOSE_PAGE_TAB_TOOL, 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, DataSourceCandidatePolicy, DataSourcePolicy, DelegationOrchestrator, DownloadedFilePolicy, EMU_PER_PIXEL, EMU_PER_POINT, EMU_PER_TWIP, EXPORT_SPREADSHEET_TOOL, FETCH_REMOTE_IMAGE_TOOL, FILL_TEMPLATE_TOOL, FOCUS_PAGE_TAB_TOOL, GENERATE_SKILL_TOOL, INSPECT_TEMPLATE_TOOL, LIST_DOWNLOADED_FILES_TOOL, LIST_PAGE_TABS_TOOL, MANAGE_TODO_TOOL, MAX_DIGIT_WIDTH, 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, PageActionPolicy, PagePerceptionPolicy, READ_DOCUMENT_TOOL, READ_DOWNLOADED_FILE_TOOL, SCROLL_DIRECTIONS, SKILL_GENERATION_SYSTEM_PROMPT, SkillGenerator, TAB_WORKSET_DEFAULT_MAX, TAB_WORKSET_MAX_MAX, TAB_WORKSET_MIN_MAX, TAB_WORKSET_SYSTEM_PROMPT, TEMPLATE_INSPECT_BUDGET, TODO_SYSTEM_PROMPT, TabWorksetPolicy, TodoStore, VIEW_DWG_TOOL, asReadMode, clampDownloadWaitMs, clampWorksetMax, columnWidthToPixels, createDelegationToolSource, createDocumentToolSource, createDownloadedFileToolSource, createDwgToolSource, createHttpDataSourceTransport, createPageActionToolSource, createPageImageToolSource, createPagePerceptionToolSource, createRemoteImageToolSource, createSkillGenerationToolSource, createSpreadsheetToolSource, createTabWorksetToolSource, createTemplateToolSource, createTodoToolSource, defersImage, dwgPickView, dwgViewsOf, fitWithin, formatCellAddress, frameLabel, frameSteps, isPdfTextTrustworthy, isRangeTopLeft, measurePdfTextQuality, parseCellAddress, parseCellRange, rangeContains, readImageSize, sniffDocumentFormat, takesImage, toActionFrameScopes, toFrameScopes, withDelegationOrigin };
@@ -1,9 +1,9 @@
1
1
  import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
2
- import { b as parseSkillMarkdown, i as buildCatalog, n as SkillDiscovery, r as SkillReader } from "./skill-CAJMsLod.js";
3
- import { a as atomicWriteText, r as resolveInsideRoot, t as assertSafePathSegment } from "./pathSecurity-B1owvJAF.js";
2
+ import { b as parseSkillMarkdown, i as buildCatalog, n as SkillDiscovery, r as SkillReader } from "./skill-WSUDp6A1.js";
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-CIuh_Yp0.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";
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";