@powerhousedao/shared 6.2.3-dev.49 → 6.2.3-dev.50

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.
Files changed (43) hide show
  1. package/dist/clis/args/common-BXabdhiO.mjs.map +1 -1
  2. package/dist/clis/args/dist-CorQTQL-.mjs +1533 -0
  3. package/dist/clis/args/dist-CorQTQL-.mjs.map +1 -0
  4. package/dist/clis/args/vetra-ports.test.mjs +10867 -9334
  5. package/dist/clis/args/vetra-ports.test.mjs.map +1 -1
  6. package/dist/clis/build-pieces.d.mts +1 -1
  7. package/dist/clis/constants.d.mts +1 -1
  8. package/dist/clis/constants.mjs +2 -2
  9. package/dist/clis/constants.mjs.map +1 -1
  10. package/dist/clis/index.d.mts +2 -2
  11. package/dist/clis/index.mjs +2 -2
  12. package/dist/clis/index.mjs.map +1 -1
  13. package/dist/clis/{types-DM26OWlT.d.mts → types-Cc_rB0Yx.d.mts} +3 -3
  14. package/dist/clis/{types-DM26OWlT.d.mts.map → types-Cc_rB0Yx.d.mts.map} +1 -1
  15. package/dist/connect/config-loader.d.ts +1 -1
  16. package/dist/connect/index.d.ts +1 -1
  17. package/dist/document-drive/index.d.ts +3 -3
  18. package/dist/document-model/errors.d.ts +3 -0
  19. package/dist/document-model/errors.js +152 -0
  20. package/dist/document-model/errors.js.map +1 -0
  21. package/dist/document-model/index.d.ts +2 -1
  22. package/dist/document-model/index.js +2 -160
  23. package/dist/document-model/index.js.map +1 -1
  24. package/dist/document-model/version.d.ts +3 -0
  25. package/dist/document-model/version.js +8 -0
  26. package/dist/document-model/version.js.map +1 -0
  27. package/dist/{index-DdXp-CVw.d.ts → index-BhqNGLu9.d.ts} +2 -2
  28. package/dist/{index-DdXp-CVw.d.ts.map → index-BhqNGLu9.d.ts.map} +1 -1
  29. package/dist/index.d.ts +3 -3
  30. package/dist/processors/index.d.ts +1 -1
  31. package/dist/registry/index.d.ts +2 -2
  32. package/dist/registry/index.js.map +1 -1
  33. package/dist/registry/manifest-slim.d.ts +2 -2
  34. package/dist/{types-CFbd2nan.d.ts → types-BRJfX8ck.d.ts} +2 -11
  35. package/dist/types-BRJfX8ck.d.ts.map +1 -0
  36. package/dist/{types-B11NGQOQ.d.ts → types-BTfv_ZzS.d.ts} +2 -2
  37. package/dist/{types-B11NGQOQ.d.ts.map → types-BTfv_ZzS.d.ts.map} +1 -1
  38. package/dist/version-BxLITo9P.d.ts +6 -0
  39. package/dist/version-BxLITo9P.d.ts.map +1 -0
  40. package/package.json +2 -2
  41. package/dist/clis/args/magic-string.es-BWtG0AyA.mjs +0 -1019
  42. package/dist/clis/args/magic-string.es-BWtG0AyA.mjs.map +0 -1
  43. package/dist/types-CFbd2nan.d.ts.map +0 -1
@@ -160,7 +160,7 @@ declare const externalDevDependencies: {
160
160
  readonly "@types/react": "^19.2.3";
161
161
  readonly "@types/react-dom": "^19.2.3";
162
162
  readonly "@vitejs/plugin-react": "^6.0.1";
163
- readonly "@vitest/coverage-v8": "4.1.1";
163
+ readonly "@vitest/coverage-v8": "5.0.3";
164
164
  readonly oxfmt: "0.68.0";
165
165
  readonly oxlint: "1.70.0";
166
166
  readonly "oxlint-tsgolint": "0.23.0";
@@ -168,7 +168,7 @@ declare const externalDevDependencies: {
168
168
  readonly typescript: "~7.0.2";
169
169
  readonly vite: "^8.0.10";
170
170
  readonly "vite-tsconfig-paths": "6.1.1";
171
- readonly vitest: "4.1.1";
171
+ readonly vitest: "5.0.3";
172
172
  };
173
173
  declare const defaultManifest: Manifest;
174
174
  declare const DEFAULT_CONFIG: PowerhouseConfig;
@@ -538,4 +538,4 @@ type Manifest = z.infer<typeof ManifestSchema>;
538
538
  //#endregion
539
539
  export { PIECES_FRAMEWORK_PACKAGE as A, VERSIONED_DEPENDENCIES as B, LEGACY_LINT_FORMAT_FILES as C, PH_BIN as D, PEER_EXTERNAL_DEPENDENCIES as E, PROJECT_PORT_BAND_SWITCHBOARD as F, externalDevDependencies as G, VERSIONED_PEER_DEPENDENCIES as H, PROJECT_PORT_BAND_VETRA_CONNECT as I, packageJsonExports as K, REACTOR_API_PACKAGE as L, POWERHOUSE_GLOBAL_DIR as M, PROJECT_PORT_BAND_SIZE as N, PH_GLOBAL_DIR_NAME as O, PROJECT_PORT_BAND_STUDIO as P, SECONDS_IN_DAY as R, LEGACY_LINT_FORMAT_DEPENDENCIES as S, MINIMUM_NODE_VERSION as T, defaultManifest as U, VERSIONED_DEV_DEPENDENCIES as V, externalDependencies as W, DRIVES_PRESERVE_STRATEGIES as _, DEFAULT_CONFIG as a, GRAPHQL_TAG_PACKAGE as b, DEFAULT_CONNECT_STUDIO_PORT as c, DEFAULT_REGISTRY_URL as d, DEFAULT_RENOWN_URL as f, DEFAULT_VETRA_DRIVE_ID as g, DEFAULT_VETRA_CONNECT_PORT as h, BOILERPLATE_DEPENDENCY_OVERRIDES as i, POWERHOUSE_CONFIG_FILE as j, PH_GLOBAL_PROJECT_NAME as k, DEFAULT_EXPIRY_DAYS as l, DEFAULT_TIMEOUT as m, ANALYTICS_ENGINE_CORE_PACKAGE as n, DEFAULT_CONNECT_OUTDIR as o, DEFAULT_SWITCHBOARD_PORT as p, packageScripts as q, BOILERPLATE_ALLOWED_BUILDS as r, DEFAULT_CONNECT_PREVIEW_PORT as s, Manifest as t, DEFAULT_EXPIRY_SECONDS as u, FEATURE_DEPENDENCIES as v, LOG_LEVELS as w, HOME_DIR as x, GRAPHQL_PACKAGE as y, SERVICE_ACTIONS as z };
540
540
  export {};
541
- //# sourceMappingURL=types-DM26OWlT.d.mts.map
541
+ //# sourceMappingURL=types-Cc_rB0Yx.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-DM26OWlT.d.mts","names":[],"sources":["../../clis/constants.ts","../../clis/types.ts","../../document-model/schemas.ts","../../document-model/types.ts"],"mappings":";;;;;;;cAKa;cAQA;cACA;cACA;cAEA;cAKA;cAQA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAqBA;cACA;cACA;cACA;cAEA;cAEA;cACA;cACA;cACA;cAEA;cAEA;cAEA;cAGA;cAOA;cACA;cAEA;cACA;cACA;cAQA;;aACU;aAAa;;;aACT;aAAY;;;aAC5B;aAAa;;;aACP;aAAa;;;aACrB;aAAY;;;cAKR;;aAET;aACA;aACA;;;aAKA;aACA;aACA;;;cAWS;cAUA;cAiBA;WACC;WACN;WACI;;cAGC;cAQA;WACX;aACE;aACA;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAKF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;WACA;;cAGW;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WAEA;;cAIW;cAIA;cAcA;cAwBA;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;cAGW,iBAAiB;cAuBjB,gBAAgB;;;KCxUjB,iCAAiC;KACjC,wBAAwB;KACxB,mBAAmB;KACnB,WAAW;KAOX;KAGA;EACV;EACA;EACA,WAAW;EACX;;KAGU;EACV;EACA;;KAGU;EACV;EACA;EACA;;KAGU;;EAEV;;EAEA;EACA;EACA;;EAEA;;KAGU,wBACR,8BACA;KAEQ;EACV;EACA;EACA;;KAGU;EACV,SAAS;EACT,QAAQ;;KAGE;EACV;EACA,gBAAgB;EAChB,mBAAmB;EACnB,WAAW;;KAGD;EACV;EACA;EACA;EAGA;EAKA;;KAGU;;EAEV;;KAGU;EACV;;EAEA;;KAGU;;EAEV;;EAEA;;KAGU;;EAEV;;EAEA;;EAEA;;KAGU;EACV,UAAU;EACV,QAAQ;;KAGE;EACV;EACA;EACA;;EAEA;;EAEA;;EAEA,WAAW;;KAGD;;EAEV;;EAEA;;EAEA;;KAGU;;EAEV;;EAEA;;EAEA;;EAEA;;KAGU;EACV;EACA;;;;KAKU;;EAEV;;EAEA;;EAEA;;EAEA;;KAGU;EACV,eAAe;;EAEf;;EAEA;;;;;;;;;;KAWU;EAEN;EAAgB;;KAEV;;KAQA;EACV,YAAY;EACZ,SAAS;EACT;EACA;IACE;;;IAGA;IACA;MAAe;MAAqB;;IACpC;MACE;MACA,UAAU;;;;KAKJ;EACV;EACA;EACA;EACA;;;;;;;;;KAUU;;EAEV,QAAQ;;EAER,QAAQ;EACR;;;KAIU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;;EAER,gBAAgB;;EAEhB;IACE;;;;;EASF;;;;;;;;;;;;KAaU;EACV,WAAW;;EAEX;;EAEA;;EAEA;;EAEA,iBAAiB;;EAEjB,2BAA2B;;KAGjB;EACV,WAAW;EACX,MAAM;EACN,KAAK;EACL,WAAW;EACX,SAAS;EACT,SAAS;EACT,SAAS;EACT,YAAY;EACZ,WAAW;EACX,UAAU;EACV,MAAM;;;KAII;;;EAGV;;EAEA;;EAEA;;KAGU;EAEV,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;IACE;IACA;MAIM;MACA;;IAEN;MACE;MACA;MACA;;;EAGJ;IACE;IACA;IACA,SAAS;;EAEX;IACE;MACE;;IAEF;;EAEF;IACE;IACA;IACA;IACA;;EAEF,WAAW;EACX;IACE;IACA;IACA;;EAIF;IACE;;EAEF;EACA,UAAU;;;;cC6eC,gBAAc,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBzB,EAAA,KAAA;;;KC+0BU,WAAW,EAAE,aAAa"}
1
+ {"version":3,"file":"types-Cc_rB0Yx.d.mts","names":[],"sources":["../../clis/constants.ts","../../clis/types.ts","../../document-model/schemas.ts","../../document-model/types.ts"],"mappings":";;;;;;;cAKa;cAQA;cACA;cACA;cAEA;cAKA;cAQA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAqBA;cACA;cACA;cACA;cAEA;cAEA;cACA;cACA;cACA;cAEA;cAEA;cAEA;cAGA;cAOA;cACA;cAEA;cACA;cACA;cAQA;;aACU;aAAa;;;aACT;aAAY;;;aAC5B;aAAa;;;aACP;aAAa;;;aACrB;aAAY;;;cAKR;;aAET;aACA;aACA;;;aAKA;aACA;aACA;;;cAWS;cAUA;cAiBA;WACC;WACN;WACI;;cAGC;cAQA;WACX;aACE;aACA;aACA;;WAEF;aACE;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAEF;aACE;aACA;aACA;;WAKF;aACE;aACA;;WAEF;aACE;aACA;;WAEF;WACA;;cAGW;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WAEA;;cAIW;cAIA;cAcA;cAwBA;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;cAGW,iBAAiB;cAuBjB,gBAAgB;;;KCxUjB,iCAAiC;KACjC,wBAAwB;KACxB,mBAAmB;KACnB,WAAW;KAOX;KAGA;EACV;EACA;EACA,WAAW;EACX;;KAGU;EACV;EACA;;KAGU;EACV;EACA;EACA;;KAGU;;EAEV;;EAEA;EACA;EACA;;EAEA;;KAGU,wBACR,8BACA;KAEQ;EACV;EACA;EACA;;KAGU;EACV,SAAS;EACT,QAAQ;;KAGE;EACV;EACA,gBAAgB;EAChB,mBAAmB;EACnB,WAAW;;KAGD;EACV;EACA;EACA;EAGA;EAKA;;KAGU;;EAEV;;KAGU;EACV;;EAEA;;KAGU;;EAEV;;EAEA;;KAGU;;EAEV;;EAEA;;EAEA;;KAGU;EACV,UAAU;EACV,QAAQ;;KAGE;EACV;EACA;EACA;;EAEA;;EAEA;;EAEA,WAAW;;KAGD;;EAEV;;EAEA;;EAEA;;KAGU;;EAEV;;EAEA;;EAEA;;EAEA;;KAGU;EACV;EACA;;;;KAKU;;EAEV;;EAEA;;EAEA;;EAEA;;KAGU;EACV,eAAe;;EAEf;;EAEA;;;;;;;;;;KAWU;EAEN;EAAgB;;KAEV;;KAQA;EACV,YAAY;EACZ,SAAS;EACT;EACA;IACE;;;IAGA;IACA;MAAe;MAAqB;;IACpC;MACE;MACA,UAAU;;;;KAKJ;EACV;EACA;EACA;EACA;;;;;;;;;KAUU;;EAEV,QAAQ;;EAER,QAAQ;EACR;;;KAIU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;;EAER,gBAAgB;;EAEhB;IACE;;;;;EASF;;;;;;;;;;;;KAaU;EACV,WAAW;;EAEX;;EAEA;;EAEA;;EAEA,iBAAiB;;EAEjB,2BAA2B;;KAGjB;EACV,WAAW;EACX,MAAM;EACN,KAAK;EACL,WAAW;EACX,SAAS;EACT,SAAS;EACT,SAAS;EACT,YAAY;EACZ,WAAW;EACX,UAAU;EACV,MAAM;;;KAII;;;EAGV;;EAEA;;EAEA;;KAGU;EAEV,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;IACE;IACA;MAIM;MACA;;IAEN;MACE;MACA;MACA;;;EAGJ;IACE;IACA;IACA,SAAS;;EAEX;IACE;MACE;;IAEF;;EAEF;IACE;IACA;IACA;IACA;;EAEF,WAAW;EACX;IACE;IACA;IACA;;EAIF;IACE;;EAEF;EACA,UAAU;;;;cC6eC,gBAAc,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBzB,EAAA,KAAA;;;KC+0BU,WAAW,EAAE,aAAa"}
@@ -1,4 +1,4 @@
1
- import { L as PowerhouseConfig, O as PHConnectRuntimeConfig } from "../types-CFbd2nan.js";
1
+ import { L as PowerhouseConfig, O as PHConnectRuntimeConfig } from "../types-BRJfX8ck.js";
2
2
  //#region connect/config-loader.d.ts
3
3
  /** Recursive Partial. Arrays are leaves — `write({ packages: [...] })`
4
4
  * replaces the array, it doesn't merge. */
@@ -1,4 +1,4 @@
1
- import { C as PHConnectPwaUrlPattern, L as PowerhouseConfig, O as PHConnectRuntimeConfig, R as PowerhousePackage, S as PHConnectPwaRuntimeCaching, _ as PHConnectPwa, b as PHConnectPwaIcon, v as PHConnectPwaCacheStrategy, x as PHConnectPwaManifest, y as PHConnectPwaFileHandler } from "../types-CFbd2nan.js";
1
+ import { C as PHConnectPwaUrlPattern, L as PowerhouseConfig, O as PHConnectRuntimeConfig, R as PowerhousePackage, S as PHConnectPwaRuntimeCaching, _ as PHConnectPwa, b as PHConnectPwaIcon, v as PHConnectPwaCacheStrategy, x as PHConnectPwaManifest, y as PHConnectPwaFileHandler } from "../types-BRJfX8ck.js";
2
2
  import { ConfigAdapter, ConfigLoader, ConfigShape, DeepPartial, deepMerge, resolveSourceConnect, workflowsSettingConflict } from "./config-loader.js";
3
3
  import { JsonConfigAdapter, JsonConfigAdapterOptions } from "./json-adapter.js";
4
4
  import { z } from "zod";
@@ -1,6 +1,6 @@
1
- import { Dn as IsStateOfType, En as IsDocumentOfType, Fn as Maybe, Om as PHBaseState, Vt as DocumentModelGlobalState, Yr as Reducer, _t as CreateDocument, bt as CreateState, ct as AssertIsStateOfType, hi as SaveToFileHandle, kn as LoadFromInput, st as AssertIsDocumentOfType } from "../types-CFbd2nan.js";
2
- import { $ as LegacySynchronizationUnit, A as TriggerData, C as RemoveTriggerInput, D as SetSharingTypeInput, E as SetDriveNameInput, J as DriveDocumentModelModule, M as TriggerType, N as UpdateFileInput, O as TransmitterType, P as UpdateNodeInput, Q as LegacyAddFileInput, S as RemoveListenerInput, T as SetDriveIconInput, X as DocumentDriveDocument, Y as DocumentDriveAction, Z as LegacyAddFileAction, _ as ListenerInput, _t as SetDriveNameAction, a as CopyNodeInput, at as DocumentDriveNodeOperations, b as PullResponderTriggerData, c as DocumentDriveLocalState, ct as UpdateNodeAction, d as FolderNode, dt as DocumentDriveDriveAction, et as AddFileAction, f as Listener, ft as DocumentDriveDriveOperations, g as ListenerFilterInput, gt as SetDriveIconAction, h as ListenerFilter, ht as SetAvailableOfflineAction, i as AddTriggerInput, it as DocumentDriveNodeAction, j as TriggerInput, k as Trigger, l as DocumentDrivePHState$1, lt as AddListenerAction, m as ListenerCallInfoInput, mt as RemoveTriggerAction, n as AddFolderInput, nt as CopyNodeAction, o as DeleteNodeInput, ot as MoveNodeAction, p as ListenerCallInfo, pt as RemoveListenerAction, q as DocumentDrivePHState, r as AddListenerInput, rt as DeleteNodeAction, s as DocumentDriveGlobalState, st as UpdateFileAction, t as AddFileInput, tt as AddFolderAction, u as FileNode, ut as AddTriggerAction, v as MoveNodeInput, vt as SetSharingTypeAction, w as SetAvailableOfflineInput, x as PullResponderTriggerDataInput, y as Node } from "../types-B11NGQOQ.js";
3
- import { a as GenerateNodesCopyIdGenerator, i as DriveInput, o as GenerateNodesCopySrc, s as SharingType } from "../index-DdXp-CVw.js";
1
+ import { Dm as PHBaseState, Dn as IsStateOfType, En as IsDocumentOfType, Fn as Maybe, Vt as DocumentModelGlobalState, Yr as Reducer, _t as CreateDocument, bt as CreateState, ct as AssertIsStateOfType, hi as SaveToFileHandle, kn as LoadFromInput, st as AssertIsDocumentOfType } from "../types-BRJfX8ck.js";
2
+ import { $ as LegacySynchronizationUnit, A as TriggerData, C as RemoveTriggerInput, D as SetSharingTypeInput, E as SetDriveNameInput, J as DriveDocumentModelModule, M as TriggerType, N as UpdateFileInput, O as TransmitterType, P as UpdateNodeInput, Q as LegacyAddFileInput, S as RemoveListenerInput, T as SetDriveIconInput, X as DocumentDriveDocument, Y as DocumentDriveAction, Z as LegacyAddFileAction, _ as ListenerInput, _t as SetDriveNameAction, a as CopyNodeInput, at as DocumentDriveNodeOperations, b as PullResponderTriggerData, c as DocumentDriveLocalState, ct as UpdateNodeAction, d as FolderNode, dt as DocumentDriveDriveAction, et as AddFileAction, f as Listener, ft as DocumentDriveDriveOperations, g as ListenerFilterInput, gt as SetDriveIconAction, h as ListenerFilter, ht as SetAvailableOfflineAction, i as AddTriggerInput, it as DocumentDriveNodeAction, j as TriggerInput, k as Trigger, l as DocumentDrivePHState$1, lt as AddListenerAction, m as ListenerCallInfoInput, mt as RemoveTriggerAction, n as AddFolderInput, nt as CopyNodeAction, o as DeleteNodeInput, ot as MoveNodeAction, p as ListenerCallInfo, pt as RemoveListenerAction, q as DocumentDrivePHState, r as AddListenerInput, rt as DeleteNodeAction, s as DocumentDriveGlobalState, st as UpdateFileAction, t as AddFileInput, tt as AddFolderAction, u as FileNode, ut as AddTriggerAction, v as MoveNodeInput, vt as SetSharingTypeAction, w as SetAvailableOfflineInput, x as PullResponderTriggerDataInput, y as Node } from "../types-BTfv_ZzS.js";
3
+ import { a as GenerateNodesCopyIdGenerator, i as DriveInput, o as GenerateNodesCopySrc, s as SharingType } from "../index-BhqNGLu9.js";
4
4
  import { z } from "zod";
5
5
  //#region document-drive/constants.d.ts
6
6
  export declare const driveDocumentFileExtension = "phdd";
@@ -0,0 +1,3 @@
1
+ import { _u as UnsupportedDocumentModelVersionError, cu as AuthInitializerNotCreatorError, du as FileSystemError, fu as GrantNotFoundError, gu as InvalidAuthVersionError, hu as InvalidActionInputZodError, lu as AuthPolicyNotPreservedError, mu as InvalidActionInputError, ou as AuthActionNotAllowedError, pu as HashMismatchError, su as AuthAlreadyInitializedError, uu as DowngradeNotSupportedError } from "../types-BRJfX8ck.js";
2
+ export { AuthActionNotAllowedError, AuthAlreadyInitializedError, AuthInitializerNotCreatorError, AuthPolicyNotPreservedError, DowngradeNotSupportedError, FileSystemError, GrantNotFoundError, HashMismatchError, InvalidActionInputError, InvalidActionInputZodError, InvalidAuthVersionError, UnsupportedDocumentModelVersionError };
3
+ export {};
@@ -0,0 +1,152 @@
1
+ //#region document-model/errors.ts
2
+ const FileSystemError = /* @__PURE__ */ new Error("File system not available.");
3
+ var InvalidActionInputError = class extends Error {
4
+ data;
5
+ constructor(data) {
6
+ super();
7
+ this.name = "InvalidActionInputError";
8
+ this.data = data;
9
+ this.message = this.message || `Invalid action input: ${JSON.stringify(data, null, 2)}`;
10
+ }
11
+ };
12
+ var InvalidActionInputZodError = class extends InvalidActionInputError {
13
+ issues;
14
+ constructor(issues) {
15
+ super(issues);
16
+ this.issues = issues;
17
+ this.name = "InvalidActionInputZodError";
18
+ }
19
+ };
20
+ /**
21
+ * Error thrown when attempting to downgrade a document version.
22
+ */
23
+ var DowngradeNotSupportedError = class extends Error {
24
+ documentType;
25
+ fromVersion;
26
+ toVersion;
27
+ constructor(documentType, fromVersion, toVersion) {
28
+ super(`Downgrade not supported for ${documentType}: cannot upgrade from version ${fromVersion} to ${toVersion}`);
29
+ this.name = "DowngradeNotSupportedError";
30
+ this.documentType = documentType;
31
+ this.fromVersion = fromVersion;
32
+ this.toVersion = toVersion;
33
+ }
34
+ };
35
+ /**
36
+ * Thrown when INITIALIZE_AUTH is applied to an already-initialized auth scope.
37
+ * The genesis action is valid only at auth revision zero.
38
+ */
39
+ var AuthAlreadyInitializedError = class extends Error {
40
+ documentId;
41
+ constructor(documentId) {
42
+ super(`Auth scope already initialized for document ${documentId}: INITIALIZE_AUTH is valid only at auth revision zero`);
43
+ this.name = "AuthAlreadyInitializedError";
44
+ this.documentId = documentId;
45
+ }
46
+ };
47
+ /**
48
+ * Thrown when INITIALIZE_AUTH is not signed by the document creator (its signer
49
+ * does not match `header.sig.publicKey`), so it cannot set the auth policy.
50
+ */
51
+ var AuthInitializerNotCreatorError = class extends Error {
52
+ documentId;
53
+ constructor(documentId) {
54
+ super(`INITIALIZE_AUTH for document ${documentId} must be signed by the document creator`);
55
+ this.name = "AuthInitializerNotCreatorError";
56
+ this.documentId = documentId;
57
+ }
58
+ };
59
+ /**
60
+ * Thrown when INITIALIZE_AUTH carries a version below 1. Version 0 is reserved
61
+ * for the uninitialized auth scope.
62
+ */
63
+ var InvalidAuthVersionError = class extends Error {
64
+ documentId;
65
+ version;
66
+ constructor(documentId, version) {
67
+ super(`Invalid auth policy version ${version} for document ${documentId}: INITIALIZE_AUTH requires an integer version >= 1`);
68
+ this.name = "InvalidAuthVersionError";
69
+ this.documentId = documentId;
70
+ this.version = version;
71
+ }
72
+ };
73
+ /** Thrown when a duplicate would lose the source policy's version or creator binding. */
74
+ var AuthPolicyNotPreservedError = class extends Error {
75
+ documentId;
76
+ constructor(documentId) {
77
+ super(`Duplicating document ${documentId} would not preserve its auth policy: the copy loses the policy version or its creator binding`);
78
+ this.name = "AuthPolicyNotPreservedError";
79
+ this.documentId = documentId;
80
+ }
81
+ };
82
+ /**
83
+ * Thrown when a grant referenced by REMOVE_GRANT or MOVE_GRANT does not exist.
84
+ */
85
+ var GrantNotFoundError = class extends Error {
86
+ grantId;
87
+ constructor(grantId) {
88
+ super(`Grant not found in auth scope: ${grantId}`);
89
+ this.name = "GrantNotFoundError";
90
+ this.grantId = grantId;
91
+ }
92
+ };
93
+ /**
94
+ * Thrown when a disallowed action (UNDO, REDO) targets the auth scope.
95
+ */
96
+ var AuthActionNotAllowedError = class extends Error {
97
+ actionType;
98
+ constructor(actionType) {
99
+ super(`${actionType} is not permitted on the auth scope`);
100
+ this.name = "AuthActionNotAllowedError";
101
+ this.actionType = actionType;
102
+ }
103
+ };
104
+ var HashMismatchError = class extends Error {
105
+ _scope;
106
+ _document;
107
+ _operation;
108
+ constructor(scope, document, operation) {
109
+ super();
110
+ this.name = "HashMismatchError";
111
+ this._document = document;
112
+ this._scope = scope;
113
+ this._operation = operation;
114
+ this.message = JSON.stringify({
115
+ error: `Hash mismatch on document ${document.header.id}, scope ${scope}, index ${operation.index}`,
116
+ document,
117
+ operation
118
+ }, null, 1);
119
+ }
120
+ get document() {
121
+ return this._document;
122
+ }
123
+ get scope() {
124
+ return this._scope;
125
+ }
126
+ get operation() {
127
+ return this._operation;
128
+ }
129
+ };
130
+ /**
131
+ * Thrown when replay or import requires a document model version that is not
132
+ * registered. Carries the data the UI needs to explain the mismatch.
133
+ */
134
+ var UnsupportedDocumentModelVersionError = class extends Error {
135
+ documentType;
136
+ requiredVersion;
137
+ availableVersions;
138
+ constructor(documentType, requiredVersion, availableVersions) {
139
+ super(`No reducer registered for document version ${requiredVersion}. Available versions: ${availableVersions.join(", ")}`);
140
+ this.name = "UnsupportedDocumentModelVersionError";
141
+ this.documentType = documentType;
142
+ this.requiredVersion = requiredVersion;
143
+ this.availableVersions = availableVersions;
144
+ }
145
+ static isError(error) {
146
+ return Error.isError(error) && error.name === "UnsupportedDocumentModelVersionError";
147
+ }
148
+ };
149
+ //#endregion
150
+ export { AuthActionNotAllowedError, AuthAlreadyInitializedError, AuthInitializerNotCreatorError, AuthPolicyNotPreservedError, DowngradeNotSupportedError, FileSystemError, GrantNotFoundError, HashMismatchError, InvalidActionInputError, InvalidActionInputZodError, InvalidAuthVersionError, UnsupportedDocumentModelVersionError };
151
+
152
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","names":[],"sources":["../../document-model/errors.ts"],"sourcesContent":["import type { ZodIssue } from \"zod\";\nimport type { PHDocument } from \"./documents.js\";\nimport type { Operation } from \"./operations.js\";\n\nexport const FileSystemError = new Error(\"File system not available.\");\n\nexport class InvalidActionInputError extends Error {\n public data: unknown;\n constructor(data: unknown) {\n super();\n this.name = \"InvalidActionInputError\";\n this.data = data;\n this.message =\n this.message || `Invalid action input: ${JSON.stringify(data, null, 2)}`;\n }\n}\n\nexport class InvalidActionInputZodError extends InvalidActionInputError {\n public issues: ZodIssue[];\n\n constructor(issues: ZodIssue[]) {\n super(issues);\n this.issues = issues;\n this.name = \"InvalidActionInputZodError\";\n }\n}\n\n/**\n * Error thrown when attempting to downgrade a document version.\n */\nexport class DowngradeNotSupportedError extends Error {\n public readonly documentType: string;\n public readonly fromVersion: number;\n public readonly toVersion: number;\n\n constructor(documentType: string, fromVersion: number, toVersion: number) {\n super(\n `Downgrade not supported for ${documentType}: cannot upgrade from version ${fromVersion} to ${toVersion}`,\n );\n this.name = \"DowngradeNotSupportedError\";\n this.documentType = documentType;\n this.fromVersion = fromVersion;\n this.toVersion = toVersion;\n }\n}\n\n/**\n * Thrown when INITIALIZE_AUTH is applied to an already-initialized auth scope.\n * The genesis action is valid only at auth revision zero.\n */\nexport class AuthAlreadyInitializedError extends Error {\n public readonly documentId: string;\n\n constructor(documentId: string) {\n super(\n `Auth scope already initialized for document ${documentId}: INITIALIZE_AUTH is valid only at auth revision zero`,\n );\n this.name = \"AuthAlreadyInitializedError\";\n this.documentId = documentId;\n }\n}\n\n/**\n * Thrown when INITIALIZE_AUTH is not signed by the document creator (its signer\n * does not match `header.sig.publicKey`), so it cannot set the auth policy.\n */\nexport class AuthInitializerNotCreatorError extends Error {\n public readonly documentId: string;\n\n constructor(documentId: string) {\n super(\n `INITIALIZE_AUTH for document ${documentId} must be signed by the document creator`,\n );\n this.name = \"AuthInitializerNotCreatorError\";\n this.documentId = documentId;\n }\n}\n\n/**\n * Thrown when INITIALIZE_AUTH carries a version below 1. Version 0 is reserved\n * for the uninitialized auth scope.\n */\nexport class InvalidAuthVersionError extends Error {\n public readonly documentId: string;\n public readonly version: number;\n\n constructor(documentId: string, version: number) {\n super(\n `Invalid auth policy version ${version} for document ${documentId}: INITIALIZE_AUTH requires an integer version >= 1`,\n );\n this.name = \"InvalidAuthVersionError\";\n this.documentId = documentId;\n this.version = version;\n }\n}\n\n/** Thrown when a duplicate would lose the source policy's version or creator binding. */\nexport class AuthPolicyNotPreservedError extends Error {\n public readonly documentId: string;\n\n constructor(documentId: string) {\n super(\n `Duplicating document ${documentId} would not preserve its auth policy: the copy loses the policy version or its creator binding`,\n );\n this.name = \"AuthPolicyNotPreservedError\";\n this.documentId = documentId;\n }\n}\n\n/**\n * Thrown when a grant referenced by REMOVE_GRANT or MOVE_GRANT does not exist.\n */\nexport class GrantNotFoundError extends Error {\n public readonly grantId: string;\n\n constructor(grantId: string) {\n super(`Grant not found in auth scope: ${grantId}`);\n this.name = \"GrantNotFoundError\";\n this.grantId = grantId;\n }\n}\n\n/**\n * Thrown when a disallowed action (UNDO, REDO) targets the auth scope.\n */\nexport class AuthActionNotAllowedError extends Error {\n public readonly actionType: string;\n\n constructor(actionType: string) {\n super(`${actionType} is not permitted on the auth scope`);\n this.name = \"AuthActionNotAllowedError\";\n this.actionType = actionType;\n }\n}\n\nexport class HashMismatchError extends Error {\n protected _scope: string;\n protected _document: PHDocument;\n protected _operation: Operation;\n\n constructor(scope: string, document: PHDocument, operation: Operation) {\n super();\n this.name = \"HashMismatchError\";\n this._document = document;\n this._scope = scope;\n this._operation = operation;\n\n this.message = JSON.stringify(\n {\n error: `Hash mismatch on document ${document.header.id}, scope ${scope}, index ${operation.index}`,\n document,\n operation,\n },\n null,\n 1,\n );\n }\n\n get document() {\n return this._document;\n }\n\n get scope() {\n return this._scope;\n }\n\n get operation() {\n return this._operation;\n }\n}\n\n/**\n * Thrown when replay or import requires a document model version that is not\n * registered. Carries the data the UI needs to explain the mismatch.\n */\nexport class UnsupportedDocumentModelVersionError extends Error {\n public readonly documentType: string;\n public readonly requiredVersion: number;\n public readonly availableVersions: number[];\n\n constructor(\n documentType: string,\n requiredVersion: number,\n availableVersions: number[],\n ) {\n super(\n `No reducer registered for document version ${requiredVersion}. Available versions: ${availableVersions.join(\", \")}`,\n );\n this.name = \"UnsupportedDocumentModelVersionError\";\n this.documentType = documentType;\n this.requiredVersion = requiredVersion;\n this.availableVersions = availableVersions;\n }\n\n static isError(\n error: unknown,\n ): error is UnsupportedDocumentModelVersionError {\n return (\n Error.isError(error) &&\n error.name === \"UnsupportedDocumentModelVersionError\"\n );\n }\n}\n"],"mappings":";AAIA,MAAa,kCAAkB,IAAI,MAAM,4BAA4B;AAErE,IAAa,0BAAb,cAA6C,MAAM;CACjD;CACA,YAAY,MAAe;EACzB,MAAM;EACN,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,UACH,KAAK,WAAW,yBAAyB,KAAK,UAAU,MAAM,MAAM,CAAC;CACzE;AACF;AAEA,IAAa,6BAAb,cAAgD,wBAAwB;CACtE;CAEA,YAAY,QAAoB;EAC9B,MAAM,MAAM;EACZ,KAAK,SAAS;EACd,KAAK,OAAO;CACd;AACF;;;;AAKA,IAAa,6BAAb,cAAgD,MAAM;CACpD;CACA;CACA;CAEA,YAAY,cAAsB,aAAqB,WAAmB;EACxE,MACE,+BAA+B,aAAa,gCAAgC,YAAY,MAAM,WAChG;EACA,KAAK,OAAO;EACZ,KAAK,eAAe;EACpB,KAAK,cAAc;EACnB,KAAK,YAAY;CACnB;AACF;;;;;AAMA,IAAa,8BAAb,cAAiD,MAAM;CACrD;CAEA,YAAY,YAAoB;EAC9B,MACE,+CAA+C,WAAW,sDAC5D;EACA,KAAK,OAAO;EACZ,KAAK,aAAa;CACpB;AACF;;;;;AAMA,IAAa,iCAAb,cAAoD,MAAM;CACxD;CAEA,YAAY,YAAoB;EAC9B,MACE,gCAAgC,WAAW,wCAC7C;EACA,KAAK,OAAO;EACZ,KAAK,aAAa;CACpB;AACF;;;;;AAMA,IAAa,0BAAb,cAA6C,MAAM;CACjD;CACA;CAEA,YAAY,YAAoB,SAAiB;EAC/C,MACE,+BAA+B,QAAQ,gBAAgB,WAAW,mDACpE;EACA,KAAK,OAAO;EACZ,KAAK,aAAa;EAClB,KAAK,UAAU;CACjB;AACF;;AAGA,IAAa,8BAAb,cAAiD,MAAM;CACrD;CAEA,YAAY,YAAoB;EAC9B,MACE,wBAAwB,WAAW,8FACrC;EACA,KAAK,OAAO;EACZ,KAAK,aAAa;CACpB;AACF;;;;AAKA,IAAa,qBAAb,cAAwC,MAAM;CAC5C;CAEA,YAAY,SAAiB;EAC3B,MAAM,kCAAkC,SAAS;EACjD,KAAK,OAAO;EACZ,KAAK,UAAU;CACjB;AACF;;;;AAKA,IAAa,4BAAb,cAA+C,MAAM;CACnD;CAEA,YAAY,YAAoB;EAC9B,MAAM,GAAG,WAAW,oCAAoC;EACxD,KAAK,OAAO;EACZ,KAAK,aAAa;CACpB;AACF;AAEA,IAAa,oBAAb,cAAuC,MAAM;CAC3C;CACA;CACA;CAEA,YAAY,OAAe,UAAsB,WAAsB;EACrE,MAAM;EACN,KAAK,OAAO;EACZ,KAAK,YAAY;EACjB,KAAK,SAAS;EACd,KAAK,aAAa;EAElB,KAAK,UAAU,KAAK,UAClB;GACE,OAAO,6BAA6B,SAAS,OAAO,GAAG,UAAU,MAAM,UAAU,UAAU;GAC3F;GACA;EACF,GACA,MACA,CACF;CACF;CAEA,IAAI,WAAW;EACb,OAAO,KAAK;CACd;CAEA,IAAI,QAAQ;EACV,OAAO,KAAK;CACd;CAEA,IAAI,YAAY;EACd,OAAO,KAAK;CACd;AACF;;;;;AAMA,IAAa,uCAAb,cAA0D,MAAM;CAC9D;CACA;CACA;CAEA,YACE,cACA,iBACA,mBACA;EACA,MACE,8CAA8C,gBAAgB,wBAAwB,kBAAkB,KAAK,IAAI,GACnH;EACA,KAAK,OAAO;EACZ,KAAK,eAAe;EACpB,KAAK,kBAAkB;EACvB,KAAK,oBAAoB;CAC3B;CAEA,OAAO,QACL,OAC+C;EAC/C,OACE,MAAM,QAAQ,KAAK,KACnB,MAAM,SAAS;CAEnB;AACF"}
@@ -1,4 +1,5 @@
1
- import { $ as AddOperationErrorInput, $c as PurgeMarkerOperation, $d as mentionedGroupIds, $f as reorderChangeLogItems, $i as SetOperationErrorTemplateInput, $l as UpgradeManifest, $m as isSignaturePolicy, $n as MutationMoveOperationArgs, $o as assertOperationExampleIdUnique, $p as isDocumentAction, $r as RemoveRelationshipActionInput, $s as ReorderOperationErrorsInputSchema, $t as DocumentModelOperationExampleAction, $u as documentModelInitialLocalState, Aa as UndoAction, Ac as UndoActionInputSchema, Ad as InitializeAuthActionInputSchema, Af as addOperation, Ai as SetModelDescriptionInput, Al as createVerificationSigner, Am as PHGroupState, An as MakeEmpty, Ap as updateStateExample, Ar as MutationUpdateStateExampleArgs, As as DeleteStateExampleInputSchema, At as DeleteOperationErrorAction, Au as isDocumentModelState, Ba as UpdateStateExampleInput, Bc as documentModelOperationErrorReducer, Bd as SetGrantActionInputSchema, Bf as deleteOperation, Bi as SetModuleNameInput, Bl as createZip, Bm as defaultBaseState, Bn as Mutation, Bp as baseCreateDocument, Br as PieceModule, Bs as OperationSpecificationSchema, Bt as DocumentModelDocumentModelModule, Bu as buildOperationSignatureParams, Ca as SigningParameters, Cc as SetOperationTemplateInputSchema, Cd as AuthRefusal, Cf as ActionContext, Ci as SetAuthorNameAction, Cl as peerSupports, Cm as Capability, Cn as ISigner, Cp as setOperationScope, Cr as MutationSetOperationReducerArgs, Cs as ConfigEntrySchema, Ct as DeleteChildDocumentInput, Cu as BaseDocumentStateSchema, Da as StateReducer, Dc as Set_NameSchema, Dd as ConditionContext, Df as actions, Di as SetInitialStateAction, Dl as createPresignedHeader, Dm as PHAuthState, Dn as IsStateOfType, Dp as undo, Dr as MutationUndoArgs, Ds as DeleteOperationErrorInputSchema, Dt as DeleteModuleAction, Du as assertIsDocumentModelDocument, Ea as State, Ec as SetStateSchemaInputSchema, Ed as AuthVerb, Ef as actionSigner, Ei as SetAuthorWebsiteInput, El as createCopyHeader, Em as Operand, En as IsDocumentOfType, Ep as setStateSchema, Er as MutationSetStateSchemaArgs, Es as DeleteModuleInputSchema, Et as DeleteDocumentActionInput, Eu as DocumentModelSchema, Fa as UpdateOperationExampleAction, Fc as UpdateStateExampleInputSchema, Fd as RemoveGrantAction, Ff as buildOperationSignature, Fi as SetModelNameAction, Fl as BulkArchiveEntry, Fm as createDocumentState, Fn as Maybe, Fp as PHDocumentHeader, Fr as OperationsByScope, Fs as ManifestSchema, Ft as DeleteStateExampleAction, Fu as isDenied, G as ActionVerificationHandler, Gc as documentModelStateSchemaReducer, Gd as applySetGrantAction, Gf as moveOperation, Gi as SetOperationDescriptionInput, Gl as isDocumentZip, Gm as DEFAULT_SIGNATURE_POLICY, Gn as MutationAddOperationExampleArgs, Gp as filterDocumentOperationsResultingState, Gr as Query, Gs as PublisherSchema, Gt as DocumentModelLib, Gu as HASH_ALGORITHM_SHA1, H as ActionErrorCallback, Ha as UpgradeDocumentActionInput, Hc as documentModelOperationReducer, Hd as applyInitializeAuthAction, Hf as deleteOperationExample, Hi as SetNameActionInput, Hl as documentModelSaveToFileHandle, Hm as defaultGlobalState, Hn as MutationAddModuleArgs, Hp as checkCleanedOperationsIntegrity, Hr as Publisher, Hs as PieceModulesSchema, Ht as DocumentModelHeaderAction, Hu as getUnixTimestamp, Ia as UpdateOperationExampleInput, Ic as definedNonNullAnySchema, Id as RemoveGrantActionInput, If as buildSignedAction, Ii as SetModelNameInput, Il as baseLoadFromInput, Im as createGlobalState, In as MinimalBackupData, Ip as PHDocumentMeta, Ir as PartialRecord, Is as ModuleSchema, It as DeleteStateExampleInput, Iu as ab2hex, J as AddChangeLogItemInput, Jc as createReducer, Jd as decide, Jf as operationFromAction, Ji as SetOperationErrorDescriptionAction, Jl as writeFileBrowser, Jm as SIGNATURE_PROTOCOL, Jn as MutationDeleteModuleArgs, Jo as OPERATION_NAME_PATTERN, Jp as garbageCollectDocumentOperations, Jr as RedoActionInput, Js as RedoActionSchema, Jt as DocumentModelModuleAction, Ju as HASH_ENCODING_BASE64, K as Actions, Kc as documentModelVersioningReducer, Kd as assertAuthPreservedOnDuplicate, Kf as noop, Ki as SetOperationErrorCodeAction, Kl as parseBulkArchive, Km as DocumentIdParams, Kn as MutationAddStateExampleArgs, Kp as filterDuplicatedOperations, Kr as Redo, Ks as PwaConfigSchema, Kt as DocumentModelLocalState, Ku as HASH_ALGORITHM_SHA256, La as UpdateRelationshipAction, Lc as isDefinedNonNullAny, Ld as RemoveGrantActionInputSchema, Lf as createAction, Li as SetModuleDescriptionAction, Ll as baseLoadFromInputVersioned, Lm as createLocalState, Ln as ModuleSpecification, Lp as addUndo, Lr as PartialState, Ls as MoveOperationInputSchema, Lt as DocumentAction, Lu as base58Decode, Ma as UndoRedoAction, Mc as UndoSchema, Md as MoveGrantAction, Mf as addOperationExample, Mi as SetModelExtensionInput, Ml as sign, Mm as backfillAuthState, Mn as MakeOptional, Mp as IntegrityIssueSubType, Mr as OperationErrorSpecification, Ms as DocumentModelGlobalStateSchema, Mt as DeleteOperationExampleAction, Mu as AUTH_NO_GRANT_REASON, Na as UpdateChangeLogItemAction, Nc as UpdateChangeLogItemInputSchema, Nd as MoveGrantActionInput, Nf as addStateExample, Ni as SetModelIdAction, Nl as validateHeader, Nm as createAuthState, Nn as Manifest, Np as IntegrityIssueType, Nr as OperationIndex, Ns as DocumentModelInputSchema, Nt as DeleteOperationExampleInput, Nu as AUTH_VERSION_UNSUPPORTED_REASON, Oa as SubgraphModule, Oc as Set_PreferredEditorSchema, Od as InitializeAuthAction, Of as addChangeLogItem, Oi as SetInitialStateInput, Ol as createSignedHeader, Om as PHBaseState, On as LoadFromFile, Op as updateChangeLogItem, Or as MutationUpdateChangeLogItemInputArgs, Os as DeleteOperationExampleInputSchema, Ot as DeleteModuleInput, Ou as assertIsDocumentModelState, Pa as UpdateChangeLogItemInput, Pc as UpdateOperationExampleInputSchema, Pd as MoveGrantActionInputSchema, Pf as baseActions, Pi as SetModelIdInput, Pl as verify, Pm as createBaseState, Pn as MappedOperation, Pp as PHDocument, Pr as OperationSpecification, Ps as DocumentSpecificationSchema, Pt as DeleteOperationInput, Pu as DOCUMENT_DELETED_REASON, Q as AddOperationErrorAction, Qc as PURGE_DOCUMENT, Qd as isDocumentCreator, Qf as releaseNewVersion, Qi as SetOperationErrorTemplateAction, Ql as replayDocumentVersioned, Qm as isDerivedDocumentId, Qn as MutationDeleteStateExampleArgs, Qo as assertOperationErrorIdUnique, Qp as hashDocumentStateForScope, Qr as RemoveRelationshipAction, Qs as ReorderModulesInputSchema, Qt as DocumentModelOperationErrorOperations, Qu as documentModelInitialGlobalState, Ra as UpdateRelationshipActionInput, Rc as documentModelHeaderReducer, Rd as SetGrantAction, Rf as deleteChangeLogItem, Ri as SetModuleDescriptionInput, Rl as baseSaveToFileHandle, Rm as createState, Rn as MoveOperationAction, Rp as appendWithoutApplying, Rr as PhAiToolAnnotations, Rs as OperationErrorSchema, Rt as DocumentModelAction, Ru as base64UrlToBytes, Sa as SignatureVerificationHandler, Sc as SetOperationScopeInputSchema, Sd as AuthEvaluation, Sf as Action, Sh as serializeSignature, Si as ScopeState, Sl as mergePeerCapabilities, Sm as AuthGroups, Sn as ISignalResult, Sp as setOperationSchema, Sr as MutationSetOperationNameArgs, Ss as CodeExampleSchema, St as DeleteChangeLogItemInput, Su as BaseDocumentHeaderSchema, Ta as SkipHeaderOperations, Tc as SetPreferredEditorActionSchema, Td as AuthSubject, Tf as actionFromAction, Ti as SetAuthorWebsiteAction, Tl as selectProtocolVersions, Tm as Grant, Tn as InputMaybe, Tp as setPreferredEditor, Tr as MutationSetOperationTemplateArgs, Ts as DeleteChangeLogItemInputSchema, Tt as DeleteDocumentAction, Tu as DocumentModelPHStateSchema, U as ActionSignatureContext, Ua as User, Uc as documentModelReducer, Ud as applyMoveGrantAction, Uf as deleteStateExample, Ui as SetNameOperation, Ul as fetchFileBrowser, Um as defaultLocalState, Un as MutationAddOperationArgs, Up as checkOperationsIntegrity, Ur as PurgeDocumentAction, Us as PowerhouseModuleSchema, Ut as DocumentModelHeaderOperations, Uu as hashBrowser, Va as UpgradeDocumentAction, Vc as documentModelOperationExampleReducer, Vd as applyAuthAction, Vf as deleteOperationError, Vi as SetNameAction, Vl as documentModelLoadFromInput, Vm as defaultDocumentState, Vn as MutationAddChangeLogItemInputArgs, Vp as baseReducerVersion, Vr as PowerhouseModule, Vs as PieceModuleSchema, Vt as DocumentModelGlobalState, Vu as bytesToBase64Url, W as ActionSigningHandler, Wa as ValidationError, Wc as documentModelStateReducer, Wd as applyRemoveGrantAction, Wf as documentModelActions, Wi as SetOperationDescriptionAction, Wl as getFileBrowser, Wm as defaultPHState, Wn as MutationAddOperationErrorArgs, Wp as diffOperations, Wr as PurgeDocumentActionInput, Ws as PowerhouseModulesSchema, Wt as DocumentModelInput, Wu as hex2ab, X as AddModuleInput, Xc as replayOperations, Xd as initializeAuth, Xf as operationWithContext, Xi as SetOperationErrorNameAction, Xl as VersionedReducers, Xm as SignaturePolicy, Xn as MutationDeleteOperationErrorArgs, Xo as ReservedOperationName, Xp as getDocumentLastModified, Xr as ReducerOptions, Xs as ReorderChangeLogItemsInputSchema, Xt as DocumentModelOperationAction, Xu as documentModelFileExtension, Y as AddModuleAction, Yc as processUndoRedo, Yd as evaluate, Yf as operationFromOperation, Yi as SetOperationErrorDescriptionInput, Yl as zipEntries, Ym as SIGNATURE_PROTOCOL_V2, Yn as MutationDeleteOperationArgs, Yo as RESERVED_OPERATION_NAMES, Yp as garbageCollectV2, Yr as Reducer, Ys as RedoSchema, Yt as DocumentModelModuleOperations, Yu as HASH_ENCODING_HEX, Z as AddOperationAction, Zc as updateDocument, Zd as isAuthAction, Zf as redo, Zi as SetOperationErrorNameInput, Zl as VersionedReplayConfig, Zm as deriveDocumentId, Zn as MutationDeleteOperationExampleArgs, Zo as assertModuleIdUnique, Zp as groupOperationsByScope, Zr as ReleaseNewVersionAction, Zs as ReorderModuleOperationsInputSchema, Zt as DocumentModelOperationErrorAction, Zu as documentModelGlobalState, _a as Signal, _c as SetOperationErrorNameInputSchema, _d as isPlainValue, _f as hashActionV2, _h as HashConfig, _i as SchemaNOOPAction, _l as isOlderManifest, _m as sortMappedOperations, _n as IAction, _p as setOperationErrorDescription, _r as MutationSetOperationDescriptionArgs, _s as AddOperationErrorInputSchema, _t as CreateDocument, _u as InvalidAuthVersionError, aa as SetOperationSchemaInput, ac as SetInitialStateInputSchema, ad as MAX_AUTH_GRANTS, af as TransportActionContext, ah as Operation, ai as ReorderModulesInput, al as FeatureCapability, am as merge, an as DocumentModelUtils, ap as setAuthorName, ar as MutationReorderOperationExamplesArgs, as as getAllOperationNames, at as AddStateExampleAction, au as normalizeDocumentModelVersion, ba as SignalResults, bc as SetOperationReducerInputSchema, bd as AuthAction, bf as targetDocumentId, bh as UserActionSigner, bi as SchemaSetPreferredEditorAction, bl as localSupports, bm as updateHeaderRevision, bn as IOperation, bp as setOperationName, br as MutationSetOperationErrorNameArgs, bs as AddStateExampleInputSchema, bt as CreateState, bu as groupDocumentType, ca as SetOperationTemplateAction, cc as SetModelIdInputSchema, cd as MAX_CONDITION_NODES, cf as ACTION_SIGNATURE_V2_PREFIX, ch as OperationWithContext, ci as ReorderOperationExamplesAction, cl as PEER_CAPABILITIES, cm as parseResultingState, cn as DocumentOperationsIgnoreMap, cp as setModelDescription, cr as MutationSetAuthorWebsiteArgs, cs as validateInitialState, ct as AssertIsStateOfType, cu as AuthAlreadyInitializedError, da as SetPreferredEditorActionInput, dc as SetModuleNameInputSchema, dd as assertValidGrantUpsert, df as CanonicalJsonError, dh as setNameOperation, di as ReorderStateExamplesInput, dl as PeerCapabilityFlags, dm as readOnly, dn as EditorDispatch, dp as setModelName, dr as MutationSetModelExtensionArgs, ds as validateModules, dt as ConfigEntry, du as DowngradeNotSupportedError, ea as SetOperationNameAction, ec as ReorderOperationExamplesInputSchema, ed as AuthAdministrationLockoutError, ef as moveGrant, eh as protocolVersionsFor, ei as ReorderChangeLogItemsAction, el as isPurgeMarker, em as isNoopOperation, en as DocumentModelOperationExampleOperations, ep as reorderModuleOperations, er as MutationRedoArgs, es as assertOperationIdUnique, et as AddOperationExampleAction, eu as UpgradeReducer, fa as SetPreferredEditorOperation, fc as SetNameActionInputSchema, fd as assertValidInitialGrants, ff as DOCUMENT_SCOPE_ACTION_TYPES, fh as setPreferredEditorOperation, fi as ReplayDocumentOptions, fl as PeerManifest, fm as removeExistingOperations, fn as EditorModule, fp as setModuleDescription, fr as MutationSetModelIdArgs, fs as validateOperationName, ft as ConfigEntryType, fu as FileSystemError, ga as Set_PreferredEditor, gc as SetOperationErrorDescriptionInputSchema, gd as grantProblem, gf as canonicalJson, gh as AppActionSigner, gi as Scalars, gl as holdReason, gm as skipHeaderOperations, gn as GetDocumentOptions, gp as setOperationErrorCode, gr as MutationSetNameArgs, gs as AddModuleInputSchema, gt as CreateChildDocumentSignal, gu as InvalidActionInputZodError, ha as Set_Name, hc as SetOperationErrorCodeInputSchema, hd as evaluateGrants, hf as actionSigningTarget, hh as ActionSigner, hi as SaveToFileHandle, hl as coversLocal, hm as reshuffleByTimestampAndIndex, hn as FileInput, hp as setOperationDescription, hr as MutationSetModuleNameArgs, hs as AddChangeLogItemInputSchema, ht as CreateChildDocumentInput, hu as InvalidActionInputError, ia as SetOperationSchemaAction, ic as SetAuthorWebsiteInputSchema, id as InvalidGrantError, if as TransportAction, ih as DocumentOperations, ii as ReorderModulesAction, il as DOCUMENT_PURGE_PROTOCOL, im as mapSkippedOperationsV2, in as DocumentModelStateOperations, ip as reorderStateExamples, ir as MutationReorderOperationErrorsArgs, is as findOperationOrThrow, it as AddRelationshipActionInput, iu as computeUpgradeTransitions, ja as UndoActionInput, jc as UndoActionSchema, jd as MAX_SUPPORTED_AUTH_VERSION, jf as addOperationError, ji as SetModelExtensionAction, jl as hasDerivedDocumentId, jm as Principal, jn as MakeMaybe, jp as verifyOperationSignature, jr as NOOPAction, js as DocumentActionSchema, jt as DeleteOperationErrorInput, ju as AUTH_DENIED_BY_GRANT_REASON, ka as Undo, kc as StateSchema, kd as InitializeAuthActionInput, kf as addModule, ki as SetModelDescriptionAction, kl as createSignedHeaderForSigner, km as PHDocumentState, kn as LoadFromInput, kp as updateOperationExample, kr as MutationUpdateOperationExampleArgs, ks as DeleteOperationInputSchema, kt as DeleteOperationAction, ku as isDocumentModelDocument, la as SetOperationTemplateInput, lc as SetModelNameInputSchema, ld as assertAuthAdministrationRetained, lf as ActionSignerIdentity, lh as operationOutcome, li as ReorderOperationExamplesInput, ll as PEER_MANIFEST_FORMAT, lm as precedes, ln as DocumentSpecification, lp as setModelExtension, lr as MutationSetInitialStateArgs, ls as validateModule, lt as Author, lu as AuthInitializerNotCreatorError, ma as SetStateSchemaInput, mc as SetOperationDescriptionInputSchema, md as evaluateGrantStack, mf as actionSignerIdentity, mh as undoOperationV2, mi as SaveToFile, ml as Supports, mm as reshuffleByTimestamp, mn as Exact, mp as setName, mr as MutationSetModuleDescriptionArgs, ms as validateStateSchemaName, mt as CopyChildDocumentSignal, mu as HashMismatchError, na as SetOperationReducerAction, nc as ScopeStateSchema, nd as GrantSchema, nf as resolveSnapshotAuth, nh as signaturePolicyOf, ni as ReorderModuleOperationsAction, nl as purgeMarkerOperation, nm as isUndoRedo, nn as DocumentModelPHState, np as reorderOperationErrors, nr as MutationReorderModuleOperationsArgs, ns as findOperationErrorOrThrow, nt as AddOperationInput, nu as applyDeleteDocumentAction, oa as SetOperationScopeAction, oc as SetModelDescriptionInputSchema, od as MAX_CAPABILITY_OPERATIONS, of as TransportSigner, oh as OperationContext, oi as ReorderOperationErrorsAction, ol as HoldReason, om as nextSkipNumber, on as DocumentModelVersioningAction, op as setAuthorWebsite, or as MutationReorderStateExamplesArgs, os as isReservedOperationName, ot as AddStateExampleInput, ou as withProtocolVersions, pa as SetStateSchemaAction, pc as SetNameActionSchema, pd as evaluateCondition, pf as actionPreimageV2, ph as undoOperation, pi as RevisionsFilter, pl as ProtocolCapability, pm as replayDocument, pn as EditorProps, pp as setModuleName, pr as MutationSetModelNameArgs, ps as validateOperations, pt as CopyChildDocumentInput, pu as GrantNotFoundError, q as AddChangeLogItemAction, qc as baseReducer, qd as assertAuthScopeActionAllowed, qf as operationExampleCreators, qi as SetOperationErrorCodeInput, ql as readFileBrowser, qm as ProtocolVersions, qn as MutationDeleteChangeLogItemInputArgs, qp as garbageCollect, qr as RedoAction, qs as RedoActionInputSchema, qt as DocumentModelModule, qu as HASH_ALGORITHM_SHA512, ra as SetOperationReducerInput, rc as SetAuthorNameInputSchema, rd as GroupPrincipalNotAllowedError, rf as setGrant, rh as v2RequiredProtocolVersions, ri as ReorderModuleOperationsInput, rl as purgedProtocolVersions, rm as mapSkippedOperations, rn as DocumentModelStateAction, rp as reorderOperationExamples, rr as MutationReorderModulesArgs, rs as findOperationExampleOrThrow, rt as AddRelationshipAction, ru as applyUpgradeDocumentAction, sa as SetOperationScopeInput, sc as SetModelExtensionInputSchema, sd as MAX_CONDITION_DEPTH, sf as toTransportAction, sh as OperationOutcome, si as ReorderOperationErrorsInput, sl as MARKER_REFUSAL_FEATURE, sm as operationsAreEqual, sn as DocumentModelVersioningOperations, sp as setInitialState, sr as MutationSetAuthorNameArgs, ss as isValidOperationNameFormat, st as AssertIsDocumentOfType, su as AuthActionNotAllowedError, ta as SetOperationNameInput, tc as ReorderStateExamplesInputSchema, td as AuthAdministrationMissingError, tf as removeGrant, th as requestedSignaturePolicy, ti as ReorderChangeLogItemsInput, tl as purgeDocumentAction, tm as isUndo, tn as DocumentModelOperationOperations, tp as reorderModules, tr as MutationReorderChangeLogItemsInputArgs, ts as findModuleOrThrow, tt as AddOperationExampleInput, tu as UpgradeTransition, ua as SetPreferredEditorAction, uc as SetModuleDescriptionInputSchema, ud as assertValidGrant, uf as ActionSigningTarget, uh as redoOperation, ui as ReorderStateExamplesAction, ul as PeerCapability, um as prepareOperations, un as ENSInfo, up as setModelId, ur as MutationSetModelDescriptionArgs, us as validateModuleOperation, ut as CodeExample, uu as AuthPolicyNotPreservedError, va as SignalDispatch, vc as SetOperationErrorTemplateInputSchema, vd as referencedGroupIds, vf as isV2ActionHash, vh as PHDocumentSignatureInfo, vi as SchemaRedoAction, vl as legacySupports, vm as sortOperations, vn as ID, vp as setOperationErrorName, vr as MutationSetOperationErrorCodeArgs, vs as AddOperationExampleInputSchema, vt as CreateDocumentAction, vu as UnsupportedDocumentModelVersionError, wa as SkipHeaderOperationIndex, wc as SetPreferredEditorActionInputSchema, wd as AuthRequest, wf as actionContext, wi as SetAuthorNameInput, wl as readPeerManifest, wm as Condition, wn as Incremental, wp as setOperationTemplate, wr as MutationSetOperationSchemaArgs, ws as ConfigEntryTypeSchema, wt as DeleteChildDocumentSignal, wu as DocumentModelHeaderSchema, xa as SignalType, xc as SetOperationSchemaInputSchema, xd as AuthDecision, xf as v2TupleProblem, xh as deserializeSignature, xi as SchemaUndoAction, xl as manifestRevision, xm as withSignaturePolicy, xn as ISignal, xp as setOperationReducer, xr as MutationSetOperationErrorTemplateArgs, xs as AuthorSchema, xt as DeleteChangeLogItemAction, xu as groupMembershipActionTypes, ya as SignalResult, yc as SetOperationNameInputSchema, yd as AUTH_ACTION_TYPES, yf as signActionV2, yh as Signature, yi as SchemaSetNameAction, yl as localPeerManifest, ym as split, yn as IDocument, yp as setOperationErrorTemplate, yr as MutationSetOperationErrorDescriptionArgs, ys as AddOperationInputSchema, yt as CreateDocumentActionInput, yu as documentModelDocumentType, za as UpdateStateExampleAction, zc as documentModelModuleReducer, zd as SetGrantActionInput, zf as deleteModule, zi as SetModuleNameAction, zl as createMinimalZip, zm as defaultAuthState, zn as MoveOperationInput, zp as attachBranch, zr as PhAiToolDescriptor, zs as OperationScopeSchema, zt as DocumentModelDocument, zu as buildOperationSignatureMessage } from "../types-CFbd2nan.js";
1
+ import { $ as AddOperationErrorInput, $c as PurgeMarkerOperation, $d as moveGrant, $f as reorderModuleOperations, $i as SetOperationErrorTemplateInput, $l as UpgradeManifest, $m as protocolVersionsFor, $n as MutationMoveOperationArgs, $o as assertOperationExampleIdUnique, $p as isNoopOperation, $r as RemoveRelationshipActionInput, $s as ReorderOperationErrorsInputSchema, $t as DocumentModelOperationExampleAction, $u as AuthAdministrationLockoutError, Aa as UndoAction, Ac as UndoActionInputSchema, Ad as MAX_SUPPORTED_AUTH_VERSION, Af as addOperationError, Ai as SetModelDescriptionInput, Al as createVerificationSigner, Am as Principal, An as MakeEmpty, Ap as verifyOperationSignature, Ar as MutationUpdateStateExampleArgs, As as DeleteStateExampleInputSchema, At as DeleteOperationErrorAction, Au as AUTH_DENIED_BY_GRANT_REASON, Ba as UpdateStateExampleInput, Bc as documentModelOperationErrorReducer, Bd as applyAuthAction, Bf as deleteOperationError, Bi as SetModuleNameInput, Bl as createZip, Bm as defaultDocumentState, Bn as Mutation, Bp as baseReducerVersion, Br as PieceModule, Bs as OperationSpecificationSchema, Bt as DocumentModelDocumentModelModule, Bu as bytesToBase64Url, Ca as SigningParameters, Cc as SetOperationTemplateInputSchema, Cd as AuthRequest, Cf as actionContext, Ci as SetAuthorNameAction, Cl as peerSupports, Cm as Condition, Cn as ISigner, Cp as setOperationTemplate, Cr as MutationSetOperationReducerArgs, Cs as ConfigEntrySchema, Ct as DeleteChildDocumentInput, Cu as DocumentModelHeaderSchema, Da as StateReducer, Dc as Set_NameSchema, Dd as InitializeAuthAction, Df as addChangeLogItem, Di as SetInitialStateAction, Dl as createPresignedHeader, Dm as PHBaseState, Dn as IsStateOfType, Dp as updateChangeLogItem, Dr as MutationUndoArgs, Ds as DeleteOperationErrorInputSchema, Dt as DeleteModuleAction, Du as assertIsDocumentModelState, Ea as State, Ec as SetStateSchemaInputSchema, Ed as ConditionContext, Ef as actions, Ei as SetAuthorWebsiteInput, El as createCopyHeader, Em as PHAuthState, En as IsDocumentOfType, Ep as undo, Er as MutationSetStateSchemaArgs, Es as DeleteModuleInputSchema, Et as DeleteDocumentActionInput, Eu as assertIsDocumentModelDocument, Fa as UpdateOperationExampleAction, Fc as UpdateStateExampleInputSchema, Fd as RemoveGrantActionInput, Ff as buildSignedAction, Fi as SetModelNameAction, Fl as BulkArchiveEntry, Fm as createGlobalState, Fn as Maybe, Fp as PHDocumentMeta, Fr as OperationsByScope, Fs as ManifestSchema, Ft as DeleteStateExampleAction, Fu as ab2hex, G as ActionVerificationHandler, Gc as documentModelStateSchemaReducer, Gd as assertAuthPreservedOnDuplicate, Gf as noop, Gi as SetOperationDescriptionInput, Gl as isDocumentZip, Gm as DocumentIdParams, Gn as MutationAddOperationExampleArgs, Gp as filterDuplicatedOperations, Gr as Query, Gs as PublisherSchema, Gt as DocumentModelLib, Gu as HASH_ALGORITHM_SHA256, H as ActionErrorCallback, Ha as UpgradeDocumentActionInput, Hc as documentModelOperationReducer, Hd as applyMoveGrantAction, Hf as deleteStateExample, Hi as SetNameActionInput, Hl as documentModelSaveToFileHandle, Hm as defaultLocalState, Hn as MutationAddModuleArgs, Hp as checkOperationsIntegrity, Hr as Publisher, Hs as PieceModulesSchema, Ht as DocumentModelHeaderAction, Hu as hashBrowser, Ia as UpdateOperationExampleInput, Ic as definedNonNullAnySchema, Id as RemoveGrantActionInputSchema, If as createAction, Ii as SetModelNameInput, Il as baseLoadFromInput, Im as createLocalState, In as MinimalBackupData, Ip as addUndo, Ir as PartialRecord, Is as ModuleSchema, It as DeleteStateExampleInput, Iu as base58Decode, J as AddChangeLogItemInput, Jc as createReducer, Jd as evaluate, Jf as operationFromOperation, Ji as SetOperationErrorDescriptionAction, Jl as writeFileBrowser, Jm as SIGNATURE_PROTOCOL_V2, Jn as MutationDeleteModuleArgs, Jo as OPERATION_NAME_PATTERN, Jp as garbageCollectV2, Jr as RedoActionInput, Js as RedoActionSchema, Jt as DocumentModelModuleAction, Ju as HASH_ENCODING_HEX, K as Actions, Kc as documentModelVersioningReducer, Kd as assertAuthScopeActionAllowed, Kf as operationExampleCreators, Ki as SetOperationErrorCodeAction, Kl as parseBulkArchive, Km as ProtocolVersions, Kn as MutationAddStateExampleArgs, Kp as garbageCollect, Kr as Redo, Ks as PwaConfigSchema, Kt as DocumentModelLocalState, Ku as HASH_ALGORITHM_SHA512, La as UpdateRelationshipAction, Lc as isDefinedNonNullAny, Ld as SetGrantAction, Lf as deleteChangeLogItem, Li as SetModuleDescriptionAction, Ll as baseLoadFromInputVersioned, Lm as createState, Ln as ModuleSpecification, Lp as appendWithoutApplying, Lr as PartialState, Ls as MoveOperationInputSchema, Lt as DocumentAction, Lu as base64UrlToBytes, Ma as UndoRedoAction, Mc as UndoSchema, Md as MoveGrantActionInput, Mf as addStateExample, Mi as SetModelExtensionInput, Ml as sign, Mm as createAuthState, Mn as MakeOptional, Mp as IntegrityIssueType, Mr as OperationErrorSpecification, Ms as DocumentModelGlobalStateSchema, Mt as DeleteOperationExampleAction, Mu as AUTH_VERSION_UNSUPPORTED_REASON, Na as UpdateChangeLogItemAction, Nc as UpdateChangeLogItemInputSchema, Nd as MoveGrantActionInputSchema, Nf as baseActions, Ni as SetModelIdAction, Nl as validateHeader, Nm as createBaseState, Nn as Manifest, Np as PHDocument, Nr as OperationIndex, Ns as DocumentModelInputSchema, Nt as DeleteOperationExampleInput, Nu as DOCUMENT_DELETED_REASON, Oa as SubgraphModule, Oc as Set_PreferredEditorSchema, Od as InitializeAuthActionInput, Of as addModule, Oi as SetInitialStateInput, Ol as createSignedHeader, Om as PHDocumentState, On as LoadFromFile, Op as updateOperationExample, Or as MutationUpdateChangeLogItemInputArgs, Os as DeleteOperationExampleInputSchema, Ot as DeleteModuleInput, Ou as isDocumentModelDocument, Pa as UpdateChangeLogItemInput, Pc as UpdateOperationExampleInputSchema, Pd as RemoveGrantAction, Pf as buildOperationSignature, Pi as SetModelIdInput, Pl as verify, Pm as createDocumentState, Pn as MappedOperation, Pp as PHDocumentHeader, Pr as OperationSpecification, Ps as DocumentSpecificationSchema, Pt as DeleteOperationInput, Pu as isDenied, Q as AddOperationErrorAction, Qc as PURGE_DOCUMENT, Qd as mentionedGroupIds, Qf as reorderChangeLogItems, Qi as SetOperationErrorTemplateAction, Ql as replayDocumentVersioned, Qm as isSignaturePolicy, Qn as MutationDeleteStateExampleArgs, Qo as assertOperationErrorIdUnique, Qp as isDocumentAction, Qr as RemoveRelationshipAction, Qs as ReorderModulesInputSchema, Qt as DocumentModelOperationErrorOperations, Qu as documentModelInitialLocalState, Ra as UpdateRelationshipActionInput, Rc as documentModelHeaderReducer, Rd as SetGrantActionInput, Rf as deleteModule, Ri as SetModuleDescriptionInput, Rl as baseSaveToFileHandle, Rm as defaultAuthState, Rn as MoveOperationAction, Rp as attachBranch, Rr as PhAiToolAnnotations, Rs as OperationErrorSchema, Rt as DocumentModelAction, Ru as buildOperationSignatureMessage, Sa as SignatureVerificationHandler, Sc as SetOperationScopeInputSchema, Sd as AuthRefusal, Sf as ActionContext, Si as ScopeState, Sl as mergePeerCapabilities, Sm as Capability, Sn as ISignalResult, Sp as setOperationScope, Sr as MutationSetOperationNameArgs, Ss as CodeExampleSchema, St as DeleteChangeLogItemInput, Su as BaseDocumentStateSchema, Ta as SkipHeaderOperations, Tc as SetPreferredEditorActionSchema, Td as AuthVerb, Tf as actionSigner, Ti as SetAuthorWebsiteAction, Tl as selectProtocolVersions, Tm as Operand, Tn as InputMaybe, Tp as setStateSchema, Tr as MutationSetOperationTemplateArgs, Ts as DeleteChangeLogItemInputSchema, Tt as DeleteDocumentAction, Tu as DocumentModelSchema, U as ActionSignatureContext, Ua as User, Uc as documentModelReducer, Ud as applyRemoveGrantAction, Uf as documentModelActions, Ui as SetNameOperation, Ul as fetchFileBrowser, Um as defaultPHState, Un as MutationAddOperationArgs, Up as diffOperations, Ur as PurgeDocumentAction, Us as PowerhouseModuleSchema, Ut as DocumentModelHeaderOperations, Uu as hex2ab, Va as UpgradeDocumentAction, Vc as documentModelOperationExampleReducer, Vd as applyInitializeAuthAction, Vf as deleteOperationExample, Vi as SetNameAction, Vl as documentModelLoadFromInput, Vm as defaultGlobalState, Vn as MutationAddChangeLogItemInputArgs, Vp as checkCleanedOperationsIntegrity, Vr as PowerhouseModule, Vs as PieceModuleSchema, Vt as DocumentModelGlobalState, Vu as getUnixTimestamp, W as ActionSigningHandler, Wa as ValidationError, Wc as documentModelStateReducer, Wd as applySetGrantAction, Wf as moveOperation, Wi as SetOperationDescriptionAction, Wl as getFileBrowser, Wm as DEFAULT_SIGNATURE_POLICY, Wn as MutationAddOperationErrorArgs, Wp as filterDocumentOperationsResultingState, Wr as PurgeDocumentActionInput, Ws as PowerhouseModulesSchema, Wt as DocumentModelInput, Wu as HASH_ALGORITHM_SHA1, X as AddModuleInput, Xc as replayOperations, Xd as isAuthAction, Xf as redo, Xi as SetOperationErrorNameAction, Xl as VersionedReducers, Xm as deriveDocumentId, Xn as MutationDeleteOperationErrorArgs, Xo as ReservedOperationName, Xp as groupOperationsByScope, Xr as ReducerOptions, Xs as ReorderChangeLogItemsInputSchema, Xt as DocumentModelOperationAction, Xu as documentModelGlobalState, Y as AddModuleAction, Yc as processUndoRedo, Yd as initializeAuth, Yf as operationWithContext, Yi as SetOperationErrorDescriptionInput, Yl as zipEntries, Ym as SignaturePolicy, Yn as MutationDeleteOperationArgs, Yo as RESERVED_OPERATION_NAMES, Yp as getDocumentLastModified, Yr as Reducer, Ys as RedoSchema, Yt as DocumentModelModuleOperations, Yu as documentModelFileExtension, Z as AddOperationAction, Zc as updateDocument, Zd as isDocumentCreator, Zf as releaseNewVersion, Zi as SetOperationErrorNameInput, Zl as VersionedReplayConfig, Zm as isDerivedDocumentId, Zn as MutationDeleteOperationExampleArgs, Zo as assertModuleIdUnique, Zp as hashDocumentStateForScope, Zr as ReleaseNewVersionAction, Zs as ReorderModuleOperationsInputSchema, Zt as DocumentModelOperationErrorAction, Zu as documentModelInitialGlobalState, _a as Signal, _c as SetOperationErrorNameInputSchema, _d as referencedGroupIds, _f as isV2ActionHash, _h as PHDocumentSignatureInfo, _i as SchemaNOOPAction, _l as isOlderManifest, _m as sortOperations, _n as IAction, _p as setOperationErrorName, _r as MutationSetOperationDescriptionArgs, _s as AddOperationErrorInputSchema, _t as CreateDocument, _u as UnsupportedDocumentModelVersionError, aa as SetOperationSchemaInput, ac as SetInitialStateInputSchema, ad as MAX_CAPABILITY_OPERATIONS, af as TransportSigner, ah as OperationContext, ai as ReorderModulesInput, al as FeatureCapability, am as nextSkipNumber, an as DocumentModelUtils, ap as setAuthorWebsite, ar as MutationReorderOperationExamplesArgs, as as getAllOperationNames, at as AddStateExampleAction, au as withProtocolVersions, ba as SignalResults, bc as SetOperationReducerInputSchema, bd as AuthDecision, bf as v2TupleProblem, bh as deserializeSignature, bi as SchemaSetPreferredEditorAction, bl as localSupports, bm as withSignaturePolicy, bn as IOperation, bp as setOperationReducer, br as MutationSetOperationErrorNameArgs, bs as AddStateExampleInputSchema, bt as CreateState, bu as groupMembershipActionTypes, ca as SetOperationTemplateAction, cc as SetModelIdInputSchema, cd as assertAuthAdministrationRetained, cf as ActionSignerIdentity, ch as operationOutcome, ci as ReorderOperationExamplesAction, cl as PEER_CAPABILITIES, cm as precedes, cn as DocumentOperationsIgnoreMap, cp as setModelExtension, cr as MutationSetAuthorWebsiteArgs, cs as validateInitialState, ct as AssertIsStateOfType, cu as AuthInitializerNotCreatorError, da as SetPreferredEditorActionInput, dc as SetModuleNameInputSchema, dd as assertValidInitialGrants, df as DOCUMENT_SCOPE_ACTION_TYPES, dh as setPreferredEditorOperation, di as ReorderStateExamplesInput, dl as PeerCapabilityFlags, dm as removeExistingOperations, dn as EditorDispatch, dp as setModuleDescription, dr as MutationSetModelExtensionArgs, ds as validateModules, dt as ConfigEntry, du as FileSystemError, ea as SetOperationNameAction, ec as ReorderOperationExamplesInputSchema, ed as AuthAdministrationMissingError, ef as removeGrant, eh as requestedSignaturePolicy, ei as ReorderChangeLogItemsAction, el as isPurgeMarker, em as isUndo, en as DocumentModelOperationExampleOperations, ep as reorderModules, er as MutationRedoArgs, es as assertOperationIdUnique, et as AddOperationExampleAction, eu as UpgradeReducer, fa as SetPreferredEditorOperation, fc as SetNameActionInputSchema, fd as evaluateCondition, ff as actionPreimageV2, fh as undoOperation, fi as ReplayDocumentOptions, fl as PeerManifest, fm as replayDocument, fn as EditorModule, fp as setModuleName, fr as MutationSetModelIdArgs, fs as validateOperationName, ft as ConfigEntryType, fu as GrantNotFoundError, ga as Set_PreferredEditor, gc as SetOperationErrorDescriptionInputSchema, gd as isPlainValue, gf as hashActionV2, gh as HashConfig, gi as Scalars, gl as holdReason, gm as sortMappedOperations, gn as GetDocumentOptions, gp as setOperationErrorDescription, gr as MutationSetNameArgs, gs as AddModuleInputSchema, gt as CreateChildDocumentSignal, gu as InvalidAuthVersionError, ha as Set_Name, hc as SetOperationErrorCodeInputSchema, hd as grantProblem, hf as canonicalJson, hh as AppActionSigner, hi as SaveToFileHandle, hl as coversLocal, hm as skipHeaderOperations, hn as FileInput, hp as setOperationErrorCode, hr as MutationSetModuleNameArgs, hs as AddChangeLogItemInputSchema, ht as CreateChildDocumentInput, hu as InvalidActionInputZodError, ia as SetOperationSchemaAction, ic as SetAuthorWebsiteInputSchema, id as MAX_AUTH_GRANTS, if as TransportActionContext, ih as Operation, ii as ReorderModulesAction, il as DOCUMENT_PURGE_PROTOCOL, im as merge, in as DocumentModelStateOperations, ip as setAuthorName, ir as MutationReorderOperationErrorsArgs, is as findOperationOrThrow, it as AddRelationshipActionInput, iu as computeUpgradeTransitions, ja as UndoActionInput, jc as UndoActionSchema, jd as MoveGrantAction, jf as addOperationExample, ji as SetModelExtensionAction, jl as hasDerivedDocumentId, jm as backfillAuthState, jn as MakeMaybe, jp as IntegrityIssueSubType, jr as NOOPAction, js as DocumentActionSchema, jt as DeleteOperationErrorInput, ju as AUTH_NO_GRANT_REASON, ka as Undo, kc as StateSchema, kd as InitializeAuthActionInputSchema, kf as addOperation, ki as SetModelDescriptionAction, kl as createSignedHeaderForSigner, km as PHGroupState, kn as LoadFromInput, kp as updateStateExample, kr as MutationUpdateOperationExampleArgs, ks as DeleteOperationInputSchema, kt as DeleteOperationAction, ku as isDocumentModelState, la as SetOperationTemplateInput, lc as SetModelNameInputSchema, ld as assertValidGrant, lf as ActionSigningTarget, lh as redoOperation, li as ReorderOperationExamplesInput, ll as PEER_MANIFEST_FORMAT, lm as prepareOperations, ln as DocumentSpecification, lp as setModelId, lr as MutationSetInitialStateArgs, ls as validateModule, lt as Author, lu as AuthPolicyNotPreservedError, ma as SetStateSchemaInput, mc as SetOperationDescriptionInputSchema, md as evaluateGrants, mf as actionSigningTarget, mh as ActionSigner, mi as SaveToFile, ml as Supports, mm as reshuffleByTimestampAndIndex, mn as Exact, mp as setOperationDescription, mr as MutationSetModuleDescriptionArgs, ms as validateStateSchemaName, mt as CopyChildDocumentSignal, mu as InvalidActionInputError, na as SetOperationReducerAction, nc as ScopeStateSchema, nd as GroupPrincipalNotAllowedError, nf as setGrant, nh as v2RequiredProtocolVersions, ni as ReorderModuleOperationsAction, nl as purgeMarkerOperation, nm as mapSkippedOperations, nn as DocumentModelPHState, np as reorderOperationExamples, nr as MutationReorderModuleOperationsArgs, ns as findOperationErrorOrThrow, nt as AddOperationInput, nu as applyDeleteDocumentAction, oa as SetOperationScopeAction, oc as SetModelDescriptionInputSchema, od as MAX_CONDITION_DEPTH, of as toTransportAction, oh as OperationOutcome, oi as ReorderOperationErrorsAction, ol as HoldReason, om as operationsAreEqual, on as DocumentModelVersioningAction, op as setInitialState, or as MutationReorderStateExamplesArgs, os as isReservedOperationName, ot as AddStateExampleInput, ou as AuthActionNotAllowedError, pa as SetStateSchemaAction, pc as SetNameActionSchema, pd as evaluateGrantStack, pf as actionSignerIdentity, ph as undoOperationV2, pi as RevisionsFilter, pl as ProtocolCapability, pm as reshuffleByTimestamp, pn as EditorProps, pp as setName, pr as MutationSetModelNameArgs, ps as validateOperations, pt as CopyChildDocumentInput, pu as HashMismatchError, q as AddChangeLogItemAction, qc as baseReducer, qd as decide, qf as operationFromAction, qi as SetOperationErrorCodeInput, ql as readFileBrowser, qm as SIGNATURE_PROTOCOL, qn as MutationDeleteChangeLogItemInputArgs, qp as garbageCollectDocumentOperations, qr as RedoAction, qs as RedoActionInputSchema, qt as DocumentModelModule, qu as HASH_ENCODING_BASE64, ra as SetOperationReducerInput, rc as SetAuthorNameInputSchema, rd as InvalidGrantError, rf as TransportAction, rh as DocumentOperations, ri as ReorderModuleOperationsInput, rl as purgedProtocolVersions, rm as mapSkippedOperationsV2, rn as DocumentModelStateAction, rp as reorderStateExamples, rr as MutationReorderModulesArgs, rs as findOperationExampleOrThrow, rt as AddRelationshipAction, ru as applyUpgradeDocumentAction, sa as SetOperationScopeInput, sc as SetModelExtensionInputSchema, sd as MAX_CONDITION_NODES, sf as ACTION_SIGNATURE_V2_PREFIX, sh as OperationWithContext, si as ReorderOperationErrorsInput, sl as MARKER_REFUSAL_FEATURE, sm as parseResultingState, sn as DocumentModelVersioningOperations, sp as setModelDescription, sr as MutationSetAuthorNameArgs, ss as isValidOperationNameFormat, st as AssertIsDocumentOfType, su as AuthAlreadyInitializedError, ta as SetOperationNameInput, tc as ReorderStateExamplesInputSchema, td as GrantSchema, tf as resolveSnapshotAuth, th as signaturePolicyOf, ti as ReorderChangeLogItemsInput, tl as purgeDocumentAction, tm as isUndoRedo, tn as DocumentModelOperationOperations, tp as reorderOperationErrors, tr as MutationReorderChangeLogItemsInputArgs, ts as findModuleOrThrow, tt as AddOperationExampleInput, tu as UpgradeTransition, ua as SetPreferredEditorAction, uc as SetModuleDescriptionInputSchema, ud as assertValidGrantUpsert, uf as CanonicalJsonError, uh as setNameOperation, ui as ReorderStateExamplesAction, ul as PeerCapability, um as readOnly, un as ENSInfo, up as setModelName, ur as MutationSetModelDescriptionArgs, us as validateModuleOperation, ut as CodeExample, uu as DowngradeNotSupportedError, va as SignalDispatch, vc as SetOperationErrorTemplateInputSchema, vd as AUTH_ACTION_TYPES, vf as signActionV2, vh as Signature, vi as SchemaRedoAction, vl as legacySupports, vm as split, vn as ID, vp as setOperationErrorTemplate, vr as MutationSetOperationErrorCodeArgs, vs as AddOperationExampleInputSchema, vt as CreateDocumentAction, vu as documentModelDocumentType, wa as SkipHeaderOperationIndex, wc as SetPreferredEditorActionInputSchema, wd as AuthSubject, wf as actionFromAction, wi as SetAuthorNameInput, wl as readPeerManifest, wm as Grant, wn as Incremental, wp as setPreferredEditor, wr as MutationSetOperationSchemaArgs, ws as ConfigEntryTypeSchema, wt as DeleteChildDocumentSignal, wu as DocumentModelPHStateSchema, xa as SignalType, xc as SetOperationSchemaInputSchema, xd as AuthEvaluation, xf as Action, xh as serializeSignature, xi as SchemaUndoAction, xl as manifestRevision, xm as AuthGroups, xn as ISignal, xp as setOperationSchema, xr as MutationSetOperationErrorTemplateArgs, xs as AuthorSchema, xt as DeleteChangeLogItemAction, xu as BaseDocumentHeaderSchema, ya as SignalResult, yc as SetOperationNameInputSchema, yd as AuthAction, yf as targetDocumentId, yh as UserActionSigner, yi as SchemaSetNameAction, yl as localPeerManifest, ym as updateHeaderRevision, yn as IDocument, yp as setOperationName, yr as MutationSetOperationErrorDescriptionArgs, ys as AddOperationInputSchema, yt as CreateDocumentActionInput, yu as groupDocumentType, za as UpdateStateExampleAction, zc as documentModelModuleReducer, zd as SetGrantActionInputSchema, zf as deleteOperation, zi as SetModuleNameAction, zl as createMinimalZip, zm as defaultBaseState, zn as MoveOperationInput, zp as baseCreateDocument, zr as PhAiToolDescriptor, zs as OperationScopeSchema, zt as DocumentModelDocument, zu as buildOperationSignatureParams } from "../types-BRJfX8ck.js";
2
+ import { t as normalizeDocumentModelVersion } from "../version-BxLITo9P.js";
2
3
  import { n as generateId, r as generateMock, t as deriveOperationId } from "../utils-BrKxCmKx.js";
3
4
  export { ACTION_SIGNATURE_V2_PREFIX, AUTH_ACTION_TYPES, AUTH_DENIED_BY_GRANT_REASON, AUTH_NO_GRANT_REASON, AUTH_VERSION_UNSUPPORTED_REASON, Action, ActionContext, type ActionErrorCallback, type ActionSignatureContext, ActionSigner, ActionSignerIdentity, type ActionSigningHandler, ActionSigningTarget, type ActionVerificationHandler, type Actions, type AddChangeLogItemAction, type AddChangeLogItemInput, AddChangeLogItemInputSchema, type AddModuleAction, type AddModuleInput, AddModuleInputSchema, type AddOperationAction, type AddOperationErrorAction, type AddOperationErrorInput, AddOperationErrorInputSchema, type AddOperationExampleAction, type AddOperationExampleInput, AddOperationExampleInputSchema, type AddOperationInput, AddOperationInputSchema, type AddRelationshipAction, type AddRelationshipActionInput, type AddStateExampleAction, type AddStateExampleInput, AddStateExampleInputSchema, AppActionSigner, type AssertIsDocumentOfType, type AssertIsStateOfType, AuthAction, AuthActionNotAllowedError, AuthAdministrationLockoutError, AuthAdministrationMissingError, AuthAlreadyInitializedError, AuthDecision, AuthEvaluation, AuthGroups, AuthInitializerNotCreatorError, AuthPolicyNotPreservedError, AuthRefusal, AuthRequest, AuthSubject, AuthVerb, type Author, AuthorSchema, BaseDocumentHeaderSchema, BaseDocumentStateSchema, BulkArchiveEntry, CanonicalJsonError, Capability, type CodeExample, CodeExampleSchema, Condition, ConditionContext, type ConfigEntry, ConfigEntrySchema, type ConfigEntryType, ConfigEntryTypeSchema, type CopyChildDocumentInput, type CopyChildDocumentSignal, type CreateChildDocumentInput, type CreateChildDocumentSignal, type CreateDocument, type CreateDocumentAction, type CreateDocumentActionInput, type CreateState, DEFAULT_SIGNATURE_POLICY, DOCUMENT_DELETED_REASON, DOCUMENT_PURGE_PROTOCOL, DOCUMENT_SCOPE_ACTION_TYPES, type DeleteChangeLogItemAction, type DeleteChangeLogItemInput, DeleteChangeLogItemInputSchema, type DeleteChildDocumentInput, type DeleteChildDocumentSignal, type DeleteDocumentAction, type DeleteDocumentActionInput, type DeleteModuleAction, type DeleteModuleInput, DeleteModuleInputSchema, type DeleteOperationAction, type DeleteOperationErrorAction, type DeleteOperationErrorInput, DeleteOperationErrorInputSchema, type DeleteOperationExampleAction, type DeleteOperationExampleInput, DeleteOperationExampleInputSchema, type DeleteOperationInput, DeleteOperationInputSchema, type DeleteStateExampleAction, type DeleteStateExampleInput, DeleteStateExampleInputSchema, type DocumentAction, DocumentActionSchema, DocumentIdParams, type DocumentModelAction, type DocumentModelDocument, type DocumentModelDocumentModelModule, type DocumentModelGlobalState, DocumentModelGlobalStateSchema, type DocumentModelHeaderAction, type DocumentModelHeaderOperations, DocumentModelHeaderSchema, type DocumentModelInput, DocumentModelInputSchema, type DocumentModelLib, type DocumentModelLocalState, type DocumentModelModule, type DocumentModelModuleAction, type DocumentModelModuleOperations, type DocumentModelOperationAction, type DocumentModelOperationErrorAction, type DocumentModelOperationErrorOperations, type DocumentModelOperationExampleAction, type DocumentModelOperationExampleOperations, type DocumentModelOperationOperations, type DocumentModelPHState, DocumentModelPHStateSchema, DocumentModelSchema, type DocumentModelStateAction, type DocumentModelStateOperations, type DocumentModelUtils, type DocumentModelVersioningAction, type DocumentModelVersioningOperations, DocumentOperations, type DocumentOperationsIgnoreMap, type DocumentSpecification, DocumentSpecificationSchema, DowngradeNotSupportedError, type ENSInfo, type EditorDispatch, type EditorModule, type EditorProps, type Exact, FeatureCapability, type FileInput, FileSystemError, type GetDocumentOptions, Grant, GrantNotFoundError, GrantSchema, GroupPrincipalNotAllowedError, HASH_ALGORITHM_SHA1, HASH_ALGORITHM_SHA256, HASH_ALGORITHM_SHA512, HASH_ENCODING_BASE64, HASH_ENCODING_HEX, HashConfig, HashMismatchError, HoldReason, type IAction, type ID, type IDocument, type IOperation, type ISignal, type ISignalResult, type ISigner, type Incremental, InitializeAuthAction, InitializeAuthActionInput, InitializeAuthActionInputSchema, type InputMaybe, IntegrityIssueSubType, IntegrityIssueType, InvalidActionInputError, InvalidActionInputZodError, InvalidAuthVersionError, InvalidGrantError, type IsDocumentOfType, type IsStateOfType, type LoadFromFile, type LoadFromInput, MARKER_REFUSAL_FEATURE, MAX_AUTH_GRANTS, MAX_CAPABILITY_OPERATIONS, MAX_CONDITION_DEPTH, MAX_CONDITION_NODES, MAX_SUPPORTED_AUTH_VERSION, type MakeEmpty, type MakeMaybe, type MakeOptional, type Manifest, ManifestSchema, type MappedOperation, type Maybe, type MinimalBackupData, ModuleSchema, type ModuleSpecification, MoveGrantAction, MoveGrantActionInput, MoveGrantActionInputSchema, type MoveOperationAction, type MoveOperationInput, MoveOperationInputSchema, type Mutation, type MutationAddChangeLogItemInputArgs, type MutationAddModuleArgs, type MutationAddOperationArgs, type MutationAddOperationErrorArgs, type MutationAddOperationExampleArgs, type MutationAddStateExampleArgs, type MutationDeleteChangeLogItemInputArgs, type MutationDeleteModuleArgs, type MutationDeleteOperationArgs, type MutationDeleteOperationErrorArgs, type MutationDeleteOperationExampleArgs, type MutationDeleteStateExampleArgs, type MutationMoveOperationArgs, type MutationRedoArgs, type MutationReorderChangeLogItemsInputArgs, type MutationReorderModuleOperationsArgs, type MutationReorderModulesArgs, type MutationReorderOperationErrorsArgs, type MutationReorderOperationExamplesArgs, type MutationReorderStateExamplesArgs, type MutationSetAuthorNameArgs, type MutationSetAuthorWebsiteArgs, type MutationSetInitialStateArgs, type MutationSetModelDescriptionArgs, type MutationSetModelExtensionArgs, type MutationSetModelIdArgs, type MutationSetModelNameArgs, type MutationSetModuleDescriptionArgs, type MutationSetModuleNameArgs, type MutationSetNameArgs, type MutationSetOperationDescriptionArgs, type MutationSetOperationErrorCodeArgs, type MutationSetOperationErrorDescriptionArgs, type MutationSetOperationErrorNameArgs, type MutationSetOperationErrorTemplateArgs, type MutationSetOperationNameArgs, type MutationSetOperationReducerArgs, type MutationSetOperationSchemaArgs, type MutationSetOperationTemplateArgs, type MutationSetStateSchemaArgs, type MutationUndoArgs, type MutationUpdateChangeLogItemInputArgs, type MutationUpdateOperationExampleArgs, type MutationUpdateStateExampleArgs, type NOOPAction, OPERATION_NAME_PATTERN, Operand, Operation, OperationContext, OperationErrorSchema, type OperationErrorSpecification, type OperationIndex, OperationOutcome, OperationScopeSchema, type OperationSpecification, OperationSpecificationSchema, OperationWithContext, type OperationsByScope, PEER_CAPABILITIES, PEER_MANIFEST_FORMAT, PHAuthState, PHBaseState, PHDocument, PHDocumentHeader, PHDocumentMeta, PHDocumentSignatureInfo, PHDocumentState, PHGroupState, PURGE_DOCUMENT, type PartialRecord, type PartialState, PeerCapability, PeerCapabilityFlags, PeerManifest, type PhAiToolAnnotations, type PhAiToolDescriptor, type PieceModule, PieceModuleSchema, PieceModulesSchema, type PowerhouseModule, PowerhouseModuleSchema, PowerhouseModulesSchema, Principal, ProtocolCapability, ProtocolVersions, type Publisher, PublisherSchema, type PurgeDocumentAction, type PurgeDocumentActionInput, PurgeMarkerOperation, PwaConfigSchema, type Query, RESERVED_OPERATION_NAMES, type Redo, type RedoAction, type RedoActionInput, RedoActionInputSchema, RedoActionSchema, RedoSchema, type Reducer, type ReducerOptions, type ReleaseNewVersionAction, RemoveGrantAction, RemoveGrantActionInput, RemoveGrantActionInputSchema, type RemoveRelationshipAction, type RemoveRelationshipActionInput, type ReorderChangeLogItemsAction, type ReorderChangeLogItemsInput, ReorderChangeLogItemsInputSchema, type ReorderModuleOperationsAction, type ReorderModuleOperationsInput, ReorderModuleOperationsInputSchema, type ReorderModulesAction, type ReorderModulesInput, ReorderModulesInputSchema, type ReorderOperationErrorsAction, type ReorderOperationErrorsInput, ReorderOperationErrorsInputSchema, type ReorderOperationExamplesAction, type ReorderOperationExamplesInput, ReorderOperationExamplesInputSchema, type ReorderStateExamplesAction, type ReorderStateExamplesInput, ReorderStateExamplesInputSchema, type ReplayDocumentOptions, ReservedOperationName, type RevisionsFilter, SIGNATURE_PROTOCOL, SIGNATURE_PROTOCOL_V2, type SaveToFile, type SaveToFileHandle, type Scalars, type SchemaNOOPAction, type SchemaRedoAction, type SchemaSetNameAction, type SchemaSetPreferredEditorAction, type SchemaUndoAction, type ScopeState, ScopeStateSchema, type SetAuthorNameAction, type SetAuthorNameInput, SetAuthorNameInputSchema, type SetAuthorWebsiteAction, type SetAuthorWebsiteInput, SetAuthorWebsiteInputSchema, SetGrantAction, SetGrantActionInput, SetGrantActionInputSchema, type SetInitialStateAction, type SetInitialStateInput, SetInitialStateInputSchema, type SetModelDescriptionAction, type SetModelDescriptionInput, SetModelDescriptionInputSchema, type SetModelExtensionAction, type SetModelExtensionInput, SetModelExtensionInputSchema, type SetModelIdAction, type SetModelIdInput, SetModelIdInputSchema, type SetModelNameAction, type SetModelNameInput, SetModelNameInputSchema, type SetModuleDescriptionAction, type SetModuleDescriptionInput, SetModuleDescriptionInputSchema, type SetModuleNameAction, type SetModuleNameInput, SetModuleNameInputSchema, type SetNameAction, type SetNameActionInput, SetNameActionInputSchema, SetNameActionSchema, type SetNameOperation, type SetOperationDescriptionAction, type SetOperationDescriptionInput, SetOperationDescriptionInputSchema, type SetOperationErrorCodeAction, type SetOperationErrorCodeInput, SetOperationErrorCodeInputSchema, type SetOperationErrorDescriptionAction, type SetOperationErrorDescriptionInput, SetOperationErrorDescriptionInputSchema, type SetOperationErrorNameAction, type SetOperationErrorNameInput, SetOperationErrorNameInputSchema, type SetOperationErrorTemplateAction, type SetOperationErrorTemplateInput, SetOperationErrorTemplateInputSchema, type SetOperationNameAction, type SetOperationNameInput, SetOperationNameInputSchema, type SetOperationReducerAction, type SetOperationReducerInput, SetOperationReducerInputSchema, type SetOperationSchemaAction, type SetOperationSchemaInput, SetOperationSchemaInputSchema, type SetOperationScopeAction, type SetOperationScopeInput, SetOperationScopeInputSchema, type SetOperationTemplateAction, type SetOperationTemplateInput, SetOperationTemplateInputSchema, type SetPreferredEditorAction, type SetPreferredEditorActionInput, SetPreferredEditorActionInputSchema, SetPreferredEditorActionSchema, type SetPreferredEditorOperation, type SetStateSchemaAction, type SetStateSchemaInput, SetStateSchemaInputSchema, type Set_Name, Set_NameSchema, type Set_PreferredEditor, Set_PreferredEditorSchema, type Signal, type SignalDispatch, type SignalResult, type SignalResults, type SignalType, Signature, SignaturePolicy, type SignatureVerificationHandler, type SigningParameters, type SkipHeaderOperationIndex, type SkipHeaderOperations, type State, type StateReducer, StateSchema, type SubgraphModule, Supports, TransportAction, TransportActionContext, TransportSigner, type Undo, type UndoAction, type UndoActionInput, UndoActionInputSchema, UndoActionSchema, type UndoRedoAction, UndoSchema, UnsupportedDocumentModelVersionError, type UpdateChangeLogItemAction, type UpdateChangeLogItemInput, UpdateChangeLogItemInputSchema, type UpdateOperationExampleAction, type UpdateOperationExampleInput, UpdateOperationExampleInputSchema, type UpdateRelationshipAction, type UpdateRelationshipActionInput, type UpdateStateExampleAction, type UpdateStateExampleInput, UpdateStateExampleInputSchema, type UpgradeDocumentAction, type UpgradeDocumentActionInput, UpgradeManifest, UpgradeReducer, UpgradeTransition, type User, UserActionSigner, type ValidationError, VersionedReducers, VersionedReplayConfig, ab2hex, actionContext, actionFromAction, actionPreimageV2, actionSigner, actionSignerIdentity, actionSigningTarget, actions, addChangeLogItem, addModule, addOperation, addOperationError, addOperationExample, addStateExample, addUndo, appendWithoutApplying, applyAuthAction, applyDeleteDocumentAction, applyInitializeAuthAction, applyMoveGrantAction, applyRemoveGrantAction, applySetGrantAction, applyUpgradeDocumentAction, assertAuthAdministrationRetained, assertAuthPreservedOnDuplicate, assertAuthScopeActionAllowed, assertIsDocumentModelDocument, assertIsDocumentModelState, assertModuleIdUnique, assertOperationErrorIdUnique, assertOperationExampleIdUnique, assertOperationIdUnique, assertValidGrant, assertValidGrantUpsert, assertValidInitialGrants, attachBranch, backfillAuthState, base58Decode, base64UrlToBytes, baseActions, baseCreateDocument, baseLoadFromInput, baseLoadFromInputVersioned, baseReducer, baseReducerVersion, baseSaveToFileHandle, buildOperationSignature, buildOperationSignatureMessage, buildOperationSignatureParams, buildSignedAction, bytesToBase64Url, canonicalJson, checkCleanedOperationsIntegrity, checkOperationsIntegrity, computeUpgradeTransitions, coversLocal, createAction, createAuthState, createBaseState, createCopyHeader, createDocumentState, createGlobalState, createLocalState, createMinimalZip, createPresignedHeader, createReducer, createSignedHeader, createSignedHeaderForSigner, createState, createVerificationSigner, createZip, decide, defaultAuthState, defaultBaseState, defaultDocumentState, defaultGlobalState, defaultLocalState, defaultPHState, definedNonNullAnySchema, deleteChangeLogItem, deleteModule, deleteOperation, deleteOperationError, deleteOperationExample, deleteStateExample, deriveDocumentId, deriveOperationId, deserializeSignature, diffOperations, documentModelActions, documentModelDocumentType, documentModelFileExtension, documentModelGlobalState, documentModelHeaderReducer, documentModelInitialGlobalState, documentModelInitialLocalState, documentModelLoadFromInput, documentModelModuleReducer, documentModelOperationErrorReducer, documentModelOperationExampleReducer, documentModelOperationReducer, documentModelReducer, documentModelSaveToFileHandle, documentModelStateReducer, documentModelStateSchemaReducer, documentModelVersioningReducer, evaluate, evaluateCondition, evaluateGrantStack, evaluateGrants, fetchFileBrowser, filterDocumentOperationsResultingState, filterDuplicatedOperations, findModuleOrThrow, findOperationErrorOrThrow, findOperationExampleOrThrow, findOperationOrThrow, garbageCollect, garbageCollectDocumentOperations, garbageCollectV2, generateId, generateMock, getAllOperationNames, getDocumentLastModified, getFileBrowser, getUnixTimestamp, grantProblem, groupDocumentType, groupMembershipActionTypes, groupOperationsByScope, hasDerivedDocumentId, hashActionV2, hashBrowser, hashDocumentStateForScope, hex2ab, holdReason, initializeAuth, isAuthAction, isDefinedNonNullAny, isDenied, isDerivedDocumentId, isDocumentAction, isDocumentCreator, isDocumentModelDocument, isDocumentModelState, isDocumentZip, isNoopOperation, isOlderManifest, isPlainValue, isPurgeMarker, isReservedOperationName, isSignaturePolicy, isUndo, isUndoRedo, isV2ActionHash, isValidOperationNameFormat, legacySupports, localPeerManifest, localSupports, manifestRevision, mapSkippedOperations, mapSkippedOperationsV2, mentionedGroupIds, merge, mergePeerCapabilities, moveGrant, moveOperation, nextSkipNumber, noop, normalizeDocumentModelVersion, operationExampleCreators, operationFromAction, operationFromOperation, operationOutcome, operationWithContext, operationsAreEqual, parseBulkArchive, parseResultingState, peerSupports, precedes, prepareOperations, processUndoRedo, protocolVersionsFor, purgeDocumentAction, purgeMarkerOperation, purgedProtocolVersions, readFileBrowser, readOnly, readPeerManifest, redo, redoOperation, referencedGroupIds, releaseNewVersion, removeExistingOperations, removeGrant, reorderChangeLogItems, reorderModuleOperations, reorderModules, reorderOperationErrors, reorderOperationExamples, reorderStateExamples, replayDocument, replayDocumentVersioned, replayOperations, requestedSignaturePolicy, reshuffleByTimestamp, reshuffleByTimestampAndIndex, resolveSnapshotAuth, selectProtocolVersions, serializeSignature, setAuthorName, setAuthorWebsite, setGrant, setInitialState, setModelDescription, setModelExtension, setModelId, setModelName, setModuleDescription, setModuleName, setName, setNameOperation, setOperationDescription, setOperationErrorCode, setOperationErrorDescription, setOperationErrorName, setOperationErrorTemplate, setOperationName, setOperationReducer, setOperationSchema, setOperationScope, setOperationTemplate, setPreferredEditor, setPreferredEditorOperation, setStateSchema, sign, signActionV2, signaturePolicyOf, skipHeaderOperations, sortMappedOperations, sortOperations, split, targetDocumentId, toTransportAction, undo, undoOperation, undoOperationV2, updateChangeLogItem, updateDocument, updateHeaderRevision, updateOperationExample, updateStateExample, v2RequiredProtocolVersions, v2TupleProblem, validateHeader, validateInitialState, validateModule, validateModuleOperation, validateModules, validateOperationName, validateOperations, validateStateSchemaName, verify, verifyOperationSignature, withProtocolVersions, withSignaturePolicy, writeFileBrowser, zipEntries };
4
5
  export {};
@@ -1,5 +1,7 @@
1
1
  import { a as base58Decode, c as buildOperationSignatureParams, d as hashBrowser, f as hex2ab, i as ab2hex, l as bytesToBase64Url, n as generateId, o as base64UrlToBytes, r as generateMock, s as buildOperationSignatureMessage, t as deriveOperationId, u as getUnixTimestamp } from "../utils-CSF716ux.js";
2
2
  import { A as signActionV2, C as DOCUMENT_SCOPE_ACTION_TYPES, D as canonicalJson, E as actionSigningTarget, M as v2TupleProblem, O as hashActionV2, S as CanonicalJsonError, T as actionSignerIdentity, _ as mergePeerCapabilities, a as purgedProtocolVersions, b as selectProtocolVersions, c as PEER_CAPABILITIES, d as holdReason, f as isOlderManifest, g as manifestRevision, h as localSupports, i as purgeMarkerOperation, j as targetDocumentId, k as isV2ActionHash, l as PEER_MANIFEST_FORMAT, m as localPeerManifest, n as isPurgeMarker, o as DOCUMENT_PURGE_PROTOCOL, p as legacySupports, r as purgeDocumentAction, s as MARKER_REFUSAL_FEATURE, t as PURGE_DOCUMENT, u as coversLocal, v as peerSupports, w as actionPreimageV2, x as ACTION_SIGNATURE_V2_PREFIX, y as readPeerManifest } from "../purge-v06m_oGz.js";
3
+ import { AuthActionNotAllowedError, AuthAlreadyInitializedError, AuthInitializerNotCreatorError, AuthPolicyNotPreservedError, DowngradeNotSupportedError, FileSystemError, GrantNotFoundError, HashMismatchError, InvalidActionInputError, InvalidActionInputZodError, InvalidAuthVersionError, UnsupportedDocumentModelVersionError } from "./errors.js";
4
+ import { normalizeDocumentModelVersion } from "./version.js";
3
5
  import { ZodError, z } from "zod";
4
6
  import { stringify } from "safe-stable-stringify";
5
7
  import { sha256 } from "@noble/hashes/sha2.js";
@@ -107,155 +109,6 @@ function toTransportSignerApp(app) {
107
109
  };
108
110
  }
109
111
  //#endregion
110
- //#region document-model/errors.ts
111
- const FileSystemError = /* @__PURE__ */ new Error("File system not available.");
112
- var InvalidActionInputError = class extends Error {
113
- data;
114
- constructor(data) {
115
- super();
116
- this.name = "InvalidActionInputError";
117
- this.data = data;
118
- this.message = this.message || `Invalid action input: ${JSON.stringify(data, null, 2)}`;
119
- }
120
- };
121
- var InvalidActionInputZodError = class extends InvalidActionInputError {
122
- issues;
123
- constructor(issues) {
124
- super(issues);
125
- this.issues = issues;
126
- this.name = "InvalidActionInputZodError";
127
- }
128
- };
129
- /**
130
- * Error thrown when attempting to downgrade a document version.
131
- */
132
- var DowngradeNotSupportedError = class extends Error {
133
- documentType;
134
- fromVersion;
135
- toVersion;
136
- constructor(documentType, fromVersion, toVersion) {
137
- super(`Downgrade not supported for ${documentType}: cannot upgrade from version ${fromVersion} to ${toVersion}`);
138
- this.name = "DowngradeNotSupportedError";
139
- this.documentType = documentType;
140
- this.fromVersion = fromVersion;
141
- this.toVersion = toVersion;
142
- }
143
- };
144
- /**
145
- * Thrown when INITIALIZE_AUTH is applied to an already-initialized auth scope.
146
- * The genesis action is valid only at auth revision zero.
147
- */
148
- var AuthAlreadyInitializedError = class extends Error {
149
- documentId;
150
- constructor(documentId) {
151
- super(`Auth scope already initialized for document ${documentId}: INITIALIZE_AUTH is valid only at auth revision zero`);
152
- this.name = "AuthAlreadyInitializedError";
153
- this.documentId = documentId;
154
- }
155
- };
156
- /**
157
- * Thrown when INITIALIZE_AUTH is not signed by the document creator (its signer
158
- * does not match `header.sig.publicKey`), so it cannot set the auth policy.
159
- */
160
- var AuthInitializerNotCreatorError = class extends Error {
161
- documentId;
162
- constructor(documentId) {
163
- super(`INITIALIZE_AUTH for document ${documentId} must be signed by the document creator`);
164
- this.name = "AuthInitializerNotCreatorError";
165
- this.documentId = documentId;
166
- }
167
- };
168
- /**
169
- * Thrown when INITIALIZE_AUTH carries a version below 1. Version 0 is reserved
170
- * for the uninitialized auth scope.
171
- */
172
- var InvalidAuthVersionError = class extends Error {
173
- documentId;
174
- version;
175
- constructor(documentId, version) {
176
- super(`Invalid auth policy version ${version} for document ${documentId}: INITIALIZE_AUTH requires an integer version >= 1`);
177
- this.name = "InvalidAuthVersionError";
178
- this.documentId = documentId;
179
- this.version = version;
180
- }
181
- };
182
- /** Thrown when a duplicate would lose the source policy's version or creator binding. */
183
- var AuthPolicyNotPreservedError = class extends Error {
184
- documentId;
185
- constructor(documentId) {
186
- super(`Duplicating document ${documentId} would not preserve its auth policy: the copy loses the policy version or its creator binding`);
187
- this.name = "AuthPolicyNotPreservedError";
188
- this.documentId = documentId;
189
- }
190
- };
191
- /**
192
- * Thrown when a grant referenced by REMOVE_GRANT or MOVE_GRANT does not exist.
193
- */
194
- var GrantNotFoundError = class extends Error {
195
- grantId;
196
- constructor(grantId) {
197
- super(`Grant not found in auth scope: ${grantId}`);
198
- this.name = "GrantNotFoundError";
199
- this.grantId = grantId;
200
- }
201
- };
202
- /**
203
- * Thrown when a disallowed action (UNDO, REDO) targets the auth scope.
204
- */
205
- var AuthActionNotAllowedError = class extends Error {
206
- actionType;
207
- constructor(actionType) {
208
- super(`${actionType} is not permitted on the auth scope`);
209
- this.name = "AuthActionNotAllowedError";
210
- this.actionType = actionType;
211
- }
212
- };
213
- var HashMismatchError = class extends Error {
214
- _scope;
215
- _document;
216
- _operation;
217
- constructor(scope, document, operation) {
218
- super();
219
- this.name = "HashMismatchError";
220
- this._document = document;
221
- this._scope = scope;
222
- this._operation = operation;
223
- this.message = JSON.stringify({
224
- error: `Hash mismatch on document ${document.header.id}, scope ${scope}, index ${operation.index}`,
225
- document,
226
- operation
227
- }, null, 1);
228
- }
229
- get document() {
230
- return this._document;
231
- }
232
- get scope() {
233
- return this._scope;
234
- }
235
- get operation() {
236
- return this._operation;
237
- }
238
- };
239
- /**
240
- * Thrown when replay or import requires a document model version that is not
241
- * registered. Carries the data the UI needs to explain the mismatch.
242
- */
243
- var UnsupportedDocumentModelVersionError = class extends Error {
244
- documentType;
245
- requiredVersion;
246
- availableVersions;
247
- constructor(documentType, requiredVersion, availableVersions) {
248
- super(`No reducer registered for document version ${requiredVersion}. Available versions: ${availableVersions.join(", ")}`);
249
- this.name = "UnsupportedDocumentModelVersionError";
250
- this.documentType = documentType;
251
- this.requiredVersion = requiredVersion;
252
- this.availableVersions = availableVersions;
253
- }
254
- static isError(error) {
255
- return Error.isError(error) && error.name === "UnsupportedDocumentModelVersionError";
256
- }
257
- };
258
- //#endregion
259
112
  //#region document-model/schemas.ts
260
113
  const isDefinedNonNullAny = (v) => v !== void 0 && v !== null;
261
114
  const definedNonNullAnySchema = z.any().refine((v) => isDefinedNonNullAny(v));
@@ -4697,17 +4550,6 @@ const documentModelStateReducer = (state, action) => {
4697
4550
  const documentModelReducer = createReducer(documentModelStateReducer);
4698
4551
  //#endregion
4699
4552
  //#region document-model/upgrades.ts
4700
- /**
4701
- * Canonical document-model version normalization: documents stamped with 0
4702
- * or nothing at all predate versioning and are treated as version 1, the
4703
- * same version the registry assigns unversioned modules. Every consumer
4704
- * that resolves a module or compares versions must use this rule; resolving
4705
- * 0 to "latest" instead re-pins a legacy document's history to whichever
4706
- * module happens to be newest.
4707
- */
4708
- function normalizeDocumentModelVersion(version) {
4709
- return version && version > 0 ? version : 1;
4710
- }
4711
4553
  function applyInitialState(document, action) {
4712
4554
  const input = action.input;
4713
4555
  const newState = input.initialState || input.state;