ignotum 0.0.16 → 0.0.18
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/README.md +6 -6
- package/dist/cli/bin.mjs +13263 -2689
- package/dist/cli/bin.mjs.map +1 -1
- package/dist/platform/_headers +3 -0
- package/dist/platform/_ignotum/v1.0/client.js +12 -0
- package/dist/runtime/{api-B4fwp5a2.d.ts → api-BnUKx9cj-D49Tf0rX.d.ts} +4 -3
- package/dist/runtime/api-C-tltz6s.js +31 -0
- package/dist/runtime/api-C-tltz6s.js.map +1 -0
- package/dist/runtime/artifact-BB5qzoa6.js +42 -0
- package/dist/runtime/artifact-BB5qzoa6.js.map +1 -0
- package/dist/runtime/{bootstrap-BTFScKAc.d.ts → bootstrap-DjTwGJao-DBx5zdFI.d.ts} +64 -64
- package/dist/runtime/{bootstrap-BISQSn_O.js → bootstrap-DlNIfH-r.js} +9 -9
- package/dist/runtime/bootstrap-DlNIfH-r.js.map +1 -0
- package/dist/runtime/client.d.ts +24 -20
- package/dist/runtime/client.js +9 -9
- package/dist/runtime/client.js.map +1 -1
- package/dist/runtime/id-BI08JkmR.d.ts +1 -0
- package/dist/runtime/{id--1m0NuUL.js → id-BrEnxY-r.js} +118 -53
- package/dist/runtime/id-BrEnxY-r.js.map +1 -0
- package/dist/runtime/{image-Djtjy4Z8.js → image-gofzZeCm.js} +2 -2
- package/dist/runtime/image-gofzZeCm.js.map +1 -0
- package/dist/runtime/{index-D4seNHlX.d.ts → index-Biaw5vdF.d.ts} +2 -2
- package/dist/runtime/internal/api.d.ts +1 -1
- package/dist/runtime/internal/api.js +1 -30
- package/dist/runtime/internal/bootstrap.d.ts +1 -1
- package/dist/runtime/internal/bootstrap.js +1 -1
- package/dist/runtime/internal/client.d.ts +2 -2
- package/dist/runtime/internal/client.js +4 -4
- package/dist/runtime/internal/client.js.map +1 -1
- package/dist/runtime/internal/host.d.ts +4 -4
- package/dist/runtime/internal/host.js +4 -4
- package/dist/runtime/internal/routes.d.ts +1 -1
- package/dist/runtime/internal/routes.js +1 -1
- package/dist/runtime/internal/server.d.ts +3 -2
- package/dist/runtime/internal/server.js +2 -2
- package/dist/runtime/internal/server.js.map +1 -1
- package/dist/runtime/internal/types.d.ts +2 -2
- package/dist/runtime/internal/types.js +1 -1
- package/dist/runtime/{pagination-D3qd6s9N.js → pagination--f4kMKf6.js} +2 -2
- package/dist/runtime/{pagination-D3qd6s9N.js.map → pagination--f4kMKf6.js.map} +1 -1
- package/dist/runtime/pagination-BI08JkmR.d.ts +1 -0
- package/dist/runtime/{router-BSBI1oN1.js → router-C1eC9yy5.js} +462 -419
- package/dist/runtime/router-C1eC9yy5.js.map +1 -0
- package/dist/runtime/routes-DnU39R7c.js +152 -0
- package/dist/runtime/routes-DnU39R7c.js.map +1 -0
- package/dist/runtime/{schema-D1wOqiNH.js → schema-BSjepoNF.js} +271 -6
- package/dist/runtime/schema-BSjepoNF.js.map +1 -0
- package/dist/runtime/server.d.ts +5 -4
- package/dist/runtime/server.js +3 -3
- package/dist/runtime/server.js.map +1 -1
- package/dist/runtime/{sync-DzUwA8W9.js → sync-BwgS19Xy.js} +4 -16
- package/dist/runtime/sync-BwgS19Xy.js.map +1 -0
- package/dist/runtime/{sync-D-GK2sv9.d.ts → sync-By2hX5ev.d.ts} +1 -2
- package/dist/runtime/{types-DeCCyqLU-BIm7rU-0.d.ts → types-DeCCyqLU-CHx7KFtx.d.ts} +2 -2
- package/package.json +7 -1
- package/src/cli/agent-files.ts +2 -0
- package/src/cli/build/asset-names.ts +190 -0
- package/src/cli/build/managed-client.ts +151 -81
- package/src/cli/build/managed-server.ts +4 -4
- package/src/cli/build/managed.ts +5 -6
- package/src/cli/command.ts +7 -15
- package/src/cli/control-client.ts +7 -9
- package/src/cli/deploy.ts +45 -15
- package/src/cli/dev.ts +50 -99
- package/src/cli/image-assets.ts +5 -2
- package/src/cli/managed-client-boundaries.ts +6 -6
- package/src/cli/managed-dev-platform.ts +52 -66
- package/src/cli/managed-exports.ts +5 -66
- package/src/cli/new-app.ts +7 -2
- package/src/cli/path.ts +11 -0
- package/src/cli/route-codegen.ts +2 -1
- package/src/cli/route-static.ts +3 -2
- package/src/cli/upload-journal.ts +130 -0
- package/src/client/bootstrap.ts +1 -110
- package/src/client/errors.ts +1 -70
- package/src/client/files.ts +1 -233
- package/src/client/hooks.ts +1 -367
- package/src/client/id.ts +1 -263
- package/src/client/image.ts +1 -28
- package/src/client/index.ts +1 -126
- package/src/client/jsx-dev-runtime.ts +1 -2
- package/src/client/jsx-runtime.ts +1 -2
- package/src/client/managed-client.ts +1 -729
- package/src/client/managed-upgrade.ts +1 -283
- package/src/client/page-observers.ts +1 -77
- package/src/client/query.ts +1 -17
- package/src/client/recovery-journal.ts +1 -195
- package/src/client/route-boundaries.ts +1 -184
- package/src/client/router-history.ts +1 -152
- package/src/client/router-store.ts +1 -644
- package/src/client/router.ts +1 -324
- package/src/client/routes.ts +1 -28
- package/src/client/sync.ts +1 -286
- package/src/dev-runtime/id.ts +1 -1
- package/src/dev-runtime/managed-functions.ts +10 -18
- package/src/dev-runtime/managed-sync.ts +16 -16
- package/src/dev-runtime/sync.ts +6 -4
- package/src/internal/api.ts +1 -156
- package/src/internal/client.ts +1 -186
- package/src/internal/host.ts +1 -1
- package/src/internal/http-paths.ts +1 -4
- package/src/internal/routes.ts +1 -45
- package/src/internal/server.ts +1 -3
- package/src/internal/types.ts +1 -2
- package/src/server/index.ts +1 -27
- package/dist/cli/managed-release-WHYLZwaS.mjs +0 -10902
- package/dist/cli/managed-release-WHYLZwaS.mjs.map +0 -1
- package/dist/cli/managed-release.d.mts +0 -1
- package/dist/cli/managed-release.mjs +0 -14
- package/dist/cli/managed-release.mjs.map +0 -1
- package/dist/runtime/bootstrap-BISQSn_O.js.map +0 -1
- package/dist/runtime/descriptor-CTY4mtwS-cS43EbwS.js +0 -269
- package/dist/runtime/descriptor-CTY4mtwS-cS43EbwS.js.map +0 -1
- package/dist/runtime/id--1m0NuUL.js.map +0 -1
- package/dist/runtime/id-CBOt2kDo.d.ts +0 -1
- package/dist/runtime/identity-QjtJRxBD.d.ts +0 -2
- package/dist/runtime/image-Djtjy4Z8.js.map +0 -1
- package/dist/runtime/internal/api.js.map +0 -1
- package/dist/runtime/pagination-CBOt2kDo.d.ts +0 -1
- package/dist/runtime/router-BSBI1oN1.js.map +0 -1
- package/dist/runtime/routes-Ce8TVP-T.js +0 -690
- package/dist/runtime/routes-Ce8TVP-T.js.map +0 -1
- package/dist/runtime/schema-D1wOqiNH.js.map +0 -1
- package/dist/runtime/sync-DzUwA8W9.js.map +0 -1
- package/src/cli/managed-release-bin.ts +0 -13
- package/src/cli/managed-release.ts +0 -260
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routes-Ce8TVP-T.js","names":["strict"],"sources":["../../../contracts/dist/runtime/functions.js","../../../contracts/dist/version.js","../../../contracts/dist/platform.js","../../../contracts/dist/app-definition.js","../../src/internal/routes.ts"],"sourcesContent":["import { FunctionAddress } from \"./sync.js\";\nimport { Schema } from \"effect\";\n//#region src/runtime/functions.ts\nconst FunctionKind = Schema.Literals([\"Mutation\", \"Query\"]);\nvar UnknownFunction = class extends Schema.TaggedError()(\"UnknownFunction\", {\n\tfunction: FunctionAddress,\n\tmessage: Schema.String\n}) {};\nvar WrongFunctionKind = class extends Schema.TaggedError()(\"WrongFunctionKind\", {\n\tactual: FunctionKind,\n\texpected: FunctionKind,\n\tfunction: FunctionAddress,\n\tmessage: Schema.String\n}) {};\nvar InvalidArguments = class extends Schema.TaggedError()(\"InvalidArguments\", {\n\tfunction: FunctionAddress,\n\tmessage: Schema.String\n}) {};\nvar FunctionUnavailable = class extends Schema.TaggedError()(\"FunctionUnavailable\", {\n\tcause: Schema.Defect(),\n\tfunction: FunctionAddress,\n\tmessage: Schema.String\n}) {};\n//#endregion\nexport { FunctionKind, FunctionUnavailable, InvalidArguments, UnknownFunction, WrongFunctionKind };\n\n//# sourceMappingURL=functions.js.map","import { initial, upgrade } from \"./versioned.js\";\nimport { FunctionAddress } from \"./runtime/sync.js\";\nimport { FunctionKind } from \"./runtime/functions.js\";\nimport { t as ValueDescriptor } from \"./descriptor-CTY4mtwS.js\";\nimport { Schema } from \"effect\";\n//#region src/version.ts\nconst ArtifactPath = Schema.String.check(Schema.isPattern(/^(?!\\/)(?![A-Za-z]:\\/)(?!.*(?:^|\\/)\\.\\.(?:\\/|$))(?!.*(?:^|\\/)\\.(?:\\/|$))(?!.*\\/\\/)[^\\\\\\0]+$/)).pipe(Schema.brand(\"ignotum/version/ArtifactPath\"));\nconst ClientPath = Schema.String.check(Schema.isPattern(/^\\/(?!_ignotum(?:\\/|$))(?:(?:[A-Za-z0-9._~-]+\\/)*[A-Za-z0-9._~-]+\\/?)?$/)).pipe(Schema.brand(\"ignotum/version/ClientPath\"));\nconst Sha256 = Schema.String.check(Schema.isPattern(/^[0-9a-f]{64}$/)).pipe(Schema.brand(\"ignotum/version/Sha256\"));\nconst ArtifactKind = Schema.Literals([\n\t\"ClientAsset\",\n\t\"ClientDocument\",\n\t\"ClientManifest\",\n\t\"ClientPublicFile\",\n\t\"ClientShell\",\n\t\"FunctionBundle\",\n\t\"ServerManifest\",\n\t\"ServerEnvironment\",\n\t\"SourceMap\",\n\t\"SchemaSnapshot\"\n]);\nconst ArtifactReference = Schema.Struct({\n\tpath: ArtifactPath,\n\tsize: Schema.Natural,\n\tsha256: Sha256\n});\nconst ArtifactFile = Schema.Struct({\n\tpath: ArtifactPath,\n\tsize: Schema.Natural,\n\tsha256: Sha256,\n\tkind: ArtifactKind,\n\tcontentType: Schema.String,\n\tcontentEncoding: Schema.optional(Schema.String)\n});\nconst ClientRoute = Schema.Struct({\n\tpathname: ClientPath,\n\tartifact: ArtifactReference\n});\nconst VersionInventoryV1 = Schema.Struct({\n\tformatVersion: Schema.Literal(1),\n\tfiles: Schema.Array(ArtifactFile)\n});\nconst VersionInventoryV2 = Schema.Struct({\n\tformatVersion: Schema.Literal(2),\n\tfiles: Schema.Array(ArtifactFile)\n});\nconst VersionInventory = upgrade(initial(VersionInventoryV1), VersionInventoryV2, (inventory) => ({\n\tformatVersion: 2,\n\tfiles: inventory.files\n}));\nconst ClientManifestV1 = Schema.Struct({\n\tformatVersion: Schema.Literal(1),\n\tshell: ArtifactReference,\n\troutes: Schema.Array(ClientRoute)\n});\nconst ClientManifest = initial(ClientManifestV1);\nconst ClientRoutingRoute = Schema.Struct({\n\tpathname: ClientPath,\n\tartifact: ArtifactPath\n});\nconst ClientRoutingV1 = Schema.Struct({\n\tformatVersion: Schema.Literal(1),\n\tshell: ArtifactPath,\n\troutes: Schema.Array(ClientRoutingRoute)\n});\nconst ClientRouting = initial(ClientRoutingV1);\nconst SchemaSnapshotField = Schema.Struct({\n\tname: Schema.String,\n\tvalue: ValueDescriptor\n});\nconst EnvironmentArtifactV1 = Schema.Struct({\n\tformatVersion: Schema.Literal(1),\n\tnonce: Schema.String.check(Schema.isPattern(/^[A-Za-z0-9_-]{43}$/)),\n\tvalues: Schema.Record(Schema.String, Schema.String)\n});\nconst EnvironmentArtifact = initial(EnvironmentArtifactV1);\nconst ServerEnvironmentArtifact = Schema.Struct({\n\tartifact: ArtifactReference,\n\tfields: Schema.Array(SchemaSnapshotField)\n});\nconst SchemaSnapshotIndex = Schema.Struct({\n\tname: Schema.String,\n\tfields: Schema.Array(Schema.String)\n});\nconst SchemaSnapshotTableV1 = Schema.Struct({\n\tname: Schema.String,\n\tfields: Schema.Array(SchemaSnapshotField)\n});\nconst SchemaSnapshotV1 = Schema.Struct({\n\tformatVersion: Schema.Literal(1),\n\ttables: Schema.Array(SchemaSnapshotTableV1)\n});\nconst SchemaSnapshotTable = Schema.Struct({\n\tname: Schema.String,\n\tfields: Schema.Array(SchemaSnapshotField),\n\tindexes: Schema.Array(SchemaSnapshotIndex)\n});\nconst SchemaSnapshotV2 = Schema.Struct({\n\tformatVersion: Schema.Literal(2),\n\ttables: Schema.Array(SchemaSnapshotTable)\n});\nconst SchemaSnapshot = upgrade(initial(SchemaSnapshotV1), SchemaSnapshotV2, (snapshot) => ({\n\tformatVersion: 2,\n\ttables: snapshot.tables.map((table) => ({\n\t\t...table,\n\t\tindexes: []\n\t}))\n}));\nconst ServerFunctionArtifactV1 = Schema.Struct({\n\taddress: FunctionAddress,\n\tkind: FunctionKind,\n\tbundle: ArtifactReference,\n\tsourceMap: ArtifactReference\n});\nconst ServerFunctionArtifact = Schema.Struct({\n\taddress: FunctionAddress,\n\tkind: FunctionKind,\n\targs: Schema.optional(ValueDescriptor),\n\treturns: Schema.optional(ValueDescriptor),\n\terrors: Schema.optional(ValueDescriptor),\n\tbundle: ArtifactReference,\n\tsourceMap: ArtifactReference\n});\nconst ServerBuildManifestV1 = Schema.Struct({\n\tformatVersion: Schema.Literal(1),\n\tschema: ArtifactReference,\n\tfunctions: Schema.Array(ServerFunctionArtifactV1)\n});\nconst ServerBuildManifestV2 = Schema.Struct({\n\tformatVersion: Schema.Literal(2),\n\tschema: ArtifactReference,\n\tfunctions: Schema.Array(ServerFunctionArtifact)\n});\nconst ServerBuildManifestThroughV2 = upgrade(initial(ServerBuildManifestV1), ServerBuildManifestV2, (manifest) => ({\n\tformatVersion: 2,\n\tschema: manifest.schema,\n\tfunctions: manifest.functions\n}));\nconst ServerBuildManifestV3 = Schema.Struct({\n\tformatVersion: Schema.Literal(3),\n\tschema: ArtifactReference,\n\tenvironment: Schema.optional(ServerEnvironmentArtifact),\n\tfunctions: Schema.Array(ServerFunctionArtifact)\n});\nconst ServerBuildManifestThroughV3 = upgrade(ServerBuildManifestThroughV2, ServerBuildManifestV3, (manifest) => ({\n\tformatVersion: 3,\n\tschema: manifest.schema,\n\tfunctions: manifest.functions\n}));\nconst ServerBuildManifestV4 = Schema.Struct({\n\tformatVersion: Schema.Literal(4),\n\tschema: ArtifactReference,\n\tenvironment: Schema.optional(ServerEnvironmentArtifact),\n\tfunctions: Schema.Array(ServerFunctionArtifact),\n\tschemaEvolution: Schema.optional(Schema.Struct({\n\t\tbundle: ArtifactReference,\n\t\tsourceMap: ArtifactReference\n\t}))\n});\nconst ServerBuildManifest = upgrade(ServerBuildManifestThroughV3, ServerBuildManifestV4, (manifest) => ({\n\t...manifest,\n\tformatVersion: 4\n}));\nconst versionInventoryPath = ArtifactPath.make(\"inventory.json\");\nconst clientManifestPath = ArtifactPath.make(\"client/manifest.json\");\nconst clientShellPath = ArtifactPath.make(\"client/shell.html\");\nconst clientAssetDirectory = ArtifactPath.make(\"client/assets\");\nconst clientAssetPathPrefix = `${clientAssetDirectory}/`;\nconst clientRouteDirectory = ArtifactPath.make(\"client/routes\");\nconst clientRoutePathPrefix = `${clientRouteDirectory}/`;\nconst clientPublicFileExtensions = [\n\t\".avif\",\n\t\".gif\",\n\t\".ico\",\n\t\".jpeg\",\n\t\".jpg\",\n\t\".pdf\",\n\t\".png\",\n\t\".webp\"\n];\nconst serverManifestPath = ArtifactPath.make(\"server/manifest.json\");\nconst schemaSnapshotPath = ArtifactPath.make(\"server/schema.json\");\nconst serverEnvironmentPath = ArtifactPath.make(\"server/environment.json\");\nconst versionArtifactLimits = {\n\tfileBytes: 16777216,\n\tfileCount: 512,\n\tinventoryBytes: 1048576,\n\tserverBytes: 67108864,\n\ttotalBytes: 134217728\n};\n//#endregion\nexport { ArtifactFile, ArtifactKind, ArtifactPath, ArtifactReference, ClientManifest, ClientPath, ClientRoute, ClientRouting, ClientRoutingRoute, EnvironmentArtifact, SchemaSnapshot, SchemaSnapshotField, SchemaSnapshotIndex, SchemaSnapshotTable, ServerBuildManifest, ServerEnvironmentArtifact, ServerFunctionArtifact, Sha256, VersionInventory, clientAssetDirectory, clientAssetPathPrefix, clientManifestPath, clientPublicFileExtensions, clientRouteDirectory, clientRoutePathPrefix, clientShellPath, schemaSnapshotPath, serverEnvironmentPath, serverManifestPath, versionArtifactLimits, versionInventoryPath };\n\n//# sourceMappingURL=version.js.map","import { AppId, InvocationId, VersionId, defineId } from \"./runtime/id.js\";\nimport { ActivationGeneration, CapabilityId, ClientApiVersion, DataHistoryId, PlatformGeneration, PlatformReleaseId, ProtocolVersion, ServerApiVersion, VersionNumber } from \"./runtime/identity.js\";\nimport { initial, upgrade } from \"./versioned.js\";\nimport { Sha256 } from \"./version.js\";\nimport { Schema } from \"effect\";\n//#region src/platform.ts\nconst strict = (fields) => Schema.Struct(fields).annotate({ parseOptions: { onExcessProperty: \"error\" } });\nconst Capabilities = Schema.UniqueArray(CapabilityId).check(Schema.isMaxLength(256));\nconst RuntimeRequirements = strict({\n\tclientApiVersion: ClientApiVersion,\n\tserverApiVersion: ServerApiVersion,\n\tcapabilities: Capabilities\n});\nconst BrowserGraphReference = strict({\n\tsha256: Sha256,\n\tentry: Schema.String.check(Schema.isTrimmed(), Schema.isPattern(/^ignotum\\/platform\\/browser\\/[a-zA-Z0-9_-]+(?:\\/[a-zA-Z0-9_-]+)*\\.js$/), Schema.isMaxLength(512))\n});\nconst GuestGraphReference = strict({\n\tsha256: Sha256,\n\tentry: Schema.String.check(Schema.isTrimmed(), Schema.isPattern(/^ignotum\\/platform\\/guest\\/[a-zA-Z0-9_-]+(?:\\/[a-zA-Z0-9_-]+)*\\.js$/), Schema.isMaxLength(512))\n});\nconst PersistentStateFormatId = Schema.String.check(Schema.isTrimmed(), Schema.isPattern(/^[a-z][a-z0-9]*(?:[./-][a-z0-9]+)*$/), Schema.isMaxLength(128)).pipe(Schema.brand(\"ignotum/platform/PersistentStateFormatId\"));\nconst PersistentStateFormatVersion = Schema.Int.check(Schema.isGreaterThan(0)).pipe(Schema.brand(\"ignotum/platform/PersistentStateFormatVersion\"));\nconst PersistentStateCompatibility = strict({\n\tformat: PersistentStateFormatId,\n\treadableVersions: Schema.UniqueArray(PersistentStateFormatVersion).check(Schema.isMinLength(1), Schema.isMaxLength(256)),\n\twriteVersion: PersistentStateFormatVersion\n}).check(Schema.makeFilter((value) => value.readableVersions.includes(value.writeVersion) ? void 0 : \"A release must read the persistent state version it writes\")).annotate({ parseOptions: { onExcessProperty: \"error\" } });\nconst PersistentState = Schema.Array(strict({\n\tformat: PersistentStateFormatId,\n\tversion: PersistentStateFormatVersion\n})).check(Schema.isMaxLength(256), Schema.makeFilter((states) => new Set(states.map((state) => state.format)).size === states.length ? void 0 : \"Persistent state format identifiers must be unique\"));\nconst ReleasePublication = Schema.Union([\n\tstrict({\n\t\tstate: Schema.Literal(\"Staging\"),\n\t\teligible: Schema.Literal(false)\n\t}),\n\tstrict({\n\t\tstate: Schema.Literal(\"Ready\"),\n\t\teligible: Schema.Literal(true)\n\t}),\n\tstrict({\n\t\tstate: Schema.Literal(\"Failed\"),\n\t\teligible: Schema.Literal(false),\n\t\treason: Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(4096))\n\t}),\n\tstrict({\n\t\tstate: Schema.Literal(\"Retired\"),\n\t\teligible: Schema.Literal(false)\n\t})\n]);\nconst SupportedProtocols = Schema.UniqueArray(ProtocolVersion).check(Schema.isMinLength(1), Schema.isMaxLength(32));\nconst PlatformReleaseV1 = strict({\n\tformatVersion: Schema.Literal(1),\n\tid: PlatformReleaseId,\n\tbrowser: strict({\n\t\tgraph: BrowserGraphReference,\n\t\tclientApiVersion: ClientApiVersion,\n\t\tprotocolVersion: ProtocolVersion\n\t}),\n\tguest: strict({\n\t\tgraph: GuestGraphReference,\n\t\tserverApiVersion: ServerApiVersion,\n\t\tprotocolVersion: ProtocolVersion\n\t}),\n\tgateway: strict({\n\t\timplementation: Sha256,\n\t\tbrowserProtocols: SupportedProtocols\n\t}),\n\thost: strict({\n\t\timplementation: Sha256,\n\t\tguestProtocols: SupportedProtocols\n\t}),\n\tcapabilities: Capabilities,\n\tpersistentState: Schema.Array(PersistentStateCompatibility).check(Schema.isMaxLength(256)),\n\tpublication: ReleasePublication\n}).check(Schema.makeFilter((release) => {\n\tconst issues = [];\n\tif (!release.gateway.browserProtocols.includes(release.browser.protocolVersion)) issues.push({\n\t\tpath: [\"gateway\"],\n\t\tissue: \"Gateway must support the selected browser protocol\"\n\t});\n\tif (!release.host.guestProtocols.includes(release.guest.protocolVersion)) issues.push({\n\t\tpath: [\"host\"],\n\t\tissue: \"Host must support the selected guest protocol\"\n\t});\n\tif (new Set(release.persistentState.map((state) => state.format)).size !== release.persistentState.length) issues.push({\n\t\tpath: [\"persistentState\"],\n\t\tissue: \"Persistent state format identifiers must be unique\"\n\t});\n\treturn issues;\n})).annotate({ parseOptions: { onExcessProperty: \"error\" } });\nconst PlatformRelease = initial(PlatformReleaseV1);\n/** Decode each input at its trust boundary before checking selection eligibility. */\nconst isReleaseCompatible = (release, requirements, persistentState) => release.publication.eligible && release.browser.clientApiVersion === requirements.clientApiVersion && release.guest.serverApiVersion === requirements.serverApiVersion && requirements.capabilities.every((capability) => release.capabilities.includes(capability)) && persistentState.every((state) => release.persistentState.some((supported) => supported.format === state.format && supported.readableVersions.includes(state.version)));\nconst ExecutionSelectionV1 = strict({\n\tformatVersion: Schema.Literal(1),\n\tappId: AppId,\n\tversionId: VersionId,\n\tactivationGeneration: ActivationGeneration,\n\tplatformReleaseId: PlatformReleaseId,\n\tplatformGeneration: PlatformGeneration,\n\tdataHistoryId: DataHistoryId\n});\nconst ExecutionSelection = initial(ExecutionSelectionV1);\n/** Compare trusted admission and commit selections, including the database history fence. */\nconst sameExecutionSelection = (left, right) => left.appId === right.appId && left.versionId === right.versionId && left.activationGeneration === right.activationGeneration && left.platformReleaseId === right.platformReleaseId && left.platformGeneration === right.platformGeneration && left.dataHistoryId === right.dataHistoryId;\n/** Browser recovery scope only; reconciliation must verify the owning session separately. */\nconst RecoverySessionId = defineId(\"rec\", \"ignotum/platform/RecoverySessionId\");\nconst RecoveryIdentity = strict({\n\tinvocationId: InvocationId,\n\toriginalSelection: ExecutionSelection\n});\nconst RecoveryLimits = {\n\tmaxOperations: 1024,\n\tmaxRetentionMs: 6048e5\n};\nconst RecoveryRecordV1 = strict({\n\tformatVersion: Schema.Literal(1),\n\tappId: AppId,\n\tclientSessionId: RecoverySessionId,\n\trecordedAt: Schema.Natural,\n\texpiresAt: Schema.Natural,\n\toperations: Schema.Array(RecoveryIdentity).check(Schema.isMaxLength(RecoveryLimits.maxOperations))\n}).check(Schema.makeFilter((record) => {\n\tconst issues = [];\n\tif (record.expiresAt <= record.recordedAt || record.expiresAt - record.recordedAt > RecoveryLimits.maxRetentionMs) issues.push({\n\t\tpath: [\"expiresAt\"],\n\t\tissue: \"Recovery retention must be positive and bounded\"\n\t});\n\tif (record.operations.some((operation) => operation.originalSelection.appId !== record.appId)) issues.push({\n\t\tpath: [\"operations\"],\n\t\tissue: \"Recovery operations must belong to the record's app\"\n\t});\n\tconst identities = record.operations.map((operation) => `${operation.originalSelection.dataHistoryId}/${operation.invocationId}`);\n\tif (new Set(identities).size !== identities.length) issues.push({\n\t\tpath: [\"operations\"],\n\t\tissue: \"Recovery operation identities must be unique within a data history\"\n\t});\n\treturn issues;\n})).annotate({ parseOptions: { onExcessProperty: \"error\" } });\nconst RecoveryRecord = initial(RecoveryRecordV1);\nconst RetentionTarget = Schema.Union([\n\tstrict({\n\t\tkind: Schema.Literal(\"Version\"),\n\t\tappId: AppId,\n\t\tversionId: VersionId\n\t}),\n\tstrict({\n\t\tkind: Schema.Literal(\"PlatformRelease\"),\n\t\tplatformReleaseId: PlatformReleaseId\n\t}),\n\tstrict({\n\t\tkind: Schema.Literal(\"AppArtifact\"),\n\t\tappId: AppId,\n\t\tversionId: VersionId,\n\t\tsha256: Sha256\n\t}),\n\tstrict({\n\t\tkind: Schema.Literal(\"PlatformArtifact\"),\n\t\tplatformReleaseId: PlatformReleaseId,\n\t\tsha256: Sha256\n\t})\n]);\nconst RetentionOwnerV1 = Schema.Union([\n\tstrict({\n\t\treason: Schema.Literal(\"Rollback\"),\n\t\tappId: AppId\n\t}),\n\tstrict({\n\t\treason: Schema.Literal(\"Recovery\"),\n\t\tappId: AppId,\n\t\tclientSessionId: RecoverySessionId\n\t}),\n\tstrict({\n\t\treason: Schema.Literal(\"DataHistory\"),\n\t\tappId: AppId,\n\t\tdataHistoryId: DataHistoryId\n\t})\n]);\nconst RetentionOwner = Schema.Union([RetentionOwnerV1, strict({\n\treason: Schema.Literal(\"Lifecycle\"),\n\tappId: AppId,\n\tkey: Schema.String.check(Schema.isPattern(/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/))\n})]);\nconst RetentionReferenceV1 = strict({\n\tformatVersion: Schema.Literal(1),\n\towner: RetentionOwnerV1,\n\ttarget: RetentionTarget\n}).check(Schema.makeFilter((reference) => (reference.target.kind === \"Version\" || reference.target.kind === \"AppArtifact\") && reference.target.appId !== reference.owner.appId ? \"Retention references must belong to the owner's app\" : void 0)).annotate({ parseOptions: { onExcessProperty: \"error\" } });\nconst RetentionReferenceV2 = strict({\n\tformatVersion: Schema.Literal(2),\n\towner: RetentionOwner,\n\ttarget: RetentionTarget\n}).check(Schema.makeFilter((reference) => (reference.target.kind === \"Version\" || reference.target.kind === \"AppArtifact\") && reference.target.appId !== reference.owner.appId ? \"Retention references must belong to the owner's app\" : void 0));\nconst RetentionReference = upgrade(initial(RetentionReferenceV1), RetentionReferenceV2, (previous) => ({\n\t...previous,\n\tformatVersion: 2\n}));\n//#endregion\nexport { BrowserGraphReference, CapabilityId, ClientApiVersion, DataHistoryId, ExecutionSelection, GuestGraphReference, PersistentState, PersistentStateCompatibility, PersistentStateFormatId, PersistentStateFormatVersion, PlatformGeneration, PlatformRelease, PlatformReleaseId, ProtocolVersion, RecoveryIdentity, RecoveryLimits, RecoveryRecord, RecoverySessionId, ReleasePublication, RetentionOwner, RetentionReference, RetentionTarget, RuntimeRequirements, ServerApiVersion, VersionNumber, isReleaseCompatible, sameExecutionSelection };\n\n//# sourceMappingURL=platform.js.map","import { GeneratedId, VersionId } from \"./runtime/id.js\";\nimport { VersionNumber } from \"./runtime/identity.js\";\nimport { initial } from \"./versioned.js\";\nimport { FunctionAddress } from \"./runtime/sync.js\";\nimport { FunctionKind } from \"./runtime/functions.js\";\nimport { t as ValueDescriptor } from \"./descriptor-CTY4mtwS.js\";\nimport { ArtifactPath, SchemaSnapshot, SchemaSnapshotField, Sha256 } from \"./version.js\";\nimport { RuntimeRequirements } from \"./platform.js\";\nimport { Schema } from \"effect\";\n//#region src/app-definition.ts\nconst appDefinitionLimits = {\n\tdeclarationBytes: 1048576,\n\tartifactBytes: 16777216,\n\ttotalArtifactBytes: 134217728,\n\tserverArtifactBytes: 67108864,\n\tartifacts: 512,\n\tmodules: 512,\n\timportsPerModule: 256,\n\troutes: 512,\n\tlayouts: 128,\n\tfunctions: 512,\n\tconversions: 512,\n\turlFields: 64,\n\tliteralValues: 64,\n\ttextLength: 4096,\n\tconfigurationDepth: 96,\n\tconfigurationNodes: 65536,\n\tdescriptorDepth: 32,\n\tdescriptorNodes: 8192,\n\tgraphDepth: 64,\n\tmoduleTokens: 1e5\n};\nconst strict = (fields) => Schema.Struct(fields).annotate({ parseOptions: { onExcessProperty: \"error\" } });\nconst Name = Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(256));\nconst Text = Schema.String.check(Schema.isMaxLength(appDefinitionLimits.textLength));\nconst ExportName = Schema.String.check(Schema.isPattern(/^[A-Za-z_$][A-Za-z0-9_$]*$/), Schema.isTrimmed());\nconst AppArtifactPath = ArtifactPath.check(Schema.isTrimmed(), Schema.isMaxLength(512), Schema.isPattern(/^(?:[A-Za-z0-9_-][A-Za-z0-9_.-]*\\/)*[A-Za-z0-9_-][A-Za-z0-9_.-]*$/));\nconst AppModuleId = Schema.String.check(Schema.isTrimmed(), Schema.isMaxLength(512), Schema.isPattern(/^app\\/(?:client|server)\\/(?:[A-Za-z0-9_-][A-Za-z0-9_.-]*\\/)*[A-Za-z0-9_-][A-Za-z0-9_.-]*$/)).pipe(Schema.brand(\"ignotum/app-definition/AppModuleId\"));\nconst RouteId = Name.pipe(Schema.brand(\"ignotum/app-definition/RouteId\"));\nconst LayoutId = Name.pipe(Schema.brand(\"ignotum/app-definition/LayoutId\"));\nconst ModuleExportReference = strict({\n\tmodule: AppModuleId,\n\texportName: ExportName\n});\nconst ModuleImport = Schema.Union([\n\tstrict({\n\t\tkind: Schema.Literal(\"App\"),\n\t\tspecifier: Name,\n\t\tmodule: AppModuleId\n\t}),\n\tstrict({\n\t\tkind: Schema.Literal(\"Runtime\"),\n\t\tspecifier: Schema.Literals([\n\t\t\t\"ignotum/client\",\n\t\t\t\"ignotum/client/jsx-runtime\",\n\t\t\t\"ignotum/client/jsx-dev-runtime\",\n\t\t\t\"ignotum/server\"\n\t\t])\n\t}),\n\tstrict({\n\t\tkind: Schema.Literal(\"Compiler\"),\n\t\tspecifier: Schema.Literals([\n\t\t\t\"ignotum/internal/api\",\n\t\t\t\"ignotum/internal/client\",\n\t\t\t\"ignotum/internal/routes\",\n\t\t\t\"ignotum/internal/bootstrap\",\n\t\t\t\"ignotum/internal/server\"\n\t\t])\n\t}),\n\tstrict({\n\t\tkind: Schema.Literal(\"RenderingPeer\"),\n\t\tspecifier: Schema.Literals([\n\t\t\t\"preact\",\n\t\t\t\"preact/hooks\",\n\t\t\t\"preact/jsx-runtime\",\n\t\t\t\"preact/jsx-dev-runtime\"\n\t\t])\n\t}),\n\tstrict({\n\t\tkind: Schema.Literal(\"HostBridge\"),\n\t\tspecifier: Schema.Literal(\"ignotum:host\")\n\t})\n]);\nconst AppModule = strict({\n\tid: AppModuleId,\n\tartifact: AppArtifactPath,\n\timports: Schema.Array(ModuleImport).check(Schema.isMaxLength(appDefinitionLimits.importsPerModule)),\n\tsourceMap: Schema.optional(AppArtifactPath),\n\tassets: Schema.optional(Schema.Array(AppArtifactPath).check(Schema.isMaxLength(appDefinitionLimits.artifacts))),\n\tstyles: Schema.optional(Schema.Array(AppArtifactPath).check(Schema.isMaxLength(appDefinitionLimits.artifacts)))\n});\nconst AppModuleGraph = strict({\n\tentries: Schema.Array(AppModuleId).check(Schema.isMaxLength(appDefinitionLimits.modules)),\n\tmodules: Schema.Array(AppModule).check(Schema.isMaxLength(appDefinitionLimits.modules))\n});\nconst ArtifactFields = {\n\tpath: AppArtifactPath,\n\tsize: Schema.Natural.check(Schema.isLessThanOrEqualTo(appDefinitionLimits.artifactBytes)),\n\tsha256: Sha256,\n\tcontentType: Name,\n\tcontentEncoding: Schema.optional(Schema.Literal(\"gzip\"))\n};\nconst AppArtifact = Schema.Union([\n\tstrict({\n\t\t...ArtifactFields,\n\t\tkind: Schema.Literals([\n\t\t\t\"ClientModule\",\n\t\t\t\"Style\",\n\t\t\t\"Image\",\n\t\t\t\"Icon\"\n\t\t]),\n\t\tvisibility: Schema.Literal(\"public\")\n\t}),\n\tstrict({\n\t\t...ArtifactFields,\n\t\tkind: Schema.Literal(\"ServerModule\"),\n\t\tvisibility: Schema.Literal(\"private\")\n\t}),\n\tstrict({\n\t\t...ArtifactFields,\n\t\tkind: Schema.Literal(\"SourceMap\"),\n\t\tvisibility: Schema.Literal(\"private\"),\n\t\towner: AppModuleId\n\t})\n]);\nconst UrlLiteral = Schema.Union([\n\tText,\n\tSchema.Finite,\n\tSchema.Boolean\n]);\nconst UrlScalarDescriptor = Schema.Union([\n\tstrict({ type: Schema.Literal(\"string\") }),\n\tstrict({\n\t\ttype: Schema.Literal(\"id\"),\n\t\ttable: Name\n\t}),\n\tstrict({ type: Schema.Literal(\"number\") }),\n\tstrict({ type: Schema.Literal(\"integer\") }),\n\tstrict({ type: Schema.Literal(\"boolean\") }),\n\tstrict({\n\t\ttype: Schema.Literal(\"literal\"),\n\t\tvalue: UrlLiteral\n\t}),\n\tstrict({\n\t\ttype: Schema.Literal(\"literals\"),\n\t\tvalues: Schema.Array(UrlLiteral).check(Schema.isMinLength(1), Schema.isMaxLength(appDefinitionLimits.literalValues), Schema.makeFilter((values) => new Set(values.map(String)).size === values.length || \"URL literal encodings must be unique\"))\n\t})\n]);\nconst urlScalarSchema = (descriptor) => {\n\tswitch (descriptor.type) {\n\t\tcase \"string\": return Text;\n\t\tcase \"id\": return GeneratedId;\n\t\tcase \"number\": return Schema.Finite;\n\t\tcase \"integer\": return Schema.Int;\n\t\tcase \"boolean\": return Schema.Boolean;\n\t\tcase \"literal\": return Schema.Literal(descriptor.value);\n\t\tcase \"literals\": return Schema.Literals(descriptor.values);\n\t}\n};\nconst UrlRequiredDescriptor = Schema.Union([UrlScalarDescriptor, strict({\n\ttype: Schema.Literal(\"array\"),\n\tvalue: UrlScalarDescriptor\n})]);\nconst UrlDefault = Schema.Union([UrlLiteral, Schema.Array(UrlLiteral).check(Schema.isMaxLength(256))]);\nconst UrlValueDescriptor = Schema.Union([\n\tUrlRequiredDescriptor,\n\tstrict({\n\t\ttype: Schema.Literal(\"optional\"),\n\t\tvalue: UrlRequiredDescriptor\n\t}),\n\tstrict({\n\t\ttype: Schema.Literal(\"default\"),\n\t\tvalue: UrlRequiredDescriptor,\n\t\tdefault: UrlDefault\n\t}).check(Schema.makeFilter((descriptor) => {\n\t\tconst valueSchema = descriptor.value.type === \"array\" ? Schema.Array(urlScalarSchema(descriptor.value.value)) : urlScalarSchema(descriptor.value);\n\t\treturn Schema.is(valueSchema)(descriptor.default) || \"The URL default must satisfy its value descriptor\";\n\t})).annotate({ parseOptions: { onExcessProperty: \"error\" } })\n]);\nconst UrlField = strict({\n\tname: Name,\n\tvalue: UrlValueDescriptor\n});\nconst PathUrlField = strict({\n\tname: Name,\n\tvalue: Schema.Union([UrlScalarDescriptor, strict({\n\t\ttype: Schema.Literal(\"array\"),\n\t\tvalue: strict({ type: Schema.Literal(\"string\") })\n\t})])\n});\nconst Meta = strict({\n\tdescription: Schema.optional(Text),\n\trobots: Schema.optional(Text)\n});\nconst StaticMetadata = strict({\n\ttitle: Schema.optional(Text),\n\tmeta: Schema.optional(Meta)\n});\nconst LayoutMetadata = strict({\n\ttitle: Schema.optional(Text),\n\ttitleTemplate: Schema.optional(Text.check(Schema.makeFilter((template) => template.split(\"%s\").length === 2 || \"A title template must contain exactly one %s placeholder\"))),\n\tmeta: Schema.optional(Meta)\n});\nconst RoutePattern = Schema.String.check(Schema.isMaxLength(2048), Schema.isPattern(/^\\/(?!_ignotum(?:\\/|$))[^?#\\\\\\0]*$/));\nconst RouteDefinition = strict({\n\tid: RouteId,\n\tpattern: RoutePattern,\n\tdirectoryScope: Schema.optional(RoutePattern),\n\tprecedence: Schema.Array(Schema.Natural).check(Schema.isMaxLength(128)),\n\tparams: Schema.Array(PathUrlField).check(Schema.isMaxLength(appDefinitionLimits.urlFields)),\n\tsearchParams: Schema.Array(UrlField).check(Schema.isMaxLength(appDefinitionLimits.urlFields)),\n\tpage: ModuleExportReference,\n\tlayouts: Schema.Array(LayoutId).check(Schema.isMaxLength(appDefinitionLimits.layouts)),\n\tmetadata: StaticMetadata,\n\tboundaries: strict({\n\t\terror: Schema.Boolean,\n\t\tinvalid: Schema.Boolean\n\t})\n});\nconst LayoutDefinition = strict({\n\tid: LayoutId,\n\tscope: RoutePattern,\n\tparent: Schema.optional(LayoutId),\n\tmodule: ModuleExportReference,\n\tmetadata: LayoutMetadata,\n\tboundaries: strict({\n\t\terror: Schema.Boolean,\n\t\tinvalid: Schema.Boolean,\n\t\tnotFound: Schema.Boolean\n\t})\n});\nconst FunctionDefinition = strict({\n\taddress: FunctionAddress,\n\tkind: FunctionKind,\n\tentry: ModuleExportReference,\n\targs: ValueDescriptor,\n\treturns: Schema.optional(ValueDescriptor),\n\terrors: ValueDescriptor\n});\nconst SchemaConversion = strict({\n\ttable: Name,\n\tfield: Name,\n\tfrom: ValueDescriptor,\n\tto: ValueDescriptor,\n\tentry: ModuleExportReference\n});\nconst AppDefinitionV1 = strict({\n\tformatVersion: Schema.Literal(1),\n\tappName: Name,\n\trequirements: RuntimeRequirements,\n\tclient: strict({\n\t\tregistration: ModuleExportReference,\n\t\tgraph: AppModuleGraph,\n\t\troutes: Schema.Array(RouteDefinition).check(Schema.isMaxLength(appDefinitionLimits.routes)),\n\t\tlayouts: Schema.Array(LayoutDefinition).check(Schema.isMaxLength(appDefinitionLimits.layouts)),\n\t\tstyles: Schema.Array(AppArtifactPath).check(Schema.isMaxLength(appDefinitionLimits.artifacts)),\n\t\ticon: Schema.optional(AppArtifactPath)\n\t}),\n\tserver: strict({\n\t\tgraph: AppModuleGraph,\n\t\tfunctions: Schema.Array(FunctionDefinition).check(Schema.isMaxLength(appDefinitionLimits.functions)),\n\t\tschema: strict({\n\t\t\tentry: ModuleExportReference,\n\t\t\tidentity: Sha256,\n\t\t\tdescriptor: SchemaSnapshot,\n\t\t\tconversions: Schema.Array(SchemaConversion).check(Schema.isMaxLength(appDefinitionLimits.conversions))\n\t\t})\n\t}),\n\tartifacts: Schema.Array(AppArtifact).check(Schema.isMaxLength(appDefinitionLimits.artifacts))\n}).check(Schema.makeFilter((definition) => definition.artifacts.reduce((sum, artifact) => sum + artifact.size, 0) <= appDefinitionLimits.totalArtifactBytes || \"App artifacts exceed the total byte limit\"), Schema.makeFilter((definition) => definition.artifacts.filter((artifact) => artifact.visibility === \"private\").reduce((sum, artifact) => sum + artifact.size, 0) <= appDefinitionLimits.serverArtifactBytes || \"Private artifacts exceed the server byte limit\"), Schema.makeFilter((definition) => new TextEncoder().encode(JSON.stringify(definition)).byteLength <= appDefinitionLimits.declarationBytes || \"App definition exceeds the declaration byte limit\"));\nconst AppDefinitionThroughV1 = initial(AppDefinitionV1.annotate({ parseOptions: { onExcessProperty: \"error\" } }));\nconst ManagedServerDefinition = AppDefinitionV1.fields.server;\nconst AppDefinition = AppDefinitionThroughV1;\nconst ProtectedEnvironmentReference = strict({\n\tartifact: strict({\n\t\tpath: AppArtifactPath,\n\t\tsize: ArtifactFields.size,\n\t\tsha256: Sha256\n\t}),\n\tfields: Schema.Array(SchemaSnapshotField).check(Schema.isMaxLength(256))\n});\nconst UploadDeclarationV1 = strict({\n\tformatVersion: Schema.Literal(1),\n\tdefinition: AppDefinition,\n\tenvironment: Schema.optional(ProtectedEnvironmentReference)\n}).check(Schema.makeFilter((declaration) => new TextEncoder().encode(JSON.stringify(declaration)).byteLength <= appDefinitionLimits.declarationBytes || \"Upload declaration exceeds the declaration byte limit\"), Schema.makeFilter((declaration) => declaration.definition.artifacts.reduce((sum, artifact) => sum + artifact.size, declaration.environment?.artifact.size ?? 0) <= appDefinitionLimits.totalArtifactBytes || \"Upload artifacts exceed the total byte limit\"), Schema.makeFilter((declaration) => declaration.definition.artifacts.filter((artifact) => artifact.visibility === \"private\").reduce((sum, artifact) => sum + artifact.size, declaration.environment?.artifact.size ?? 0) <= appDefinitionLimits.serverArtifactBytes || \"Protected upload artifacts exceed the server byte limit\"));\nconst UploadDeclaration = initial(UploadDeclarationV1.annotate({ parseOptions: { onExcessProperty: \"error\" } }));\nconst VersionAdmissionRecordV1 = Schema.Union([strict({\n\tformatVersion: Schema.Literal(1),\n\tversionId: VersionId,\n\tstate: Schema.Literals([\n\t\t\"Uploading\",\n\t\t\"Validating\",\n\t\t\"Rejected\"\n\t]),\n\teligible: Schema.Literal(false)\n}), strict({\n\tformatVersion: Schema.Literal(1),\n\tversionId: VersionId,\n\tstate: Schema.Literal(\"Finalized\"),\n\tnumber: VersionNumber,\n\teligible: Schema.Boolean\n})]);\nconst VersionAdmissionRecord = initial(VersionAdmissionRecordV1);\n//#endregion\nexport { AppArtifact, AppArtifactPath, AppDefinition, AppModule, AppModuleGraph, AppModuleId, FunctionDefinition, LayoutDefinition, LayoutId, LayoutMetadata, ManagedServerDefinition, ModuleExportReference, ModuleImport, ProtectedEnvironmentReference, RouteDefinition, RouteId, SchemaConversion, StaticMetadata, UploadDeclaration, UrlField, UrlScalarDescriptor, UrlValueDescriptor, VersionAdmissionRecord, appDefinitionLimits };\n\n//# sourceMappingURL=app-definition.js.map","import { RouteDefinition } from \"@ignotum/contracts/app-definition\";\nimport { Schema } from \"effect\";\n\nimport type { DecodedFields, InputFields, PathFields, UrlFields } from \"./client.js\";\n\nconst RouteReferenceTypeId: unique symbol = Symbol.for(\"ignotum/internal/routes/RouteReference\");\ndeclare const RouteReferenceTypesTypeId: unique symbol;\n\nexport interface RouteReference<Params = unknown, Search = unknown, SearchInputs = unknown> {\n readonly [RouteReferenceTypeId]: RouteDefinition;\n readonly [RouteReferenceTypesTypeId]?: {\n readonly params: Params;\n readonly searchParams: Search;\n readonly searchInputs: SearchInputs;\n };\n}\nexport type ReferenceTypes<Reference> =\n Reference extends RouteReference<infer Params, infer Search, infer SearchInputs>\n ? {\n readonly params: Params;\n readonly searchParams: Search;\n readonly searchInputs: SearchInputs;\n }\n : never;\ntype ParamsOf<Page, Inferred> = Page extends { readonly params?: infer Params }\n ? Params extends PathFields\n ? DecodedFields<Params>\n : Inferred\n : Inferred;\ntype SearchOf<Page> = Page extends { readonly searchParams?: infer Search extends UrlFields }\n ? Search\n : {};\n\nexport const createRouteReference = <Page, InferredParams>(\n definition: typeof RouteDefinition.Encoded,\n): RouteReference<\n ParamsOf<Page, InferredParams>,\n DecodedFields<SearchOf<Page>>,\n InputFields<SearchOf<Page>>\n> => ({\n [RouteReferenceTypeId]: Schema.decodeUnknownSync(RouteDefinition)(definition),\n});\n\nexport const getRouteDefinition = (reference: RouteReference): RouteDefinition =>\n reference[RouteReferenceTypeId];\n"],"mappings":";;;;;AAGA,MAAM,eAAe,OAAO,SAAS,CAAC,YAAY,OAAO,CAAC;AACtB,OAAO,YAAY,CAAC,CAAC,mBAAmB;CAC3E,UAAU;CACV,SAAS,OAAO;AACjB,CAAC;AACqC,OAAO,YAAY,CAAC,CAAC,qBAAqB;CAC/E,QAAQ;CACR,UAAU;CACV,UAAU;CACV,SAAS,OAAO;AACjB,CAAC;AACoC,OAAO,YAAY,CAAC,CAAC,oBAAoB;CAC7E,UAAU;CACV,SAAS,OAAO;AACjB,CAAC;AACuC,OAAO,YAAY,CAAC,CAAC,uBAAuB;CACnF,OAAO,OAAO,OAAO;CACrB,UAAU;CACV,SAAS,OAAO;AACjB,CAAC;;;AChBD,MAAM,eAAe,OAAO,OAAO,MAAM,OAAO,UAAU,6FAA6F,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,8BAA8B,CAAC;AAC3M,MAAM,aAAa,OAAO,OAAO,MAAM,OAAO,UAAU,yEAAyE,CAAC,C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","../../../contracts/dist/runtime/schema.js","../../../contracts/dist/schema/index.js"],"sourcesContent":["import { GeneratedId } from \"../runtime/id.js\";\nimport { FileFormat, constrainedFileValue, fileFormats, fileLimits } from \"./file.js\";\nimport { ErrorBrand } from \"../runtime/result.js\";\nimport { UserId } from \"../id.js\";\nimport { c as getValueDescriptor, m as withValueChildren, p as validateFieldRenames, r as attachValueDescriptor, s as descriptorFields } from \"../descriptor-CTY4mtwS.js\";\nimport { PaginationCursor, PaginationPageSize } from \"../runtime/pagination.js\";\nimport { Redacted, Schema, Struct } from \"effect\";\n//#region src/schema/values.ts\nconst LiteralValueSchema = Schema.Union([\n\tSchema.String,\n\tSchema.Finite,\n\tSchema.Boolean\n]);\nconst schemaIndexLimits = {\n\tfieldsPerIndex: 8,\n\tindexesPerSchema: 128,\n\tindexesPerTable: 16,\n\tkeyBytes: 4096,\n\tnameBytes: 64\n};\nconst utf8ByteLength = (value) => {\n\tlet bytes = 0;\n\tfor (const character of value) {\n\t\tconst point = character.codePointAt(0) ?? 0;\n\t\tbytes += point <= 127 ? 1 : point <= 2047 ? 2 : point <= 65535 ? 3 : 4;\n\t}\n\treturn bytes;\n};\nconst table = (fields) => {\n\tconst tableFields = fields;\n\tvalidateFieldRenames(tableFields);\n\tconst make = (indexes, schema = withValueChildren(attachValueDescriptor(Schema.Struct(tableFields), {\n\t\ttype: \"object\",\n\t\tfields: descriptorFields(tableFields)\n\t}), {\n\t\ttype: \"object\",\n\t\tfields: tableFields\n\t})) => {\n\t\tconst index = (name, fieldNames) => {\n\t\t\tif (utf8ByteLength(name) > schemaIndexLimits.nameBytes) throw new Error(`Index names cannot exceed ${schemaIndexLimits.nameBytes} UTF-8 bytes.`);\n\t\t\tif (name.length === 0) throw new Error(\"Index names cannot be empty.\");\n\t\t\tif (name.startsWith(\"$\")) throw new Error(\"Index names beginning with '$' are reserved.\");\n\t\t\tif (Object.hasOwn(indexes, name)) throw new Error(`Duplicate index name '${name}'.`);\n\t\t\tif (fieldNames.length > schemaIndexLimits.fieldsPerIndex) throw new Error(`Indexes cannot contain more than ${schemaIndexLimits.fieldsPerIndex} fields.`);\n\t\t\tif (new Set(fieldNames).size !== fieldNames.length) throw new Error(`Index '${name}' contains duplicate fields.`);\n\t\t\tfor (const fieldName of fieldNames) {\n\t\t\t\tif (!Object.hasOwn(tableFields, fieldName)) throw new Error(`Index '${name}' references unknown field '${fieldName}'.`);\n\t\t\t\tconst descriptor = getValueDescriptor(tableFields[fieldName]);\n\t\t\t\tif (!(descriptor?.type === \"boolean\" || descriptor?.type === \"date\" || descriptor?.type === \"id\" || descriptor?.type === \"integer\" || descriptor?.type === \"number\" || descriptor?.type === \"string\" || descriptor?.type === \"literal\" || descriptor?.type === \"literals\")) throw new Error(`Index '${name}' field '${fieldName}' is not indexable.`);\n\t\t\t\tif (descriptor.type === \"literals\" && !(descriptor.values.every(Schema.is(Schema.Boolean)) || descriptor.values.every(Schema.is(Schema.Finite)) || descriptor.values.every(Schema.is(Schema.String)))) throw new Error(`Index '${name}' field '${fieldName}' mixes value types.`);\n\t\t\t}\n\t\t\tconst duplicate = Object.values(indexes).find((candidate) => candidate.fields.length === fieldNames.length && candidate.fields.every((fieldName, position) => fieldName === fieldNames[position]));\n\t\t\tif (duplicate !== void 0) throw new Error(`Index '${name}' duplicates index '${duplicate.name}'.`);\n\t\t\tif (Object.keys(indexes).length >= schemaIndexLimits.indexesPerTable) throw new Error(`Tables cannot declare more than ${schemaIndexLimits.indexesPerTable} indexes.`);\n\t\t\treturn make({\n\t\t\t\t...indexes,\n\t\t\t\t[name]: {\n\t\t\t\t\tname,\n\t\t\t\t\tfields: fieldNames\n\t\t\t\t}\n\t\t\t}, schema);\n\t\t};\n\t\treturn {\n\t\t\t_tag: \"Table\",\n\t\t\tdescriptor: {\n\t\t\t\ttype: \"object\",\n\t\t\t\tfields: descriptorFields(tableFields)\n\t\t\t},\n\t\t\tfields: tableFields,\n\t\t\tfrom: (previous, convert) => make(indexes, schema.from(previous, convert)),\n\t\t\tindex,\n\t\t\tindexes,\n\t\t\tschema\n\t\t};\n\t};\n\treturn make({});\n};\nconst fresh = (value) => value.pipe(Schema.annotate({}));\nconst string = () => attachValueDescriptor(fresh(Schema.String), { type: \"string\" });\nconst number = () => attachValueDescriptor(fresh(Schema.Finite), { type: \"number\" });\nconst integer = () => attachValueDescriptor(fresh(Schema.Int), { type: \"integer\" });\nconst boolean = () => attachValueDescriptor(fresh(Schema.Boolean), { type: \"boolean\" });\nconst date = () => attachValueDescriptor(fresh(Schema.DateFromMillis), { type: \"date\" });\nconst file = (options = {}) => {\n\tconst formats = options.formats ?? fileFormats;\n\tif (formats.length === 0) throw new Error(\"File format lists cannot be empty.\");\n\tSchema.decodeUnknownSync(Schema.Array(FileFormat))(formats);\n\tif (new Set(formats).size !== formats.length) throw new Error(\"File format lists cannot contain duplicates.\");\n\tconst maxBytes = options.maxBytes ?? fileLimits.fileBytes;\n\tif (!Number.isSafeInteger(maxBytes) || maxBytes <= 0 || maxBytes > fileLimits.fileBytes) throw new Error(`File sizes must be between 1 and ${fileLimits.fileBytes} bytes.`);\n\treturn attachValueDescriptor(constrainedFileValue(formats, maxBytes), {\n\t\ttype: \"file\",\n\t\tformats: [...formats],\n\t\tmaxBytes\n\t});\n};\nconst never = () => attachValueDescriptor(fresh(Schema.Never), { type: \"never\" });\nconst nullValue = () => attachValueDescriptor(fresh(Schema.Null), { type: \"null\" });\nconst literal = (value) => {\n\tSchema.decodeSync(LiteralValueSchema)(value);\n\treturn attachValueDescriptor(Schema.Literal(value), {\n\t\ttype: \"literal\",\n\t\tvalue\n\t});\n};\nconst literals = (...members) => {\n\tSchema.decodeSync(Schema.Array(LiteralValueSchema))(members);\n\treturn attachValueDescriptor(Schema.Literals(members), {\n\t\ttype: \"literals\",\n\t\tvalues: members\n\t});\n};\nconst makeIdSchema = (tableName) => {\n\tconst identifier = `ignotum/id/${tableName}`;\n\treturn attachValueDescriptor(GeneratedId.pipe(Schema.brand(identifier), Schema.annotate({ \"ignotum/table\": tableName })), {\n\t\ttype: \"id\",\n\t\ttable: tableName\n\t});\n};\nconst userId = () => attachValueDescriptor(fresh(UserId), { type: \"userId\" });\nconst id = (tableName) => makeIdSchema(tableName);\nconst requireDescriptor = (value) => {\n\tconst descriptor = getValueDescriptor(value);\n\tif (descriptor === void 0) throw new Error(\"Ignotum value combinators require a values validator.\");\n\treturn descriptor;\n};\nconst array = (value) => {\n\treturn withValueChildren(attachValueDescriptor(Schema.Array(value), {\n\t\ttype: \"array\",\n\t\tvalue: requireDescriptor(value)\n\t}), {\n\t\ttype: \"array\",\n\t\tvalue\n\t});\n};\nconst assertFieldsExist = (fields, keys, operation) => {\n\tfor (const key of keys) if (!Object.hasOwn(fields, key)) throw new Error(`Cannot ${operation} unknown field '${String(key)}'.`);\n};\nconst fixedObject = (fields) => {\n\tvalidateFieldRenames(fields);\n\tconst pick = (...keys) => {\n\t\tassertFieldsExist(fields, keys, \"pick\");\n\t\treturn fixedObject(Struct.pick(fields, keys));\n\t};\n\tconst omit = (...keys) => {\n\t\tassertFieldsExist(fields, keys, \"omit\");\n\t\treturn fixedObject(Struct.omit(fields, keys));\n\t};\n\tconst extend = (addedFields, ..._validation) => {\n\t\tfor (const key of Reflect.ownKeys(addedFields)) if (Object.hasOwn(fields, key)) throw new Error(`Cannot extend existing field '${String(key)}'.`);\n\t\treturn fixedObject(Struct.assign(fields, addedFields));\n\t};\n\tconst override = (overriddenFields, ..._validation) => {\n\t\tassertFieldsExist(fields, Reflect.ownKeys(overriddenFields), \"override\");\n\t\treturn fixedObject(Struct.assign(fields, overriddenFields));\n\t};\n\tconst partial = () => {\n\t\tconst partialFields = Struct.map(fields, Schema.optional);\n\t\tfor (const name of Reflect.ownKeys(fields)) {\n\t\t\tconst field = fields[name];\n\t\t\tconst partialField = partialFields[name];\n\t\t\tif (field === void 0 || partialField === void 0) continue;\n\t\t\tattachValueDescriptor(partialField, {\n\t\t\t\ttype: \"optional\",\n\t\t\t\tvalue: requireDescriptor(field)\n\t\t\t});\n\t\t}\n\t\treturn fixedObject(partialFields);\n\t};\n\tconst schema = withValueChildren(attachValueDescriptor(Schema.Struct(fields), {\n\t\ttype: \"object\",\n\t\tfields: descriptorFields(fields)\n\t}), {\n\t\ttype: \"object\",\n\t\tfields\n\t});\n\treturn Object.assign(schema, {\n\t\textend,\n\t\tomit,\n\t\toverride,\n\t\tpartial,\n\t\tpick\n\t});\n};\nconst object = (fields) => fixedObject(fields);\nconst optional = (value) => {\n\treturn withValueChildren(attachValueDescriptor(Schema.optional(value), {\n\t\ttype: \"optional\",\n\t\tvalue: requireDescriptor(value)\n\t}), {\n\t\ttype: \"optional\",\n\t\tvalue\n\t});\n};\nconst nullable = (value) => {\n\treturn withValueChildren(attachValueDescriptor(Schema.NullOr(value), {\n\t\ttype: \"nullable\",\n\t\tvalue: requireDescriptor(value)\n\t}), {\n\t\ttype: \"nullable\",\n\t\tvalue\n\t});\n};\nconst record = (value) => {\n\treturn withValueChildren(attachValueDescriptor(Schema.Record(Schema.String, value), {\n\t\ttype: \"record\",\n\t\tvalue: requireDescriptor(value)\n\t}), {\n\t\ttype: \"record\",\n\t\tvalue\n\t});\n};\nconst union = (...members) => {\n\treturn withValueChildren(attachValueDescriptor(Schema.Union(members), {\n\t\ttype: \"union\",\n\t\tmembers: members.map(requireDescriptor)\n\t}), {\n\t\ttype: \"union\",\n\t\tmembers\n\t});\n};\nconst Secret = {\n\tisSecret: Redacted.isRedacted,\n\tvalue: Redacted.value\n};\nfunction secret(value = string()) {\n\treturn attachValueDescriptor(Schema.RedactedFromValue(value, { disallowEncode: true }), {\n\t\ttype: \"secret\",\n\t\tvalue: requireDescriptor(value)\n\t});\n}\nconst paginationCursor = () => attachValueDescriptor(fresh(PaginationCursor), { type: \"string\" });\nconst pagination = () => fixedObject({\n\tcursor: nullable(paginationCursor()),\n\tpageSize: attachValueDescriptor(fresh(PaginationPageSize), { type: \"integer\" })\n});\nconst page = (value) => {\n\treturn fixedObject({\n\t\titems: array(value),\n\t\tnextCursor: nullable(paginationCursor())\n\t});\n};\nconst error = (tag, fields) => {\n\tif (tag === \"InternalServerError\") throw new Error(\"The error tag 'InternalServerError' is reserved by Ignotum.\");\n\tconst errorFields = { ...fields };\n\tReflect.deleteProperty(errorFields, \"_tag\");\n\tconst schema = Schema.TaggedStruct(tag, errorFields).pipe(Schema.brand(ErrorBrand));\n\tconst make = (input) => schema.make(input);\n\tconst definition = Object.assign(make, schema);\n\tObject.setPrototypeOf(definition, Object.getPrototypeOf(schema));\n\tattachValueDescriptor(definition, {\n\t\ttype: \"error\",\n\t\ttag,\n\t\tfields: descriptorFields(errorFields)\n\t});\n\treturn definition;\n};\nconst values = {\n\tuserId,\n\tarray,\n\tboolean,\n\tdate,\n\tfile,\n\terror,\n\tid,\n\tinteger,\n\tliteral,\n\tliterals,\n\tnever,\n\tnull: nullValue,\n\tnullable,\n\tnumber,\n\tobject,\n\toptional,\n\trecord,\n\tstring,\n\tunion\n};\nconst environmentValues = {\n\tarray,\n\tboolean,\n\tdate,\n\tinteger,\n\tliteral,\n\tliterals,\n\tnever,\n\tnull: nullValue,\n\tnullable,\n\tnumber,\n\tobject,\n\toptional,\n\trecord,\n\tsecret,\n\tstring,\n\tunion\n};\nconst bindValues = (definition) => {\n\tconst boundId = (tableName) => makeIdSchema(tableName);\n\tconst doc = (tableName) => {\n\t\tconst tableDefinition = definition[tableName];\n\t\tif (tableDefinition === void 0) throw new Error(`Unknown table '${tableName}'.`);\n\t\tconst tableFields = tableDefinition.fields;\n\t\tconst systemFields = {\n\t\t\tid: boundId(tableName),\n\t\t\tcreatedAt: date(),\n\t\t\tupdatedAt: date()\n\t\t};\n\t\treturn fixedObject(Struct.assign(tableFields, systemFields));\n\t};\n\tconst boundPagination = () => {\n\t\treturn pagination();\n\t};\n\treturn {\n\t\t...values,\n\t\tdoc,\n\t\tid: boundId,\n\t\tpage,\n\t\tpagination: boundPagination\n\t};\n};\n//#endregion\nexport { Secret, bindValues, environmentValues, schemaIndexLimits, table, values };\n\n//# sourceMappingURL=values.js.map","//#region src/runtime/schema.ts\nconst FunctionSchemaTypeId = Symbol.for(\"ignotum/runtime/schema/FunctionSchema\");\nconst FunctionEnvironmentTypeId = Symbol.for(\"ignotum/runtime/schema/FunctionEnvironment\");\nconst attachFunctionSchema = (schema) => (definition) => {\n\tObject.defineProperty(definition, FunctionSchemaTypeId, {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\tvalue: schema,\n\t\twritable: false\n\t});\n\treturn definition;\n};\nconst getFunctionSchema = (value) => value[FunctionSchemaTypeId];\nconst attachFunctionEnvironment = (environment) => (definition) => {\n\tObject.defineProperty(definition, FunctionEnvironmentTypeId, {\n\t\tconfigurable: false,\n\t\tenumerable: false,\n\t\tvalue: environment,\n\t\twritable: false\n\t});\n\treturn definition;\n};\nconst getFunctionEnvironment = (value) => value[FunctionEnvironmentTypeId];\n//#endregion\nexport { FunctionEnvironmentTypeId, FunctionSchemaTypeId, attachFunctionEnvironment, attachFunctionSchema, getFunctionEnvironment, getFunctionSchema };\n\n//# sourceMappingURL=schema.js.map","import { FileFormat, FileId, FileValue, FileValueTypeId, fileFormats, fileLimits, fileMimeTypes, isFileValue } from \"./file.js\";\nimport { Result } from \"../runtime/result.js\";\nimport { a as descriptorContainsFile, c as getValueDescriptor, d as evolveStoredFields, f as evolveStoredValue, i as descriptorAllowedInEnvironment, l as applyValueDefaults, n as ValueDescriptorTypeId, o as descriptorContainsSecret, r as attachValueDescriptor, s as descriptorFields, t as ValueDescriptor, u as evolutionRules } from \"../descriptor-CTY4mtwS.js\";\nimport { Secret, bindValues, environmentValues, schemaIndexLimits, table, values } from \"./values.js\";\nimport { attachFunctionEnvironment, attachFunctionSchema } from \"../runtime/schema.js\";\nimport { Effect, Predicate, Result as Result$1, Schema } from \"effect\";\n//#region src/schema/types.ts\nconst SchemaDefinitionTypeId = Symbol.for(\"ignotum/schema/SchemaDefinition\");\n//#endregion\n//#region src/schema/definition.ts\nconst defineSchema = (define) => {\n\tconst definitions = define({\n\t\ttable,\n\t\tvalues\n\t});\n\tif (Object.values(definitions).reduce((count, definition) => count + Object.keys(definition.indexes).length, 0) > schemaIndexLimits.indexesPerSchema) throw new Error(`Schemas cannot declare more than ${schemaIndexLimits.indexesPerSchema} indexes.`);\n\treturn {\n\t\t_tag: \"Schema\",\n\t\t[SchemaDefinitionTypeId]: definitions\n\t};\n};\nconst isDefinedSchema = (value) => value._tag === \"Schema\" && Predicate.isObject(value[SchemaDefinitionTypeId]);\n//#endregion\n//#region src/schema/environment.ts\nconst EnvironmentDefinitionTypeId = Symbol.for(\"ignotum/schema/EnvironmentDefinition\");\nconst EnvironmentDecoderTypeId = Symbol.for(\"ignotum/schema/EnvironmentDecoder\");\nconst environmentLimits = {\n\tbytes: 65536,\n\tvariables: 128\n};\nvar EnvironmentValueInvalid = class extends Schema.TaggedError()(\"EnvironmentValueInvalid\", {\n\tkey: Schema.optional(Schema.String),\n\tmessage: Schema.String\n}) {};\nconst environmentName = /^[A-Z_][A-Z0-9_]*$/;\nconst defineEnv = (define) => {\n\tconst fields = define({ values: environmentValues });\n\tif (Reflect.ownKeys(fields).length > environmentLimits.variables) throw new Error(`Environments cannot declare more than ${environmentLimits.variables} variables.`);\n\tfor (const name of Reflect.ownKeys(fields)) {\n\t\tif (!Predicate.isString(name)) throw new Error(\"Environment variable names must be strings.\");\n\t\tif (!environmentName.test(name)) throw new Error(`Environment variable '${name}' must match ${environmentName.source}.`);\n\t\tif (name.startsWith(\"IGNOTUM_\")) throw new Error(`Environment variable '${name}' uses the reserved IGNOTUM_ prefix.`);\n\t}\n\tconst descriptors = descriptorFields(fields);\n\tfor (const field of descriptors) if (!descriptorAllowedInEnvironment(field.value)) throw new Error(`Environment variable '${field.name}' uses an unsupported validator.`);\n\tconst environment = {\n\t\t_tag: \"Environment\",\n\t\tfields,\n\t\tdescriptors,\n\t\tschema: Schema.Struct(fields),\n\t\t[EnvironmentDefinitionTypeId]: fields\n\t};\n\tObject.defineProperty(environment, EnvironmentDecoderTypeId, {\n\t\tenumerable: false,\n\t\tvalue: (raw) => decodeEnvironment(environment, raw)\n\t});\n\treturn Object.freeze(environment);\n};\nconst emptyEnv = defineEnv(() => ({}));\nconst isDefinedEnv = (value) => value._tag === \"Environment\" && Predicate.isObject(value[EnvironmentDefinitionTypeId]);\nconst utf8ByteLength = (value) => {\n\tlet bytes = 0;\n\tfor (const character of value) {\n\t\tconst point = character.codePointAt(0) ?? 0;\n\t\tbytes += point <= 127 ? 1 : point <= 2047 ? 2 : point <= 65535 ? 3 : 4;\n\t}\n\treturn bytes;\n};\nconst invalidValue = (key) => EnvironmentValueInvalid.make({\n\tkey,\n\tmessage: `Environment variable '${key}' does not match its declaration.`\n});\nconst decodeEnvironment = Effect.fn(\"Environment.decode\")(function* (environment, raw) {\n\tconst declared = new Set(Object.keys(environment.fields));\n\tconst supplied = Object.keys(raw);\n\tif (supplied.length > environmentLimits.variables) return yield* EnvironmentValueInvalid.make({ message: `Environments cannot contain more than ${environmentLimits.variables} variables.` });\n\tconst rawJson = JSON.stringify(raw);\n\tif (utf8ByteLength(rawJson) > environmentLimits.bytes) return yield* EnvironmentValueInvalid.make({ message: `Environments cannot exceed ${environmentLimits.bytes} UTF-8 bytes.` });\n\tfor (const key of supplied) if (!declared.has(key)) return yield* EnvironmentValueInvalid.make({\n\t\tkey,\n\t\tmessage: `Environment variable '${key}' is not declared in server/env.ts.`\n\t});\n\tconst decoded = {};\n\tfor (const [key, field] of Object.entries(environment.fields)) {\n\t\tconst input = Object.hasOwn(raw, key) ? raw[key] : void 0;\n\t\tconst direct = yield* Effect.result(Schema.decodeUnknownEffect(field)(input));\n\t\tif (Result$1.isSuccess(direct)) {\n\t\t\tif (direct.success !== void 0) Reflect.set(decoded, key, direct.success);\n\t\t\tcontinue;\n\t\t}\n\t\tif (input === void 0) return yield* invalidValue(key);\n\t\tconst parsed = yield* Effect.result(Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.Unknown))(input));\n\t\tif (Result$1.isFailure(parsed)) return yield* invalidValue(key);\n\t\tconst fromJson = yield* Effect.result(Schema.decodeUnknownEffect(field)(parsed.success));\n\t\tif (Result$1.isFailure(fromJson)) return yield* invalidValue(key);\n\t\tif (fromJson.success !== void 0) Reflect.set(decoded, key, fromJson.success);\n\t}\n\treturn Object.freeze(decoded);\n});\nconst decodeDefinedEnvironment = (environment, raw) => environment[EnvironmentDecoderTypeId](raw);\n//#endregion\n//#region src/schema/server.ts\nconst makeFunctionBuilder = (schema, environment, kind) => {\n\tconst define = (definition) => attachFunctionEnvironment(environment)(attachFunctionSchema(schema)({\n\t\t_tag: kind,\n\t\t...definition\n\t}));\n\treturn define;\n};\nconst makeFunctionBuilders = (schema, environment) => ({\n\tmutation: makeFunctionBuilder(schema, environment, \"Mutation\"),\n\tquery: makeFunctionBuilder(schema, environment, \"Query\")\n});\nfunction bindSchema(schema, environment = emptyEnv) {\n\treturn {\n\t\tvalues: bindValues(schema[SchemaDefinitionTypeId]),\n\t\t...makeFunctionBuilders(schema, environment)\n\t};\n}\n//#endregion\nexport { EnvironmentDefinitionTypeId, EnvironmentValueInvalid, FileFormat, FileId, FileValue, FileValueTypeId, Result, SchemaDefinitionTypeId, Secret, ValueDescriptor, ValueDescriptorTypeId, applyValueDefaults, attachValueDescriptor, bindSchema, bindValues, decodeDefinedEnvironment, decodeEnvironment, defineEnv, defineSchema, descriptorAllowedInEnvironment, descriptorContainsFile, descriptorContainsSecret, descriptorFields, emptyEnv, environmentLimits, environmentValues, evolutionRules, evolveStoredFields, evolveStoredValue, fileFormats, fileLimits, fileMimeTypes, getValueDescriptor, isDefinedEnv, isDefinedSchema, isFileValue, schemaIndexLimits, table, values };\n\n//# sourceMappingURL=index.js.map"],"mappings":";;;;;AAQA,MAAM,qBAAqB,OAAO,MAAM;CACvC,OAAO;CACP,OAAO;CACP,OAAO;AACR,CAAC;AACD,MAAM,oBAAoB;CACzB,gBAAgB;CAChB,kBAAkB;CAClB,iBAAiB;CACjB,UAAU;CACV,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D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync-DzUwA8W9.js","names":[],"sources":["../../../contracts/dist/runtime/identity.js","../../../contracts/dist/runtime/sync.js"],"sourcesContent":["import { AppId, AuthAccountId, AuthDeviceCodeId, AuthInternalId, AuthInvitationId, AuthMemberId, AuthSessionId, AuthVerificationId, ConnectionId, DevDatabaseLockId, InvocationId, PlatformPrincipalId, RequestId, RuntimeRequestNonce, SubscriptionId, TableId, TeamId, VersionId, defineId } from \"./id.js\";\nimport { Schema } from \"effect\";\n//#region src/runtime/identity.ts\nconst InvocationKey = Schema.String.pipe(Schema.brand(\"ignotum/hosted/InvocationKey\"));\nconst ActivationGeneration = Schema.Natural.pipe(Schema.brand(\"ignotum/hosted/ActivationGeneration\"));\nconst AppStateRevision = Schema.Natural.pipe(Schema.brand(\"ignotum/hosted/AppStateRevision\"));\nconst VersionNumber = Schema.Int.check(Schema.isGreaterThan(0)).pipe(Schema.brand(\"ignotum/hosted/VersionNumber\"));\nconst ClientApiVersion = Schema.Int.check(Schema.isGreaterThan(0)).pipe(Schema.brand(\"ignotum/platform/ClientApiVersion\"));\nconst ServerApiVersion = Schema.Int.check(Schema.isGreaterThan(0)).pipe(Schema.brand(\"ignotum/platform/ServerApiVersion\"));\nconst CapabilityId = Schema.String.check(Schema.isTrimmed(), Schema.isPattern(/^[a-z][a-z0-9]*(?:[./-][a-z0-9]+)*$/), Schema.isMaxLength(128)).pipe(Schema.brand(\"ignotum/platform/CapabilityId\"));\nconst PlatformReleaseId = defineId(\"rel\", \"ignotum/platform/PlatformReleaseId\");\nconst PlatformGeneration = Schema.Natural.pipe(Schema.brand(\"ignotum/platform/PlatformGeneration\"));\nconst ProtocolVersion = Schema.Int.check(Schema.isGreaterThan(0)).pipe(Schema.brand(\"ignotum/platform/ProtocolVersion\"));\nconst DataHistoryId = defineId(\"hist\", \"ignotum/hosted/DataHistoryId\");\n//#endregion\nexport { ActivationGeneration, AppId, AppStateRevision, AuthAccountId, AuthDeviceCodeId, AuthInternalId, AuthInvitationId, AuthMemberId, AuthSessionId, AuthVerificationId, CapabilityId, ClientApiVersion, ConnectionId, DataHistoryId, DevDatabaseLockId, InvocationId, InvocationKey, PlatformGeneration, PlatformPrincipalId, PlatformReleaseId, ProtocolVersion, RequestId, RuntimeRequestNonce, ServerApiVersion, SubscriptionId, TableId, TeamId, VersionId, VersionNumber };\n\n//# sourceMappingURL=identity.js.map","import { AppId, InvocationId, SubscriptionId, VersionId } from \"./id.js\";\nimport { ActivationGeneration, AppStateRevision } from \"./identity.js\";\nimport { FileId } from \"../schema/file.js\";\nimport { TransportValueSchema, datePathsOf, datePathsOfObject, decodeTransportObject, decodeTransportValue, encodeTransportObject, encodeTransportValue } from \"./value.js\";\nimport { SessionState } from \"../id.js\";\nimport { Schema } from \"effect\";\n//#region src/runtime/sync.ts\nconst FunctionNamePart = Schema.String.check(Schema.isPattern(/^[A-Za-z_$][A-Za-z0-9_$]*$/));\nconst ApiFunctionAddressParts = Schema.TemplateLiteralParser([\n\t\"api.\",\n\tFunctionNamePart,\n\t\".\",\n\tFunctionNamePart\n]);\nconst FunctionAddress = Schema.TemplateLiteral([\n\t\"api.\",\n\tFunctionNamePart,\n\t\".\",\n\tFunctionNamePart\n]);\nconst apiFunctionParts = (address) => {\n\tconst [, moduleName, , functionName] = Schema.decodeSync(ApiFunctionAddressParts)(address);\n\treturn {\n\t\tfunctionName,\n\t\tmoduleName\n\t};\n};\nconst Subscribe = Schema.Struct({\n\ttype: Schema.Literal(\"Subscribe\"),\n\tid: SubscriptionId,\n\tfunction: FunctionAddress,\n\targs: Schema.Json\n});\nconst Unsubscribe = Schema.Struct({\n\ttype: Schema.Literal(\"Unsubscribe\"),\n\tid: SubscriptionId\n});\nconst Invoke = Schema.Struct({\n\ttype: Schema.Literal(\"Invoke\"),\n\tid: InvocationId,\n\tkind: Schema.Literal(\"Mutation\"),\n\tfunction: FunctionAddress,\n\targs: Schema.Json\n});\nconst Prepare = Schema.Struct({\n\ttype: Schema.Literal(\"Prepare\"),\n\tid: InvocationId,\n\tkind: Schema.Literal(\"Mutation\"),\n\tfunction: FunctionAddress,\n\targs: Schema.Json,\n\tfiles: Schema.Array(FileId)\n});\nconst ClientMessage = Schema.Union([\n\tSubscribe,\n\tUnsubscribe,\n\tPrepare,\n\tInvoke\n]);\nconst SubscriptionOperation = Schema.Struct({\n\ttype: Schema.Literal(\"Subscription\"),\n\tid: SubscriptionId\n});\nconst InvocationOperation = Schema.Struct({\n\ttype: Schema.Literal(\"Invocation\"),\n\tid: InvocationId\n});\nconst Operation = Schema.Union([SubscriptionOperation, InvocationOperation]);\nconst DatePath = Schema.Array(Schema.Union([Schema.String, Schema.Natural]));\nconst DatePaths = Schema.Array(DatePath);\nconst WireSuccess = Schema.Struct({\n\ttype: Schema.Literal(\"Success\"),\n\tvalue: Schema.optional(Schema.Json),\n\tdates: Schema.optional(DatePaths)\n});\nconst WireFailure = Schema.Struct({\n\ttype: Schema.Literal(\"Failure\"),\n\terror: Schema.Json,\n\tdates: Schema.optional(DatePaths)\n});\nconst WireResult = Schema.Union([WireSuccess, WireFailure]);\nconst SyncHandshake = Schema.Struct({\n\tsession: Schema.optional(SessionState),\n\tserverTime: Schema.optional(Schema.Finite),\n\ttype: Schema.Literal(\"Handshake\"),\n\tappId: AppId,\n\tversionId: VersionId,\n\tgeneration: ActivationGeneration\n});\nconst Snapshot = Schema.Struct({\n\tidentity: Schema.optional(Schema.Struct({\n\t\tsessionEpoch: Schema.String,\n\t\tviewRevision: Schema.Natural,\n\t\tdependsOnId: Schema.Boolean\n\t})),\n\ttype: Schema.Literal(\"Snapshot\"),\n\tid: SubscriptionId,\n\tresult: WireResult,\n\trevision: AppStateRevision,\n\tfiles: Schema.optional(Schema.Array(Schema.Struct({\n\t\tid: FileId,\n\t\turl: Schema.String\n\t})))\n});\nconst Preparation = Schema.Struct({\n\tsessionEpoch: Schema.optional(Schema.String),\n\ttype: Schema.Literal(\"Preparation\"),\n\tid: InvocationId,\n\tkind: Schema.Literal(\"Mutation\"),\n\tuploads: Schema.Array(Schema.Struct({\n\t\tid: FileId,\n\t\turl: Schema.optional(Schema.String)\n\t}))\n});\nconst SyncResultSuccess = Schema.Struct({\n\tsessionEpoch: Schema.optional(Schema.String),\n\ttype: Schema.Literal(\"Result\"),\n\tid: InvocationId,\n\tresult: WireSuccess,\n\tcommittedRevision: AppStateRevision\n});\nconst SyncResultFailure = Schema.Struct({\n\tsessionEpoch: Schema.optional(Schema.String),\n\ttype: Schema.Literal(\"Result\"),\n\tid: InvocationId,\n\tresult: WireFailure\n});\nconst ErrorCode = Schema.Literals([\n\t\"SessionChanged\",\n\t\"SessionExpired\",\n\t\"DuplicateOperationId\",\n\t\"FunctionUnavailable\",\n\t\"InvalidArguments\",\n\t\"InvalidMessage\",\n\t\"InvocationIdConflict\",\n\t\"ResourceLimitExceeded\",\n\t\"UnknownFunction\",\n\t\"WrongFunctionKind\"\n]);\nconst SyncError = Schema.Struct({\n\tsessionEpoch: Schema.optional(Schema.String),\n\ttype: Schema.Literal(\"Error\"),\n\toperation: Schema.optional(Operation),\n\tcode: ErrorCode,\n\tmessage: Schema.String\n});\nconst Version = Schema.Struct({\n\ttype: Schema.Literal(\"Version\"),\n\tversionId: VersionId,\n\tgeneration: ActivationGeneration\n});\nconst VersionCloseCode = 4409;\nconst Session = Schema.Union([Schema.Struct({\n\ttype: Schema.Literal(\"Session\"),\n\tevent: Schema.Literal(\"Updated\"),\n\tserverTime: Schema.Finite,\n\tsession: SessionState\n}), Schema.Struct({\n\ttype: Schema.Literal(\"Session\"),\n\tevent: Schema.Literals([\n\t\t\"SignedOut\",\n\t\t\"Revoked\",\n\t\t\"Expired\",\n\t\t\"Unavailable\",\n\t\t\"Replaced\"\n\t]),\n\tsessionEpoch: Schema.String\n})]);\nconst Invalidate = Schema.Struct({\n\ttype: Schema.Literal(\"Invalidate\"),\n\tsessionEpoch: Schema.String,\n\tids: Schema.Array(SubscriptionId)\n});\nconst ServerMessage = Schema.Union([\n\tSession,\n\tInvalidate,\n\tSyncHandshake,\n\tSnapshot,\n\tPreparation,\n\tSyncResultSuccess,\n\tSyncResultFailure,\n\tSyncError,\n\tVersion\n]);\nconst ClientMessageJson = Schema.fromJsonString(ClientMessage);\nconst ServerMessageJson = Schema.fromJsonString(ServerMessage);\n//#endregion\nexport { ClientMessage, ClientMessageJson, DatePath, ErrorCode, FunctionAddress, FunctionNamePart, Invalidate, InvocationId, Operation, ServerMessage, ServerMessageJson, Session, SubscriptionId, SyncHandshake, TransportValueSchema, Version, VersionCloseCode, WireFailure, WireResult, WireSuccess, apiFunctionParts, datePathsOf, datePathsOfObject, decodeTransportObject, decodeTransportValue, encodeTransportObject, encodeTransportValue };\n\n//# sourceMappingURL=sync.js.map"],"mappings":";;;AAGA,MAAM,gBAAgB,OAAO,OAAO,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACrF,MAAM,uBAAuB,OAAO,QAAQ,KAAK,OAAO,MAAM,qCAAqC,CAAC;AACpG,MAAM,mBAAmB,OAAO,QAAQ,KAAK,OAAO,MAAM,iCAAiC,CAAC;AAC5F,MAAM,gBAAgB,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,8BAA8B,CAAC;AACjH,MAAM,mBAAmB,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,mCAAmC,CAAC;AACzH,MAAM,mBAAmB,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,mCAAmC,CAAC;AACzH,MAAM,eAAe,OAAO,OAAO,MAAM,OAAO,UAAU,GAAG,OAAO,UAAU,qCAAqC,GAAG,OAAO,YAAY,GAAG,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,+BAA+B,CAAC;AACjM,MAAM,oBAAoB,SAAS,OAAO,oCAAoC;AAC9E,MAAM,qBAAqB,OAAO,QAA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QAAQ,QAAQ;CAC7B,IAAI;CACJ,QAAQ;CACR,mBAAmB;AACpB,CAAC;AACD,MAAM,oBAAoB,OAAO,OAAO;CACvC,cAAc,OAAO,SAAS,OAAO,MAAM;CAC3C,MAAM,OAAO,QAAQ,QAAQ;CAC7B,IAAI;CACJ,QAAQ;AACT,CAAC;AACD,MAAM,YAAY,OAAO,SAAS;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,MAAM,YAAY,OAAO,OAAO;CAC/B,cAAc,OAAO,SAAS,OAAO,MAAM;CAC3C,MAAM,OAAO,QAAQ,OAAO;CAC5B,WAAW,OAAO,SAAS,SAAS;CACpC,MAAM;CACN,SAAS,OAAO;AACjB,CAAC;AACD,MAAM,UAAU,OAAO,OAAO;CAC7B,MAAM,OAAO,QAAQ,SAAS;CAC9B,WAAW;CACX,YAAY;AACb,CAAC;AAED,MAAM,UAAU,OAAO,MAAM,CAAC,OAAO,OAAO;CAC3C,MAAM,OAAO,QAAQ,SAAS;CAC9B,OAAO,OAAO,QAAQ,SAAS;CAC/B,YAAY,OAAO;CACnB,SAAS;AACV,CAAC,GAAG,OAAO,OAAO;CACjB,MAAM,OAAO,QAAQ,SAAS;CAC9B,OAAO,OAAO,SAAS;EACtB;EACA;EACA;EACA;EACA;CACD,CAAC;CACD,cAAc,OAAO;AACtB,CAAC,CAAC,CAAC;AACH,MAAM,aAAa,OAAO,OAAO;CAChC,MAAM,OAAO,QAAQ,YAAY;CACjC,cAAc,OAAO;CACrB,KAAK,OAAO,MAAM,cAAc;AACjC,CAAC;AACD,MAAM,gBAAgB,OAAO,MAAM;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACyB,OAAO,eAAe,aAAa;AACnC,OAAO,eAAe,aAAa"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from "node:url";
|
|
2
|
-
import { NodeRuntime, NodeServices } from "@effect/platform-node";
|
|
3
|
-
import { Config, Effect, Path } from "effect";
|
|
4
|
-
import { writeManagedReleaseGraphs } from "./managed-release.js";
|
|
5
|
-
|
|
6
|
-
Effect.gen(function* () {
|
|
7
|
-
const path = yield* Path.Path;
|
|
8
|
-
const sdkDirectory = fileURLToPath(new URL("../../", import.meta.url));
|
|
9
|
-
const output = yield* Config.string("IGNOTUM_MANAGED_RELEASE_DIRECTORY").pipe(
|
|
10
|
-
Config.withDefault(path.join(sdkDirectory, "dist/managed")),
|
|
11
|
-
);
|
|
12
|
-
yield* writeManagedReleaseGraphs(sdkDirectory, output);
|
|
13
|
-
}).pipe(Effect.provide(NodeServices.layer), NodeRuntime.runMain);
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from "node:url";
|
|
2
|
-
import { Effect, FileSystem, Path, Predicate, Schema } from "effect";
|
|
3
|
-
import type { Plugin } from "vite";
|
|
4
|
-
import { normalizePath } from "vite";
|
|
5
|
-
import { ManagedReleaseManifest } from "@ignotum/contracts/managed-release";
|
|
6
|
-
import {
|
|
7
|
-
encodeManagedReleaseManifest,
|
|
8
|
-
validateManagedReleaseGraph,
|
|
9
|
-
} from "@ignotum/versions/managed-release";
|
|
10
|
-
import { sha256, utf8Bytes } from "@ignotum/versions";
|
|
11
|
-
import {
|
|
12
|
-
managedBrowserExports,
|
|
13
|
-
managedGuestExports,
|
|
14
|
-
managedPreactVersion,
|
|
15
|
-
} from "./managed-exports.js";
|
|
16
|
-
import { InvalidBuildOutput, runViteBuild } from "./build/artifact.js";
|
|
17
|
-
|
|
18
|
-
interface EmittedModule {
|
|
19
|
-
readonly path: string;
|
|
20
|
-
readonly bytes: Uint8Array;
|
|
21
|
-
readonly imports: ReadonlyArray<string>;
|
|
22
|
-
readonly exports: ReadonlyArray<string>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** Release publication uses SDK sources; installed local development uses packed SDK entries. */
|
|
26
|
-
export const buildManagedReleaseGraph = Effect.fn("ManagedRelease.buildGraph")(function* (
|
|
27
|
-
sdkDirectory: string,
|
|
28
|
-
kind: "Browser" | "Guest",
|
|
29
|
-
inputKind: "Source" | "Packed" = "Source",
|
|
30
|
-
) {
|
|
31
|
-
const path = yield* Path.Path;
|
|
32
|
-
if (kind === "Browser") {
|
|
33
|
-
const fs = yield* FileSystem.FileSystem;
|
|
34
|
-
const preact = yield* Schema.decodeEffect(
|
|
35
|
-
Schema.fromJsonString(Schema.Struct({ version: Schema.String })),
|
|
36
|
-
)(yield* fs.readFileString(fileURLToPath(import.meta.resolve("preact/package.json"))));
|
|
37
|
-
if (preact.version !== managedPreactVersion)
|
|
38
|
-
return yield* InvalidBuildOutput.make({
|
|
39
|
-
message: `The installed Preact version ${preact.version} differs from compiler peer metadata ${managedPreactVersion}. Update and validate the shared managed export mapping before publishing.`,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
const prefix = `ignotum/platform/${kind.toLowerCase()}/`;
|
|
43
|
-
const entries = kind === "Browser" ? managedBrowserExports : managedGuestExports;
|
|
44
|
-
const modules: Array<EmittedModule> = [];
|
|
45
|
-
const files: Array<{ path: string; bytes: Uint8Array }> = [];
|
|
46
|
-
const rendererRoots = new Set<string>();
|
|
47
|
-
const plugin: Plugin = {
|
|
48
|
-
name: "ignotum:managed-release-ownership",
|
|
49
|
-
enforce: "pre",
|
|
50
|
-
resolveId(id) {
|
|
51
|
-
if (id.startsWith("node:") || id.startsWith("@effect/platform-node"))
|
|
52
|
-
this.error(`Managed ${kind} modules cannot import Node capabilities: ${id}.`);
|
|
53
|
-
},
|
|
54
|
-
generateBundle(_options, bundle) {
|
|
55
|
-
for (const item of Object.values(bundle)) {
|
|
56
|
-
if (item.type === "asset") {
|
|
57
|
-
if (!item.fileName.endsWith(".js.map"))
|
|
58
|
-
this.error(`Unexpected managed release asset '${item.fileName}'.`);
|
|
59
|
-
const artifact = {
|
|
60
|
-
path: item.fileName,
|
|
61
|
-
bytes: Predicate.isString(item.source) ? utf8Bytes(item.source) : item.source,
|
|
62
|
-
};
|
|
63
|
-
const existing = files.findIndex((file) => file.path === artifact.path);
|
|
64
|
-
if (existing < 0) files.push(artifact);
|
|
65
|
-
else files[existing] = artifact;
|
|
66
|
-
continue;
|
|
67
|
-
}
|
|
68
|
-
for (const [id, module] of Object.entries(item.modules)) {
|
|
69
|
-
if (module.renderedLength === 0) continue;
|
|
70
|
-
const normalized = normalizePath(id);
|
|
71
|
-
if (
|
|
72
|
-
normalized.includes("/src/cli/") ||
|
|
73
|
-
normalized.includes("/platform-node/") ||
|
|
74
|
-
(kind === "Browser" &&
|
|
75
|
-
(normalized.includes("/runtime/src/guest.") ||
|
|
76
|
-
normalized.includes("/ignotum/src/server/") ||
|
|
77
|
-
normalized.includes("/ignotum/src/internal/host.")))
|
|
78
|
-
)
|
|
79
|
-
this.error(`Unexpected implementation in managed ${kind} graph: ${normalized}.`);
|
|
80
|
-
const marker = "/node_modules/preact/";
|
|
81
|
-
const renderer = normalized.lastIndexOf(marker);
|
|
82
|
-
if (renderer >= 0) rendererRoots.add(normalized.slice(0, renderer + marker.length));
|
|
83
|
-
}
|
|
84
|
-
const bytes = utf8Bytes(item.code);
|
|
85
|
-
if (!files.some((file) => file.path === `${item.fileName}.map`)) {
|
|
86
|
-
// Generated re-export facades have no source locations. Keep an explicit empty map.
|
|
87
|
-
const sourceMap =
|
|
88
|
-
item.map?.toString() ??
|
|
89
|
-
JSON.stringify({
|
|
90
|
-
version: 3,
|
|
91
|
-
file: item.fileName,
|
|
92
|
-
sources: [],
|
|
93
|
-
names: [],
|
|
94
|
-
mappings: "",
|
|
95
|
-
});
|
|
96
|
-
files.push({ path: `${item.fileName}.map`, bytes: utf8Bytes(sourceMap) });
|
|
97
|
-
}
|
|
98
|
-
modules.push({
|
|
99
|
-
path: item.fileName,
|
|
100
|
-
bytes,
|
|
101
|
-
imports: [...new Set([...item.imports, ...item.dynamicImports])].sort(),
|
|
102
|
-
exports: [...item.exports].sort(),
|
|
103
|
-
});
|
|
104
|
-
files.push({ path: item.fileName, bytes });
|
|
105
|
-
}
|
|
106
|
-
if (kind === "Browser" && rendererRoots.size !== 1)
|
|
107
|
-
this.error(
|
|
108
|
-
`Managed browser release must contain one Preact package, found ${rendererRoots.size}.`,
|
|
109
|
-
);
|
|
110
|
-
if (kind === "Guest" && rendererRoots.size !== 0)
|
|
111
|
-
this.error("Managed guest release cannot contain a renderer.");
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
const input = Object.fromEntries(
|
|
115
|
-
entries.map((entry) => [
|
|
116
|
-
entry.fileName,
|
|
117
|
-
entry.source.startsWith("preact")
|
|
118
|
-
? fileURLToPath(import.meta.resolve(entry.source))
|
|
119
|
-
: inputKind === "Source"
|
|
120
|
-
? path.join(sdkDirectory, "src", entry.source)
|
|
121
|
-
: path.join(
|
|
122
|
-
sdkDirectory,
|
|
123
|
-
"dist/runtime",
|
|
124
|
-
`${entry.specifier.slice("ignotum/".length)}.js`,
|
|
125
|
-
),
|
|
126
|
-
]),
|
|
127
|
-
);
|
|
128
|
-
yield* runViteBuild(`managed ${kind} release`, {
|
|
129
|
-
configFile: false,
|
|
130
|
-
root: sdkDirectory,
|
|
131
|
-
publicDir: false,
|
|
132
|
-
logLevel: "warn",
|
|
133
|
-
mode: "production",
|
|
134
|
-
define: { "process.env.NODE_ENV": JSON.stringify("production") },
|
|
135
|
-
plugins: [plugin],
|
|
136
|
-
resolve: {
|
|
137
|
-
alias: managedBrowserExports
|
|
138
|
-
.filter((entry) => entry.specifier.startsWith("preact"))
|
|
139
|
-
.map((entry) => ({
|
|
140
|
-
find: new RegExp(`^${entry.specifier}$`),
|
|
141
|
-
replacement: fileURLToPath(import.meta.resolve(entry.source)),
|
|
142
|
-
})),
|
|
143
|
-
conditions: ["@ignotum/source", "module", "browser", "production"],
|
|
144
|
-
dedupe: ["preact"],
|
|
145
|
-
noExternal: true,
|
|
146
|
-
},
|
|
147
|
-
build: {
|
|
148
|
-
write: false,
|
|
149
|
-
sourcemap: "hidden",
|
|
150
|
-
minify: "oxc",
|
|
151
|
-
target: "es2020",
|
|
152
|
-
modulePreload: false,
|
|
153
|
-
rolldownOptions: {
|
|
154
|
-
input,
|
|
155
|
-
preserveEntrySignatures: "strict",
|
|
156
|
-
output: {
|
|
157
|
-
format: "es",
|
|
158
|
-
entryFileNames: `${prefix}[name].js`,
|
|
159
|
-
chunkFileNames: `${prefix}chunks/[name]-[hash].js`,
|
|
160
|
-
sourcemapPathTransform: (source) => {
|
|
161
|
-
const normalized = normalizePath(source);
|
|
162
|
-
const dependency = normalized.lastIndexOf("/node_modules/");
|
|
163
|
-
return dependency >= 0
|
|
164
|
-
? `ignotum://dependency/${normalized.slice(dependency + "/node_modules/".length)}`
|
|
165
|
-
: `ignotum://platform/${normalized.replace(/^(?:\.\.\/)+/, "")}`;
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
const descriptions = yield* Effect.forEach(modules, (module) =>
|
|
172
|
-
Effect.gen(function* () {
|
|
173
|
-
const sourceMap = files.find((file) => file.path === `${module.path}.map`);
|
|
174
|
-
if (sourceMap === undefined)
|
|
175
|
-
return yield* new InvalidBuildOutput({ message: `Missing source map for ${module.path}.` });
|
|
176
|
-
return {
|
|
177
|
-
path: module.path,
|
|
178
|
-
sha256: yield* sha256(module.bytes),
|
|
179
|
-
size: module.bytes.byteLength,
|
|
180
|
-
imports: module.imports,
|
|
181
|
-
exports: module.exports,
|
|
182
|
-
sourceMap: {
|
|
183
|
-
path: sourceMap.path,
|
|
184
|
-
sha256: yield* sha256(sourceMap.bytes),
|
|
185
|
-
size: sourceMap.bytes.byteLength,
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
|
-
}),
|
|
189
|
-
);
|
|
190
|
-
const manifest = yield* Schema.decodeUnknownEffect(ManagedReleaseManifest)({
|
|
191
|
-
formatVersion: 1,
|
|
192
|
-
kind,
|
|
193
|
-
entries: Object.fromEntries(
|
|
194
|
-
entries.map((entry) => [entry.specifier, `${prefix}${entry.fileName}.js`]),
|
|
195
|
-
),
|
|
196
|
-
modules: descriptions.sort((a, b) => a.path.localeCompare(b.path)),
|
|
197
|
-
});
|
|
198
|
-
const manifestBytes = encodeManagedReleaseManifest(manifest);
|
|
199
|
-
const verified = yield* validateManagedReleaseGraph(manifestBytes, files);
|
|
200
|
-
return { ...verified, manifestBytes };
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
export const buildManagedReleaseGraphs = Effect.fn("ManagedRelease.buildGraphs")(function* (
|
|
204
|
-
sdkDirectory: string,
|
|
205
|
-
inputKind: "Source" | "Packed" = "Source",
|
|
206
|
-
) {
|
|
207
|
-
// Build sequentially to bound compiler memory. Each graph has its own private dependencies.
|
|
208
|
-
const browser = yield* buildManagedReleaseGraph(sdkDirectory, "Browser", inputKind);
|
|
209
|
-
const guest = yield* buildManagedReleaseGraph(sdkDirectory, "Guest", inputKind);
|
|
210
|
-
return { browser, guest };
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
/** Fixtures and local development resolve exactly the entries that publication verifies. */
|
|
214
|
-
export const localManagedReleaseProvider = Effect.fn("ManagedRelease.localProvider")(function* (
|
|
215
|
-
sdkDirectory: string,
|
|
216
|
-
) {
|
|
217
|
-
const fs = yield* FileSystem.FileSystem;
|
|
218
|
-
const path = yield* Path.Path;
|
|
219
|
-
const hasWorkspaceSources = yield* fs.exists(
|
|
220
|
-
path.resolve(sdkDirectory, "../contracts/src/schema/index.ts"),
|
|
221
|
-
);
|
|
222
|
-
const graphs = yield* buildManagedReleaseGraphs(
|
|
223
|
-
sdkDirectory,
|
|
224
|
-
hasWorkspaceSources ? "Source" : "Packed",
|
|
225
|
-
);
|
|
226
|
-
return {
|
|
227
|
-
...graphs,
|
|
228
|
-
resolve: (kind: "Browser" | "Guest", specifier: string) =>
|
|
229
|
-
(kind === "Browser" ? graphs.browser : graphs.guest).manifest.entries[specifier],
|
|
230
|
-
read: (kind: "Browser" | "Guest", modulePath: string) =>
|
|
231
|
-
(kind === "Browser" ? graphs.browser : graphs.guest).files.get(modulePath)?.slice(),
|
|
232
|
-
};
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
export const writeManagedReleaseGraphs = Effect.fn("ManagedRelease.writeGraphs")(function* (
|
|
236
|
-
sdkDirectory: string,
|
|
237
|
-
outputDirectory: string,
|
|
238
|
-
) {
|
|
239
|
-
const fs = yield* FileSystem.FileSystem;
|
|
240
|
-
const path = yield* Path.Path;
|
|
241
|
-
const graphs = yield* buildManagedReleaseGraphs(sdkDirectory);
|
|
242
|
-
for (const graph of [graphs.browser, graphs.guest]) {
|
|
243
|
-
const directory = path.join(outputDirectory, graph.sha256);
|
|
244
|
-
yield* fs.makeDirectory(directory, { recursive: true });
|
|
245
|
-
for (const [name, bytes] of graph.files) {
|
|
246
|
-
const target = path.join(directory, name);
|
|
247
|
-
yield* fs.makeDirectory(path.dirname(target), { recursive: true });
|
|
248
|
-
yield* fs.writeFile(target, bytes);
|
|
249
|
-
}
|
|
250
|
-
yield* fs.writeFile(path.join(directory, "manifest.json"), graph.manifestBytes);
|
|
251
|
-
yield* Effect.logInfo("Built managed runtime graph", {
|
|
252
|
-
kind: graph.manifest.kind,
|
|
253
|
-
sha256: graph.sha256,
|
|
254
|
-
modules: graph.manifest.modules.length,
|
|
255
|
-
moduleBytes: graph.manifest.modules.reduce((sum, module) => sum + module.size, 0),
|
|
256
|
-
directory,
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
return graphs;
|
|
260
|
-
});
|