@appport/sdk 1.1.19 → 1.1.20
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/LICENSE +126 -0
- package/README.md +86 -9
- package/dist/application-onboarding.d.ts +52 -0
- package/dist/application-onboarding.d.ts.map +1 -0
- package/dist/application-onboarding.js +50 -0
- package/dist/application-onboarding.js.map +1 -0
- package/dist/external-compatibility.d.ts +142 -0
- package/dist/external-compatibility.d.ts.map +1 -0
- package/dist/external-compatibility.js +132 -0
- package/dist/external-compatibility.js.map +1 -0
- package/dist/index.d.ts +18 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -13
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/provider-lifecycle.d.ts +247 -0
- package/dist/provider-lifecycle.d.ts.map +1 -0
- package/dist/provider-lifecycle.js +314 -0
- package/dist/provider-lifecycle.js.map +1 -0
- package/dist/resolution-policy.d.ts +81 -0
- package/dist/resolution-policy.d.ts.map +1 -0
- package/dist/resolution-policy.js +131 -0
- package/dist/resolution-policy.js.map +1 -0
- package/package.json +32 -22
- package/vendor/@appport/authorization/README.md +28 -0
- package/vendor/@appport/authorization/dist/index.d.ts +94 -0
- package/vendor/@appport/authorization/dist/index.d.ts.map +1 -0
- package/vendor/@appport/authorization/dist/index.js +131 -0
- package/vendor/@appport/authorization/dist/index.js.map +1 -0
- package/vendor/@appport/authorization/package.json +28 -0
- package/vendor/@appport/client/README.md +35 -0
- package/vendor/@appport/client/dist/channel.d.ts +14 -0
- package/vendor/@appport/client/dist/channel.d.ts.map +1 -0
- package/vendor/@appport/client/dist/channel.js +58 -0
- package/vendor/@appport/client/dist/channel.js.map +1 -0
- package/vendor/@appport/client/dist/client.d.ts +61 -0
- package/vendor/@appport/client/dist/client.d.ts.map +1 -0
- package/vendor/@appport/client/dist/client.js +214 -0
- package/vendor/@appport/client/dist/client.js.map +1 -0
- package/vendor/@appport/client/dist/contract.d.ts +55 -0
- package/vendor/@appport/client/dist/contract.d.ts.map +1 -0
- package/vendor/@appport/client/dist/contract.js +12 -0
- package/vendor/@appport/client/dist/contract.js.map +1 -0
- package/vendor/@appport/client/dist/discovery.d.ts +17 -0
- package/vendor/@appport/client/dist/discovery.d.ts.map +1 -0
- package/vendor/@appport/client/dist/discovery.js +56 -0
- package/vendor/@appport/client/dist/discovery.js.map +1 -0
- package/vendor/@appport/client/dist/duplex.d.ts +25 -0
- package/vendor/@appport/client/dist/duplex.d.ts.map +1 -0
- package/vendor/@appport/client/dist/duplex.js +194 -0
- package/vendor/@appport/client/dist/duplex.js.map +1 -0
- package/vendor/@appport/client/dist/host.d.ts +62 -0
- package/vendor/@appport/client/dist/host.d.ts.map +1 -0
- package/vendor/@appport/client/dist/host.js +139 -0
- package/vendor/@appport/client/dist/host.js.map +1 -0
- package/vendor/@appport/client/dist/index.d.ts +14 -0
- package/vendor/@appport/client/dist/index.d.ts.map +1 -0
- package/vendor/@appport/client/dist/index.js +14 -0
- package/vendor/@appport/client/dist/index.js.map +1 -0
- package/vendor/@appport/client/dist/transport.d.ts +42 -0
- package/vendor/@appport/client/dist/transport.d.ts.map +1 -0
- package/vendor/@appport/client/dist/transport.js +2 -0
- package/vendor/@appport/client/dist/transport.js.map +1 -0
- package/vendor/@appport/client/package.json +32 -0
- package/vendor/@appport/core/README.md +91 -0
- package/vendor/@appport/core/dist/appboundry-capability-catalog.d.ts +930 -0
- package/vendor/@appport/core/dist/appboundry-capability-catalog.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-capability-catalog.js +352 -0
- package/vendor/@appport/core/dist/appboundry-capability-catalog.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-composition.d.ts +93 -0
- package/vendor/@appport/core/dist/appboundry-composition.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-composition.js +184 -0
- package/vendor/@appport/core/dist/appboundry-composition.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-contract.d.ts +80 -0
- package/vendor/@appport/core/dist/appboundry-contract.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-contract.js +160 -0
- package/vendor/@appport/core/dist/appboundry-contract.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-diagnostics.d.ts +107 -0
- package/vendor/@appport/core/dist/appboundry-diagnostics.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-diagnostics.js +358 -0
- package/vendor/@appport/core/dist/appboundry-diagnostics.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-discovery.d.ts +110 -0
- package/vendor/@appport/core/dist/appboundry-discovery.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-discovery.js +141 -0
- package/vendor/@appport/core/dist/appboundry-discovery.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-entitlements.d.ts +128 -0
- package/vendor/@appport/core/dist/appboundry-entitlements.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-entitlements.js +312 -0
- package/vendor/@appport/core/dist/appboundry-entitlements.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-execution.d.ts +84 -0
- package/vendor/@appport/core/dist/appboundry-execution.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-execution.js +150 -0
- package/vendor/@appport/core/dist/appboundry-execution.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-exercise.d.ts +152 -0
- package/vendor/@appport/core/dist/appboundry-exercise.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-exercise.js +416 -0
- package/vendor/@appport/core/dist/appboundry-exercise.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-materialization.d.ts +222 -0
- package/vendor/@appport/core/dist/appboundry-materialization.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-materialization.js +494 -0
- package/vendor/@appport/core/dist/appboundry-materialization.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-migration.d.ts +195 -0
- package/vendor/@appport/core/dist/appboundry-migration.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-migration.js +227 -0
- package/vendor/@appport/core/dist/appboundry-migration.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-onboarding.d.ts +70 -0
- package/vendor/@appport/core/dist/appboundry-onboarding.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-onboarding.js +232 -0
- package/vendor/@appport/core/dist/appboundry-onboarding.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-operation-discovery.d.ts +93 -0
- package/vendor/@appport/core/dist/appboundry-operation-discovery.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-operation-discovery.js +89 -0
- package/vendor/@appport/core/dist/appboundry-operation-discovery.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-resolution.d.ts +160 -0
- package/vendor/@appport/core/dist/appboundry-resolution.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-resolution.js +218 -0
- package/vendor/@appport/core/dist/appboundry-resolution.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-surface.d.ts +96 -0
- package/vendor/@appport/core/dist/appboundry-surface.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-surface.js +223 -0
- package/vendor/@appport/core/dist/appboundry-surface.js.map +1 -0
- package/vendor/@appport/core/dist/appboundry-usage.d.ts +94 -0
- package/vendor/@appport/core/dist/appboundry-usage.d.ts.map +1 -0
- package/vendor/@appport/core/dist/appboundry-usage.js +80 -0
- package/vendor/@appport/core/dist/appboundry-usage.js.map +1 -0
- package/vendor/@appport/core/dist/application-conformance.d.ts +68 -0
- package/vendor/@appport/core/dist/application-conformance.d.ts.map +1 -0
- package/vendor/@appport/core/dist/application-conformance.js +108 -0
- package/vendor/@appport/core/dist/application-conformance.js.map +1 -0
- package/vendor/@appport/core/dist/application-implementation.d.ts +125 -0
- package/vendor/@appport/core/dist/application-implementation.d.ts.map +1 -0
- package/vendor/@appport/core/dist/application-implementation.js +220 -0
- package/vendor/@appport/core/dist/application-implementation.js.map +1 -0
- package/vendor/@appport/core/dist/application-lifecycle.d.ts +150 -0
- package/vendor/@appport/core/dist/application-lifecycle.d.ts.map +1 -0
- package/vendor/@appport/core/dist/application-lifecycle.js +70 -0
- package/vendor/@appport/core/dist/application-lifecycle.js.map +1 -0
- package/vendor/@appport/core/dist/application-package.d.ts +105 -0
- package/vendor/@appport/core/dist/application-package.d.ts.map +1 -0
- package/vendor/@appport/core/dist/application-package.js +349 -0
- package/vendor/@appport/core/dist/application-package.js.map +1 -0
- package/vendor/@appport/core/dist/application-source.d.ts +109 -0
- package/vendor/@appport/core/dist/application-source.d.ts.map +1 -0
- package/vendor/@appport/core/dist/application-source.js +186 -0
- package/vendor/@appport/core/dist/application-source.js.map +1 -0
- package/vendor/@appport/core/dist/application.d.ts +124 -0
- package/vendor/@appport/core/dist/application.d.ts.map +1 -0
- package/vendor/@appport/core/dist/application.js +518 -0
- package/vendor/@appport/core/dist/application.js.map +1 -0
- package/vendor/@appport/core/dist/artifact.d.ts +395 -0
- package/vendor/@appport/core/dist/artifact.d.ts.map +1 -0
- package/vendor/@appport/core/dist/artifact.js +392 -0
- package/vendor/@appport/core/dist/artifact.js.map +1 -0
- package/vendor/@appport/core/dist/assembly.d.ts +237 -0
- package/vendor/@appport/core/dist/assembly.d.ts.map +1 -0
- package/vendor/@appport/core/dist/assembly.js +458 -0
- package/vendor/@appport/core/dist/assembly.js.map +1 -0
- package/vendor/@appport/core/dist/authority-attestation.d.ts +34 -0
- package/vendor/@appport/core/dist/authority-attestation.d.ts.map +1 -0
- package/vendor/@appport/core/dist/authority-attestation.js +72 -0
- package/vendor/@appport/core/dist/authority-attestation.js.map +1 -0
- package/vendor/@appport/core/dist/authorization-grant.d.ts +107 -0
- package/vendor/@appport/core/dist/authorization-grant.d.ts.map +1 -0
- package/vendor/@appport/core/dist/authorization-grant.js +131 -0
- package/vendor/@appport/core/dist/authorization-grant.js.map +1 -0
- package/vendor/@appport/core/dist/binding.d.ts +294 -0
- package/vendor/@appport/core/dist/binding.d.ts.map +1 -0
- package/vendor/@appport/core/dist/binding.js +263 -0
- package/vendor/@appport/core/dist/binding.js.map +1 -0
- package/vendor/@appport/core/dist/builtins.d.ts +18 -0
- package/vendor/@appport/core/dist/builtins.d.ts.map +1 -0
- package/vendor/@appport/core/dist/builtins.js +38 -0
- package/vendor/@appport/core/dist/builtins.js.map +1 -0
- package/vendor/@appport/core/dist/capability.d.ts +94 -0
- package/vendor/@appport/core/dist/capability.d.ts.map +1 -0
- package/vendor/@appport/core/dist/capability.js +85 -0
- package/vendor/@appport/core/dist/capability.js.map +1 -0
- package/vendor/@appport/core/dist/concurrency.d.ts +16 -0
- package/vendor/@appport/core/dist/concurrency.d.ts.map +1 -0
- package/vendor/@appport/core/dist/concurrency.js +46 -0
- package/vendor/@appport/core/dist/concurrency.js.map +1 -0
- package/vendor/@appport/core/dist/context.d.ts +59 -0
- package/vendor/@appport/core/dist/context.d.ts.map +1 -0
- package/vendor/@appport/core/dist/context.js +14 -0
- package/vendor/@appport/core/dist/context.js.map +1 -0
- package/vendor/@appport/core/dist/contract-artifact.d.ts +15 -0
- package/vendor/@appport/core/dist/contract-artifact.d.ts.map +1 -0
- package/vendor/@appport/core/dist/contract-artifact.js +161 -0
- package/vendor/@appport/core/dist/contract-artifact.js.map +1 -0
- package/vendor/@appport/core/dist/contract-attestation.d.ts +68 -0
- package/vendor/@appport/core/dist/contract-attestation.d.ts.map +1 -0
- package/vendor/@appport/core/dist/contract-attestation.js +76 -0
- package/vendor/@appport/core/dist/contract-attestation.js.map +1 -0
- package/vendor/@appport/core/dist/crash-injection.d.ts +3 -0
- package/vendor/@appport/core/dist/crash-injection.d.ts.map +1 -0
- package/vendor/@appport/core/dist/crash-injection.js +8 -0
- package/vendor/@appport/core/dist/crash-injection.js.map +1 -0
- package/vendor/@appport/core/dist/events.d.ts +33 -0
- package/vendor/@appport/core/dist/events.d.ts.map +1 -0
- package/vendor/@appport/core/dist/events.js +79 -0
- package/vendor/@appport/core/dist/events.js.map +1 -0
- package/vendor/@appport/core/dist/execution-barrier.d.ts +13 -0
- package/vendor/@appport/core/dist/execution-barrier.d.ts.map +1 -0
- package/vendor/@appport/core/dist/execution-barrier.js +33 -0
- package/vendor/@appport/core/dist/execution-barrier.js.map +1 -0
- package/vendor/@appport/core/dist/execution-ledger.d.ts +81 -0
- package/vendor/@appport/core/dist/execution-ledger.d.ts.map +1 -0
- package/vendor/@appport/core/dist/execution-ledger.js +173 -0
- package/vendor/@appport/core/dist/execution-ledger.js.map +1 -0
- package/vendor/@appport/core/dist/execution.d.ts +387 -0
- package/vendor/@appport/core/dist/execution.d.ts.map +1 -0
- package/vendor/@appport/core/dist/execution.js +165 -0
- package/vendor/@appport/core/dist/execution.js.map +1 -0
- package/vendor/@appport/core/dist/idempotency.d.ts +36 -0
- package/vendor/@appport/core/dist/idempotency.d.ts.map +1 -0
- package/vendor/@appport/core/dist/idempotency.js +36 -0
- package/vendor/@appport/core/dist/idempotency.js.map +1 -0
- package/vendor/@appport/core/dist/implementation.d.ts +110 -0
- package/vendor/@appport/core/dist/implementation.d.ts.map +1 -0
- package/vendor/@appport/core/dist/implementation.js +65 -0
- package/vendor/@appport/core/dist/implementation.js.map +1 -0
- package/vendor/@appport/core/dist/index.d.ts +62 -0
- package/vendor/@appport/core/dist/index.d.ts.map +1 -0
- package/vendor/@appport/core/dist/index.js +61 -0
- package/vendor/@appport/core/dist/index.js.map +1 -0
- package/vendor/@appport/core/dist/invocation.d.ts +253 -0
- package/vendor/@appport/core/dist/invocation.d.ts.map +1 -0
- package/vendor/@appport/core/dist/invocation.js +258 -0
- package/vendor/@appport/core/dist/invocation.js.map +1 -0
- package/vendor/@appport/core/dist/manifest.d.ts +157 -0
- package/vendor/@appport/core/dist/manifest.d.ts.map +1 -0
- package/vendor/@appport/core/dist/manifest.js +255 -0
- package/vendor/@appport/core/dist/manifest.js.map +1 -0
- package/vendor/@appport/core/dist/memory-application-data-store.d.ts +19 -0
- package/vendor/@appport/core/dist/memory-application-data-store.d.ts.map +1 -0
- package/vendor/@appport/core/dist/memory-application-data-store.js +161 -0
- package/vendor/@appport/core/dist/memory-application-data-store.js.map +1 -0
- package/vendor/@appport/core/dist/operations.d.ts +61 -0
- package/vendor/@appport/core/dist/operations.d.ts.map +1 -0
- package/vendor/@appport/core/dist/operations.js +210 -0
- package/vendor/@appport/core/dist/operations.js.map +1 -0
- package/vendor/@appport/core/dist/provider-contract.d.ts +89 -0
- package/vendor/@appport/core/dist/provider-contract.d.ts.map +1 -0
- package/vendor/@appport/core/dist/provider-contract.js +40 -0
- package/vendor/@appport/core/dist/provider-contract.js.map +1 -0
- package/vendor/@appport/core/dist/public.d.ts +23 -0
- package/vendor/@appport/core/dist/public.d.ts.map +1 -0
- package/vendor/@appport/core/dist/public.js +22 -0
- package/vendor/@appport/core/dist/public.js.map +1 -0
- package/vendor/@appport/core/dist/registration.d.ts +165 -0
- package/vendor/@appport/core/dist/registration.d.ts.map +1 -0
- package/vendor/@appport/core/dist/registration.js +253 -0
- package/vendor/@appport/core/dist/registration.js.map +1 -0
- package/vendor/@appport/core/dist/registry.d.ts +30 -0
- package/vendor/@appport/core/dist/registry.d.ts.map +1 -0
- package/vendor/@appport/core/dist/registry.js +149 -0
- package/vendor/@appport/core/dist/registry.js.map +1 -0
- package/vendor/@appport/core/dist/resolver.d.ts +130 -0
- package/vendor/@appport/core/dist/resolver.d.ts.map +1 -0
- package/vendor/@appport/core/dist/resolver.js +252 -0
- package/vendor/@appport/core/dist/resolver.js.map +1 -0
- package/vendor/@appport/core/dist/runtime-manifest.d.ts +68 -0
- package/vendor/@appport/core/dist/runtime-manifest.d.ts.map +1 -0
- package/vendor/@appport/core/dist/runtime-manifest.js +84 -0
- package/vendor/@appport/core/dist/runtime-manifest.js.map +1 -0
- package/vendor/@appport/core/dist/sanitize.d.ts +14 -0
- package/vendor/@appport/core/dist/sanitize.d.ts.map +1 -0
- package/vendor/@appport/core/dist/sanitize.js +49 -0
- package/vendor/@appport/core/dist/sanitize.js.map +1 -0
- package/vendor/@appport/core/dist/server-internal.d.ts +5 -0
- package/vendor/@appport/core/dist/server-internal.d.ts.map +1 -0
- package/vendor/@appport/core/dist/server-internal.js +4 -0
- package/vendor/@appport/core/dist/server-internal.js.map +1 -0
- package/vendor/@appport/core/dist/sessions.d.ts +29 -0
- package/vendor/@appport/core/dist/sessions.d.ts.map +1 -0
- package/vendor/@appport/core/dist/sessions.js +39 -0
- package/vendor/@appport/core/dist/sessions.js.map +1 -0
- package/vendor/@appport/core/dist/sha256.d.ts +3 -0
- package/vendor/@appport/core/dist/sha256.d.ts.map +1 -0
- package/vendor/@appport/core/dist/sha256.js +46 -0
- package/vendor/@appport/core/dist/sha256.js.map +1 -0
- package/vendor/@appport/core/dist/source-verification.d.ts +53 -0
- package/vendor/@appport/core/dist/source-verification.d.ts.map +1 -0
- package/vendor/@appport/core/dist/source-verification.js +92 -0
- package/vendor/@appport/core/dist/source-verification.js.map +1 -0
- package/vendor/@appport/core/dist/state-context.d.ts +312 -0
- package/vendor/@appport/core/dist/state-context.d.ts.map +1 -0
- package/vendor/@appport/core/dist/state-context.js +100 -0
- package/vendor/@appport/core/dist/state-context.js.map +1 -0
- package/vendor/@appport/core/dist/state.d.ts +96 -0
- package/vendor/@appport/core/dist/state.d.ts.map +1 -0
- package/vendor/@appport/core/dist/state.js +89 -0
- package/vendor/@appport/core/dist/state.js.map +1 -0
- package/vendor/@appport/core/dist/streams.d.ts +38 -0
- package/vendor/@appport/core/dist/streams.d.ts.map +1 -0
- package/vendor/@appport/core/dist/streams.js +123 -0
- package/vendor/@appport/core/dist/streams.js.map +1 -0
- package/vendor/@appport/core/dist/telemetry.d.ts +42 -0
- package/vendor/@appport/core/dist/telemetry.d.ts.map +1 -0
- package/vendor/@appport/core/dist/telemetry.js +32 -0
- package/vendor/@appport/core/dist/telemetry.js.map +1 -0
- package/vendor/@appport/core/dist/wasm-engine.d.ts +24 -0
- package/vendor/@appport/core/dist/wasm-engine.d.ts.map +1 -0
- package/vendor/@appport/core/dist/wasm-engine.js +376 -0
- package/vendor/@appport/core/dist/wasm-engine.js.map +1 -0
- package/vendor/@appport/core/package.json +58 -0
- package/vendor/@appport/mcp/README.md +29 -0
- package/vendor/@appport/mcp/dist/index.d.ts +59 -0
- package/vendor/@appport/mcp/dist/index.d.ts.map +1 -0
- package/vendor/@appport/mcp/dist/index.js +70 -0
- package/vendor/@appport/mcp/dist/index.js.map +1 -0
- package/vendor/@appport/mcp/package.json +29 -0
- package/vendor/@appport/mobile/README.md +10 -0
- package/vendor/@appport/mobile/dist/index.d.ts +66 -0
- package/vendor/@appport/mobile/dist/index.d.ts.map +1 -0
- package/vendor/@appport/mobile/dist/index.js +182 -0
- package/vendor/@appport/mobile/dist/index.js.map +1 -0
- package/vendor/@appport/mobile/package.json +33 -0
- package/vendor/@appport/protocol/README.md +41 -0
- package/vendor/@appport/protocol/dist/blob.d.ts +46 -0
- package/vendor/@appport/protocol/dist/blob.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/blob.js +23 -0
- package/vendor/@appport/protocol/dist/blob.js.map +1 -0
- package/vendor/@appport/protocol/dist/compatibility.d.ts +25 -0
- package/vendor/@appport/protocol/dist/compatibility.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/compatibility.js +189 -0
- package/vendor/@appport/protocol/dist/compatibility.js.map +1 -0
- package/vendor/@appport/protocol/dist/envelopes.d.ts +175 -0
- package/vendor/@appport/protocol/dist/envelopes.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/envelopes.js +97 -0
- package/vendor/@appport/protocol/dist/envelopes.js.map +1 -0
- package/vendor/@appport/protocol/dist/errors.d.ts +74 -0
- package/vendor/@appport/protocol/dist/errors.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/errors.js +92 -0
- package/vendor/@appport/protocol/dist/errors.js.map +1 -0
- package/vendor/@appport/protocol/dist/ids.d.ts +12 -0
- package/vendor/@appport/protocol/dist/ids.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/ids.js +50 -0
- package/vendor/@appport/protocol/dist/ids.js.map +1 -0
- package/vendor/@appport/protocol/dist/index.d.ts +21 -0
- package/vendor/@appport/protocol/dist/index.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/index.js +21 -0
- package/vendor/@appport/protocol/dist/index.js.map +1 -0
- package/vendor/@appport/protocol/dist/jsonschema.d.ts +50 -0
- package/vendor/@appport/protocol/dist/jsonschema.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/jsonschema.js +6 -0
- package/vendor/@appport/protocol/dist/jsonschema.js.map +1 -0
- package/vendor/@appport/protocol/dist/manifest.d.ts +134 -0
- package/vendor/@appport/protocol/dist/manifest.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/manifest.js +20 -0
- package/vendor/@appport/protocol/dist/manifest.js.map +1 -0
- package/vendor/@appport/protocol/dist/materialization.d.ts +59 -0
- package/vendor/@appport/protocol/dist/materialization.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/materialization.js +2 -0
- package/vendor/@appport/protocol/dist/materialization.js.map +1 -0
- package/vendor/@appport/protocol/dist/names.d.ts +26 -0
- package/vendor/@appport/protocol/dist/names.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/names.js +85 -0
- package/vendor/@appport/protocol/dist/names.js.map +1 -0
- package/vendor/@appport/protocol/dist/operations.d.ts +34 -0
- package/vendor/@appport/protocol/dist/operations.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/operations.js +9 -0
- package/vendor/@appport/protocol/dist/operations.js.map +1 -0
- package/vendor/@appport/protocol/dist/session.d.ts +27 -0
- package/vendor/@appport/protocol/dist/session.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/session.js +7 -0
- package/vendor/@appport/protocol/dist/session.js.map +1 -0
- package/vendor/@appport/protocol/dist/validate.d.ts +37 -0
- package/vendor/@appport/protocol/dist/validate.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/validate.js +321 -0
- package/vendor/@appport/protocol/dist/validate.js.map +1 -0
- package/vendor/@appport/protocol/dist/version.d.ts +27 -0
- package/vendor/@appport/protocol/dist/version.d.ts.map +1 -0
- package/vendor/@appport/protocol/dist/version.js +26 -0
- package/vendor/@appport/protocol/dist/version.js.map +1 -0
- package/vendor/@appport/protocol/package.json +25 -0
- package/vendor/@appport/schema/README.md +32 -0
- package/vendor/@appport/schema/dist/builder.d.ts +85 -0
- package/vendor/@appport/schema/dist/builder.d.ts.map +1 -0
- package/vendor/@appport/schema/dist/builder.js +278 -0
- package/vendor/@appport/schema/dist/builder.js.map +1 -0
- package/vendor/@appport/schema/dist/from-json-schema.d.ts +12 -0
- package/vendor/@appport/schema/dist/from-json-schema.d.ts.map +1 -0
- package/vendor/@appport/schema/dist/from-json-schema.js +186 -0
- package/vendor/@appport/schema/dist/from-json-schema.js.map +1 -0
- package/vendor/@appport/schema/dist/index.d.ts +23 -0
- package/vendor/@appport/schema/dist/index.d.ts.map +1 -0
- package/vendor/@appport/schema/dist/index.js +22 -0
- package/vendor/@appport/schema/dist/index.js.map +1 -0
- package/vendor/@appport/schema/dist/standard.d.ts +46 -0
- package/vendor/@appport/schema/dist/standard.d.ts.map +1 -0
- package/vendor/@appport/schema/dist/standard.js +42 -0
- package/vendor/@appport/schema/dist/standard.js.map +1 -0
- package/vendor/@appport/schema/dist/types.d.ts +40 -0
- package/vendor/@appport/schema/dist/types.d.ts.map +1 -0
- package/vendor/@appport/schema/dist/types.js +19 -0
- package/vendor/@appport/schema/dist/types.js.map +1 -0
- package/vendor/@appport/schema/package.json +28 -0
- package/vendor/@appport/server/README.md +39 -0
- package/vendor/@appport/server/dist/connection.d.ts +45 -0
- package/vendor/@appport/server/dist/connection.d.ts.map +1 -0
- package/vendor/@appport/server/dist/connection.js +217 -0
- package/vendor/@appport/server/dist/connection.js.map +1 -0
- package/vendor/@appport/server/dist/fetch.d.ts +10 -0
- package/vendor/@appport/server/dist/fetch.d.ts.map +1 -0
- package/vendor/@appport/server/dist/fetch.js +50 -0
- package/vendor/@appport/server/dist/fetch.js.map +1 -0
- package/vendor/@appport/server/dist/http.d.ts +80 -0
- package/vendor/@appport/server/dist/http.d.ts.map +1 -0
- package/vendor/@appport/server/dist/http.js +307 -0
- package/vendor/@appport/server/dist/http.js.map +1 -0
- package/vendor/@appport/server/dist/index.d.ts +11 -0
- package/vendor/@appport/server/dist/index.d.ts.map +1 -0
- package/vendor/@appport/server/dist/index.js +11 -0
- package/vendor/@appport/server/dist/index.js.map +1 -0
- package/vendor/@appport/server/dist/node-entry.d.ts +4 -0
- package/vendor/@appport/server/dist/node-entry.d.ts.map +1 -0
- package/vendor/@appport/server/dist/node-entry.js +4 -0
- package/vendor/@appport/server/dist/node-entry.js.map +1 -0
- package/vendor/@appport/server/dist/node.d.ts +45 -0
- package/vendor/@appport/server/dist/node.d.ts.map +1 -0
- package/vendor/@appport/server/dist/node.js +190 -0
- package/vendor/@appport/server/dist/node.js.map +1 -0
- package/vendor/@appport/server/dist/server.d.ts +83 -0
- package/vendor/@appport/server/dist/server.d.ts.map +1 -0
- package/vendor/@appport/server/dist/server.js +114 -0
- package/vendor/@appport/server/dist/server.js.map +1 -0
- package/vendor/@appport/server/dist/websocket.d.ts +25 -0
- package/vendor/@appport/server/dist/websocket.d.ts.map +1 -0
- package/vendor/@appport/server/dist/websocket.js +221 -0
- package/vendor/@appport/server/dist/websocket.js.map +1 -0
- package/vendor/@appport/server/package.json +34 -0
- package/vendor/@appport/transport-electron/README.md +56 -0
- package/vendor/@appport/transport-electron/dist/index.d.ts +11 -0
- package/vendor/@appport/transport-electron/dist/index.d.ts.map +1 -0
- package/vendor/@appport/transport-electron/dist/index.js +11 -0
- package/vendor/@appport/transport-electron/dist/index.js.map +1 -0
- package/vendor/@appport/transport-electron/dist/main.d.ts +31 -0
- package/vendor/@appport/transport-electron/dist/main.d.ts.map +1 -0
- package/vendor/@appport/transport-electron/dist/main.js +61 -0
- package/vendor/@appport/transport-electron/dist/main.js.map +1 -0
- package/vendor/@appport/transport-electron/dist/preload.d.ts +22 -0
- package/vendor/@appport/transport-electron/dist/preload.d.ts.map +1 -0
- package/vendor/@appport/transport-electron/dist/preload.js +29 -0
- package/vendor/@appport/transport-electron/dist/preload.js.map +1 -0
- package/vendor/@appport/transport-electron/dist/renderer.d.ts +16 -0
- package/vendor/@appport/transport-electron/dist/renderer.d.ts.map +1 -0
- package/vendor/@appport/transport-electron/dist/renderer.js +36 -0
- package/vendor/@appport/transport-electron/dist/renderer.js.map +1 -0
- package/vendor/@appport/transport-electron/dist/types.d.ts +49 -0
- package/vendor/@appport/transport-electron/dist/types.d.ts.map +1 -0
- package/vendor/@appport/transport-electron/dist/types.js +5 -0
- package/vendor/@appport/transport-electron/dist/types.js.map +1 -0
- package/vendor/@appport/transport-electron/package.json +46 -0
- package/vendor/@appport/transport-http/README.md +24 -0
- package/vendor/@appport/transport-http/dist/index.d.ts +18 -0
- package/vendor/@appport/transport-http/dist/index.d.ts.map +1 -0
- package/vendor/@appport/transport-http/dist/index.js +223 -0
- package/vendor/@appport/transport-http/dist/index.js.map +1 -0
- package/vendor/@appport/transport-http/package.json +29 -0
- package/vendor/@appport/transport-inprocess/README.md +24 -0
- package/vendor/@appport/transport-inprocess/dist/index.d.ts +16 -0
- package/vendor/@appport/transport-inprocess/dist/index.d.ts.map +1 -0
- package/vendor/@appport/transport-inprocess/dist/index.js +30 -0
- package/vendor/@appport/transport-inprocess/dist/index.js.map +1 -0
- package/vendor/@appport/transport-inprocess/package.json +30 -0
- package/vendor/@appport/transport-tauri/README.md +45 -0
- package/vendor/@appport/transport-tauri/dist/index.d.ts +23 -0
- package/vendor/@appport/transport-tauri/dist/index.d.ts.map +1 -0
- package/vendor/@appport/transport-tauri/dist/index.js +44 -0
- package/vendor/@appport/transport-tauri/dist/index.js.map +1 -0
- package/vendor/@appport/transport-tauri/package.json +29 -0
- package/vendor/@appport/transport-websocket/README.md +22 -0
- package/vendor/@appport/transport-websocket/dist/index.d.ts +26 -0
- package/vendor/@appport/transport-websocket/dist/index.d.ts.map +1 -0
- package/vendor/@appport/transport-websocket/dist/index.js +72 -0
- package/vendor/@appport/transport-websocket/dist/index.js.map +1 -0
- package/vendor/@appport/transport-websocket/package.json +29 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { errors, CONFORMANCE_LEVELS, PROTOCOL_ID } from "../../protocol/dist/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The capability registry: the authoritative set of capabilities and events an
|
|
4
|
+
* application exposes, and the source of its manifest (§30).
|
|
5
|
+
*/
|
|
6
|
+
export class CapabilityRegistry {
|
|
7
|
+
#capabilities = new Map();
|
|
8
|
+
#events = new Map();
|
|
9
|
+
register(input) {
|
|
10
|
+
const definition = input;
|
|
11
|
+
const versions = this.#capabilities.get(definition.name) ?? new Map();
|
|
12
|
+
if (versions.has(definition.version)) {
|
|
13
|
+
throw errors.conflict(`Capability ${definition.name}@${definition.version} is already registered`);
|
|
14
|
+
}
|
|
15
|
+
const existing = [...versions.values()][0];
|
|
16
|
+
if (existing && existing.kind !== definition.kind) {
|
|
17
|
+
throw errors.conflict(`Capability ${definition.name} cannot mix "${existing.kind}" and "${definition.kind}" versions`);
|
|
18
|
+
}
|
|
19
|
+
versions.set(definition.version, definition);
|
|
20
|
+
this.#capabilities.set(definition.name, versions);
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
registerEvent(input) {
|
|
24
|
+
const definition = input;
|
|
25
|
+
const versions = this.#events.get(definition.name) ?? new Map();
|
|
26
|
+
if (versions.has(definition.version)) {
|
|
27
|
+
throw errors.conflict(`Event ${definition.name}@${definition.version} is already registered`);
|
|
28
|
+
}
|
|
29
|
+
versions.set(definition.version, definition);
|
|
30
|
+
this.#events.set(definition.name, versions);
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
has(name, version) {
|
|
34
|
+
const versions = this.#capabilities.get(name);
|
|
35
|
+
if (!versions)
|
|
36
|
+
return false;
|
|
37
|
+
return version === undefined ? versions.size > 0 : versions.has(version);
|
|
38
|
+
}
|
|
39
|
+
/** Resolves a capability, or throws the correct protocol error (§15). */
|
|
40
|
+
resolve(name, version) {
|
|
41
|
+
const versions = this.#capabilities.get(name);
|
|
42
|
+
if (!versions || versions.size === 0)
|
|
43
|
+
throw errors.unknownCapability(name);
|
|
44
|
+
const definition = versions.get(version);
|
|
45
|
+
if (!definition) {
|
|
46
|
+
throw errors.unsupportedCapabilityVersion(name, version, [...versions.keys()].sort((a, b) => a - b));
|
|
47
|
+
}
|
|
48
|
+
return definition;
|
|
49
|
+
}
|
|
50
|
+
getEvent(name, version) {
|
|
51
|
+
const versions = this.#events.get(name);
|
|
52
|
+
if (!versions || versions.size === 0)
|
|
53
|
+
return undefined;
|
|
54
|
+
if (version === undefined) {
|
|
55
|
+
const latest = Math.max(...versions.keys());
|
|
56
|
+
return versions.get(latest);
|
|
57
|
+
}
|
|
58
|
+
return versions.get(version);
|
|
59
|
+
}
|
|
60
|
+
capabilities() {
|
|
61
|
+
return [...this.#capabilities.values()].flatMap((versions) => [...versions.values()]);
|
|
62
|
+
}
|
|
63
|
+
events() {
|
|
64
|
+
return [...this.#events.values()].flatMap((versions) => [...versions.values()]);
|
|
65
|
+
}
|
|
66
|
+
capabilityNames() {
|
|
67
|
+
return [...this.#capabilities.keys()].sort();
|
|
68
|
+
}
|
|
69
|
+
/** Renders the manifest entries for every registered capability. */
|
|
70
|
+
capabilityEntries() {
|
|
71
|
+
const entries = [];
|
|
72
|
+
for (const [name, versions] of [...this.#capabilities.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
73
|
+
const definitions = [...versions.values()]
|
|
74
|
+
.sort((a, b) => a.version - b.version)
|
|
75
|
+
.map((definition) => ({
|
|
76
|
+
version: definition.version,
|
|
77
|
+
...(definition.description ? { description: definition.description } : {}),
|
|
78
|
+
kind: definition.kind,
|
|
79
|
+
inputSchema: definition.input.toJSONSchema(),
|
|
80
|
+
outputSchema: definition.output.toJSONSchema(),
|
|
81
|
+
authorization: [...definition.authorization],
|
|
82
|
+
idempotency: definition.idempotency,
|
|
83
|
+
concurrency: definition.concurrency,
|
|
84
|
+
...(definition.timeoutMs !== undefined ? { timeoutMs: definition.timeoutMs } : {}),
|
|
85
|
+
...(definition.deprecated ? { deprecated: true } : {}),
|
|
86
|
+
...(definition.emits.length ? { emits: [...definition.emits] } : {})
|
|
87
|
+
}));
|
|
88
|
+
const preferred = [...definitions].reverse().find((entry) => !entry.deprecated) ?? definitions[definitions.length - 1];
|
|
89
|
+
entries.push({
|
|
90
|
+
name,
|
|
91
|
+
versions: definitions.map((entry) => entry.version),
|
|
92
|
+
latestVersion: preferred.version,
|
|
93
|
+
...(preferred.description ? { description: preferred.description } : {}),
|
|
94
|
+
kind: preferred.kind,
|
|
95
|
+
inputSchema: preferred.inputSchema,
|
|
96
|
+
outputSchema: preferred.outputSchema,
|
|
97
|
+
authorization: preferred.authorization,
|
|
98
|
+
...(preferred.idempotency ? { idempotency: preferred.idempotency } : {}),
|
|
99
|
+
...(preferred.concurrency ? { concurrency: preferred.concurrency } : {}),
|
|
100
|
+
definitions
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return entries;
|
|
104
|
+
}
|
|
105
|
+
eventEntries() {
|
|
106
|
+
const entries = [];
|
|
107
|
+
for (const [name, versions] of [...this.#events.entries()].sort(([a], [b]) => a.localeCompare(b))) {
|
|
108
|
+
const definitions = [...versions.values()]
|
|
109
|
+
.sort((a, b) => a.version - b.version)
|
|
110
|
+
.map((definition) => ({
|
|
111
|
+
version: definition.version,
|
|
112
|
+
...(definition.description ? { description: definition.description } : {}),
|
|
113
|
+
payloadSchema: definition.payload.toJSONSchema(),
|
|
114
|
+
authorization: [...definition.authorization],
|
|
115
|
+
...(definition.deprecated ? { deprecated: true } : {})
|
|
116
|
+
}));
|
|
117
|
+
const preferred = [...definitions].reverse().find((entry) => !entry.deprecated) ?? definitions[definitions.length - 1];
|
|
118
|
+
entries.push({
|
|
119
|
+
name,
|
|
120
|
+
versions: definitions.map((entry) => entry.version),
|
|
121
|
+
latestVersion: preferred.version,
|
|
122
|
+
...(preferred.description ? { description: preferred.description } : {}),
|
|
123
|
+
payloadSchema: preferred.payloadSchema,
|
|
124
|
+
authorization: preferred.authorization,
|
|
125
|
+
definitions
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return entries;
|
|
129
|
+
}
|
|
130
|
+
/** Builds the full application manifest (§30). */
|
|
131
|
+
manifest(options) {
|
|
132
|
+
const capabilities = this.capabilityEntries();
|
|
133
|
+
const events = this.eventEntries();
|
|
134
|
+
const hasStreams = capabilities.some((entry) => entry.kind === "stream");
|
|
135
|
+
const conformance = options.conformance ??
|
|
136
|
+
(hasStreams ? CONFORMANCE_LEVELS.streams : events.length > 0 ? CONFORMANCE_LEVELS.events : CONFORMANCE_LEVELS.core);
|
|
137
|
+
return {
|
|
138
|
+
protocol: PROTOCOL_ID,
|
|
139
|
+
application: options.application,
|
|
140
|
+
capabilities,
|
|
141
|
+
events,
|
|
142
|
+
transports: options.transports ?? [],
|
|
143
|
+
conformance,
|
|
144
|
+
...(options.materialization ? { materialization: options.materialization } : {}),
|
|
145
|
+
...(options.extensions?.length ? { extensions: options.extensions } : {})
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EASN,kBAAkB,EAClB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAG3B;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IACpB,aAAa,GAAG,IAAI,GAAG,EAAsC,CAAC;IAC9D,OAAO,GAAG,IAAI,GAAG,EAAiC,CAAC;IAE5D,QAAQ,CAAgB,KAA0C;QAChE,MAAM,UAAU,GAAkB,KAAK,CAAC;QACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAA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CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;QACzE,MAAM,WAAW,GACf,OAAO,CAAC,WAAW;YACnB,CAAC,UAAU,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACtH,OAAO;YACL,QAAQ,EAAE,WAAW;YACrB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,YAAY;YACZ,MAAM;YACN,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;YACpC,WAAW;YACX,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChF,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1E,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Dependency Resolver (PR22)
|
|
3
|
+
*
|
|
4
|
+
* Deterministic resolution of application capability requirements against
|
|
5
|
+
* the Application Registry.
|
|
6
|
+
*
|
|
7
|
+
* Key principles:
|
|
8
|
+
* - Discovery via ApplicationRegistry (who provides this capability?)
|
|
9
|
+
* - Compatibility evaluation (can this provider satisfy this requirement?)
|
|
10
|
+
* - Deterministic selection (same registry state always produces same result)
|
|
11
|
+
* - No authorization checks (authorization is a separate layer)
|
|
12
|
+
* - No execution (resolution produces metadata only)
|
|
13
|
+
*/
|
|
14
|
+
import type { ApplicationState } from "./state.js";
|
|
15
|
+
import type { ApplicationRegistry } from "./registration.js";
|
|
16
|
+
import type { CapabilityManifestEntry, RequirementManifestEntry } from "./manifest.js";
|
|
17
|
+
/**
|
|
18
|
+
* Extended requirement with version constraint and provider constraint support.
|
|
19
|
+
*
|
|
20
|
+
* Extends RequirementManifestEntry to support semantic version constraints
|
|
21
|
+
* and provider constraints for deterministic resolution.
|
|
22
|
+
*/
|
|
23
|
+
export interface RequirementWithConstraints extends RequirementManifestEntry {
|
|
24
|
+
readonly versionConstraint?: string;
|
|
25
|
+
readonly provider?: {
|
|
26
|
+
readonly applicationId?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Compatibility result: detailed assessment of whether a provider can satisfy a requirement.
|
|
31
|
+
*/
|
|
32
|
+
export interface CompatibilityResult {
|
|
33
|
+
readonly compatible: boolean;
|
|
34
|
+
readonly reasons: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A resolved requirement: provider has been selected.
|
|
38
|
+
*/
|
|
39
|
+
export interface ResolvedRequirement {
|
|
40
|
+
readonly kind: "resolved";
|
|
41
|
+
readonly requirement: RequirementWithConstraints;
|
|
42
|
+
readonly provider: ApplicationState;
|
|
43
|
+
readonly capability: CapabilityManifestEntry;
|
|
44
|
+
readonly compatibility: CompatibilityResult;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* An unresolved requirement: no compatible provider found.
|
|
48
|
+
*/
|
|
49
|
+
export interface UnresolvedRequirement {
|
|
50
|
+
readonly kind: "unresolved";
|
|
51
|
+
readonly requirement: RequirementWithConstraints;
|
|
52
|
+
readonly candidates: readonly ApplicationState[];
|
|
53
|
+
readonly reason: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* An ambiguous requirement: multiple equally valid providers exist.
|
|
57
|
+
*/
|
|
58
|
+
export interface AmbiguousRequirement {
|
|
59
|
+
readonly kind: "ambiguous";
|
|
60
|
+
readonly requirement: RequirementWithConstraints;
|
|
61
|
+
readonly candidates: readonly ApplicationState[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A resolution result: resolved, unresolved, or ambiguous.
|
|
65
|
+
*/
|
|
66
|
+
export type ResolutionResult = ResolvedRequirement | UnresolvedRequirement | AmbiguousRequirement;
|
|
67
|
+
/**
|
|
68
|
+
* Full application resolution: all requirements resolved/unresolved/ambiguous.
|
|
69
|
+
*/
|
|
70
|
+
export interface ApplicationResolution {
|
|
71
|
+
readonly application: ApplicationState;
|
|
72
|
+
readonly results: readonly ResolutionResult[];
|
|
73
|
+
readonly resolved: readonly ResolvedRequirement[];
|
|
74
|
+
readonly unresolved: readonly UnresolvedRequirement[];
|
|
75
|
+
readonly ambiguous: readonly AmbiguousRequirement[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Parse a semantic version constraint string and check if a provided version satisfies it.
|
|
79
|
+
*
|
|
80
|
+
* Supports:
|
|
81
|
+
* - Exact: "1" (matches 1 only)
|
|
82
|
+
* - Caret: "^1" (matches 1.x.x, i.e., >= 1 and < 2)
|
|
83
|
+
* - Tilde: "~1.2" (matches 1.2.x, i.e., >= 1.2 and < 1.3, but for major version numbers)
|
|
84
|
+
* - Comparison: ">=1", ">1", "<=1", "<1"
|
|
85
|
+
*
|
|
86
|
+
* Returns true if the provided version satisfies the constraint.
|
|
87
|
+
*/
|
|
88
|
+
export declare function satisfiesVersionConstraint(providedVersion: number, constraint: string): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Evaluate capability compatibility between a provider and a requirement.
|
|
91
|
+
*
|
|
92
|
+
* Checks:
|
|
93
|
+
* - Capability name matches exactly
|
|
94
|
+
* - Provider version satisfies version constraint
|
|
95
|
+
* - Provider passes provider constraint (if specified)
|
|
96
|
+
*
|
|
97
|
+
* Returns a CompatibilityResult with detailed reasons.
|
|
98
|
+
*/
|
|
99
|
+
export declare function evaluateCompatibility(requirement: RequirementWithConstraints, provider: ApplicationState): CompatibilityResult;
|
|
100
|
+
/**
|
|
101
|
+
* Application Dependency Resolver
|
|
102
|
+
*
|
|
103
|
+
* Resolves application requirements against the Application Registry using
|
|
104
|
+
* deterministic compatibility evaluation and provider selection.
|
|
105
|
+
*/
|
|
106
|
+
export declare class ApplicationDependencyResolver {
|
|
107
|
+
#private;
|
|
108
|
+
constructor(registry: ApplicationRegistry);
|
|
109
|
+
/**
|
|
110
|
+
* Resolve a single requirement against the registry.
|
|
111
|
+
*
|
|
112
|
+
* Flow:
|
|
113
|
+
* 1. Discover candidate providers (findByCapability)
|
|
114
|
+
* 2. Evaluate compatibility for each candidate
|
|
115
|
+
* 3. Apply provider constraints
|
|
116
|
+
* 4. Select deterministically or report ambiguity
|
|
117
|
+
* 5. Return ResolvedRequirement, UnresolvedRequirement, or AmbiguousRequirement
|
|
118
|
+
*/
|
|
119
|
+
resolveRequirement(requirement: RequirementWithConstraints): Promise<ResolutionResult>;
|
|
120
|
+
/**
|
|
121
|
+
* Resolve all requirements of an application.
|
|
122
|
+
*
|
|
123
|
+
* Returns a comprehensive ApplicationResolution containing:
|
|
124
|
+
* - All resolution results
|
|
125
|
+
* - Separated resolved/unresolved/ambiguous for easy access
|
|
126
|
+
* - The application state (unchanged)
|
|
127
|
+
*/
|
|
128
|
+
resolveApplication(application: ApplicationState): Promise<ApplicationResolution>;
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../src/resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,wBAAwB,EAAuB,MAAM,eAAe,CAAC;AAG5G;;;;;GAKG;AACH,MAAM,WAAW,0BAA2B,SAAQ,wBAAwB;IAC1E,QAA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,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACtD,QAAQ,CAAC,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACrD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAqD/F;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,0BAA0B,EACvC,QAAQ,EAAE,gBAAgB,GACzB,mBAAmB,CAgCrB;AAED;;;;;GAKG;AACH,qBAAa,6BAA6B;;gBAG5B,QAAQ,EAAE,mBAAmB;IAIzC;;;;;;;;;OASG;IACG,kBAAkB,CAAC,WAAW,EAAE,0BAA0B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAwG5F;;;;;;;OAOG;IACG,kBAAkB,CAAC,WAAW,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAyBxF"}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Dependency Resolver (PR22)
|
|
3
|
+
*
|
|
4
|
+
* Deterministic resolution of application capability requirements against
|
|
5
|
+
* the Application Registry.
|
|
6
|
+
*
|
|
7
|
+
* Key principles:
|
|
8
|
+
* - Discovery via ApplicationRegistry (who provides this capability?)
|
|
9
|
+
* - Compatibility evaluation (can this provider satisfy this requirement?)
|
|
10
|
+
* - Deterministic selection (same registry state always produces same result)
|
|
11
|
+
* - No authorization checks (authorization is a separate layer)
|
|
12
|
+
* - No execution (resolution produces metadata only)
|
|
13
|
+
*/
|
|
14
|
+
import { attestResolution } from "./authority-attestation.js";
|
|
15
|
+
/**
|
|
16
|
+
* Parse a semantic version constraint string and check if a provided version satisfies it.
|
|
17
|
+
*
|
|
18
|
+
* Supports:
|
|
19
|
+
* - Exact: "1" (matches 1 only)
|
|
20
|
+
* - Caret: "^1" (matches 1.x.x, i.e., >= 1 and < 2)
|
|
21
|
+
* - Tilde: "~1.2" (matches 1.2.x, i.e., >= 1.2 and < 1.3, but for major version numbers)
|
|
22
|
+
* - Comparison: ">=1", ">1", "<=1", "<1"
|
|
23
|
+
*
|
|
24
|
+
* Returns true if the provided version satisfies the constraint.
|
|
25
|
+
*/
|
|
26
|
+
export function satisfiesVersionConstraint(providedVersion, constraint) {
|
|
27
|
+
const trimmed = constraint.trim();
|
|
28
|
+
// Caret range: ^1 matches >= 1 and < 2
|
|
29
|
+
if (trimmed.startsWith("^")) {
|
|
30
|
+
const versionStr = trimmed.substring(1);
|
|
31
|
+
const [major] = versionStr.split(".").map(Number);
|
|
32
|
+
return providedVersion >= major && providedVersion < major + 1;
|
|
33
|
+
}
|
|
34
|
+
// Tilde range: ~1.2 matches >= 1.2 and < 1.3 (but for major version numbers)
|
|
35
|
+
if (trimmed.startsWith("~")) {
|
|
36
|
+
const versionStr = trimmed.substring(1);
|
|
37
|
+
const [major, minor] = versionStr.split(".").map(Number);
|
|
38
|
+
if (minor === undefined) {
|
|
39
|
+
// ~1 is equivalent to ^1
|
|
40
|
+
return providedVersion >= major && providedVersion < major + 1;
|
|
41
|
+
}
|
|
42
|
+
// For ~1.2, since we're dealing with major version numbers, only match the major
|
|
43
|
+
return providedVersion === major;
|
|
44
|
+
}
|
|
45
|
+
// Greater than or equal: >=1
|
|
46
|
+
if (trimmed.startsWith(">=")) {
|
|
47
|
+
const version = parseInt(trimmed.substring(2), 10);
|
|
48
|
+
return providedVersion >= version;
|
|
49
|
+
}
|
|
50
|
+
// Greater than: >1
|
|
51
|
+
if (trimmed.startsWith(">")) {
|
|
52
|
+
const version = parseInt(trimmed.substring(1), 10);
|
|
53
|
+
return providedVersion > version;
|
|
54
|
+
}
|
|
55
|
+
// Less than or equal: <=1
|
|
56
|
+
if (trimmed.startsWith("<=")) {
|
|
57
|
+
const version = parseInt(trimmed.substring(2), 10);
|
|
58
|
+
return providedVersion <= version;
|
|
59
|
+
}
|
|
60
|
+
// Less than: <1
|
|
61
|
+
if (trimmed.startsWith("<")) {
|
|
62
|
+
const version = parseInt(trimmed.substring(1), 10);
|
|
63
|
+
return providedVersion < version;
|
|
64
|
+
}
|
|
65
|
+
// Exact version: 1
|
|
66
|
+
const version = parseInt(trimmed, 10);
|
|
67
|
+
if (!Number.isNaN(version)) {
|
|
68
|
+
return providedVersion === version;
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Evaluate capability compatibility between a provider and a requirement.
|
|
74
|
+
*
|
|
75
|
+
* Checks:
|
|
76
|
+
* - Capability name matches exactly
|
|
77
|
+
* - Provider version satisfies version constraint
|
|
78
|
+
* - Provider passes provider constraint (if specified)
|
|
79
|
+
*
|
|
80
|
+
* Returns a CompatibilityResult with detailed reasons.
|
|
81
|
+
*/
|
|
82
|
+
export function evaluateCompatibility(requirement, provider) {
|
|
83
|
+
const reasons = [];
|
|
84
|
+
// Find the capability in the provider's manifest
|
|
85
|
+
const capability = provider.manifest.provides.find((cap) => cap.name === requirement.name);
|
|
86
|
+
if (!capability) {
|
|
87
|
+
reasons.push(`Provider ${provider.id} does not provide capability "${requirement.name}"`);
|
|
88
|
+
return { compatible: false, reasons };
|
|
89
|
+
}
|
|
90
|
+
// Check version constraint
|
|
91
|
+
const versionConstraint = requirement.versionConstraint || String(requirement.version);
|
|
92
|
+
if (!satisfiesVersionConstraint(capability.version, versionConstraint)) {
|
|
93
|
+
reasons.push(`Provider version ${capability.version} does not satisfy constraint "${versionConstraint}" for "${requirement.name}"`);
|
|
94
|
+
return { compatible: false, reasons };
|
|
95
|
+
}
|
|
96
|
+
// Check provider constraint
|
|
97
|
+
if (requirement.provider?.applicationId) {
|
|
98
|
+
if (provider.id !== requirement.provider.applicationId) {
|
|
99
|
+
reasons.push(`Requirement specifies provider "${requirement.provider.applicationId}" but got provider "${provider.id}"`);
|
|
100
|
+
return { compatible: false, reasons };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
// All checks passed
|
|
104
|
+
return { compatible: true, reasons: [] };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Application Dependency Resolver
|
|
108
|
+
*
|
|
109
|
+
* Resolves application requirements against the Application Registry using
|
|
110
|
+
* deterministic compatibility evaluation and provider selection.
|
|
111
|
+
*/
|
|
112
|
+
export class ApplicationDependencyResolver {
|
|
113
|
+
#registry;
|
|
114
|
+
constructor(registry) {
|
|
115
|
+
this.#registry = registry;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Resolve a single requirement against the registry.
|
|
119
|
+
*
|
|
120
|
+
* Flow:
|
|
121
|
+
* 1. Discover candidate providers (findByCapability)
|
|
122
|
+
* 2. Evaluate compatibility for each candidate
|
|
123
|
+
* 3. Apply provider constraints
|
|
124
|
+
* 4. Select deterministically or report ambiguity
|
|
125
|
+
* 5. Return ResolvedRequirement, UnresolvedRequirement, or AmbiguousRequirement
|
|
126
|
+
*/
|
|
127
|
+
async resolveRequirement(requirement) {
|
|
128
|
+
// If requirement has a provider constraint, look for that specific provider
|
|
129
|
+
if (requirement.provider?.applicationId) {
|
|
130
|
+
const provider = await this.#registry.get(requirement.provider.applicationId);
|
|
131
|
+
if (!provider) {
|
|
132
|
+
return {
|
|
133
|
+
kind: "unresolved",
|
|
134
|
+
requirement,
|
|
135
|
+
candidates: [],
|
|
136
|
+
reason: `Provider "${requirement.provider.applicationId}" not found in registry`
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
const compat = evaluateCompatibility(requirement, provider);
|
|
140
|
+
if (compat.compatible) {
|
|
141
|
+
const capability = provider.manifest.provides.find((cap) => cap.name === requirement.name);
|
|
142
|
+
const resolution = {
|
|
143
|
+
kind: "resolved",
|
|
144
|
+
requirement,
|
|
145
|
+
provider,
|
|
146
|
+
capability,
|
|
147
|
+
compatibility: compat
|
|
148
|
+
};
|
|
149
|
+
attestResolution(resolution, this.#registry);
|
|
150
|
+
return resolution;
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
return {
|
|
154
|
+
kind: "unresolved",
|
|
155
|
+
requirement,
|
|
156
|
+
candidates: [provider],
|
|
157
|
+
reason: compat.reasons.join("; ")
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// Discover candidates: applications providing this capability
|
|
162
|
+
const candidates = await this.#registry.findByCapability(requirement.name);
|
|
163
|
+
if (candidates.length === 0) {
|
|
164
|
+
return {
|
|
165
|
+
kind: "unresolved",
|
|
166
|
+
requirement,
|
|
167
|
+
candidates: [],
|
|
168
|
+
reason: `No providers found for capability "${requirement.name}"`
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
// Evaluate compatibility for each candidate
|
|
172
|
+
const compatible = [];
|
|
173
|
+
for (const candidate of candidates) {
|
|
174
|
+
const compat = evaluateCompatibility(requirement, candidate);
|
|
175
|
+
if (compat.compatible) {
|
|
176
|
+
const capability = candidate.manifest.provides.find((cap) => cap.name === requirement.name);
|
|
177
|
+
compatible.push({ provider: candidate, capability });
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (compatible.length === 0) {
|
|
181
|
+
return {
|
|
182
|
+
kind: "unresolved",
|
|
183
|
+
requirement,
|
|
184
|
+
candidates,
|
|
185
|
+
reason: `No compatible providers found for "${requirement.name}"`
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
if (compatible.length > 1) {
|
|
189
|
+
// Apply deterministic selection: highest version, then by application ID
|
|
190
|
+
compatible.sort((a, b) => {
|
|
191
|
+
const versionDiff = b.capability.version - a.capability.version;
|
|
192
|
+
if (versionDiff !== 0)
|
|
193
|
+
return versionDiff;
|
|
194
|
+
return a.provider.id.localeCompare(b.provider.id);
|
|
195
|
+
});
|
|
196
|
+
// Check if the top candidate is unique
|
|
197
|
+
const top = compatible[0];
|
|
198
|
+
const second = compatible[1];
|
|
199
|
+
if (top.capability.version === second.capability.version &&
|
|
200
|
+
top.provider.id !== second.provider.id) {
|
|
201
|
+
// Ambiguous: multiple providers with same version
|
|
202
|
+
return {
|
|
203
|
+
kind: "ambiguous",
|
|
204
|
+
requirement,
|
|
205
|
+
candidates: compatible.map((c) => c.provider)
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Return the selected provider
|
|
210
|
+
const selected = compatible[0];
|
|
211
|
+
const resolution = {
|
|
212
|
+
kind: "resolved",
|
|
213
|
+
requirement,
|
|
214
|
+
provider: selected.provider,
|
|
215
|
+
capability: selected.capability,
|
|
216
|
+
compatibility: { compatible: true, reasons: [] }
|
|
217
|
+
};
|
|
218
|
+
attestResolution(resolution, this.#registry);
|
|
219
|
+
return resolution;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Resolve all requirements of an application.
|
|
223
|
+
*
|
|
224
|
+
* Returns a comprehensive ApplicationResolution containing:
|
|
225
|
+
* - All resolution results
|
|
226
|
+
* - Separated resolved/unresolved/ambiguous for easy access
|
|
227
|
+
* - The application state (unchanged)
|
|
228
|
+
*/
|
|
229
|
+
async resolveApplication(application) {
|
|
230
|
+
const results = [];
|
|
231
|
+
for (const requirement of application.manifest.requires) {
|
|
232
|
+
const requirementWithConstraints = {
|
|
233
|
+
...requirement,
|
|
234
|
+
versionConstraint: requirement.versionConstraint || String(requirement.version)
|
|
235
|
+
};
|
|
236
|
+
const result = await this.resolveRequirement(requirementWithConstraints);
|
|
237
|
+
results.push(result);
|
|
238
|
+
}
|
|
239
|
+
// Separate into categories
|
|
240
|
+
const resolved = results.filter((r) => r.kind === "resolved");
|
|
241
|
+
const unresolved = results.filter((r) => r.kind === "unresolved");
|
|
242
|
+
const ambiguous = results.filter((r) => r.kind === "ambiguous");
|
|
243
|
+
return {
|
|
244
|
+
application,
|
|
245
|
+
results,
|
|
246
|
+
resolved,
|
|
247
|
+
unresolved,
|
|
248
|
+
ambiguous
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+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WAAW,CAAC,iBAAiB,IAAI,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC;aAChF,CAAC;YACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,0BAA0B,CAAC,CAAC;YACzE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;QAED,2BAA2B;QAC3B,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAA4B,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;QACxF,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAA8B,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;QAC9F,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAA6B,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;QAE3F,OAAO;YACL,WAAW;YACX,OAAO;YACP,QAAQ;YACR,UAAU;YACV,SAAS;SACV,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime Implementation Manifest (F6)
|
|
3
|
+
*
|
|
4
|
+
* The local, per-source description of what a repository/runtime actually
|
|
5
|
+
* implements. It is implementation metadata and nothing else.
|
|
6
|
+
*
|
|
7
|
+
* It establishes:
|
|
8
|
+
* - implementation capability coverage
|
|
9
|
+
*
|
|
10
|
+
* It does NOT establish:
|
|
11
|
+
* - application identity
|
|
12
|
+
* - contract authority
|
|
13
|
+
* - the application fingerprint
|
|
14
|
+
* - authorization
|
|
15
|
+
* - provider identity
|
|
16
|
+
*
|
|
17
|
+
* This schema is deliberately distinct from `AppBoundryContractDocument`. The
|
|
18
|
+
* two documents are never aliased, and parsing one rejects the other so a
|
|
19
|
+
* contract mismatch can never be converted into a runtime-manifest match.
|
|
20
|
+
*/
|
|
21
|
+
/** Protocol identifier of the runtime implementation manifest. */
|
|
22
|
+
export declare const RUNTIME_IMPLEMENTATION_MANIFEST_PROTOCOL = "AppPort/runtime-implementation/1";
|
|
23
|
+
/** Canonical file name of the runtime implementation manifest. */
|
|
24
|
+
export declare const RUNTIME_IMPLEMENTATION_MANIFEST_FILE = "appport.implementation.json";
|
|
25
|
+
/** A capability this source claims to implement. */
|
|
26
|
+
export interface RuntimeImplementedCapability {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly version: number;
|
|
29
|
+
/** Optional implementation entry point, meaningful only to the source. */
|
|
30
|
+
readonly entry?: string;
|
|
31
|
+
}
|
|
32
|
+
/** What a particular source implements of an application it does not own. */
|
|
33
|
+
export interface RuntimeImplementationManifest {
|
|
34
|
+
readonly protocol: typeof RUNTIME_IMPLEMENTATION_MANIFEST_PROTOCOL;
|
|
35
|
+
/** Reference to the AppBoundry application. The source never owns this id. */
|
|
36
|
+
readonly applicationId: string;
|
|
37
|
+
/** Stable identity of this implementation, distinct from the application. */
|
|
38
|
+
readonly implementationId?: string;
|
|
39
|
+
/** Provider-neutral source connection identity established by AppBoundry. */
|
|
40
|
+
readonly sourceId?: string;
|
|
41
|
+
readonly implements: readonly RuntimeImplementedCapability[];
|
|
42
|
+
readonly build?: {
|
|
43
|
+
readonly command?: string;
|
|
44
|
+
readonly artifactPath?: string;
|
|
45
|
+
};
|
|
46
|
+
readonly runtime?: {
|
|
47
|
+
readonly engine?: "wasm";
|
|
48
|
+
readonly artifactHash?: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export type RuntimeManifestErrorCode = "RUNTIME_MANIFEST_INVALID" | "RUNTIME_MANIFEST_IS_A_CONTRACT";
|
|
52
|
+
/** Explicit runtime-manifest failure; never silently promoted to a contract. */
|
|
53
|
+
export declare class RuntimeManifestError extends Error {
|
|
54
|
+
readonly code: RuntimeManifestErrorCode;
|
|
55
|
+
constructor(code: RuntimeManifestErrorCode, message: string);
|
|
56
|
+
}
|
|
57
|
+
/** Parse a runtime implementation manifest, rejecting contract documents. */
|
|
58
|
+
export declare function parseRuntimeImplementationManifest(value: unknown): RuntimeImplementationManifest;
|
|
59
|
+
/**
|
|
60
|
+
* Derive implementation coverage from a runtime manifest.
|
|
61
|
+
*
|
|
62
|
+
* Coverage is a claim, not an authority. It becomes meaningful only once
|
|
63
|
+
* validated against the authoritative contract (see `contract-attestation.ts`).
|
|
64
|
+
*/
|
|
65
|
+
export declare function deriveImplementationCoverage(manifest: RuntimeImplementationManifest): readonly string[];
|
|
66
|
+
/** Render a runtime implementation manifest for a repository to commit. */
|
|
67
|
+
export declare function serializeRuntimeImplementationManifest(manifest: RuntimeImplementationManifest): string;
|
|
68
|
+
//# sourceMappingURL=runtime-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-manifest.d.ts","sourceRoot":"","sources":["../src/runtime-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,kEAAkE;AAClE,eAAO,MAAM,wCAAwC,qCAAqC,CAAC;AAE3F,kEAAkE;AAClE,eAAO,MAAM,oCAAoC,gCAAgC,CAAC;AAElF,oDAAoD;AACpD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,6EAA6E;AAC7E,MAAM,WAAW,6BAA6B;IAC5C,QAAQ,CAAC,QAAQ,EAAE,OAAO,wCAAwC,CAAC;IACnE,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAA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