@powerhousedao/shared 6.2.3-dev.85 → 6.2.3-dev.87

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 (69) hide show
  1. package/dist/clis/args/{help-CmnOv3z3.d.mts → help-Cgh3krcq.d.mts} +14 -2
  2. package/dist/clis/args/help-Cgh3krcq.d.mts.map +1 -0
  3. package/dist/clis/args/{help-Cb66IK-J.mjs → help-DnOa5Gr-.mjs} +9 -1
  4. package/dist/clis/args/help-DnOa5Gr-.mjs.map +1 -0
  5. package/dist/clis/args/help.d.mts +1 -1
  6. package/dist/clis/args/help.mjs +2 -1
  7. package/dist/clis/args/index.d.mts +3 -2
  8. package/dist/clis/args/index.mjs +3 -2
  9. package/dist/clis/args/keyframes.d.mts +25 -0
  10. package/dist/clis/args/keyframes.d.mts.map +1 -0
  11. package/dist/clis/args/keyframes.mjs +42 -0
  12. package/dist/clis/args/keyframes.mjs.map +1 -0
  13. package/dist/clis/build-pieces.d.mts +1 -1
  14. package/dist/clis/command-names.d.mts +1 -1
  15. package/dist/clis/command-names.d.mts.map +1 -1
  16. package/dist/clis/command-names.mjs +1 -0
  17. package/dist/clis/command-names.mjs.map +1 -1
  18. package/dist/clis/constants.d.mts +1 -1
  19. package/dist/clis/index.d.mts +126 -3
  20. package/dist/clis/index.d.mts.map +1 -1
  21. package/dist/clis/index.mjs +92 -3
  22. package/dist/clis/index.mjs.map +1 -1
  23. package/dist/clis/{types-0G3o7wZE.d.mts → types-ByIjNbGg.d.mts} +45 -2
  24. package/dist/clis/{types-0G3o7wZE.d.mts.map → types-ByIjNbGg.d.mts.map} +1 -1
  25. package/dist/connect/config-loader.d.ts +1 -1
  26. package/dist/connect/connect-config-schema.d.ts +2 -2
  27. package/dist/connect/connect-config-schema.js +16 -3
  28. package/dist/connect/connect-config-schema.js.map +1 -1
  29. package/dist/connect/index.d.ts +3 -3
  30. package/dist/connect/index.js +2 -2
  31. package/dist/{connect-config-schema-c39dvEne.d.ts → connect-config-schema-LzQbfZHm.d.ts} +37 -3
  32. package/dist/{connect-config-schema-c39dvEne.d.ts.map → connect-config-schema-LzQbfZHm.d.ts.map} +1 -1
  33. package/dist/document-drive/index.d.ts +3 -3
  34. package/dist/document-drive/index.js +1 -1
  35. package/dist/document-model/dispatch.d.ts +1 -1
  36. package/dist/document-model/errors.d.ts +2 -2
  37. package/dist/document-model/errors.js +49 -1
  38. package/dist/document-model/errors.js.map +1 -1
  39. package/dist/document-model/index.d.ts +2 -3
  40. package/dist/document-model/index.js +5 -5
  41. package/dist/document-model/utils.d.ts +2 -2
  42. package/dist/document-model/utils.js +2 -2
  43. package/dist/{document-model-CMyP_XZ8.js → document-model-B98EymhI.js} +927 -402
  44. package/dist/document-model-B98EymhI.js.map +1 -0
  45. package/dist/{index-CR7EJfyR.d.ts → index-59YGevDz.d.ts} +2 -2
  46. package/dist/{index-CR7EJfyR.d.ts.map → index-59YGevDz.d.ts.map} +1 -1
  47. package/dist/index.d.ts +4 -4
  48. package/dist/processors/index.d.ts +2 -2
  49. package/dist/processors/index.js +1 -1
  50. package/dist/processors/testing.d.ts +1 -1
  51. package/dist/{purge-YMJM0Vl7.js → purge-BOqSpe4O.js} +224 -6
  52. package/dist/purge-BOqSpe4O.js.map +1 -0
  53. package/dist/registry/index.d.ts +2 -2
  54. package/dist/registry/manifest-slim.d.ts +2 -2
  55. package/dist/{types-DR4mZKAj.d.ts → types-D1ToC1mB.d.ts} +651 -126
  56. package/dist/types-D1ToC1mB.d.ts.map +1 -0
  57. package/dist/{types-DPBZvxkk.d.ts → types-DRj0sF2w.d.ts} +2 -2
  58. package/dist/{types-DPBZvxkk.d.ts.map → types-DRj0sF2w.d.ts.map} +1 -1
  59. package/dist/{utils-CSF716ux.js → utils-DiV32YIj.js} +45 -2
  60. package/dist/utils-DiV32YIj.js.map +1 -0
  61. package/package.json +1 -1
  62. package/dist/clis/args/help-Cb66IK-J.mjs.map +0 -1
  63. package/dist/clis/args/help-CmnOv3z3.d.mts.map +0 -1
  64. package/dist/document-model-CMyP_XZ8.js.map +0 -1
  65. package/dist/purge-YMJM0Vl7.js.map +0 -1
  66. package/dist/types-DR4mZKAj.d.ts.map +0 -1
  67. package/dist/utils-BrKxCmKx.d.ts +0 -18
  68. package/dist/utils-BrKxCmKx.d.ts.map +0 -1
  69. package/dist/utils-CSF716ux.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import "./types-DPBZvxkk.js";
1
+ import "./types-DRj0sF2w.js";
2
2
  import { SignaturePolicy } from "@powerhousedao/shared/document-model";
3
3
  import { DocumentDriveLocalState, Node } from "@powerhousedao/shared/document-drive";
4
4
  //#region document-drive/src/types.d.ts
@@ -33,4 +33,4 @@ declare function shortGitSha(sha: string): string;
33
33
  //#endregion
34
34
  export { GenerateNodesCopyIdGenerator as a, DriveInput as i, buildTreeUrl as n, GenerateNodesCopySrc as o, shortGitSha as r, SharingType as s, GITHUB_REPO_URL as t };
35
35
  export {};
36
- //# sourceMappingURL=index-CR7EJfyR.d.ts.map
36
+ //# sourceMappingURL=index-59YGevDz.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CR7EJfyR.d.ts","names":[],"sources":["../document-drive/src/types.ts","../git.ts"],"mappings":";;;;KAMY;EACV,OAAO;EACP,aAAa;EACb,qBAAqB;;KAGX,gCAAgC,YAAY,SAAS;KAErD;EACV;IACE;IACA;;EAEF;EACA;EACA;EACA,QAAQ,QAAQ;;EAEhB;KAAsB;;;EAEtB,kBAAkB;;KAGR;;;cC7BC;iBAEG,aAAa;iBAKb,YAAY"}
1
+ {"version":3,"file":"index-59YGevDz.d.ts","names":[],"sources":["../document-drive/src/types.ts","../git.ts"],"mappings":";;;;KAMY;EACV,OAAO;EACP,aAAa;EACb,qBAAqB;;KAGX,gCAAgC,YAAY,SAAS;KAErD;EACV;IACE;IACA;;EAEF;EACA;EACA;EACA,QAAQ,QAAQ;;EAEhB;KAAsB;;;EAEtB,kBAAkB;;KAGR;;;cC7BC;iBAEG,aAAa;iBAKb,YAAY"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { a as AnalyticsSeriesInput, c as CompoundAnalyticsExpression, d as ConversionMetric, f as IAnalyticsStore, i as AnalyticsSeries, l as CompoundAnalyticsInputs, n as AnalyticsOperand, o as AnalyticsSeriesQuery, p as MultiCurrencyConversion, r as AnalyticsQuery, s as AnalyticsUpdateCallback, t as AnalyticsDimension, u as CompoundAnalyticsQuery } from "./types-Bsp8VL2y.js";
2
- import { $ as PathValidation, $a as UndoRedoAction, $i as SetModelExtensionInput, $n as Manifest, $r as OperationIndex, $t as DeleteStateExampleInput, A as PHConnectPwaRuntimeCaching, Aa as SetOperationTemplateInput, Ai as ReorderOperationExamplesInput, An as EditorDispatch, Ar as MutationSetModelDescriptionArgs, At as CopyChildDocumentInput, B as PHConnectSentry, Ba as SignalResult, Bi as SchemaSetNameAction, Bn as IOperation, Bo as ProcessorApps, Br as MutationSetOperationErrorNameArgs, Bt as DeleteChildDocumentInput, C as PHConnectOpenPanel, Ca as SetOperationReducerAction, Ci as ReorderModuleOperationsAction, Cn as DocumentModelStateOperations, Cr as MutationReorderModulesArgs, Ct as AddStateExampleInput, D as PHConnectPwaFileHandler, Da as SetOperationScopeAction, Di as ReorderOperationErrorsAction, Dn as DocumentOperationsIgnoreMap, Dr as MutationSetAuthorNameArgs, Dt as CodeExample, E as PHConnectPwaCacheStrategy, Ea as SetOperationSchemaInput, Ei as ReorderModulesInput, En as DocumentModelVersioningOperations, Er as MutationReorderStateExamplesArgs, Et as Author, F as PHConnectRenown, Fa as SetStateSchemaInput, Fi as SaveToFile, Fn as GetDocumentOptions, Fo as IProcessor, Fr as MutationSetModuleNameArgs, Ft as CreateDocumentAction, G as PHReactorClientMode, Ga as SkipHeaderOperationIndex, Gi as SetAuthorNameInput, Gn as InputMaybe, Go as ProcessorFactoryBuilder, Gr as MutationSetOperationTemplateArgs, Gt as DeleteModuleInput, H as PHImageRef, Ha as SignalType, Hi as SchemaUndoAction, Hn as ISignalResult, Ho as ProcessorDispatchCreateResult, Hr as MutationSetOperationNameArgs, Ht as DeleteDocumentAction, I as PHConnectRenownAdapters, Ia as Set_Name, Ii as SaveToFileHandle, In as HostedEditorProps, Io as IProcessorDispatch, Ir as MutationSetNameArgs, It as CreateDocumentActionInput, J as PHRenownRainbowAdapterConfig, Ja as StateReducer, Ji as SetInitialStateAction, Jn as LoadFromFile, Jo as ProcessorRecord, Jr as MutationUpdateChangeLogItemInputArgs, Jt as DeleteOperationErrorInput, K as PHReactorRenown, Ka as SkipHeaderOperations, Ki as SetAuthorWebsiteAction, Kn as IsDocumentOfType, Ko as ProcessorFilter, Kr as MutationSetStateSchemaArgs, Kt as DeleteOperationAction, L as PHConnectRuntimeConfig, La as Set_PreferredEditor, Li as Scalars, Ln as IAction, Lo as IProcessorHostModuleBase, Lr as MutationSetOperationDescriptionArgs, Lt as CreateState, M as PHConnectReactor, Ma as SetPreferredEditorActionInput, Mi as ReorderStateExamplesInput, Mn as EditorProps, Mr as MutationSetModelIdArgs, Mt as CreateChildDocumentInput, N as PHConnectReactorFeatureFlags, Na as SetPreferredEditorOperation, Ni as ReplayDocumentOptions, Nn as Exact, Nr as MutationSetModelNameArgs, Nt as CreateChildDocumentSignal, O as PHConnectPwaIcon, Oa as SetOperationScopeInput, Oi as ReorderOperationErrorsInput, On as DocumentSpecification, Or as MutationSetAuthorWebsiteArgs, Ot as ConfigEntry, P as PHConnectRemoteBackend, Pa as SetStateSchemaAction, Pi as RevisionsFilter, Pn as FileInput, Pr as MutationSetModuleDescriptionArgs, Pt as CreateDocument, Q as ParsedCmdResult, Qa as UndoActionInput, Qi as SetModelExtensionAction, Qn as MakeOptional, Qo as TrackedProcessor, Qr as OperationErrorSpecification, Qt as DeleteStateExampleAction, R as PHConnectRuntimeDefaultDrive, Ra as Signal, Ri as SchemaNOOPAction, Rn as ID, Ro as IProcessorManager, Rr as MutationSetOperationErrorCodeArgs, Rt as DeleteChangeLogItemAction, S as PHConnectLoader, Sa as SetOperationNameInput, Si as ReorderChangeLogItemsInput, Sn as DocumentModelStateAction, Sr as MutationReorderModuleOperationsArgs, St as AddStateExampleAction, T as PHConnectPwa, Ta as SetOperationSchemaAction, Ti as ReorderModulesAction, Tn as DocumentModelVersioningAction, Tr as MutationReorderOperationExamplesArgs, Tt as AssertIsStateOfType, U as PHLength, Ua as SignatureVerificationHandler, Ui as ScopeState, Un as ISigner, Uo as ProcessorDispatchResult, Ur as MutationSetOperationReducerArgs, Ut as DeleteDocumentActionInput, V as PHEdges, Va as SignalResults, Vi as SchemaSetPreferredEditorAction, Vn as ISignal, Vo as ProcessorDeletePropagation, Vr as MutationSetOperationErrorTemplateArgs, Vt as DeleteChildDocumentSignal, W as PHPackageProvider, Wa as SigningParameters, Wi as SetAuthorNameAction, Wn as Incremental, Wo as ProcessorFactory, Wr as MutationSetOperationSchemaArgs, Wt as DeleteModuleAction, X as PHSchemedImage, Xa as Undo, Xi as SetModelDescriptionAction, Xn as MakeEmpty, Xo as ProcessorStatus, Xr as MutationUpdateStateExampleArgs, Xt as DeleteOperationExampleInput, Y as PHSchemedColor, Ya as SubgraphModule, Yi as SetInitialStateInput, Yn as LoadFromInput, Yo as ProcessorRerunOptions, Yr as MutationUpdateOperationExampleArgs, Yt as DeleteOperationExampleAction, Z as PackageManagerArgs, Za as UndoAction, Zi as SetModelDescriptionInput, Zn as MakeMaybe, Zo as ReplayStateMode, Zr as NOOPAction, Zt as DeleteOperationInput, _ as PHConnectDriveSections, _a as SetOperationErrorNameAction, _i as RejectedAction, _n as DocumentModelOperationErrorOperations, _r as MutationDeleteOperationExampleArgs, _t as AddOperationExampleAction, a as PHBackground, aa as SetModuleDescriptionInput, ai as PhAiToolDescriptor, an as DocumentModelDocumentModelModule, ao as UpdateRelationshipActionInput, ar as MoveOperationInput, at as ActionErrorCallback, b as PHConnectHome, ba as SetOperationErrorTemplateInput, bi as RemoveRelationshipActionInput, bn as DocumentModelOperationOperations, br as MutationRedoArgs, bt as AddRelationshipAction, c as PHConnectAi, ca as SetNameAction, ci as Publisher, cn as DocumentModelHeaderOperations, co as UpgradeDocumentAction, cr as MutationAddModuleArgs, ct as ActionVerificationHandler, d as PHConnectCollection, da as SetOperationDescriptionAction, di as Query, dn as DocumentModelLocalState, do as ValidationError, dr as MutationAddOperationExampleArgs, dt as AddChangeLogItemInput, ea as SetModelIdAction, ei as OperationSpecification, en as DispatchOutcome, eo as UpdateChangeLogItemAction, er as MappedOperation, et as PowerhouseConfig, f as PHConnectCompositionEntry, fa as SetOperationDescriptionInput, fi as Redo, fn as DocumentModelModule, fr as MutationAddStateExampleArgs, ft as AddModuleAction, g as PHConnectDriveSection, ga as SetOperationErrorDescriptionInput, gi as ReducerOptions, gn as DocumentModelOperationErrorAction, gr as MutationDeleteOperationErrorArgs, gt as AddOperationErrorInput, h as PHConnectDefaultDriveRemote, ha as SetOperationErrorDescriptionAction, hi as Reducer, hn as DocumentModelOperationAction, hr as MutationDeleteOperationArgs, ht as AddOperationErrorAction, i as LogLevels, ia as SetModuleDescriptionAction, ii as PhAiToolAnnotations, in as DocumentModelDocument, io as UpdateRelationshipAction, ir as MoveOperationAction, j as PHConnectPwaUrlPattern, ja as SetPreferredEditorAction, ji as ReorderStateExamplesAction, jn as EditorModule, jr as MutationSetModelExtensionArgs, jt as CopyChildDocumentSignal, k as PHConnectPwaManifest, ka as SetOperationTemplateAction, ki as ReorderOperationExamplesAction, kn as ENSInfo, kr as MutationSetInitialStateArgs, kt as ConfigEntryType, l as PHConnectApp, la as SetNameActionInput, li as PurgeDocumentAction, ln as DocumentModelInput, lo as UpgradeDocumentActionInput, lr as MutationAddOperationArgs, lt as Actions, m as PHConnectDefaultDriveLocal, ma as SetOperationErrorCodeInput, mi as RedoActionInput, mn as DocumentModelModuleOperations, mr as MutationDeleteModuleArgs, mt as AddOperationAction, n as DrivePreserveStrategy, na as SetModelNameAction, ni as PartialRecord, nn as DocumentDispatch, no as UpdateOperationExampleAction, nr as MinimalBackupData, nt as ServiceAction, o as PHBackgroundLayer, oa as SetModuleNameAction, oi as PieceModule, on as DocumentModelGlobalState, oo as UpdateStateExampleAction, or as Mutation, ot as ActionSignatureContext, p as PHConnectDefaultDrive, pa as SetOperationErrorCodeAction, pi as RedoAction, pn as DocumentModelModuleAction, pr as MutationDeleteChangeLogItemInputArgs, pt as AddModuleInput, q as PHRenownPrivyAdapterConfig, qa as State, qi as SetAuthorWebsiteInput, qn as IsStateOfType, qo as ProcessorPhase, qr as MutationUndoArgs, qt as DeleteOperationErrorAction, r as LogLevel, ra as SetModelNameInput, ri as PartialState, rn as DocumentModelAction, ro as UpdateOperationExampleInput, rr as ModuleSpecification, rt as ServiceActions, s as PHBackgroundLayers, sa as SetModuleNameInput, si as PowerhouseModule, sn as DocumentModelHeaderAction, so as UpdateStateExampleInput, sr as MutationAddChangeLogItemInputArgs, st as ActionSigningHandler, t as DrivePreserveStrategies, ta as SetModelIdInput, ti as OperationsByScope, tn as DocumentAction, to as UpdateChangeLogItemInput, tr as Maybe, tt as PowerhousePackage, u as PHConnectBranding, ua as SetNameOperation, ui as PurgeDocumentActionInput, un as DocumentModelLib, uo as User, ur as MutationAddOperationErrorArgs, ut as AddChangeLogItemAction, v as PHConnectDrives, va as SetOperationErrorNameInput, vi as ReleaseNewVersionAction, vn as DocumentModelOperationExampleAction, vr as MutationDeleteStateExampleArgs, vt as AddOperationExampleInput, w as PHConnectPackages, wa as SetOperationReducerInput, wi as ReorderModuleOperationsInput, wn as DocumentModelUtils, wr as MutationReorderOperationErrorsArgs, wt as AssertIsDocumentOfType, x as PHConnectInstance, xa as SetOperationNameAction, xi as ReorderChangeLogItemsAction, xn as DocumentModelPHState, xr as MutationReorderChangeLogItemsInputArgs, xt as AddRelationshipActionInput, y as PHConnectExplorerIcons, ya as SetOperationErrorTemplateAction, yi as RemoveRelationshipAction, yn as DocumentModelOperationExampleOperations, yr as MutationMoveOperationArgs, yt as AddOperationInput, z as PHConnectRuntimeDefaultDriveRemote, za as SignalDispatch, zi as SchemaRedoAction, zn as IDocument, zo as ProcessorApp, zr as MutationSetOperationErrorDescriptionArgs, zt as DeleteChangeLogItemInput } from "./types-DR4mZKAj.js";
2
+ import { $ as PackageManagerArgs, $a as SkipHeaderOperations, $i as SetAuthorWebsiteAction, $n as MakeEmpty, $o as ProcessorFilter, $r as MutationUpdateStateExampleArgs, $t as DeleteOperationInput, A as PHConnectPwaRuntimeCaching, Aa as SetOperationReducerAction, Ai as ReorderModulesAction, An as DocumentOperationsIgnoreMap, Ar as MutationSetAuthorNameArgs, At as ConfigEntry, B as PHConnectRuntimeDefaultDriveRemote, Ba as SetPreferredEditorOperation, Bi as RetractActionInput, Bn as IAction, Br as MutationSetOperationDescriptionArgs, Bt as DeleteChangeLogItemAction, C as PHConnectOpenPanel, Ca as SetOperationErrorDescriptionInput, Ci as ReleaseNewVersionAction, Cn as DocumentModelOperationOperations, Cr as MutationRedoArgs, Ct as AddRelationshipActionInput, D as PHConnectPwaFileHandler, Da as SetOperationErrorTemplateInput, Di as ReorderChangeLogItemsInput, Dn as DocumentModelUtils, Dr as MutationReorderOperationErrorsArgs, Dt as AssertIsStateOfType, E as PHConnectPwaCacheStrategy, Ea as SetOperationErrorTemplateAction, Ei as ReorderChangeLogItemsAction, En as DocumentModelStateOperations, Er as MutationReorderModulesArgs, Et as AssertIsDocumentOfType, F as PHConnectRenown, Fa as SetOperationScopeInput, Fi as ReorderOperationExamplesInput, Fn as EditorProps, Fr as MutationSetModelIdArgs, Ft as CreateChildDocumentSignal, G as PHLength, Ga as Signal, Gi as SchemaNOOPAction, Gn as ISignalResult, Go as IProcessorManager, Gr as MutationSetOperationNameArgs, Gt as DeleteDocumentActionInput, H as PHEdges, Ha as SetStateSchemaInput, Hi as SaveToFile, Hn as IDocument, Ho as IProcessor, Hr as MutationSetOperationErrorDescriptionArgs, Ht as DeleteChildDocumentInput, I as PHConnectRenownAdapters, Ia as SetOperationTemplateAction, Ii as ReorderStateExamplesAction, In as Exact, Ir as MutationSetModelNameArgs, It as CreateDocument, J as PHReactorRenown, Ja as SignalResults, Ji as SchemaSetPreferredEditorAction, Jn as InputMaybe, Jo as ProcessorDeletePropagation, Jr as MutationSetOperationTemplateArgs, Jt as DeleteOperationAction, K as PHPackageProvider, Ka as SignalDispatch, Ki as SchemaRedoAction, Kn as ISigner, Ko as ProcessorApp, Kr as MutationSetOperationReducerArgs, Kt as DeleteModuleAction, L as PHConnectRouterSettings, La as SetOperationTemplateInput, Li as ReorderStateExamplesInput, Ln as FileInput, Lr as MutationSetModuleDescriptionArgs, Lt as CreateDocumentAction, M as PHConnectReactor, Ma as SetOperationSchemaAction, Mi as ReorderOperationErrorsAction, Mn as ENSInfo, Mr as MutationSetInitialStateArgs, Mt as CopyChildDocumentInput, N as PHConnectReactorFeatureFlags, Na as SetOperationSchemaInput, Ni as ReorderOperationErrorsInput, Nn as EditorDispatch, Nr as MutationSetModelDescriptionArgs, Nt as CopyChildDocumentSignal, O as PHConnectPwaIcon, Oa as SetOperationNameAction, Oi as ReorderModuleOperationsAction, On as DocumentModelVersioningAction, Or as MutationReorderOperationExamplesArgs, Ot as Author, P as PHConnectRemoteBackend, Pa as SetOperationScopeAction, Pi as ReorderOperationExamplesAction, Pn as EditorModule, Pr as MutationSetModelExtensionArgs, Pt as CreateChildDocumentInput, Q as PHSchemedImage, Qa as SkipHeaderOperationIndex, Qi as SetAuthorNameInput, Qn as LoadFromInput, Qo as ProcessorFactoryBuilder, Qr as MutationUpdateOperationExampleArgs, Qt as DeleteOperationExampleInput, R as PHConnectRuntimeConfig, Ra as SetPreferredEditorAction, Ri as ReplayDocumentOptions, Rn as GetDocumentOptions, Rr as MutationSetModuleNameArgs, Rt as CreateDocumentActionInput, S as PHConnectLoader, Sa as SetOperationErrorDescriptionAction, Si as RejectedAction, Sn as DocumentModelOperationExampleOperations, Sr as MutationMoveOperationArgs, St as AddRelationshipAction, T as PHConnectPwa, Ta as SetOperationErrorNameInput, Ti as RemoveRelationshipActionInput, Tn as DocumentModelStateAction, Tr as MutationReorderModuleOperationsArgs, Tt as AddStateExampleInput, U as PHImageRef, Ua as Set_Name, Ui as SaveToFileHandle, Un as IOperation, Uo as IProcessorDispatch, Ur as MutationSetOperationErrorNameArgs, Ut as DeleteChildDocumentSignal, V as PHConnectSentry, Va as SetStateSchemaAction, Vi as RevisionsFilter, Vn as ID, Vr as MutationSetOperationErrorCodeArgs, Vt as DeleteChangeLogItemInput, W as PHKeyframeRule, Wa as Set_PreferredEditor, Wi as Scalars, Wn as ISignal, Wo as IProcessorHostModuleBase, Wr as MutationSetOperationErrorTemplateArgs, Wt as DeleteDocumentAction, X as PHRenownRainbowAdapterConfig, Xa as SignatureVerificationHandler, Xi as ScopeState, Xn as IsStateOfType, Xo as ProcessorDispatchResult, Xr as MutationUndoArgs, Xt as DeleteOperationErrorInput, Y as PHRenownPrivyAdapterConfig, Ya as SignalType, Yi as SchemaUndoAction, Yn as IsDocumentOfType, Yo as ProcessorDispatchCreateResult, Yr as MutationSetStateSchemaArgs, Yt as DeleteOperationErrorAction, Z as PHSchemedColor, Za as SigningParameters, Zi as SetAuthorNameAction, Zn as LoadFromFile, Zo as ProcessorFactory, Zr as MutationUpdateChangeLogItemInputArgs, Zt as DeleteOperationExampleAction, _ as PHConnectDriveSections, _a as SetNameOperation, _i as Redo, _n as DocumentModelModuleOperations, _o as User, _r as MutationDeleteModuleArgs, _t as AddOperationErrorAction, a as PHBackground, aa as SetModelExtensionAction, ai as PartialRecord, an as DocumentDispatch, ao as UndoActionInput, ar as MinimalBackupData, as as ProcessorTiming, at as ServiceActions, b as PHConnectHome, ba as SetOperationErrorCodeAction, bi as Reducer, bn as DocumentModelOperationErrorOperations, br as MutationDeleteOperationExampleArgs, bt as AddOperationExampleInput, c as PHConnectAi, ca as SetModelIdInput, ci as PhAiToolAnnotations, cn as DocumentModelDocumentModelModule, co as UpdateChangeLogItemInput, cr as MoveOperationInput, cs as ProcessorTimingDocumentType, ct as ActionSignatureContext, d as PHConnectCollection, da as SetModuleDescriptionAction, di as PieceModule, dn as DocumentModelHeaderOperations, do as UpdateRelationshipAction, dr as MutationAddModuleArgs, ds as ProcessorTimingLevel, dt as Actions, ea as SetAuthorWebsiteInput, ei as NOOPAction, en as DeleteStateExampleAction, eo as State, er as MakeMaybe, es as ProcessorPhase, et as ParsedCmdResult, f as PHConnectCompositionEntry, fa as SetModuleDescriptionInput, fi as PowerhouseModule, fn as DocumentModelInput, fo as UpdateRelationshipActionInput, fr as MutationAddOperationArgs, fs as ProcessorTimingPath, ft as AddChangeLogItemAction, g as PHConnectDriveSection, ga as SetNameActionInput, gi as Query, gn as DocumentModelModuleAction, go as UpgradeDocumentActionInput, gr as MutationDeleteChangeLogItemInputArgs, gt as AddOperationAction, h as PHConnectDefaultDriveRemote, ha as SetNameAction, hi as PurgeDocumentActionInput, hn as DocumentModelModule, ho as UpgradeDocumentAction, hr as MutationAddStateExampleArgs, hs as TrackedProcessor, ht as AddModuleInput, i as LogLevels, ia as SetModelDescriptionInput, ii as OperationsByScope, in as DocumentAction, io as UndoAction, ir as Maybe, is as ProcessorStatus, it as ServiceAction, j as PHConnectPwaUrlPattern, ja as SetOperationReducerInput, ji as ReorderModulesInput, jn as DocumentSpecification, jr as MutationSetAuthorWebsiteArgs, jt as ConfigEntryType, k as PHConnectPwaManifest, ka as SetOperationNameInput, ki as ReorderModuleOperationsInput, kn as DocumentModelVersioningOperations, kr as MutationReorderStateExamplesArgs, kt as CodeExample, l as PHConnectApp, la as SetModelNameAction, li as PhAiToolContext, ln as DocumentModelGlobalState, lo as UpdateOperationExampleAction, lr as Mutation, ls as ProcessorTimingHorizon, lt as ActionSigningHandler, m as PHConnectDefaultDriveLocal, ma as SetModuleNameInput, mi as PurgeDocumentAction, mn as DocumentModelLocalState, mo as UpdateStateExampleInput, mr as MutationAddOperationExampleArgs, ms as ReplayStateMode, mt as AddModuleAction, n as DrivePreserveStrategy, na as SetInitialStateInput, ni as OperationIndex, nn as DeriveScope, no as SubgraphModule, nr as Manifest, ns as ProcessorRecord, nt as PowerhouseConfig, o as PHBackgroundLayer, oa as SetModelExtensionInput, oi as PartialState, on as DocumentModelAction, oo as UndoRedoAction, or as ModuleSpecification, os as ProcessorTimingBatch, p as PHConnectDefaultDrive, pa as SetModuleNameAction, pi as Publisher, pn as DocumentModelLib, po as UpdateStateExampleAction, pr as MutationAddOperationErrorArgs, ps as ProcessorTimingRun, pt as AddChangeLogItemInput, q as PHReactorClientMode, qa as SignalResult, qi as SchemaSetNameAction, qn as Incremental, qo as ProcessorApps, qr as MutationSetOperationSchemaArgs, qt as DeleteModuleInput, r as LogLevel, ra as SetModelDescriptionAction, ri as OperationSpecification, rn as DispatchOutcome, ro as Undo, rr as MappedOperation, rs as ProcessorRerunOptions, rt as PowerhousePackage, s as PHBackgroundLayers, sa as SetModelIdAction, si as PhAiChatImage, sn as DocumentModelDocument, so as UpdateChangeLogItemAction, sr as MoveOperationAction, ss as ProcessorTimingCounters, st as ActionErrorCallback, t as DrivePreserveStrategies, ta as SetInitialStateAction, ti as OperationErrorSpecification, tn as DeleteStateExampleInput, to as StateReducer, tr as MakeOptional, ts as ProcessorQueueDepth, tt as PathValidation, u as PHConnectBranding, ua as SetModelNameInput, ui as PhAiToolDescriptor, un as DocumentModelHeaderAction, uo as UpdateOperationExampleInput, ur as MutationAddChangeLogItemInputArgs, us as ProcessorTimingLastRun, ut as ActionVerificationHandler, v as PHConnectDrives, va as SetOperationDescriptionAction, vi as RedoAction, vn as DocumentModelOperationAction, vo as ValidationError, vr as MutationDeleteOperationArgs, vt as AddOperationErrorInput, w as PHConnectPackages, wa as SetOperationErrorNameAction, wi as RemoveRelationshipAction, wn as DocumentModelPHState, wr as MutationReorderChangeLogItemsInputArgs, wt as AddStateExampleAction, x as PHConnectInstance, xa as SetOperationErrorCodeInput, xi as ReducerOptions, xn as DocumentModelOperationExampleAction, xr as MutationDeleteStateExampleArgs, xt as AddOperationInput, y as PHConnectExplorerIcons, ya as SetOperationDescriptionInput, yi as RedoActionInput, yn as DocumentModelOperationErrorAction, yr as MutationDeleteOperationErrorArgs, yt as AddOperationExampleAction, z as PHConnectRuntimeDefaultDrive, za as SetPreferredEditorActionInput, zi as RetractAction, zn as HostedEditorProps, zr as MutationSetNameArgs, zt as CreateState } from "./types-D1ToC1mB.js";
3
3
  import { i as PACKAGES_DEPENDENCIES, n as APPS_DEPENDENCIES, r as CLIS_DEPENDENCIES, t as ALL_POWERHOUSE_DEPENDENCIES } from "./constants-5UFY_rXh.js";
4
- import { $ as LegacySynchronizationUnit, A as TriggerData, B as PackagePage, C as RemoveTriggerInput, D as SetSharingTypeInput, E as SetDriveNameInput, F as PACKAGE_MODULE_TYPES, G as RegistryPackageSource, H as RegistryPackage, I as PackageFacets, J as DriveDocumentModelModule, K as RegistryPackageStatus, L as PackageInfo, M as TriggerType, N as UpdateFileInput, O as TransmitterType, P as UpdateNodeInput, Q as LegacyAddFileInput, R as PackageListItem, S as RemoveListenerInput, T as SetDriveIconInput, U as RegistryPackageList, V as Page, W as RegistryPackageMap, 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, 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, z as PackageModuleType } from "./types-DPBZvxkk.js";
5
- import { a as GenerateNodesCopyIdGenerator, i as DriveInput, n as buildTreeUrl, o as GenerateNodesCopySrc, r as shortGitSha, s as SharingType, t as GITHUB_REPO_URL } from "./index-CR7EJfyR.js";
6
- export { ALL_POWERHOUSE_DEPENDENCIES, APPS_DEPENDENCIES, type ActionErrorCallback, type ActionSignatureContext, type ActionSigningHandler, type ActionVerificationHandler, type Actions, type AddChangeLogItemAction, type AddChangeLogItemInput, type AddFileAction, type AddFileInput, type AddFolderAction, type AddFolderInput, type AddListenerAction, type AddListenerInput, type AddModuleAction, type AddModuleInput, type AddOperationAction, type AddOperationErrorAction, type AddOperationErrorInput, type AddOperationExampleAction, type AddOperationExampleInput, type AddOperationInput, type AddRelationshipAction, type AddRelationshipActionInput, type AddStateExampleAction, type AddStateExampleInput, type AddTriggerAction, type AddTriggerInput, type AnalyticsDimension, type AnalyticsOperand, type AnalyticsQuery, type AnalyticsSeries, type AnalyticsSeriesInput, type AnalyticsSeriesQuery, type AnalyticsUpdateCallback, type AssertIsDocumentOfType, type AssertIsStateOfType, type Author, CLIS_DEPENDENCIES, type CodeExample, type CompoundAnalyticsExpression, type CompoundAnalyticsInputs, type CompoundAnalyticsQuery, type ConfigEntry, type ConfigEntryType, type ConversionMetric, type CopyChildDocumentInput, type CopyChildDocumentSignal, type CopyNodeAction, type CopyNodeInput, type CreateChildDocumentInput, type CreateChildDocumentSignal, type CreateDocument, type CreateDocumentAction, type CreateDocumentActionInput, type CreateState, type DeleteChangeLogItemAction, type DeleteChangeLogItemInput, type DeleteChildDocumentInput, type DeleteChildDocumentSignal, type DeleteDocumentAction, type DeleteDocumentActionInput, type DeleteModuleAction, type DeleteModuleInput, type DeleteNodeAction, type DeleteNodeInput, type DeleteOperationAction, type DeleteOperationErrorAction, type DeleteOperationErrorInput, type DeleteOperationExampleAction, type DeleteOperationExampleInput, type DeleteOperationInput, type DeleteStateExampleAction, type DeleteStateExampleInput, type DispatchOutcome, type DocumentAction, type DocumentDispatch, type DocumentDriveAction, type DocumentDriveDocument, type DocumentDriveDriveAction, type DocumentDriveDriveOperations, type DocumentDriveGlobalState, type DocumentDriveLocalState, type DocumentDriveNodeAction, type DocumentDriveNodeOperations, type DocumentDrivePHState, type DocumentModelAction, type DocumentModelDocument, type DocumentModelDocumentModelModule, type DocumentModelGlobalState, type DocumentModelHeaderAction, type DocumentModelHeaderOperations, type DocumentModelInput, type DocumentModelLib, type DocumentModelLocalState, type DocumentModelModule, type DocumentModelModuleAction, type DocumentModelModuleOperations, type DocumentModelOperationAction, type DocumentModelOperationErrorAction, type DocumentModelOperationErrorOperations, type DocumentModelOperationExampleAction, type DocumentModelOperationExampleOperations, type DocumentModelOperationOperations, type DocumentModelPHState, type DocumentModelStateAction, type DocumentModelStateOperations, type DocumentModelUtils, type DocumentModelVersioningAction, type DocumentModelVersioningOperations, type DocumentOperationsIgnoreMap, type DocumentSpecification, type DriveDocumentModelModule, type DriveInput, type DrivePreserveStrategies, type DrivePreserveStrategy, type ENSInfo, type EditorDispatch, type EditorModule, type EditorProps, type Exact, type FileInput, type FileNode, type FolderNode, GITHUB_REPO_URL, type GenerateNodesCopyIdGenerator, type GenerateNodesCopySrc, type GetDocumentOptions, type HostedEditorProps, type IAction, type IAnalyticsStore, type ID, type IDocument, type IOperation, type IProcessor, type IProcessorDispatch, type IProcessorHostModuleBase, type IProcessorManager, type ISignal, type ISignalResult, type ISigner, type Incremental, type InputMaybe, type IsDocumentOfType, type IsStateOfType, type LegacyAddFileAction, type LegacyAddFileInput, type LegacySynchronizationUnit, type Listener, type ListenerCallInfo, type ListenerCallInfoInput, type ListenerFilter, type ListenerFilterInput, type ListenerInput, type LoadFromFile, type LoadFromInput, type LogLevel, type LogLevels, type MakeEmpty, type MakeMaybe, type MakeOptional, type Manifest, type MappedOperation, type Maybe, type MinimalBackupData, type ModuleSpecification, type MoveNodeAction, type MoveNodeInput, type MoveOperationAction, type MoveOperationInput, type MultiCurrencyConversion, 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, type Node, type OperationErrorSpecification, type OperationIndex, type OperationSpecification, type OperationsByScope, PACKAGES_DEPENDENCIES, type PACKAGE_MODULE_TYPES, type PHBackground, type PHBackgroundLayer, type PHBackgroundLayers, type PHConnectAi, type PHConnectApp, type PHConnectBranding, type PHConnectCollection, type PHConnectCompositionEntry, type PHConnectDefaultDrive, type PHConnectDefaultDriveLocal, type PHConnectDefaultDriveRemote, type PHConnectDriveSection, type PHConnectDriveSections, type PHConnectDrives, type PHConnectExplorerIcons, type PHConnectHome, type PHConnectInstance, type PHConnectLoader, type PHConnectOpenPanel, type PHConnectPackages, type PHConnectPwa, type PHConnectPwaCacheStrategy, type PHConnectPwaFileHandler, type PHConnectPwaIcon, type PHConnectPwaManifest, type PHConnectPwaRuntimeCaching, type PHConnectPwaUrlPattern, type PHConnectReactor, type PHConnectReactorFeatureFlags, type PHConnectRemoteBackend, type PHConnectRenown, type PHConnectRenownAdapters, type PHConnectRuntimeConfig, type PHConnectRuntimeDefaultDrive, type PHConnectRuntimeDefaultDriveRemote, type PHConnectSentry, type PHEdges, type PHImageRef, type PHLength, type PHPackageProvider, type PHReactorClientMode, type PHReactorRenown, type PHRenownPrivyAdapterConfig, type PHRenownRainbowAdapterConfig, type PHSchemedColor, type PHSchemedImage, type PackageFacets, type PackageInfo, type PackageListItem, type PackageManagerArgs, type PackageModuleType, type PackagePage, type Page, type ParsedCmdResult, type PartialRecord, type PartialState, type PathValidation, type PhAiToolAnnotations, type PhAiToolDescriptor, type PieceModule, type PowerhouseConfig, type PowerhouseModule, type PowerhousePackage, type ProcessorApp, type ProcessorApps, type ProcessorDeletePropagation, type ProcessorDispatchCreateResult, type ProcessorDispatchResult, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, type ProcessorPhase, type ProcessorRecord, type ProcessorRerunOptions, type ProcessorStatus, type Publisher, type PullResponderTriggerData, type PullResponderTriggerDataInput, type PurgeDocumentAction, type PurgeDocumentActionInput, type Query, type Redo, type RedoAction, type RedoActionInput, type Reducer, type ReducerOptions, type RegistryPackage, type RegistryPackageList, type RegistryPackageMap, type RegistryPackageSource, type RegistryPackageStatus, type RejectedAction, type ReleaseNewVersionAction, type RemoveListenerAction, type RemoveListenerInput, type RemoveRelationshipAction, type RemoveRelationshipActionInput, type RemoveTriggerAction, type RemoveTriggerInput, type ReorderChangeLogItemsAction, type ReorderChangeLogItemsInput, type ReorderModuleOperationsAction, type ReorderModuleOperationsInput, type ReorderModulesAction, type ReorderModulesInput, type ReorderOperationErrorsAction, type ReorderOperationErrorsInput, type ReorderOperationExamplesAction, type ReorderOperationExamplesInput, type ReorderStateExamplesAction, type ReorderStateExamplesInput, type ReplayDocumentOptions, type ReplayStateMode, type RevisionsFilter, type SaveToFile, type SaveToFileHandle, type Scalars, type SchemaNOOPAction, type SchemaRedoAction, type SchemaSetNameAction, type SchemaSetPreferredEditorAction, type SchemaUndoAction, type ScopeState, type ServiceAction, type ServiceActions, type SetAuthorNameAction, type SetAuthorNameInput, type SetAuthorWebsiteAction, type SetAuthorWebsiteInput, type SetAvailableOfflineAction, type SetAvailableOfflineInput, type SetDriveIconAction, type SetDriveIconInput, type SetDriveNameAction, type SetDriveNameInput, type SetInitialStateAction, type SetInitialStateInput, type SetModelDescriptionAction, type SetModelDescriptionInput, type SetModelExtensionAction, type SetModelExtensionInput, type SetModelIdAction, type SetModelIdInput, type SetModelNameAction, type SetModelNameInput, type SetModuleDescriptionAction, type SetModuleDescriptionInput, type SetModuleNameAction, type SetModuleNameInput, type SetNameAction, type SetNameActionInput, type SetNameOperation, type SetOperationDescriptionAction, type SetOperationDescriptionInput, type SetOperationErrorCodeAction, type SetOperationErrorCodeInput, type SetOperationErrorDescriptionAction, type SetOperationErrorDescriptionInput, type SetOperationErrorNameAction, type SetOperationErrorNameInput, type SetOperationErrorTemplateAction, type SetOperationErrorTemplateInput, type SetOperationNameAction, type SetOperationNameInput, type SetOperationReducerAction, type SetOperationReducerInput, type SetOperationSchemaAction, type SetOperationSchemaInput, type SetOperationScopeAction, type SetOperationScopeInput, type SetOperationTemplateAction, type SetOperationTemplateInput, type SetPreferredEditorAction, type SetPreferredEditorActionInput, type SetPreferredEditorOperation, type SetSharingTypeAction, type SetSharingTypeInput, type SetStateSchemaAction, type SetStateSchemaInput, type Set_Name, type Set_PreferredEditor, type SharingType, type Signal, type SignalDispatch, type SignalResult, type SignalResults, type SignalType, type SignatureVerificationHandler, type SigningParameters, type SkipHeaderOperationIndex, type SkipHeaderOperations, type State, type StateReducer, type SubgraphModule, type TrackedProcessor, type TransmitterType, type Trigger, type TriggerData, type TriggerInput, type TriggerType, type Undo, type UndoAction, type UndoActionInput, type UndoRedoAction, type UpdateChangeLogItemAction, type UpdateChangeLogItemInput, type UpdateFileAction, type UpdateFileInput, type UpdateNodeAction, type UpdateNodeInput, type UpdateOperationExampleAction, type UpdateOperationExampleInput, type UpdateRelationshipAction, type UpdateRelationshipActionInput, type UpdateStateExampleAction, type UpdateStateExampleInput, type UpgradeDocumentAction, type UpgradeDocumentActionInput, type User, type ValidationError, buildTreeUrl, shortGitSha };
4
+ import { $ as LegacySynchronizationUnit, A as TriggerData, B as PackagePage, C as RemoveTriggerInput, D as SetSharingTypeInput, E as SetDriveNameInput, F as PACKAGE_MODULE_TYPES, G as RegistryPackageSource, H as RegistryPackage, I as PackageFacets, J as DriveDocumentModelModule, K as RegistryPackageStatus, L as PackageInfo, M as TriggerType, N as UpdateFileInput, O as TransmitterType, P as UpdateNodeInput, Q as LegacyAddFileInput, R as PackageListItem, S as RemoveListenerInput, T as SetDriveIconInput, U as RegistryPackageList, V as Page, W as RegistryPackageMap, 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, 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, z as PackageModuleType } from "./types-DRj0sF2w.js";
5
+ import { a as GenerateNodesCopyIdGenerator, i as DriveInput, n as buildTreeUrl, o as GenerateNodesCopySrc, r as shortGitSha, s as SharingType, t as GITHUB_REPO_URL } from "./index-59YGevDz.js";
6
+ export { ALL_POWERHOUSE_DEPENDENCIES, APPS_DEPENDENCIES, type ActionErrorCallback, type ActionSignatureContext, type ActionSigningHandler, type ActionVerificationHandler, type Actions, type AddChangeLogItemAction, type AddChangeLogItemInput, type AddFileAction, type AddFileInput, type AddFolderAction, type AddFolderInput, type AddListenerAction, type AddListenerInput, type AddModuleAction, type AddModuleInput, type AddOperationAction, type AddOperationErrorAction, type AddOperationErrorInput, type AddOperationExampleAction, type AddOperationExampleInput, type AddOperationInput, type AddRelationshipAction, type AddRelationshipActionInput, type AddStateExampleAction, type AddStateExampleInput, type AddTriggerAction, type AddTriggerInput, type AnalyticsDimension, type AnalyticsOperand, type AnalyticsQuery, type AnalyticsSeries, type AnalyticsSeriesInput, type AnalyticsSeriesQuery, type AnalyticsUpdateCallback, type AssertIsDocumentOfType, type AssertIsStateOfType, type Author, CLIS_DEPENDENCIES, type CodeExample, type CompoundAnalyticsExpression, type CompoundAnalyticsInputs, type CompoundAnalyticsQuery, type ConfigEntry, type ConfigEntryType, type ConversionMetric, type CopyChildDocumentInput, type CopyChildDocumentSignal, type CopyNodeAction, type CopyNodeInput, type CreateChildDocumentInput, type CreateChildDocumentSignal, type CreateDocument, type CreateDocumentAction, type CreateDocumentActionInput, type CreateState, type DeleteChangeLogItemAction, type DeleteChangeLogItemInput, type DeleteChildDocumentInput, type DeleteChildDocumentSignal, type DeleteDocumentAction, type DeleteDocumentActionInput, type DeleteModuleAction, type DeleteModuleInput, type DeleteNodeAction, type DeleteNodeInput, type DeleteOperationAction, type DeleteOperationErrorAction, type DeleteOperationErrorInput, type DeleteOperationExampleAction, type DeleteOperationExampleInput, type DeleteOperationInput, type DeleteStateExampleAction, type DeleteStateExampleInput, type DeriveScope, type DispatchOutcome, type DocumentAction, type DocumentDispatch, type DocumentDriveAction, type DocumentDriveDocument, type DocumentDriveDriveAction, type DocumentDriveDriveOperations, type DocumentDriveGlobalState, type DocumentDriveLocalState, type DocumentDriveNodeAction, type DocumentDriveNodeOperations, type DocumentDrivePHState, type DocumentModelAction, type DocumentModelDocument, type DocumentModelDocumentModelModule, type DocumentModelGlobalState, type DocumentModelHeaderAction, type DocumentModelHeaderOperations, type DocumentModelInput, type DocumentModelLib, type DocumentModelLocalState, type DocumentModelModule, type DocumentModelModuleAction, type DocumentModelModuleOperations, type DocumentModelOperationAction, type DocumentModelOperationErrorAction, type DocumentModelOperationErrorOperations, type DocumentModelOperationExampleAction, type DocumentModelOperationExampleOperations, type DocumentModelOperationOperations, type DocumentModelPHState, type DocumentModelStateAction, type DocumentModelStateOperations, type DocumentModelUtils, type DocumentModelVersioningAction, type DocumentModelVersioningOperations, type DocumentOperationsIgnoreMap, type DocumentSpecification, type DriveDocumentModelModule, type DriveInput, type DrivePreserveStrategies, type DrivePreserveStrategy, type ENSInfo, type EditorDispatch, type EditorModule, type EditorProps, type Exact, type FileInput, type FileNode, type FolderNode, GITHUB_REPO_URL, type GenerateNodesCopyIdGenerator, type GenerateNodesCopySrc, type GetDocumentOptions, type HostedEditorProps, type IAction, type IAnalyticsStore, type ID, type IDocument, type IOperation, type IProcessor, type IProcessorDispatch, type IProcessorHostModuleBase, type IProcessorManager, type ISignal, type ISignalResult, type ISigner, type Incremental, type InputMaybe, type IsDocumentOfType, type IsStateOfType, type LegacyAddFileAction, type LegacyAddFileInput, type LegacySynchronizationUnit, type Listener, type ListenerCallInfo, type ListenerCallInfoInput, type ListenerFilter, type ListenerFilterInput, type ListenerInput, type LoadFromFile, type LoadFromInput, type LogLevel, type LogLevels, type MakeEmpty, type MakeMaybe, type MakeOptional, type Manifest, type MappedOperation, type Maybe, type MinimalBackupData, type ModuleSpecification, type MoveNodeAction, type MoveNodeInput, type MoveOperationAction, type MoveOperationInput, type MultiCurrencyConversion, 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, type Node, type OperationErrorSpecification, type OperationIndex, type OperationSpecification, type OperationsByScope, PACKAGES_DEPENDENCIES, type PACKAGE_MODULE_TYPES, type PHBackground, type PHBackgroundLayer, type PHBackgroundLayers, type PHConnectAi, type PHConnectApp, type PHConnectBranding, type PHConnectCollection, type PHConnectCompositionEntry, type PHConnectDefaultDrive, type PHConnectDefaultDriveLocal, type PHConnectDefaultDriveRemote, type PHConnectDriveSection, type PHConnectDriveSections, type PHConnectDrives, type PHConnectExplorerIcons, type PHConnectHome, type PHConnectInstance, type PHConnectLoader, type PHConnectOpenPanel, type PHConnectPackages, type PHConnectPwa, type PHConnectPwaCacheStrategy, type PHConnectPwaFileHandler, type PHConnectPwaIcon, type PHConnectPwaManifest, type PHConnectPwaRuntimeCaching, type PHConnectPwaUrlPattern, type PHConnectReactor, type PHConnectReactorFeatureFlags, type PHConnectRemoteBackend, type PHConnectRenown, type PHConnectRenownAdapters, type PHConnectRouterSettings, type PHConnectRuntimeConfig, type PHConnectRuntimeDefaultDrive, type PHConnectRuntimeDefaultDriveRemote, type PHConnectSentry, type PHEdges, type PHImageRef, type PHKeyframeRule, type PHLength, type PHPackageProvider, type PHReactorClientMode, type PHReactorRenown, type PHRenownPrivyAdapterConfig, type PHRenownRainbowAdapterConfig, type PHSchemedColor, type PHSchemedImage, type PackageFacets, type PackageInfo, type PackageListItem, type PackageManagerArgs, type PackageModuleType, type PackagePage, type Page, type ParsedCmdResult, type PartialRecord, type PartialState, type PathValidation, type PhAiChatImage, type PhAiToolAnnotations, type PhAiToolContext, type PhAiToolDescriptor, type PieceModule, type PowerhouseConfig, type PowerhouseModule, type PowerhousePackage, type ProcessorApp, type ProcessorApps, type ProcessorDeletePropagation, type ProcessorDispatchCreateResult, type ProcessorDispatchResult, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, type ProcessorPhase, type ProcessorQueueDepth, type ProcessorRecord, type ProcessorRerunOptions, type ProcessorStatus, type ProcessorTiming, type ProcessorTimingBatch, type ProcessorTimingCounters, type ProcessorTimingDocumentType, type ProcessorTimingHorizon, type ProcessorTimingLastRun, type ProcessorTimingLevel, type ProcessorTimingPath, type ProcessorTimingRun, type Publisher, type PullResponderTriggerData, type PullResponderTriggerDataInput, type PurgeDocumentAction, type PurgeDocumentActionInput, type Query, type Redo, type RedoAction, type RedoActionInput, type Reducer, type ReducerOptions, type RegistryPackage, type RegistryPackageList, type RegistryPackageMap, type RegistryPackageSource, type RegistryPackageStatus, type RejectedAction, type ReleaseNewVersionAction, type RemoveListenerAction, type RemoveListenerInput, type RemoveRelationshipAction, type RemoveRelationshipActionInput, type RemoveTriggerAction, type RemoveTriggerInput, type ReorderChangeLogItemsAction, type ReorderChangeLogItemsInput, type ReorderModuleOperationsAction, type ReorderModuleOperationsInput, type ReorderModulesAction, type ReorderModulesInput, type ReorderOperationErrorsAction, type ReorderOperationErrorsInput, type ReorderOperationExamplesAction, type ReorderOperationExamplesInput, type ReorderStateExamplesAction, type ReorderStateExamplesInput, type ReplayDocumentOptions, type ReplayStateMode, type RetractAction, type RetractActionInput, type RevisionsFilter, type SaveToFile, type SaveToFileHandle, type Scalars, type SchemaNOOPAction, type SchemaRedoAction, type SchemaSetNameAction, type SchemaSetPreferredEditorAction, type SchemaUndoAction, type ScopeState, type ServiceAction, type ServiceActions, type SetAuthorNameAction, type SetAuthorNameInput, type SetAuthorWebsiteAction, type SetAuthorWebsiteInput, type SetAvailableOfflineAction, type SetAvailableOfflineInput, type SetDriveIconAction, type SetDriveIconInput, type SetDriveNameAction, type SetDriveNameInput, type SetInitialStateAction, type SetInitialStateInput, type SetModelDescriptionAction, type SetModelDescriptionInput, type SetModelExtensionAction, type SetModelExtensionInput, type SetModelIdAction, type SetModelIdInput, type SetModelNameAction, type SetModelNameInput, type SetModuleDescriptionAction, type SetModuleDescriptionInput, type SetModuleNameAction, type SetModuleNameInput, type SetNameAction, type SetNameActionInput, type SetNameOperation, type SetOperationDescriptionAction, type SetOperationDescriptionInput, type SetOperationErrorCodeAction, type SetOperationErrorCodeInput, type SetOperationErrorDescriptionAction, type SetOperationErrorDescriptionInput, type SetOperationErrorNameAction, type SetOperationErrorNameInput, type SetOperationErrorTemplateAction, type SetOperationErrorTemplateInput, type SetOperationNameAction, type SetOperationNameInput, type SetOperationReducerAction, type SetOperationReducerInput, type SetOperationSchemaAction, type SetOperationSchemaInput, type SetOperationScopeAction, type SetOperationScopeInput, type SetOperationTemplateAction, type SetOperationTemplateInput, type SetPreferredEditorAction, type SetPreferredEditorActionInput, type SetPreferredEditorOperation, type SetSharingTypeAction, type SetSharingTypeInput, type SetStateSchemaAction, type SetStateSchemaInput, type Set_Name, type Set_PreferredEditor, type SharingType, type Signal, type SignalDispatch, type SignalResult, type SignalResults, type SignalType, type SignatureVerificationHandler, type SigningParameters, type SkipHeaderOperationIndex, type SkipHeaderOperations, type State, type StateReducer, type SubgraphModule, type TrackedProcessor, type TransmitterType, type Trigger, type TriggerData, type TriggerInput, type TriggerType, type Undo, type UndoAction, type UndoActionInput, type UndoRedoAction, type UpdateChangeLogItemAction, type UpdateChangeLogItemInput, type UpdateFileAction, type UpdateFileInput, type UpdateNodeAction, type UpdateNodeInput, type UpdateOperationExampleAction, type UpdateOperationExampleInput, type UpdateRelationshipAction, type UpdateRelationshipActionInput, type UpdateStateExampleAction, type UpdateStateExampleInput, type UpgradeDocumentAction, type UpgradeDocumentActionInput, type User, type ValidationError, buildTreeUrl, shortGitSha };
7
7
  export {};
@@ -1,3 +1,3 @@
1
- import { $o as AuthorizerResult, Ao as IRelationalDbProcessor, Bo as ProcessorApps, Co as namespaceSchemaOf, Cs as WebhookSignatureEncoding, Do as HashAlgorithms, Eo as ExtractProcessorSchemaOrSelf, Es as deletedDocumentId, Fo as IProcessor, G_ as DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, Go as ProcessorFactoryBuilder, Ho as ProcessorDispatchCreateResult, Io as IProcessorDispatch, Jo as ProcessorRecord, K_ as DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, Ko as ProcessorFilter, Lo as IProcessorHostModuleBase, Mo as IRelationalQueryMethods, No as RelationalDbProcessor, Oo as IBaseRelationalDb, Po as RelationalDbProcessorClass, Qo as TrackedProcessor, Ro as IProcessorManager, So as hashNamespace, Ss as WebhookScheme, To as DOCUMENT_ID_COLUMNS, Ts as WebhookVerification, Uo as ProcessorDispatchResult, Vo as ProcessorDeletePropagation, Wo as ProcessorFactory, Xo as ProcessorStatus, Yo as ProcessorRerunOptions, Zo as ReplayStateMode, _o as getCodegenStatusRegistry, _s as WebhookField, as as RouteAuth, bo as createNamespacedQueryBuilder, bs as WebhookReply, cs as RouteContext, ds as RouteOptions, es as IHttpScope, fo as CodegenState, fs as RouteSpec, go as SETTLED_CODEGEN_STATES, gs as WebhookEndpointInfo, ho as PackageLoadFailure, hs as ScopedRouteHandle, is as RouteActor, jo as IRelationalQueryBuilder, ko as IRelationalDb, ls as RouteHandler, mo as CodegenStatusRegistry, ms as RouteUser, ns as IWebhookScope, os as RouteAuthorizer, po as CodegenStatus, ps as RouteTransport, q_ as PROCESSOR_APPS, qo as ProcessorPhase, rs as NodeRouteSpec, ss as RouteBody, ts as IWebhookEndpoints, us as RouteMethod, vo as isSettledCodegenState, vs as WebhookHashAlgorithm, wo as relationalDbToQueryBuilder, ws as WebhookSpec, xo as createRelationalDb, xs as WebhookRequest, yo as createNamespacedDb, ys as WebhookPolicy, zo as ProcessorApp } from "../types-DR4mZKAj.js";
2
- export { type AuthorizerResult, CodegenState, CodegenStatus, CodegenStatusRegistry, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, DOCUMENT_ID_COLUMNS, ExtractProcessorSchemaOrSelf, HashAlgorithms, IBaseRelationalDb, type IHttpScope, type IProcessor, type IProcessorDispatch, type IProcessorHostModuleBase, type IProcessorManager, IRelationalDb, IRelationalDbProcessor, IRelationalQueryBuilder, IRelationalQueryMethods, type IWebhookEndpoints, type IWebhookScope, type NodeRouteSpec, PROCESSOR_APPS, PackageLoadFailure, type ProcessorApp, type ProcessorApps, type ProcessorDeletePropagation, type ProcessorDispatchCreateResult, type ProcessorDispatchResult, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, type ProcessorPhase, type ProcessorRecord, type ProcessorRerunOptions, type ProcessorStatus, RelationalDbProcessor, RelationalDbProcessorClass, type ReplayStateMode, type RouteActor, type RouteAuth, type RouteAuthorizer, type RouteBody, type RouteContext, type RouteHandler, type RouteMethod, type RouteOptions, type RouteSpec, type RouteTransport, type RouteUser, SETTLED_CODEGEN_STATES, type ScopedRouteHandle, type TrackedProcessor, type WebhookEndpointInfo, type WebhookField, type WebhookHashAlgorithm, type WebhookPolicy, type WebhookReply, type WebhookRequest, type WebhookScheme, type WebhookSignatureEncoding, type WebhookSpec, type WebhookVerification, createNamespacedDb, createNamespacedQueryBuilder, createRelationalDb, deletedDocumentId, getCodegenStatusRegistry, hashNamespace, isSettledCodegenState, namespaceSchemaOf, relationalDbToQueryBuilder };
1
+ import { $o as ProcessorFilter, Ao as namespaceSchemaOf, As as RouteTransport, Bo as RelationalDbProcessor, Bs as WebhookSignatureEncoding, Co as SETTLED_CODEGEN_STATES, Cs as RouteAuthorizer, Do as createNamespacedQueryBuilder, Ds as RouteMethod, Eo as createNamespacedDb, Es as RouteHandler, Fo as IBaseRelationalDb, Fs as WebhookHashAlgorithm, Go as IProcessorManager, Ho as IProcessor, Hs as WebhookVerification, Io as IRelationalDb, Is as WebhookPolicy, Jo as ProcessorDeletePropagation, Ko as ProcessorApp, Lo as IRelationalDbProcessor, Ls as WebhookReply, Mo as DOCUMENT_ID_COLUMNS, Ms as ScopedRouteHandle, No as ExtractProcessorSchemaOrSelf, Ns as WebhookEndpointInfo, Oo as createRelationalDb, Os as RouteOptions, Po as HashAlgorithms, Ps as WebhookField, Qo as ProcessorFactoryBuilder, Ro as IRelationalQueryBuilder, Rs as WebhookRequest, So as PackageLoadFailure, Ss as RouteAuth, To as isSettledCodegenState, Ts as RouteContext, Uo as IProcessorDispatch, Us as deletedDocumentId, Vo as RelationalDbProcessorClass, Vs as WebhookSpec, Wo as IProcessorHostModuleBase, Xo as ProcessorDispatchResult, Yo as ProcessorDispatchCreateResult, Zo as ProcessorFactory, _s as IHttpScope, as as ProcessorTiming, bo as CodegenStatus, bs as NodeRouteSpec, cs as ProcessorTimingDocumentType, ds as ProcessorTimingLevel, es as ProcessorPhase, fs as ProcessorTimingPath, gs as AuthorizerResult, hs as TrackedProcessor, is as ProcessorStatus, jo as relationalDbToQueryBuilder, js as RouteUser, ko as hashNamespace, ks as RouteSpec, ls as ProcessorTimingHorizon, ms as ReplayStateMode, nb as DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, ns as ProcessorRecord, os as ProcessorTimingBatch, ps as ProcessorTimingRun, qo as ProcessorApps, rb as PROCESSOR_APPS, rs as ProcessorRerunOptions, ss as ProcessorTimingCounters, tb as DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, ts as ProcessorQueueDepth, us as ProcessorTimingLastRun, vs as IWebhookEndpoints, wo as getCodegenStatusRegistry, ws as RouteBody, xo as CodegenStatusRegistry, xs as RouteActor, yo as CodegenState, ys as IWebhookScope, zo as IRelationalQueryMethods, zs as WebhookScheme } from "../types-D1ToC1mB.js";
2
+ export { type AuthorizerResult, CodegenState, CodegenStatus, CodegenStatusRegistry, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME, DOCUMENT_ID_COLUMNS, ExtractProcessorSchemaOrSelf, HashAlgorithms, IBaseRelationalDb, type IHttpScope, type IProcessor, type IProcessorDispatch, type IProcessorHostModuleBase, type IProcessorManager, IRelationalDb, IRelationalDbProcessor, IRelationalQueryBuilder, IRelationalQueryMethods, type IWebhookEndpoints, type IWebhookScope, type NodeRouteSpec, PROCESSOR_APPS, PackageLoadFailure, type ProcessorApp, type ProcessorApps, type ProcessorDeletePropagation, type ProcessorDispatchCreateResult, type ProcessorDispatchResult, type ProcessorFactory, type ProcessorFactoryBuilder, type ProcessorFilter, type ProcessorPhase, type ProcessorQueueDepth, type ProcessorRecord, type ProcessorRerunOptions, type ProcessorStatus, type ProcessorTiming, type ProcessorTimingBatch, type ProcessorTimingCounters, type ProcessorTimingDocumentType, type ProcessorTimingHorizon, type ProcessorTimingLastRun, type ProcessorTimingLevel, type ProcessorTimingPath, type ProcessorTimingRun, RelationalDbProcessor, RelationalDbProcessorClass, type ReplayStateMode, type RouteActor, type RouteAuth, type RouteAuthorizer, type RouteBody, type RouteContext, type RouteHandler, type RouteMethod, type RouteOptions, type RouteSpec, type RouteTransport, type RouteUser, SETTLED_CODEGEN_STATES, type ScopedRouteHandle, type TrackedProcessor, type WebhookEndpointInfo, type WebhookField, type WebhookHashAlgorithm, type WebhookPolicy, type WebhookReply, type WebhookRequest, type WebhookScheme, type WebhookSignatureEncoding, type WebhookSpec, type WebhookVerification, createNamespacedDb, createNamespacedQueryBuilder, createRelationalDb, deletedDocumentId, getCodegenStatusRegistry, hashNamespace, isSettledCodegenState, namespaceSchemaOf, relationalDbToQueryBuilder };
3
3
  export {};
@@ -1,4 +1,4 @@
1
- import "../purge-YMJM0Vl7.js";
1
+ import "../purge-BOqSpe4O.js";
2
2
  import { a as namespaceSchemaOf, i as hashNamespace, n as createNamespacedQueryBuilder, o as relationalDbToQueryBuilder, r as createRelationalDb, t as createNamespacedDb } from "../utils-MrLmLEVr.js";
3
3
  import { sql } from "kysely";
4
4
  //#region processors/constants.ts
@@ -1,4 +1,4 @@
1
- import { Eo as ExtractProcessorSchemaOrSelf, ko as IRelationalDb } from "../types-DR4mZKAj.js";
1
+ import { Io as IRelationalDb, No as ExtractProcessorSchemaOrSelf } from "../types-D1ToC1mB.js";
2
2
  import { OperationWithContext, PHDocument } from "@powerhousedao/shared/document-model";
3
3
  //#region processors/testing.d.ts
4
4
  /** An in-memory PGlite database, as a host's `module.relationalDb`. `destroy()` closes it. */
@@ -1,4 +1,4 @@
1
- import { l as bytesToBase64Url$1, s as buildOperationSignatureMessage, t as deriveOperationId } from "./utils-CSF716ux.js";
1
+ import { g as buildOperationSignatureMessage, t as deriveOperationId, v as bytesToBase64Url$1 } from "./utils-DiV32YIj.js";
2
2
  import { generateActionId } from "./document-model/action-id.js";
3
3
  import { stringify } from "safe-stable-stringify";
4
4
  import { sha256 } from "@noble/hashes/sha2.js";
@@ -169,6 +169,213 @@ function bytesToHex(bytes) {
169
169
  return Array.from(bytes).map((byte) => byte.toString(16).padStart(2, "0")).join("");
170
170
  }
171
171
  //#endregion
172
+ //#region document-model/state-reducer.ts
173
+ const STATE_REDUCER = Symbol.for("powerhouse.stateReducer");
174
+ function tagStateReducer(reducer, stateReducer) {
175
+ return Object.assign(reducer, { [STATE_REDUCER]: stateReducer });
176
+ }
177
+ /** The state reducer a `createReducer` reducer wraps, for base-reducer 3 derivation. */
178
+ function stateReducerOf(reducer) {
179
+ return reducer[STATE_REDUCER];
180
+ }
181
+ //#endregion
182
+ //#region document-model/base-reducer-protocol.ts
183
+ const BASE_REDUCER_VERSIONS = [
184
+ 1,
185
+ 2,
186
+ 3
187
+ ];
188
+ const CAPABILITIES = {
189
+ 1: {
190
+ version: 1,
191
+ undo: "skip",
192
+ derivation: "replay",
193
+ skip: "undo-or-rewind",
194
+ tieOrder: "rank-locale",
195
+ synthesizedId: "hashed",
196
+ replayHash: "sender",
197
+ reducerContract: "any",
198
+ gatedBy: null
199
+ },
200
+ 2: {
201
+ version: 2,
202
+ undo: "noop-chain",
203
+ derivation: "replay",
204
+ skip: "undo-or-rewind",
205
+ tieOrder: "rank-locale",
206
+ synthesizedId: "hashed",
207
+ replayHash: "sender",
208
+ reducerContract: "any",
209
+ gatedBy: null
210
+ },
211
+ 3: {
212
+ version: 3,
213
+ undo: "retraction",
214
+ derivation: "retraction-rule",
215
+ skip: "rewind",
216
+ tieOrder: "canonical",
217
+ synthesizedId: "none",
218
+ replayHash: "receiver",
219
+ reducerContract: "state-reducer",
220
+ gatedBy: "undoV3"
221
+ }
222
+ };
223
+ /** The versions a reactor running `flags` supports. */
224
+ function baseReducerVersionsFor(flags) {
225
+ return BASE_REDUCER_VERSIONS.filter((version) => {
226
+ const gate = CAPABILITIES[version].gatedBy;
227
+ return gate === null || flags[gate] === true;
228
+ });
229
+ }
230
+ /** Flags under which this build runs every version it knows. */
231
+ const FLAGS_FOR_EVERY_VERSION = Object.fromEntries(BASE_REDUCER_VERSIONS.flatMap((version) => {
232
+ const gate = CAPABILITIES[version].gatedBy;
233
+ return gate === null ? [] : [[gate, true]];
234
+ }));
235
+ /** Scopes the retraction rule never derives. */
236
+ const RULE_EXEMPT_SCOPES = /* @__PURE__ */ new Set(["auth", "document"]);
237
+ function assertNever(value, what) {
238
+ throw new Error(`Unhandled ${what}: ${String(value)}`);
239
+ }
240
+ function isBaseReducerVersion(value) {
241
+ return BASE_REDUCER_VERSIONS.includes(value);
242
+ }
243
+ function capabilitiesOf(version) {
244
+ return CAPABILITIES[version];
245
+ }
246
+ /** Throws on a missing version: defaulting one would replay through the wrong reducer. */
247
+ function baseReducerVersion(header) {
248
+ const version = header.protocolVersions?.["base-reducer"];
249
+ if (typeof version !== "number") throw new Error(`Document ${header.id} carries no base-reducer protocol version`);
250
+ if (!isBaseReducerVersion(version)) throw new Error(`Document ${header.id} carries unknown base-reducer protocol version ${version}`);
251
+ return version;
252
+ }
253
+ /** Throws on a missing or unknown version. */
254
+ function baseReducerCapabilities(header) {
255
+ return capabilitiesOf(baseReducerVersion(header));
256
+ }
257
+ /** Undefined only for a header without a version; throws on an unknown one. */
258
+ function optionalBaseReducerCapabilities(header) {
259
+ if (header.protocolVersions?.["base-reducer"] === void 0) return;
260
+ return baseReducerCapabilities(header);
261
+ }
262
+ /** Undefined when `versions` names no known base-reducer version. */
263
+ function capabilitiesFor(versions) {
264
+ const version = versions?.["base-reducer"];
265
+ return isBaseReducerVersion(version) ? capabilitiesOf(version) : void 0;
266
+ }
267
+ /** From CREATE_DOCUMENT input; undefined when it names no known version. */
268
+ function createdCapabilities(input) {
269
+ return capabilitiesFor(input?.protocolVersions);
270
+ }
271
+ /**
272
+ * Every decision a consumer may take on a capability axis. Outside this module
273
+ * and the other protocol owners, an axis is read only through these or through
274
+ * an exhaustive switch.
275
+ */
276
+ const CAPABILITY_DECISIONS = {
277
+ usesRetractionRule: {
278
+ replay: false,
279
+ "retraction-rule": true
280
+ },
281
+ needsTaggedModel: {
282
+ any: false,
283
+ "state-reducer": true
284
+ },
285
+ sortsJobsCanonically: {
286
+ "rank-locale": false,
287
+ canonical: true
288
+ },
289
+ conflictWindowMovesEveryRow: {
290
+ "rank-locale": false,
291
+ canonical: true
292
+ },
293
+ skipMayUndo: {
294
+ "undo-or-rewind": true,
295
+ rewind: false
296
+ }
297
+ };
298
+ const UNVERSIONED = CAPABILITIES[1];
299
+ /** Whether the version derives scopes by the retraction rule; a versionless header does not. */
300
+ function usesRetractionRule(caps) {
301
+ return CAPABILITY_DECISIONS.usesRetractionRule[(caps ?? UNVERSIONED).derivation];
302
+ }
303
+ /** Whether the retraction rule derives `scope`. */
304
+ function derivesByRule(caps, scope) {
305
+ return usesRetractionRule(caps) && !RULE_EXEMPT_SCOPES.has(scope);
306
+ }
307
+ /** Whether the retraction rule derives `scope` of the document `header` heads. */
308
+ function documentDerivesByRule(header, scope) {
309
+ return derivesByRule(optionalBaseReducerCapabilities(header), scope);
310
+ }
311
+ /** Whether the version runs only models whose every reducer is tagged. */
312
+ function needsTaggedModel(caps) {
313
+ return CAPABILITY_DECISIONS.needsTaggedModel[(caps ?? UNVERSIONED).reducerContract];
314
+ }
315
+ /** How same-timestamp actions are ordered; a versionless header ranks and compares by locale. */
316
+ function tieOrderOf(caps) {
317
+ return (caps ?? UNVERSIONED).tieOrder;
318
+ }
319
+ /** Whether a job's actions are stored in canonical order rather than as submitted. */
320
+ function sortsJobsCanonically(caps) {
321
+ return CAPABILITY_DECISIONS.sortsJobsCanonically[tieOrderOf(caps)];
322
+ }
323
+ /** Whether every conflicting row of a load moves, rather than only those past the predecessor bound. */
324
+ function conflictWindowMovesEveryRow(caps) {
325
+ return CAPABILITY_DECISIONS.conflictWindowMovesEveryRow[tieOrderOf(caps)];
326
+ }
327
+ /** Whether a stored skip may be an undo, not only a replica's rewind. */
328
+ function skipMayUndo(caps) {
329
+ return CAPABILITY_DECISIONS.skipMayUndo[(caps ?? UNVERSIONED).skip];
330
+ }
331
+ /** Whether a stored skip in `scope` is a rewind the reducer applies. */
332
+ function appliesRewind(caps, scope) {
333
+ return !derivesByRule(caps, scope);
334
+ }
335
+ /** Whether a submitted RETRACT is this version's undo. */
336
+ function acceptsSubmittedRetract(caps) {
337
+ switch (caps.undo) {
338
+ case "retraction": return true;
339
+ case "skip":
340
+ case "noop-chain": return false;
341
+ default: return assertNever(caps.undo, "undo model");
342
+ }
343
+ }
344
+ /** Whether a submitted UNDO or REDO is this version's undo; on retraction a client submits RETRACT. */
345
+ function acceptsSubmittedUndoRedo(caps) {
346
+ switch (caps.undo) {
347
+ case "skip":
348
+ case "noop-chain": return true;
349
+ case "retraction": return false;
350
+ default: return assertNever(caps.undo, "undo model");
351
+ }
352
+ }
353
+ /** Whether every registered version of `documentType` runs under `caps`; undefined when none is. */
354
+ function modelRunsBaseReducer(caps, documentType, modules) {
355
+ const registered = modules.filter((module) => module.documentModel.global.id === documentType);
356
+ if (registered.length === 0) return void 0;
357
+ if (!needsTaggedModel(caps)) return true;
358
+ return registered.every((module) => stateReducerOf(module.reducer) !== void 0);
359
+ }
360
+ /** Why `versions` cannot run here; unregistered protocols and types are admitted. */
361
+ function refusalFor(documentType, versions, support, modules) {
362
+ for (const [protocol, version] of Object.entries(versions ?? {})) {
363
+ const supported = support[protocol];
364
+ if (supported === void 0 || supported.includes(version)) continue;
365
+ return {
366
+ protocol,
367
+ version
368
+ };
369
+ }
370
+ const version = versions?.["base-reducer"];
371
+ if (documentType === void 0 || !isBaseReducerVersion(version)) return;
372
+ if (modelRunsBaseReducer(capabilitiesOf(version), documentType, modules) === false) return {
373
+ protocol: "base-reducer",
374
+ version,
375
+ documentType
376
+ };
377
+ }
378
+ //#endregion
172
379
  //#region document-model/peer-agreement.ts
173
380
  /** A purged document's protocol; never preferred, so creation never selects it. */
174
381
  const DOCUMENT_PURGE_PROTOCOL = "document-purge";
@@ -179,8 +386,9 @@ const PEER_CAPABILITIES = [
179
386
  kind: "protocol",
180
387
  name: "base-reducer",
181
388
  baseline: [1, 2],
182
- supported: () => [1, 2],
183
- preferred: () => 2,
389
+ supported: baseReducerVersionsFor,
390
+ preferred: (flags) => Math.max(...baseReducerVersionsFor(flags)),
391
+ selection: (preferred) => isBaseReducerVersion(preferred) && capabilitiesOf(preferred).gatedBy !== null ? "creator" : "agreed",
184
392
  optional: false
185
393
  },
186
394
  {
@@ -204,6 +412,8 @@ const PEER_CAPABILITIES = [
204
412
  supported: () => [1]
205
413
  }
206
414
  ];
415
+ /** `base-reducer`'s preference with no reactor flags, which shared never holds. */
416
+ const FLAGLESS_BASE_REDUCER_VERSION = PEER_CAPABILITIES.find((capability) => capability.kind === "protocol" && capability.name === "base-reducer").preferred({});
207
417
  /** `base` plus `extra`; an extra replaces a base entry of the same name. */
208
418
  function mergePeerCapabilities(base, extra) {
209
419
  const key = (capability) => `${capability.kind}:${capability.name}`;
@@ -328,7 +538,7 @@ function selectProtocolVersions(input) {
328
538
  const preferred = capability.preferred(input.flags);
329
539
  const supported = capability.supported(input.flags);
330
540
  let agreed = supported.filter((version) => version <= preferred);
331
- for (const member of members) {
541
+ for (const member of narrowedBy(capability, preferred, members)) {
332
542
  const theirs = member.protocols[capability.name] ?? [];
333
543
  agreed = agreed.filter((version) => theirs.includes(version));
334
544
  }
@@ -339,6 +549,14 @@ function selectProtocolVersions(input) {
339
549
  ...input.requested
340
550
  };
341
551
  }
552
+ function narrowedBy(capability, preferred, members) {
553
+ const rule = typeof capability.selection === "function" ? capability.selection(preferred) : capability.selection ?? "agreed";
554
+ switch (rule) {
555
+ case "agreed": return members;
556
+ case "creator": return [];
557
+ default: return assertNever(rule, "protocol selection rule");
558
+ }
559
+ }
342
560
  /**
343
561
  * Another reactor's selection for a new document, within `supports`: a
344
562
  * negotiated protocol drops to the highest supported version at or below it,
@@ -397,6 +615,6 @@ function purgedProtocolVersions() {
397
615
  return { [DOCUMENT_PURGE_PROTOCOL]: 1 };
398
616
  }
399
617
  //#endregion
400
- export { isV2ActionHash as A, CanonicalJsonError as C, actionSigningTarget as D, actionSignerIdentity as E, targetDocumentId as M, v2TupleProblem as N, canonicalJson as O, ACTION_SIGNATURE_V2_PREFIX as S, actionPreimageV2 as T, manifestRevision as _, purgedProtocolVersions as a, readPeerManifest as b, PEER_CAPABILITIES as c, coversLocal as d, holdReason as f, localSupports as g, localPeerManifest as h, purgeMarkerOperation as i, signActionV2 as j, hashActionV2 as k, PEER_MANIFEST_FORMAT as l, legacySupports as m, isPurgeMarker as n, DOCUMENT_PURGE_PROTOCOL as o, isOlderManifest as p, purgeDocumentAction as r, MARKER_REFUSAL_FEATURE as s, PURGE_DOCUMENT as t, capSelection as u, mergePeerCapabilities as v, DOCUMENT_SCOPE_ACTION_TYPES as w, selectProtocolVersions as x, peerSupports as y };
618
+ export { DOCUMENT_SCOPE_ACTION_TYPES as $, assertNever as A, isBaseReducerVersion as B, BASE_REDUCER_VERSIONS as C, acceptsSubmittedRetract as D, RULE_EXEMPT_SCOPES as E, capabilitiesOf as F, skipMayUndo as G, needsTaggedModel as H, conflictWindowMovesEveryRow as I, usesRetractionRule as J, sortsJobsCanonically as K, createdCapabilities as L, baseReducerVersion as M, baseReducerVersionsFor as N, acceptsSubmittedUndoRedo as O, capabilitiesFor as P, CanonicalJsonError as Q, derivesByRule as R, selectProtocolVersions as S, FLAGS_FOR_EVERY_VERSION as T, optionalBaseReducerCapabilities as U, modelRunsBaseReducer as V, refusalFor as W, tagStateReducer as X, stateReducerOf as Y, ACTION_SIGNATURE_V2_PREFIX as Z, localSupports as _, purgedProtocolVersions as a, isV2ActionHash as at, peerSupports as b, MARKER_REFUSAL_FEATURE as c, v2TupleProblem as ct, capSelection as d, actionPreimageV2 as et, coversLocal as f, localPeerManifest as g, legacySupports as h, purgeMarkerOperation as i, hashActionV2 as it, baseReducerCapabilities as j, appliesRewind as k, PEER_CAPABILITIES as l, isOlderManifest as m, isPurgeMarker as n, actionSigningTarget as nt, DOCUMENT_PURGE_PROTOCOL as o, signActionV2 as ot, holdReason as p, tieOrderOf as q, purgeDocumentAction as r, canonicalJson as rt, FLAGLESS_BASE_REDUCER_VERSION as s, targetDocumentId as st, PURGE_DOCUMENT as t, actionSignerIdentity as tt, PEER_MANIFEST_FORMAT as u, manifestRevision as v, CAPABILITY_DECISIONS as w, readPeerManifest as x, mergePeerCapabilities as y, documentDerivesByRule as z };
401
619
 
402
- //# sourceMappingURL=purge-YMJM0Vl7.js.map
620
+ //# sourceMappingURL=purge-BOqSpe4O.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purge-BOqSpe4O.js","names":["stringifyJson","bytesToBase64Url"],"sources":["../document-model/action-signature.ts","../document-model/state-reducer.ts","../document-model/base-reducer-protocol.ts","../document-model/peer-agreement.ts","../document-model/purge.ts"],"sourcesContent":["import { stringify as stringifyJson } from \"safe-stable-stringify\";\nimport type { Action } from \"./actions.js\";\nimport { buildOperationSignatureMessage } from \"./crypto.js\";\nimport type {\n AppActionSigner,\n Signature,\n UserActionSigner,\n} from \"./signatures.js\";\nimport type { ActionSigningHandler } from \"./types.js\";\n\nexport const ACTION_SIGNATURE_V2_PREFIX = \"v2:\";\n\n// 32 bytes: 42 free characters, then one whose low two bits are zero.\nconst V2_HASH = /^v2:[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$/;\nconst V2_TIMESTAMP = /^[0-9]+$/;\nconst V2_SIGNATURE = /^0x[0-9a-f]{128}$/;\nconst LONE_SURROGATE = /\\p{Cs}/u;\nconst PREIMAGE_FIELDS = [\n \"version\",\n \"documentId\",\n \"branch\",\n \"scope\",\n \"type\",\n \"id\",\n \"timestampUtcMs\",\n \"input\",\n \"signer.user.address\",\n \"signer.user.networkId\",\n \"signer.user.chainId\",\n \"signer.app.key\",\n];\n\n/** The log an operation is stored in, which a v2 tuple is bound to. */\nexport type ActionSigningTarget = {\n documentId: string;\n branch: string;\n};\n\n/** Who a v2 tuple attributes the action to; both halves are in the preimage. */\nexport type ActionSignerIdentity = {\n user: UserActionSigner;\n app: AppActionSigner;\n};\n\n/** A value that would not survive a JSON store round trip unchanged. */\nexport class CanonicalJsonError extends Error {\n constructor(path: string, detail: string) {\n super(`Cannot canonicalize ${path}: ${detail}`);\n this.name = \"CanonicalJsonError\";\n }\n}\n\n/** Sorted-key JSON, as the state hash encodes; drops `undefined` properties. */\nexport function canonicalJson(value: unknown, label = \"value\"): string {\n assertCanonical(value, label, new Set());\n return stringifyJson(value) as string;\n}\n\n/** Actions the reactor reduces itself, onto the document scope. */\nexport const DOCUMENT_SCOPE_ACTION_TYPES: ReadonlySet<string> = new Set([\n \"CREATE_DOCUMENT\",\n \"DELETE_DOCUMENT\",\n \"UPGRADE_DOCUMENT\",\n \"ADD_RELATIONSHIP\",\n \"REMOVE_RELATIONSHIP\",\n \"UPDATE_RELATIONSHIP\",\n \"PURGE_DOCUMENT\",\n]);\n\n/** Where a document-scope action writes: `sourceId` or `documentId`. */\nexport function targetDocumentId(\n action: { type: string; input: unknown },\n fallback: string,\n): string {\n const input = action.input as\n | { documentId?: unknown; sourceId?: unknown }\n | undefined;\n\n if (\n action.type === \"ADD_RELATIONSHIP\" ||\n action.type === \"REMOVE_RELATIONSHIP\" ||\n action.type === \"UPDATE_RELATIONSHIP\"\n ) {\n return typeof input?.sourceId === \"string\" && input.sourceId.length > 0\n ? input.sourceId\n : fallback;\n }\n\n return typeof input?.documentId === \"string\" && input.documentId.length > 0\n ? input.documentId\n : fallback;\n}\n\n/** The log an action submitted to a job on `documentId` is stored in. */\nexport function actionSigningTarget(\n action: { type: string; input: unknown },\n documentId: string,\n branch: string,\n): ActionSigningTarget {\n return {\n documentId: DOCUMENT_SCOPE_ACTION_TYPES.has(action.type)\n ? targetDocumentId(action, documentId)\n : documentId,\n branch,\n };\n}\n\n/** The identity a signer writes into `context.signer`, and signs over. */\nexport function actionSignerIdentity(signer: {\n user?: UserActionSigner;\n app?: AppActionSigner;\n}): ActionSignerIdentity {\n return {\n user: {\n address: signer.user?.address ?? \"\",\n networkId: signer.user?.networkId ?? \"\",\n chainId: signer.user?.chainId ?? 0,\n },\n app: {\n name: signer.app?.name ?? \"\",\n key: signer.app?.key ?? \"\",\n },\n };\n}\n\n/** The v2 preimage; throws `CanonicalJsonError` on an unsignable action. */\nexport function actionPreimageV2(\n action: Action,\n target: ActionSigningTarget,\n signer: ActionSignerIdentity,\n): string {\n if (!target.documentId) {\n throw new CanonicalJsonError(\"documentId\", \"must not be empty\");\n }\n if (!target.branch) {\n throw new CanonicalJsonError(\"branch\", \"must not be empty\");\n }\n if (action.input === undefined) {\n throw new CanonicalJsonError(\n \"input\",\n `action ${action.id} (${action.type}) has no input`,\n );\n }\n const fields: unknown[] = [\n \"v2\",\n target.documentId,\n target.branch,\n action.scope,\n action.type,\n action.id,\n action.timestampUtcMs,\n action.input,\n signer.user.address,\n signer.user.networkId,\n signer.user.chainId,\n signer.app.key,\n ];\n fields.forEach((field, i) => {\n assertCanonical(field, PREIMAGE_FIELDS[i], new Set());\n });\n return stringifyJson(fields) as string;\n}\n\n/** `\"v2:\" + base64url(sha256(preimage))`, unpadded. */\nexport async function hashActionV2(\n action: Action,\n target: ActionSigningTarget,\n signer: ActionSignerIdentity,\n): Promise<string> {\n const preimage = actionPreimageV2(action, target, signer);\n const digest = await crypto.subtle.digest(\n \"SHA-256\",\n new TextEncoder().encode(preimage),\n );\n return ACTION_SIGNATURE_V2_PREFIX + bytesToBase64Url(new Uint8Array(digest));\n}\n\n/** Signs `action` as a v2 tuple; the message layout is the legacy one. */\nexport async function signActionV2(params: {\n action: Action;\n target: ActionSigningTarget;\n signer: ActionSignerIdentity;\n sign: ActionSigningHandler;\n previousStateHash?: string;\n}): Promise<Signature> {\n const { action, target, signer, sign } = params;\n const previousStateHash = params.previousStateHash ?? \"\";\n if (previousStateHash.includes(\", \")) {\n throw new Error(\n `Cannot sign action ${action.id}: the previous state hash contains \", \"`,\n );\n }\n\n const tuple: [string, string, string, string] = [\n (Date.now() / 1000).toFixed(0),\n signer.app.key,\n await hashActionV2(action, target, signer),\n previousStateHash,\n ];\n const signature = await sign(buildOperationSignatureMessage(tuple));\n if (signature.length !== 64) {\n throw new Error(\n `Cannot sign action ${action.id}: expected a 64-byte P-256 signature, got ${signature.length} bytes`,\n );\n }\n return [...tuple, `0x${bytesToHex(signature)}`];\n}\n\n/** Element [2] carries the v2 prefix, whether or not it is well formed. */\nexport function isV2ActionHash(hash: string): boolean {\n return hash.startsWith(ACTION_SIGNATURE_V2_PREFIX);\n}\n\n/** The strict shape of a v2 tuple, apart from what its hash covers. */\nexport function v2TupleProblem(tuple: Signature): string | undefined {\n if (!V2_TIMESTAMP.test(tuple[0])) {\n return \"signing time is not decimal seconds\";\n }\n if (!V2_HASH.test(tuple[2])) {\n return \"hash is not v2: and 43 base64url characters\";\n }\n if (!V2_SIGNATURE.test(tuple[4])) {\n return \"signature is not 0x and 128 lowercase hex digits\";\n }\n return undefined;\n}\n\nfunction assertCanonical(\n value: unknown,\n path: string,\n ancestors: Set<object>,\n): void {\n switch (typeof value) {\n case \"string\":\n if (LONE_SURROGATE.test(value)) {\n throw new CanonicalJsonError(path, \"string holds a lone surrogate\");\n }\n return;\n case \"boolean\":\n return;\n case \"number\":\n if (!Number.isFinite(value)) {\n throw new CanonicalJsonError(path, `${value} is not a JSON number`);\n }\n return;\n case \"undefined\":\n throw new CanonicalJsonError(path, \"undefined is not a JSON value\");\n case \"bigint\":\n throw new CanonicalJsonError(path, \"BigInt is not a JSON value\");\n case \"function\":\n case \"symbol\":\n throw new CanonicalJsonError(path, `${typeof value} is not a JSON value`);\n }\n\n if (value === null) {\n return;\n }\n\n const object = value as object;\n if (ancestors.has(object)) {\n throw new CanonicalJsonError(path, \"value is circular\");\n }\n\n const toJSON = (object as { toJSON?: unknown }).toJSON;\n if (typeof toJSON === \"function\") {\n assertCanonical(\n (toJSON as () => unknown).call(object),\n path,\n new Set(ancestors).add(object),\n );\n return;\n }\n\n ancestors.add(object);\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; i++) {\n if (!(i in object)) {\n throw new CanonicalJsonError(`${path}[${i}]`, \"array is sparse\");\n }\n assertCanonical(object[i], `${path}[${i}]`, ancestors);\n }\n } else {\n for (const [key, child] of Object.entries(object)) {\n if (LONE_SURROGATE.test(key)) {\n throw new CanonicalJsonError(path, \"key holds a lone surrogate\");\n }\n if (child === undefined) {\n continue;\n }\n assertCanonical(child, `${path}.${key}`, ancestors);\n }\n }\n ancestors.delete(object);\n}\n\nfunction bytesToBase64Url(bytes: Uint8Array): string {\n let binary = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return btoa(binary)\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\")\n .replace(/=+$/, \"\");\n}\n\nfunction bytesToHex(bytes: Uint8Array): string {\n return Array.from(bytes)\n .map((byte) => byte.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n","import type { PHBaseState } from \"./state.js\";\nimport type { Reducer, StateReducer } from \"./types.js\";\n\nconst STATE_REDUCER = Symbol.for(\"powerhouse.stateReducer\");\n\nexport function tagStateReducer<TState extends PHBaseState>(\n reducer: Reducer<TState>,\n stateReducer: StateReducer<TState>,\n): Reducer<TState> {\n return Object.assign(reducer, { [STATE_REDUCER]: stateReducer });\n}\n\n/** The state reducer a `createReducer` reducer wraps, for base-reducer 3 derivation. */\nexport function stateReducerOf<TState extends PHBaseState = PHBaseState>(\n reducer: Reducer<TState>,\n): StateReducer<TState> | undefined {\n return (reducer as { [STATE_REDUCER]?: StateReducer<TState> })[STATE_REDUCER];\n}\n","import type { PHDocumentHeader } from \"./documents.js\";\nimport type { PeerCapabilityFlags, Supports } from \"./peer-agreement.js\";\nimport type { ProtocolVersions } from \"./signature-policy.js\";\nimport { stateReducerOf } from \"./state-reducer.js\";\nimport type {\n CreateDocumentActionInput,\n DocumentModelModule,\n} from \"./types.js\";\n\nexport const BASE_REDUCER_VERSIONS = [1, 2, 3] as const;\nexport type BaseReducerVersion = (typeof BASE_REDUCER_VERSIONS)[number];\n\n// Each axis is the keys of an interface, so declaration merging can add a value.\n\nexport interface UndoModelValues {\n skip: true;\n \"noop-chain\": true;\n retraction: true;\n}\n/** What UNDO and REDO become. */\nexport type UndoModel = keyof UndoModelValues;\n\nexport interface SkipMeaningValues {\n \"undo-or-rewind\": true;\n rewind: true;\n}\n/** Whether a stored skip can be an undo, or is only a replica's rewind. */\nexport type SkipMeaning = keyof SkipMeaningValues;\n\nexport interface TieOrderValues {\n \"rank-locale\": true;\n canonical: true;\n}\n/** How same-timestamp actions are ordered. */\nexport type TieOrder = keyof TieOrderValues;\n\nexport interface SynthesizedIdFormValues {\n hashed: true;\n none: true;\n}\n/** How a synthesized row's action id derives from its source's; \"none\" synthesizes nothing. */\nexport type SynthesizedIdForm = keyof SynthesizedIdFormValues;\n\nexport interface ReplayHashValues {\n sender: true;\n receiver: true;\n}\n/** Whose state hash a received row keeps. */\nexport type ReplayHash = keyof ReplayHashValues;\n\nexport interface DerivationModelValues {\n replay: true;\n \"retraction-rule\": true;\n}\n/** How a scope's state derives from its rows. */\nexport type DerivationModel = keyof DerivationModelValues;\n\nexport interface ReducerContractValues {\n any: true;\n \"state-reducer\": true;\n}\n/** Which registered reducers a version runs. */\nexport type ReducerContract = keyof ReducerContractValues;\n\nexport interface GatingFlagValues {\n undoV3: true;\n}\n/** A reactor feature flag a version runs only under. */\nexport type GatingFlag = keyof GatingFlagValues;\n\nexport type BaseReducerCapabilities = {\n readonly version: BaseReducerVersion;\n readonly undo: UndoModel;\n /** \"retraction-rule\" derives every scope outside RULE_EXEMPT_SCOPES by the rule. */\n readonly derivation: DerivationModel;\n readonly skip: SkipMeaning;\n readonly tieOrder: TieOrder;\n readonly synthesizedId: SynthesizedIdForm;\n readonly replayHash: ReplayHash;\n /** \"state-reducer\" runs only models whose every registered reducer createReducer tagged. */\n readonly reducerContract: ReducerContract;\n /** The flag this version runs only under; null runs always. */\n readonly gatedBy: GatingFlag | null;\n};\n\nconst CAPABILITIES = {\n 1: {\n version: 1,\n undo: \"skip\",\n derivation: \"replay\",\n skip: \"undo-or-rewind\",\n tieOrder: \"rank-locale\",\n synthesizedId: \"hashed\",\n replayHash: \"sender\",\n reducerContract: \"any\",\n gatedBy: null,\n },\n 2: {\n version: 2,\n undo: \"noop-chain\",\n derivation: \"replay\",\n skip: \"undo-or-rewind\",\n tieOrder: \"rank-locale\",\n synthesizedId: \"hashed\",\n replayHash: \"sender\",\n reducerContract: \"any\",\n gatedBy: null,\n },\n 3: {\n version: 3,\n undo: \"retraction\",\n derivation: \"retraction-rule\",\n skip: \"rewind\",\n tieOrder: \"canonical\",\n synthesizedId: \"none\",\n replayHash: \"receiver\",\n reducerContract: \"state-reducer\",\n gatedBy: \"undoV3\",\n },\n} as const satisfies {\n readonly [V in BaseReducerVersion]: BaseReducerCapabilities & {\n readonly version: V;\n };\n};\n\n/** The versions a reactor running `flags` supports. */\nexport function baseReducerVersionsFor(\n flags: PeerCapabilityFlags,\n): BaseReducerVersion[] {\n return BASE_REDUCER_VERSIONS.filter((version) => {\n const gate = CAPABILITIES[version].gatedBy;\n return gate === null || flags[gate] === true;\n });\n}\n\n/** Flags under which this build runs every version it knows. */\nexport const FLAGS_FOR_EVERY_VERSION: { readonly [F in GatingFlag]: true } =\n Object.fromEntries(\n BASE_REDUCER_VERSIONS.flatMap((version) => {\n const gate = CAPABILITIES[version].gatedBy;\n return gate === null ? [] : [[gate, true]];\n }),\n ) as { readonly [F in GatingFlag]: true };\n\n/** Scopes the retraction rule never derives. */\nexport const RULE_EXEMPT_SCOPES: ReadonlySet<string> = new Set([\n \"auth\",\n \"document\",\n]);\n\nexport function assertNever(value: never, what: string): never {\n throw new Error(`Unhandled ${what}: ${String(value)}`);\n}\n\nexport function isBaseReducerVersion(\n value: unknown,\n): value is BaseReducerVersion {\n return (BASE_REDUCER_VERSIONS as readonly unknown[]).includes(value);\n}\n\nexport function capabilitiesOf(\n version: BaseReducerVersion,\n): BaseReducerCapabilities {\n return CAPABILITIES[version];\n}\n\n/** Throws on a missing version: defaulting one would replay through the wrong reducer. */\nexport function baseReducerVersion(\n header: PHDocumentHeader,\n): BaseReducerVersion {\n const version = header.protocolVersions?.[\"base-reducer\"];\n\n if (typeof version !== \"number\") {\n throw new Error(\n `Document ${header.id} carries no base-reducer protocol version`,\n );\n }\n\n if (!isBaseReducerVersion(version)) {\n throw new Error(\n `Document ${header.id} carries unknown base-reducer protocol version ${version}`,\n );\n }\n\n return version;\n}\n\n/** Throws on a missing or unknown version. */\nexport function baseReducerCapabilities(\n header: PHDocumentHeader,\n): BaseReducerCapabilities {\n return capabilitiesOf(baseReducerVersion(header));\n}\n\n/** Undefined only for a header without a version; throws on an unknown one. */\nexport function optionalBaseReducerCapabilities(\n header: PHDocumentHeader,\n): BaseReducerCapabilities | undefined {\n if (header.protocolVersions?.[\"base-reducer\"] === undefined) {\n return undefined;\n }\n return baseReducerCapabilities(header);\n}\n\n/** Undefined when `versions` names no known base-reducer version. */\nexport function capabilitiesFor(\n versions: ProtocolVersions | undefined,\n): BaseReducerCapabilities | undefined {\n const version = versions?.[\"base-reducer\"];\n return isBaseReducerVersion(version) ? capabilitiesOf(version) : undefined;\n}\n\n/** From CREATE_DOCUMENT input; undefined when it names no known version. */\nexport function createdCapabilities(\n input: Partial<CreateDocumentActionInput> | undefined,\n): BaseReducerCapabilities | undefined {\n return capabilitiesFor(input?.protocolVersions);\n}\n\n/** One answer per value of a capability axis; a new value fails to compile here. */\ntype Decision<A extends string, R> = { readonly [K in A]: R };\n\n/**\n * Every decision a consumer may take on a capability axis. Outside this module\n * and the other protocol owners, an axis is read only through these or through\n * an exhaustive switch.\n */\nexport const CAPABILITY_DECISIONS = {\n usesRetractionRule: {\n replay: false,\n \"retraction-rule\": true,\n } satisfies Decision<DerivationModel, boolean>,\n needsTaggedModel: {\n any: false,\n \"state-reducer\": true,\n } satisfies Decision<ReducerContract, boolean>,\n sortsJobsCanonically: {\n \"rank-locale\": false,\n canonical: true,\n } satisfies Decision<TieOrder, boolean>,\n conflictWindowMovesEveryRow: {\n \"rank-locale\": false,\n canonical: true,\n } satisfies Decision<TieOrder, boolean>,\n skipMayUndo: {\n \"undo-or-rewind\": true,\n rewind: false,\n } satisfies Decision<SkipMeaning, boolean>,\n} as const;\n\n// A header without a version runs v1/v2's rules on every axis read here.\nconst UNVERSIONED = CAPABILITIES[1];\n\n/** Whether the version derives scopes by the retraction rule; a versionless header does not. */\nexport function usesRetractionRule(\n caps: BaseReducerCapabilities | undefined,\n): boolean {\n return CAPABILITY_DECISIONS.usesRetractionRule[\n (caps ?? UNVERSIONED).derivation\n ];\n}\n\n/** Whether the retraction rule derives `scope`. */\nexport function derivesByRule(\n caps: BaseReducerCapabilities | undefined,\n scope: string,\n): boolean {\n return usesRetractionRule(caps) && !RULE_EXEMPT_SCOPES.has(scope);\n}\n\n/** Whether the retraction rule derives `scope` of the document `header` heads. */\nexport function documentDerivesByRule(\n header: PHDocumentHeader,\n scope: string,\n): boolean {\n return derivesByRule(optionalBaseReducerCapabilities(header), scope);\n}\n\n/** Whether the version runs only models whose every reducer is tagged. */\nexport function needsTaggedModel(\n caps: BaseReducerCapabilities | undefined,\n): boolean {\n return CAPABILITY_DECISIONS.needsTaggedModel[\n (caps ?? UNVERSIONED).reducerContract\n ];\n}\n\n/** How same-timestamp actions are ordered; a versionless header ranks and compares by locale. */\nexport function tieOrderOf(\n caps: BaseReducerCapabilities | undefined,\n): TieOrder {\n return (caps ?? UNVERSIONED).tieOrder;\n}\n\n/** Whether a job's actions are stored in canonical order rather than as submitted. */\nexport function sortsJobsCanonically(\n caps: BaseReducerCapabilities | undefined,\n): boolean {\n return CAPABILITY_DECISIONS.sortsJobsCanonically[tieOrderOf(caps)];\n}\n\n/** Whether every conflicting row of a load moves, rather than only those past the predecessor bound. */\nexport function conflictWindowMovesEveryRow(\n caps: BaseReducerCapabilities | undefined,\n): boolean {\n return CAPABILITY_DECISIONS.conflictWindowMovesEveryRow[tieOrderOf(caps)];\n}\n\n/** Whether a stored skip may be an undo, not only a replica's rewind. */\nexport function skipMayUndo(\n caps: BaseReducerCapabilities | undefined,\n): boolean {\n return CAPABILITY_DECISIONS.skipMayUndo[(caps ?? UNVERSIONED).skip];\n}\n\n/** Whether a stored skip in `scope` is a rewind the reducer applies. */\nexport function appliesRewind(\n caps: BaseReducerCapabilities,\n scope: string,\n): boolean {\n return !derivesByRule(caps, scope);\n}\n\n/** Whether a submitted RETRACT is this version's undo. */\nexport function acceptsSubmittedRetract(\n caps: BaseReducerCapabilities,\n): boolean {\n switch (caps.undo) {\n case \"retraction\":\n return true;\n case \"skip\":\n case \"noop-chain\":\n return false;\n default:\n return assertNever(caps.undo, \"undo model\");\n }\n}\n\n/** Whether a submitted UNDO or REDO is this version's undo; on retraction a client submits RETRACT. */\nexport function acceptsSubmittedUndoRedo(\n caps: BaseReducerCapabilities,\n): boolean {\n switch (caps.undo) {\n case \"skip\":\n case \"noop-chain\":\n return true;\n case \"retraction\":\n return false;\n default:\n return assertNever(caps.undo, \"undo model\");\n }\n}\n\n/** Whether every registered version of `documentType` runs under `caps`; undefined when none is. */\nexport function modelRunsBaseReducer(\n caps: BaseReducerCapabilities,\n documentType: string,\n modules: readonly DocumentModelModule[],\n): boolean | undefined {\n const registered = modules.filter(\n (module) => module.documentModel.global.id === documentType,\n );\n if (registered.length === 0) return undefined;\n if (!needsTaggedModel(caps)) return true;\n return registered.every(\n (module) => stateReducerOf(module.reducer) !== undefined,\n );\n}\n\nexport type ProtocolSupport = Supports[\"protocols\"];\n\nexport type ProtocolRefusal = {\n protocol: string;\n version: number;\n /** Set when the version is supported but this model cannot run it. */\n documentType?: string;\n};\n\n/** Why `versions` cannot run here; unregistered protocols and types are admitted. */\nexport function refusalFor(\n documentType: string | undefined,\n versions: ProtocolVersions | undefined,\n support: ProtocolSupport,\n modules: readonly DocumentModelModule[],\n): ProtocolRefusal | undefined {\n for (const [protocol, version] of Object.entries(versions ?? {})) {\n const supported = support[protocol] as readonly number[] | undefined;\n if (supported === undefined || supported.includes(version)) continue;\n return { protocol, version };\n }\n const version = versions?.[\"base-reducer\"];\n if (documentType === undefined || !isBaseReducerVersion(version)) {\n return undefined;\n }\n if (\n modelRunsBaseReducer(capabilitiesOf(version), documentType, modules) ===\n false\n ) {\n return { protocol: \"base-reducer\", version, documentType };\n }\n return undefined;\n}\n","import { sha256 } from \"@noble/hashes/sha2.js\";\nimport { canonicalJson } from \"./action-signature.js\";\nimport {\n assertNever,\n baseReducerVersionsFor,\n capabilitiesOf,\n isBaseReducerVersion,\n} from \"./base-reducer-protocol.js\";\nimport { bytesToBase64Url } from \"./crypto.js\";\n\n/** The reactor feature flags a capability's support is a function of. */\nexport type PeerCapabilityFlags = {\n readonly undoV3?: boolean;\n readonly [flag: string]: boolean | undefined;\n};\n\n/** A document protocol, named by its `protocolVersions` key. */\nexport type ProtocolCapability = {\n kind: \"protocol\";\n name: string;\n /** What a peer that announces nothing is assumed to support. */\n baseline: readonly number[];\n supported(flags: PeerCapabilityFlags): readonly number[];\n /** The version new documents take when peers agree. Absent: not negotiated. */\n preferred?(flags: PeerCapabilityFlags): number;\n /** Who chooses a new document's version, given the creator's preference; absent: \"agreed\". */\n selection?:\n | ProtocolSelectionRule\n | ((preferred: number) => ProtocolSelectionRule);\n /** A header may omit the key. */\n optional: boolean;\n};\n\n/**\n * \"agreed\": the creator's preference narrowed to what every member supports.\n * \"creator\": the creator's preference; a member that cannot run it is held.\n */\nexport type ProtocolSelectionRule = \"agreed\" | \"creator\";\n\n/** A feature that changes what a peer sends or expects on the wire. */\nexport type FeatureCapability = {\n kind: \"feature\";\n name: string;\n baseline: readonly number[];\n supported(flags: PeerCapabilityFlags): readonly number[];\n};\n\nexport type PeerCapability = ProtocolCapability | FeatureCapability;\n\n/** A purged document's protocol; never preferred, so creation never selects it. */\nexport const DOCUMENT_PURGE_PROTOCOL = \"document-purge\";\n\n/** A peer that takes refusals of polled purge markers on the poll. */\nexport const MARKER_REFUSAL_FEATURE = \"marker-refusal\";\n\n// Baselines are frozen at what the last release without peer agreement runs.\nexport const PEER_CAPABILITIES: readonly PeerCapability[] = [\n {\n kind: \"protocol\",\n name: \"base-reducer\",\n baseline: [1, 2],\n supported: baseReducerVersionsFor,\n preferred: (flags: PeerCapabilityFlags) =>\n Math.max(...baseReducerVersionsFor(flags)),\n selection: (preferred) =>\n isBaseReducerVersion(preferred) &&\n capabilitiesOf(preferred).gatedBy !== null\n ? \"creator\"\n : \"agreed\",\n optional: false,\n },\n {\n kind: \"protocol\",\n name: \"signature\",\n baseline: [2],\n supported: () => [2],\n optional: true,\n },\n {\n kind: \"protocol\",\n name: DOCUMENT_PURGE_PROTOCOL,\n baseline: [],\n supported: () => [1],\n optional: true,\n },\n {\n kind: \"feature\",\n name: MARKER_REFUSAL_FEATURE,\n baseline: [],\n supported: () => [1],\n },\n];\n\n/** `base-reducer`'s preference with no reactor flags, which shared never holds. */\nexport const FLAGLESS_BASE_REDUCER_VERSION: number = (\n PEER_CAPABILITIES.find(\n (capability) =>\n capability.kind === \"protocol\" && capability.name === \"base-reducer\",\n ) as ProtocolCapability\n).preferred!({});\n\n/** `base` plus `extra`; an extra replaces a base entry of the same name. */\nexport function mergePeerCapabilities(\n base: readonly PeerCapability[],\n extra: readonly PeerCapability[],\n): PeerCapability[] {\n const key = (capability: PeerCapability) =>\n `${capability.kind}:${capability.name}`;\n const replaced = new Set(extra.map(key));\n return [\n ...base.filter((capability) => !replaced.has(key(capability))),\n ...extra,\n ];\n}\n\nexport const PEER_MANIFEST_FORMAT = 1;\n\nexport type Supports = {\n protocols: { [protocol: string]: readonly number[] };\n features: { [feature: string]: readonly number[] };\n};\n\nexport type PeerManifest = Supports & {\n format: 1;\n /** The signer's did:key, when configured; informational. */\n appKey?: string;\n /** Grows with every start of the reactor; a peer ignores an older one. */\n sequence: number;\n /** base64url(sha256(canonicalJson(Supports & { sequence }))) */\n revision: string;\n};\n\nfunction versionSet(values: readonly number[]): number[] {\n return [...new Set(values)].sort((a, b) => a - b);\n}\n\nfunction supportsFrom(\n capabilities: readonly PeerCapability[],\n values: (capability: PeerCapability) => readonly number[],\n): Supports {\n const supports: Supports = { protocols: {}, features: {} };\n for (const capability of capabilities) {\n const target =\n capability.kind === \"protocol\" ? supports.protocols : supports.features;\n target[capability.name] = versionSet(values(capability));\n }\n return supports;\n}\n\n/** What this reactor supports, for every capability it registers. */\nexport function localSupports(\n capabilities: readonly PeerCapability[],\n flags: PeerCapabilityFlags,\n): Supports {\n return supportsFrom(capabilities, (capability) =>\n capability.supported(flags),\n );\n}\n\n/** What a peer that announces nothing supports. */\nexport function legacySupports(\n capabilities: readonly PeerCapability[],\n): Supports {\n return supportsFrom(capabilities, (capability) => capability.baseline);\n}\n\nexport function manifestRevision(supports: Supports, sequence = 0): string {\n const preimage = canonicalJson(\n { protocols: supports.protocols, features: supports.features, sequence },\n \"peer manifest\",\n );\n return bytesToBase64Url(sha256(new TextEncoder().encode(preimage)));\n}\n\nexport function localPeerManifest(\n capabilities: readonly PeerCapability[],\n flags: PeerCapabilityFlags,\n appKey?: string,\n sequence = 0,\n): PeerManifest {\n const supports = localSupports(capabilities, flags);\n return {\n format: PEER_MANIFEST_FORMAT,\n ...(appKey !== undefined ? { appKey } : {}),\n sequence,\n revision: manifestRevision(supports, sequence),\n protocols: supports.protocols,\n features: supports.features,\n };\n}\n\n/** A manifest sent before the one already held; silence carries no sequence. */\nexport function isOlderManifest(\n next: PeerManifest | null,\n held: PeerManifest | null | undefined,\n): boolean {\n return next !== null && held != null && next.sequence < held.sequence;\n}\n\n/** A peer's manifest, or the baselines for a peer that announced none. */\nexport function peerSupports(\n manifest: PeerManifest | null,\n capabilities: readonly PeerCapability[],\n): Supports {\n return manifest ?? legacySupports(capabilities);\n}\n\nfunction readVersionMap(\n value: unknown,\n): { [name: string]: readonly number[] } | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return undefined;\n }\n const map: { [name: string]: readonly number[] } = {};\n for (const [name, versions] of Object.entries(value)) {\n if (\n !Array.isArray(versions) ||\n !versions.every((v) => Number.isInteger(v))\n ) {\n return undefined;\n }\n map[name] = versionSet(versions as number[]);\n }\n return map;\n}\n\n/**\n * A manifest as received from a peer, or null when it is not one. Formats only\n * add fields, so one of an unknown format is read as its two maps.\n */\nexport function readPeerManifest(value: unknown): PeerManifest | null {\n if (typeof value !== \"object\" || value === null) {\n return null;\n }\n const raw = value as Record<string, unknown>;\n const protocols = readVersionMap(raw.protocols);\n const features = readVersionMap(raw.features ?? {});\n if (!protocols || !features) {\n return null;\n }\n const sequence = Number.isSafeInteger(raw.sequence)\n ? (raw.sequence as number)\n : 0;\n return {\n format: PEER_MANIFEST_FORMAT,\n ...(typeof raw.appKey === \"string\" ? { appKey: raw.appKey } : {}),\n sequence,\n revision:\n typeof raw.revision === \"string\"\n ? raw.revision\n : manifestRevision({ protocols, features }, sequence),\n protocols,\n features,\n };\n}\n\n/** Why a document may not go to a peer. */\nexport type HoldReason = {\n protocol: string;\n version: number;\n peerSupports: readonly number[];\n};\n\n/** Only keys this reactor registers are judged; an absent key agrees. */\nexport function holdReason(\n peer: Supports,\n versions: { readonly [protocol: string]: number },\n capabilities: readonly PeerCapability[],\n): HoldReason | undefined {\n for (const capability of capabilities) {\n if (capability.kind !== \"protocol\") continue;\n const version = versions[capability.name] as number | undefined;\n if (version === undefined) continue;\n const supported = peer.protocols[capability.name] ?? [];\n if (!supported.includes(version)) {\n return { protocol: capability.name, version, peerSupports: supported };\n }\n }\n return undefined;\n}\n\n/** Whether a peer runs every version this reactor does, so nothing is held. */\nexport function coversLocal(\n peer: Supports,\n local: Supports,\n capabilities: readonly PeerCapability[],\n): boolean {\n for (const capability of capabilities) {\n if (capability.kind !== \"protocol\") continue;\n const theirs = peer.protocols[capability.name] ?? [];\n const ours = local.protocols[capability.name] ?? [];\n if (!ours.every((version) => theirs.includes(version))) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * protocolVersions for a new document: per negotiated protocol, the highest\n * version up to the local preference that every member supports, else the\n * lowest local one. `requested` wins over what is selected.\n */\nexport function selectProtocolVersions(input: {\n capabilities: readonly PeerCapability[];\n flags: PeerCapabilityFlags;\n members: Iterable<Supports>;\n requested?: { readonly [protocol: string]: number };\n}): { [protocol: string]: number } {\n const members = [...input.members];\n const selected: { [protocol: string]: number } = {};\n for (const capability of input.capabilities) {\n if (capability.kind !== \"protocol\" || !capability.preferred) continue;\n const preferred = capability.preferred(input.flags);\n const supported = capability.supported(input.flags);\n let agreed = supported.filter((version) => version <= preferred);\n for (const member of narrowedBy(capability, preferred, members)) {\n const theirs = member.protocols[capability.name] ?? [];\n agreed = agreed.filter((version) => theirs.includes(version));\n }\n selected[capability.name] =\n agreed.length > 0 ? Math.max(...agreed) : Math.min(...supported);\n }\n return { ...selected, ...input.requested };\n}\n\nfunction narrowedBy(\n capability: ProtocolCapability,\n preferred: number,\n members: readonly Supports[],\n): readonly Supports[] {\n const rule =\n typeof capability.selection === \"function\"\n ? capability.selection(preferred)\n : (capability.selection ?? \"agreed\");\n switch (rule) {\n case \"agreed\":\n return members;\n case \"creator\":\n return [];\n default:\n return assertNever(rule, \"protocol selection rule\");\n }\n}\n\n/**\n * Another reactor's selection for a new document, within `supports`: a\n * negotiated protocol drops to the highest supported version at or below it,\n * or takes its baseline when absent; another known protocol must be\n * supported; an unknown one passes, as refusalFor admits it.\n */\nexport function capSelection(\n selected: { readonly [protocol: string]: number } | undefined,\n capabilities: readonly PeerCapability[],\n supports: Supports,\n): { [protocol: string]: number } {\n const capped: { [protocol: string]: number } = { ...selected };\n for (const capability of capabilities) {\n if (capability.kind !== \"protocol\") continue;\n const runs = supports.protocols[capability.name] ?? [];\n const version = capped[capability.name];\n if (capability.preferred) {\n const fits =\n version === undefined\n ? capability.baseline.filter((v) => runs.includes(v))\n : runs.filter((v) => v <= version);\n if (fits.length === 0) {\n throw new Error(\n `Cannot create at ${capability.name} ${version ?? \"baseline\"}: this client runs ${runs.join(\", \") || \"none\"}`,\n );\n }\n capped[capability.name] = Math.max(...fits);\n } else if (version !== undefined && !runs.includes(version)) {\n throw new Error(\n `Cannot create at ${capability.name} ${version}: this client runs ${runs.join(\", \") || \"none\"}`,\n );\n }\n }\n return capped;\n}\n","import type { Action } from \"./actions.js\";\nimport type { Operation, OperationWithContext } from \"./operations.js\";\nimport { DOCUMENT_PURGE_PROTOCOL } from \"./peer-agreement.js\";\nimport type { PurgeDocumentAction, PurgeDocumentActionInput } from \"./types.js\";\nimport { deriveOperationId, generateActionId } from \"./utils.js\";\n\nexport const PURGE_DOCUMENT = \"PURGE_DOCUMENT\";\n\nexport type PurgeMarkerOperation = Operation & { action: PurgeDocumentAction };\n\ntype ActionLike = Pick<Action, \"type\">;\n\nexport function isPurgeMarker(value: Action): value is PurgeDocumentAction;\nexport function isPurgeMarker(value: Operation): value is PurgeMarkerOperation;\nexport function isPurgeMarker(\n value: OperationWithContext,\n): value is OperationWithContext & { operation: PurgeMarkerOperation };\nexport function isPurgeMarker(\n value: ActionLike | { action?: ActionLike } | { operation: Operation },\n): boolean;\nexport function isPurgeMarker(\n value: ActionLike | { action?: ActionLike } | { operation: Operation },\n): boolean {\n const action =\n \"operation\" in value\n ? value.operation.action\n : \"action\" in value\n ? value.action\n : (value as ActionLike);\n return action?.type === PURGE_DOCUMENT;\n}\n\n/** An unsigned marker; `purgedAtUtcIso` is the action's own timestamp. */\nexport function purgeDocumentAction(\n input: Omit<PurgeDocumentActionInput, \"purgedAtUtcIso\">,\n options: { id?: string; timestampUtcMs?: string } = {},\n): PurgeDocumentAction {\n const timestampUtcMs = options.timestampUtcMs ?? new Date().toISOString();\n return {\n id: options.id ?? generateActionId(),\n type: PURGE_DOCUMENT,\n scope: \"document\",\n timestampUtcMs,\n input: {\n documentId: input.documentId,\n documentType: input.documentType,\n purgedAtUtcIso: timestampUtcMs,\n requestId: input.requestId,\n },\n };\n}\n\n/** The sole row of a purged stream: document/main, index 0, skip 0, hash \"\". */\nexport function purgeMarkerOperation(\n action: PurgeDocumentAction,\n): PurgeMarkerOperation {\n return {\n id: deriveOperationId(\n action.input.documentId,\n \"document\",\n \"main\",\n action.id,\n ),\n index: 0,\n skip: 0,\n timestampUtcMs: action.timestampUtcMs,\n hash: \"\",\n action,\n };\n}\n\n/** Protocol versions of a purged id; derived, never stored. */\nexport function purgedProtocolVersions(): { [protocol: string]: number } {\n return { [DOCUMENT_PURGE_PROTOCOL]: 1 };\n}\n"],"mappings":";;;;;AAUA,MAAa,6BAA6B;AAG1C,MAAM,UAAU;AAChB,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,iBAAiB;AACvB,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAeA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,YAAY,MAAc,QAAgB;EACxC,MAAM,uBAAuB,KAAK,IAAI,QAAQ;EAC9C,KAAK,OAAO;CACd;AACF;;AAGA,SAAgB,cAAc,OAAgB,QAAQ,SAAiB;CACrE,gBAAgB,OAAO,uBAAO,IAAI,IAAI,CAAC;CACvC,OAAOA,UAAc,KAAK;AAC5B;;AAGA,MAAa,8CAAmD,IAAI,IAAI;CACtE;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,SAAgB,iBACd,QACA,UACQ;CACR,MAAM,QAAQ,OAAO;CAIrB,IACE,OAAO,SAAS,sBAChB,OAAO,SAAS,yBAChB,OAAO,SAAS,uBAEhB,OAAO,OAAO,OAAO,aAAa,YAAY,MAAM,SAAS,SAAS,IAClE,MAAM,WACN;CAGN,OAAO,OAAO,OAAO,eAAe,YAAY,MAAM,WAAW,SAAS,IACtE,MAAM,aACN;AACN;;AAGA,SAAgB,oBACd,QACA,YACA,QACqB;CACrB,OAAO;EACL,YAAY,4BAA4B,IAAI,OAAO,IAAI,IACnD,iBAAiB,QAAQ,UAAU,IACnC;EACJ;CACF;AACF;;AAGA,SAAgB,qBAAqB,QAGZ;CACvB,OAAO;EACL,MAAM;GAC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AAM,UAAU,SAChB,YAAY,QACV,MAAM,SACL,MAAA,EACM,SAAS;AAC1B;;AAGA,SAAgB,oBACd,OACA,UAAoD,CAAC,GAChC;CACrB,MAAM,iBAAiB,QAAQ,mCAAkB,IAAI,KAAK,EAAA,CAAE,YAAY;CACxE,OAAO;EACL,IAAI,QAAQ,MAAM,iBAAiB;EACnC,MAAM;EACN,OAAO;EACP;EACA,OAAO;GACL,YAAY,MAAM;GAClB,cAAc,MAAM;GACpB,gBAAgB;GAChB,WAAW,MAAM;EACnB;CACF;AACF;;AAGA,SAAgB,qBACd,QACsB;CACtB,OAAO;EACL,IAAI,kBACF,OAAO,MAAM,YACb,YACA,QACA,OAAO,EACT;EACA,OAAO;EACP,MAAM;EACN,gBAAgB,OAAO;EACvB,MAAM;EACN;CACF;AACF;;AAGA,SAAgB,yBAAyD;CACvE,OAAO,GAAG,0BAA0B,EAAE;AACxC"}
@@ -1,5 +1,5 @@
1
- import { it as DEFAULT_REGISTRY_URL } from "../types-DR4mZKAj.js";
2
- import { B as PackagePage, F as PACKAGE_MODULE_TYPES, G as RegistryPackageSource, H as RegistryPackage, I as PackageFacets, K as RegistryPackageStatus, L as PackageInfo, R as PackageListItem, U as RegistryPackageList, V as Page, W as RegistryPackageMap, z as PackageModuleType } from "../types-DPBZvxkk.js";
1
+ import { ot as DEFAULT_REGISTRY_URL } from "../types-D1ToC1mB.js";
2
+ import { B as PackagePage, F as PACKAGE_MODULE_TYPES, G as RegistryPackageSource, H as RegistryPackage, I as PackageFacets, K as RegistryPackageStatus, L as PackageInfo, R as PackageListItem, U as RegistryPackageList, V as Page, W as RegistryPackageMap, z as PackageModuleType } from "../types-DRj0sF2w.js";
3
3
  import { slimManifest } from "./manifest-slim.js";
4
4
  import { toCdnUrl } from "./urls.js";
5
5
  import { getUpdateTarget, parseInstallSpec } from "./updates.js";
@@ -1,5 +1,5 @@
1
- import { $n as Manifest } from "../types-DR4mZKAj.js";
2
- import "../types-DPBZvxkk.js";
1
+ import { nr as Manifest } from "../types-D1ToC1mB.js";
2
+ import "../types-DRj0sF2w.js";
3
3
  //#region registry/manifest-slim.d.ts
4
4
  /**
5
5
  * Reduce a manifest to the summary fields the package-listing surfaces