@wordinweb/agent 0.2.3 → 0.2.4

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/cli.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  isSuggestable,
8
8
  isSuggestableTableOp,
9
9
  stretchShareCode
10
- } from "./chunk-RQ74KQML.js";
10
+ } from "./chunk-JK7OGOJB.js";
11
11
 
12
12
  // src/cli.ts
13
13
  import { webcrypto } from "crypto";
package/dist/index.d.ts CHANGED
@@ -1265,6 +1265,8 @@ declare class Package {
1265
1265
  private files;
1266
1266
  constructor(data: Uint8Array);
1267
1267
  static from(data: ArrayBuffer | Uint8Array): Package;
1268
+ /** A package over an already-unzipped entry map (DocxDocument.clone). */
1269
+ static fromFiles(files: Record<string, Uint8Array>): Package;
1268
1270
  has(name: string): boolean;
1269
1271
  binary(name: string): Uint8Array | undefined;
1270
1272
  text(name: string): string | undefined;
@@ -1850,6 +1852,8 @@ declare class DocxDocument {
1850
1852
  /** The header part roots, in package order. A watermark is authored into
1851
1853
  * every one of them: Word paints it on every page, and a document with a
1852
1854
  * first-page or even-page header has more than one header part. */
1855
+ /** The root of the header or footer part at `target`, if this document has one. */
1856
+ headerFooterRoot(target: string): XmlElement | undefined;
1853
1857
  headerRoots(): XmlElement[];
1854
1858
  /** The footer part roots, in package order — headerRoots' counterpart, for
1855
1859
  * operations that walk both bands (the page-number gallery's removal
@@ -1902,6 +1906,13 @@ declare class DocxDocument {
1902
1906
  private journalSetAttr;
1903
1907
  private normalizePercentageTableGrids;
1904
1908
  save(): Uint8Array;
1909
+ /**
1910
+ * An independent copy: what `DocxDocument.load(doc.save())` gives, without
1911
+ * zipping the package and unzipping it again. compareDocuments starts from a
1912
+ * copy of the revised document, and the round trip through the zip was a
1913
+ * third of its time on a document that had not changed at all.
1914
+ */
1915
+ clone(): DocxDocument;
1905
1916
  saveAsync(): Promise<Uint8Array>;
1906
1917
  private buildPackage;
1907
1918
  private buildPackageFiles;
@@ -1942,9 +1953,31 @@ declare class DocxDocument {
1942
1953
  */
1943
1954
  private ensureRelsRoot;
1944
1955
  /** Register an external hyperlink relationship and return its rId. */
1945
- addHyperlinkRel(url: string): string;
1956
+ /**
1957
+ * Copy the part that `source`'s main-document relationship `relId` points
1958
+ * at into this package, with every part it references in turn (a chart's
1959
+ * embedded workbook, SmartArt's layout, style and colour parts) and their
1960
+ * content types, and add a relationship to it. Returns the new
1961
+ * relationship id, or null when the source has no such internal part.
1962
+ *
1963
+ * compareDocuments needs this for struck content: a removed picture keeps
1964
+ * its w:drawing, and without its image part the result's reject-all
1965
+ * brought the picture back as an empty frame.
1966
+ */
1967
+ adoptRelFrom(source: DocxDocument, relId: string, scope?: {
1968
+ from?: string | null;
1969
+ into?: string | null;
1970
+ }): string | null;
1971
+ /** Give a part copied from `source` the content type it had there. */
1972
+ private adoptContentType;
1973
+ addHyperlinkRel(url: string, ownerPart?: string | null): string;
1946
1974
  /** Retarget an existing external relationship (hyperlink href edit). */
1947
1975
  setRelTarget(relId: string, url: string): boolean;
1976
+ /** The relationships owned by `part` (a header or footer part), or by the
1977
+ * document part when null; a header or footer gets a rels root on demand. */
1978
+ private relsOwnerOf;
1979
+ /** The relationships of `part` (a header or footer), or of the document part. */
1980
+ relationshipsOf(part?: string | null): Relationships;
1948
1981
  /** The relationships of the part that holds `source`: a header or footer
1949
1982
  * part when the element is inside one, else the document part. */
1950
1983
  private imageRelsOwner;
package/dist/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  validateAgentComposeRequest,
18
18
  validateAgentOperationShape,
19
19
  validateIntent
20
- } from "./chunk-RQ74KQML.js";
20
+ } from "./chunk-JK7OGOJB.js";
21
21
 
22
22
  // src/session.ts
23
23
  var LocalDocumentSession = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordinweb/agent",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Complete, schema-enforced DOCX creation, inspection, and editing tools for AI agents",
5
5
  "license": "MIT",
6
6
  "repository": {