@party-stack/ontology-backend 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/protocol.d.ts +5 -0
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js.map +1 -1
- package/package.json +1 -1
package/lib/protocol.d.ts
CHANGED
|
@@ -112,6 +112,11 @@ export interface OntologySource {
|
|
|
112
112
|
readonly read: (session: ClientSession, view?: ClientView) => Effect.Effect<ClientState, BackendError>;
|
|
113
113
|
readonly subscribe?: (session: ClientSession, view: ClientView, policy?: DeliveryPolicy, resume?: DeliveryPosition) => Effect.Effect<DeliverySubscription, BackendError, Scope.Scope>;
|
|
114
114
|
readonly acknowledgeDelivery?: (position: DeliveryPosition) => Effect.Effect<void, BackendError>;
|
|
115
|
+
/** Change the view of this client's open state subscription in place. The source
|
|
116
|
+
* acquires the added subsets before releasing removed ones and delivers the change
|
|
117
|
+
* on the same stream. A source that cannot fails `ViewReplaced`, and the client
|
|
118
|
+
* subscribes again with the new view. */
|
|
119
|
+
readonly updateView?: (session: ClientSession, view: ClientView) => Effect.Effect<void, BackendError>;
|
|
115
120
|
/** Acceptance only; selected delivery carries the resulting state. */
|
|
116
121
|
readonly accept?: (request: ClientSubmission) => Effect.Effect<void, BackendError>;
|
|
117
122
|
/** Snapshot-mode interest lease. The first element confirms acquisition;
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","names":["_$__errors_js0.ValidationIssue","_$__delivery_js0.DeliveryPolicy","_$__delivery_js0.DeliveryPosition","_$__delivery_js0.DeliverySubscription"],"sources":["../src/protocol.ts"],"mappings":";;;;;;;;;;iBAciB;WACJ,YAAY;WACZ;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA,yBAXYA;WAYZ;;WAEA;WACA;WACA;WACA,UAAU;WACV,UAAU;WACV;aAAwB;aAA2B;;;;;;;WAMnD;WACA,oBAAoB;WACpB;;;;;iBAMI;WACJ;WACA;WACA;WACA;aAAkB;;WAClB;aACI;aACA,eAAe,IAAI;aACnB,oBAAoB,IAAI,SAAS;;WAErC,kBAAkB;WAClB,oBAAoB;;;;;iBAMhB;WACJ,kBAAkB;WAClB;;;WAGA;;iBAEI;WACJ;WACA,WAAW;;iBAGP;WACJ;aACI,QAAQ;aACR;;aAEA;;WAEJ,OAAO;WACP,QAAQ;;iBAEJ;WACJ,SAAS;WACT;WACA,YAAY;WACZ;;WAEA;WACA,OAAO;;;;;;iBAOH;WACJ;WACA;aACI,SACL,YACA;eAAqB;UACpB,OAAO,aAAa;aAChB,QACL,YACA;eAAqB;UACpB,OAAO,aAAa;aAChB,OAAO,YAAY,SAAS,kBAAkB,OAAO,aAAa;;WAEtE;WACA,aAAa,SAAS,gBAAgB,OAAO,OAAO,aAAa;WACjE,OAAO,SAAS,eAAe,OAAO,eAAe,OAAO,OAAO,aAAa;WAChF,aACL,SAAS,eACT,MAAM,YACN,SADMC,gBAEN,SADiCC,qBAEhC,OAAO,OADyBC,sBAC4B,cAAc,MAAM;WAC5E,uBACL,UAFQD,qBAGP,OAAO,aAAa;;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","names":["_$__errors_js0.ValidationIssue","_$__delivery_js0.DeliveryPolicy","_$__delivery_js0.DeliveryPosition","_$__delivery_js0.DeliverySubscription"],"sources":["../src/protocol.ts"],"mappings":";;;;;;;;;;iBAciB;WACJ,YAAY;WACZ;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA,yBAXYA;WAYZ;;WAEA;WACA;WACA;WACA,UAAU;WACV,UAAU;WACV;aAAwB;aAA2B;;;;;;;WAMnD;WACA,oBAAoB;WACpB;;;;;iBAMI;WACJ;WACA;WACA;WACA;aAAkB;;WAClB;aACI;aACA,eAAe,IAAI;aACnB,oBAAoB,IAAI,SAAS;;WAErC,kBAAkB;WAClB,oBAAoB;;;;;iBAMhB;WACJ,kBAAk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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAgD1B,qBAAsB,GAAC,QAAU,OAAO,MAAM,OAAK,OAAO,MAAM;qBAoBhE,kBAAgB,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAChB,uBAAqB,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBACrB,iBAAe,OAAA;;;;;;;;;;;qBACf,qBAAmB,OAAA;;;;qBAEnB,qBAAmB,OAAA;;;;;;;;qBAEnB,mBAAiB,OAAA,iDAAA;qBACjB,sBAAoB,OAAA"}
|
package/lib/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","names":[],"sources":["../src/protocol.ts"],"sourcesContent":["import { QuerySchema } from \"@party-stack/ontology-storage\";\nimport { Table } from \"@party-stack/ontology-storage/tables\";\nimport { Effect, Schema, SchemaGetter, SchemaIssue } from \"effect\";\nimport { ClientLeaseSchema, ClientSessionSchema } from \"./clients.js\";\nimport { ObjectSubsetSchema, ObjectSelectionSchema } from \"./subset.js\";\nimport { ActionReceiptSchema, BackendErrorKindSchema, ValidationIssueSchema } from \"./index.js\";\nimport type { ClientLease, ClientSession, ClientToken } from \"./clients.js\";\nimport type { ActionRequest, ActionReceipt, BackendError } from \"./index.js\";\nimport type { CompiledSubset } from \"./subset.js\";\nimport type { Row } from \"@party-stack/ontology-storage\";\nimport type { Override } from \"@party-stack/ontology-storage/overlay\";\nimport type { Scope, Stream } from \"effect\";\n\n/** Logical action state shared by owned sources, intermediate replicas and clients. */\nexport interface PendingAction {\n readonly invocation: ActionRequest;\n readonly requestIdentity: string;\n readonly createdAt: number;\n readonly sequence: number;\n readonly state: \"queued\" | \"sending\" | \"acknowledged\" | \"blocked\";\n readonly optimistic: boolean;\n readonly attempts: number;\n /** Total attempts at the last explicit retry; automatic retry budgets start here. */\n readonly retryFromAttempt?: number;\n readonly nextAttemptAt?: number;\n readonly failureMessage?: string;\n readonly failureIssues?: readonly import(\"./errors.js\").ValidationIssue[];\n readonly completedAt?: number;\n /** The upstream cannot safely deduplicate another attempt; caller acknowledgment is required. */\n readonly retryRequiresAcknowledgement?: boolean;\n readonly failureOutcome?: \"not-committed\" | \"unknown\";\n readonly failureRetryable?: boolean;\n readonly receipt?: ActionReceipt;\n readonly failure?: BackendError[\"kind\"];\n readonly submission?: { readonly clientId: string; readonly sequence: number };\n /** Whether the local prediction is reflected in visible state. `dropped` means it is\n * not reflected locally: its last replay failed (`predictionFailure` says why), or\n * the queue is stopped at a blocked action (this one or an earlier one).\n * `none` means it was never predicted here (confirmed visibility or a source prediction).\n * Absent on entries stored before this field existed; treat as `optimistic ? \"applied\" : \"none\"`. */\n readonly prediction?: \"applied\" | \"dropped\" | \"none\";\n readonly predictionFailure?: BackendError[\"kind\"];\n readonly predictionMessage?: string;\n}\n\n/** Consistent logical state. Selected views limit membership, while authorization\n * and property/action projection remain the server's responsibility.\n */\nexport interface ReplicaStateSnapshot {\n readonly sourceId: string;\n readonly revision: number;\n readonly definition: string;\n readonly view?: { readonly generation: number };\n readonly objects: readonly {\n readonly objectType: string;\n readonly base: readonly Row<Record<string, unknown>>[];\n readonly overrides: readonly Row<Override<Record<string, unknown>>>[];\n }[];\n readonly pending: readonly PendingAction[];\n readonly completed: readonly PendingAction[];\n}\n\n/** Membership is evaluated against the source's composed visible state. Action\n * inspection is privileged and must be authorized independently of row access.\n */\nexport interface StateSelection {\n readonly subsets: readonly CompiledSubset[];\n readonly actionIds: readonly string[];\n /** Include the pending queue. Outcomes are selected by actionIds, including\n * pending actions already observed by the child, not the parent's full history. */\n readonly inspectActions?: boolean;\n}\nexport interface ClientView {\n readonly generation: number;\n readonly selection: StateSelection;\n}\n\nexport interface ClientState {\n readonly coverage?: readonly {\n readonly subset: CompiledSubset;\n readonly complete: boolean;\n /** Previously confirmed resident coverage; it may need background refresh. */\n readonly cached?: boolean;\n }[];\n readonly state: ReplicaStateSnapshot;\n readonly client: ClientLease;\n}\nexport interface ClientSubmission {\n readonly session: ClientSession;\n readonly sequence: number;\n readonly invocation: ActionRequest;\n readonly optimistic: boolean;\n /** Newly staged child copies required before first acceptance; duplicates need no transfer. */\n readonly stagedAttachments?: readonly string[];\n readonly view?: ClientView;\n}\n\n/** A protocol source need not contain a Replica or an upstream outbox. Ordered\n * submission idempotency is scoped to a valid resumable client lease. A transport\n * must bind authorization and decode data before exposing this interface.\n */\nexport interface OntologySource {\n readonly sourceId: string;\n readonly outbox?: {\n readonly remove: (\n id: string,\n options?: { readonly allowUnknownOutcome?: boolean }\n ) => Effect.Effect<void, BackendError>;\n readonly retry: (\n id: string,\n options?: { readonly allowUnknownOutcome?: boolean }\n ) => Effect.Effect<void, BackendError>;\n readonly edit: (id: string, request: ActionRequest) => Effect.Effect<void, BackendError>;\n };\n readonly supportsIdempotency: boolean;\n readonly openClient: (resume?: ClientToken) => Effect.Effect<ClientLease, BackendError>;\n readonly read: (session: ClientSession, view?: ClientView) => Effect.Effect<ClientState, BackendError>;\n readonly subscribe?: (\n session: ClientSession,\n view: ClientView,\n policy?: import(\"./delivery.js\").DeliveryPolicy,\n resume?: import(\"./delivery.js\").DeliveryPosition\n ) => Effect.Effect<import(\"./delivery.js\").DeliverySubscription, BackendError, Scope.Scope>;\n readonly acknowledgeDelivery?: (\n position: import(\"./delivery.js\").DeliveryPosition\n ) => Effect.Effect<void, BackendError>;\n /** Acceptance only; selected delivery carries the resulting state. */\n readonly accept?: (request: ClientSubmission) => Effect.Effect<void, BackendError>;\n /** Snapshot-mode interest lease. The first element confirms acquisition;\n * failures/EOF remain observable, and closing the stream releases interest.\n * Replica supervision owns retries, not the transport.\n */\n readonly demand: (subset: CompiledSubset) => Stream.Stream<void, BackendError>;\n readonly subscribeChanges: Effect.Effect<Stream.Stream<void, BackendError>, BackendError, Scope.Scope>;\n readonly submit: (request: ClientSubmission) => Effect.Effect<ClientState, BackendError>;\n readonly acknowledge: (\n session: ClientSession,\n revision: number,\n through: number,\n viewGeneration?: number\n ) => Effect.Effect<void, BackendError>;\n}\n\n/** Row/action arrays represent keyed records, not their transport ordering. */\nexport const stateIdentity = (snapshot: ReplicaStateSnapshot): string => {\n const compare = (a: string, b: string) => (a < b ? -1 : a > b ? 1 : 0);\n const rows = <A>(values: readonly Row<A>[]) =>\n [...values].sort((a, b) => compare(JSON.stringify(a.key), JSON.stringify(b.key)));\n const actions = (values: readonly PendingAction[]) =>\n [...values].sort((a, b) => compare(a.invocation.id, b.invocation.id));\n return Table.make({ name: \"state-identity\" }).encode({\n ...snapshot,\n objects: [...snapshot.objects]\n .sort((a, b) => compare(a.objectType, b.objectType))\n .map((object) => ({\n ...object,\n base: rows(object.base),\n overrides: rows(object.overrides),\n })),\n pending: actions(snapshot.pending),\n completed: actions(snapshot.completed),\n });\n};\n\nconst Counter = Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER }));\nconst PositiveCounter = Counter.check(Schema.isGreaterThan(0));\nconst KeySchema = Schema.Union([Schema.String, Schema.Finite]);\nconst ValueSchema = Schema.Record(Schema.String, Schema.Unknown);\nexport const ActionRequestSchema = Schema.Struct({\n id: Schema.NonEmptyString,\n name: Schema.NonEmptyString,\n parameters: ValueSchema,\n replay: Schema.optional(Schema.Struct({ now: Schema.String, seed: Schema.NonEmptyString })),\n});\nexport const PendingActionSchema = Schema.Struct({\n invocation: ActionRequestSchema,\n requestIdentity: Schema.String,\n createdAt: Schema.Finite,\n sequence: PositiveCounter,\n state: Schema.Literals([\"queued\", \"sending\", \"acknowledged\", \"blocked\"]),\n optimistic: Schema.Boolean,\n attempts: Counter,\n retryFromAttempt: Schema.optional(Counter),\n nextAttemptAt: Schema.optional(Schema.Finite),\n failureMessage: Schema.optional(Schema.String),\n failureIssues: Schema.optional(Schema.Array(ValidationIssueSchema)),\n completedAt: Schema.optional(Schema.Finite),\n retryRequiresAcknowledgement: Schema.optional(Schema.Boolean),\n failureOutcome: Schema.optional(Schema.Literals([\"not-committed\", \"unknown\"])),\n failureRetryable: Schema.optional(Schema.Boolean),\n receipt: Schema.optional(ActionReceiptSchema),\n failure: Schema.optional(BackendErrorKindSchema),\n submission: Schema.optional(\n Schema.Struct({ clientId: Schema.NonEmptyString, sequence: PositiveCounter })\n ),\n prediction: Schema.optional(Schema.Literals([\"applied\", \"dropped\", \"none\"])),\n predictionFailure: Schema.optional(BackendErrorKindSchema),\n predictionMessage: Schema.optional(Schema.String),\n});\nexport const CompiledSubsetSchema = Schema.Struct({\n objectType: Schema.NonEmptyString,\n query: Schema.optional(QuerySchema),\n});\nexport const StateSelectionSchema = Schema.Struct({\n subsets: Schema.Array(CompiledSubsetSchema),\n actionIds: Schema.Array(Schema.NonEmptyString),\n inspectActions: Schema.optional(Schema.Boolean),\n});\nexport const ClientViewSchema = Schema.Struct({\n generation: PositiveCounter,\n selection: StateSelectionSchema,\n});\nexport const ReplicaStateSnapshotSchema = Schema.Struct({\n sourceId: Schema.NonEmptyString,\n revision: PositiveCounter,\n definition: Schema.NonEmptyString,\n view: Schema.optional(Schema.Struct({ generation: PositiveCounter })),\n objects: Schema.Array(\n Schema.Struct({\n objectType: Schema.NonEmptyString,\n base: Schema.Array(Schema.Struct({ key: KeySchema, value: ValueSchema })),\n overrides: Schema.Array(\n Schema.Struct({\n key: KeySchema,\n value: Schema.Union([\n Schema.Struct({ deleted: Schema.Literal(true) }),\n Schema.Struct({ deleted: Schema.Literal(false), value: ValueSchema }),\n ]),\n })\n ),\n })\n ),\n pending: Schema.Array(PendingActionSchema),\n completed: Schema.Array(PendingActionSchema),\n});\nconst ClientStateSchema = Schema.Struct({\n state: ReplicaStateSnapshotSchema,\n client: ClientLeaseSchema,\n coverage: Schema.optional(\n Schema.Array(\n Schema.Struct({\n subset: CompiledSubsetSchema,\n complete: Schema.Boolean,\n cached: Schema.optional(Schema.Boolean),\n })\n )\n ),\n});\nconst ClientSubmissionSchema = Schema.Struct({\n session: ClientSessionSchema,\n sequence: PositiveCounter,\n invocation: ActionRequestSchema,\n optimistic: Schema.Boolean,\n stagedAttachments: Schema.optional(Schema.Array(Schema.NonEmptyString)),\n view: Schema.optional(ClientViewSchema),\n});\n\n// Reuse the storage value codec for bigint/Temporal/nested values rather than\n// letting JSON or structured clone silently change the domain representation.\nconst values = Table.make<unknown>({ name: \"ontology-protocol-value\" });\nexport const protocolValueCodec = <A>(schema: Schema.Codec<A>): Schema.Codec<A, string> =>\n Schema.String.pipe(\n Schema.decodeTo(Schema.Unknown, {\n decode: SchemaGetter.transformEffect((input: string) =>\n Effect.try({\n try: () => values.decode(input),\n catch: () =>\n new SchemaIssue.InvalidValue({ message: \"Invalid ontology protocol encoding.\" }),\n })\n ),\n encode: SchemaGetter.transformEffect((input: unknown) =>\n Effect.try({\n try: () => values.encode(input),\n catch: () =>\n new SchemaIssue.InvalidValue({ message: \"Unsupported ontology protocol value.\" }),\n })\n ),\n }),\n Schema.decodeTo(Schema.toType(schema))\n );\nexport const ClientStateCodec = protocolValueCodec(ClientStateSchema);\nexport const ClientSubmissionCodec = protocolValueCodec(ClientSubmissionSchema);\nexport const ClientViewCodec = protocolValueCodec(ClientViewSchema);\nexport const CompiledSubsetCodec = protocolValueCodec(CompiledSubsetSchema);\n\nexport const StateSelectionCodec = protocolValueCodec(StateSelectionSchema);\n\nexport const ObjectSubsetCodec = protocolValueCodec(ObjectSubsetSchema);\nexport const ObjectSelectionCodec = protocolValueCodec(ObjectSelectionSchema);\n"],"mappings":";;;;;;;;;;AAgJA,MAAa,iBAAiB,aAA2C;CACrE,MAAM,WAAW,GAAW,MAAe,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI;CACpE,MAAM,QAAW,WACb,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,GAAG,MA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pE,MAAa,wBAAwB,mBAAmB,sBAAsB;AAC9E,MAAa,kBAAkB,mBAAmB,gBAAgB;AAClE,MAAa,sBAAsB,mBAAmB,oBAAoB;AAE1E,MAAa,sBAAsB,mBAAmB,oBAAoB;AAE1E,MAAa,oBAAoB,mBAAmB,kBAAkB;AACtE,MAAa,uBAAuB,mBAAmB,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"protocol.js","names":[],"sources":["../src/protocol.ts"],"sourcesContent":["import { QuerySchema } from \"@party-stack/ontology-storage\";\nimport { Table } from \"@party-stack/ontology-storage/tables\";\nimport { Effect, Schema, SchemaGetter, SchemaIssue } from \"effect\";\nimport { ClientLeaseSchema, ClientSessionSchema } from \"./clients.js\";\nimport { ObjectSubsetSchema, ObjectSelectionSchema } from \"./subset.js\";\nimport { ActionReceiptSchema, BackendErrorKindSchema, ValidationIssueSchema } from \"./index.js\";\nimport type { ClientLease, ClientSession, ClientToken } from \"./clients.js\";\nimport type { ActionRequest, ActionReceipt, BackendError } from \"./index.js\";\nimport type { CompiledSubset } from \"./subset.js\";\nimport type { Row } from \"@party-stack/ontology-storage\";\nimport type { Override } from \"@party-stack/ontology-storage/overlay\";\nimport type { Scope, Stream } from \"effect\";\n\n/** Logical action state shared by owned sources, intermediate replicas and clients. */\nexport interface PendingAction {\n readonly invocation: ActionRequest;\n readonly requestIdentity: string;\n readonly createdAt: number;\n readonly sequence: number;\n readonly state: \"queued\" | \"sending\" | \"acknowledged\" | \"blocked\";\n readonly optimistic: boolean;\n readonly attempts: number;\n /** Total attempts at the last explicit retry; automatic retry budgets start here. */\n readonly retryFromAttempt?: number;\n readonly nextAttemptAt?: number;\n readonly failureMessage?: string;\n readonly failureIssues?: readonly import(\"./errors.js\").ValidationIssue[];\n readonly completedAt?: number;\n /** The upstream cannot safely deduplicate another attempt; caller acknowledgment is required. */\n readonly retryRequiresAcknowledgement?: boolean;\n readonly failureOutcome?: \"not-committed\" | \"unknown\";\n readonly failureRetryable?: boolean;\n readonly receipt?: ActionReceipt;\n readonly failure?: BackendError[\"kind\"];\n readonly submission?: { readonly clientId: string; readonly sequence: number };\n /** Whether the local prediction is reflected in visible state. `dropped` means it is\n * not reflected locally: its last replay failed (`predictionFailure` says why), or\n * the queue is stopped at a blocked action (this one or an earlier one).\n * `none` means it was never predicted here (confirmed visibility or a source prediction).\n * Absent on entries stored before this field existed; treat as `optimistic ? \"applied\" : \"none\"`. */\n readonly prediction?: \"applied\" | \"dropped\" | \"none\";\n readonly predictionFailure?: BackendError[\"kind\"];\n readonly predictionMessage?: string;\n}\n\n/** Consistent logical state. Selected views limit membership, while authorization\n * and property/action projection remain the server's responsibility.\n */\nexport interface ReplicaStateSnapshot {\n readonly sourceId: string;\n readonly revision: number;\n readonly definition: string;\n readonly view?: { readonly generation: number };\n readonly objects: readonly {\n readonly objectType: string;\n readonly base: readonly Row<Record<string, unknown>>[];\n readonly overrides: readonly Row<Override<Record<string, unknown>>>[];\n }[];\n readonly pending: readonly PendingAction[];\n readonly completed: readonly PendingAction[];\n}\n\n/** Membership is evaluated against the source's composed visible state. Action\n * inspection is privileged and must be authorized independently of row access.\n */\nexport interface StateSelection {\n readonly subsets: readonly CompiledSubset[];\n readonly actionIds: readonly string[];\n /** Include the pending queue. Outcomes are selected by actionIds, including\n * pending actions already observed by the child, not the parent's full history. */\n readonly inspectActions?: boolean;\n}\nexport interface ClientView {\n readonly generation: number;\n readonly selection: StateSelection;\n}\n\nexport interface ClientState {\n readonly coverage?: readonly {\n readonly subset: CompiledSubset;\n readonly complete: boolean;\n /** Previously confirmed resident coverage; it may need background refresh. */\n readonly cached?: boolean;\n }[];\n readonly state: ReplicaStateSnapshot;\n readonly client: ClientLease;\n}\nexport interface ClientSubmission {\n readonly session: ClientSession;\n readonly sequence: number;\n readonly invocation: ActionRequest;\n readonly optimistic: boolean;\n /** Newly staged child copies required before first acceptance; duplicates need no transfer. */\n readonly stagedAttachments?: readonly string[];\n readonly view?: ClientView;\n}\n\n/** A protocol source need not contain a Replica or an upstream outbox. Ordered\n * submission idempotency is scoped to a valid resumable client lease. A transport\n * must bind authorization and decode data before exposing this interface.\n */\nexport interface OntologySource {\n readonly sourceId: string;\n readonly outbox?: {\n readonly remove: (\n id: string,\n options?: { readonly allowUnknownOutcome?: boolean }\n ) => Effect.Effect<void, BackendError>;\n readonly retry: (\n id: string,\n options?: { readonly allowUnknownOutcome?: boolean }\n ) => Effect.Effect<void, BackendError>;\n readonly edit: (id: string, request: ActionRequest) => Effect.Effect<void, BackendError>;\n };\n readonly supportsIdempotency: boolean;\n readonly openClient: (resume?: ClientToken) => Effect.Effect<ClientLease, BackendError>;\n readonly read: (session: ClientSession, view?: ClientView) => Effect.Effect<ClientState, BackendError>;\n readonly subscribe?: (\n session: ClientSession,\n view: ClientView,\n policy?: import(\"./delivery.js\").DeliveryPolicy,\n resume?: import(\"./delivery.js\").DeliveryPosition\n ) => Effect.Effect<import(\"./delivery.js\").DeliverySubscription, BackendError, Scope.Scope>;\n readonly acknowledgeDelivery?: (\n position: import(\"./delivery.js\").DeliveryPosition\n ) => Effect.Effect<void, BackendError>;\n /** Change the view of this client's open state subscription in place. The source\n * acquires the added subsets before releasing removed ones and delivers the change\n * on the same stream. A source that cannot fails `ViewReplaced`, and the client\n * subscribes again with the new view. */\n readonly updateView?: (session: ClientSession, view: ClientView) => Effect.Effect<void, BackendError>;\n /** Acceptance only; selected delivery carries the resulting state. */\n readonly accept?: (request: ClientSubmission) => Effect.Effect<void, BackendError>;\n /** Snapshot-mode interest lease. The first element confirms acquisition;\n * failures/EOF remain observable, and closing the stream releases interest.\n * Replica supervision owns retries, not the transport.\n */\n readonly demand: (subset: CompiledSubset) => Stream.Stream<void, BackendError>;\n readonly subscribeChanges: Effect.Effect<Stream.Stream<void, BackendError>, BackendError, Scope.Scope>;\n readonly submit: (request: ClientSubmission) => Effect.Effect<ClientState, BackendError>;\n readonly acknowledge: (\n session: ClientSession,\n revision: number,\n through: number,\n viewGeneration?: number\n ) => Effect.Effect<void, BackendError>;\n}\n\n/** Row/action arrays represent keyed records, not their transport ordering. */\nexport const stateIdentity = (snapshot: ReplicaStateSnapshot): string => {\n const compare = (a: string, b: string) => (a < b ? -1 : a > b ? 1 : 0);\n const rows = <A>(values: readonly Row<A>[]) =>\n [...values].sort((a, b) => compare(JSON.stringify(a.key), JSON.stringify(b.key)));\n const actions = (values: readonly PendingAction[]) =>\n [...values].sort((a, b) => compare(a.invocation.id, b.invocation.id));\n return Table.make({ name: \"state-identity\" }).encode({\n ...snapshot,\n objects: [...snapshot.objects]\n .sort((a, b) => compare(a.objectType, b.objectType))\n .map((object) => ({\n ...object,\n base: rows(object.base),\n overrides: rows(object.overrides),\n })),\n pending: actions(snapshot.pending),\n completed: actions(snapshot.completed),\n });\n};\n\nconst Counter = Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER }));\nconst PositiveCounter = Counter.check(Schema.isGreaterThan(0));\nconst KeySchema = Schema.Union([Schema.String, Schema.Finite]);\nconst ValueSchema = Schema.Record(Schema.String, Schema.Unknown);\nexport const ActionRequestSchema = Schema.Struct({\n id: Schema.NonEmptyString,\n name: Schema.NonEmptyString,\n parameters: ValueSchema,\n replay: Schema.optional(Schema.Struct({ now: Schema.String, seed: Schema.NonEmptyString })),\n});\nexport const PendingActionSchema = Schema.Struct({\n invocation: ActionRequestSchema,\n requestIdentity: Schema.String,\n createdAt: Schema.Finite,\n sequence: PositiveCounter,\n state: Schema.Literals([\"queued\", \"sending\", \"acknowledged\", \"blocked\"]),\n optimistic: Schema.Boolean,\n attempts: Counter,\n retryFromAttempt: Schema.optional(Counter),\n nextAttemptAt: Schema.optional(Schema.Finite),\n failureMessage: Schema.optional(Schema.String),\n failureIssues: Schema.optional(Schema.Array(ValidationIssueSchema)),\n completedAt: Schema.optional(Schema.Finite),\n retryRequiresAcknowledgement: Schema.optional(Schema.Boolean),\n failureOutcome: Schema.optional(Schema.Literals([\"not-committed\", \"unknown\"])),\n failureRetryable: Schema.optional(Schema.Boolean),\n receipt: Schema.optional(ActionReceiptSchema),\n failure: Schema.optional(BackendErrorKindSchema),\n submission: Schema.optional(\n Schema.Struct({ clientId: Schema.NonEmptyString, sequence: PositiveCounter })\n ),\n prediction: Schema.optional(Schema.Literals([\"applied\", \"dropped\", \"none\"])),\n predictionFailure: Schema.optional(BackendErrorKindSchema),\n predictionMessage: Schema.optional(Schema.String),\n});\nexport const CompiledSubsetSchema = Schema.Struct({\n objectType: Schema.NonEmptyString,\n query: Schema.optional(QuerySchema),\n});\nexport const StateSelectionSchema = Schema.Struct({\n subsets: Schema.Array(CompiledSubsetSchema),\n actionIds: Schema.Array(Schema.NonEmptyString),\n inspectActions: Schema.optional(Schema.Boolean),\n});\nexport const ClientViewSchema = Schema.Struct({\n generation: PositiveCounter,\n selection: StateSelectionSchema,\n});\nexport const ReplicaStateSnapshotSchema = Schema.Struct({\n sourceId: Schema.NonEmptyString,\n revision: PositiveCounter,\n definition: Schema.NonEmptyString,\n view: Schema.optional(Schema.Struct({ generation: PositiveCounter })),\n objects: Schema.Array(\n Schema.Struct({\n objectType: Schema.NonEmptyString,\n base: Schema.Array(Schema.Struct({ key: KeySchema, value: ValueSchema })),\n overrides: Schema.Array(\n Schema.Struct({\n key: KeySchema,\n value: Schema.Union([\n Schema.Struct({ deleted: Schema.Literal(true) }),\n Schema.Struct({ deleted: Schema.Literal(false), value: ValueSchema }),\n ]),\n })\n ),\n })\n ),\n pending: Schema.Array(PendingActionSchema),\n completed: Schema.Array(PendingActionSchema),\n});\nconst ClientStateSchema = Schema.Struct({\n state: ReplicaStateSnapshotSchema,\n client: ClientLeaseSchema,\n coverage: Schema.optional(\n Schema.Array(\n Schema.Struct({\n subset: CompiledSubsetSchema,\n complete: Schema.Boolean,\n cached: Schema.optional(Schema.Boolean),\n })\n )\n ),\n});\nconst ClientSubmissionSchema = Schema.Struct({\n session: ClientSessionSchema,\n sequence: PositiveCounter,\n invocation: ActionRequestSchema,\n optimistic: Schema.Boolean,\n stagedAttachments: Schema.optional(Schema.Array(Schema.NonEmptyString)),\n view: Schema.optional(ClientViewSchema),\n});\n\n// Reuse the storage value codec for bigint/Temporal/nested values rather than\n// letting JSON or structured clone silently change the domain representation.\nconst values = Table.make<unknown>({ name: \"ontology-protocol-value\" });\nexport const protocolValueCodec = <A>(schema: Schema.Codec<A>): Schema.Codec<A, string> =>\n Schema.String.pipe(\n Schema.decodeTo(Schema.Unknown, {\n decode: SchemaGetter.transformEffect((input: string) =>\n Effect.try({\n try: () => values.decode(input),\n catch: () =>\n new SchemaIssue.InvalidValue({ message: \"Invalid ontology protocol encoding.\" }),\n })\n ),\n encode: SchemaGetter.transformEffect((input: unknown) =>\n Effect.try({\n try: () => values.encode(input),\n catch: () =>\n new SchemaIssue.InvalidValue({ message: \"Unsupported ontology protocol value.\" }),\n })\n ),\n }),\n Schema.decodeTo(Schema.toType(schema))\n );\nexport const ClientStateCodec = protocolValueCodec(ClientStateSchema);\nexport const ClientSubmissionCodec = protocolValueCodec(ClientSubmissionSchema);\nexport const ClientViewCodec = protocolValueCodec(ClientViewSchema);\nexport const CompiledSubsetCodec = protocolValueCodec(CompiledSubsetSchema);\n\nexport const StateSelectionCodec = protocolValueCodec(StateSelectionSchema);\n\nexport const ObjectSubsetCodec = protocolValueCodec(ObjectSubsetSchema);\nexport const ObjectSelectionCodec = protocolValueCodec(ObjectSelectionSchema);\n"],"mappings":";;;;;;;;;;AAqJA,MAAa,iBAAiB,aAA2C;CACrE,MAAM,WAAW,GAAW,MAAe,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI;CACpE,MAAM,QAAW,WACb,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,GAAG,MAAM,QAAQ,KAAK,UAAU,EAAE,GAAG,GAAG,KAAK,UAAU,EAAE,GAAG,CAAC,CAAC;CACpF,MAAM,WAAW,WACb,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,GAAG,MAAM,QAAQ,EAAE,WAAW,IAAI,EAAE,WAAW,EAAE,CAA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