@yielded/agent 0.1.0-beta.171 → 0.1.0-beta.172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Admin-BmALDmj8.d.mts → Admin-BX9ns28E.d.mts} +2 -2
- package/dist/{DurableAgentRuntime-CQGiSnCa.mjs → DurableAgentRuntime-BAmSkWYr.mjs} +10 -9
- package/dist/DurableAgentRuntime-BAmSkWYr.mjs.map +1 -0
- package/dist/{EventSource-CVXzC_8E.d.mts → EventSource-BwliwQz9.d.mts} +2 -2
- package/dist/{MessageDelivery-BGKWdjUu.d.mts → MessageDelivery-CeSDfHZa.d.mts} +4 -4
- package/dist/{PreparedInputAdmission-C1xt29pl.d.mts → PreparedInputAdmission-CxSJSiTl.d.mts} +3 -3
- package/dist/{RecordFormat-BphUsB6Q.d.mts → RecordFormat-BNiLpe43.d.mts} +9 -3
- package/dist/{RunContinuation-CNWMmymY.mjs → RunContinuation-DHYNAQFi.mjs} +2 -2
- package/dist/{RunContinuation-CNWMmymY.mjs.map → RunContinuation-DHYNAQFi.mjs.map} +1 -1
- package/dist/{RunContinuation-B7a2dK8k.d.mts → RunContinuation-FHM7XPjq.d.mts} +3 -3
- package/dist/{RunStorage-FFaYE4-2.mjs → RunStorage-uqPxps09.mjs} +2 -2
- package/dist/{RunStorage-FFaYE4-2.mjs.map → RunStorage-uqPxps09.mjs.map} +1 -1
- package/dist/{Subscription-CQqYNUqy.d.mts → Subscription-DONig54Q.d.mts} +2 -2
- package/dist/{SubscriptionInput-BibUlnWP.d.mts → SubscriptionInput-mJIRxWJM.d.mts} +2 -2
- package/dist/{ThreadImport-mLZiwu30.d.mts → ThreadImport-CoQTZywm.d.mts} +42 -42
- package/dist/{ThreadImport-BsOXD7qr.mjs → ThreadImport-DckUMEqJ.mjs} +4 -4
- package/dist/{ThreadImport-BsOXD7qr.mjs.map → ThreadImport-DckUMEqJ.mjs.map} +1 -1
- package/dist/{ThreadStore-B5sew3ir.mjs → ThreadStore-CEekRa80.mjs} +2 -2
- package/dist/ThreadStore-CEekRa80.mjs.map +1 -0
- package/dist/{ThreadTransfer-DeO03GBg.mjs → ThreadTransfer-B4gTQLIl.mjs} +3 -5
- package/dist/ThreadTransfer-B4gTQLIl.mjs.map +1 -0
- package/dist/{WorkerAdmission-C1TxLQPT.mjs → WorkerAdmission-DFVbbVh2.mjs} +2 -2
- package/dist/{WorkerAdmission-C1TxLQPT.mjs.map → WorkerAdmission-DFVbbVh2.mjs.map} +1 -1
- package/dist/durable/Admin.d.mts +1 -1
- package/dist/durable/AgentRegistration.d.mts +1 -1
- package/dist/durable/Certification.d.mts +1 -1
- package/dist/durable/CommittedActivity.d.mts +1 -1
- package/dist/durable/CommittedActivity.mjs +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.mjs +2 -2
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
- package/dist/durable/LifecyclePublication.d.mts +1 -1
- package/dist/durable/LifecyclePublication.mjs +1 -1
- package/dist/durable/MessageDelivery.d.mts +1 -1
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +2 -2
- package/dist/durable/PersistentHistory.d.mts +1 -1
- package/dist/durable/PersistentHistory.mjs +2 -2
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/RecordFormat.d.mts +2 -2
- package/dist/durable/RecordFormat.mjs +14 -2
- package/dist/durable/RecordFormat.mjs.map +1 -1
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/RunContinuation.d.mts +2 -2
- package/dist/durable/RunContinuation.mjs +2 -2
- package/dist/durable/RunJournal.d.mts +1 -1
- package/dist/durable/RunStorage.d.mts +1 -1
- package/dist/durable/RunStorage.mjs +1 -1
- package/dist/durable/Scheduling.d.mts +1 -1
- package/dist/durable/SettlementPublisher.d.mts +1 -1
- package/dist/durable/SettlementPublisher.mjs +1 -1
- package/dist/durable/SubmissionLedger.d.mts +1 -1
- package/dist/durable/SubmissionLedgerConformance.d.mts +1 -1
- package/dist/durable/SubmissionLedgerConformance.mjs +2 -2
- package/dist/durable/SubmissionStatus.d.mts +1 -1
- package/dist/durable/Subscription.d.mts +1 -1
- package/dist/durable/SubscriptionInput.d.mts +1 -1
- package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
- package/dist/durable/SubscriptionTools.d.mts +2 -2
- package/dist/durable/SubscriptionTransition.d.mts +1 -1
- package/dist/durable/Subscriptions.d.mts +5 -5
- package/dist/durable/ThreadArchiveRange.d.mts +1 -1
- package/dist/durable/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadContextHistory.mjs +1 -1
- package/dist/durable/ThreadImport.d.mts +1 -1
- package/dist/durable/ThreadImport.mjs +1 -1
- package/dist/durable/ThreadInvariants.d.mts +3 -3
- package/dist/durable/ThreadInvariants.mjs +3 -3
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadReader.d.mts +1 -1
- package/dist/durable/ThreadReader.mjs +1 -1
- package/dist/durable/ThreadStore.d.mts +1 -1
- package/dist/durable/ThreadStore.mjs +1 -1
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/ThreadStoreConformance.mjs +2 -2
- package/dist/durable/ThreadTransfer.d.mts +1 -1
- package/dist/durable/ThreadTransfer.mjs +1 -1
- package/dist/durable/ThreadWork.d.mts +1 -1
- package/dist/durable/ThreadWork.mjs +2 -2
- package/dist/durable/WorkerAdmission.d.mts +1 -1
- package/dist/durable/WorkerAdmission.mjs +1 -1
- package/dist/durable/WorkerHost.d.mts +1 -1
- package/dist/index.d.mts +9 -9
- package/dist/index.mjs +6 -6
- package/dist/{run-context-reader-BrbZ8tb7.d.mts → run-context-reader-OcsZr4bk.d.mts} +2 -2
- package/package.json +1 -1
- package/src/durable/DurableAgentRuntime.ts +4 -1
- package/src/durable/RecordFormat.ts +18 -0
- package/src/durable/ThreadStore.ts +1 -1
- package/src/durable/ThreadTransfer.ts +1 -8
- package/src/durable/internal/agent-updates.ts +10 -2
- package/dist/DurableAgentRuntime-CQGiSnCa.mjs.map +0 -1
- package/dist/ThreadStore-B5sew3ir.mjs.map +0 -1
- package/dist/ThreadTransfer-DeO03GBg.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreadTransfer-B4gTQLIl.mjs","names":[],"sources":["../src/durable/internal/thread-transfer-source.ts","../src/durable/ThreadTransfer.ts"],"sourcesContent":["import { Context } from \"effect\";\n\n/** Installed before opening the source pull, so producer fibers observe the same phase. */\nexport const ImportSourcePhase = Context.Reference<{ writing: boolean } | undefined>(\n \"@effect-agent/thread/internal/ImportSourcePhase\",\n { defaultValue: () => undefined },\n);\n","import { Context, Effect, Schema } from \"effect\";\n\nimport type { ThreadId } from \"../core/Identifiers.ts\";\nimport { canonicalJson, utf8ByteLength } from \"./Digest.ts\";\nimport { ImportSourcePhase } from \"./internal/thread-transfer-source.ts\";\nimport { transferRecordDependencies } from \"./internal/transfer-dependencies.ts\";\nimport {\n type RecordId,\n CURRENT_RECORD_FORMAT,\n CanonicalSequence,\n type CanonicalRecordEnvelope,\n} from \"./Records.ts\";\nimport {\n MAX_THREAD_EXPORT_PAGE_BYTES,\n ThreadExport,\n ThreadExportRequest,\n ThreadExportSnapshot,\n ThreadExportRejected,\n type ThreadNotMaterialized,\n ThreadStoreError,\n} from \"./ThreadStore.ts\";\n\nexport const transferSections = [\n \"admissions\",\n \"aborts\",\n \"approvals\",\n \"resolutions\",\n \"deliveries\",\n] as const;\n\nexport type TransferSection = (typeof transferSections)[number];\n\nexport type TransferFacts = Pick<ThreadExport, \"admissions\" | \"commands\" | \"deliveries\">;\n\nexport type TransferManifest = Pick<\n ThreadExport,\n \"threadId\" | \"format\" | \"tailSequence\" | \"snapshot\" | \"workerSeal\"\n>;\n\n/** Reads share the adapter's single page transaction. Batch reads hydrate archives. */\nexport class ThreadExporterReader extends Context.Service<\n ThreadExporterReader,\n {\n readonly snapshot: (\n threadId: ThreadId,\n captured?: TransferManifest,\n ) => Effect.Effect<\n TransferManifest,\n ThreadStoreError | ThreadNotMaterialized | ThreadExportRejected\n >;\n readonly batch: (\n threadId: ThreadId,\n fromSequence: number,\n ) => Effect.Effect<\n Pick<ThreadExport, \"records\" | \"batches\">,\n ThreadStoreError | ThreadNotMaterialized\n >;\n /** A keyset read of at most 256 facts. Keys stay bounded independently of fact identities. */\n readonly facts: (\n threadId: ThreadId,\n section: TransferSection,\n after: string | undefined,\n ) => Effect.Effect<\n {\n readonly facts: TransferFacts;\n readonly after: string;\n },\n ThreadStoreError\n >;\n }\n>()(\"@effect-agent/thread/ThreadExporterReader\") {}\n\nexport const TransferManifest = Schema.Struct({\n threadId: ThreadExport.fields.threadId,\n format: ThreadExport.fields.format,\n tailSequence: ThreadExport.fields.tailSequence,\n snapshot: ThreadExportSnapshot,\n workerSeal: ThreadExport.fields.workerSeal,\n});\n\nconst Position = Schema.Struct({\n manifest: TransferManifest,\n fromSequence: Schema.Int.check(Schema.isGreaterThan(0)),\n section: Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: transferSections.length })),\n consumed: Schema.Natural,\n after: Schema.optionalKey(Schema.String),\n});\n\nconst failure = (message: string, cause?: unknown) =>\n ThreadStoreError.make({\n operation: \"Thread transfer\",\n message,\n ...(cause === undefined ? {} : { cause }),\n });\n\nconst nextSection = (position: typeof Position.Type) => {\n const { after: _, ...retained } = position;\n\n return { ...retained, section: position.section + 1, consumed: 0 };\n};\n\n/** Exact manifest equality replaces a redundant stored snapshot fingerprint. */\nexport const sameTransferManifest = Schema.toEquivalence(TransferManifest);\n\n/** Must run BEFORE a source gate, transaction or routed RPC is acquired. */\nexport const checkExportSource = (threadId: ThreadId) =>\n Effect.flatMap(ImportSourcePhase, (phase) =>\n phase?.writing\n ? Effect.fail(ThreadExportRejected.make({ threadId, reason: \"live-import-source\" }))\n : Effect.void,\n );\n\n/** Exact evidence references outside this canonical page. */\nexport const transferDependencies = (\n records: ReadonlyArray<CanonicalRecordEnvelope>,\n): ReadonlyArray<RecordId> =>\n [...new Set(transferRecordDependencies(records.map((entry) => entry.record)))].sort();\n\nconst factCount = (facts: TransferFacts, section: TransferSection): number =>\n section === \"admissions\"\n ? facts.admissions.length\n : section === \"deliveries\"\n ? facts.deliveries.length\n : facts.commands[section].length;\n\nexport const checkTransferPageBytes = (page: ThreadExport) =>\n Schema.encodeEffect(ThreadExport)(page).pipe(\n Effect.mapError(() => failure(\"Transfer page does not encode its canonical wire\")),\n Effect.flatMap((wire) =>\n utf8ByteLength(canonicalJson(wire)) <= MAX_THREAD_EXPORT_PAGE_BYTES\n ? Effect.void\n : Effect.fail(failure(\"Transfer page exceeds 32 MiB\")),\n ),\n );\n\n/** Stateless pages require application quiescence; no transfer counter is maintained on writes. */\nexport const exportThreadPage = Effect.fnUntraced(function* (input: ThreadExportRequest) {\n const reader = yield* ThreadExporterReader;\n\n const request = yield* Schema.decodeEffect(ThreadExportRequest)(input).pipe(\n Effect.mapError(() => failure(\"Invalid export request\")),\n );\n\n const captured =\n request.cursor === undefined\n ? undefined\n : yield* Schema.decodeEffect(Schema.fromJsonString(Position))(request.cursor).pipe(\n Effect.mapError((cause) => failure(\"Invalid transfer cursor\", cause)),\n );\n\n const manifest = yield* reader.snapshot(request.threadId, captured?.manifest);\n let position = captured ?? { manifest, fromSequence: 1, section: 0, consumed: 0 };\n\n if (!sameTransferManifest(position.manifest, manifest) || manifest.threadId !== request.threadId)\n return yield* ThreadExportRejected.make({\n threadId: request.threadId,\n reason: \"source-changed\",\n });\n if (\n manifest.format !== CURRENT_RECORD_FORMAT ||\n position.fromSequence > manifest.tailSequence + 1\n )\n return yield* failure(\"Unsupported format or invalid canonical transfer position\");\n let canonical: Pick<ThreadExport, \"records\" | \"batches\"> = { records: [], batches: [] };\n\n let facts: TransferFacts = {\n admissions: [],\n commands: { aborts: [], approvals: [], resolutions: [] },\n deliveries: [],\n };\n\n const fromSequence = position.fromSequence;\n\n if (fromSequence <= manifest.tailSequence) {\n canonical = yield* reader.batch(request.threadId, fromSequence);\n if (\n canonical.batches.length !== 1 ||\n canonical.records.length === 0 ||\n canonical.records.length > 256\n )\n return yield* failure(\"A transfer page must contain a complete bounded canonical batch\");\n const batch = canonical.batches[0]!;\n\n for (const [index, entry] of canonical.records.entries())\n if (\n entry.threadId !== request.threadId ||\n entry.sequence !== fromSequence + index ||\n entry.batchId !== batch.batchId\n )\n return yield* failure(\"Canonical batch identity or sequence mismatch\");\n\n position = {\n ...position,\n fromSequence: fromSequence + canonical.records.length,\n };\n } else {\n while (position.section < transferSections.length) {\n const section = transferSections[position.section]!;\n\n if (position.consumed > manifest.snapshot[section])\n return yield* failure(\"Transfer fact cursor exceeds its captured count\");\n if (position.consumed === manifest.snapshot[section]) {\n const probe = yield* reader.facts(request.threadId, section, position.after);\n\n const remaining = factCount(probe.facts, section);\n\n if (remaining !== 0) return yield* failure(\"Native transfer count omits retained facts\");\n position = nextSection(position);\n continue;\n }\n const page = yield* reader.facts(request.threadId, section, position.after);\n\n facts = page.facts;\n\n const count = factCount(facts, section);\n\n if (\n count === 0 ||\n count > 256 ||\n page.after === position.after ||\n position.consumed + count > manifest.snapshot[section]\n )\n return yield* failure(\"Transfer fact page is missing or exceeds its captured count\");\n position = { ...position, consumed: position.consumed + count, after: page.after };\n break;\n }\n }\n while (\n position.section < transferSections.length &&\n position.consumed === manifest.snapshot[transferSections[position.section]!]\n ) {\n const section = transferSections[position.section]!;\n const probe = yield* reader.facts(request.threadId, section, position.after);\n\n const count = factCount(probe.facts, section);\n\n if (count !== 0) return yield* failure(\"Native transfer count omits retained facts\");\n position = nextSection(position);\n }\n\n const more =\n position.fromSequence <= manifest.tailSequence || position.section < transferSections.length;\n\n const cursor = more\n ? yield* Schema.encodeEffect(Schema.fromJsonString(Position))(position).pipe(\n Effect.mapError((cause) => failure(\"Cannot encode transfer cursor\", cause)),\n )\n : undefined;\n\n const page = yield* ThreadExport.makeEffect({\n ...manifest,\n transferFormat: \"effect-agent/thread-transfer@4\",\n fromSequence: Schema.decodeSync(CanonicalSequence)(fromSequence),\n ...canonical,\n ...facts,\n dependencies: transferDependencies(canonical.records),\n ...(cursor === undefined ? {} : { cursor }),\n }).pipe(Effect.mapError(() => failure(\"Transfer page exceeds its schema bounds\")));\n\n yield* checkTransferPageBytes(page);\n\n return page;\n});\n"],"mappings":";;;;;;;;AAGA,MAAa,oBAAoB,QAAQ,UACvC,mDACA,EAAE,oBAAoB,KAAA,EAAU,CAClC;;;;;;;;;;;;;ACgBA,MAAa,mBAAmB;CAC9B;CACA;CACA;CACA;CACA;AACF;;AAYA,IAAa,uBAAb,cAA0C,QAAQ,QA8BhD,CAAC,CAAC,2CAA2C,CAAC,CAAC,CAAC;AAElD,MAAa,mBAAmB,OAAO,OAAO;CAC5C,UAAU,aAAa,OAAO;CAC9B,QAAQ,aAAa,OAAO;CAC5B,cAAc,aAAa,OAAO;CAClC,UAAU;CACV,YAAY,aAAa,OAAO;AAClC,CAAC;AAED,MAAM,WAAW,OAAO,OAAO;CAC7B,UAAU;CACV,cAAc,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;CACtD,SAAS,OAAO,IAAI,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS,iBAAiB;CAAO,CAAC,CAAC;CAC5F,UAAU,OAAO;CACjB,OAAO,OAAO,YAAY,OAAO,MAAM;AACzC,CAAC;AAED,MAAM,WAAW,SAAiB,UAChC,iBAAiB,KAAK;CACpB,WAAW;CACX;CACA,GAAI,UAAU,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM;AACzC,CAAC;AAEH,MAAM,eAAe,aAAmC;CACtD,MAAM,EAAE,OAAO,GAAG,GAAG,aAAa;CAElC,OAAO;EAAE,GAAG;EAAU,SAAS,SAAS,UAAU;EAAG,UAAU;CAAE;AACnE;;AAGA,MAAa,uBAAuB,OAAO,cAAc,gBAAgB;;AAGzE,MAAa,qBAAqB,aACh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ionConflict, AdmissionPolicyError, AdmissionRequest, LedgerError, MarkReadyRequest, SubmissionLedger } from "./durable/SubmissionLedger.mjs";
|
|
5
5
|
import { o as definitionDigestsEqual } from "./agent-registration-ByMZ_cK5.mjs";
|
|
6
6
|
import { Y as workerOriginRecordId } from "./RunJournal-kfKVxJj7.mjs";
|
|
7
|
-
import { $ as ThreadTailRequest, F as ThreadIdentityRequest, I as ThreadMaterialization, J as ThreadStore, L as ThreadNotMaterialized, X as ThreadStoreError, n as AppendRequest, t as AppendConflict } from "./ThreadStore-
|
|
7
|
+
import { $ as ThreadTailRequest, F as ThreadIdentityRequest, I as ThreadMaterialization, J as ThreadStore, L as ThreadNotMaterialized, X as ThreadStoreError, n as AppendRequest, t as AppendConflict } from "./ThreadStore-CEekRa80.mjs";
|
|
8
8
|
import { DurableRuntimeFailpoint, DurableRuntimeFailpointError } from "./durable/DurableFailpoint.mjs";
|
|
9
9
|
import { WakeScheduler } from "./durable/WakeScheduler.mjs";
|
|
10
10
|
import { Context, DateTime, Effect, Schema } from "effect";
|
|
@@ -158,4 +158,4 @@ const WorkerAdmissionPort = Context.Reference("@effect-agent/thread/WorkerAdmiss
|
|
|
158
158
|
//#endregion
|
|
159
159
|
export { admitWorker as a, threadCreatedBatchId as c, WorkerAdmission_exports as i, threadCreatedRecordId as l, WorkerAdmissionPort as n, ensureThreadCreated as o, WorkerAdmissionRequest as r, ensureWorkerOrigin as s, WorkerAdmissionFailure as t };
|
|
160
160
|
|
|
161
|
-
//# sourceMappingURL=WorkerAdmission-
|
|
161
|
+
//# sourceMappingURL=WorkerAdmission-DFVbbVh2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkerAdmission-C1TxLQPT.mjs","names":[],"sources":["../src/durable/internal/thread-initialization.ts","../src/durable/WorkerAdmission.ts"],"sourcesContent":["import { DateTime, Effect, Schema } from \"effect\";\n\nimport type { AgentId, ThreadId } from \"../../core/Identifiers.ts\";\nimport { WorkerError } from \"../../core/Worker.ts\";\nimport { DurableRuntimeFailpoint } from \"../DurableFailpoint.ts\";\nimport {\n BatchId,\n CanonicalBatch,\n RecordEnvelope,\n RecordId,\n ThreadCreated,\n WorkerOrigin,\n WorkerOriginRecorded,\n type DefinitionDigests,\n type DeploymentId,\n type ProducerId,\n} from \"../Records.ts\";\nimport { workerOriginRecordId } from \"../RunJournal.ts\";\nimport type { OwnershipLost } from \"../SubmissionLedger.ts\";\nimport type { AppendConflict, ThreadNotMaterialized, ThreadStoreError } from \"../ThreadStore.ts\";\nimport {\n AppendRequest,\n ThreadIdentityRequest,\n ThreadTailRequest,\n ThreadStore,\n} from \"../ThreadStore.ts\";\nimport { WakeScheduler } from \"../WakeScheduler.ts\";\nimport { definitionDigestsEqual } from \"./agent-registration.ts\";\n\ninterface InitializationConfig {\n readonly producerId: ProducerId;\n readonly deploymentId: DeploymentId;\n}\n\n/** Stable identities retained across admission retries and recovery. */\nexport const threadCreatedBatchId = (threadId: ThreadId): BatchId =>\n Schema.decodeSync(BatchId)(`thread-created:${threadId}`);\n\nexport const threadCreatedRecordId = (threadId: ThreadId): RecordId =>\n Schema.decodeSync(RecordId)(`thread-created:${threadId}`);\n\n/**\n * Coordinator invariant: every Thread's first canonical record is `ThreadCreated`,\n * so `tailSequence >= 1` is the deterministic already-created check. Concurrent admissions\n * re-read this invariant after a tail conflict before considering initialization complete.\n */\nexport const ensureThreadCreated = Effect.fnUntraced(\n function* (\n config: InitializationConfig,\n threadId: ThreadId,\n agentId: AgentId,\n definitions: DefinitionDigests,\n ): Effect.fn.Return<\n void,\n ThreadStoreError | ThreadNotMaterialized | AppendConflict | OwnershipLost,\n ThreadStore | WakeScheduler\n > {\n const store = yield* ThreadStore;\n const wake = yield* WakeScheduler;\n const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId }));\n\n if (tail.tailSequence > 0) return;\n\n const record = yield* Effect.map(DateTime.now, (createdAt) =>\n RecordEnvelope.make({\n recordId: threadCreatedRecordId(threadId),\n family: \"thread\",\n schemaVersion: 1,\n createdAt,\n deploymentId: config.deploymentId,\n payload: ThreadCreated.make({ agentId, definitions }),\n }),\n );\n\n yield* store\n .append(\n AppendRequest.make({\n threadId,\n batch: CanonicalBatch.make({\n batchId: threadCreatedBatchId(threadId),\n producerId: config.producerId,\n records: [record],\n }),\n expectedTailSequence: tail.tailSequence,\n }),\n )\n .pipe(\n Effect.catchTag(\"AppendConflict\", (error) =>\n store\n .inspectTail(ThreadTailRequest.make({ threadId }))\n .pipe(\n Effect.flatMap((current) =>\n current.tailSequence > 0 ? Effect.void : Effect.fail(error),\n ),\n ),\n ),\n Effect.andThen(wake.notify(threadId)),\n Effect.asVoid,\n );\n },\n (effect) =>\n effect.pipe(\n Effect.retry({\n times: 7,\n while: (error) => error._tag === \"AppendConflict\",\n }),\n ),\n);\n\nconst sameOrigin = Schema.toEquivalence(WorkerOrigin);\n\nexport const ensureWorkerOrigin = Effect.fnUntraced(\n function* (config: InitializationConfig, origin: WorkerOrigin) {\n const store = yield* ThreadStore;\n const failpoint = yield* DurableRuntimeFailpoint;\n\n for (let attempt = 0; attempt < 16; attempt++) {\n const current = yield* store.readIdentity(\n ThreadIdentityRequest.make({ threadId: origin.worker.threadId }),\n );\n\n const existing = current.records.find(\n ({ record }) => record.payload._tag === \"WorkerOriginRecorded\",\n )?.record.payload;\n\n if (existing?._tag === \"WorkerOriginRecorded\") {\n if (!sameOrigin(existing.origin, origin))\n return yield* WorkerError.make({ operation: \"start\", reason: \"worker-mismatch\" });\n\n return;\n }\n const first = current.records[0]?.record.payload;\n\n if (\n first?._tag !== \"ThreadCreated\" ||\n first.agentId !== origin.worker.targetAgentId ||\n !definitionDigestsEqual(first.definitions, origin.targetDigests) ||\n current.records.some(({ record }) => record.payload._tag === \"SubagentLineageRecorded\")\n )\n return yield* WorkerError.make({ operation: \"start\", reason: \"worker-mismatch\" });\n const id = workerOriginRecordId(origin.worker.threadId);\n\n yield* failpoint.hit(\"worker:before-origin-append\");\n\n const appended = yield* store\n .append(\n AppendRequest.make({\n threadId: origin.worker.threadId,\n expectedTailSequence: current.tailSequence,\n\n batch: CanonicalBatch.make({\n batchId: Schema.decodeSync(BatchId)(id),\n producerId: config.producerId,\n records: [\n RecordEnvelope.make({\n recordId: id,\n family: \"thread\",\n schemaVersion: 1,\n createdAt: DateTime.makeUnsafe(origin.createdAtMillis),\n deploymentId: config.deploymentId,\n payload: WorkerOriginRecorded.make({ origin }),\n }),\n ],\n }),\n }),\n )\n .pipe(\n Effect.as(true),\n Effect.catchTag(\"AppendConflict\", () => Effect.succeed(false)),\n );\n\n if (appended) {\n yield* failpoint.hit(\"worker:after-origin-append\");\n\n return;\n }\n }\n\n return yield* WorkerError.make({ operation: \"start\", reason: \"storage\" });\n },\n Effect.mapError((cause) =>\n cause._tag === \"WorkerError\"\n ? cause\n : WorkerError.make({ operation: \"start\", reason: \"storage\", cause }),\n ),\n);\n","import { Context, Effect, Schema } from \"effect\";\n\nimport { DurableRuntimeFailpoint, DurableRuntimeFailpointError } from \"./DurableFailpoint.ts\";\nimport { ensureThreadCreated, ensureWorkerOrigin } from \"./internal/thread-initialization.ts\";\nimport { ProducerId, WorkerAdmission } from \"./Records.ts\";\nimport {\n AdmissionConflict,\n AdmissionPolicyError,\n AdmissionRequest,\n LedgerError,\n MarkReadyRequest,\n SubmissionLedger,\n} from \"./SubmissionLedger.ts\";\nimport {\n AppendConflict,\n ThreadMaterialization,\n ThreadNotMaterialized,\n ThreadStore,\n ThreadStoreError,\n} from \"./ThreadStore.ts\";\nimport { WakeScheduler } from \"./WakeScheduler.ts\";\n\n/**\n * Storage admission after source authorization, input validation and capacity reservation.\n * This is an internal host port, not an authorization entrypoint. Hosts route the whole\n * operation to the destination owner and enroll recovery before executing it.\n */\nexport class WorkerAdmissionRequest extends Schema.Class<WorkerAdmissionRequest>(\n \"@effect-agent/thread/WorkerAdmissionRequest\",\n)({\n ...AdmissionRequest.fields,\n workerAdmission: WorkerAdmission,\n producerId: ProducerId,\n}) {}\n\nexport const WorkerAdmissionFailure = Schema.Union([\n AdmissionConflict,\n AdmissionPolicyError,\n LedgerError,\n ThreadStoreError,\n ThreadNotMaterialized,\n AppendConflict,\n DurableRuntimeFailpointError,\n]);\n\n/** Local implementation shared by every host; retries finish the same admitted row. */\nexport const admitWorker = Effect.fnUntraced(function* (request: WorkerAdmissionRequest) {\n const origin = request.workerAdmission.origin;\n\n if (\n origin.worker.threadId !== request.threadId ||\n origin.worker.targetAgentId !== request.agentId ||\n request.parentLinkage !== undefined\n )\n return yield* LedgerError.make({\n operation: \"admit worker\",\n message: \"Worker admission does not belong to the destination Thread\",\n });\n\n const ledger = yield* SubmissionLedger;\n const store = yield* ThreadStore;\n const wake = yield* WakeScheduler;\n const failpoint = yield* DurableRuntimeFailpoint;\n const admitted = yield* ledger.admit(AdmissionRequest.make(request));\n\n yield* failpoint.hit(\"submit:after-admit\");\n if (admitted.replayed && admitted.state !== \"admitted\") return admitted;\n\n yield* store.materialize(\n ThreadMaterialization.make({\n threadId: request.threadId,\n }),\n );\n\n const config = {\n producerId: request.producerId,\n deploymentId: request.deploymentId,\n };\n\n yield* ensureThreadCreated(config, request.threadId, request.agentId, request.agentDigests);\n yield* ensureWorkerOrigin(config, origin).pipe(\n Effect.mapError((cause) =>\n LedgerError.make({ operation: \"worker-origin\", message: cause.reason, cause }),\n ),\n );\n yield* failpoint.hit(\"submit:after-materialize\");\n yield* ledger.markReady(MarkReadyRequest.make({ submissionId: admitted.submissionId }));\n yield* wake.notify(request.threadId);\n\n return admitted;\n});\n\n/** Placement adapter for the composite operation; local hosts use the same implementation. */\nexport const WorkerAdmissionPort = Context.Reference<{ readonly admit: typeof admitWorker }>(\n \"@effect-agent/thread/WorkerAdmissionPort\",\n { defaultValue: () => ({ admit: admitWorker }) },\n);\n"],"mappings":";;;;;;;;;;;;AAmCA,MAAa,wBAAwB,aACnC,OAAO,WAAW,OAAO,CAAC,CAAC,kBAAkB,UAAU;AAEzD,MAAa,yBAAyB,aACpC,OAAO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,OAAO,UAAU,IAAI,0BAA0B;CAC/C,OAAO,OAAO,UAAU,iBAAiB,KAAK,EAAE,cAAc,SAAS,aAAa,CAAC,CAAC;CACtF,OAAO,KAAK,OAAO,QAAQ,QAAQ;CAEnC,OAAO;AACT,CAAC;;AAGD,MAAa,sBAAsB,QAAQ,UACzC,4CACA,EAAE,qBAAqB,EAAE,OAAO,YAAY,GAAG,CACjD"}
|
|
1
|
+
{"version":3,"file":"WorkerAdmission-DFVbbVh2.mjs","names":[],"sources":["../src/durable/internal/thread-initialization.ts","../src/durable/WorkerAdmission.ts"],"sourcesContent":["import { DateTime, Effect, Schema } from \"effect\";\n\nimport type { AgentId, ThreadId } from \"../../core/Identifiers.ts\";\nimport { WorkerError } from \"../../core/Worker.ts\";\nimport { DurableRuntimeFailpoint } from \"../DurableFailpoint.ts\";\nimport {\n BatchId,\n CanonicalBatch,\n RecordEnvelope,\n RecordId,\n ThreadCreated,\n WorkerOrigin,\n WorkerOriginRecorded,\n type DefinitionDigests,\n type DeploymentId,\n type ProducerId,\n} from \"../Records.ts\";\nimport { workerOriginRecordId } from \"../RunJournal.ts\";\nimport type { OwnershipLost } from \"../SubmissionLedger.ts\";\nimport type { AppendConflict, ThreadNotMaterialized, ThreadStoreError } from \"../ThreadStore.ts\";\nimport {\n AppendRequest,\n ThreadIdentityRequest,\n ThreadTailRequest,\n ThreadStore,\n} from \"../ThreadStore.ts\";\nimport { WakeScheduler } from \"../WakeScheduler.ts\";\nimport { definitionDigestsEqual } from \"./agent-registration.ts\";\n\ninterface InitializationConfig {\n readonly producerId: ProducerId;\n readonly deploymentId: DeploymentId;\n}\n\n/** Stable identities retained across admission retries and recovery. */\nexport const threadCreatedBatchId = (threadId: ThreadId): BatchId =>\n Schema.decodeSync(BatchId)(`thread-created:${threadId}`);\n\nexport const threadCreatedRecordId = (threadId: ThreadId): RecordId =>\n Schema.decodeSync(RecordId)(`thread-created:${threadId}`);\n\n/**\n * Coordinator invariant: every Thread's first canonical record is `ThreadCreated`,\n * so `tailSequence >= 1` is the deterministic already-created check. Concurrent admissions\n * re-read this invariant after a tail conflict before considering initialization complete.\n */\nexport const ensureThreadCreated = Effect.fnUntraced(\n function* (\n config: InitializationConfig,\n threadId: ThreadId,\n agentId: AgentId,\n definitions: DefinitionDigests,\n ): Effect.fn.Return<\n void,\n ThreadStoreError | ThreadNotMaterialized | AppendConflict | OwnershipLost,\n ThreadStore | WakeScheduler\n > {\n const store = yield* ThreadStore;\n const wake = yield* WakeScheduler;\n const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId }));\n\n if (tail.tailSequence > 0) return;\n\n const record = yield* Effect.map(DateTime.now, (createdAt) =>\n RecordEnvelope.make({\n recordId: threadCreatedRecordId(threadId),\n family: \"thread\",\n schemaVersion: 1,\n createdAt,\n deploymentId: config.deploymentId,\n payload: ThreadCreated.make({ agentId, definitions }),\n }),\n );\n\n yield* store\n .append(\n AppendRequest.make({\n threadId,\n batch: CanonicalBatch.make({\n batchId: threadCreatedBatchId(threadId),\n producerId: config.producerId,\n records: [record],\n }),\n expectedTailSequence: tail.tailSequence,\n }),\n )\n .pipe(\n Effect.catchTag(\"AppendConflict\", (error) =>\n store\n .inspectTail(ThreadTailRequest.make({ threadId }))\n .pipe(\n Effect.flatMap((current) =>\n current.tailSequence > 0 ? Effect.void : Effect.fail(error),\n ),\n ),\n ),\n Effect.andThen(wake.notify(threadId)),\n Effect.asVoid,\n );\n },\n (effect) =>\n effect.pipe(\n Effect.retry({\n times: 7,\n while: (error) => error._tag === \"AppendConflict\",\n }),\n ),\n);\n\nconst sameOrigin = Schema.toEquivalence(WorkerOrigin);\n\nexport const ensureWorkerOrigin = Effect.fnUntraced(\n function* (config: InitializationConfig, origin: WorkerOrigin) {\n const store = yield* ThreadStore;\n const failpoint = yield* DurableRuntimeFailpoint;\n\n for (let attempt = 0; attempt < 16; attempt++) {\n const current = yield* store.readIdentity(\n ThreadIdentityRequest.make({ threadId: origin.worker.threadId }),\n );\n\n const existing = current.records.find(\n ({ record }) => record.payload._tag === \"WorkerOriginRecorded\",\n )?.record.payload;\n\n if (existing?._tag === \"WorkerOriginRecorded\") {\n if (!sameOrigin(existing.origin, origin))\n return yield* WorkerError.make({ operation: \"start\", reason: \"worker-mismatch\" });\n\n return;\n }\n const first = current.records[0]?.record.payload;\n\n if (\n first?._tag !== \"ThreadCreated\" ||\n first.agentId !== origin.worker.targetAgentId ||\n !definitionDigestsEqual(first.definitions, origin.targetDigests) ||\n current.records.some(({ record }) => record.payload._tag === \"SubagentLineageRecorded\")\n )\n return yield* WorkerError.make({ operation: \"start\", reason: \"worker-mismatch\" });\n const id = workerOriginRecordId(origin.worker.threadId);\n\n yield* failpoint.hit(\"worker:before-origin-append\");\n\n const appended = yield* store\n .append(\n AppendRequest.make({\n threadId: origin.worker.threadId,\n expectedTailSequence: current.tailSequence,\n\n batch: CanonicalBatch.make({\n batchId: Schema.decodeSync(BatchId)(id),\n producerId: config.producerId,\n records: [\n RecordEnvelope.make({\n recordId: id,\n family: \"thread\",\n schemaVersion: 1,\n createdAt: DateTime.makeUnsafe(origin.createdAtMillis),\n deploymentId: config.deploymentId,\n payload: WorkerOriginRecorded.make({ origin }),\n }),\n ],\n }),\n }),\n )\n .pipe(\n Effect.as(true),\n Effect.catchTag(\"AppendConflict\", () => Effect.succeed(false)),\n );\n\n if (appended) {\n yield* failpoint.hit(\"worker:after-origin-append\");\n\n return;\n }\n }\n\n return yield* WorkerError.make({ operation: \"start\", reason: \"storage\" });\n },\n Effect.mapError((cause) =>\n cause._tag === \"WorkerError\"\n ? cause\n : WorkerError.make({ operation: \"start\", reason: \"storage\", cause }),\n ),\n);\n","import { Context, Effect, Schema } from \"effect\";\n\nimport { DurableRuntimeFailpoint, DurableRuntimeFailpointError } from \"./DurableFailpoint.ts\";\nimport { ensureThreadCreated, ensureWorkerOrigin } from \"./internal/thread-initialization.ts\";\nimport { ProducerId, WorkerAdmission } from \"./Records.ts\";\nimport {\n AdmissionConflict,\n AdmissionPolicyError,\n AdmissionRequest,\n LedgerError,\n MarkReadyRequest,\n SubmissionLedger,\n} from \"./SubmissionLedger.ts\";\nimport {\n AppendConflict,\n ThreadMaterialization,\n ThreadNotMaterialized,\n ThreadStore,\n ThreadStoreError,\n} from \"./ThreadStore.ts\";\nimport { WakeScheduler } from \"./WakeScheduler.ts\";\n\n/**\n * Storage admission after source authorization, input validation and capacity reservation.\n * This is an internal host port, not an authorization entrypoint. Hosts route the whole\n * operation to the destination owner and enroll recovery before executing it.\n */\nexport class WorkerAdmissionRequest extends Schema.Class<WorkerAdmissionRequest>(\n \"@effect-agent/thread/WorkerAdmissionRequest\",\n)({\n ...AdmissionRequest.fields,\n workerAdmission: WorkerAdmission,\n producerId: ProducerId,\n}) {}\n\nexport const WorkerAdmissionFailure = Schema.Union([\n AdmissionConflict,\n AdmissionPolicyError,\n LedgerError,\n ThreadStoreError,\n ThreadNotMaterialized,\n AppendConflict,\n DurableRuntimeFailpointError,\n]);\n\n/** Local implementation shared by every host; retries finish the same admitted row. */\nexport const admitWorker = Effect.fnUntraced(function* (request: WorkerAdmissionRequest) {\n const origin = request.workerAdmission.origin;\n\n if (\n origin.worker.threadId !== request.threadId ||\n origin.worker.targetAgentId !== request.agentId ||\n request.parentLinkage !== undefined\n )\n return yield* LedgerError.make({\n operation: \"admit worker\",\n message: \"Worker admission does not belong to the destination Thread\",\n });\n\n const ledger = yield* SubmissionLedger;\n const store = yield* ThreadStore;\n const wake = yield* WakeScheduler;\n const failpoint = yield* DurableRuntimeFailpoint;\n const admitted = yield* ledger.admit(AdmissionRequest.make(request));\n\n yield* failpoint.hit(\"submit:after-admit\");\n if (admitted.replayed && admitted.state !== \"admitted\") return admitted;\n\n yield* store.materialize(\n ThreadMaterialization.make({\n threadId: request.threadId,\n }),\n );\n\n const config = {\n producerId: request.producerId,\n deploymentId: request.deploymentId,\n };\n\n yield* ensureThreadCreated(config, request.threadId, request.agentId, request.agentDigests);\n yield* ensureWorkerOrigin(config, origin).pipe(\n Effect.mapError((cause) =>\n LedgerError.make({ operation: \"worker-origin\", message: cause.reason, cause }),\n ),\n );\n yield* failpoint.hit(\"submit:after-materialize\");\n yield* ledger.markReady(MarkReadyRequest.make({ submissionId: admitted.submissionId }));\n yield* wake.notify(request.threadId);\n\n return admitted;\n});\n\n/** Placement adapter for the composite operation; local hosts use the same implementation. */\nexport const WorkerAdmissionPort = Context.Reference<{ readonly admit: typeof admitWorker }>(\n \"@effect-agent/thread/WorkerAdmissionPort\",\n { defaultValue: () => ({ admit: admitWorker }) },\n);\n"],"mappings":";;;;;;;;;;;;AAmCA,MAAa,wBAAwB,aACnC,OAAO,WAAW,OAAO,CAAC,CAAC,kBAAkB,UAAU;AAEzD,MAAa,yBAAyB,aACpC,OAAO,WAAW,QAAQ,CAAC,CAAC,kBAAkB,UAAU;;;;;;AAO1D,MAAa,sBAAsB,OAAO,WACxC,WACE,QACA,UACA,SACA,aAKA;CACA,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO;CACpB,MAAM,OAAO,OAAO,MAAM,YAAY,kBAAkB,KAAK,EAAE,SAAS,CAAC,CAAC;CAE1E,IAAI,KAAK,eAAe,GAAG;CAE3B,MAAM,SAAS,OAAO,OAAO,IAAI,SAAS,MAAM,cAC9C,eAAe,KAAK;EAClB,UAAU,sBAAsB,QAAQ;EACxC,QAAQ;EACR,eAAe;EACf;EACA,cAAc,OAAO;EACrB,SAAS,cAAc,KAAK;GAAE;GAAS;EAAY,CAAC;CACtD,CAAC,CACH;CAEA,OAAO,MACJ,OACC,cAAc,KAAK;EACjB;EACA,OAAO,eAAe,KAAK;GACzB,SAAS,qBAAqB,QAAQ;GACtC,YAAY,OAAO;GACnB,SAAS,CAAC,MAAM;EAClB,CAAC;EACD,sBAAsB,KAAK;CAC7B,CAAC,CACH,CAAC,CACA,KACC,OAAO,SAAS,mBAAmB,UACjC,MACG,YAAY,kBAAkB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CACjD,KACC,OAAO,SAAS,Y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,iBAAiB,KAAK,OAAO,CAAC;CAEnE,OAAO,UAAU,IAAI,oBAAoB;CACzC,IAAI,SAAS,YAAY,SAAS,UAAU,YAAY,OAAO;CAE/D,OAAO,MAAM,YACX,sBAAsB,KAAK,EACzB,UAAU,QAAQ,SACpB,CAAC,CACH;CAEA,MAAM,SAAS;EACb,YAAY,QAAQ;EACpB,cAAc,QAAQ;CACxB;CAEA,OAAO,oBAAoB,QAAQ,QAAQ,UAAU,QAAQ,SAAS,QAAQ,YAAY;CAC1F,OAAO,mBAAmB,QAAQ,MAAM,CAAC,CAAC,KACxC,OAAO,UAAU,UACf,YAAY,KAAK;EAAE,WAAW;EAAiB,SAAS,MAAM;EAAQ;CAAM,CAAC,CAC/E,CACF;CACA,OAAO,UAAU,IAAI,0BAA0B;CAC/C,OAAO,OAAO,UAAU,iBAAiB,KAAK,EAAE,cAAc,SAAS,aAAa,CAAC,CAAC;CACtF,OAAO,KAAK,OAAO,QAAQ,QAAQ;CAEnC,OAAO;AACT,CAAC;;AAGD,MAAa,sBAAsB,QAAQ,UACzC,4CACA,EAAE,qBAAqB,EAAE,OAAO,YAAY,GAAG,CACjD"}
|
package/dist/durable/Admin.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as renderRecoveryExplanation, S as recoveryDecisionMeaning, _ as RetryCommand, a as IntegrityCheck, b as obligationSeverityOf, c as IntegrityReport, d as ObligationReport, f as ObligationSeverity, g as RecoveryExplanation, h as RecoveryDisposition, i as ExplainedUnknownCall, l as ObligationBlockedOn, m as RECOVERY_DECISION_MEANINGS, n as ExplainedEvidence, o as IntegrityCheckName, p as ObligationThresholds, r as ExplainedSubmission, s as IntegrityCheckStatus, u as ObligationEntry, v as RetryRefusalReason, x as predictRecoveryDisposition, y as RetryRefused } from "../Admin-
|
|
1
|
+
import { C as renderRecoveryExplanation, S as recoveryDecisionMeaning, _ as RetryCommand, a as IntegrityCheck, b as obligationSeverityOf, c as IntegrityReport, d as ObligationReport, f as ObligationSeverity, g as RecoveryExplanation, h as RecoveryDisposition, i as ExplainedUnknownCall, l as ObligationBlockedOn, m as RECOVERY_DECISION_MEANINGS, n as ExplainedEvidence, o as IntegrityCheckName, p as ObligationThresholds, r as ExplainedSubmission, s as IntegrityCheckStatus, u as ObligationEntry, v as RetryRefusalReason, x as predictRecoveryDisposition, y as RetryRefused } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
export { ExplainedEvidence, ExplainedSubmission, ExplainedUnknownCall, IntegrityCheck, IntegrityCheckName, IntegrityCheckStatus, IntegrityReport, ObligationBlockedOn, ObligationEntry, ObligationReport, ObligationSeverity, ObligationThresholds, RECOVERY_DECISION_MEANINGS, RecoveryDisposition, RecoveryExplanation, RetryCommand, RetryRefusalReason, RetryRefused, obligationSeverityOf, predictRecoveryDisposition, recoveryDecisionMeaning, renderRecoveryExplanation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { As as DurableBindingFailure, Ds as BindingSelection, Es as AgentRegistration, Fs as compileBindingContracts, Is as compileRegistrations, Ls as definitionDigestsEqual, Ms as ExecutableAgentBinding, Ns as ReplayVersions, Os as BindingUnavailable, Ps as ResolvedBinding, Ts as AgentAttemptContext, js as DurableWorkerBinding, ks as CurrentBindingSelection } from "../Admin-
|
|
1
|
+
import { As as DurableBindingFailure, Ds as BindingSelection, Es as AgentRegistration, Fs as compileBindingContracts, Is as compileRegistrations, Ls as definitionDigestsEqual, Ms as ExecutableAgentBinding, Ns as ReplayVersions, Os as BindingUnavailable, Ps as ResolvedBinding, Ts as AgentAttemptContext, js as DurableWorkerBinding, ks as CurrentBindingSelection } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
export { type AgentAttemptContext, type AgentRegistration, type BindingSelection, BindingUnavailable, CurrentBindingSelection, type DurableBindingFailure, DurableWorkerBinding, type ExecutableAgentBinding, type ReplayVersions, type ResolvedBinding, compileBindingContracts, compileRegistrations, definitionDigestsEqual };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ui as ThreadStore, Wr as SettlementPublisher, dn as SubmissionLedger, vo as StorageOwner } from "../Admin-
|
|
1
|
+
import { Ui as ThreadStore, Wr as SettlementPublisher, dn as SubmissionLedger, vo as StorageOwner } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
import { Crypto, Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/Certification.d.ts
|
|
4
4
|
declare const CertifiedAdapterIdentity_base: Schema.Class<CertifiedAdapterIdentity, Schema.Struct<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { K as PersistedJson, d as CanonicalRecordEnvelope, p as CanonicalSequence } from "../Records-BTnGRdcf.mjs";
|
|
2
2
|
import { ActivityProcessorKey, ActivityProcessorStore, ActivityStoreFailure, PreparedActivity } from "./ActivityStore.mjs";
|
|
3
3
|
import { t as DigestError } from "../Digest-DjUgS5PG.mjs";
|
|
4
|
-
import { Gi as ThreadStoreError, Mi as ThreadNotMaterialized, Ui as ThreadStore } from "../Admin-
|
|
4
|
+
import { Gi as ThreadStoreError, Mi as ThreadNotMaterialized, Ui as ThreadStore } from "../Admin-BX9ns28E.mjs";
|
|
5
5
|
import { Crypto, Effect, Schema, Scope } from "effect";
|
|
6
6
|
declare namespace CommittedActivity_d_exports {
|
|
7
7
|
export { ActivityPassLimits, ActivityPassResult, ActivityProcessingError, CommittedActivityProcessor, activityWorkId, processCommittedActivity };
|
|
@@ -2,7 +2,7 @@ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
|
2
2
|
import { U as PersistedJson, f as CanonicalSequence, u as CanonicalRecordEnvelope } from "../Records-BiuJDWNe.mjs";
|
|
3
3
|
import { ActivityProcessorKey, ActivityProcessorStore, ActivityProgress, PreparedActivity } from "./ActivityStore.mjs";
|
|
4
4
|
import { s as digestJson } from "../Digest-DCuPlhNk.mjs";
|
|
5
|
-
import { $ as ThreadTailRequest, J as ThreadStore, Q as ThreadTail, V as ThreadRead } from "../ThreadStore-
|
|
5
|
+
import { $ as ThreadTailRequest, J as ThreadStore, Q as ThreadTail, V as ThreadRead } from "../ThreadStore-CEekRa80.mjs";
|
|
6
6
|
import { Clock, Effect, Schema, Stream } from "effect";
|
|
7
7
|
//#region src/durable/CommittedActivity.ts
|
|
8
8
|
var CommittedActivity_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as Receipt } from "../Receipt-BkM21Qiu.mjs";
|
|
2
|
-
import { $n as DurableAwaitFailure, Cr as recoveryRepairBatchId, Er as threadCreatedRecordId, Jn as DurableAgentRuntime, Kn as ApprovalSuspensionError, Qn as DurableApprovalSuspension, Sr as isolateRecovery, Tr as threadCreatedBatchId, Xn as DurableApprovalFailure, Zn as DurableApprovalResolver, _r as RecoverySweepOptions, ar as DurableRetryFailure, br as WorkRecoveryRequest, cr as DurableSubmitAgent, dr as DurableVerifyFailure, er as DurableExplainFailure, fr as DurableWorkerFailure, gr as RecoveryReport, hr as RecoveryFailure, ir as DurableResolveFailure, lr as DurableSubmitFailure, mr as RecoveryBlocked, nr as DurableObserveOptions, or as DurableRuntimeConfig, pr as DurableWorkerRequirements, qn as DurableAbortFailure, rr as DurableProgressFailure, sr as DurableRuntimeConfigOptions, tr as DurableObligationFailure, ur as DurableSubmitOptions, vr as RecoverySweepResult, wr as recoveryRepairRecordId, xr as childReservationIdFor, yr as WorkRecoveryReport } from "../Admin-
|
|
2
|
+
import { $n as DurableAwaitFailure, Cr as recoveryRepairBatchId, Er as threadCreatedRecordId, Jn as DurableAgentRuntime, Kn as ApprovalSuspensionError, Qn as DurableApprovalSuspension, Sr as isolateRecovery, Tr as threadCreatedBatchId, Xn as DurableApprovalFailure, Zn as DurableApprovalResolver, _r as RecoverySweepOptions, ar as DurableRetryFailure, br as WorkRecoveryRequest, cr as DurableSubmitAgent, dr as DurableVerifyFailure, er as DurableExplainFailure, fr as DurableWorkerFailure, gr as RecoveryReport, hr as RecoveryFailure, ir as DurableResolveFailure, lr as DurableSubmitFailure, mr as RecoveryBlocked, nr as DurableObserveOptions, or as DurableRuntimeConfig, pr as DurableWorkerRequirements, qn as DurableAbortFailure, rr as DurableProgressFailure, sr as DurableRuntimeConfigOptions, tr as DurableObligationFailure, ur as DurableSubmitOptions, vr as RecoverySweepResult, wr as recoveryRepairRecordId, xr as childReservationIdFor, yr as WorkRecoveryReport } from "../Admin-BX9ns28E.mjs";
|
|
3
3
|
export { ApprovalSuspensionError, DurableAbortFailure, DurableAgentRuntime, DurableApprovalFailure, DurableApprovalResolver, DurableApprovalSuspension, DurableAwaitFailure, DurableExplainFailure, DurableObligationFailure, DurableObserveOptions, DurableProgressFailure, DurableResolveFailure, DurableRetryFailure, DurableRuntimeConfig, DurableRuntimeConfigOptions, DurableSubmitAgent, DurableSubmitFailure, DurableSubmitOptions, DurableVerifyFailure, DurableWorkerFailure, DurableWorkerRequirements, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, RecoverySweepOptions, RecoverySweepResult, WorkRecoveryReport, WorkRecoveryRequest, childReservationIdFor, isolateRecovery, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Receipt } from "../core/Receipt.mjs";
|
|
2
|
-
import { a as DurableApprovalSuspension, c as RecoveryFailure, d as WorkRecoveryReport, f as WorkRecoveryRequest, g as recoveryRepairRecordId, h as recoveryRepairBatchId, i as DurableApprovalResolver, l as RecoveryReport, m as isolateRecovery, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as childReservationIdFor, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-
|
|
3
|
-
import { c as threadCreatedBatchId, l as threadCreatedRecordId } from "../WorkerAdmission-
|
|
2
|
+
import { a as DurableApprovalSuspension, c as RecoveryFailure, d as WorkRecoveryReport, f as WorkRecoveryRequest, g as recoveryRepairRecordId, h as recoveryRepairBatchId, i as DurableApprovalResolver, l as RecoveryReport, m as isolateRecovery, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as childReservationIdFor, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-BAmSkWYr.mjs";
|
|
3
|
+
import { c as threadCreatedBatchId, l as threadCreatedRecordId } from "../WorkerAdmission-DFVbbVh2.mjs";
|
|
4
4
|
export { ApprovalSuspensionError, DurableAgentRuntime, DurableApprovalResolver, DurableApprovalSuspension, DurableRuntimeConfig, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, RecoverySweepResult, WorkRecoveryReport, WorkRecoveryRequest, childReservationIdFor, isolateRecovery, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as makeEventSource, i as NormalizedEvent, r as EventSources, t as EventSource } from "../EventSource-
|
|
1
|
+
import { a as makeEventSource, i as NormalizedEvent, r as EventSources, t as EventSource } from "../EventSource-BwliwQz9.mjs";
|
|
2
2
|
export { EventSource, EventSources, NormalizedEvent, makeEventSource };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BkM21Qiu.mjs";
|
|
2
|
-
import "../Admin-
|
|
3
|
-
import { E as SubscriptionSourceError } from "../Subscription-
|
|
4
|
-
import { t as EventSource } from "../EventSource-
|
|
2
|
+
import "../Admin-BX9ns28E.mjs";
|
|
3
|
+
import { E as SubscriptionSourceError } from "../Subscription-DONig54Q.mjs";
|
|
4
|
+
import { t as EventSource } from "../EventSource-BwliwQz9.mjs";
|
|
5
5
|
import { SubscriptionFailure, SubscriptionIntake } from "./Subscriptions.mjs";
|
|
6
6
|
import { Context, Effect, Layer, Redacted, Schema } from "effect";
|
|
7
7
|
import { HttpClient } from "effect/http";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ao as LifecyclePublicationConfig, co as LifecyclePublicationHandler, fo as drainLifecyclePublications, io as LifecyclePublicationBatch, lo as LifecyclePublicationSource, mo as lifecyclePublicationLayer, oo as LifecyclePublicationError, po as lifecyclePublicationBatchMaxFacts, ro as LifecyclePublication, so as LifecyclePublicationFact, uo as LifecyclePublicationStorage } from "../Admin-
|
|
1
|
+
import { ao as LifecyclePublicationConfig, co as LifecyclePublicationHandler, fo as drainLifecyclePublications, io as LifecyclePublicationBatch, lo as LifecyclePublicationSource, mo as lifecyclePublicationLayer, oo as LifecyclePublicationError, po as lifecyclePublicationBatchMaxFacts, ro as LifecyclePublication, so as LifecyclePublicationFact, uo as LifecyclePublicationStorage } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
export { LifecyclePublication, LifecyclePublicationBatch, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, LifecyclePublicationStorage, drainLifecyclePublications, lifecyclePublicationBatchMaxFacts, lifecyclePublicationLayer };
|
|
@@ -4,7 +4,7 @@ import { Receipt } from "../core/Receipt.mjs";
|
|
|
4
4
|
import { n as AssignmentTerminal } from "../Worker-DZjdMjZn.mjs";
|
|
5
5
|
import { Ft as WorkerInputRequested, Nt as WorkerInputCompleted, Vt as WorkerStopRequested, _t as SubmissionSettledRecord, bt as ToolApprovalDecided, f as CanonicalSequence, ft as SubagentJoined, ht as SubagentStarted, kt as UserInputRecorded, lt as RunStartedRecord, mt as SubagentRequested, n as AgentUpdateEmitted, t as AbortRequested, xt as ToolApprovalRequested } from "../Records-BiuJDWNe.mjs";
|
|
6
6
|
import { AbortIntent, Settlement, SubmissionLedger, SubmissionLookupById, SubmissionSnapshot, SuspensionReason } from "./SubmissionLedger.mjs";
|
|
7
|
-
import { st as getRunInput } from "../ThreadStore-
|
|
7
|
+
import { st as getRunInput } from "../ThreadStore-CEekRa80.mjs";
|
|
8
8
|
import { PreparedInput } from "./Subscription.mjs";
|
|
9
9
|
import { MessageDeliveryKey } from "./MessageDelivery.mjs";
|
|
10
10
|
import { Cause, Clock, Context, Crypto, Effect, Layer, Option, Schema } from "effect";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as messageDeliveryKeyString, D as readPending, E as prepareMessageDelivery, O as sameMessageDeliveryIdentity, S as messageDeliveryDeadline, T as peerMessageRetentionDeadline, _ as applyMessageDeliveryChange, a as MessageDeliveryError, b as isWorkerUpdateDelivery, c as MessageDeliveryFailure, d as MessageDeliveryPageRequest, f as MessageDeliveryPolicy, h as MessageDeliveryStoreLimits, i as MessageDeliveryDriverLimits, k as validateMessageDelivery, l as MessageDeliveryKey, m as MessageDeliveryStore, n as MessageDeliveryCompletion, o as MessageDeliveryFailpoint, p as MessageDeliveryRecord, r as MessageDeliveryDriver, s as MessageDeliveryFailpointError, t as MessageDeliveryChange, u as MessageDeliveryPage, v as defaultMessageDeliveryPolicy, w as messageDeliveryUsesCapacity, x as messageDeliveryCapacity, y as defaultMessageDeliveryStoreLimits } from "../MessageDelivery-
|
|
1
|
+
import { C as messageDeliveryKeyString, D as readPending, E as prepareMessageDelivery, O as sameMessageDeliveryIdentity, S as messageDeliveryDeadline, T as peerMessageRetentionDeadline, _ as applyMessageDeliveryChange, a as MessageDeliveryError, b as isWorkerUpdateDelivery, c as MessageDeliveryFailure, d as MessageDeliveryPageRequest, f as MessageDeliveryPolicy, h as MessageDeliveryStoreLimits, i as MessageDeliveryDriverLimits, k as validateMessageDelivery, l as MessageDeliveryKey, m as MessageDeliveryStore, n as MessageDeliveryCompletion, o as MessageDeliveryFailpoint, p as MessageDeliveryRecord, r as MessageDeliveryDriver, s as MessageDeliveryFailpointError, t as MessageDeliveryChange, u as MessageDeliveryPage, v as defaultMessageDeliveryPolicy, w as messageDeliveryUsesCapacity, x as messageDeliveryCapacity, y as defaultMessageDeliveryStoreLimits } from "../MessageDelivery-CeSDfHZa.mjs";
|
|
2
2
|
export { MessageDeliveryChange, MessageDeliveryCompletion, MessageDeliveryDriver, MessageDeliveryDriverLimits, MessageDeliveryError, MessageDeliveryFailpoint, MessageDeliveryFailpointError, MessageDeliveryFailure, MessageDeliveryKey, MessageDeliveryPage, MessageDeliveryPageRequest, MessageDeliveryPolicy, MessageDeliveryRecord, MessageDeliveryStore, MessageDeliveryStoreLimits, applyMessageDeliveryChange, defaultMessageDeliveryPolicy, defaultMessageDeliveryStoreLimits, isWorkerUpdateDelivery, messageDeliveryCapacity, messageDeliveryDeadline, messageDeliveryKeyString, messageDeliveryUsesCapacity, peerMessageRetentionDeadline, prepareMessageDelivery, readPending, sameMessageDeliveryIdentity, validateMessageDelivery };
|
|
@@ -5,8 +5,8 @@ import { r as Diagnostic } from "../FailureDiagnostic-DvHruCSJ.mjs";
|
|
|
5
5
|
import { t as AgentPolicy } from "../AgentPolicy-B4lbCU2T.mjs";
|
|
6
6
|
import { b as DefinitionDigests } from "../Records-BTnGRdcf.mjs";
|
|
7
7
|
import { t as DigestError } from "../Digest-DjUgS5PG.mjs";
|
|
8
|
-
import { sn as Settlement } from "../Admin-
|
|
9
|
-
import { a as MessageDeliveryError, c as MessageDeliveryFailure, m as MessageDeliveryStore } from "../MessageDelivery-
|
|
8
|
+
import { sn as Settlement } from "../Admin-BX9ns28E.mjs";
|
|
9
|
+
import { a as MessageDeliveryError, c as MessageDeliveryFailure, m as MessageDeliveryStore } from "../MessageDelivery-CeSDfHZa.mjs";
|
|
10
10
|
import { Effect, Schema } from "effect";
|
|
11
11
|
//#region src/durable/MessageDeliveryStoreConformance.d.ts
|
|
12
12
|
declare const MessageDeliveryConformanceViolation_base: Schema.Class<MessageDeliveryConformanceViolation, Schema.TaggedStruct<"MessageDeliveryConformanceViolation", {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ThreadHistory } from "../ThreadHistory-ByxS8HU1.mjs";
|
|
2
|
-
import { Ui as ThreadStore, vo as StorageOwner } from "../Admin-
|
|
2
|
+
import { Ui as ThreadStore, vo as StorageOwner } from "../Admin-BX9ns28E.mjs";
|
|
3
3
|
import { Layer } from "effect";
|
|
4
4
|
declare namespace PersistentHistory_d_exports {
|
|
5
5
|
export { layer };
|
|
@@ -2,8 +2,8 @@ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
|
2
2
|
import { ThreadHistory, ThreadHistoryError } from "../engine/ThreadHistory.mjs";
|
|
3
3
|
import { L as ModelCompleted, U as PersistedJson, W as ProducerId, X as RecordEnvelope, Z as RecordId, c as CanonicalBatch, i as BatchId, kt as UserInputRecorded, nt as RunCompleted, y as DeploymentId } from "../Records-BiuJDWNe.mjs";
|
|
4
4
|
import { _ as promptFromCanonicalRecords } from "../RunJournal-kfKVxJj7.mjs";
|
|
5
|
-
import { F as ThreadIdentityRequest, I as ThreadMaterialization, J as ThreadStore, b as SelectedThreadRead, n as AppendRequest } from "../ThreadStore-
|
|
6
|
-
import { s as StorageOwner } from "../RunStorage-
|
|
5
|
+
import { F as ThreadIdentityRequest, I as ThreadMaterialization, J as ThreadStore, b as SelectedThreadRead, n as AppendRequest } from "../ThreadStore-CEekRa80.mjs";
|
|
6
|
+
import { s as StorageOwner } from "../RunStorage-uqPxps09.mjs";
|
|
7
7
|
import { DateTime, Effect, Layer, Schema, Stream } from "effect";
|
|
8
8
|
import { Prompt } from "effect/ai";
|
|
9
9
|
//#region src/durable/PersistentHistory.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
1
|
+
import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-CxSJSiTl.mjs";
|
|
2
2
|
export { PreparedInputAdmission, admitPreparedInput };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ReadRecord, c as decodeExportRecord, i as ReadEnvelope, n as ExportRecord, o as RecordFormatError, r as ExportedRecord, t as ExportBatch } from "../RecordFormat-
|
|
2
|
-
export { ExportBatch, ExportRecord, ExportedRecord, ReadEnvelope, ReadRecord, RecordFormatError, decodeExportRecord };
|
|
1
|
+
import { a as ReadRecord, c as decodeExportRecord, i as ReadEnvelope, l as decodeExportRecordJson, n as ExportRecord, o as RecordFormatError, r as ExportedRecord, t as ExportBatch } from "../RecordFormat-BNiLpe43.mjs";
|
|
2
|
+
export { ExportBatch, ExportRecord, ExportedRecord, ReadEnvelope, ReadRecord, RecordFormatError, decodeExportRecord, decodeExportRecordJson };
|
|
@@ -9,7 +9,8 @@ var RecordFormat_exports = /* @__PURE__ */ __exportAll({
|
|
|
9
9
|
ReadEnvelope: () => ReadEnvelope,
|
|
10
10
|
ReadRecord: () => ReadRecord,
|
|
11
11
|
RecordFormatError: () => RecordFormatError,
|
|
12
|
-
decodeExportRecord: () => decodeExportRecord
|
|
12
|
+
decodeExportRecord: () => decodeExportRecord,
|
|
13
|
+
decodeExportRecordJson: () => decodeExportRecordJson
|
|
13
14
|
});
|
|
14
15
|
var RecordFormatError = class extends Schema.TaggedError()("RecordFormatError", {
|
|
15
16
|
format: Schema.String,
|
|
@@ -19,6 +20,17 @@ var RecordFormatError = class extends Schema.TaggedError()("RecordFormatError",
|
|
|
19
20
|
var ExportedRecord = class extends RecordEnvelope.extend("@effect-agent/thread/ExportedRecord")({ wire: RecordJson }) {};
|
|
20
21
|
const decodeRecord = Schema.decodeUnknownEffect(RecordEnvelope);
|
|
21
22
|
const sameRecord = Schema.toEquivalence(RecordEnvelope);
|
|
23
|
+
const parseRecordObject = Schema.decodeEffect(Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown)));
|
|
24
|
+
const decodeExportedRecord = Schema.decodeUnknownEffect(ExportedRecord);
|
|
25
|
+
/**
|
|
26
|
+
* Decode stored text directly into its final record, retaining additive wire.
|
|
27
|
+
* Parsing owns the object; the final schema checks the wire bounds and supported fields once.
|
|
28
|
+
* Object-input codecs still validate caller-owned wire when constructing the read view.
|
|
29
|
+
*/
|
|
30
|
+
const decodeExportRecordJson = (encoded) => parseRecordObject(encoded).pipe(Effect.flatMap((wire) => decodeExportedRecord({
|
|
31
|
+
...wire,
|
|
32
|
+
wire
|
|
33
|
+
})));
|
|
22
34
|
const decodeView = SchemaGetter.transformEffect((value) => decodeRecord(value).pipe(Effect.map((record) => new ExportedRecord({
|
|
23
35
|
...record,
|
|
24
36
|
wire: value
|
|
@@ -61,6 +73,6 @@ const ExportBatch = Schema.Struct({
|
|
|
61
73
|
records: Schema.NonEmptyArray(ExportRecord).check(Schema.isMaxLength(256))
|
|
62
74
|
});
|
|
63
75
|
//#endregion
|
|
64
|
-
export { ExportBatch, ExportRecord, ExportedRecord, ReadEnvelope, ReadRecord, RecordFormatError, decodeExportRecord, RecordFormat_exports as t };
|
|
76
|
+
export { ExportBatch, ExportRecord, ExportedRecord, ReadEnvelope, ReadRecord, RecordFormatError, decodeExportRecord, decodeExportRecordJson, RecordFormat_exports as t };
|
|
65
77
|
|
|
66
78
|
//# sourceMappingURL=RecordFormat.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecordFormat.mjs","names":[],"sources":["../../src/durable/RecordFormat.ts"],"sourcesContent":["import { Effect, Schema, SchemaGetter, SchemaIssue } from \"effect\";\n\nimport {\n CanonicalBatch,\n CanonicalRecordEnvelope,\n CURRENT_RECORD_FORMAT,\n RecordEnvelope,\n RecordJson,\n} from \"./Records.ts\";\n\nexport class RecordFormatError extends Schema.TaggedError<RecordFormatError>()(\n \"RecordFormatError\",\n {\n format: Schema.String,\n message: Schema.String,\n },\n) {}\n\n/** An archive owns its wire JSON explicitly; the typed fields are only a read view. */\nexport class ExportedRecord extends RecordEnvelope.extend<ExportedRecord>(\n \"@effect-agent/thread/ExportedRecord\",\n)({ wire: RecordJson }) {}\n\nconst decodeRecord = Schema.decodeUnknownEffect(RecordEnvelope);\nconst sameRecord = Schema.toEquivalence(RecordEnvelope);\n\n// Both codecs validate RecordJson before this getter; decode the supported view once.\nconst decodeView = SchemaGetter.transformEffect((value: RecordJson) =>\n decodeRecord(value).pipe(\n Effect.map((record) => new ExportedRecord({ ...record, wire: value }, { disableChecks: true })),\n Effect.mapError((error) => error.issue),\n ),\n);\n\n/** Decode at the archive boundary, retaining unknown additive fields for a lossless backup. */\nexport const decodeExportRecord = Effect.fnUntraced(function* (format: string, input: RecordJson) {\n if (format !== CURRENT_RECORD_FORMAT)\n return yield* RecordFormatError.make({ format, message: \"Unsupported record format\" });\n\n return yield* Schema.decodeEffect(ExportRecord)(input).pipe(\n Effect.mapError(() => RecordFormatError.make({ format, message: \"Invalid canonical record\" })),\n );\n});\n\n/**\n * Preserve additive fields without process-local side state. Copy with ExportedRecord.make\n * or this codec. Normalizing through RecordEnvelope discards the wire and cannot be encoded\n * as an archive record. Editing the typed view also fails rather than silently changing a log.\n */\nexport const ExportRecord = RecordJson.pipe(\n Schema.decodeTo(Schema.toType(ExportedRecord), {\n decode: decodeView,\n encode: SchemaGetter.transformEffect((record) =>\n decodeRecord(record.wire).pipe(\n Effect.mapError((error) => error.issue),\n Effect.flatMap((view) =>\n sameRecord(view, record)\n ? Effect.succeed(record.wire)\n : Effect.fail(\n new SchemaIssue.InvalidValue({\n message:\n \"Archive record view differs from its wire JSON; export the source again\",\n }),\n ),\n ),\n ),\n ),\n }),\n);\n\n/** Canonical read transport preserves exact evidence while exposing the supported typed view. */\nexport const ReadRecord = RecordJson.pipe(\n Schema.decodeTo(Schema.toType(RecordEnvelope), {\n decode: decodeView,\n encode: SchemaGetter.transformEffect((record) =>\n (record instanceof ExportedRecord\n ? Schema.encodeEffect(ExportRecord)(record)\n : Schema.encodeEffect(RecordEnvelope)(record)\n ).pipe(Effect.mapError((error) => error.issue)),\n ),\n }),\n);\n\nexport const ReadEnvelope = Schema.Struct({\n ...CanonicalRecordEnvelope.fields,\n record: ReadRecord,\n}).pipe(\n Schema.decodeTo(Schema.toType(CanonicalRecordEnvelope), {\n decode: SchemaGetter.transform(\n (fields) => new CanonicalRecordEnvelope(fields, { disableChecks: true }),\n ),\n encode: SchemaGetter.transform((envelope) => envelope),\n }),\n);\n\n/** Batch identity plus lossless record wire, used when checking a complete immutable log. */\nexport const ExportBatch = Schema.Struct({\n ...CanonicalBatch.fields,\n records: Schema.NonEmptyArray(ExportRecord).check(Schema.isMaxLength(256)),\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"RecordFormat.mjs","names":[],"sources":["../../src/durable/RecordFormat.ts"],"sourcesContent":["import { Effect, Schema, SchemaGetter, SchemaIssue } from \"effect\";\n\nimport {\n CanonicalBatch,\n CanonicalRecordEnvelope,\n CURRENT_RECORD_FORMAT,\n RecordEnvelope,\n RecordJson,\n} from \"./Records.ts\";\n\nexport class RecordFormatError extends Schema.TaggedError<RecordFormatError>()(\n \"RecordFormatError\",\n {\n format: Schema.String,\n message: Schema.String,\n },\n) {}\n\n/** An archive owns its wire JSON explicitly; the typed fields are only a read view. */\nexport class ExportedRecord extends RecordEnvelope.extend<ExportedRecord>(\n \"@effect-agent/thread/ExportedRecord\",\n)({ wire: RecordJson }) {}\n\nconst decodeRecord = Schema.decodeUnknownEffect(RecordEnvelope);\nconst sameRecord = Schema.toEquivalence(RecordEnvelope);\n\nconst parseRecordObject = Schema.decodeEffect(\n Schema.fromJsonString(Schema.Record(Schema.String, Schema.Unknown)),\n);\n\nconst decodeExportedRecord = Schema.decodeUnknownEffect(ExportedRecord);\n\n/**\n * Decode stored text directly into its final record, retaining additive wire.\n * Parsing owns the object; the final schema checks the wire bounds and supported fields once.\n * Object-input codecs still validate caller-owned wire when constructing the read view.\n */\nexport const decodeExportRecordJson = (\n encoded: string,\n): Effect.Effect<ExportedRecord, Schema.SchemaError> =>\n parseRecordObject(encoded).pipe(\n Effect.flatMap((wire) => decodeExportedRecord({ ...wire, wire })),\n );\n\n// Both codecs validate RecordJson before this getter; decode the supported view once.\nconst decodeView = SchemaGetter.transformEffect((value: RecordJson) =>\n decodeRecord(value).pipe(\n Effect.map((record) => new ExportedRecord({ ...record, wire: value }, { disableChecks: true })),\n Effect.mapError((error) => error.issue),\n ),\n);\n\n/** Decode at the archive boundary, retaining unknown additive fields for a lossless backup. */\nexport const decodeExportRecord = Effect.fnUntraced(function* (format: string, input: RecordJson) {\n if (format !== CURRENT_RECORD_FORMAT)\n return yield* RecordFormatError.make({ format, message: \"Unsupported record format\" });\n\n return yield* Schema.decodeEffect(ExportRecord)(input).pipe(\n Effect.mapError(() => RecordFormatError.make({ format, message: \"Invalid canonical record\" })),\n );\n});\n\n/**\n * Preserve additive fields without process-local side state. Copy with ExportedRecord.make\n * or this codec. Normalizing through RecordEnvelope discards the wire and cannot be encoded\n * as an archive record. Editing the typed view also fails rather than silently changing a log.\n */\nexport const ExportRecord = RecordJson.pipe(\n Schema.decodeTo(Schema.toType(ExportedRecord), {\n decode: decodeView,\n encode: SchemaGetter.transformEffect((record) =>\n decodeRecord(record.wire).pipe(\n Effect.mapError((error) => error.issue),\n Effect.flatMap((view) =>\n sameRecord(view, record)\n ? Effect.succeed(record.wire)\n : Effect.fail(\n new SchemaIssue.InvalidValue({\n message:\n \"Archive record view differs from its wire JSON; export the source again\",\n }),\n ),\n ),\n ),\n ),\n }),\n);\n\n/** Canonical read transport preserves exact evidence while exposing the supported typed view. */\nexport const ReadRecord = RecordJson.pipe(\n Schema.decodeTo(Schema.toType(RecordEnvelope), {\n decode: decodeView,\n encode: SchemaGetter.transformEffect((record) =>\n (record instanceof ExportedRecord\n ? Schema.encodeEffect(ExportRecord)(record)\n : Schema.encodeEffect(RecordEnvelope)(record)\n ).pipe(Effect.mapError((error) => error.issue)),\n ),\n }),\n);\n\nexport const ReadEnvelope = Schema.Struct({\n ...CanonicalRecordEnvelope.fields,\n record: ReadRecord,\n}).pipe(\n Schema.decodeTo(Schema.toType(CanonicalRecordEnvelope), {\n decode: SchemaGetter.transform(\n (fields) => new CanonicalRecordEnvelope(fields, { disableChecks: true }),\n ),\n encode: SchemaGetter.transform((envelope) => envelope),\n }),\n);\n\n/** Batch identity plus lossless record wire, used when checking a complete immutable log. */\nexport const ExportBatch = Schema.Struct({\n ...CanonicalBatch.fields,\n records: Schema.NonEmptyArray(ExportRecord).check(Schema.isMaxLength(256)),\n});\n"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,IAAI,CAAC,CAAC,KACxB,OAAO,UAAU,UAAU,MAAM,KAAK,GACtC,OAAO,SAAS,SACd,WAAW,MAAM,MAAM,IACnB,OAAO,QAAQ,OAAO,IAAI,IAC1B,OAAO,KACL,IAAI,YAAY,aAAa,EAC3B,SACE,0EACJ,CAAC,CACH,CACN,CACF,CACF;AACF,CAAC,CACH;;AAGA,MAAa,aAAa,WAAW,KACnC,OAAO,SAAS,OAAO,OAAO,cAAc,GAAG;CAC7C,QAAQ;CACR,QAAQ,aAAa,iBAAiB,YACnC,kBAAkB,iBACf,OAAO,aAAa,YAAY,CAAC,CAAC,MAAM,IACxC,OAAO,aAAa,cAAc,CAAC,CAAC,MAAM,EAAA,CAC5C,KAAK,OAAO,UAAU,UAAU,MAAM,KAAK,CAAC,CAChD;AACF,CAAC,CACH;AAEA,MAAa,eAAe,OAAO,OAAO;CACxC,GAAG,wBAAwB;CAC3B,QAAQ;AACV,CAAC,CAAC,CAAC,KACD,OAAO,SAAS,OAAO,OAAO,uBAAuB,GAAG;CACtD,QAAQ,aAAa,WAClB,WAAW,IAAI,wBAAwB,QAAQ,EAAE,eAAe,KAAK,CAAC,CACzE;CACA,QAAQ,aAAa,WAAW,aAAa,QAAQ;AACvD,CAAC,CACH;;AAGA,MAAa,cAAc,OAAO,OAAO;CACvC,GAAG,eAAe;CAClB,SAAS,OAAO,cAAc,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,GAAG,CAAC;AAC3E,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ResumeFromTurnBoundary, A as AwaitHostSettlement, B as NoAction, D as AwaitApprovalDecision, E as ApplyUnknownResolutions, F as DeclaredPendingBatchEvidence, G as RecoveryDecision, H as OpenToolCallEvidence, I as DelegationAdmissionEvidence, J as ReleaseOrphanChildReservation, K as RecoveryEvidence, L as EnsureWaitingForChild, M as AwaitUnknownResolution, N as CompleteChildAdmission, O as AwaitChildAdmissionResolution, P as CompleteMaterialization, Q as RepairSubagentStartLink, R as FinalizeLedgerFromHistory, T as ApplyJoinAccounting, U as PendingApprovalEvidence, V as OpenDelegationCallEvidence, W as PropagateChildAbort, X as RepairJoinMarker, Y as RepairInputMarker, Z as RepairReadiness, at as SettleJoinedWithHost, et as ResumePendingToolBatch, it as SettleAborted, j as AwaitParentEstablishment, k as AwaitChildSettlement, nt as ResumeWaitingParent, ot as classifyRecovery, rt as RevertJoining, st as pendingApprovalForRecovery, tt as ResumeSuspended, w as ApplyInput, z as MarkUnknown } from "../Admin-
|
|
1
|
+
import { $ as ResumeFromTurnBoundary, A as AwaitHostSettlement, B as NoAction, D as AwaitApprovalDecision, E as ApplyUnknownResolutions, F as DeclaredPendingBatchEvidence, G as RecoveryDecision, H as OpenToolCallEvidence, I as DelegationAdmissionEvidence, J as ReleaseOrphanChildReservation, K as RecoveryEvidence, L as EnsureWaitingForChild, M as AwaitUnknownResolution, N as CompleteChildAdmission, O as AwaitChildAdmissionResolution, P as CompleteMaterialization, Q as RepairSubagentStartLink, R as FinalizeLedgerFromHistory, T as ApplyJoinAccounting, U as PendingApprovalEvidence, V as OpenDelegationCallEvidence, W as PropagateChildAbort, X as RepairJoinMarker, Y as RepairInputMarker, Z as RepairReadiness, at as SettleJoinedWithHost, et as ResumePendingToolBatch, it as SettleAborted, j as AwaitParentEstablishment, k as AwaitChildSettlement, nt as ResumeWaitingParent, ot as classifyRecovery, rt as RevertJoining, st as pendingApprovalForRecovery, tt as ResumeSuspended, w as ApplyInput, z as MarkUnknown } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
export { ApplyInput, ApplyJoinAccounting, ApplyUnknownResolutions, AwaitApprovalDecision, AwaitChildAdmissionResolution, AwaitChildSettlement, AwaitHostSettlement, AwaitParentEstablishment, AwaitUnknownResolution, CompleteChildAdmission, CompleteMaterialization, DeclaredPendingBatchEvidence, DelegationAdmissionEvidence, EnsureWaitingForChild, FinalizeLedgerFromHistory, MarkUnknown, NoAction, OpenDelegationCallEvidence, OpenToolCallEvidence, PendingApprovalEvidence, PropagateChildAbort, RecoveryDecision, RecoveryEvidence, ReleaseOrphanChildReservation, RepairInputMarker, RepairJoinMarker, RepairReadiness, RepairSubagentStartLink, ResumeFromTurnBoundary, ResumePendingToolBatch, ResumeSuspended, ResumeWaitingParent, RevertJoining, SettleAborted, SettleJoinedWithHost, classifyRecovery, pendingApprovalForRecovery };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { C as EvidenceReference, ot as RunContextRecorded, st as RunContinuation } from "../Records-BTnGRdcf.mjs";
|
|
2
|
-
import { ho as ProgressAppendRecord } from "../Admin-
|
|
3
|
-
import { S as resolveEvidence, _ as executionRunIds, a as canonicalRecordBytes, b as terminalUsageCharge, c as prepareProgressAppend, d as resolveExecutionEvidence, f as runEvidence, g as canonicalRunIds, h as verifyRunContinuations, l as readContinuation, m as validateSuffix, n as CurrentRunWriter, o as isOperationalRecord, p as validateProgressAppend, r as ProgressAppendReader, s as makeProgressWriter, t as CurrentRunSettlement, u as readRunEvidenceSnapshot, v as isPreContinuationFact, x as reference, y as isWorkHandoff } from "../RunContinuation-
|
|
2
|
+
import { ho as ProgressAppendRecord } from "../Admin-BX9ns28E.mjs";
|
|
3
|
+
import { S as resolveEvidence, _ as executionRunIds, a as canonicalRecordBytes, b as terminalUsageCharge, c as prepareProgressAppend, d as resolveExecutionEvidence, f as runEvidence, g as canonicalRunIds, h as verifyRunContinuations, l as readContinuation, m as validateSuffix, n as CurrentRunWriter, o as isOperationalRecord, p as validateProgressAppend, r as ProgressAppendReader, s as makeProgressWriter, t as CurrentRunSettlement, u as readRunEvidenceSnapshot, v as isPreContinuationFact, x as reference, y as isWorkHandoff } from "../RunContinuation-FHM7XPjq.mjs";
|
|
4
4
|
export { CurrentRunSettlement, CurrentRunWriter, EvidenceReference, ProgressAppendReader, type ProgressAppendRecord, RunContextRecorded, RunContinuation, canonicalRecordBytes, canonicalRunIds, executionRunIds, isOperationalRecord, isPreContinuationFact, isWorkHandoff, makeProgressWriter, prepareProgressAppend, readContinuation, readRunEvidenceSnapshot, reference, resolveEvidence, resolveExecutionEvidence, runEvidence, terminalUsageCharge, validateProgressAppend, validateSuffix, verifyRunContinuations };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { it as RunContinuation, rt as RunContextRecorded, x as EvidenceReference } from "../Records-BiuJDWNe.mjs";
|
|
2
|
-
import { _t as isPreContinuationFact, bt as terminalUsageCharge, gt as executionRunIds, ht as canonicalRunIds, yt as isWorkHandoff } from "../ThreadStore-
|
|
3
|
-
import { a as canonicalRecordBytes, b as reference, c as prepareProgressAppend, d as resolveExecutionEvidence, f as runEvidence, h as verifyRunContinuations, l as readContinuation, m as validateSuffix, n as CurrentRunWriter, o as isOperationalRecord, p as validateProgressAppend, r as ProgressAppendReader, s as makeProgressWriter, t as CurrentRunSettlement, u as readRunEvidenceSnapshot, x as resolveEvidence } from "../RunContinuation-
|
|
2
|
+
import { _t as isPreContinuationFact, bt as terminalUsageCharge, gt as executionRunIds, ht as canonicalRunIds, yt as isWorkHandoff } from "../ThreadStore-CEekRa80.mjs";
|
|
3
|
+
import { a as canonicalRecordBytes, b as reference, c as prepareProgressAppend, d as resolveExecutionEvidence, f as runEvidence, h as verifyRunContinuations, l as readContinuation, m as validateSuffix, n as CurrentRunWriter, o as isOperationalRecord, p as validateProgressAppend, r as ProgressAppendReader, s as makeProgressWriter, t as CurrentRunSettlement, u as readRunEvidenceSnapshot, x as resolveEvidence } from "../RunContinuation-DHYNAQFi.mjs";
|
|
4
4
|
export { CurrentRunSettlement, CurrentRunWriter, EvidenceReference, ProgressAppendReader, RunContextRecorded, RunContinuation, canonicalRecordBytes, canonicalRunIds, executionRunIds, isOperationalRecord, isPreContinuationFact, isWorkHandoff, makeProgressWriter, prepareProgressAppend, readContinuation, readRunEvidenceSnapshot, reference, resolveEvidence, resolveExecutionEvidence, runEvidence, terminalUsageCharge, validateProgressAppend, validateSuffix, verifyRunContinuations };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $o as subagentRequestedBatchId, Ao as childIdempotencyKeyFor, Bo as projectRunJournal, Co as RunJournalError, Cs as toolCallSettledRecordId, Do as TurnCommitInput, Fo as markUnknownBatchId, Go as runDurationRecordId, Ho as promptFromCanonicalRecords, Io as modelResponseInterruptedBatchId, Jo as runStartedRecordId, Ko as runIdForSubmission, Lo as modelResponseInterruptedRecordId, Mo as compactionBatchId, No as compactionRecordId, Oo as agentUpdateRecordId, Po as firstWorkerInputRecordId, Qo as subagentLineageRecordId, Ro as modelResponseRecordId, So as RunJournalContext, To as RunJournalUsage, Uo as runCompletedRecordId, Vo as projectRunJournalStream, Wo as runDurationBatchId, Xo as subagentJoinedRecordId, Yo as subagentJoinBatchId, Zo as subagentLineageBatchId, _s as turnResultsBatch, as as toolCallResolutionBatchId, bs as workerOriginRecordId, cs as toolCallUnknownRecordId, ds as turnApprovalsBatchId, es as subagentRequestedRecordId, fs as turnBatchId, gs as turnResponseBatchId, hs as turnResponseBatch, is as toolApprovalRequestRecordId, jo as childThreadIdFor, ko as approvalDecisionBatchId, ls as toolStepSettledBatchId, ms as turnIdForRun, ns as subagentStartedRecordId, os as toolCallResolvedRecordId, ps as turnCanonicalBatch, qo as runStartedBatchId, rs as toolApprovalDecisionRecordId, ss as toolCallResultBatchId, ts as subagentStartedBatchId, us as toolStepSettledRecordId, vs as turnResultsBatchId, wo as RunJournalProjection, xo as JournalBoundary, xs as workerReportRecordId, ys as workerInputRecordId, zo as peerMessageRecordId } from "../Admin-
|
|
1
|
+
import { $o as subagentRequestedBatchId, Ao as childIdempotencyKeyFor, Bo as projectRunJournal, Co as RunJournalError, Cs as toolCallSettledRecordId, Do as TurnCommitInput, Fo as markUnknownBatchId, Go as runDurationRecordId, Ho as promptFromCanonicalRecords, Io as modelResponseInterruptedBatchId, Jo as runStartedRecordId, Ko as runIdForSubmission, Lo as modelResponseInterruptedRecordId, Mo as compactionBatchId, No as compactionRecordId, Oo as agentUpdateRecordId, Po as firstWorkerInputRecordId, Qo as subagentLineageRecordId, Ro as modelResponseRecordId, So as RunJournalContext, To as RunJournalUsage, Uo as runCompletedRecordId, Vo as projectRunJournalStream, Wo as runDurationBatchId, Xo as subagentJoinedRecordId, Yo as subagentJoinBatchId, Zo as subagentLineageBatchId, _s as turnResultsBatch, as as toolCallResolutionBatchId, bs as workerOriginRecordId, cs as toolCallUnknownRecordId, ds as turnApprovalsBatchId, es as subagentRequestedRecordId, fs as turnBatchId, gs as turnResponseBatchId, hs as turnResponseBatch, is as toolApprovalRequestRecordId, jo as childThreadIdFor, ko as approvalDecisionBatchId, ls as toolStepSettledBatchId, ms as turnIdForRun, ns as subagentStartedRecordId, os as toolCallResolvedRecordId, ps as turnCanonicalBatch, qo as runStartedBatchId, rs as toolApprovalDecisionRecordId, ss as toolCallResultBatchId, ts as subagentStartedBatchId, us as toolStepSettledRecordId, vs as turnResultsBatchId, wo as RunJournalProjection, xo as JournalBoundary, xs as workerReportRecordId, ys as workerInputRecordId, zo as peerMessageRecordId } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
export { JournalBoundary, RunJournalContext, RunJournalError, RunJournalProjection, RunJournalUsage, TurnCommitInput, agentUpdateRecordId, approvalDecisionBatchId, childIdempotencyKeyFor, childThreadIdFor, compactionBatchId, compactionRecordId, firstWorkerInputRecordId, markUnknownBatchId, modelResponseInterruptedBatchId, modelResponseInterruptedRecordId, modelResponseRecordId, peerMessageRecordId, projectRunJournal, projectRunJournalStream, promptFromCanonicalRecords, runCompletedRecordId, runDurationBatchId, runDurationRecordId, runIdForSubmission, runStartedBatchId, runStartedRecordId, subagentJoinBatchId, subagentJoinedRecordId, subagentLineageBatchId, subagentLineageRecordId, subagentRequestedBatchId, subagentRequestedRecordId, subagentStartedBatchId, subagentStartedRecordId, toolApprovalDecisionRecordId, toolApprovalRequestRecordId, toolCallResolutionBatchId, toolCallResolvedRecordId, toolCallResultBatchId, toolCallSettledRecordId, toolCallUnknownRecordId, toolStepSettledBatchId, toolStepSettledRecordId, turnApprovalsBatchId, turnBatchId, turnCanonicalBatch, turnIdForRun, turnResponseBatch, turnResponseBatchId, turnResultsBatch, turnResultsBatchId, workerInputRecordId, workerOriginRecordId, workerReportRecordId };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Fr as RunStorageSession, Ir as RunWriter, Lr as layer, Mr as RunChildBudgetReservation, Nr as RunOwnership, Pr as RunStorage, Rr as make, _o as OwnerGeneration, bo as makeStorageOwner, go as MutationGate, jr as RunChildAttachment, vo as StorageOwner, yo as StorageOwnerService, zr as makeRunWriter } from "../Admin-
|
|
1
|
+
import { Fr as RunStorageSession, Ir as RunWriter, Lr as layer, Mr as RunChildBudgetReservation, Nr as RunOwnership, Pr as RunStorage, Rr as make, _o as OwnerGeneration, bo as makeStorageOwner, go as MutationGate, jr as RunChildAttachment, vo as StorageOwner, yo as StorageOwnerService, zr as makeRunWriter } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
export { type MutationGate, type OwnerGeneration, RunChildAttachment, RunChildBudgetReservation, RunOwnership, RunStorage, RunStorageSession, RunWriter, StorageOwner, type StorageOwnerService, layer, make, makeRunWriter, makeStorageOwner };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as make, c as makeStorageOwner, i as layer, n as RunChildBudgetReservation, o as makeRunWriter, r as RunStorage, s as StorageOwner, t as RunChildAttachment } from "../RunStorage-
|
|
1
|
+
import { a as make, c as makeStorageOwner, i as layer, n as RunChildBudgetReservation, o as makeRunWriter, r as RunStorage, s as StorageOwner, t as RunChildAttachment } from "../RunStorage-uqPxps09.mjs";
|
|
2
2
|
export { RunChildAttachment, RunChildBudgetReservation, RunStorage, StorageOwner, layer, make, makeRunWriter, makeStorageOwner };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BkM21Qiu.mjs";
|
|
2
2
|
import { b as DefinitionDigests } from "../Records-BTnGRdcf.mjs";
|
|
3
|
-
import { cr as DurableSubmitAgent, pt as AdmissionFence } from "../Admin-
|
|
3
|
+
import { cr as DurableSubmitAgent, pt as AdmissionFence } from "../Admin-BX9ns28E.mjs";
|
|
4
4
|
import { A as ScheduleSnapshotPage, B as ScheduledInputAdmission, C as ScheduleRecord, D as ScheduleScope, F as ScheduleTimingRequest, I as ScheduleValidationError, L as ScheduleWake, M as ScheduleStore, N as ScheduleStoreFailure, W as SchedulingLimits, c as ScheduleDestination, f as ScheduleId, j as ScheduleStorageError, k as ScheduleSnapshot, m as ScheduleKey, n as ScheduleAuthorizationError, r as ScheduleAuthorizer, y as ScheduleOwner } from "../Schedule-CDgTz0vj.mjs";
|
|
5
5
|
import { Context, Crypto, Effect, Layer, Schema } from "effect";
|
|
6
6
|
declare namespace Scheduling_d_exports {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Br as SettlementPublication, Gr as validateCanonicalSettlement, Hr as SettlementPublicationFailure, Kr as validateJoinedSettlement, Ur as SettlementPublicationResult, Vr as SettlementPublicationAuthority, Wr as SettlementPublisher, qr as validatePublication } from "../Admin-
|
|
1
|
+
import { Br as SettlementPublication, Gr as validateCanonicalSettlement, Hr as SettlementPublicationFailure, Kr as validateJoinedSettlement, Ur as SettlementPublicationResult, Vr as SettlementPublicationAuthority, Wr as SettlementPublisher, qr as validatePublication } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
export { SettlementPublication, SettlementPublicationAuthority, SettlementPublicationFailure, SettlementPublicationResult, SettlementPublisher, validateCanonicalSettlement, validateJoinedSettlement, validatePublication };
|
|
@@ -2,7 +2,7 @@ import { SubmissionId } from "../core/Identifiers.mjs";
|
|
|
2
2
|
import { X as RecordEnvelope, f as CanonicalSequence, gt as SubmissionSettled } from "../Records-BiuJDWNe.mjs";
|
|
3
3
|
import { LedgerError, submissionSettlementBatchId, submissionSettlementId, submissionSettlementRecordId } from "./SubmissionLedger.mjs";
|
|
4
4
|
import { x as runIdForSubmission } from "../RunJournal-kfKVxJj7.mjs";
|
|
5
|
-
import { h as PreparedAppend, n as AppendRequest } from "../ThreadStore-
|
|
5
|
+
import { h as PreparedAppend, n as AppendRequest } from "../ThreadStore-CEekRa80.mjs";
|
|
6
6
|
import { Context, Effect, Schema } from "effect";
|
|
7
7
|
//#region src/durable/SettlementPublisher.ts
|
|
8
8
|
/** Authority rechecked atomically on every publication attempt, including canonical replay. */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { i as QueueSequence, n as JoinedToHost, r as Principal, t as IdempotencyKey } from "../Receipt-BkM21Qiu.mjs";
|
|
2
|
-
import { $t as RecoverySnapshotRequest, An as WaitingChild, At as ChildReservationConflict, Bn as submissionSettlementBatchId, Bt as FundingOwnerRequest, Cn as SuspensionReason, Ct as ApprovalDecisionIntent, Dn as UnknownResolutionConflict, Dt as ChildAttachmentSnapshot, En as UnknownResolutionCommand, Et as BeginChildBudgetReleaseRequest, Fn as settlementFailureFromRecord, Ft as Claim, Gn as workerTerminalFromRecord, Gt as LedgerError, Hn as submissionSettlementRecordId, Ht as JoinSnapshot, In as submissionAbortBatchId, It as ClaimHandoff, Jt as MarkReadyRequest, Kt as MarkInputAppliedRequest, Ln as submissionAbortRecordId, Lt as ClaimJoiningRequest, Mn as WorkerLedgerState, Mt as ChildReservationStatus, Nn as WorkerStopCommand, Nt as ChildSettledNotification, On as UnknownResolutionIntent, Ot as ChildBudgetReservationRequest, Pn as approvalDecisionsCover, Pt as ChildSettledOutcome, Qt as RecoverySnapshot, Rn as submissionInputBatchId, Rt as ClaimRequest, Sn as SuspensionOutcome, St as ApprovalDecisionCommand, Tn as UnknownResolution, Tt as AttachChildToReservationRequest, Un as unknownResolutionKind, Ut as JoiningClaim, Vn as submissionSettlementId, Vt as InputAppliedMarker, Wn as unknownResolutionMatchesResult, Wt as LedgerCapabilities, Xt as OwnershipLost, Yt as MarkUnknownRequest, Zt as ParentLinkage, _n as SubmissionScheduling, _t as AdmissionPolicyError, an as ResolutionSafeToRetry, bn as SubmissionWorkItem, bt as AdmissionResult, cn as SettlementConflict, ct as AbortCommand, dn as SubmissionLedger, dt as AdmissionAdmitted, en as ReleaseChildBudgetRequest, fn as SubmissionLedgerFailure, ft as AdmissionConflict, gn as SubmissionLookupByKey, gt as AdmissionNotAdmitted, hn as SubmissionLookupById, ht as AdmissionIndeterminate, in as ResolutionNeverHappened, jn as WaitingForChildSuspension, jt as ChildReservationId, kn as UnknownResolutionKind, kt as ChildBudgetReservationSnapshot, ln as SettlementFinalization, lt as AbortIntent, mn as SubmissionLookup, mt as AdmissionGroup, nn as ResolutionAbortSubmission, on as RevertJoiningRequest, pt as AdmissionFence, qt as MarkJoinedRequest, rn as ResolutionCompletedWithResult, sn as Settlement, tn as ReservedChildBudget, un as SubmissionAdmissionFence, ut as AbortIntentRequest, vn as SubmissionSnapshot, vt as AdmissionRequest, wn as SuspensionSnapshot, wt as ApprovalPendingSuspension, xn as SuspendRequest, xt as ApprovalConflict, yn as SubmissionState, yt as AdmissionResolution, zn as submissionInputRecordId, zt as FundingOwner } from "../Admin-
|
|
2
|
+
import { $t as RecoverySnapshotRequest, An as WaitingChild, At as ChildReservationConflict, Bn as submissionSettlementBatchId, Bt as FundingOwnerRequest, Cn as SuspensionReason, Ct as ApprovalDecisionIntent, Dn as UnknownResolutionConflict, Dt as ChildAttachmentSnapshot, En as UnknownResolutionCommand, Et as BeginChildBudgetReleaseRequest, Fn as settlementFailureFromRecord, Ft as Claim, Gn as workerTerminalFromRecord, Gt as LedgerError, Hn as submissionSettlementRecordId, Ht as JoinSnapshot, In as submissionAbortBatchId, It as ClaimHandoff, Jt as MarkReadyRequest, Kt as MarkInputAppliedRequest, Ln as submissionAbortRecordId, Lt as ClaimJoiningRequest, Mn as WorkerLedgerState, Mt as ChildReservationStatus, Nn as WorkerStopCommand, Nt as ChildSettledNotification, On as UnknownResolutionIntent, Ot as ChildBudgetReservationRequest, Pn as approvalDecisionsCover, Pt as ChildSettledOutcome, Qt as RecoverySnapshot, Rn as submissionInputBatchId, Rt as ClaimRequest, Sn as SuspensionOutcome, St as ApprovalDecisionCommand, Tn as UnknownResolution, Tt as AttachChildToReservationRequest, Un as unknownResolutionKind, Ut as JoiningClaim, Vn as submissionSettlementId, Vt as InputAppliedMarker, Wn as unknownResolutionMatchesResult, Wt as LedgerCapabilities, Xt as OwnershipLost, Yt as MarkUnknownRequest, Zt as ParentLinkage, _n as SubmissionScheduling, _t as AdmissionPolicyError, an as ResolutionSafeToRetry, bn as SubmissionWorkItem, bt as AdmissionResult, cn as SettlementConflict, ct as AbortCommand, dn as SubmissionLedger, dt as AdmissionAdmitted, en as ReleaseChildBudgetRequest, fn as SubmissionLedgerFailure, ft as AdmissionConflict, gn as SubmissionLookupByKey, gt as AdmissionNotAdmitted, hn as SubmissionLookupById, ht as AdmissionIndeterminate, in as ResolutionNeverHappened, jn as WaitingForChildSuspension, jt as ChildReservationId, kn as UnknownResolutionKind, kt as ChildBudgetReservationSnapshot, ln as SettlementFinalization, lt as AbortIntent, mn as SubmissionLookup, mt as AdmissionGroup, nn as ResolutionAbortSubmission, on as RevertJoiningRequest, pt as AdmissionFence, qt as MarkJoinedRequest, rn as ResolutionCompletedWithResult, sn as Settlement, tn as ReservedChildBudget, un as SubmissionAdmissionFence, ut as AbortIntentRequest, vn as SubmissionSnapshot, vt as AdmissionRequest, wn as SuspensionSnapshot, wt as ApprovalPendingSuspension, xn as SuspendRequest, xt as ApprovalConflict, yn as SubmissionState, yt as AdmissionResolution, zn as submissionInputRecordId, zt as FundingOwner } from "../Admin-BX9ns28E.mjs";
|
|
3
3
|
export { AbortCommand, AbortIntent, AbortIntentRequest, AdmissionAdmitted, AdmissionConflict, AdmissionFence, AdmissionGroup, AdmissionIndeterminate, AdmissionNotAdmitted, AdmissionPolicyError, AdmissionRequest, AdmissionResolution, AdmissionResult, ApprovalConflict, ApprovalDecisionCommand, ApprovalDecisionIntent, ApprovalPendingSuspension, AttachChildToReservationRequest, BeginChildBudgetReleaseRequest, ChildAttachmentSnapshot, ChildBudgetReservationRequest, ChildBudgetReservationSnapshot, ChildReservationConflict, ChildReservationId, ChildReservationStatus, ChildSettledNotification, ChildSettledOutcome, Claim, ClaimHandoff, ClaimJoiningRequest, ClaimRequest, FundingOwner, FundingOwnerRequest, IdempotencyKey, InputAppliedMarker, JoinSnapshot, JoinedToHost, JoiningClaim, LedgerCapabilities, LedgerError, MarkInputAppliedRequest, MarkJoinedRequest, MarkReadyRequest, MarkUnknownRequest, OwnershipLost, ParentLinkage, Principal, QueueSequence, RecoverySnapshot, RecoverySnapshotRequest, ReleaseChildBudgetRequest, ReservedChildBudget, ResolutionAbortSubmission, ResolutionCompletedWithResult, ResolutionNeverHappened, ResolutionSafeToRetry, RevertJoiningRequest, Settlement, SettlementConflict, SettlementFinalization, SubmissionAdmissionFence, SubmissionLedger, SubmissionLedgerFailure, SubmissionLookup, SubmissionLookupById, SubmissionLookupByKey, SubmissionScheduling, SubmissionSnapshot, SubmissionState, SubmissionWorkItem, SuspendRequest, SuspensionOutcome, SuspensionReason, SuspensionSnapshot, UnknownResolution, UnknownResolutionCommand, UnknownResolutionConflict, UnknownResolutionIntent, UnknownResolutionKind, WaitingChild, WaitingForChildSuspension, WorkerLedgerState, WorkerStopCommand, approvalDecisionsCover, settlementFailureFromRecord, submissionAbortBatchId, submissionAbortRecordId, submissionInputBatchId, submissionInputRecordId, submissionSettlementBatchId, submissionSettlementId, submissionSettlementRecordId, unknownResolutionKind, unknownResolutionMatchesResult, workerTerminalFromRecord };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as DigestError } from "../Digest-DjUgS5PG.mjs";
|
|
2
|
-
import { Hr as SettlementPublicationFailure, Ui as ThreadStore, Wr as SettlementPublisher, dn as SubmissionLedger, fn as SubmissionLedgerFailure, vo as StorageOwner } from "../Admin-
|
|
2
|
+
import { Hr as SettlementPublicationFailure, Ui as ThreadStore, Wr as SettlementPublisher, dn as SubmissionLedger, fn as SubmissionLedgerFailure, vo as StorageOwner } from "../Admin-BX9ns28E.mjs";
|
|
3
3
|
import { Crypto, Effect, Schema } from "effect";
|
|
4
4
|
//#region src/durable/SubmissionLedgerConformance.d.ts
|
|
5
5
|
declare const SubmissionLedgerConformanceViolation_base: Schema.Class<SubmissionLedgerConformanceViolation, Schema.TaggedStruct<"SubmissionLedgerConformanceViolation", {
|
|
@@ -8,8 +8,8 @@ import { U as PersistedJson, W as ProducerId, X as RecordEnvelope, _t as Submiss
|
|
|
8
8
|
import { s as digestJson } from "../Digest-DCuPlhNk.mjs";
|
|
9
9
|
import { AbortCommand, AbortIntentRequest, AdmissionConflict, AdmissionPolicyError, AdmissionRequest, ApprovalConflict, ApprovalDecisionCommand, ApprovalPendingSuspension, BeginChildBudgetReleaseRequest, ChildBudgetReservationRequest, ChildReservationConflict, ChildReservationId, ChildSettledNotification, ClaimHandoff, ClaimRequest, LedgerError, MarkInputAppliedRequest, MarkJoinedRequest, MarkReadyRequest, MarkUnknownRequest, OwnershipLost, ParentLinkage, RecoverySnapshotRequest, ReleaseChildBudgetRequest, ResolutionCompletedWithResult, ResolutionNeverHappened, ResolutionSafeToRetry, RevertJoiningRequest, Settlement, SettlementConflict, SettlementFinalization, SubmissionLedger, SubmissionLookupById, SubmissionLookupByKey, SuspendRequest, UnknownResolutionCommand, UnknownResolutionConflict, WaitingChild, WaitingForChildSuspension, submissionInputRecordId, submissionSettlementBatchId, submissionSettlementId, submissionSettlementRecordId } from "./SubmissionLedger.mjs";
|
|
10
10
|
import { x as runIdForSubmission } from "../RunJournal-kfKVxJj7.mjs";
|
|
11
|
-
import { $ as ThreadTailRequest, I as ThreadMaterialization, J as ThreadStore, U as ThreadReader, n as AppendRequest, ot as getRecord } from "../ThreadStore-
|
|
12
|
-
import { a as make } from "../RunStorage-
|
|
11
|
+
import { $ as ThreadTailRequest, I as ThreadMaterialization, J as ThreadStore, U as ThreadReader, n as AppendRequest, ot as getRecord } from "../ThreadStore-CEekRa80.mjs";
|
|
12
|
+
import { a as make } from "../RunStorage-uqPxps09.mjs";
|
|
13
13
|
import { SettlementPublication, SettlementPublisher } from "./SettlementPublisher.mjs";
|
|
14
14
|
import { DateTime, Duration, Effect, Exit, Option, Result, Schema, Scope, Stream } from "effect";
|
|
15
15
|
import { TestClock } from "effect/testing";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Dr as PendingSubmission, Or as SettledSubmission, kr as SubmissionStatus } from "../Admin-
|
|
1
|
+
import { Dr as PendingSubmission, Or as SettledSubmission, kr as SubmissionStatus } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
export { PendingSubmission, SettledSubmission, SubmissionStatus };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as defaultSubscriptionLimits, C as SubscriptionScanCursors, D as SubscriptionStore, E as SubscriptionSourceError, M as subscriptionKeyString, O as SubscriptionStoreFailure, S as SubscriptionRetentionPolicy, T as SubscriptionSnapshot, _ as SubscriptionKey, a as PreparedInput, b as SubscriptionRecord, c as SubscriptionAuthorizer, d as SubscriptionDelivery, f as SubscriptionDeliveryKey, g as SubscriptionFailpointError, h as SubscriptionFailpoint, i as EventSourceVersion, j as subscriptionDeliveryKeyString, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, s as SourceRecovery, t as AcceptedEvent, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope, x as SubscriptionRefusal, y as SubscriptionName } from "../Subscription-
|
|
1
|
+
import { A as defaultSubscriptionLimits, C as SubscriptionScanCursors, D as SubscriptionStore, E as SubscriptionSourceError, M as subscriptionKeyString, O as SubscriptionStoreFailure, S as SubscriptionRetentionPolicy, T as SubscriptionSnapshot, _ as SubscriptionKey, a as PreparedInput, b as SubscriptionRecord, c as SubscriptionAuthorizer, d as SubscriptionDelivery, f as SubscriptionDeliveryKey, g as SubscriptionFailpointError, h as SubscriptionFailpoint, i as EventSourceVersion, j as subscriptionDeliveryKeyString, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, s as SourceRecovery, t as AcceptedEvent, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope, x as SubscriptionRefusal, y as SubscriptionName } from "../Subscription-DONig54Q.mjs";
|
|
2
2
|
export { AcceptedEvent, DeliveryChange, EventAcknowledgement, EventSourceVersion, PreparedInput, SourcePartition, SourceRecovery, SubscriptionAuthorizer, SubscriptionChange, SubscriptionConfiguration, SubscriptionDelivery, SubscriptionDeliveryKey, SubscriptionDeliverySnapshot, SubscriptionError, SubscriptionFailpoint, SubscriptionFailpointError, SubscriptionKey, SubscriptionLimits, SubscriptionName, SubscriptionRecord, SubscriptionRefusal, SubscriptionRetentionPolicy, SubscriptionScanCursors, SubscriptionScope, SubscriptionSnapshot, SubscriptionSourceError, SubscriptionStore, SubscriptionStoreFailure, defaultSubscriptionLimits, subscriptionDeliveryKeyString, subscriptionKeyString };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveSubscriptionInput, i as makeSubscriptionInputBinding, n as SubscriptionInputBindings, t as SubscriptionInputBinding } from "../SubscriptionInput-
|
|
1
|
+
import { a as resolveSubscriptionInput, i as makeSubscriptionInputBinding, n as SubscriptionInputBindings, t as SubscriptionInputBinding } from "../SubscriptionInput-mJIRxWJM.mjs";
|
|
2
2
|
export { SubscriptionInputBinding, SubscriptionInputBindings, makeSubscriptionInputBinding, resolveSubscriptionInput };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as SubscriptionStore, O as SubscriptionStoreFailure, o as SourcePartition } from "../Subscription-
|
|
1
|
+
import { D as SubscriptionStore, O as SubscriptionStoreFailure, o as SourcePartition } from "../Subscription-DONig54Q.mjs";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
3
|
//#region src/durable/SubscriptionStoreConformance.d.ts
|
|
4
4
|
declare const SubscriptionStoreConformanceViolation_base: Schema.Class<SubscriptionStoreConformanceViolation, Schema.TaggedStruct<"SubscriptionStoreConformanceViolation", {
|
|
@@ -2,9 +2,9 @@ import { t as AgentId, u as ThreadId } from "../Identifiers-CN2s30fF.mjs";
|
|
|
2
2
|
import { r as Principal } from "../Receipt-BkM21Qiu.mjs";
|
|
3
3
|
import { t as DurableStep } from "../DurableStep-DXGn7KQ4.mjs";
|
|
4
4
|
import { b as DefinitionDigests } from "../Records-BTnGRdcf.mjs";
|
|
5
|
-
import "../Admin-
|
|
5
|
+
import "../Admin-BX9ns28E.mjs";
|
|
6
6
|
import { c as ScheduleDestination } from "../Schedule-CDgTz0vj.mjs";
|
|
7
|
-
import { E as SubscriptionSourceError, g as SubscriptionFailpointError, i as EventSourceVersion, m as SubscriptionError, w as SubscriptionScope } from "../Subscription-
|
|
7
|
+
import { E as SubscriptionSourceError, g as SubscriptionFailpointError, i as EventSourceVersion, m as SubscriptionError, w as SubscriptionScope } from "../Subscription-DONig54Q.mjs";
|
|
8
8
|
import { Subscriptions } from "./Subscriptions.mjs";
|
|
9
9
|
import { Crypto, Layer, Schema } from "effect";
|
|
10
10
|
import { Tool, Toolkit } from "effect/ai";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as SubscriptionRecord, d as SubscriptionDelivery, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, t as AcceptedEvent, v as SubscriptionLimits } from "../Subscription-
|
|
1
|
+
import { b as SubscriptionRecord, d as SubscriptionDelivery, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, t as AcceptedEvent, v as SubscriptionLimits } from "../Subscription-DONig54Q.mjs";
|
|
2
2
|
import { Result } from "effect";
|
|
3
3
|
declare namespace SubscriptionTransition_d_exports {
|
|
4
4
|
export { applySubscriptionChange, applySubscriptionDeliveryChange, sameAcceptedEventIdentity, sameSourcePartition, sameSubscriptionDelivery, subscriptionCanSelect, subscriptionDeliveryCanSelect, subscriptionDeliveryUsesCapacity, subscriptionMatchesEvent, subscriptionUsesCapacity, validateEventRetention };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as Principal } from "../Receipt-BkM21Qiu.mjs";
|
|
2
2
|
import { K as PersistedJson } from "../Records-BTnGRdcf.mjs";
|
|
3
|
-
import { pt as AdmissionFence } from "../Admin-
|
|
4
|
-
import { D as SubscriptionStore, E as SubscriptionSourceError, O as SubscriptionStoreFailure, T as SubscriptionSnapshot, _ as SubscriptionKey, c as SubscriptionAuthorizer, f as SubscriptionDeliveryKey, i as EventSourceVersion, m as SubscriptionError, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope } from "../Subscription-
|
|
5
|
-
import { r as EventSources } from "../EventSource-
|
|
6
|
-
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-
|
|
7
|
-
import { n as SubscriptionInputBindings } from "../SubscriptionInput-
|
|
3
|
+
import { pt as AdmissionFence } from "../Admin-BX9ns28E.mjs";
|
|
4
|
+
import { D as SubscriptionStore, E as SubscriptionSourceError, O as SubscriptionStoreFailure, T as SubscriptionSnapshot, _ as SubscriptionKey, c as SubscriptionAuthorizer, f as SubscriptionDeliveryKey, i as EventSourceVersion, m as SubscriptionError, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope } from "../Subscription-DONig54Q.mjs";
|
|
5
|
+
import { r as EventSources } from "../EventSource-BwliwQz9.mjs";
|
|
6
|
+
import { t as PreparedInputAdmission } from "../PreparedInputAdmission-CxSJSiTl.mjs";
|
|
7
|
+
import { n as SubscriptionInputBindings } from "../SubscriptionInput-mJIRxWJM.mjs";
|
|
8
8
|
import { Context, Crypto, Effect, Layer } from "effect";
|
|
9
9
|
declare namespace Subscriptions_d_exports {
|
|
10
10
|
export { SubscribeOptions, SubscriptionDriver, SubscriptionFailure, SubscriptionIntake, Subscriptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $a as ThreadArchiveRangeRequest, Ga as MAX_ARCHIVE_RANGE_BYTES, Ja as MAX_CANONICAL_BATCH_BYTES, Ka as MAX_ARCHIVE_RANGE_PAGE, Qa as ThreadArchiveRangeRead, Xa as ThreadArchiveRangePage, Ya as ThreadArchiveRange, Za as ThreadArchiveRangePublish, eo as ThreadArchiveRangeSeal, no as ThreadArchiveStorage, qa as MAX_ARCHIVE_RANGE_RECORDS } from "../Admin-
|
|
1
|
+
import { $a as ThreadArchiveRangeRequest, Ga as MAX_ARCHIVE_RANGE_BYTES, Ja as MAX_CANONICAL_BATCH_BYTES, Ka as MAX_ARCHIVE_RANGE_PAGE, Qa as ThreadArchiveRangeRead, Xa as ThreadArchiveRangePage, Ya as ThreadArchiveRange, Za as ThreadArchiveRangePublish, eo as ThreadArchiveRangeSeal, no as ThreadArchiveStorage, qa as MAX_ARCHIVE_RANGE_RECORDS } from "../Admin-BX9ns28E.mjs";
|
|
2
2
|
export { MAX_ARCHIVE_RANGE_BYTES, MAX_ARCHIVE_RANGE_PAGE, MAX_ARCHIVE_RANGE_RECORDS, MAX_CANONICAL_BATCH_BYTES, ThreadArchiveRange, ThreadArchiveRangePage, ThreadArchiveRangePublish, ThreadArchiveRangeRead, ThreadArchiveRangeRequest, ThreadArchiveRangeSeal, ThreadArchiveStorage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ContextHistory, ContextHistoryError } from "../engine/ContextHistory.mjs";
|
|
2
|
-
import { Ui as ThreadStore } from "../Admin-
|
|
2
|
+
import { Ui as ThreadStore } from "../Admin-BX9ns28E.mjs";
|
|
3
3
|
import { Layer, Schema } from "effect";
|
|
4
4
|
declare namespace ThreadContextHistory_d_exports {
|
|
5
5
|
export { ThreadContextHistoryOptions, layer };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { ContextHistory, ContextHistoryError, ContextHistoryHit, ContextHistoryPage, ContextHistoryRead, ContextHistorySearch } from "../engine/ContextHistory.mjs";
|
|
3
3
|
import { Z as RecordId, f as CanonicalSequence, u as CanonicalRecordEnvelope } from "../Records-BiuJDWNe.mjs";
|
|
4
|
-
import { $ as ThreadTailRequest, J as ThreadStore, Q as ThreadTail, V as ThreadRead, b as SelectedThreadRead } from "../ThreadStore-
|
|
4
|
+
import { $ as ThreadTailRequest, J as ThreadStore, Q as ThreadTail, V as ThreadRead, b as SelectedThreadRead } from "../ThreadStore-CEekRa80.mjs";
|
|
5
5
|
import { matchText, normalizeQuery, project, windowIdFor } from "./ThreadContextHistoryProjection.mjs";
|
|
6
6
|
import { Effect, Layer, Schema, Stream } from "effect";
|
|
7
7
|
//#region src/durable/ThreadContextHistory.ts
|