@stll/folio-cli 0.5.3 → 0.5.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/save.js CHANGED
@@ -325,8 +325,9 @@ const runSaveValues = async (values, positionals, io) => {
325
325
  });
326
326
  };
327
327
  const emit = (io, format, result) => {
328
+ const envelope = result.isOk() ? successEnvelope(result.value) : failureEnvelope(result.error);
328
329
  const rendered = renderEnvelope({
329
- envelope: result.isOk() ? successEnvelope(result.value) : failureEnvelope(result.error),
330
+ envelope,
330
331
  format,
331
332
  tool: EDITOR_SAVE_TOOL
332
333
  });
package/dist/serve.d.ts CHANGED
@@ -1,18 +1,17 @@
1
1
  import { FolioCliError } from "./errors.js";
2
2
  import { Result } from "better-result";
3
3
  //#region src/serve.d.ts
4
- declare const PREVIEW_HOST = "127.0.0.1";
5
- type PreviewServerOptions = {
4
+ export declare const PREVIEW_HOST = "127.0.0.1";
5
+ export type PreviewServerOptions = {
6
6
  documentPath: string;
7
7
  /** 0 picks a free port. */
8
8
  port: number;
9
9
  };
10
- type PreviewServer = {
10
+ export type PreviewServer = {
11
11
  /** The preview URL, token included. */
12
12
  url: string;
13
13
  close: () => Promise<void>;
14
14
  };
15
15
  /** Serve the preview until {@link PreviewServer.close}. */
16
- declare const startPreviewServer: ({ documentPath, port }: PreviewServerOptions) => Promise<Result<PreviewServer, FolioCliError>>;
17
- //#endregion
18
- export { PREVIEW_HOST, PreviewServer, PreviewServerOptions, startPreviewServer };
16
+ export declare const startPreviewServer: ({ documentPath, port }: PreviewServerOptions) => Promise<Result<PreviewServer, FolioCliError>>;
17
+ //#endregion
package/dist/sidecar.d.ts CHANGED
@@ -3,10 +3,10 @@ import { FileIdentity } from "./file-system.js";
3
3
  import { Result } from "better-result";
4
4
  import { FileHandle } from "node:fs/promises";
5
5
  //#region src/sidecar.d.ts
6
- declare const SIDECAR_DIRECTORY = ".folio";
7
- declare const unsafePath: (message: string, hint?: string) => FolioCliError;
6
+ export declare const SIDECAR_DIRECTORY = ".folio";
7
+ export declare const unsafePath: (message: string, hint?: string) => FolioCliError;
8
8
  /** What a path names, without following a final symlink. */
9
- type PathEntry = {
9
+ export type PathEntry = {
10
10
  type: "missing";
11
11
  } | {
12
12
  type: "file";
@@ -19,15 +19,15 @@ type PathEntry = {
19
19
  } | {
20
20
  type: "other";
21
21
  };
22
- declare const inspectPath: (filePath: string) => Promise<Result<PathEntry, FolioCliError>>;
22
+ export declare const inspectPath: (filePath: string) => Promise<Result<PathEntry, FolioCliError>>;
23
23
  /**
24
24
  * `<document directory>/.folio/<segments...>`, each level checked or created
25
25
  * private. The document's own directory is the caller's choice and is not
26
26
  * inspected.
27
27
  */
28
- declare const sidecarDirectory: (documentPath: string, ...segments: readonly string[]) => Promise<Result<string, FolioCliError>>;
28
+ export declare const sidecarDirectory: (documentPath: string, ...segments: readonly string[]) => Promise<Result<string, FolioCliError>>;
29
29
  /** Check the directory a sidecar file lives in; create it only when it is `.folio` itself. */
30
- declare const ensureSidecarParent: (filePath: string) => Promise<Result<void, FolioCliError>>;
30
+ export declare const ensureSidecarParent: (filePath: string) => Promise<Result<void, FolioCliError>>;
31
31
  type OpenedSidecar = {
32
32
  handle: FileHandle;
33
33
  identity: FileIdentity;
@@ -37,16 +37,16 @@ type OpenedSidecar = {
37
37
  * Open a sidecar file without following a final symlink, and refuse it
38
38
  * unless it is a regular file with exactly one link.
39
39
  */
40
- declare const openSidecarFile: (filePath: string, flags: number) => Promise<Result<OpenedSidecar, FolioCliError>>;
40
+ export declare const openSidecarFile: (filePath: string, flags: number) => Promise<Result<OpenedSidecar, FolioCliError>>;
41
41
  /** Read a whole sidecar file through {@link openSidecarFile}. */
42
- declare const readSidecarFile: (filePath: string) => Promise<Result<Uint8Array<ArrayBuffer>, FolioCliError>>;
42
+ export declare const readSidecarFile: (filePath: string) => Promise<Result<Uint8Array<ArrayBuffer>, FolioCliError>>;
43
43
  /** Create a new sidecar file (never an existing one), write it, and flush it to disk. */
44
- declare const writeNewSidecarFile: (filePath: string, bytes: Uint8Array) => Promise<Result<FileIdentity, FolioCliError>>;
44
+ export declare const writeNewSidecarFile: (filePath: string, bytes: Uint8Array) => Promise<Result<FileIdentity, FolioCliError>>;
45
45
  /**
46
46
  * Flush a directory's entries (a create or rename) to disk. Platforms that
47
47
  * cannot open a directory for syncing report nothing; every other failure
48
48
  * is returned.
49
49
  */
50
- declare const syncDirectory: (directory: string) => Promise<Result<void, FolioCliError>>;
50
+ export declare const syncDirectory: (directory: string) => Promise<Result<void, FolioCliError>>;
51
51
  //#endregion
52
- export { PathEntry, SIDECAR_DIRECTORY, ensureSidecarParent, inspectPath, openSidecarFile, readSidecarFile, sidecarDirectory, syncDirectory, unsafePath, writeNewSidecarFile };
52
+ export {};
@@ -6,8 +6,8 @@ import { ChangedPart } from "./package-parts.js";
6
6
  import { Result } from "better-result";
7
7
  //#region src/transaction.d.ts
8
8
  /** Backups kept per document. */
9
- declare const MAX_BACKUPS = 20;
10
- type WriteDestination = {
9
+ export declare const MAX_BACKUPS = 20;
10
+ export type WriteDestination = {
11
11
  type: "inPlace";
12
12
  } | {
13
13
  type: "file";
@@ -17,13 +17,13 @@ type WriteDestination = {
17
17
  expectedVersion: string | undefined;
18
18
  };
19
19
  /** `.folio/backups/<document name>`, created private and never through a symlink. */
20
- declare const backupDirectoryFor: (documentPath: string) => Promise<Result<string, FolioCliError>>;
20
+ export declare const backupDirectoryFor: (documentPath: string) => Promise<Result<string, FolioCliError>>;
21
21
  /**
22
22
  * Keep the newest `keep` backups in one document's backup directory. Only
23
23
  * regular files named `<version>.docx` count; nothing else is touched.
24
24
  */
25
- declare const pruneBackups: (directory: string, keep: number) => Promise<Result<void, FolioCliError>>;
26
- type CommitRequest = {
25
+ export declare const pruneBackups: (directory: string, keep: number) => Promise<Result<void, FolioCliError>>;
26
+ export type CommitRequest = {
27
27
  txId: string;
28
28
  destinationPath: string;
29
29
  destination: WriteDestination;
@@ -41,7 +41,7 @@ type CommitRequest = {
41
41
  /** The receipt returned to the caller; completed with `toVersion` and `backup`. */
42
42
  receipt: Readonly<Record<string, unknown>>;
43
43
  };
44
- type CommitResult = {
44
+ export type CommitResult = {
45
45
  toVersion: string;
46
46
  backup: string | undefined;
47
47
  receipt: Readonly<Record<string, unknown>>;
@@ -51,6 +51,5 @@ type CommitResult = {
51
51
  * changed since it was read, when a new destination already exists, or when
52
52
  * an existing destination is not the version the caller named.
53
53
  */
54
- declare const commitTransaction: (request: CommitRequest) => Promise<Result<CommitResult, FolioCliError>>;
55
- //#endregion
56
- export { CommitRequest, CommitResult, MAX_BACKUPS, WriteDestination, backupDirectoryFor, commitTransaction, pruneBackups };
54
+ export declare const commitTransaction: (request: CommitRequest) => Promise<Result<CommitResult, FolioCliError>>;
55
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stll/folio-cli",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Command line and stdio MCP server for reading, reviewing, and redlining .docx files with folio: tracked-change edits, comments, and comparisons written atomically with version preconditions.",
5
5
  "keywords": [
6
6
  "cli",
@@ -70,19 +70,20 @@
70
70
  "@fontsource/cousine": "^5.2.7",
71
71
  "@fontsource/lato": "^5.2.7",
72
72
  "@fontsource/noto-sans-arabic": "^5.2.7",
73
- "@fontsource/source-sans-3": "^5.2.9",
73
+ "@fontsource/source-sans-3": "^5.3.1",
74
74
  "@fontsource/tinos": "^5.2.7",
75
- "@modelcontextprotocol/server": "2.0.0",
76
- "@stll/agent-input": "0.1.0",
77
- "@stll/folio-agents": "^0.16.3",
78
- "@stll/folio-core": "^0.62.0",
79
- "@stll/utf8-boundaries": "0.1.0",
75
+ "@modelcontextprotocol/server": "2.3.1",
76
+ "@stll/agent-input": "0.1.6",
77
+ "@stll/folio-agents": "^0.16.4",
78
+ "@stll/folio-core": "^0.63.0",
79
+ "@stll/fuzzy-search": "1.2.0",
80
+ "@stll/utf8-boundaries": "0.1.1",
80
81
  "better-result": "3.0.1",
81
- "fast-xml-parser": "^5.10.1",
82
+ "fast-xml-parser": "^5.11.2",
82
83
  "jszip": "3.10.2"
83
84
  },
84
85
  "devDependencies": {
85
- "@modelcontextprotocol/client": "2.2.0",
86
+ "@modelcontextprotocol/client": "2.3.1",
86
87
  "playwright-core": "1.61.1"
87
88
  },
88
89
  "peerDependencies": {