@webskill/sdk 0.23.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.
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +33 -10
- package/dist/browser.d.ts +41 -6
- package/dist/browser.js +252 -12
- package/dist/governance.d.ts +3 -3
- package/dist/governance.js +12 -2
- package/dist/{index-V76_OFj2.d.ts → index-B3rMAUWB.d.ts} +49 -10
- package/dist/{index-7No55dRb.d.ts → index-Bq299VnF.d.ts} +1 -1
- package/dist/{index-ShvCB5I9.d.ts → index-mKgZU7cG.d.ts} +62 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/mcp.d.ts +2 -2
- package/dist/node.d.ts +3 -3
- package/dist/{openUiLibrary-B7j3rLrm.js → openUiLibrary-CxtrnX54.js} +1 -1
- package/dist/{openUiSpecLang-BSYYnjay.js → openUiSpecLang-DIcLcybq.js} +148 -13
- package/dist/{skillVersionStore-S4_HJ_Fl-Cvy9LqVu.d.ts → skillVersionStore-S4_HJ_Fl-Ds97pwm5.d.ts} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{types-CpDRZ0rA-BiZBXGm4.d.ts → types-CpDRZ0rA-CFQ-vdKz.d.ts} +4 -0
- package/dist/ui-react.d.ts +11 -4
- package/dist/ui-react.js +48 -6
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +6 -6
- package/dist/{webskillLitCatalog-D5BCiMCU.js → webskillLitCatalog-BPyjYuRT.js} +1 -1
- 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-
|
|
2
|
-
import { $ as DownloadedFileEntry, $n as SkillCandidateSink, $r as
|
|
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 };
|
|
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
|
@@ -2172,7 +2172,7 @@ var PageActionPolicy = class {
|
|
|
2172
2172
|
ok: outcome.ok,
|
|
2173
2173
|
...request.action === "fill" && request.value !== void 0 && !secret ? { value: request.value } : {},
|
|
2174
2174
|
...request.action === "scroll" && outcome.scrolled !== void 0 ? { scrolled: {
|
|
2175
|
-
direction: request.value
|
|
2175
|
+
direction: scrollDirectionOf(request.value),
|
|
2176
2176
|
...outcome.scrolled
|
|
2177
2177
|
} } : {},
|
|
2178
2178
|
...outcome.reason !== void 0 ? { reason: outcome.reason } : {}
|
|
@@ -2216,6 +2216,8 @@ var PageActionPolicy = class {
|
|
|
2216
2216
|
* 措辞刻意保守:提示词里的鼓励性表述会直接抬高模型尝试操作的频率,
|
|
2217
2217
|
* 而每一次尝试都要打断用户去点确认。
|
|
2218
2218
|
*/
|
|
2219
|
+
/** 与 toolSource 的校验失败文案同源:模型看到的取值集合必须就是被校验的那个集合 */
|
|
2220
|
+
const DIRECTIONS = SCROLL_DIRECTIONS.map((d) => `"${d}"`).join(" / ");
|
|
2219
2221
|
const PAGE_ACTION_SYSTEM_PROMPT = [
|
|
2220
2222
|
"You can act on the current page, but only within the regions the host made actionable.",
|
|
2221
2223
|
"Targets must come from the \"ref\" values in a fresh perceive_page result — you cannot construct them, and CSS selectors are rejected.",
|
|
@@ -2223,7 +2225,7 @@ const PAGE_ACTION_SYSTEM_PROMPT = [
|
|
|
2223
2225
|
"A reference expires as soon as the page is perceived again; perceive first, then act.",
|
|
2224
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.",
|
|
2225
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.",
|
|
2226
|
-
"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
|
|
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.",
|
|
2227
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.",
|
|
2228
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."
|
|
2229
2231
|
].join("\n");
|
|
@@ -3276,8 +3278,13 @@ const TEMPLATE_INSPECT_BUDGET = {
|
|
|
3276
3278
|
cells: 400,
|
|
3277
3279
|
chars: 2e4
|
|
3278
3280
|
};
|
|
3279
|
-
|
|
3280
|
-
|
|
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.";
|
|
3281
3288
|
const TEMPLATE_ID = "The attachment id, or the id from list_downloaded_files.";
|
|
3282
3289
|
function inspectSchema(idHint) {
|
|
3283
3290
|
return {
|
|
@@ -3321,7 +3328,7 @@ function fillSchema(withImages, idHint) {
|
|
|
3321
3328
|
},
|
|
3322
3329
|
cells: {
|
|
3323
3330
|
type: "array",
|
|
3324
|
-
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.",
|
|
3325
3332
|
items: {
|
|
3326
3333
|
type: "object",
|
|
3327
3334
|
properties: {
|
|
@@ -3447,7 +3454,7 @@ function fillSchema(withImages, idHint) {
|
|
|
3447
3454
|
};
|
|
3448
3455
|
}
|
|
3449
3456
|
function systemPrompt(withImages) {
|
|
3450
|
-
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." : "");
|
|
3451
3458
|
}
|
|
3452
3459
|
function toolError(e) {
|
|
3453
3460
|
return {
|
|
@@ -3541,6 +3548,9 @@ function createTemplateToolSource(options) {
|
|
|
3541
3548
|
const cells = sheet.cells.slice(0, Math.max(left, 0));
|
|
3542
3549
|
if (cells.length < sheet.cells.length) truncated = true;
|
|
3543
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;
|
|
3544
3554
|
return {
|
|
3545
3555
|
name: sheet.name,
|
|
3546
3556
|
range: sheet.range,
|
|
@@ -3550,6 +3560,9 @@ function createTemplateToolSource(options) {
|
|
|
3550
3560
|
...cell.formula === void 0 ? {} : { formula: cell.formula }
|
|
3551
3561
|
})),
|
|
3552
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] } : {},
|
|
3553
3566
|
...cells.length < sheet.cells.length ? { omittedCells: sheet.cells.length - cells.length } : {}
|
|
3554
3567
|
};
|
|
3555
3568
|
});
|
|
@@ -3606,14 +3619,24 @@ function createTemplateToolSource(options) {
|
|
|
3606
3619
|
};
|
|
3607
3620
|
}) } : {}
|
|
3608
3621
|
};
|
|
3609
|
-
const
|
|
3610
|
-
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);
|
|
3611
3624
|
return json({
|
|
3612
3625
|
path: artifact.path,
|
|
3613
3626
|
size: artifact.size,
|
|
3614
|
-
filledCount:
|
|
3627
|
+
filledCount: outcome.filled,
|
|
3615
3628
|
insertedRows: (spec.rows ?? []).reduce((total, row) => total + row.count, 0),
|
|
3616
|
-
...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
|
+
})) } : {}
|
|
3617
3640
|
});
|
|
3618
3641
|
}
|
|
3619
3642
|
const spec = {
|
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-
|
|
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-
|
|
3
|
-
import {
|
|
1
|
+
import { G as FileStat, It as VerifyResult, K as FileSystemProvider, Lt as WebSkillError, N as ArchiveLimits, Ot as SkillsLockfile, Pt as UnsignedPolicy, S as UiBridge, St as SkillManifest, b as RenderResultRequest, c as InteractionResponse, jt as TrustedKeyStore, l as LlmClient, m as LlmStreamEvent, o as InteractionPolicy, p as LlmResponse, q as FileWriteStream, s as InteractionRequest, u as LlmCompleteInput, v as MemoryStore, vt as SkillInstallSource } from "./types-CpDRZ0rA-CFQ-vdKz.js";
|
|
2
|
+
import { $ as ImageOmission, B as ExternalToolSource, C as BridgeResponse, N as DocumentSurfaceHost, Pn as ToolResult, S as BridgeRequest, Sr as bridgeError, Yr as parseBridgeRequest, b as BridgeCapabilities, ct as LinkedDocumentReader, en as ScriptExecutionContext, jn as ToolDefinition, m as ApprovalScope, mr as WebSkillApi, sr as ViewerImageFact, tn as ScriptExecutor, ut as NetworkPolicy, z as ExternalSkillProvider } from "./index-Bq299VnF.js";
|
|
3
|
+
import { Gr as XlsxDocumentReader, In as PerceptionScopeInput, K as DocxDocumentContent, Ln as PptxDocumentContent, Pn as PerceptionResult, Rn as PptxDocumentReader, Tn as PdfDocumentReader, Ut as NestedFrameRef, Wr 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-B3rMAUWB.js";
|
|
4
4
|
//#region ../browser/dist/index.d.ts
|
|
5
5
|
//#region src/fs/featureDetection.d.ts
|
|
6
6
|
/** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
|
|
@@ -1694,6 +1694,12 @@ interface XlsxTemplateSheet {
|
|
|
1694
1694
|
}>;
|
|
1695
1695
|
readonly merges: readonly string[];
|
|
1696
1696
|
readonly columnWidths: readonly number[];
|
|
1697
|
+
/** 空着、等着被填的格,压成矩形区间(0.24.0 FR-17.1 / FR-17.3) */
|
|
1698
|
+
readonly blanks?: readonly string[];
|
|
1699
|
+
/** 被合并区吞掉的格(不含左上角),写进去不会显示(FR-17.4) */
|
|
1700
|
+
readonly covered?: readonly string[];
|
|
1701
|
+
/** 表头行,1 基(FR-17.5) */
|
|
1702
|
+
readonly headerRows?: readonly number[];
|
|
1697
1703
|
}
|
|
1698
1704
|
interface XlsxTemplateSkeleton {
|
|
1699
1705
|
readonly sheets: readonly XlsxTemplateSheet[];
|
|
@@ -1725,6 +1731,31 @@ interface XlsxTemplateSpec {
|
|
|
1725
1731
|
readonly cells?: readonly XlsxCellFill[];
|
|
1726
1732
|
readonly images?: readonly XlsxImagePlacement[];
|
|
1727
1733
|
}
|
|
1734
|
+
/** 一条被挡回的填写(0.24.0 FR-17.8 · 设计 18 §4.2) */
|
|
1735
|
+
interface XlsxFillRejection {
|
|
1736
|
+
readonly sheet: string;
|
|
1737
|
+
readonly address: string;
|
|
1738
|
+
readonly code: 'TEMPLATE_CELL_IS_FORMULA' | 'TEMPLATE_CELL_IS_COVERED';
|
|
1739
|
+
readonly reason: string;
|
|
1740
|
+
}
|
|
1741
|
+
/** 放行了,但值得说一句(写进了推导出来的表头行) */
|
|
1742
|
+
interface XlsxFillWarning {
|
|
1743
|
+
readonly sheet: string;
|
|
1744
|
+
readonly address: string;
|
|
1745
|
+
readonly reason: string;
|
|
1746
|
+
}
|
|
1747
|
+
interface XlsxSheetBlanks {
|
|
1748
|
+
readonly sheet: string;
|
|
1749
|
+
readonly ranges: readonly string[];
|
|
1750
|
+
}
|
|
1751
|
+
/** 填充回执(FR-17.8 ~ FR-17.12)。`filled` 是真正写进文件的条数,不是请求条数。 */
|
|
1752
|
+
interface XlsxFillOutcome {
|
|
1753
|
+
readonly bytes: Uint8Array;
|
|
1754
|
+
readonly filled: number;
|
|
1755
|
+
readonly rejected: readonly XlsxFillRejection[];
|
|
1756
|
+
readonly warnings: readonly XlsxFillWarning[];
|
|
1757
|
+
readonly stillBlank: readonly XlsxSheetBlanks[];
|
|
1758
|
+
}
|
|
1728
1759
|
/** 读带坐标的骨架(FR-42.1)。模型据此决定往哪儿写。 */
|
|
1729
1760
|
declare function readXlsxTemplate(bytes: Uint8Array): Promise<XlsxTemplateSkeleton>;
|
|
1730
1761
|
/**
|
|
@@ -1732,9 +1763,13 @@ declare function readXlsxTemplate(bytes: Uint8Array): Promise<XlsxTemplateSkelet
|
|
|
1732
1763
|
*
|
|
1733
1764
|
* 顺序是**先插行、后填值**:填值用的地址是插行之后的坐标,反过来会逼模型心算偏移。
|
|
1734
1765
|
*
|
|
1735
|
-
*
|
|
1766
|
+
* 格值写入是**部分应用**(0.24.0 FR-17.8):撞上护栏的逐条记进回执,其余照常落盘。
|
|
1767
|
+
* 插行与图片仍然全或无——插了一半再中止,后面所有地址的行号都偏了,
|
|
1768
|
+
* 「部分应用」在那里没有可理解的语义。
|
|
1769
|
+
*
|
|
1770
|
+
* @throws WebSkillError 模板不是 xlsx、地址不合法、目标不存在、插行越界、或请求的格一条都没写成
|
|
1736
1771
|
*/
|
|
1737
|
-
declare function fillXlsxTemplate(bytes: Uint8Array, spec: XlsxTemplateSpec): Promise<
|
|
1772
|
+
declare function fillXlsxTemplate(bytes: Uint8Array, spec: XlsxTemplateSpec): Promise<XlsxFillOutcome>;
|
|
1738
1773
|
//#endregion
|
|
1739
1774
|
//#region src/document/docxTemplate.d.ts
|
|
1740
1775
|
interface DocxTemplateParagraph {
|
|
@@ -2713,4 +2748,4 @@ interface WebOfficeToolSourceOptions {
|
|
|
2713
2748
|
*/
|
|
2714
2749
|
declare function createWebOfficeToolSource(options: WebOfficeToolSourceOptions): ExternalToolSource;
|
|
2715
2750
|
//#endregion
|
|
2716
|
-
export { type BlockedEventLike, type BridgeCapabilities, type BridgeRequest, type BridgeResponse, type BrowserHostBundle, type BrowserHostOptions, type BrowserHostOverrides, BrowserSkillManager, BrowserWorkerScriptExecutor, type BuiltinSkillManifest, type CameraAvailability, type CameraOptions, type CameraSession, type CaptureFailure, type CaptureLevel, type CapturePhotoOptions, type CapturedImage, type ChromeBuiltinAvailability, ChromeBuiltinLlmClient, type CompressResult, type ConfiguredLlmClient, DEFAULT_CAMERA_MAX_DIMENSION, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DEFAULT_MAX_VIEWER_PAYLOAD_PIXELS, DEFAULT_SOFT_VIEWER_PAYLOAD_BYTES, DEFAULT_SOFT_VIEWER_PAYLOAD_PIXELS, DOCUMENT_IMAGE_MIME_TYPES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_IMAGE_WIDTH_RATIO, DOCX_UNEXTRACTED, type DictationAvailability, type DictationOptions, type DictationSession, type DocumentBlock, type DocumentImage, type DocumentLocationView, type DocumentSurfaceAudit, type DocumentSurfaceOptions, type DocxImagePlacement, type DocxTemplateCell, type DocxTemplateParagraph, type DocxTemplateSkeleton, type DocxTemplateSpec, type DocxTextFill, type DomPageActionExecutor, type DomPageActionOptions, type DomPerceptionReader, type DomPerceptionReaderOptions, type FetchLinkedDocumentOptions, type FetchRemoteImageOptions, type FrameBudget, type FrameDelivery, type FrameDispatcher, type FrameResolveContext, type FrameRouter, type FrameRouterOptions, HOST_PORT_MATRIX, type HandleKind, type HostChatbotAdapterShape, type HostConnectFacadeShape, type HostConsoleBackendShape, type HostKind, type HostSurface, type IframeSandboxOptions, IframeWorkerLike, type InspectHostWiringInput, LIST_WEBOFFICE_DOCUMENTS_TOOL, type LlmClientConfig, type LlmEntryConfig, MAX_REMOTE_IMAGE_BYTES, type MainToWorkerMessage, type OoxmlPackage, type OpenDocumentInput, OpfsProvider, PPTX_UNEXTRACTED, PPTX_UNEXTRACTED_NOTICE, type PageAgentHandler, type PageAgentHandlerOptions, type PageAgentReply, type PageAgentRequest, type PageAgentTargetEntry, type PageAgentTransport, type PageDocumentIdentity, type PageImageHost, type PayloadDimension, type PayloadSizeNotice, type PdfPage, type PortApplicability, type PortReport, type PortSpec, type PortStatus, type PresentationSlide, type PresentationSourceDocument, type PresentationSourceReader, type PresentationSourceSlide, READ_WEBOFFICE_DOCUMENT_TOOL, REMOTE_IMAGE_TIMEOUT_MS, type RemoteFetchFailure, type RemoteImageFailure, type RemoteImageHost, type RemotePageActionExecutorOptions, type RemotePageImageHostOptions, type RemotePerceptionReaderOptions, type RemoteTargetRegistry, type RemoteTargetRegistryOptions, type RoleHint, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, type SandboxMode, type SandboxTokenDiff, type SeedSkillsFromHttpOptions, type SerializedError, type TargetResolution, TsTranspiler, type TypeScriptSupportOptions, VIEWER_IMG_SRC_BASE, VIEWER_IMG_SRC_REMOTE, VIEWER_SANDBOX_TOKENS, type ViewerBlockedHost, type ViewerBlockedNotice, type ViewerBlockedResult, type ViewerCspOptions, type ViewerDocument, type ViewerShellHost, type ViewerShellMount, type ViewerShellResult, type VisionCaptureOptions, WEBOFFICE_BUDGET, WEBOFFICE_UNEXTRACTED, WEB_OFFICE_OFFICE_TYPES, WEB_OFFICE_READ_METHODS, WEB_OFFICE_SUPPORTED_TYPES, WORKER_BOOTSTRAP_SOURCE, type WebOfficeAction, type WebOfficeApiSurface, type WebOfficeAuditRecord, type WebOfficeAuthorizationInput, type WebOfficeAuthorizationKey, type WebOfficeAuthorizationOutcome, type WebOfficeBudget, WebOfficeBudgetGuard, type WebOfficeChannel, type WebOfficeConsent, type WebOfficeContent, type WebOfficeDisplayHints, type WebOfficeExtractOptions, type WebOfficeFailure, type WebOfficeFingerprintResult, type WebOfficeHost, type WebOfficeInstanceRecord, type WebOfficeListing, WebOfficePolicy, type WebOfficePolicyOptions, type WebOfficeReadCursor, type WebOfficeReadOptions, type WebOfficeReadPort, type WebOfficeReadResult, type WebOfficeScrollPosition, type WebOfficeSupportedType, type WebOfficeToolSourceOptions, type WebOfficeVisionPort, type WindowLike, type WorkbookSheet, type WorkerEvent, type WorkerFactory, type WorkerLike, type WorkerRequest, WorkerRuntimeClient, type WorkerRuntimeClientDeps, type WorkerRuntimeHostOverrides, type WorkerScopeLike, WorkerUiBridge, XLSX_IMAGE_MIN_COLUMNS, XLSX_IMAGE_MIN_ROWS, XLSX_UNEXTRACTED, type XlsxCellFill, type XlsxImagePlacement, type XlsxRowInsert, type XlsxTemplateSheet, type XlsxTemplateSkeleton, type XlsxTemplateSpec, assertWebOfficeFingerprint, auditOoxmlPackage, blockedMessage, bridgeError, callWebOfficeMethod, captureByScrolling, captureDocumentImage, captureElementImage, capturePhoto, checkCameraAvailability, checkDictationAvailability, checkWebOfficeFingerprint, classifyFetchFailure, compressImageToBudget, contentKindOf, createBrowserChatbotHost, createDocumentSurfaceHost, createDocxBlockReader, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createPptxBlockReader, createRemoteImageHost, createRemotePageActionExecutor, createRemotePageImageHost, createRemotePerceptionReader, createRemoteTargetRegistry, createWebOfficeHandle, createWebOfficeToolSource, createXlsxBlockReader, deleteMemoryEncryptionKey, describeScreenshotOverlap, diffSandboxTokens, documentKey, explainResolution, extractDocxText, extractPptxText, extractWebOfficeContent, extractXlsxText, extractZipWeb, fetchRemoteImage, fillDocxTemplate, fillXlsxTemplate, generateMemoryEncryptionKey, headingLevelOf, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, isRemoteImageFailure, isWebOfficeReadMethod, missingPorts, openCamera, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, readDocxBlocks, readDocxTemplate, readOoxmlPackage, readPptxBlocks, readXlsxBlocks, readXlsxTemplate, resolveWebOfficeAuthorization, seedSkillsFromHttp, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, toDocumentImage, viewerCspHeader, watchBlockedResources, webOfficeFailure, writeOoxmlPackage };
|
|
2751
|
+
export { type BlockedEventLike, type BridgeCapabilities, type BridgeRequest, type BridgeResponse, type BrowserHostBundle, type BrowserHostOptions, type BrowserHostOverrides, BrowserSkillManager, BrowserWorkerScriptExecutor, type BuiltinSkillManifest, type CameraAvailability, type CameraOptions, type CameraSession, type CaptureFailure, type CaptureLevel, type CapturePhotoOptions, type CapturedImage, type ChromeBuiltinAvailability, ChromeBuiltinLlmClient, type CompressResult, type ConfiguredLlmClient, DEFAULT_CAMERA_MAX_DIMENSION, DEFAULT_FRAME_BUDGET, DEFAULT_MAX_VIEWER_PAYLOAD_BYTES, DEFAULT_MAX_VIEWER_PAYLOAD_PIXELS, DEFAULT_SOFT_VIEWER_PAYLOAD_BYTES, DEFAULT_SOFT_VIEWER_PAYLOAD_PIXELS, DOCUMENT_IMAGE_MIME_TYPES, DOCUMENT_SURFACE_AUDIT_EVENT, DOCX_IMAGE_WIDTH_RATIO, DOCX_UNEXTRACTED, type DictationAvailability, type DictationOptions, type DictationSession, type DocumentBlock, type DocumentImage, type DocumentLocationView, type DocumentSurfaceAudit, type DocumentSurfaceOptions, type DocxImagePlacement, type DocxTemplateCell, type DocxTemplateParagraph, type DocxTemplateSkeleton, type DocxTemplateSpec, type DocxTextFill, type DomPageActionExecutor, type DomPageActionOptions, type DomPerceptionReader, type DomPerceptionReaderOptions, type FetchLinkedDocumentOptions, type FetchRemoteImageOptions, type FrameBudget, type FrameDelivery, type FrameDispatcher, type FrameResolveContext, type FrameRouter, type FrameRouterOptions, HOST_PORT_MATRIX, type HandleKind, type HostChatbotAdapterShape, type HostConnectFacadeShape, type HostConsoleBackendShape, type HostKind, type HostSurface, type IframeSandboxOptions, IframeWorkerLike, type InspectHostWiringInput, LIST_WEBOFFICE_DOCUMENTS_TOOL, type LlmClientConfig, type LlmEntryConfig, MAX_REMOTE_IMAGE_BYTES, type MainToWorkerMessage, type OoxmlPackage, type OpenDocumentInput, OpfsProvider, PPTX_UNEXTRACTED, PPTX_UNEXTRACTED_NOTICE, type PageAgentHandler, type PageAgentHandlerOptions, type PageAgentReply, type PageAgentRequest, type PageAgentTargetEntry, type PageAgentTransport, type PageDocumentIdentity, type PageImageHost, type PayloadDimension, type PayloadSizeNotice, type PdfPage, type PortApplicability, type PortReport, type PortSpec, type PortStatus, type PresentationSlide, type PresentationSourceDocument, type PresentationSourceReader, type PresentationSourceSlide, READ_WEBOFFICE_DOCUMENT_TOOL, REMOTE_IMAGE_TIMEOUT_MS, type RemoteFetchFailure, type RemoteImageFailure, type RemoteImageHost, type RemotePageActionExecutorOptions, type RemotePageImageHostOptions, type RemotePerceptionReaderOptions, type RemoteTargetRegistry, type RemoteTargetRegistryOptions, type RoleHint, SANDBOX_PAGE_SCRIPT_SOURCE, SHARD_SOFT_LIMIT, type SandboxMode, type SandboxTokenDiff, type SeedSkillsFromHttpOptions, type SerializedError, type TargetResolution, TsTranspiler, type TypeScriptSupportOptions, VIEWER_IMG_SRC_BASE, VIEWER_IMG_SRC_REMOTE, VIEWER_SANDBOX_TOKENS, type ViewerBlockedHost, type ViewerBlockedNotice, type ViewerBlockedResult, type ViewerCspOptions, type ViewerDocument, type ViewerShellHost, type ViewerShellMount, type ViewerShellResult, type VisionCaptureOptions, WEBOFFICE_BUDGET, WEBOFFICE_UNEXTRACTED, WEB_OFFICE_OFFICE_TYPES, WEB_OFFICE_READ_METHODS, WEB_OFFICE_SUPPORTED_TYPES, WORKER_BOOTSTRAP_SOURCE, type WebOfficeAction, type WebOfficeApiSurface, type WebOfficeAuditRecord, type WebOfficeAuthorizationInput, type WebOfficeAuthorizationKey, type WebOfficeAuthorizationOutcome, type WebOfficeBudget, WebOfficeBudgetGuard, type WebOfficeChannel, type WebOfficeConsent, type WebOfficeContent, type WebOfficeDisplayHints, type WebOfficeExtractOptions, type WebOfficeFailure, type WebOfficeFingerprintResult, type WebOfficeHost, type WebOfficeInstanceRecord, type WebOfficeListing, WebOfficePolicy, type WebOfficePolicyOptions, type WebOfficeReadCursor, type WebOfficeReadOptions, type WebOfficeReadPort, type WebOfficeReadResult, type WebOfficeScrollPosition, type WebOfficeSupportedType, type WebOfficeToolSourceOptions, type WebOfficeVisionPort, type WindowLike, type WorkbookSheet, type WorkerEvent, type WorkerFactory, type WorkerLike, type WorkerRequest, WorkerRuntimeClient, type WorkerRuntimeClientDeps, type WorkerRuntimeHostOverrides, type WorkerScopeLike, WorkerUiBridge, XLSX_IMAGE_MIN_COLUMNS, XLSX_IMAGE_MIN_ROWS, XLSX_UNEXTRACTED, type XlsxCellFill, type XlsxFillOutcome, type XlsxFillRejection, type XlsxFillWarning, type XlsxImagePlacement, type XlsxRowInsert, type XlsxSheetBlanks, type XlsxTemplateSheet, type XlsxTemplateSkeleton, type XlsxTemplateSpec, assertWebOfficeFingerprint, auditOoxmlPackage, blockedMessage, bridgeError, callWebOfficeMethod, captureByScrolling, captureDocumentImage, captureElementImage, capturePhoto, checkCameraAvailability, checkDictationAvailability, checkWebOfficeFingerprint, classifyFetchFailure, compressImageToBudget, contentKindOf, createBrowserChatbotHost, createDocumentSurfaceHost, createDocxBlockReader, createDomPageActionExecutor, createDomPerceptionReader, createEncryptedMemoryStore, createFetchLinkedDocumentReader, createFrameRouter, createIframeWorker, createLlmClient, createPageAgentHandler, createPptxBlockReader, createRemoteImageHost, createRemotePageActionExecutor, createRemotePageImageHost, createRemotePerceptionReader, createRemoteTargetRegistry, createWebOfficeHandle, createWebOfficeToolSource, createXlsxBlockReader, deleteMemoryEncryptionKey, describeScreenshotOverlap, diffSandboxTokens, documentKey, explainResolution, extractDocxText, extractPptxText, extractWebOfficeContent, extractXlsxText, extractZipWeb, fetchRemoteImage, fillDocxTemplate, fillXlsxTemplate, generateMemoryEncryptionKey, headingLevelOf, inspectHostWiring, installWebSkillNavigator, isCapturableElement, isCaptureFailure, isEncryptedMemoryValue, isOpfsAvailable, isRemoteImageFailure, isWebOfficeReadMethod, missingPorts, openCamera, openDocumentSurface, openMemoryEncryptionKey, parseBridgeRequest, parseMainMessage, parseWorkerEvent, probeChromeBuiltinAvailability, readDocxBlocks, readDocxTemplate, readOoxmlPackage, readPptxBlocks, readXlsxBlocks, readXlsxTemplate, resolveWebOfficeAuthorization, seedSkillsFromHttp, sha256HexWeb, startDictation, startViewerShell, startWorkerRuntimeHost, toDocumentImage, viewerCspHeader, watchBlockedResources, webOfficeFailure, writeOoxmlPackage };
|
package/dist/browser.js
CHANGED
|
@@ -8,7 +8,7 @@ import { a as GoogleGenAiClient, o as AnthropicClient, s as OpenAiCompatibleClie
|
|
|
8
8
|
import { c as toBase64$1, f as SPREADSHEET_MIME_TYPE } from "./linkedDocument-CZZOl9cO.js";
|
|
9
9
|
import { n as normalizeToolContent, t as mergeCatalogEntries } from "./external-_ZRQe-V9.js";
|
|
10
10
|
import { t as createWebSkillApi } from "./webSkillApi-D5VMUnrv.js";
|
|
11
|
-
import { A as frameSteps, D as SCROLL_DIRECTIONS, E as toActionFrameScopes, O as toFrameScopes, _ as defersImage, a as columnWidthToPixels, b as isPdfTextTrustworthy, f as readImageSize, k as frameLabel, l as parseCellAddress, n as EMU_PER_POINT, o as fitWithin, p as PDF_LARGE_IMAGE_RATIO, r as EMU_PER_TWIP$1, s as formatCellAddress, t as EMU_PER_PIXEL, u as parseCellRange, v as takesImage } from "./geometry-CRhuySKV.js";
|
|
11
|
+
import { A as frameSteps, D as SCROLL_DIRECTIONS, E as toActionFrameScopes, O as toFrameScopes, _ as defersImage, a as columnWidthToPixels, b as isPdfTextTrustworthy, c as isRangeTopLeft, d as rangeContains, f as readImageSize, k as frameLabel, l as parseCellAddress, n as EMU_PER_POINT, o as fitWithin, p as PDF_LARGE_IMAGE_RATIO, r as EMU_PER_TWIP$1, s as formatCellAddress, t as EMU_PER_PIXEL, u as parseCellRange, v as takesImage } from "./geometry-CRhuySKV.js";
|
|
12
12
|
import { zipSync } from "fflate";
|
|
13
13
|
|
|
14
14
|
//#region ../browser/src/fs/featureDetection.ts
|
|
@@ -7092,6 +7092,156 @@ function formulaTextOf(cell, hosts) {
|
|
|
7092
7092
|
if (host === void 0 || address === null) return "";
|
|
7093
7093
|
return offsetFormulaRows(host.body, parseCellAddress(address).row - host.row);
|
|
7094
7094
|
}
|
|
7095
|
+
const hasFormula = (cell) => [...cell.children].some((child) => child.localName === "f");
|
|
7096
|
+
const rangeLabel = (start, end) => start.column === end.column && start.row === end.row ? formatCellAddress(start) : `${formatCellAddress(start)}:${formatCellAddress(end)}`;
|
|
7097
|
+
function mergeRangesOf(doc) {
|
|
7098
|
+
const ranges = [];
|
|
7099
|
+
for (const merge of byTag$1(doc, "mergeCell")) {
|
|
7100
|
+
const ref = merge.getAttribute("ref");
|
|
7101
|
+
if (ref !== null && ref !== "") ranges.push(parseCellRange(ref));
|
|
7102
|
+
}
|
|
7103
|
+
return ranges;
|
|
7104
|
+
}
|
|
7105
|
+
/**
|
|
7106
|
+
* 合并区里除左上角之外的部分(FR-17.4 · 设计 18 §2.3)。
|
|
7107
|
+
*
|
|
7108
|
+
* 报的是「写了没用的格」,不是「这里有块合并、请你自己排除左上角」——
|
|
7109
|
+
* 后者等于把区间算术外包给概率。挖掉左上角一格,剩下的总能切成
|
|
7110
|
+
* 最多两个矩形:右边一条 + 下面一块。
|
|
7111
|
+
*/
|
|
7112
|
+
function coveredRangesOf(merges) {
|
|
7113
|
+
const out = [];
|
|
7114
|
+
for (const { start, end } of merges) {
|
|
7115
|
+
if (end.column > start.column) out.push(rangeLabel({
|
|
7116
|
+
column: start.column + 1,
|
|
7117
|
+
row: start.row
|
|
7118
|
+
}, {
|
|
7119
|
+
column: end.column,
|
|
7120
|
+
row: start.row
|
|
7121
|
+
}));
|
|
7122
|
+
if (end.row > start.row) out.push(rangeLabel({
|
|
7123
|
+
column: start.column,
|
|
7124
|
+
row: start.row + 1
|
|
7125
|
+
}, end));
|
|
7126
|
+
}
|
|
7127
|
+
return out;
|
|
7128
|
+
}
|
|
7129
|
+
/**
|
|
7130
|
+
* 待填格:XML 里存在这个 `<c>`、没值、没公式、且不是合并区从属格(设计 18 §2.1)。
|
|
7131
|
+
*
|
|
7132
|
+
* 「XML 里存在」是刻意的收窄:模板作者刷过格式的格才会被写进文件,
|
|
7133
|
+
* 那个 `<c>` 就是他留下的坑位记号。把从没出现过的格也算进来,
|
|
7134
|
+
* 两百列的噪声会淹掉真正的那一列。
|
|
7135
|
+
*/
|
|
7136
|
+
function blankAddressesOf(doc, shared, merges) {
|
|
7137
|
+
const out = [];
|
|
7138
|
+
for (const cell of byTag$1(doc, "c")) {
|
|
7139
|
+
const address = cell.getAttribute("r");
|
|
7140
|
+
if (address === null || cellText(cell, shared) !== "" || hasFormula(cell)) continue;
|
|
7141
|
+
const parsed = parseCellAddress(address);
|
|
7142
|
+
if (merges.some((range) => rangeContains(range, parsed) && !isRangeTopLeft(range, parsed))) continue;
|
|
7143
|
+
out.push(parsed);
|
|
7144
|
+
}
|
|
7145
|
+
return out;
|
|
7146
|
+
}
|
|
7147
|
+
/**
|
|
7148
|
+
* 把散落的格压成矩形区间(FR-17.3 · 设计 18 §3)。
|
|
7149
|
+
*
|
|
7150
|
+
* 两趟:先同列纵向合并连续行,再把行范围**完全相同**的相邻列横向合并。
|
|
7151
|
+
* 行范围差一格就不合——宁可多报一条区间,也不能报出一个覆盖了非待填格的矩形,
|
|
7152
|
+
* 那会把模型引向一个写不进去的地址。
|
|
7153
|
+
*/
|
|
7154
|
+
function compressToRanges(addresses) {
|
|
7155
|
+
const byColumn = /* @__PURE__ */ new Map();
|
|
7156
|
+
for (const { column, row } of addresses) {
|
|
7157
|
+
const rows = byColumn.get(column);
|
|
7158
|
+
if (rows === void 0) byColumn.set(column, [row]);
|
|
7159
|
+
else rows.push(row);
|
|
7160
|
+
}
|
|
7161
|
+
const strips = [];
|
|
7162
|
+
for (const [column, rows] of [...byColumn].sort(([a], [b]) => a - b)) {
|
|
7163
|
+
const [head, ...rest] = [...new Set(rows)].sort((a, b) => a - b);
|
|
7164
|
+
if (head === void 0) continue;
|
|
7165
|
+
let from = head;
|
|
7166
|
+
let to = head;
|
|
7167
|
+
for (const row of rest) {
|
|
7168
|
+
if (row === to + 1) {
|
|
7169
|
+
to = row;
|
|
7170
|
+
continue;
|
|
7171
|
+
}
|
|
7172
|
+
strips.push({
|
|
7173
|
+
column,
|
|
7174
|
+
from,
|
|
7175
|
+
to
|
|
7176
|
+
});
|
|
7177
|
+
from = row;
|
|
7178
|
+
to = row;
|
|
7179
|
+
}
|
|
7180
|
+
strips.push({
|
|
7181
|
+
column,
|
|
7182
|
+
from,
|
|
7183
|
+
to
|
|
7184
|
+
});
|
|
7185
|
+
}
|
|
7186
|
+
const blocks = [];
|
|
7187
|
+
for (const strip of strips) {
|
|
7188
|
+
const left = blocks.find((block) => block.last === strip.column - 1 && block.from === strip.from && block.to === strip.to);
|
|
7189
|
+
if (left === void 0) blocks.push({
|
|
7190
|
+
first: strip.column,
|
|
7191
|
+
last: strip.column,
|
|
7192
|
+
from: strip.from,
|
|
7193
|
+
to: strip.to
|
|
7194
|
+
});
|
|
7195
|
+
else left.last = strip.column;
|
|
7196
|
+
}
|
|
7197
|
+
return blocks.map((block) => rangeLabel({
|
|
7198
|
+
column: block.first,
|
|
7199
|
+
row: block.from
|
|
7200
|
+
}, {
|
|
7201
|
+
column: block.last,
|
|
7202
|
+
row: block.to
|
|
7203
|
+
}));
|
|
7204
|
+
}
|
|
7205
|
+
/** dimension 的列跨度,用来判一条合并区是不是「横跨整表宽」 */
|
|
7206
|
+
function sheetColumnSpan(doc) {
|
|
7207
|
+
const ref = byTag$1(doc, "dimension")[0]?.getAttribute("ref");
|
|
7208
|
+
if (ref === null || ref === void 0 || ref === "") return void 0;
|
|
7209
|
+
const { start, end } = parseCellRange(ref);
|
|
7210
|
+
return {
|
|
7211
|
+
first: start.column,
|
|
7212
|
+
last: end.column
|
|
7213
|
+
};
|
|
7214
|
+
}
|
|
7215
|
+
/**
|
|
7216
|
+
* 表头行(FR-17.5 · 设计 18 §2.4)。
|
|
7217
|
+
*
|
|
7218
|
+
* 自上而下扫,遇到数据就停。区分表头与表尾的信号是「在不在数据之前」,
|
|
7219
|
+
* 不是「有没有合并」——表尾的照片粘贴区同样横跨整表宽,
|
|
7220
|
+
* 照「全宽合并即表头」去判,会把整张明细区一起卷进表头。
|
|
7221
|
+
*
|
|
7222
|
+
* 判据是启发式的(表头里写了年份会提前停),所以它只用于警示,不用于硬挡。
|
|
7223
|
+
*/
|
|
7224
|
+
function headerRowsOf(doc, merges) {
|
|
7225
|
+
const span = sheetColumnSpan(doc);
|
|
7226
|
+
const fullWidth = /* @__PURE__ */ new Set();
|
|
7227
|
+
for (const range of merges) {
|
|
7228
|
+
if (span === void 0 || range.start.column !== span.first || range.end.column !== span.last) continue;
|
|
7229
|
+
for (let row = range.start.row; row <= range.end.row; row += 1) fullWidth.add(row);
|
|
7230
|
+
}
|
|
7231
|
+
const header = [];
|
|
7232
|
+
for (const row of rowsOf(doc)) {
|
|
7233
|
+
const number = rowNumberOf(row);
|
|
7234
|
+
if (!Number.isInteger(number)) break;
|
|
7235
|
+
const cells = byTag$1(row, "c");
|
|
7236
|
+
if (cells.some(hasFormula)) break;
|
|
7237
|
+
if (cells.some((cell) => {
|
|
7238
|
+
const type = cell.getAttribute("t");
|
|
7239
|
+
return (type === null || type === "n") && byTag$1(cell, "v").length > 0;
|
|
7240
|
+
}) && !fullWidth.has(number - 1)) break;
|
|
7241
|
+
header.push(number);
|
|
7242
|
+
}
|
|
7243
|
+
return header;
|
|
7244
|
+
}
|
|
7095
7245
|
/** 读带坐标的骨架(FR-42.1)。模型据此决定往哪儿写。 */
|
|
7096
7246
|
async function readXlsxTemplate(bytes) {
|
|
7097
7247
|
const pkg = await readOoxmlPackage(bytes);
|
|
@@ -7124,12 +7274,19 @@ async function readXlsxTemplate(bytes) {
|
|
|
7124
7274
|
if (!Number.isInteger(min) || !Number.isInteger(max) || !Number.isFinite(width)) continue;
|
|
7125
7275
|
for (let index = min; index <= max; index += 1) columnWidths[index - 1] = width;
|
|
7126
7276
|
}
|
|
7277
|
+
const merges = mergeRangesOf(doc);
|
|
7278
|
+
const blanks = compressToRanges(blankAddressesOf(doc, shared, merges));
|
|
7279
|
+
const covered = coveredRangesOf(merges);
|
|
7280
|
+
const headerRows = headerRowsOf(doc, merges);
|
|
7127
7281
|
sheets.push({
|
|
7128
7282
|
name: entry.name,
|
|
7129
7283
|
range: byTag$1(doc, "dimension")[0]?.getAttribute("ref") ?? "",
|
|
7130
7284
|
cells,
|
|
7131
7285
|
merges: byTag$1(doc, "mergeCell").map((merge) => merge.getAttribute("ref")).filter((ref) => ref !== null),
|
|
7132
|
-
columnWidths
|
|
7286
|
+
columnWidths,
|
|
7287
|
+
...blanks.length > 0 ? { blanks } : {},
|
|
7288
|
+
...covered.length > 0 ? { covered } : {},
|
|
7289
|
+
...headerRows.length > 0 ? { headerRows } : {}
|
|
7133
7290
|
});
|
|
7134
7291
|
}
|
|
7135
7292
|
return { sheets };
|
|
@@ -7290,24 +7447,51 @@ function growFormulaRanges(formula, at, count) {
|
|
|
7290
7447
|
});
|
|
7291
7448
|
}
|
|
7292
7449
|
/**
|
|
7293
|
-
*
|
|
7450
|
+
* 往一个格里写值(FR-42.5)。数字写成数字,其余写成文本,不做类型推断(FR-42.26)。
|
|
7294
7451
|
*
|
|
7295
7452
|
* 用 `inlineStr` 而不是往共享串表追加:改动的数据部件从两个降到一个(设计 43 §1.4)。
|
|
7296
7453
|
* 单元格有三种形态(空壳 / 带值 / 不存在),三支都显式处理——静默跳过正是 FR-42.6 要禁的。
|
|
7297
7454
|
*
|
|
7298
|
-
*
|
|
7455
|
+
* 撞上护栏**不抛**,回报(0.24.0 FR-17.8):模型一次写四十格、其中一格撞上公式,
|
|
7456
|
+
* 另外三十九格不该跟着消失。地址本身非法仍然抛——那不是「这格填不得」,
|
|
7457
|
+
* 是给出的字符串根本不是地址,放过去只会让同一个错误重复四十次。
|
|
7458
|
+
*
|
|
7459
|
+
* @throws WebSkillError 地址语法不合法
|
|
7299
7460
|
*/
|
|
7300
|
-
function fillCell(doc, address, value) {
|
|
7461
|
+
function fillCell(doc, address, value, guards) {
|
|
7301
7462
|
const parsed = parseCellAddress(address);
|
|
7302
7463
|
const normalized = formatCellAddress(parsed);
|
|
7464
|
+
const covering = guards.merges.find((range) => rangeContains(range, parsed) && !isRangeTopLeft(range, parsed));
|
|
7465
|
+
if (covering !== void 0) return {
|
|
7466
|
+
ok: false,
|
|
7467
|
+
address: normalized,
|
|
7468
|
+
code: "TEMPLATE_CELL_IS_COVERED",
|
|
7469
|
+
reason: `Cell ${normalized} is covered by the merged region ${rangeLabel(covering.start, covering.end)}, so anything written there is never displayed. Write ${formatCellAddress(covering.start)} instead.`
|
|
7470
|
+
};
|
|
7303
7471
|
const row = rowsOf(doc).find((candidate) => rowNumberOf(candidate) === parsed.row + 1) ?? createRow(doc, parsed.row + 1);
|
|
7304
7472
|
let cell = byTag$1(row, "c").find((candidate) => candidate.getAttribute("r") === normalized);
|
|
7305
7473
|
if (cell === void 0) cell = createCell(doc, row, parsed.column, normalized);
|
|
7306
7474
|
const formula = [...cell.children].find((child) => child.localName === "f");
|
|
7307
7475
|
if (formula !== void 0) {
|
|
7308
7476
|
const body = formula.textContent ?? "";
|
|
7309
|
-
|
|
7477
|
+
return {
|
|
7478
|
+
ok: false,
|
|
7479
|
+
address: normalized,
|
|
7480
|
+
code: "TEMPLATE_CELL_IS_FORMULA",
|
|
7481
|
+
reason: `Cell ${normalized} is computed by the template${body === "" ? "" : ` (=${body})`} and must not be overwritten. Fill the cells it reads instead; the template works this one out when the file is opened.`
|
|
7482
|
+
};
|
|
7310
7483
|
}
|
|
7484
|
+
writeCellValue(doc, cell, value);
|
|
7485
|
+
return guards.headerRows.has(parsed.row + 1) ? {
|
|
7486
|
+
ok: true,
|
|
7487
|
+
address: normalized,
|
|
7488
|
+
warning: `Cell ${normalized} sits on row ${parsed.row + 1}, which looks like one of the template's own heading rows. The value was written; make sure the heading was meant to change.`
|
|
7489
|
+
} : {
|
|
7490
|
+
ok: true,
|
|
7491
|
+
address: normalized
|
|
7492
|
+
};
|
|
7493
|
+
}
|
|
7494
|
+
function writeCellValue(doc, cell, value) {
|
|
7311
7495
|
while (cell.firstChild !== null) cell.removeChild(cell.firstChild);
|
|
7312
7496
|
if (value === "") {
|
|
7313
7497
|
cell.removeAttribute("t");
|
|
@@ -7461,10 +7645,15 @@ function addSheetRelationship(pkg, relsPath, type, target) {
|
|
|
7461
7645
|
*
|
|
7462
7646
|
* 顺序是**先插行、后填值**:填值用的地址是插行之后的坐标,反过来会逼模型心算偏移。
|
|
7463
7647
|
*
|
|
7464
|
-
*
|
|
7648
|
+
* 格值写入是**部分应用**(0.24.0 FR-17.8):撞上护栏的逐条记进回执,其余照常落盘。
|
|
7649
|
+
* 插行与图片仍然全或无——插了一半再中止,后面所有地址的行号都偏了,
|
|
7650
|
+
* 「部分应用」在那里没有可理解的语义。
|
|
7651
|
+
*
|
|
7652
|
+
* @throws WebSkillError 模板不是 xlsx、地址不合法、目标不存在、插行越界、或请求的格一条都没写成
|
|
7465
7653
|
*/
|
|
7466
7654
|
async function fillXlsxTemplate(bytes, spec) {
|
|
7467
7655
|
const pkg = await readOoxmlPackage(bytes);
|
|
7656
|
+
const shared = sharedStringsOf(pkg);
|
|
7468
7657
|
const sheets = listSheets(pkg);
|
|
7469
7658
|
const touched = /* @__PURE__ */ new Map();
|
|
7470
7659
|
const partOf = (name) => {
|
|
@@ -7476,14 +7665,49 @@ async function fillXlsxTemplate(bytes, spec) {
|
|
|
7476
7665
|
...cached
|
|
7477
7666
|
};
|
|
7478
7667
|
};
|
|
7668
|
+
const reworked = /* @__PURE__ */ new Map();
|
|
7479
7669
|
for (const insert of spec.rows ?? []) {
|
|
7480
|
-
const { doc } = partOf(insert.sheet);
|
|
7670
|
+
const { entry, doc } = partOf(insert.sheet);
|
|
7481
7671
|
insertRows(pkg, doc, insert);
|
|
7482
|
-
|
|
7672
|
+
reworked.set(entry.path, entry);
|
|
7673
|
+
}
|
|
7674
|
+
const guards = /* @__PURE__ */ new Map();
|
|
7675
|
+
const guardsOf = (path, doc) => {
|
|
7676
|
+
const cached = guards.get(path);
|
|
7677
|
+
if (cached !== void 0) return cached;
|
|
7678
|
+
const merges = mergeRangesOf(doc);
|
|
7679
|
+
const built = {
|
|
7680
|
+
merges,
|
|
7681
|
+
headerRows: new Set(headerRowsOf(doc, merges))
|
|
7682
|
+
};
|
|
7683
|
+
guards.set(path, built);
|
|
7684
|
+
return built;
|
|
7685
|
+
};
|
|
7686
|
+
const rejected = [];
|
|
7687
|
+
const warnings = [];
|
|
7688
|
+
let filled = 0;
|
|
7483
7689
|
for (const fill of spec.cells ?? []) {
|
|
7484
|
-
const { doc } = partOf(fill.sheet);
|
|
7485
|
-
fillCell(doc, fill.address, fill.value);
|
|
7690
|
+
const { entry, doc } = partOf(fill.sheet);
|
|
7691
|
+
const outcome = fillCell(doc, fill.address, fill.value, guardsOf(entry.path, doc));
|
|
7692
|
+
if (!outcome.ok) {
|
|
7693
|
+
rejected.push({
|
|
7694
|
+
sheet: entry.name,
|
|
7695
|
+
address: outcome.address,
|
|
7696
|
+
code: outcome.code,
|
|
7697
|
+
reason: outcome.reason
|
|
7698
|
+
});
|
|
7699
|
+
continue;
|
|
7700
|
+
}
|
|
7701
|
+
filled += 1;
|
|
7702
|
+
reworked.set(entry.path, entry);
|
|
7703
|
+
if (outcome.warning !== void 0) warnings.push({
|
|
7704
|
+
sheet: entry.name,
|
|
7705
|
+
address: outcome.address,
|
|
7706
|
+
reason: outcome.warning
|
|
7707
|
+
});
|
|
7486
7708
|
}
|
|
7709
|
+
const requested = spec.cells?.length ?? 0;
|
|
7710
|
+
if (requested > 0 && filled === 0) throw new WebSkillError("TEMPLATE_FILL_REJECTED", `None of the ${requested} requested cell(s) could be written. ` + rejected.map((entry) => entry.reason).join(" "), { rejected });
|
|
7487
7711
|
const bySheet = /* @__PURE__ */ new Map();
|
|
7488
7712
|
for (const image of spec.images ?? []) {
|
|
7489
7713
|
const { entry } = partOf(image.sheet);
|
|
@@ -7494,11 +7718,27 @@ async function fillXlsxTemplate(bytes, spec) {
|
|
|
7494
7718
|
if (cached === void 0) continue;
|
|
7495
7719
|
attachImages(pkg, cached.doc, path, images, geometryOf(cached.doc));
|
|
7496
7720
|
}
|
|
7721
|
+
const stillBlank = [];
|
|
7722
|
+
for (const [path, entry] of reworked) {
|
|
7723
|
+
const cached = touched.get(path);
|
|
7724
|
+
if (cached === void 0) continue;
|
|
7725
|
+
const ranges = compressToRanges(blankAddressesOf(cached.doc, shared, mergeRangesOf(cached.doc)));
|
|
7726
|
+
if (ranges.length > 0) stillBlank.push({
|
|
7727
|
+
sheet: entry.name,
|
|
7728
|
+
ranges
|
|
7729
|
+
});
|
|
7730
|
+
}
|
|
7497
7731
|
if ([...touched.values()].some(({ doc }) => byTag$1(doc, "f").length > 0)) requestFullCalcOnLoad(pkg);
|
|
7498
7732
|
for (const [path, { declaration, doc }] of touched) pkg.set(path, serializeXmlPart(declaration, doc));
|
|
7499
7733
|
stripMacros(pkg);
|
|
7500
7734
|
assertOoxmlPackage(pkg);
|
|
7501
|
-
return
|
|
7735
|
+
return {
|
|
7736
|
+
bytes: writeOoxmlPackage(pkg),
|
|
7737
|
+
filled,
|
|
7738
|
+
rejected,
|
|
7739
|
+
warnings,
|
|
7740
|
+
stillBlank
|
|
7741
|
+
};
|
|
7502
7742
|
}
|
|
7503
7743
|
/** `<calcPr>` 在 CT_Workbook 的序列里排在这几个之后;追加到末尾会落到 `extLst` 后面,那是不合法的 */
|
|
7504
7744
|
const BEFORE_CALC_PR = [
|
package/dist/governance.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { K as FileSystemProvider, S as UiBridge, _t as SkillDocument, et as Page, f as LlmMessage, ht as SkillCatalogEntry, l as LlmClient, tt as PageQuery, xt as SkillManagerPort } from "./types-CpDRZ0rA-
|
|
2
|
-
import { Wt as RuntimeRun, dn as SkillIntegrityGuard, fn as SkillOutcomeReporter, gn as SkillStateGuard, hr as WebSkillRuntime, tt as IntegrityVerdict } from "./index-
|
|
3
|
-
import { S as candidateToCatalogEntry, _ as SKILL_VERSION_PAGE_SIZE, a as AuditLog, b as SkillVersionPage, c as CandidateBinaryRef, d as CandidateRisk, f as CandidateSkill, g as CompositeApprovalPolicy, h as CandidateStore, i as AuditEvent, l as CandidateFile, m as CandidateStatus, n as ApprovalDecision, o as AuditQueryFilter, p as CandidateSource, r as ApprovalPolicy, s as CANDIDATE_PAGE_SIZE, t as AlwaysHumanApprovalPolicy, u as CandidatePage, v as SkillState, x as SkillVersionStore, y as SkillVersion } from "./skillVersionStore-S4_HJ_Fl-
|
|
1
|
+
import { K as FileSystemProvider, S as UiBridge, _t as SkillDocument, et as Page, f as LlmMessage, ht as SkillCatalogEntry, l as LlmClient, tt as PageQuery, xt as SkillManagerPort } from "./types-CpDRZ0rA-CFQ-vdKz.js";
|
|
2
|
+
import { Wt as RuntimeRun, dn as SkillIntegrityGuard, fn as SkillOutcomeReporter, gn as SkillStateGuard, hr as WebSkillRuntime, tt as IntegrityVerdict } from "./index-Bq299VnF.js";
|
|
3
|
+
import { S as candidateToCatalogEntry, _ as SKILL_VERSION_PAGE_SIZE, a as AuditLog, b as SkillVersionPage, c as CandidateBinaryRef, d as CandidateRisk, f as CandidateSkill, g as CompositeApprovalPolicy, h as CandidateStore, i as AuditEvent, l as CandidateFile, m as CandidateStatus, n as ApprovalDecision, o as AuditQueryFilter, p as CandidateSource, r as ApprovalPolicy, s as CANDIDATE_PAGE_SIZE, t as AlwaysHumanApprovalPolicy, u as CandidatePage, v as SkillState, x as SkillVersionStore, y as SkillVersion } from "./skillVersionStore-S4_HJ_Fl-Ds97pwm5.js";
|
|
4
4
|
//#region ../governance/dist/index.d.ts
|
|
5
5
|
//#region src/candidate/candidateNormalizer.d.ts
|
|
6
6
|
/** 剥 markdown fence 与 <think> 块、截取首尾 {};非对象 → CANDIDATE_INVALID */
|