@webskill/sdk 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/agent.d.ts 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-7No55dRb.js";
2
+ import { $ as DownloadedFileEntry, $n as SkillCandidateSink, $r as createDownloadedFileToolSource, $t as PERCEPTION_PAGING_DEFAULTS, A as DataSourceRecord, An as PerceptionAuditSink, Ar as TemplateToolSourceOptions, At as FILL_TEMPLATE_TOOL, B as DocumentFileSource, Bn as READ_DOCUMENT_TOOL, Br as WorksetTabView, Bt as LIST_PAGE_TABS_TOOL, C as DataSourceCandidateRecord, Ci as rangeContains, Cn as ParentBudget, Cr as TemplateCellSkeleton, Ct as DwgView, D as DataSourcePolicy, Di as toActionFrameScopes, Dn as PdfTextQuality, Dr as TemplateParagraphSkeleton, Dt as EMU_PER_TWIP, E as DataSourceKind, Ei as takesImage, En as PdfPageImage, Er as TemplateImageResolver, Et as EMU_PER_POINT, F as DelegationRequest, Fn as PerceptionScope, Fr as TodoStatus, Ft as GeneratedSkillDraft, G as DocumentToolSourceOptions, Gn as RemoteImageToolSourceOptions, Gr as XlsxTemplateFillSpec, Gt as OpenedTabSignal, H as DocumentImageRole, Hn as RemoteImageFetch, Hr as XlsxDocumentReader, Ht as MAX_DIGIT_WIDTH, I as DelegationResult, In as PerceptionScopeInput, Ir as TodoStore, It as HttpDataSourceOptions, J as DocxTemplateEngine, Jn as SKILL_GENERATION_SYSTEM_PROMPT, Jr as clampDownloadWaitMs, Jt as PAGE_ACTION_TOOL, K as DocxDocumentContent, Kn as RenderedImage, Kr as XlsxTemplateSkeleton, Kt as PAGE_ACTION_KINDS, L as DelegationToolSourceOptions, Ln as PptxDocumentContent, Lr as TodoToolSourceOptions, Lt as INSPECT_TEMPLATE_TOOL, M as DelegationBudget, Mn as PerceptionPagingBudget, Mr as TodoItem, Mt as FrameNote, N as DelegationOrchestrator, Nn as PerceptionRecord, Nr as TodoList, Nt as FrameScope, O as DataSourcePolicyOptions, Oi as toFrameScopes, On as PerceivedImage, Or as TemplateSheetSkeleton, Ot as EXPORT_SPREADSHEET_TOOL, P as DelegationOrchestratorOptions, Pn as PerceptionResult, Pr as TodoListener, Pt as GENERATE_SKILL_TOOL, Q as DownloadedFileConsent, Qn as SkillBinaryPayload, Qr as createDocumentToolSource, Qt as PERCEIVE_PAGE_TOOL, R as DocumentBlock, Rn as PptxDocumentReader, Rr as VIEW_DWG_TOOL, Rt as ImageCaptureBudget, S as DataSourceCandidatePolicyOptions, Si as parseCellRange, Sn as PagePerceptionToolSourceOptions, Sr as TabWorksetToolSourceOptions, St as DwgUnits, T as DataSourceDef, Ti as sniffDocumentFormat, Tn as PdfDocumentReader, Tr as TemplateImageBytes, Tt as EMU_PER_PIXEL, U as DocumentReadBudget, Un as RemoteImageFetchFailure, Ur as XlsxSheetContent, Ut as NestedFrameRef, V as DocumentFormat, Vn as READ_DOWNLOADED_FILE_TOOL, Vr as XlsxDocumentContent, Vt as MANAGE_TODO_TOOL, W as DocumentReadMode, Wn as RemoteImageResult, Wr as XlsxTemplateEngine, Wt as OpenedPageInfo, X as DocxTemplateSkeleton, Xn as Size, Xr as columnWidthToPixels, Xt as PDF_GARBLED_RATIO, Y as DocxTemplateFillSpec, Yn as ScrollDirection, Yr as clampWorksetMax, Yt as PAGE_DOCUMENT_REF, Z as DownloadedFileAction, Zn as SkillAttachmentBytes, Zr as createDelegationToolSource, Zt as PDF_LARGE_IMAGE_RATIO, _ as DWG_MODEL_VIEW_ID, _i as frameSteps, _n as PageImageResult, _r as TODO_SYSTEM_PROMPT, _t as DwgOmission, a as ActionTabWindow, ai as createRemoteImageToolSource, an as PageActionPolicy, ar as SkillGeneratorOptions, at as DownloadedFileRecord, b as DataSourceCandidateAuditSink, bi as measurePdfTextQuality, bn as PagePerceptionPolicyOptions, br as TabWorksetPolicyOptions, bt as DwgProjection, c as CellAddress, ci as createTabWorksetToolSource, cn as PageActionRequest, cr as SpreadsheetToolSourceOptions, ct as DwgComponent, d as DELEGATE_TASK_TOOL, di as defersImage, dn as PageActionTarget, dr as SubtreeRejection, dt as DwgEntity, ei as createDwgToolSource, en as PERCEPTION_SYSTEM_PROMPT, er as SkillGenerationMessages, et as DownloadedFileListing, f as DELEGATION_SYSTEM_PROMPT, fi as dwgPickView, fn as PageActionToolSourceOptions, fr as TAB_WORKSET_DEFAULT_MAX, ft as DwgFill, g as DOWNLOAD_WAIT_MIN_MS, gi as frameLabel, gn as PageImageFailure, gr as TEMPLATE_INSPECT_BUDGET, gt as DwgLoadedDrawing, h as DOWNLOAD_WAIT_MAX_MS, hi as formatCellAddress, hn as PageImageCapture, hr as TAB_WORKSET_SYSTEM_PROMPT, ht as DwgLayer, i as ActionTabWatcher, ii as createPagePerceptionToolSource, in as PageActionOutcome, ir as SkillGenerator, it as DownloadedFileReader, j as DataSourceTransport, jn as PerceptionCaptureOptions, jr as TodoEvent, jt as FOCUS_PAGE_TAB_TOOL, k as DataSourceProvenance, ki as withDelegationOrigin, kn as PerceivedNode, kr as TemplateTableCellSkeleton, kt as FETCH_REMOTE_IMAGE_TOOL, l as CellRange, li as createTemplateToolSource, ln as PageActionScope, lr as SubAgentRunInput, lt as DwgDocumentContent, m as DOWNLOAD_WAIT_DEFAULT_MS, mi as fitWithin, mn as PageAuditSink, mr as TAB_WORKSET_MIN_MAX, mt as DwgGeometry, n as ActionDownloadWindow, ni as createPageActionToolSource, nn as PageActionExecutor, nr as SkillGenerationPolicy, nt as DownloadedFilePolicyOptions, o as CAPTURE_PAGE_IMAGE_TOOL, oi as createSkillGenerationToolSource, on as PageActionPolicyOptions, or as SkillTraceEvidence, ot as DownloadedFileToolSourceOptions, p as DOCUMENT_READ_BUDGET, pi as dwgViewsOf, pn as PageActionUi, pr as TAB_WORKSET_MAX_MAX, pt as DwgFont, q as DocxDocumentReader, qn as SCROLL_DIRECTIONS, qr as asReadMode, qt as PAGE_ACTION_SYSTEM_PROMPT, r as ActionFrameScope, ri as createPageImageToolSource, rn as PageActionKind, rr as SkillGenerationToolSourceOptions, rt as DownloadedFileReadResult, s as CLOSE_PAGE_TAB_TOOL, si as createSpreadsheetToolSource, sn as PageActionRecord, sr as SkillTraceEvidenceStep, st as DwgBounds, t as ActionDownloadWatcher, ti as createHttpDataSourceTransport, tn as PageActionConsent, tr as SkillGenerationOutcome, tt as DownloadedFilePolicy, u as ConsentUi, ui as createTodoToolSource, un as PageActionScopeInput, ur as SubAgentRunner, ut as DwgDocumentReader, v as DataSourceAuditSink, vi as isPdfTextTrustworthy, vn as PageImageToolSourceOptions, vr as TabAdmission, vt as DwgPoint, w as DataSourceCandidateStore, wi as readImageSize, wn as PdfDocumentHandle, wr as TemplateFileSource, wt as DwgViewport, x as DataSourceCandidatePolicy, xi as parseCellAddress, xn as PagePerceptionReader, xr as TabWorksetPort, xt as DwgToolSourceOptions, y as DataSourceCandidate, yi as isRangeTopLeft, yn as PagePerceptionPolicy, yr as TabWorksetPolicy, yt as DwgProjectedDrawing, z as DocumentFileBytes, zn as PptxSlideContent, zr as WorksetTab, zt as LIST_DOWNLOADED_FILES_TOOL } from "./index-V76_OFj2.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 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 };
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;
@@ -2127,7 +2250,7 @@ const INPUT_SCHEMA$2 = {
2127
2250
  },
2128
2251
  value: {
2129
2252
  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\"."
2253
+ 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
2254
  }
2132
2255
  },
2133
2256
  required: ["action"],
@@ -2218,7 +2341,7 @@ function createPageActionToolSource(options) {
2218
2341
  "select",
2219
2342
  "set"
2220
2343
  ].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\".");
2344
+ 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
2345
  return await run({
2223
2346
  ref,
2224
2347
  action,
@@ -3154,7 +3277,7 @@ const TEMPLATE_INSPECT_BUDGET = {
3154
3277
  chars: 2e4
3155
3278
  };
3156
3279
  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.";
3280
+ 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. 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
3281
  const TEMPLATE_ID = "The attachment id, or the id from list_downloaded_files.";
3159
3282
  function inspectSchema(idHint) {
3160
3283
  return {
@@ -3945,4 +4068,4 @@ function createDwgToolSource(options) {
3945
4068
  }
3946
4069
 
3947
4070
  //#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 };
4071
+ 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";
package/dist/browser.d.ts CHANGED
@@ -1,6 +1,6 @@
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-BM5FI9oN.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-YPd8ZSEa.js";
3
- import { In as PerceptionScopeInput, K as DocxDocumentContent, Ln as PptxDocumentContent, Lr as XlsxDocumentContent, Pn as PerceptionResult, Rn as PptxDocumentReader, Rr as XlsxDocumentReader, Tn as PdfDocumentReader, Ut as NestedFrameRef, cn as PageActionRequest, dn as PageActionTarget, in as PageActionOutcome, jn as PerceptionCaptureOptions, kn as PerceivedNode, mn as PageAuditSink, nn as PageActionExecutor, q as DocxDocumentReader, sr as SubtreeRejection, u as ConsentUi, un as PageActionScopeInput, xn as PagePerceptionReader, yn as PagePerceptionPolicy } from "./index-CjwdZQOS.js";
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-BiZBXGm4.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-7No55dRb.js";
3
+ import { Hr as XlsxDocumentReader, In as PerceptionScopeInput, K as DocxDocumentContent, Ln as PptxDocumentContent, Pn as PerceptionResult, Rn as PptxDocumentReader, Tn as PdfDocumentReader, Ut as NestedFrameRef, Vr as XlsxDocumentContent, cn as PageActionRequest, dn as PageActionTarget, dr 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-V76_OFj2.js";
4
4
  //#region ../browser/dist/index.d.ts
5
5
  //#region src/fs/featureDetection.d.ts
6
6
  /** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
@@ -801,9 +801,19 @@ interface PageAgentTransport {
801
801
  send(request: PageAgentRequest): Promise<PageAgentReply>;
802
802
  }
803
803
  /** @experimental */
804
- type PageAgentRequest = {
804
+ type PageAgentRequest =
805
+ /**
806
+ * `ref` 是 0.23.0 分册 13 唯一新增的字段:带上它表示只读这个句柄的子树。
807
+ * **可选**,不带时的载荷与本版前逐字相同(AC-13.2)。
808
+ *
809
+ * 页面侧不认识它时会静默整页返回,那正是需求 FR-13.3 禁止的回落,
810
+ * 所以调用方只在自己确认对端实现了子树续读时才发它——远程 reader 通过
811
+ * 「对端回不回 `PERCEPTION_SUBTREE_*` 错误码」来确认,而不是靠猜。
812
+ */
813
+ {
805
814
  type: 'perceive';
806
815
  scope: PerceptionScopeInput;
816
+ ref?: string;
807
817
  capture?: PerceptionCaptureOptions;
808
818
  } | {
809
819
  type: 'execute';