@wordinweb/agent 0.2.3 → 0.2.5

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-QDZRRLHW.js";
11
11
 
12
12
  // src/cli.ts
13
13
  import { webcrypto } from "crypto";
package/dist/index.d.ts CHANGED
@@ -942,6 +942,11 @@ interface Paragraph {
942
942
  /** Final revision view: the paragraph mark AND all content are tracked
943
943
  * deletions — the paragraph does not exist (no line, no numbering). */
944
944
  revisionHidden?: boolean;
945
+ /** Markup view: the paragraph mark itself is a tracked insertion or
946
+ * deletion (a suggested line break, or a suggested merge). Layout draws it
947
+ * as a pilcrow in the revision's colors after the paragraph's content; it is
948
+ * not text, so find, word count and the like never see it. */
949
+ markRevision?: "ins" | "del";
945
950
  /** Source w:p element. */
946
951
  src?: XmlElement;
947
952
  }
@@ -1265,6 +1270,8 @@ declare class Package {
1265
1270
  private files;
1266
1271
  constructor(data: Uint8Array);
1267
1272
  static from(data: ArrayBuffer | Uint8Array): Package;
1273
+ /** A package over an already-unzipped entry map (DocxDocument.clone). */
1274
+ static fromFiles(files: Record<string, Uint8Array>): Package;
1268
1275
  has(name: string): boolean;
1269
1276
  binary(name: string): Uint8Array | undefined;
1270
1277
  text(name: string): string | undefined;
@@ -1850,6 +1857,8 @@ declare class DocxDocument {
1850
1857
  /** The header part roots, in package order. A watermark is authored into
1851
1858
  * every one of them: Word paints it on every page, and a document with a
1852
1859
  * first-page or even-page header has more than one header part. */
1860
+ /** The root of the header or footer part at `target`, if this document has one. */
1861
+ headerFooterRoot(target: string): XmlElement | undefined;
1853
1862
  headerRoots(): XmlElement[];
1854
1863
  /** The footer part roots, in package order — headerRoots' counterpart, for
1855
1864
  * operations that walk both bands (the page-number gallery's removal
@@ -1902,6 +1911,13 @@ declare class DocxDocument {
1902
1911
  private journalSetAttr;
1903
1912
  private normalizePercentageTableGrids;
1904
1913
  save(): Uint8Array;
1914
+ /**
1915
+ * An independent copy: what `DocxDocument.load(doc.save())` gives, without
1916
+ * zipping the package and unzipping it again. compareDocuments starts from a
1917
+ * copy of the revised document, and the round trip through the zip was a
1918
+ * third of its time on a document that had not changed at all.
1919
+ */
1920
+ clone(): DocxDocument;
1905
1921
  saveAsync(): Promise<Uint8Array>;
1906
1922
  private buildPackage;
1907
1923
  private buildPackageFiles;
@@ -1942,9 +1958,31 @@ declare class DocxDocument {
1942
1958
  */
1943
1959
  private ensureRelsRoot;
1944
1960
  /** Register an external hyperlink relationship and return its rId. */
1945
- addHyperlinkRel(url: string): string;
1961
+ /**
1962
+ * Copy the part that `source`'s main-document relationship `relId` points
1963
+ * at into this package, with every part it references in turn (a chart's
1964
+ * embedded workbook, SmartArt's layout, style and colour parts) and their
1965
+ * content types, and add a relationship to it. Returns the new
1966
+ * relationship id, or null when the source has no such internal part.
1967
+ *
1968
+ * compareDocuments needs this for struck content: a removed picture keeps
1969
+ * its w:drawing, and without its image part the result's reject-all
1970
+ * brought the picture back as an empty frame.
1971
+ */
1972
+ adoptRelFrom(source: DocxDocument, relId: string, scope?: {
1973
+ from?: string | null;
1974
+ into?: string | null;
1975
+ }): string | null;
1976
+ /** Give a part copied from `source` the content type it had there. */
1977
+ private adoptContentType;
1978
+ addHyperlinkRel(url: string, ownerPart?: string | null): string;
1946
1979
  /** Retarget an existing external relationship (hyperlink href edit). */
1947
1980
  setRelTarget(relId: string, url: string): boolean;
1981
+ /** The relationships owned by `part` (a header or footer part), or by the
1982
+ * document part when null; a header or footer gets a rels root on demand. */
1983
+ private relsOwnerOf;
1984
+ /** The relationships of `part` (a header or footer), or of the document part. */
1985
+ relationshipsOf(part?: string | null): Relationships;
1948
1986
  /** The relationships of the part that holds `source`: a header or footer
1949
1987
  * part when the element is inside one, else the document part. */
1950
1988
  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-QDZRRLHW.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.5",
4
4
  "description": "Complete, schema-enforced DOCX creation, inspection, and editing tools for AI agents",
5
5
  "license": "MIT",
6
6
  "repository": {