@appport/sdk 1.1.18 → 1.1.19
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 +9 -86
- package/dist/index.d.ts +13 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -18
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/package.json +22 -32
- package/LICENSE +0 -126
- package/dist/application-onboarding.d.ts +0 -52
- package/dist/application-onboarding.d.ts.map +0 -1
- package/dist/application-onboarding.js +0 -50
- package/dist/application-onboarding.js.map +0 -1
- package/dist/external-compatibility.d.ts +0 -142
- package/dist/external-compatibility.d.ts.map +0 -1
- package/dist/external-compatibility.js +0 -132
- package/dist/external-compatibility.js.map +0 -1
- package/dist/provider-lifecycle.d.ts +0 -247
- package/dist/provider-lifecycle.d.ts.map +0 -1
- package/dist/provider-lifecycle.js +0 -314
- package/dist/provider-lifecycle.js.map +0 -1
- package/dist/resolution-policy.d.ts +0 -81
- package/dist/resolution-policy.d.ts.map +0 -1
- package/dist/resolution-policy.js +0 -131
- package/dist/resolution-policy.js.map +0 -1
- package/vendor/@appport/authorization/README.md +0 -28
- package/vendor/@appport/authorization/dist/index.d.ts +0 -94
- package/vendor/@appport/authorization/dist/index.d.ts.map +0 -1
- package/vendor/@appport/authorization/dist/index.js +0 -131
- package/vendor/@appport/authorization/dist/index.js.map +0 -1
- package/vendor/@appport/authorization/package.json +0 -28
- package/vendor/@appport/client/README.md +0 -35
- package/vendor/@appport/client/dist/channel.d.ts +0 -14
- package/vendor/@appport/client/dist/channel.d.ts.map +0 -1
- package/vendor/@appport/client/dist/channel.js +0 -58
- package/vendor/@appport/client/dist/channel.js.map +0 -1
- package/vendor/@appport/client/dist/client.d.ts +0 -61
- package/vendor/@appport/client/dist/client.d.ts.map +0 -1
- package/vendor/@appport/client/dist/client.js +0 -214
- package/vendor/@appport/client/dist/client.js.map +0 -1
- package/vendor/@appport/client/dist/contract.d.ts +0 -55
- package/vendor/@appport/client/dist/contract.d.ts.map +0 -1
- package/vendor/@appport/client/dist/contract.js +0 -12
- package/vendor/@appport/client/dist/contract.js.map +0 -1
- package/vendor/@appport/client/dist/discovery.d.ts +0 -17
- package/vendor/@appport/client/dist/discovery.d.ts.map +0 -1
- package/vendor/@appport/client/dist/discovery.js +0 -56
- package/vendor/@appport/client/dist/discovery.js.map +0 -1
- package/vendor/@appport/client/dist/duplex.d.ts +0 -25
- package/vendor/@appport/client/dist/duplex.d.ts.map +0 -1
- package/vendor/@appport/client/dist/duplex.js +0 -194
- package/vendor/@appport/client/dist/duplex.js.map +0 -1
- package/vendor/@appport/client/dist/host.d.ts +0 -62
- package/vendor/@appport/client/dist/host.d.ts.map +0 -1
- package/vendor/@appport/client/dist/host.js +0 -139
- package/vendor/@appport/client/dist/host.js.map +0 -1
- package/vendor/@appport/client/dist/index.d.ts +0 -14
- package/vendor/@appport/client/dist/index.d.ts.map +0 -1
- package/vendor/@appport/client/dist/index.js +0 -14
- package/vendor/@appport/client/dist/index.js.map +0 -1
- package/vendor/@appport/client/dist/transport.d.ts +0 -42
- package/vendor/@appport/client/dist/transport.d.ts.map +0 -1
- package/vendor/@appport/client/dist/transport.js +0 -2
- package/vendor/@appport/client/dist/transport.js.map +0 -1
- package/vendor/@appport/client/package.json +0 -32
- package/vendor/@appport/core/README.md +0 -91
- package/vendor/@appport/core/dist/appboundry-capability-catalog.d.ts +0 -930
- package/vendor/@appport/core/dist/appboundry-capability-catalog.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-capability-catalog.js +0 -352
- package/vendor/@appport/core/dist/appboundry-capability-catalog.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-composition.d.ts +0 -93
- package/vendor/@appport/core/dist/appboundry-composition.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-composition.js +0 -184
- package/vendor/@appport/core/dist/appboundry-composition.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-contract.d.ts +0 -80
- package/vendor/@appport/core/dist/appboundry-contract.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-contract.js +0 -160
- package/vendor/@appport/core/dist/appboundry-contract.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-diagnostics.d.ts +0 -107
- package/vendor/@appport/core/dist/appboundry-diagnostics.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-diagnostics.js +0 -358
- package/vendor/@appport/core/dist/appboundry-diagnostics.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-discovery.d.ts +0 -110
- package/vendor/@appport/core/dist/appboundry-discovery.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-discovery.js +0 -141
- package/vendor/@appport/core/dist/appboundry-discovery.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-entitlements.d.ts +0 -128
- package/vendor/@appport/core/dist/appboundry-entitlements.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-entitlements.js +0 -312
- package/vendor/@appport/core/dist/appboundry-entitlements.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-execution.d.ts +0 -84
- package/vendor/@appport/core/dist/appboundry-execution.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-execution.js +0 -150
- package/vendor/@appport/core/dist/appboundry-execution.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-exercise.d.ts +0 -152
- package/vendor/@appport/core/dist/appboundry-exercise.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-exercise.js +0 -416
- package/vendor/@appport/core/dist/appboundry-exercise.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-materialization.d.ts +0 -222
- package/vendor/@appport/core/dist/appboundry-materialization.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-materialization.js +0 -494
- package/vendor/@appport/core/dist/appboundry-materialization.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-migration.d.ts +0 -195
- package/vendor/@appport/core/dist/appboundry-migration.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-migration.js +0 -227
- package/vendor/@appport/core/dist/appboundry-migration.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-onboarding.d.ts +0 -70
- package/vendor/@appport/core/dist/appboundry-onboarding.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-onboarding.js +0 -232
- package/vendor/@appport/core/dist/appboundry-onboarding.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-operation-discovery.d.ts +0 -93
- package/vendor/@appport/core/dist/appboundry-operation-discovery.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-operation-discovery.js +0 -89
- package/vendor/@appport/core/dist/appboundry-operation-discovery.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-resolution.d.ts +0 -160
- package/vendor/@appport/core/dist/appboundry-resolution.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-resolution.js +0 -218
- package/vendor/@appport/core/dist/appboundry-resolution.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-surface.d.ts +0 -96
- package/vendor/@appport/core/dist/appboundry-surface.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-surface.js +0 -223
- package/vendor/@appport/core/dist/appboundry-surface.js.map +0 -1
- package/vendor/@appport/core/dist/appboundry-usage.d.ts +0 -94
- package/vendor/@appport/core/dist/appboundry-usage.d.ts.map +0 -1
- package/vendor/@appport/core/dist/appboundry-usage.js +0 -80
- package/vendor/@appport/core/dist/appboundry-usage.js.map +0 -1
- package/vendor/@appport/core/dist/application-implementation.d.ts +0 -125
- package/vendor/@appport/core/dist/application-implementation.d.ts.map +0 -1
- package/vendor/@appport/core/dist/application-implementation.js +0 -220
- package/vendor/@appport/core/dist/application-implementation.js.map +0 -1
- package/vendor/@appport/core/dist/application-lifecycle.d.ts +0 -150
- package/vendor/@appport/core/dist/application-lifecycle.d.ts.map +0 -1
- package/vendor/@appport/core/dist/application-lifecycle.js +0 -70
- package/vendor/@appport/core/dist/application-lifecycle.js.map +0 -1
- package/vendor/@appport/core/dist/application-package.d.ts +0 -105
- package/vendor/@appport/core/dist/application-package.d.ts.map +0 -1
- package/vendor/@appport/core/dist/application-package.js +0 -349
- package/vendor/@appport/core/dist/application-package.js.map +0 -1
- package/vendor/@appport/core/dist/application-source.d.ts +0 -109
- package/vendor/@appport/core/dist/application-source.d.ts.map +0 -1
- package/vendor/@appport/core/dist/application-source.js +0 -186
- package/vendor/@appport/core/dist/application-source.js.map +0 -1
- package/vendor/@appport/core/dist/application.d.ts +0 -124
- package/vendor/@appport/core/dist/application.d.ts.map +0 -1
- package/vendor/@appport/core/dist/application.js +0 -518
- package/vendor/@appport/core/dist/application.js.map +0 -1
- package/vendor/@appport/core/dist/artifact.d.ts +0 -395
- package/vendor/@appport/core/dist/artifact.d.ts.map +0 -1
- package/vendor/@appport/core/dist/artifact.js +0 -392
- package/vendor/@appport/core/dist/artifact.js.map +0 -1
- package/vendor/@appport/core/dist/assembly.d.ts +0 -237
- package/vendor/@appport/core/dist/assembly.d.ts.map +0 -1
- package/vendor/@appport/core/dist/assembly.js +0 -458
- package/vendor/@appport/core/dist/assembly.js.map +0 -1
- package/vendor/@appport/core/dist/authority-attestation.d.ts +0 -34
- package/vendor/@appport/core/dist/authority-attestation.d.ts.map +0 -1
- package/vendor/@appport/core/dist/authority-attestation.js +0 -72
- package/vendor/@appport/core/dist/authority-attestation.js.map +0 -1
- package/vendor/@appport/core/dist/authorization-grant.d.ts +0 -107
- package/vendor/@appport/core/dist/authorization-grant.d.ts.map +0 -1
- package/vendor/@appport/core/dist/authorization-grant.js +0 -131
- package/vendor/@appport/core/dist/authorization-grant.js.map +0 -1
- package/vendor/@appport/core/dist/binding.d.ts +0 -294
- package/vendor/@appport/core/dist/binding.d.ts.map +0 -1
- package/vendor/@appport/core/dist/binding.js +0 -263
- package/vendor/@appport/core/dist/binding.js.map +0 -1
- package/vendor/@appport/core/dist/builtins.d.ts +0 -18
- package/vendor/@appport/core/dist/builtins.d.ts.map +0 -1
- package/vendor/@appport/core/dist/builtins.js +0 -38
- package/vendor/@appport/core/dist/builtins.js.map +0 -1
- package/vendor/@appport/core/dist/capability.d.ts +0 -94
- package/vendor/@appport/core/dist/capability.d.ts.map +0 -1
- package/vendor/@appport/core/dist/capability.js +0 -85
- package/vendor/@appport/core/dist/capability.js.map +0 -1
- package/vendor/@appport/core/dist/concurrency.d.ts +0 -16
- package/vendor/@appport/core/dist/concurrency.d.ts.map +0 -1
- package/vendor/@appport/core/dist/concurrency.js +0 -46
- package/vendor/@appport/core/dist/concurrency.js.map +0 -1
- package/vendor/@appport/core/dist/context.d.ts +0 -59
- package/vendor/@appport/core/dist/context.d.ts.map +0 -1
- package/vendor/@appport/core/dist/context.js +0 -14
- package/vendor/@appport/core/dist/context.js.map +0 -1
- package/vendor/@appport/core/dist/contract-artifact.d.ts +0 -15
- package/vendor/@appport/core/dist/contract-artifact.d.ts.map +0 -1
- package/vendor/@appport/core/dist/contract-artifact.js +0 -161
- package/vendor/@appport/core/dist/contract-artifact.js.map +0 -1
- package/vendor/@appport/core/dist/contract-attestation.d.ts +0 -68
- package/vendor/@appport/core/dist/contract-attestation.d.ts.map +0 -1
- package/vendor/@appport/core/dist/contract-attestation.js +0 -76
- package/vendor/@appport/core/dist/contract-attestation.js.map +0 -1
- package/vendor/@appport/core/dist/crash-injection.d.ts +0 -3
- package/vendor/@appport/core/dist/crash-injection.d.ts.map +0 -1
- package/vendor/@appport/core/dist/crash-injection.js +0 -8
- package/vendor/@appport/core/dist/crash-injection.js.map +0 -1
- package/vendor/@appport/core/dist/events.d.ts +0 -33
- package/vendor/@appport/core/dist/events.d.ts.map +0 -1
- package/vendor/@appport/core/dist/events.js +0 -79
- package/vendor/@appport/core/dist/events.js.map +0 -1
- package/vendor/@appport/core/dist/execution-barrier.d.ts +0 -13
- package/vendor/@appport/core/dist/execution-barrier.d.ts.map +0 -1
- package/vendor/@appport/core/dist/execution-barrier.js +0 -33
- package/vendor/@appport/core/dist/execution-barrier.js.map +0 -1
- package/vendor/@appport/core/dist/execution-ledger.d.ts +0 -81
- package/vendor/@appport/core/dist/execution-ledger.d.ts.map +0 -1
- package/vendor/@appport/core/dist/execution-ledger.js +0 -173
- package/vendor/@appport/core/dist/execution-ledger.js.map +0 -1
- package/vendor/@appport/core/dist/execution.d.ts +0 -387
- package/vendor/@appport/core/dist/execution.d.ts.map +0 -1
- package/vendor/@appport/core/dist/execution.js +0 -165
- package/vendor/@appport/core/dist/execution.js.map +0 -1
- package/vendor/@appport/core/dist/idempotency.d.ts +0 -36
- package/vendor/@appport/core/dist/idempotency.d.ts.map +0 -1
- package/vendor/@appport/core/dist/idempotency.js +0 -36
- package/vendor/@appport/core/dist/idempotency.js.map +0 -1
- package/vendor/@appport/core/dist/implementation.d.ts +0 -110
- package/vendor/@appport/core/dist/implementation.d.ts.map +0 -1
- package/vendor/@appport/core/dist/implementation.js +0 -65
- package/vendor/@appport/core/dist/implementation.js.map +0 -1
- package/vendor/@appport/core/dist/index.d.ts +0 -61
- package/vendor/@appport/core/dist/index.d.ts.map +0 -1
- package/vendor/@appport/core/dist/index.js +0 -60
- package/vendor/@appport/core/dist/index.js.map +0 -1
- package/vendor/@appport/core/dist/invocation.d.ts +0 -253
- package/vendor/@appport/core/dist/invocation.d.ts.map +0 -1
- package/vendor/@appport/core/dist/invocation.js +0 -258
- package/vendor/@appport/core/dist/invocation.js.map +0 -1
- package/vendor/@appport/core/dist/manifest.d.ts +0 -157
- package/vendor/@appport/core/dist/manifest.d.ts.map +0 -1
- package/vendor/@appport/core/dist/manifest.js +0 -255
- package/vendor/@appport/core/dist/manifest.js.map +0 -1
- package/vendor/@appport/core/dist/memory-application-data-store.d.ts +0 -19
- package/vendor/@appport/core/dist/memory-application-data-store.d.ts.map +0 -1
- package/vendor/@appport/core/dist/memory-application-data-store.js +0 -161
- package/vendor/@appport/core/dist/memory-application-data-store.js.map +0 -1
- package/vendor/@appport/core/dist/operations.d.ts +0 -61
- package/vendor/@appport/core/dist/operations.d.ts.map +0 -1
- package/vendor/@appport/core/dist/operations.js +0 -210
- package/vendor/@appport/core/dist/operations.js.map +0 -1
- package/vendor/@appport/core/dist/provider-contract.d.ts +0 -89
- package/vendor/@appport/core/dist/provider-contract.d.ts.map +0 -1
- package/vendor/@appport/core/dist/provider-contract.js +0 -40
- package/vendor/@appport/core/dist/provider-contract.js.map +0 -1
- package/vendor/@appport/core/dist/public.d.ts +0 -20
- package/vendor/@appport/core/dist/public.d.ts.map +0 -1
- package/vendor/@appport/core/dist/public.js +0 -19
- package/vendor/@appport/core/dist/public.js.map +0 -1
- package/vendor/@appport/core/dist/registration.d.ts +0 -165
- package/vendor/@appport/core/dist/registration.d.ts.map +0 -1
- package/vendor/@appport/core/dist/registration.js +0 -253
- package/vendor/@appport/core/dist/registration.js.map +0 -1
- package/vendor/@appport/core/dist/registry.d.ts +0 -30
- package/vendor/@appport/core/dist/registry.d.ts.map +0 -1
- package/vendor/@appport/core/dist/registry.js +0 -149
- package/vendor/@appport/core/dist/registry.js.map +0 -1
- package/vendor/@appport/core/dist/repository-connection.d.ts +0 -100
- package/vendor/@appport/core/dist/repository-connection.d.ts.map +0 -1
- package/vendor/@appport/core/dist/repository-connection.js +0 -57
- package/vendor/@appport/core/dist/repository-connection.js.map +0 -1
- package/vendor/@appport/core/dist/resolver.d.ts +0 -130
- package/vendor/@appport/core/dist/resolver.d.ts.map +0 -1
- package/vendor/@appport/core/dist/resolver.js +0 -252
- package/vendor/@appport/core/dist/resolver.js.map +0 -1
- package/vendor/@appport/core/dist/runtime-manifest.d.ts +0 -68
- package/vendor/@appport/core/dist/runtime-manifest.d.ts.map +0 -1
- package/vendor/@appport/core/dist/runtime-manifest.js +0 -84
- package/vendor/@appport/core/dist/runtime-manifest.js.map +0 -1
- package/vendor/@appport/core/dist/sanitize.d.ts +0 -14
- package/vendor/@appport/core/dist/sanitize.d.ts.map +0 -1
- package/vendor/@appport/core/dist/sanitize.js +0 -49
- package/vendor/@appport/core/dist/sanitize.js.map +0 -1
- package/vendor/@appport/core/dist/server-internal.d.ts +0 -5
- package/vendor/@appport/core/dist/server-internal.d.ts.map +0 -1
- package/vendor/@appport/core/dist/server-internal.js +0 -4
- package/vendor/@appport/core/dist/server-internal.js.map +0 -1
- package/vendor/@appport/core/dist/sessions.d.ts +0 -29
- package/vendor/@appport/core/dist/sessions.d.ts.map +0 -1
- package/vendor/@appport/core/dist/sessions.js +0 -39
- package/vendor/@appport/core/dist/sessions.js.map +0 -1
- package/vendor/@appport/core/dist/sha256.d.ts +0 -3
- package/vendor/@appport/core/dist/sha256.d.ts.map +0 -1
- package/vendor/@appport/core/dist/sha256.js +0 -46
- package/vendor/@appport/core/dist/sha256.js.map +0 -1
- package/vendor/@appport/core/dist/source-verification.d.ts +0 -53
- package/vendor/@appport/core/dist/source-verification.d.ts.map +0 -1
- package/vendor/@appport/core/dist/source-verification.js +0 -92
- package/vendor/@appport/core/dist/source-verification.js.map +0 -1
- package/vendor/@appport/core/dist/state-context.d.ts +0 -312
- package/vendor/@appport/core/dist/state-context.d.ts.map +0 -1
- package/vendor/@appport/core/dist/state-context.js +0 -100
- package/vendor/@appport/core/dist/state-context.js.map +0 -1
- package/vendor/@appport/core/dist/state.d.ts +0 -96
- package/vendor/@appport/core/dist/state.d.ts.map +0 -1
- package/vendor/@appport/core/dist/state.js +0 -89
- package/vendor/@appport/core/dist/state.js.map +0 -1
- package/vendor/@appport/core/dist/streams.d.ts +0 -38
- package/vendor/@appport/core/dist/streams.d.ts.map +0 -1
- package/vendor/@appport/core/dist/streams.js +0 -123
- package/vendor/@appport/core/dist/streams.js.map +0 -1
- package/vendor/@appport/core/dist/telemetry.d.ts +0 -42
- package/vendor/@appport/core/dist/telemetry.d.ts.map +0 -1
- package/vendor/@appport/core/dist/telemetry.js +0 -32
- package/vendor/@appport/core/dist/telemetry.js.map +0 -1
- package/vendor/@appport/core/dist/wasm-engine.d.ts +0 -24
- package/vendor/@appport/core/dist/wasm-engine.d.ts.map +0 -1
- package/vendor/@appport/core/dist/wasm-engine.js +0 -376
- package/vendor/@appport/core/dist/wasm-engine.js.map +0 -1
- package/vendor/@appport/core/package.json +0 -58
- package/vendor/@appport/mcp/README.md +0 -29
- package/vendor/@appport/mcp/dist/index.d.ts +0 -58
- package/vendor/@appport/mcp/dist/index.d.ts.map +0 -1
- package/vendor/@appport/mcp/dist/index.js +0 -69
- package/vendor/@appport/mcp/dist/index.js.map +0 -1
- package/vendor/@appport/mcp/package.json +0 -29
- package/vendor/@appport/mobile/README.md +0 -10
- package/vendor/@appport/mobile/dist/index.d.ts +0 -66
- package/vendor/@appport/mobile/dist/index.d.ts.map +0 -1
- package/vendor/@appport/mobile/dist/index.js +0 -182
- package/vendor/@appport/mobile/dist/index.js.map +0 -1
- package/vendor/@appport/mobile/package.json +0 -33
- package/vendor/@appport/protocol/README.md +0 -41
- package/vendor/@appport/protocol/dist/blob.d.ts +0 -46
- package/vendor/@appport/protocol/dist/blob.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/blob.js +0 -23
- package/vendor/@appport/protocol/dist/blob.js.map +0 -1
- package/vendor/@appport/protocol/dist/compatibility.d.ts +0 -25
- package/vendor/@appport/protocol/dist/compatibility.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/compatibility.js +0 -189
- package/vendor/@appport/protocol/dist/compatibility.js.map +0 -1
- package/vendor/@appport/protocol/dist/envelopes.d.ts +0 -175
- package/vendor/@appport/protocol/dist/envelopes.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/envelopes.js +0 -97
- package/vendor/@appport/protocol/dist/envelopes.js.map +0 -1
- package/vendor/@appport/protocol/dist/errors.d.ts +0 -74
- package/vendor/@appport/protocol/dist/errors.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/errors.js +0 -92
- package/vendor/@appport/protocol/dist/errors.js.map +0 -1
- package/vendor/@appport/protocol/dist/ids.d.ts +0 -12
- package/vendor/@appport/protocol/dist/ids.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/ids.js +0 -50
- package/vendor/@appport/protocol/dist/ids.js.map +0 -1
- package/vendor/@appport/protocol/dist/index.d.ts +0 -21
- package/vendor/@appport/protocol/dist/index.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/index.js +0 -21
- package/vendor/@appport/protocol/dist/index.js.map +0 -1
- package/vendor/@appport/protocol/dist/jsonschema.d.ts +0 -50
- package/vendor/@appport/protocol/dist/jsonschema.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/jsonschema.js +0 -6
- package/vendor/@appport/protocol/dist/jsonschema.js.map +0 -1
- package/vendor/@appport/protocol/dist/manifest.d.ts +0 -134
- package/vendor/@appport/protocol/dist/manifest.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/manifest.js +0 -20
- package/vendor/@appport/protocol/dist/manifest.js.map +0 -1
- package/vendor/@appport/protocol/dist/materialization.d.ts +0 -59
- package/vendor/@appport/protocol/dist/materialization.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/materialization.js +0 -2
- package/vendor/@appport/protocol/dist/materialization.js.map +0 -1
- package/vendor/@appport/protocol/dist/names.d.ts +0 -26
- package/vendor/@appport/protocol/dist/names.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/names.js +0 -85
- package/vendor/@appport/protocol/dist/names.js.map +0 -1
- package/vendor/@appport/protocol/dist/operations.d.ts +0 -34
- package/vendor/@appport/protocol/dist/operations.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/operations.js +0 -9
- package/vendor/@appport/protocol/dist/operations.js.map +0 -1
- package/vendor/@appport/protocol/dist/session.d.ts +0 -27
- package/vendor/@appport/protocol/dist/session.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/session.js +0 -7
- package/vendor/@appport/protocol/dist/session.js.map +0 -1
- package/vendor/@appport/protocol/dist/validate.d.ts +0 -37
- package/vendor/@appport/protocol/dist/validate.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/validate.js +0 -321
- package/vendor/@appport/protocol/dist/validate.js.map +0 -1
- package/vendor/@appport/protocol/dist/version.d.ts +0 -27
- package/vendor/@appport/protocol/dist/version.d.ts.map +0 -1
- package/vendor/@appport/protocol/dist/version.js +0 -26
- package/vendor/@appport/protocol/dist/version.js.map +0 -1
- package/vendor/@appport/protocol/package.json +0 -25
- package/vendor/@appport/schema/README.md +0 -32
- package/vendor/@appport/schema/dist/builder.d.ts +0 -85
- package/vendor/@appport/schema/dist/builder.d.ts.map +0 -1
- package/vendor/@appport/schema/dist/builder.js +0 -278
- package/vendor/@appport/schema/dist/builder.js.map +0 -1
- package/vendor/@appport/schema/dist/from-json-schema.d.ts +0 -12
- package/vendor/@appport/schema/dist/from-json-schema.d.ts.map +0 -1
- package/vendor/@appport/schema/dist/from-json-schema.js +0 -186
- package/vendor/@appport/schema/dist/from-json-schema.js.map +0 -1
- package/vendor/@appport/schema/dist/index.d.ts +0 -23
- package/vendor/@appport/schema/dist/index.d.ts.map +0 -1
- package/vendor/@appport/schema/dist/index.js +0 -22
- package/vendor/@appport/schema/dist/index.js.map +0 -1
- package/vendor/@appport/schema/dist/standard.d.ts +0 -46
- package/vendor/@appport/schema/dist/standard.d.ts.map +0 -1
- package/vendor/@appport/schema/dist/standard.js +0 -42
- package/vendor/@appport/schema/dist/standard.js.map +0 -1
- package/vendor/@appport/schema/dist/types.d.ts +0 -40
- package/vendor/@appport/schema/dist/types.d.ts.map +0 -1
- package/vendor/@appport/schema/dist/types.js +0 -19
- package/vendor/@appport/schema/dist/types.js.map +0 -1
- package/vendor/@appport/schema/package.json +0 -28
- package/vendor/@appport/server/README.md +0 -39
- package/vendor/@appport/server/dist/connection.d.ts +0 -45
- package/vendor/@appport/server/dist/connection.d.ts.map +0 -1
- package/vendor/@appport/server/dist/connection.js +0 -217
- package/vendor/@appport/server/dist/connection.js.map +0 -1
- package/vendor/@appport/server/dist/fetch.d.ts +0 -10
- package/vendor/@appport/server/dist/fetch.d.ts.map +0 -1
- package/vendor/@appport/server/dist/fetch.js +0 -50
- package/vendor/@appport/server/dist/fetch.js.map +0 -1
- package/vendor/@appport/server/dist/http.d.ts +0 -80
- package/vendor/@appport/server/dist/http.d.ts.map +0 -1
- package/vendor/@appport/server/dist/http.js +0 -307
- package/vendor/@appport/server/dist/http.js.map +0 -1
- package/vendor/@appport/server/dist/index.d.ts +0 -11
- package/vendor/@appport/server/dist/index.d.ts.map +0 -1
- package/vendor/@appport/server/dist/index.js +0 -11
- package/vendor/@appport/server/dist/index.js.map +0 -1
- package/vendor/@appport/server/dist/node-entry.d.ts +0 -4
- package/vendor/@appport/server/dist/node-entry.d.ts.map +0 -1
- package/vendor/@appport/server/dist/node-entry.js +0 -4
- package/vendor/@appport/server/dist/node-entry.js.map +0 -1
- package/vendor/@appport/server/dist/node.d.ts +0 -45
- package/vendor/@appport/server/dist/node.d.ts.map +0 -1
- package/vendor/@appport/server/dist/node.js +0 -190
- package/vendor/@appport/server/dist/node.js.map +0 -1
- package/vendor/@appport/server/dist/server.d.ts +0 -83
- package/vendor/@appport/server/dist/server.d.ts.map +0 -1
- package/vendor/@appport/server/dist/server.js +0 -114
- package/vendor/@appport/server/dist/server.js.map +0 -1
- package/vendor/@appport/server/dist/websocket.d.ts +0 -25
- package/vendor/@appport/server/dist/websocket.d.ts.map +0 -1
- package/vendor/@appport/server/dist/websocket.js +0 -221
- package/vendor/@appport/server/dist/websocket.js.map +0 -1
- package/vendor/@appport/server/package.json +0 -34
- package/vendor/@appport/transport-electron/README.md +0 -56
- package/vendor/@appport/transport-electron/dist/index.d.ts +0 -11
- package/vendor/@appport/transport-electron/dist/index.d.ts.map +0 -1
- package/vendor/@appport/transport-electron/dist/index.js +0 -11
- package/vendor/@appport/transport-electron/dist/index.js.map +0 -1
- package/vendor/@appport/transport-electron/dist/main.d.ts +0 -31
- package/vendor/@appport/transport-electron/dist/main.d.ts.map +0 -1
- package/vendor/@appport/transport-electron/dist/main.js +0 -61
- package/vendor/@appport/transport-electron/dist/main.js.map +0 -1
- package/vendor/@appport/transport-electron/dist/preload.d.ts +0 -22
- package/vendor/@appport/transport-electron/dist/preload.d.ts.map +0 -1
- package/vendor/@appport/transport-electron/dist/preload.js +0 -29
- package/vendor/@appport/transport-electron/dist/preload.js.map +0 -1
- package/vendor/@appport/transport-electron/dist/renderer.d.ts +0 -16
- package/vendor/@appport/transport-electron/dist/renderer.d.ts.map +0 -1
- package/vendor/@appport/transport-electron/dist/renderer.js +0 -36
- package/vendor/@appport/transport-electron/dist/renderer.js.map +0 -1
- package/vendor/@appport/transport-electron/dist/types.d.ts +0 -49
- package/vendor/@appport/transport-electron/dist/types.d.ts.map +0 -1
- package/vendor/@appport/transport-electron/dist/types.js +0 -5
- package/vendor/@appport/transport-electron/dist/types.js.map +0 -1
- package/vendor/@appport/transport-electron/package.json +0 -46
- package/vendor/@appport/transport-http/README.md +0 -24
- package/vendor/@appport/transport-http/dist/index.d.ts +0 -18
- package/vendor/@appport/transport-http/dist/index.d.ts.map +0 -1
- package/vendor/@appport/transport-http/dist/index.js +0 -223
- package/vendor/@appport/transport-http/dist/index.js.map +0 -1
- package/vendor/@appport/transport-http/package.json +0 -29
- package/vendor/@appport/transport-inprocess/README.md +0 -24
- package/vendor/@appport/transport-inprocess/dist/index.d.ts +0 -16
- package/vendor/@appport/transport-inprocess/dist/index.d.ts.map +0 -1
- package/vendor/@appport/transport-inprocess/dist/index.js +0 -30
- package/vendor/@appport/transport-inprocess/dist/index.js.map +0 -1
- package/vendor/@appport/transport-inprocess/package.json +0 -30
- package/vendor/@appport/transport-tauri/README.md +0 -45
- package/vendor/@appport/transport-tauri/dist/index.d.ts +0 -23
- package/vendor/@appport/transport-tauri/dist/index.d.ts.map +0 -1
- package/vendor/@appport/transport-tauri/dist/index.js +0 -44
- package/vendor/@appport/transport-tauri/dist/index.js.map +0 -1
- package/vendor/@appport/transport-tauri/package.json +0 -29
- package/vendor/@appport/transport-websocket/README.md +0 -22
- package/vendor/@appport/transport-websocket/dist/index.d.ts +0 -26
- package/vendor/@appport/transport-websocket/dist/index.d.ts.map +0 -1
- package/vendor/@appport/transport-websocket/dist/index.js +0 -72
- package/vendor/@appport/transport-websocket/dist/index.js.map +0 -1
- package/vendor/@appport/transport-websocket/package.json +0 -29
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capability Invocation Layer (PR24)
|
|
3
|
-
*
|
|
4
|
-
* The canonical invocation abstraction that turns an authorized relationship
|
|
5
|
-
* into an executable invocation without introducing WASM, persistent runtime
|
|
6
|
-
* processes, or remote transports.
|
|
7
|
-
*
|
|
8
|
-
* CRITICAL INVARIANT: A capability cannot be invoked without an AuthorizedCapabilityBinding.
|
|
9
|
-
*
|
|
10
|
-
* Architecture:
|
|
11
|
-
* Discover (PR21) → Resolve (PR22) → Authorize (PR23) → Bind (PR23) → Invoke (PR24)
|
|
12
|
-
*
|
|
13
|
-
* The invocation layer:
|
|
14
|
-
* - Receives an already-authorized binding
|
|
15
|
-
* - Validates binding/context consistency (no re-authorization)
|
|
16
|
-
* - Resolves the capability implementation (no re-discovery)
|
|
17
|
-
* - Validates input before handler execution
|
|
18
|
-
* - Executes the implementation
|
|
19
|
-
* - Validates output after execution
|
|
20
|
-
* - Returns explicit result (SUCCESS, FAILED, CANCELLED, TIMED_OUT)
|
|
21
|
-
* - Never implicitly falls back to another provider
|
|
22
|
-
* - Never retries or changes topology
|
|
23
|
-
* - Remains execution-engine-neutral for future WASM integration
|
|
24
|
-
*/
|
|
25
|
-
import { assertIssuedAuthorizedBinding } from "./binding.js";
|
|
26
|
-
import { assertBindingAuthoritative } from "./authority-attestation.js";
|
|
27
|
-
import { errors } from "../../protocol/dist/index.js";
|
|
28
|
-
/**
|
|
29
|
-
* Capability Invoker: executes authorized capabilities with semantic enforcement.
|
|
30
|
-
*
|
|
31
|
-
* The invoker:
|
|
32
|
-
* - Requires AuthorizedCapabilityBinding for every invocation
|
|
33
|
-
* - Validates binding/context consistency
|
|
34
|
-
* - Validates input before handler execution
|
|
35
|
-
* - Executes the capability implementation
|
|
36
|
-
* - Validates output after execution
|
|
37
|
-
* - Returns explicit result types
|
|
38
|
-
* - Never re-discovers providers or re-authorizes
|
|
39
|
-
* - Never implicitly falls back to another provider
|
|
40
|
-
* - Remains execution-engine-neutral
|
|
41
|
-
*
|
|
42
|
-
* Flow:
|
|
43
|
-
* 1. Validate binding matches invocation context
|
|
44
|
-
* 2. Validate input against capability schema
|
|
45
|
-
* 3. Resolve capability definition and implementation
|
|
46
|
-
* 4. Execute implementation with context
|
|
47
|
-
* 5. Validate output against capability schema
|
|
48
|
-
* 6. Return explicit result
|
|
49
|
-
*/
|
|
50
|
-
export class CapabilityInvoker {
|
|
51
|
-
/**
|
|
52
|
-
* Invoke a capability through an authorized binding.
|
|
53
|
-
*
|
|
54
|
-
* @param request The invocation request containing binding and input
|
|
55
|
-
* @param capabilityDefinition The capability definition from the registry
|
|
56
|
-
* @param executionContext The execution context (from Application)
|
|
57
|
-
* @returns The invocation result with explicit outcome
|
|
58
|
-
*/
|
|
59
|
-
async invoke(request, capabilityDefinition, executionContext) {
|
|
60
|
-
const invocationId = executionContext.requestId;
|
|
61
|
-
const { binding, input } = request;
|
|
62
|
-
const { consumer, provider, capability } = binding;
|
|
63
|
-
try {
|
|
64
|
-
assertIssuedAuthorizedBinding(binding);
|
|
65
|
-
await assertBindingAuthoritative(binding);
|
|
66
|
-
// STEP 1: Validate binding matches invocation context
|
|
67
|
-
// This enforces the critical invariant: invocation uses exactly the binding provided.
|
|
68
|
-
this.#validateBindingConsistency(binding, executionContext, invocationId);
|
|
69
|
-
// STEP 2: Validate input against capability schema
|
|
70
|
-
// This MUST happen before implementation executes.
|
|
71
|
-
// Invalid input immediately produces a failed result without touching the handler.
|
|
72
|
-
const inputValidation = capabilityDefinition.input.validate(input);
|
|
73
|
-
if (!inputValidation.ok) {
|
|
74
|
-
return {
|
|
75
|
-
kind: "failed",
|
|
76
|
-
invocationId,
|
|
77
|
-
consumer,
|
|
78
|
-
provider,
|
|
79
|
-
capability: { name: capability.name, version: capability.version },
|
|
80
|
-
error: {
|
|
81
|
-
kind: "invalid_input",
|
|
82
|
-
reason: `Input validation failed: ${this.#formatValidationIssues(inputValidation.issues)}`
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
// STEP 3: Check for cancellation BEFORE execution
|
|
87
|
-
if (executionContext.signal?.aborted) {
|
|
88
|
-
return {
|
|
89
|
-
kind: "cancelled",
|
|
90
|
-
invocationId,
|
|
91
|
-
consumer,
|
|
92
|
-
provider,
|
|
93
|
-
capability: { name: capability.name, version: capability.version },
|
|
94
|
-
reason: "Invocation was cancelled before execution"
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
// STEP 4: Execute implementation
|
|
98
|
-
// The implementation is resolved from the capability definition, not re-discovered.
|
|
99
|
-
let output;
|
|
100
|
-
try {
|
|
101
|
-
if (capabilityDefinition.implementation) {
|
|
102
|
-
// Execute the bound implementation
|
|
103
|
-
output = await capabilityDefinition.implementation.execute(inputValidation.value, executionContext);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
// Fall back to the handler (for backward compatibility)
|
|
107
|
-
output = await capabilityDefinition.handler(inputValidation.value, executionContext);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
// Handle implementation failure
|
|
112
|
-
// Do NOT expose internal error details like stack traces, credentials, or error messages.
|
|
113
|
-
// Use a generic error message instead.
|
|
114
|
-
return {
|
|
115
|
-
kind: "failed",
|
|
116
|
-
invocationId,
|
|
117
|
-
consumer,
|
|
118
|
-
provider,
|
|
119
|
-
capability: { name: capability.name, version: capability.version },
|
|
120
|
-
error: {
|
|
121
|
-
kind: "implementation_failure",
|
|
122
|
-
reason: "Implementation execution failed"
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
// STEP 5: Check for cancellation AFTER execution
|
|
127
|
-
if (executionContext.signal?.aborted) {
|
|
128
|
-
return {
|
|
129
|
-
kind: "cancelled",
|
|
130
|
-
invocationId,
|
|
131
|
-
consumer,
|
|
132
|
-
provider,
|
|
133
|
-
capability: { name: capability.name, version: capability.version },
|
|
134
|
-
reason: "Invocation was cancelled after execution"
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
// STEP 6: Validate output against capability schema
|
|
138
|
-
const outputValidation = capabilityDefinition.output.validate(output);
|
|
139
|
-
if (!outputValidation.ok) {
|
|
140
|
-
return {
|
|
141
|
-
kind: "failed",
|
|
142
|
-
invocationId,
|
|
143
|
-
consumer,
|
|
144
|
-
provider,
|
|
145
|
-
capability: { name: capability.name, version: capability.version },
|
|
146
|
-
error: {
|
|
147
|
-
kind: "invalid_output",
|
|
148
|
-
reason: `Output validation failed: ${this.#formatValidationIssues(outputValidation.issues)}`
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
// SUCCESS
|
|
153
|
-
return {
|
|
154
|
-
kind: "success",
|
|
155
|
-
invocationId,
|
|
156
|
-
consumer,
|
|
157
|
-
provider,
|
|
158
|
-
capability: { name: capability.name, version: capability.version },
|
|
159
|
-
output: outputValidation.value
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
catch (error) {
|
|
163
|
-
// Unexpected errors in invocation orchestration itself
|
|
164
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
165
|
-
return {
|
|
166
|
-
kind: "failed",
|
|
167
|
-
invocationId,
|
|
168
|
-
consumer: binding.consumer,
|
|
169
|
-
provider: binding.provider,
|
|
170
|
-
capability: { name: binding.capability.name, version: binding.capability.version },
|
|
171
|
-
error: {
|
|
172
|
-
kind: "implementation_failure",
|
|
173
|
-
reason: `Invocation failed: ${reason}`
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Validate that the binding is consistent with the execution context.
|
|
180
|
-
*
|
|
181
|
-
* This enforces the critical invariant:
|
|
182
|
-
* - binding.consumer MUST match the actual caller
|
|
183
|
-
* - binding.provider MUST match the selected provider
|
|
184
|
-
* - binding.capability MUST match the capability being invoked
|
|
185
|
-
*
|
|
186
|
-
* Throws InvalidBindingError if any consistency check fails.
|
|
187
|
-
* This error is NOT recovered — it represents an architectural violation.
|
|
188
|
-
*/
|
|
189
|
-
#validateBindingConsistency(binding, context, invocationId) {
|
|
190
|
-
// Note: The consumer identity comes from the execution context.
|
|
191
|
-
// This is the caller identity as established by the application/transport layer.
|
|
192
|
-
// We validate that it matches the binding consumer.
|
|
193
|
-
const callerIdentity = context.principal?.id ?? context.session?.principal?.id ?? "unknown";
|
|
194
|
-
// The binding consumer application ID should match the caller identity context.
|
|
195
|
-
// This prevents a binding created for one consumer from being used by another.
|
|
196
|
-
if (binding.consumer.id && context.authorization) {
|
|
197
|
-
// Binding consumer is an ApplicationState, which has the application ID.
|
|
198
|
-
// We verify that this binding was intended for invocation in this context.
|
|
199
|
-
// The authorization context should reflect the binding consumer's permissions.
|
|
200
|
-
// For now, we verify the structure is present and valid.
|
|
201
|
-
// Deep validation depends on the specific authorization context format.
|
|
202
|
-
if (!binding.consumer.id) {
|
|
203
|
-
throw {
|
|
204
|
-
kind: "invalid_binding",
|
|
205
|
-
reason: "Binding consumer application identity is missing"
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
// Verify binding capability matches the executing capability
|
|
210
|
-
// (This is already checked at the binding creation level, but we verify again)
|
|
211
|
-
if (binding.capability.name && binding.capability.version) {
|
|
212
|
-
// The capability definition should be for this capability
|
|
213
|
-
// This check prevents invoking the wrong capability through a binding
|
|
214
|
-
if (typeof binding.capability.name !== "string" || typeof binding.capability.version !== "number") {
|
|
215
|
-
throw {
|
|
216
|
-
kind: "invalid_binding",
|
|
217
|
-
reason: "Binding capability identity is invalid"
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
// Verify binding provider is valid
|
|
222
|
-
if (!binding.provider || !binding.provider.id) {
|
|
223
|
-
throw {
|
|
224
|
-
kind: "invalid_binding",
|
|
225
|
-
reason: "Binding provider identity is missing or invalid"
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
// Verify authorization decision is present and authorized
|
|
229
|
-
if (!binding.authorization || binding.authorization.kind !== "authorized") {
|
|
230
|
-
throw {
|
|
231
|
-
kind: "invalid_binding",
|
|
232
|
-
reason: "Binding authorization is not authorized (should be denied at binding creation, not invocation)"
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Format validation issues for error messages.
|
|
238
|
-
* This helper abstracts the schema validation issue format.
|
|
239
|
-
*/
|
|
240
|
-
#formatValidationIssues(issues) {
|
|
241
|
-
if (!issues || issues.length === 0) {
|
|
242
|
-
return "Unknown validation error";
|
|
243
|
-
}
|
|
244
|
-
if (issues.length === 1) {
|
|
245
|
-
const issue = issues[0];
|
|
246
|
-
if (typeof issue === "object" && issue !== null && "message" in issue) {
|
|
247
|
-
return String(issue.message);
|
|
248
|
-
}
|
|
249
|
-
return String(issue);
|
|
250
|
-
}
|
|
251
|
-
return `${issues.length} validation errors`;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Default capability invoker: a singleton for common use.
|
|
256
|
-
*/
|
|
257
|
-
export const defaultCapabilityInvoker = new CapabilityInvoker();
|
|
258
|
-
//# sourceMappingURL=invocation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invocation.js","sourceRoot":"","sources":["../src/invocation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,6BAA6B,EAAoC,MAAM,cAAc,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAIxE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAyN3C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,iBAAiB;IAC5B;;;;;;;OAOG;IACH,KAAK,CAAC,MAA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AM,EAAE,gGAAgG;aAClF,CAAC;QAC3B,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,uBAAuB,CAAC,MAA0B;QAChD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,0BAA0B,CAAC;QACpC,CAAC;QACD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;gBACtE,OAAO,MAAM,CAAE,KAAiC,CAAC,OAAO,CAAC,CAAC;YAC5D,CAAC;YACD,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;QACD,OAAO,GAAG,MAAM,CAAC,MAAM,oBAAoB,CAAC;IAC9C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Application Manifest (PR19)
|
|
3
|
-
*
|
|
4
|
-
* Canonical application identity and contract description.
|
|
5
|
-
*
|
|
6
|
-
* The manifest represents the externally meaningful boundary of an application:
|
|
7
|
-
* what it provides, what it requires, and the contract metadata.
|
|
8
|
-
*
|
|
9
|
-
* CRITICAL: The manifest contains NO implementation details:
|
|
10
|
-
* - No JavaScript functions
|
|
11
|
-
* - No handlers
|
|
12
|
-
* - No runtime closures
|
|
13
|
-
* - No filesystem paths
|
|
14
|
-
* - No process information
|
|
15
|
-
* - No secrets or credentials
|
|
16
|
-
* - No transport-specific bindings
|
|
17
|
-
*
|
|
18
|
-
* This allows the same application contract to be implemented in any language
|
|
19
|
-
* while maintaining an identical manifest, identity, and fingerprint.
|
|
20
|
-
*/
|
|
21
|
-
import type { ApplicationAssembly, VerificationResult } from "./assembly.js";
|
|
22
|
-
import type { JsonValue } from "../../protocol/dist/index.d.ts";
|
|
23
|
-
/**
|
|
24
|
-
* Application Identity: uniquely identifies an application version.
|
|
25
|
-
*/
|
|
26
|
-
export interface ApplicationIdentity {
|
|
27
|
-
readonly id: string;
|
|
28
|
-
readonly name: string;
|
|
29
|
-
readonly version: string;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Capability manifest entry: semantic contract information for a capability.
|
|
33
|
-
* Contains no implementation details.
|
|
34
|
-
*/
|
|
35
|
-
export interface CapabilityManifestEntry {
|
|
36
|
-
readonly name: string;
|
|
37
|
-
readonly version: number;
|
|
38
|
-
readonly kind: "request" | "stream";
|
|
39
|
-
readonly description?: string;
|
|
40
|
-
readonly inputSchema: JsonValue;
|
|
41
|
-
readonly outputSchema: JsonValue;
|
|
42
|
-
readonly authorization: readonly string[];
|
|
43
|
-
readonly idempotency?: "supported" | "unsupported";
|
|
44
|
-
readonly concurrency?: {
|
|
45
|
-
readonly mode: "parallel" | "serialized" | "keyed";
|
|
46
|
-
readonly key?: string;
|
|
47
|
-
};
|
|
48
|
-
readonly timeoutMs?: number;
|
|
49
|
-
readonly emits: readonly string[];
|
|
50
|
-
readonly deprecated: boolean;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Requirement manifest entry: semantic contract information for a required capability.
|
|
54
|
-
* Contains no implementation details.
|
|
55
|
-
*
|
|
56
|
-
* Supports version constraints (e.g., "^1", "~1.2", ">=2") for deterministic
|
|
57
|
-
* capability resolution (PR22).
|
|
58
|
-
*/
|
|
59
|
-
export interface RequirementManifestEntry {
|
|
60
|
-
readonly name: string;
|
|
61
|
-
readonly version: number;
|
|
62
|
-
readonly versionConstraint?: string;
|
|
63
|
-
readonly provider?: {
|
|
64
|
-
readonly applicationId?: string;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Canonical application manifest.
|
|
69
|
-
*
|
|
70
|
-
* This describes what an application provides and requires,
|
|
71
|
-
* independent of implementation.
|
|
72
|
-
*
|
|
73
|
-
* The manifest is:
|
|
74
|
-
* - Implementation-agnostic (no code/handlers/functions)
|
|
75
|
-
* - Serializable to deterministic JSON
|
|
76
|
-
* - Hashable for fingerprinting
|
|
77
|
-
* - Suitable for discovery and registration
|
|
78
|
-
*/
|
|
79
|
-
export interface ApplicationManifest {
|
|
80
|
-
readonly protocol: "AppPort/1";
|
|
81
|
-
readonly application: ApplicationIdentity;
|
|
82
|
-
readonly metadata?: Readonly<Record<string, JsonValue>>;
|
|
83
|
-
readonly provides: readonly CapabilityManifestEntry[];
|
|
84
|
-
readonly requires: readonly RequirementManifestEntry[];
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Canonical manifest serialization.
|
|
88
|
-
*
|
|
89
|
-
* Deterministic JSON representation with:
|
|
90
|
-
* - Alphabetical property ordering
|
|
91
|
-
* - Sorted capability lists
|
|
92
|
-
* - Sorted requirement lists
|
|
93
|
-
* - Consistent formatting
|
|
94
|
-
*
|
|
95
|
-
* Equivalent manifests produce identical serializations.
|
|
96
|
-
*/
|
|
97
|
-
export declare function serializeManifest(manifest: ApplicationManifest): string;
|
|
98
|
-
/**
|
|
99
|
-
* Calculate deterministic fingerprint of a manifest.
|
|
100
|
-
*
|
|
101
|
-
* The fingerprint is a SHA256 hash of the canonical serialization.
|
|
102
|
-
* Identical application contracts produce identical fingerprints
|
|
103
|
-
* regardless of:
|
|
104
|
-
* - Implementation language
|
|
105
|
-
* - Declaration order
|
|
106
|
-
* - Implementation details
|
|
107
|
-
* - Runtime state
|
|
108
|
-
*
|
|
109
|
-
* The fingerprint CHANGES when:
|
|
110
|
-
* - Capability version changes
|
|
111
|
-
* - Authorization requirements change
|
|
112
|
-
* - Input/output schema changes
|
|
113
|
-
* - Concurrency policy changes
|
|
114
|
-
* - Timeouts change
|
|
115
|
-
* - Required capabilities change
|
|
116
|
-
* - Any contract metadata changes
|
|
117
|
-
*
|
|
118
|
-
* The fingerprint DOES NOT CHANGE when:
|
|
119
|
-
* - Implementation functions change
|
|
120
|
-
* - Handler logic changes
|
|
121
|
-
* - Declaration order changes
|
|
122
|
-
* - Only runtime state changes
|
|
123
|
-
*/
|
|
124
|
-
export declare function fingerprintManifest(manifest: ApplicationManifest): string;
|
|
125
|
-
/**
|
|
126
|
-
* Generate a canonical ApplicationManifest from a verified ApplicationAssembly.
|
|
127
|
-
*
|
|
128
|
-
* IMPORTANT: The assembly must be verified and ready before generating the manifest.
|
|
129
|
-
* A manifest should represent a coherent, ready-to-run application.
|
|
130
|
-
*
|
|
131
|
-
* If you need to generate a manifest from an invalid assembly for debugging,
|
|
132
|
-
* use generateManifestUnchecked() instead.
|
|
133
|
-
*/
|
|
134
|
-
export declare function generateManifest(assembly: ApplicationAssembly, verification: VerificationResult): ApplicationManifest;
|
|
135
|
-
/**
|
|
136
|
-
* Generate an ApplicationManifest from an ApplicationAssembly without verification.
|
|
137
|
-
*
|
|
138
|
-
* WARNING: This generates a manifest even if the assembly is invalid.
|
|
139
|
-
* Only use this for debugging or testing invalid applications.
|
|
140
|
-
*
|
|
141
|
-
* For production code, use generateManifest() which requires verification.
|
|
142
|
-
*/
|
|
143
|
-
export declare function generateManifestUnchecked(assembly: ApplicationAssembly): ApplicationManifest;
|
|
144
|
-
/**
|
|
145
|
-
* Convert a manifest to a JSON-compatible object suitable for serialization.
|
|
146
|
-
*
|
|
147
|
-
* This is equivalent to JSON.parse(serializeManifest(manifest)).
|
|
148
|
-
*/
|
|
149
|
-
export declare function manifestToJson(manifest: ApplicationManifest): any;
|
|
150
|
-
/**
|
|
151
|
-
* Verify that two manifests are semantically equivalent.
|
|
152
|
-
*
|
|
153
|
-
* Returns true if they describe the same application contract,
|
|
154
|
-
* regardless of declaration order or other non-semantic differences.
|
|
155
|
-
*/
|
|
156
|
-
export declare function manifestsAreEqual(a: ApplicationManifest, b: ApplicationManifest): boolean;
|
|
157
|
-
//# sourceMappingURL=manifest.d.ts.map
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1,255 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Application Manifest (PR19)
|
|
3
|
-
*
|
|
4
|
-
* Canonical application identity and contract description.
|
|
5
|
-
*
|
|
6
|
-
* The manifest represents the externally meaningful boundary of an application:
|
|
7
|
-
* what it provides, what it requires, and the contract metadata.
|
|
8
|
-
*
|
|
9
|
-
* CRITICAL: The manifest contains NO implementation details:
|
|
10
|
-
* - No JavaScript functions
|
|
11
|
-
* - No handlers
|
|
12
|
-
* - No runtime closures
|
|
13
|
-
* - No filesystem paths
|
|
14
|
-
* - No process information
|
|
15
|
-
* - No secrets or credentials
|
|
16
|
-
* - No transport-specific bindings
|
|
17
|
-
*
|
|
18
|
-
* This allows the same application contract to be implemented in any language
|
|
19
|
-
* while maintaining an identical manifest, identity, and fingerprint.
|
|
20
|
-
*/
|
|
21
|
-
import { sha256 } from "./sha256.js";
|
|
22
|
-
/**
|
|
23
|
-
* Canonical manifest serialization.
|
|
24
|
-
*
|
|
25
|
-
* Deterministic JSON representation with:
|
|
26
|
-
* - Alphabetical property ordering
|
|
27
|
-
* - Sorted capability lists
|
|
28
|
-
* - Sorted requirement lists
|
|
29
|
-
* - Consistent formatting
|
|
30
|
-
*
|
|
31
|
-
* Equivalent manifests produce identical serializations.
|
|
32
|
-
*/
|
|
33
|
-
export function serializeManifest(manifest) {
|
|
34
|
-
const canonical = canonicalizeManifest(manifest);
|
|
35
|
-
return JSON.stringify(canonical);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Convert manifest to canonical form for serialization.
|
|
39
|
-
* Ensures deterministic property and array ordering.
|
|
40
|
-
*/
|
|
41
|
-
function canonicalizeManifest(manifest) {
|
|
42
|
-
return {
|
|
43
|
-
protocol: manifest.protocol,
|
|
44
|
-
application: {
|
|
45
|
-
id: manifest.application.id,
|
|
46
|
-
name: manifest.application.name,
|
|
47
|
-
version: manifest.application.version
|
|
48
|
-
},
|
|
49
|
-
...(manifest.metadata !== undefined ? { metadata: canonicalizeJson(manifest.metadata) } : {}),
|
|
50
|
-
provides: manifest.provides
|
|
51
|
-
.slice() // Copy to avoid mutation
|
|
52
|
-
.sort((a, b) => {
|
|
53
|
-
const nameComp = a.name.localeCompare(b.name);
|
|
54
|
-
return nameComp !== 0 ? nameComp : a.version - b.version;
|
|
55
|
-
})
|
|
56
|
-
.map(canonicalizeCapabilityManifest),
|
|
57
|
-
requires: manifest.requires
|
|
58
|
-
.slice() // Copy to avoid mutation
|
|
59
|
-
.sort((a, b) => {
|
|
60
|
-
const nameComp = a.name.localeCompare(b.name);
|
|
61
|
-
return nameComp !== 0 ? nameComp : a.version - b.version;
|
|
62
|
-
})
|
|
63
|
-
.map((r) => ({
|
|
64
|
-
name: r.name,
|
|
65
|
-
version: r.version,
|
|
66
|
-
...(r.versionConstraint !== undefined ? { versionConstraint: r.versionConstraint } : {}),
|
|
67
|
-
...(r.provider !== undefined ? { provider: r.provider } : {})
|
|
68
|
-
}))
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function canonicalizeJson(value) {
|
|
72
|
-
if (Array.isArray(value))
|
|
73
|
-
return value.map(canonicalizeJson);
|
|
74
|
-
if (value !== null && typeof value === "object") {
|
|
75
|
-
return Object.fromEntries(Object.keys(value).sort().map(key => [key, canonicalizeJson(value[key])]));
|
|
76
|
-
}
|
|
77
|
-
return value;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Canonicalize a capability manifest entry.
|
|
81
|
-
*/
|
|
82
|
-
function canonicalizeCapabilityManifest(cap) {
|
|
83
|
-
const result = {
|
|
84
|
-
name: cap.name,
|
|
85
|
-
version: cap.version,
|
|
86
|
-
kind: cap.kind,
|
|
87
|
-
inputSchema: canonicalizeJson(cap.inputSchema),
|
|
88
|
-
outputSchema: canonicalizeJson(cap.outputSchema),
|
|
89
|
-
authorization: Array.from(cap.authorization).sort()
|
|
90
|
-
};
|
|
91
|
-
if (cap.description !== undefined) {
|
|
92
|
-
result.description = cap.description;
|
|
93
|
-
}
|
|
94
|
-
if (cap.idempotency !== undefined) {
|
|
95
|
-
result.idempotency = cap.idempotency;
|
|
96
|
-
}
|
|
97
|
-
if (cap.concurrency !== undefined) {
|
|
98
|
-
result.concurrency = {
|
|
99
|
-
mode: cap.concurrency.mode,
|
|
100
|
-
...(cap.concurrency.key !== undefined ? { key: cap.concurrency.key } : {})
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
if (cap.timeoutMs !== undefined) {
|
|
104
|
-
result.timeoutMs = cap.timeoutMs;
|
|
105
|
-
}
|
|
106
|
-
result.emits = Array.from(cap.emits).sort();
|
|
107
|
-
result.deprecated = cap.deprecated;
|
|
108
|
-
return result;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Calculate deterministic fingerprint of a manifest.
|
|
112
|
-
*
|
|
113
|
-
* The fingerprint is a SHA256 hash of the canonical serialization.
|
|
114
|
-
* Identical application contracts produce identical fingerprints
|
|
115
|
-
* regardless of:
|
|
116
|
-
* - Implementation language
|
|
117
|
-
* - Declaration order
|
|
118
|
-
* - Implementation details
|
|
119
|
-
* - Runtime state
|
|
120
|
-
*
|
|
121
|
-
* The fingerprint CHANGES when:
|
|
122
|
-
* - Capability version changes
|
|
123
|
-
* - Authorization requirements change
|
|
124
|
-
* - Input/output schema changes
|
|
125
|
-
* - Concurrency policy changes
|
|
126
|
-
* - Timeouts change
|
|
127
|
-
* - Required capabilities change
|
|
128
|
-
* - Any contract metadata changes
|
|
129
|
-
*
|
|
130
|
-
* The fingerprint DOES NOT CHANGE when:
|
|
131
|
-
* - Implementation functions change
|
|
132
|
-
* - Handler logic changes
|
|
133
|
-
* - Declaration order changes
|
|
134
|
-
* - Only runtime state changes
|
|
135
|
-
*/
|
|
136
|
-
export function fingerprintManifest(manifest) {
|
|
137
|
-
const canonical = serializeManifest(manifest);
|
|
138
|
-
return sha256(canonical);
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Convert a CapabilityDefinition to a CapabilityManifestEntry.
|
|
142
|
-
*
|
|
143
|
-
* Extracts contract information while excluding implementation details:
|
|
144
|
-
* - Excludes handler function
|
|
145
|
-
* - Excludes implementation binding
|
|
146
|
-
* - Preserves all contract metadata
|
|
147
|
-
*/
|
|
148
|
-
function capabilityToManifestEntry(capability) {
|
|
149
|
-
return {
|
|
150
|
-
name: capability.name,
|
|
151
|
-
version: capability.version,
|
|
152
|
-
kind: capability.kind,
|
|
153
|
-
...(capability.description ? { description: capability.description } : {}),
|
|
154
|
-
inputSchema: schemaToJsonValue(capability.input),
|
|
155
|
-
outputSchema: schemaToJsonValue(capability.output),
|
|
156
|
-
authorization: capability.authorization,
|
|
157
|
-
...(capability.idempotency ? { idempotency: capability.idempotency } : {}),
|
|
158
|
-
...(capability.concurrency ? { concurrency: capability.concurrency } : {}),
|
|
159
|
-
...(capability.timeoutMs ? { timeoutMs: capability.timeoutMs } : {}),
|
|
160
|
-
emits: capability.emits,
|
|
161
|
-
deprecated: capability.deprecated
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Convert a Schema to a JSON-serializable value.
|
|
166
|
-
* This is needed because Schema objects are not directly JSON-serializable.
|
|
167
|
-
*/
|
|
168
|
-
function schemaToJsonValue(schema) {
|
|
169
|
-
// Schemas have a toJSONSchema() method for serialization
|
|
170
|
-
if (typeof schema === "object" && schema !== null && "toJSONSchema" in schema) {
|
|
171
|
-
return schema.toJSONSchema();
|
|
172
|
-
}
|
|
173
|
-
// Fallback: convert to JSON string and parse (for direct JSON schemas)
|
|
174
|
-
if (typeof schema === "object" && schema !== null) {
|
|
175
|
-
return schema;
|
|
176
|
-
}
|
|
177
|
-
return schema;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Generate a canonical ApplicationManifest from a verified ApplicationAssembly.
|
|
181
|
-
*
|
|
182
|
-
* IMPORTANT: The assembly must be verified and ready before generating the manifest.
|
|
183
|
-
* A manifest should represent a coherent, ready-to-run application.
|
|
184
|
-
*
|
|
185
|
-
* If you need to generate a manifest from an invalid assembly for debugging,
|
|
186
|
-
* use generateManifestUnchecked() instead.
|
|
187
|
-
*/
|
|
188
|
-
export function generateManifest(assembly, verification) {
|
|
189
|
-
if (!verification.ready) {
|
|
190
|
-
throw new Error("Cannot generate manifest: application is not verified and ready. Call assembly.verify() first.");
|
|
191
|
-
}
|
|
192
|
-
return generateManifestUnchecked(assembly);
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Generate an ApplicationManifest from an ApplicationAssembly without verification.
|
|
196
|
-
*
|
|
197
|
-
* WARNING: This generates a manifest even if the assembly is invalid.
|
|
198
|
-
* Only use this for debugging or testing invalid applications.
|
|
199
|
-
*
|
|
200
|
-
* For production code, use generateManifest() which requires verification.
|
|
201
|
-
*/
|
|
202
|
-
export function generateManifestUnchecked(assembly) {
|
|
203
|
-
const provides = [];
|
|
204
|
-
for (const capability of assembly.provides) {
|
|
205
|
-
provides.push(capabilityToManifestEntry(capability));
|
|
206
|
-
}
|
|
207
|
-
// Sort provides by name then version for determinism
|
|
208
|
-
provides.sort((a, b) => {
|
|
209
|
-
const nameComp = a.name.localeCompare(b.name);
|
|
210
|
-
return nameComp !== 0 ? nameComp : a.version - b.version;
|
|
211
|
-
});
|
|
212
|
-
const requires = [];
|
|
213
|
-
for (const required of assembly.requires) {
|
|
214
|
-
requires.push({
|
|
215
|
-
name: required.name,
|
|
216
|
-
version: required.version,
|
|
217
|
-
...(required.versionConstraint ? { versionConstraint: required.versionConstraint } : {}),
|
|
218
|
-
...(required.provider ? { provider: required.provider } : {})
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
// Sort requires by name then version for determinism
|
|
222
|
-
requires.sort((a, b) => {
|
|
223
|
-
const nameComp = a.name.localeCompare(b.name);
|
|
224
|
-
return nameComp !== 0 ? nameComp : a.version - b.version;
|
|
225
|
-
});
|
|
226
|
-
return {
|
|
227
|
-
protocol: "AppPort/1",
|
|
228
|
-
application: {
|
|
229
|
-
id: assembly.identity.id,
|
|
230
|
-
name: assembly.identity.name,
|
|
231
|
-
version: assembly.identity.version
|
|
232
|
-
},
|
|
233
|
-
...(assembly.metadata ? { metadata: assembly.metadata } : {}),
|
|
234
|
-
provides,
|
|
235
|
-
requires
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Convert a manifest to a JSON-compatible object suitable for serialization.
|
|
240
|
-
*
|
|
241
|
-
* This is equivalent to JSON.parse(serializeManifest(manifest)).
|
|
242
|
-
*/
|
|
243
|
-
export function manifestToJson(manifest) {
|
|
244
|
-
return JSON.parse(serializeManifest(manifest));
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Verify that two manifests are semantically equivalent.
|
|
248
|
-
*
|
|
249
|
-
* Returns true if they describe the same application contract,
|
|
250
|
-
* regardless of declaration order or other non-semantic differences.
|
|
251
|
-
*/
|
|
252
|
-
export function manifestsAreEqual(a, b) {
|
|
253
|
-
return fingerprintManifest(a) === fingerprintManifest(b);
|
|
254
|
-
}
|
|
255
|
-
//# sourceMappingURL=manifest.js.map
|