@appport/sdk 1.0.1
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 +39 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/node.d.ts +3 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +3 -0
- package/dist/node.js.map +1 -0
- package/node_modules/@appport/authorization/README.md +28 -0
- package/node_modules/@appport/authorization/dist/index.d.ts +94 -0
- package/node_modules/@appport/authorization/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/authorization/dist/index.js +131 -0
- package/node_modules/@appport/authorization/dist/index.js.map +1 -0
- package/node_modules/@appport/authorization/package.json +28 -0
- package/node_modules/@appport/client/README.md +35 -0
- package/node_modules/@appport/client/dist/channel.d.ts +14 -0
- package/node_modules/@appport/client/dist/channel.d.ts.map +1 -0
- package/node_modules/@appport/client/dist/channel.js +58 -0
- package/node_modules/@appport/client/dist/channel.js.map +1 -0
- package/node_modules/@appport/client/dist/client.d.ts +61 -0
- package/node_modules/@appport/client/dist/client.d.ts.map +1 -0
- package/node_modules/@appport/client/dist/client.js +214 -0
- package/node_modules/@appport/client/dist/client.js.map +1 -0
- package/node_modules/@appport/client/dist/contract.d.ts +55 -0
- package/node_modules/@appport/client/dist/contract.d.ts.map +1 -0
- package/node_modules/@appport/client/dist/contract.js +12 -0
- package/node_modules/@appport/client/dist/contract.js.map +1 -0
- package/node_modules/@appport/client/dist/discovery.d.ts +17 -0
- package/node_modules/@appport/client/dist/discovery.d.ts.map +1 -0
- package/node_modules/@appport/client/dist/discovery.js +56 -0
- package/node_modules/@appport/client/dist/discovery.js.map +1 -0
- package/node_modules/@appport/client/dist/duplex.d.ts +25 -0
- package/node_modules/@appport/client/dist/duplex.d.ts.map +1 -0
- package/node_modules/@appport/client/dist/duplex.js +194 -0
- package/node_modules/@appport/client/dist/duplex.js.map +1 -0
- package/node_modules/@appport/client/dist/index.d.ts +13 -0
- package/node_modules/@appport/client/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/client/dist/index.js +13 -0
- package/node_modules/@appport/client/dist/index.js.map +1 -0
- package/node_modules/@appport/client/dist/transport.d.ts +42 -0
- package/node_modules/@appport/client/dist/transport.d.ts.map +1 -0
- package/node_modules/@appport/client/dist/transport.js +2 -0
- package/node_modules/@appport/client/dist/transport.js.map +1 -0
- package/node_modules/@appport/client/package.json +32 -0
- package/node_modules/@appport/core/README.md +91 -0
- package/node_modules/@appport/core/dist/appboundry-contract.d.ts +80 -0
- package/node_modules/@appport/core/dist/appboundry-contract.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/appboundry-contract.js +160 -0
- package/node_modules/@appport/core/dist/appboundry-contract.js.map +1 -0
- package/node_modules/@appport/core/dist/application-implementation.d.ts +125 -0
- package/node_modules/@appport/core/dist/application-implementation.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/application-implementation.js +220 -0
- package/node_modules/@appport/core/dist/application-implementation.js.map +1 -0
- package/node_modules/@appport/core/dist/application-lifecycle.d.ts +150 -0
- package/node_modules/@appport/core/dist/application-lifecycle.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/application-lifecycle.js +70 -0
- package/node_modules/@appport/core/dist/application-lifecycle.js.map +1 -0
- package/node_modules/@appport/core/dist/application-source.d.ts +109 -0
- package/node_modules/@appport/core/dist/application-source.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/application-source.js +186 -0
- package/node_modules/@appport/core/dist/application-source.js.map +1 -0
- package/node_modules/@appport/core/dist/application.d.ts +122 -0
- package/node_modules/@appport/core/dist/application.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/application.js +515 -0
- package/node_modules/@appport/core/dist/application.js.map +1 -0
- package/node_modules/@appport/core/dist/artifact.d.ts +395 -0
- package/node_modules/@appport/core/dist/artifact.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/artifact.js +392 -0
- package/node_modules/@appport/core/dist/artifact.js.map +1 -0
- package/node_modules/@appport/core/dist/assembly.d.ts +237 -0
- package/node_modules/@appport/core/dist/assembly.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/assembly.js +458 -0
- package/node_modules/@appport/core/dist/assembly.js.map +1 -0
- package/node_modules/@appport/core/dist/authority-attestation.d.ts +34 -0
- package/node_modules/@appport/core/dist/authority-attestation.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/authority-attestation.js +72 -0
- package/node_modules/@appport/core/dist/authority-attestation.js.map +1 -0
- package/node_modules/@appport/core/dist/authorization-grant.d.ts +107 -0
- package/node_modules/@appport/core/dist/authorization-grant.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/authorization-grant.js +131 -0
- package/node_modules/@appport/core/dist/authorization-grant.js.map +1 -0
- package/node_modules/@appport/core/dist/binding.d.ts +294 -0
- package/node_modules/@appport/core/dist/binding.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/binding.js +263 -0
- package/node_modules/@appport/core/dist/binding.js.map +1 -0
- package/node_modules/@appport/core/dist/builtins.d.ts +18 -0
- package/node_modules/@appport/core/dist/builtins.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/builtins.js +38 -0
- package/node_modules/@appport/core/dist/builtins.js.map +1 -0
- package/node_modules/@appport/core/dist/capability.d.ts +94 -0
- package/node_modules/@appport/core/dist/capability.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/capability.js +85 -0
- package/node_modules/@appport/core/dist/capability.js.map +1 -0
- package/node_modules/@appport/core/dist/concurrency.d.ts +16 -0
- package/node_modules/@appport/core/dist/concurrency.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/concurrency.js +46 -0
- package/node_modules/@appport/core/dist/concurrency.js.map +1 -0
- package/node_modules/@appport/core/dist/context.d.ts +59 -0
- package/node_modules/@appport/core/dist/context.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/context.js +14 -0
- package/node_modules/@appport/core/dist/context.js.map +1 -0
- package/node_modules/@appport/core/dist/contract-artifact.d.ts +15 -0
- package/node_modules/@appport/core/dist/contract-artifact.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/contract-artifact.js +152 -0
- package/node_modules/@appport/core/dist/contract-artifact.js.map +1 -0
- package/node_modules/@appport/core/dist/contract-attestation.d.ts +68 -0
- package/node_modules/@appport/core/dist/contract-attestation.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/contract-attestation.js +76 -0
- package/node_modules/@appport/core/dist/contract-attestation.js.map +1 -0
- package/node_modules/@appport/core/dist/crash-injection.d.ts +3 -0
- package/node_modules/@appport/core/dist/crash-injection.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/crash-injection.js +8 -0
- package/node_modules/@appport/core/dist/crash-injection.js.map +1 -0
- package/node_modules/@appport/core/dist/events.d.ts +33 -0
- package/node_modules/@appport/core/dist/events.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/events.js +79 -0
- package/node_modules/@appport/core/dist/events.js.map +1 -0
- package/node_modules/@appport/core/dist/execution-barrier.d.ts +13 -0
- package/node_modules/@appport/core/dist/execution-barrier.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/execution-barrier.js +33 -0
- package/node_modules/@appport/core/dist/execution-barrier.js.map +1 -0
- package/node_modules/@appport/core/dist/execution-ledger.d.ts +81 -0
- package/node_modules/@appport/core/dist/execution-ledger.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/execution-ledger.js +173 -0
- package/node_modules/@appport/core/dist/execution-ledger.js.map +1 -0
- package/node_modules/@appport/core/dist/execution.d.ts +387 -0
- package/node_modules/@appport/core/dist/execution.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/execution.js +165 -0
- package/node_modules/@appport/core/dist/execution.js.map +1 -0
- package/node_modules/@appport/core/dist/idempotency.d.ts +36 -0
- package/node_modules/@appport/core/dist/idempotency.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/idempotency.js +36 -0
- package/node_modules/@appport/core/dist/idempotency.js.map +1 -0
- package/node_modules/@appport/core/dist/implementation.d.ts +110 -0
- package/node_modules/@appport/core/dist/implementation.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/implementation.js +65 -0
- package/node_modules/@appport/core/dist/implementation.js.map +1 -0
- package/node_modules/@appport/core/dist/index.d.ts +44 -0
- package/node_modules/@appport/core/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/index.js +44 -0
- package/node_modules/@appport/core/dist/index.js.map +1 -0
- package/node_modules/@appport/core/dist/invocation.d.ts +253 -0
- package/node_modules/@appport/core/dist/invocation.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/invocation.js +258 -0
- package/node_modules/@appport/core/dist/invocation.js.map +1 -0
- package/node_modules/@appport/core/dist/manifest.d.ts +157 -0
- package/node_modules/@appport/core/dist/manifest.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/manifest.js +255 -0
- package/node_modules/@appport/core/dist/manifest.js.map +1 -0
- package/node_modules/@appport/core/dist/memory-application-data-store.d.ts +19 -0
- package/node_modules/@appport/core/dist/memory-application-data-store.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/memory-application-data-store.js +161 -0
- package/node_modules/@appport/core/dist/memory-application-data-store.js.map +1 -0
- package/node_modules/@appport/core/dist/operations.d.ts +61 -0
- package/node_modules/@appport/core/dist/operations.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/operations.js +210 -0
- package/node_modules/@appport/core/dist/operations.js.map +1 -0
- package/node_modules/@appport/core/dist/public.d.ts +19 -0
- package/node_modules/@appport/core/dist/public.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/public.js +18 -0
- package/node_modules/@appport/core/dist/public.js.map +1 -0
- package/node_modules/@appport/core/dist/registration.d.ts +165 -0
- package/node_modules/@appport/core/dist/registration.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/registration.js +253 -0
- package/node_modules/@appport/core/dist/registration.js.map +1 -0
- package/node_modules/@appport/core/dist/registry.d.ts +29 -0
- package/node_modules/@appport/core/dist/registry.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/registry.js +148 -0
- package/node_modules/@appport/core/dist/registry.js.map +1 -0
- package/node_modules/@appport/core/dist/repository-connection.d.ts +100 -0
- package/node_modules/@appport/core/dist/repository-connection.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/repository-connection.js +57 -0
- package/node_modules/@appport/core/dist/repository-connection.js.map +1 -0
- package/node_modules/@appport/core/dist/resolver.d.ts +130 -0
- package/node_modules/@appport/core/dist/resolver.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/resolver.js +252 -0
- package/node_modules/@appport/core/dist/resolver.js.map +1 -0
- package/node_modules/@appport/core/dist/runtime-manifest.d.ts +68 -0
- package/node_modules/@appport/core/dist/runtime-manifest.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/runtime-manifest.js +84 -0
- package/node_modules/@appport/core/dist/runtime-manifest.js.map +1 -0
- package/node_modules/@appport/core/dist/sanitize.d.ts +14 -0
- package/node_modules/@appport/core/dist/sanitize.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/sanitize.js +49 -0
- package/node_modules/@appport/core/dist/sanitize.js.map +1 -0
- package/node_modules/@appport/core/dist/server-internal.d.ts +5 -0
- package/node_modules/@appport/core/dist/server-internal.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/server-internal.js +4 -0
- package/node_modules/@appport/core/dist/server-internal.js.map +1 -0
- package/node_modules/@appport/core/dist/sessions.d.ts +29 -0
- package/node_modules/@appport/core/dist/sessions.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/sessions.js +39 -0
- package/node_modules/@appport/core/dist/sessions.js.map +1 -0
- package/node_modules/@appport/core/dist/sha256.d.ts +3 -0
- package/node_modules/@appport/core/dist/sha256.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/sha256.js +46 -0
- package/node_modules/@appport/core/dist/sha256.js.map +1 -0
- package/node_modules/@appport/core/dist/source-verification.d.ts +53 -0
- package/node_modules/@appport/core/dist/source-verification.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/source-verification.js +92 -0
- package/node_modules/@appport/core/dist/source-verification.js.map +1 -0
- package/node_modules/@appport/core/dist/state-context.d.ts +312 -0
- package/node_modules/@appport/core/dist/state-context.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/state-context.js +100 -0
- package/node_modules/@appport/core/dist/state-context.js.map +1 -0
- package/node_modules/@appport/core/dist/state.d.ts +96 -0
- package/node_modules/@appport/core/dist/state.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/state.js +89 -0
- package/node_modules/@appport/core/dist/state.js.map +1 -0
- package/node_modules/@appport/core/dist/streams.d.ts +38 -0
- package/node_modules/@appport/core/dist/streams.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/streams.js +123 -0
- package/node_modules/@appport/core/dist/streams.js.map +1 -0
- package/node_modules/@appport/core/dist/telemetry.d.ts +42 -0
- package/node_modules/@appport/core/dist/telemetry.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/telemetry.js +32 -0
- package/node_modules/@appport/core/dist/telemetry.js.map +1 -0
- package/node_modules/@appport/core/dist/wasm-engine.d.ts +22 -0
- package/node_modules/@appport/core/dist/wasm-engine.d.ts.map +1 -0
- package/node_modules/@appport/core/dist/wasm-engine.js +367 -0
- package/node_modules/@appport/core/dist/wasm-engine.js.map +1 -0
- package/node_modules/@appport/core/package.json +58 -0
- package/node_modules/@appport/mobile/README.md +10 -0
- package/node_modules/@appport/mobile/dist/index.d.ts +66 -0
- package/node_modules/@appport/mobile/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/mobile/dist/index.js +182 -0
- package/node_modules/@appport/mobile/dist/index.js.map +1 -0
- package/node_modules/@appport/mobile/package.json +33 -0
- package/node_modules/@appport/protocol/README.md +41 -0
- package/node_modules/@appport/protocol/dist/blob.d.ts +46 -0
- package/node_modules/@appport/protocol/dist/blob.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/blob.js +23 -0
- package/node_modules/@appport/protocol/dist/blob.js.map +1 -0
- package/node_modules/@appport/protocol/dist/compatibility.d.ts +25 -0
- package/node_modules/@appport/protocol/dist/compatibility.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/compatibility.js +189 -0
- package/node_modules/@appport/protocol/dist/compatibility.js.map +1 -0
- package/node_modules/@appport/protocol/dist/envelopes.d.ts +175 -0
- package/node_modules/@appport/protocol/dist/envelopes.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/envelopes.js +97 -0
- package/node_modules/@appport/protocol/dist/envelopes.js.map +1 -0
- package/node_modules/@appport/protocol/dist/errors.d.ts +74 -0
- package/node_modules/@appport/protocol/dist/errors.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/errors.js +91 -0
- package/node_modules/@appport/protocol/dist/errors.js.map +1 -0
- package/node_modules/@appport/protocol/dist/ids.d.ts +12 -0
- package/node_modules/@appport/protocol/dist/ids.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/ids.js +50 -0
- package/node_modules/@appport/protocol/dist/ids.js.map +1 -0
- package/node_modules/@appport/protocol/dist/index.d.ts +20 -0
- package/node_modules/@appport/protocol/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/index.js +20 -0
- package/node_modules/@appport/protocol/dist/index.js.map +1 -0
- package/node_modules/@appport/protocol/dist/jsonschema.d.ts +50 -0
- package/node_modules/@appport/protocol/dist/jsonschema.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/jsonschema.js +6 -0
- package/node_modules/@appport/protocol/dist/jsonschema.js.map +1 -0
- package/node_modules/@appport/protocol/dist/manifest.d.ts +131 -0
- package/node_modules/@appport/protocol/dist/manifest.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/manifest.js +20 -0
- package/node_modules/@appport/protocol/dist/manifest.js.map +1 -0
- package/node_modules/@appport/protocol/dist/names.d.ts +26 -0
- package/node_modules/@appport/protocol/dist/names.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/names.js +85 -0
- package/node_modules/@appport/protocol/dist/names.js.map +1 -0
- package/node_modules/@appport/protocol/dist/operations.d.ts +34 -0
- package/node_modules/@appport/protocol/dist/operations.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/operations.js +9 -0
- package/node_modules/@appport/protocol/dist/operations.js.map +1 -0
- package/node_modules/@appport/protocol/dist/session.d.ts +27 -0
- package/node_modules/@appport/protocol/dist/session.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/session.js +7 -0
- package/node_modules/@appport/protocol/dist/session.js.map +1 -0
- package/node_modules/@appport/protocol/dist/validate.d.ts +37 -0
- package/node_modules/@appport/protocol/dist/validate.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/validate.js +321 -0
- package/node_modules/@appport/protocol/dist/validate.js.map +1 -0
- package/node_modules/@appport/protocol/dist/version.d.ts +27 -0
- package/node_modules/@appport/protocol/dist/version.d.ts.map +1 -0
- package/node_modules/@appport/protocol/dist/version.js +26 -0
- package/node_modules/@appport/protocol/dist/version.js.map +1 -0
- package/node_modules/@appport/protocol/package.json +25 -0
- package/node_modules/@appport/schema/README.md +32 -0
- package/node_modules/@appport/schema/dist/builder.d.ts +85 -0
- package/node_modules/@appport/schema/dist/builder.d.ts.map +1 -0
- package/node_modules/@appport/schema/dist/builder.js +278 -0
- package/node_modules/@appport/schema/dist/builder.js.map +1 -0
- package/node_modules/@appport/schema/dist/from-json-schema.d.ts +12 -0
- package/node_modules/@appport/schema/dist/from-json-schema.d.ts.map +1 -0
- package/node_modules/@appport/schema/dist/from-json-schema.js +186 -0
- package/node_modules/@appport/schema/dist/from-json-schema.js.map +1 -0
- package/node_modules/@appport/schema/dist/index.d.ts +23 -0
- package/node_modules/@appport/schema/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/schema/dist/index.js +22 -0
- package/node_modules/@appport/schema/dist/index.js.map +1 -0
- package/node_modules/@appport/schema/dist/standard.d.ts +46 -0
- package/node_modules/@appport/schema/dist/standard.d.ts.map +1 -0
- package/node_modules/@appport/schema/dist/standard.js +42 -0
- package/node_modules/@appport/schema/dist/standard.js.map +1 -0
- package/node_modules/@appport/schema/dist/types.d.ts +40 -0
- package/node_modules/@appport/schema/dist/types.d.ts.map +1 -0
- package/node_modules/@appport/schema/dist/types.js +19 -0
- package/node_modules/@appport/schema/dist/types.js.map +1 -0
- package/node_modules/@appport/schema/package.json +28 -0
- package/node_modules/@appport/server/README.md +39 -0
- package/node_modules/@appport/server/dist/connection.d.ts +45 -0
- package/node_modules/@appport/server/dist/connection.d.ts.map +1 -0
- package/node_modules/@appport/server/dist/connection.js +217 -0
- package/node_modules/@appport/server/dist/connection.js.map +1 -0
- package/node_modules/@appport/server/dist/fetch.d.ts +10 -0
- package/node_modules/@appport/server/dist/fetch.d.ts.map +1 -0
- package/node_modules/@appport/server/dist/fetch.js +50 -0
- package/node_modules/@appport/server/dist/fetch.js.map +1 -0
- package/node_modules/@appport/server/dist/http.d.ts +80 -0
- package/node_modules/@appport/server/dist/http.d.ts.map +1 -0
- package/node_modules/@appport/server/dist/http.js +306 -0
- package/node_modules/@appport/server/dist/http.js.map +1 -0
- package/node_modules/@appport/server/dist/index.d.ts +11 -0
- package/node_modules/@appport/server/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/server/dist/index.js +11 -0
- package/node_modules/@appport/server/dist/index.js.map +1 -0
- package/node_modules/@appport/server/dist/node-entry.d.ts +4 -0
- package/node_modules/@appport/server/dist/node-entry.d.ts.map +1 -0
- package/node_modules/@appport/server/dist/node-entry.js +4 -0
- package/node_modules/@appport/server/dist/node-entry.js.map +1 -0
- package/node_modules/@appport/server/dist/node.d.ts +45 -0
- package/node_modules/@appport/server/dist/node.d.ts.map +1 -0
- package/node_modules/@appport/server/dist/node.js +190 -0
- package/node_modules/@appport/server/dist/node.js.map +1 -0
- package/node_modules/@appport/server/dist/server.d.ts +83 -0
- package/node_modules/@appport/server/dist/server.d.ts.map +1 -0
- package/node_modules/@appport/server/dist/server.js +114 -0
- package/node_modules/@appport/server/dist/server.js.map +1 -0
- package/node_modules/@appport/server/dist/websocket.d.ts +25 -0
- package/node_modules/@appport/server/dist/websocket.d.ts.map +1 -0
- package/node_modules/@appport/server/dist/websocket.js +221 -0
- package/node_modules/@appport/server/dist/websocket.js.map +1 -0
- package/node_modules/@appport/server/package.json +34 -0
- package/node_modules/@appport/transport-electron/README.md +56 -0
- package/node_modules/@appport/transport-electron/dist/index.d.ts +11 -0
- package/node_modules/@appport/transport-electron/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/transport-electron/dist/index.js +11 -0
- package/node_modules/@appport/transport-electron/dist/index.js.map +1 -0
- package/node_modules/@appport/transport-electron/dist/main.d.ts +31 -0
- package/node_modules/@appport/transport-electron/dist/main.d.ts.map +1 -0
- package/node_modules/@appport/transport-electron/dist/main.js +61 -0
- package/node_modules/@appport/transport-electron/dist/main.js.map +1 -0
- package/node_modules/@appport/transport-electron/dist/preload.d.ts +22 -0
- package/node_modules/@appport/transport-electron/dist/preload.d.ts.map +1 -0
- package/node_modules/@appport/transport-electron/dist/preload.js +29 -0
- package/node_modules/@appport/transport-electron/dist/preload.js.map +1 -0
- package/node_modules/@appport/transport-electron/dist/renderer.d.ts +16 -0
- package/node_modules/@appport/transport-electron/dist/renderer.d.ts.map +1 -0
- package/node_modules/@appport/transport-electron/dist/renderer.js +36 -0
- package/node_modules/@appport/transport-electron/dist/renderer.js.map +1 -0
- package/node_modules/@appport/transport-electron/dist/types.d.ts +49 -0
- package/node_modules/@appport/transport-electron/dist/types.d.ts.map +1 -0
- package/node_modules/@appport/transport-electron/dist/types.js +5 -0
- package/node_modules/@appport/transport-electron/dist/types.js.map +1 -0
- package/node_modules/@appport/transport-electron/package.json +46 -0
- package/node_modules/@appport/transport-http/README.md +24 -0
- package/node_modules/@appport/transport-http/dist/index.d.ts +18 -0
- package/node_modules/@appport/transport-http/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/transport-http/dist/index.js +223 -0
- package/node_modules/@appport/transport-http/dist/index.js.map +1 -0
- package/node_modules/@appport/transport-http/package.json +29 -0
- package/node_modules/@appport/transport-inprocess/README.md +24 -0
- package/node_modules/@appport/transport-inprocess/dist/index.d.ts +16 -0
- package/node_modules/@appport/transport-inprocess/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/transport-inprocess/dist/index.js +30 -0
- package/node_modules/@appport/transport-inprocess/dist/index.js.map +1 -0
- package/node_modules/@appport/transport-inprocess/package.json +30 -0
- package/node_modules/@appport/transport-tauri/README.md +45 -0
- package/node_modules/@appport/transport-tauri/dist/index.d.ts +23 -0
- package/node_modules/@appport/transport-tauri/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/transport-tauri/dist/index.js +44 -0
- package/node_modules/@appport/transport-tauri/dist/index.js.map +1 -0
- package/node_modules/@appport/transport-tauri/package.json +29 -0
- package/node_modules/@appport/transport-websocket/README.md +22 -0
- package/node_modules/@appport/transport-websocket/dist/index.d.ts +26 -0
- package/node_modules/@appport/transport-websocket/dist/index.d.ts.map +1 -0
- package/node_modules/@appport/transport-websocket/dist/index.js +72 -0
- package/node_modules/@appport/transport-websocket/dist/index.js.map +1 -0
- package/node_modules/@appport/transport-websocket/package.json +29 -0
- package/package.json +79 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { AppPortError, createStreamCancel, createSubscribe, createUnsubscribe, errors, newRequestId, newSubscriptionId, parseServerEnvelope } from "@appport/protocol";
|
|
2
|
+
import { ClientChannel } from "./channel.js";
|
|
3
|
+
import { DEFAULT_FEATURES } from "./transport.js";
|
|
4
|
+
/** Builds an {@link AppTransport} from a {@link DuplexChannel}. */
|
|
5
|
+
export function createDuplexTransport(channel) {
|
|
6
|
+
const pending = new Map();
|
|
7
|
+
const subscriptions = new Map();
|
|
8
|
+
const streamsByRequest = new Map();
|
|
9
|
+
const streamsById = new Map();
|
|
10
|
+
let opened = false;
|
|
11
|
+
let closing = false;
|
|
12
|
+
let generation = 0;
|
|
13
|
+
const failAll = (reason) => {
|
|
14
|
+
for (const request of pending.values())
|
|
15
|
+
request.reject(reason);
|
|
16
|
+
pending.clear();
|
|
17
|
+
for (const stream of streamsById.values())
|
|
18
|
+
stream.channel.fail(reason);
|
|
19
|
+
for (const stream of streamsByRequest.values())
|
|
20
|
+
stream.channel.fail(reason);
|
|
21
|
+
streamsById.clear();
|
|
22
|
+
streamsByRequest.clear();
|
|
23
|
+
subscriptions.clear();
|
|
24
|
+
};
|
|
25
|
+
const onEnvelope = (value) => {
|
|
26
|
+
let envelope;
|
|
27
|
+
try {
|
|
28
|
+
envelope = parseServerEnvelope(value);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
// A malformed server envelope must not corrupt client state (§57).
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
switch (envelope.type) {
|
|
35
|
+
case "response": {
|
|
36
|
+
const request = pending.get(envelope.requestId);
|
|
37
|
+
if (request) {
|
|
38
|
+
pending.delete(envelope.requestId);
|
|
39
|
+
request.resolve(envelope);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// A stream request that failed before `stream.start` is answered with a
|
|
43
|
+
// plain error response; surface it on the stream the caller is holding.
|
|
44
|
+
const stream = streamsByRequest.get(envelope.requestId);
|
|
45
|
+
if (stream && !envelope.ok) {
|
|
46
|
+
streamsByRequest.delete(envelope.requestId);
|
|
47
|
+
stream.channel.fail(new AppPortError(envelope.error.code, envelope.error.message));
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
case "event": {
|
|
52
|
+
const handler = envelope.subscriptionId ? subscriptions.get(envelope.subscriptionId) : undefined;
|
|
53
|
+
if (handler)
|
|
54
|
+
handler(envelope);
|
|
55
|
+
else
|
|
56
|
+
for (const listener of subscriptions.values())
|
|
57
|
+
listener(envelope);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
case "stream.start": {
|
|
61
|
+
const stream = streamsByRequest.get(envelope.requestId);
|
|
62
|
+
if (!stream)
|
|
63
|
+
return;
|
|
64
|
+
stream.streamId = envelope.streamId;
|
|
65
|
+
streamsById.set(envelope.streamId, stream);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
case "stream.chunk": {
|
|
69
|
+
const stream = streamsById.get(envelope.streamId);
|
|
70
|
+
if (!stream)
|
|
71
|
+
return;
|
|
72
|
+
if (envelope.sequence !== stream.expectedSequence) {
|
|
73
|
+
stream.channel.fail(errors.streamError(`Out-of-order stream chunk: expected ${stream.expectedSequence}, received ${envelope.sequence}`));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
stream.expectedSequence += 1;
|
|
77
|
+
stream.channel.push(envelope.payload);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
case "stream.end": {
|
|
81
|
+
const stream = streamsById.get(envelope.streamId);
|
|
82
|
+
if (!stream)
|
|
83
|
+
return;
|
|
84
|
+
streamsById.delete(envelope.streamId);
|
|
85
|
+
for (const [requestId, candidate] of streamsByRequest) {
|
|
86
|
+
if (candidate === stream)
|
|
87
|
+
streamsByRequest.delete(requestId);
|
|
88
|
+
}
|
|
89
|
+
if (envelope.error) {
|
|
90
|
+
stream.channel.fail(new AppPortError(envelope.error.code, envelope.error.message));
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
stream.channel.end();
|
|
94
|
+
}
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const ensureOpen = async () => {
|
|
100
|
+
if (opened)
|
|
101
|
+
return;
|
|
102
|
+
generation += 1;
|
|
103
|
+
const current = generation;
|
|
104
|
+
await channel.open({
|
|
105
|
+
onEnvelope: (value) => {
|
|
106
|
+
if (current !== generation)
|
|
107
|
+
return;
|
|
108
|
+
onEnvelope(value);
|
|
109
|
+
},
|
|
110
|
+
onClose: (reason) => {
|
|
111
|
+
// Ignore a close from a carrier that has already been superseded.
|
|
112
|
+
if (current !== generation)
|
|
113
|
+
return;
|
|
114
|
+
opened = false;
|
|
115
|
+
failAll(reason ?? (closing ? errors.cancelled("Transport closed") : errors.streamError("Transport disconnected")));
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
opened = true;
|
|
119
|
+
};
|
|
120
|
+
const transport = {
|
|
121
|
+
kind: channel.kind,
|
|
122
|
+
features: channel.features ?? DEFAULT_FEATURES,
|
|
123
|
+
async connect() {
|
|
124
|
+
await ensureOpen();
|
|
125
|
+
},
|
|
126
|
+
async close() {
|
|
127
|
+
closing = true;
|
|
128
|
+
generation += 1;
|
|
129
|
+
if (opened) {
|
|
130
|
+
opened = false;
|
|
131
|
+
await channel.close();
|
|
132
|
+
}
|
|
133
|
+
failAll(errors.cancelled("Transport closed"));
|
|
134
|
+
closing = false;
|
|
135
|
+
},
|
|
136
|
+
async request(request) {
|
|
137
|
+
await ensureOpen();
|
|
138
|
+
return new Promise((resolve, reject) => {
|
|
139
|
+
pending.set(request.requestId, { resolve, reject });
|
|
140
|
+
Promise.resolve(channel.send(request)).catch((error) => {
|
|
141
|
+
pending.delete(request.requestId);
|
|
142
|
+
reject(error);
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
async subscribe(handler, filter) {
|
|
147
|
+
await ensureOpen();
|
|
148
|
+
const subscriptionId = newSubscriptionId();
|
|
149
|
+
const requestId = newRequestId();
|
|
150
|
+
subscriptions.set(subscriptionId, handler);
|
|
151
|
+
const ack = new Promise((resolve, reject) => {
|
|
152
|
+
pending.set(requestId, { resolve, reject });
|
|
153
|
+
});
|
|
154
|
+
await channel.send(createSubscribe(requestId, subscriptionId, {
|
|
155
|
+
name: filter?.name ?? "*",
|
|
156
|
+
...(filter?.version !== undefined ? { version: filter.version } : {})
|
|
157
|
+
}));
|
|
158
|
+
const response = await ack;
|
|
159
|
+
if (!response.ok) {
|
|
160
|
+
subscriptions.delete(subscriptionId);
|
|
161
|
+
throw new AppPortError(response.error.code, response.error.message);
|
|
162
|
+
}
|
|
163
|
+
return () => {
|
|
164
|
+
subscriptions.delete(subscriptionId);
|
|
165
|
+
void Promise.resolve(channel.send(createUnsubscribe(newRequestId(), subscriptionId))).catch(() => undefined);
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
stream(request) {
|
|
169
|
+
const stream = { channel: new ClientChannel(), expectedSequence: 0 };
|
|
170
|
+
streamsByRequest.set(request.requestId, stream);
|
|
171
|
+
void (async () => {
|
|
172
|
+
try {
|
|
173
|
+
await ensureOpen();
|
|
174
|
+
await channel.send(request);
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
stream.channel.fail(error);
|
|
178
|
+
}
|
|
179
|
+
})();
|
|
180
|
+
return {
|
|
181
|
+
cancel(reason) {
|
|
182
|
+
const streamId = stream.streamId;
|
|
183
|
+
if (streamId) {
|
|
184
|
+
void Promise.resolve(channel.send(createStreamCancel(streamId, reason))).catch(() => undefined);
|
|
185
|
+
}
|
|
186
|
+
stream.channel.fail(errors.cancelled(reason ?? "Cancelled by client"));
|
|
187
|
+
},
|
|
188
|
+
[Symbol.asyncIterator]: () => stream.channel[Symbol.asyncIterator]()
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
return transport;
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=duplex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duplex.js","sourceRoot":"","sources":["../src/duplex.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,MAAM,EACN,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EAOpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAOjB,MAAM,gBAAgB,CAAC;AAmCxB,mEAAmE;AACnE,MAAM,UAAU,qBAAqB,CAAC,OAAsB;IAC1D,MAAM,OAAO,GAAG,IAAI,GAAG,EAA0B,CAAC;IAClD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAwB,CAAC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M,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,IAAI,qBAAqB,CAAC,CAAC,CAAC;gBACzE,CAAC;gBACD,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;aACrE,CAAC;QACJ,CAAC;KACF,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@appport/client` — the transport-independent application client.
|
|
3
|
+
*
|
|
4
|
+
* `await app.documents.save(input)` is valid application code on every runtime.
|
|
5
|
+
* `if (isElectron) { ... } else { fetch(...) }` is not (§2).
|
|
6
|
+
*/
|
|
7
|
+
export * from "./transport.js";
|
|
8
|
+
export * from "./contract.js";
|
|
9
|
+
export * from "./client.js";
|
|
10
|
+
export * from "./duplex.js";
|
|
11
|
+
export * from "./channel.js";
|
|
12
|
+
export * from "./discovery.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@appport/client` — the transport-independent application client.
|
|
3
|
+
*
|
|
4
|
+
* `await app.documents.save(input)` is valid application code on every runtime.
|
|
5
|
+
* `if (isElectron) { ... } else { fetch(...) }` is not (§2).
|
|
6
|
+
*/
|
|
7
|
+
export * from "./transport.js";
|
|
8
|
+
export * from "./contract.js";
|
|
9
|
+
export * from "./client.js";
|
|
10
|
+
export * from "./duplex.js";
|
|
11
|
+
export * from "./channel.js";
|
|
12
|
+
export * from "./discovery.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { AppEventEnvelope, AppRequest, AppResponse, AppStreamRequest } from "@appport/protocol";
|
|
2
|
+
export type Unsubscribe = () => void;
|
|
3
|
+
export type EventHandler = (event: AppEventEnvelope) => void;
|
|
4
|
+
export interface TransportEventFilter {
|
|
5
|
+
/** Event name, `namespace.*`, or `*` for everything the session may observe. */
|
|
6
|
+
name: string;
|
|
7
|
+
version?: number;
|
|
8
|
+
}
|
|
9
|
+
/** A stream of chunks with best-effort cancellation (§21). */
|
|
10
|
+
export interface TransportStream extends AsyncIterable<unknown> {
|
|
11
|
+
cancel(reason?: string): void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The transport contract (specification §22).
|
|
15
|
+
*
|
|
16
|
+
* Every transport — in-process, HTTP, WebSocket, Electron IPC, Tauri IPC — is
|
|
17
|
+
* the same conceptual interface. Application code never sees which one is
|
|
18
|
+
* mounted; that is the invariant the whole protocol exists to protect (§2).
|
|
19
|
+
*/
|
|
20
|
+
export interface AppTransport {
|
|
21
|
+
/** `inprocess`, `http`, `websocket`, `ipc`, … */
|
|
22
|
+
readonly kind: string;
|
|
23
|
+
connect(): Promise<void>;
|
|
24
|
+
close(): Promise<void>;
|
|
25
|
+
request(request: AppRequest): Promise<AppResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Subscribes to server events. Transports without a server-initiated channel
|
|
28
|
+
* (plain HTTP) reject with `STREAM_ERROR`.
|
|
29
|
+
*/
|
|
30
|
+
subscribe(handler: EventHandler, filter?: TransportEventFilter): Promise<Unsubscribe>;
|
|
31
|
+
stream(request: AppStreamRequest): TransportStream;
|
|
32
|
+
/** Advertised optional features, for capability negotiation and diagnostics. */
|
|
33
|
+
readonly features?: TransportFeatures;
|
|
34
|
+
}
|
|
35
|
+
export interface TransportFeatures {
|
|
36
|
+
events: boolean;
|
|
37
|
+
streams: boolean;
|
|
38
|
+
/** True when the transport keeps a connection open between requests. */
|
|
39
|
+
persistent: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare const DEFAULT_FEATURES: TransportFeatures;
|
|
42
|
+
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErG,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC;AAErC,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACnC,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,8DAA8D;AAC9D,MAAM,WAAW,eAAgB,SAAQ,aAAa,CAAC,OAAO,CAAC;IAC7D,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACtF,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAAC;IACnD,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,gBAAgB,EAAE,iBAAqE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AA+CA,MAAM,CAAC,MAAM,gBAAgB,GAAsB,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@appport/client",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Transport-independent typed AppPort application client.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": "github:rkendel1/appport",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -b",
|
|
22
|
+
"clean": "tsc -b --clean"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@appport/protocol": "1.0.0"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"@appport/transport-http": "1.0.0",
|
|
29
|
+
"@appport/transport-websocket": "1.0.0"
|
|
30
|
+
},
|
|
31
|
+
"private": true
|
|
32
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# @appport/core
|
|
2
|
+
|
|
3
|
+
The capability runtime: registry, dispatch pipeline, validation, sessions,
|
|
4
|
+
events, streams, operations and telemetry.
|
|
5
|
+
|
|
6
|
+
Core knows nothing about HTTP, WebSocket, IPC, or any storage engine.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { createApplication, defineCapability, defineEvent } from "@appport/core";
|
|
10
|
+
import { s } from "@appport/schema";
|
|
11
|
+
|
|
12
|
+
const application = createApplication({
|
|
13
|
+
application: { id: "com.example.docs", name: "Docs", version: "1.0.0" },
|
|
14
|
+
capabilities: [documentsSave],
|
|
15
|
+
events: [documentsChanged],
|
|
16
|
+
authorizer: permissionAuthorizer()
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const response = await application.handleRequest(envelope, { session, transport: "http" });
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## The pipeline
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
receive -> validate -> authorize -> execute -> serialize -> respond
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Authorization always runs before privileged logic. Input is validated before
|
|
29
|
+
authorization, so policies see well-formed input. Output is validated too, so a
|
|
30
|
+
handler cannot silently break its published contract.
|
|
31
|
+
|
|
32
|
+
## What the runtime provides
|
|
33
|
+
|
|
34
|
+
- **Registry and manifest** — the application's contract, rendered as JSON Schema.
|
|
35
|
+
- **Application registration** — define an application, verify it, and register for
|
|
36
|
+
durable tracking with identity, manifest, fingerprint, and verification state.
|
|
37
|
+
- **Events** — at-most-once publication, with payload validation.
|
|
38
|
+
- **Streams** — async iterables or `context.createStream()`, with cancellation.
|
|
39
|
+
- **Sessions** — transport-neutral, pluggable storage.
|
|
40
|
+
- **Idempotency** — replayed responses for capabilities that declare support.
|
|
41
|
+
- **Concurrency** — `parallel`, `serialized`, or `keyed(field)`.
|
|
42
|
+
- **Timeouts** — per capability and per request, clamped by the server.
|
|
43
|
+
- **Operations** — `operations.status`, `operations.cancel`, `operations.events`
|
|
44
|
+
for work that outlives a request.
|
|
45
|
+
- **Telemetry** — identifiers and outcomes, never credentials or payloads.
|
|
46
|
+
- **Sanitization** — production errors carry no stack traces, paths or secrets.
|
|
47
|
+
|
|
48
|
+
The reserved `appport.manifest` and `appport.ping` capabilities are registered
|
|
49
|
+
automatically, so discovery works identically on transports that have no URLs.
|
|
50
|
+
|
|
51
|
+
## Application Registration (PR20)
|
|
52
|
+
|
|
53
|
+
Define, verify, and register applications for durable tracking:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { defineApplication, ApplicationRegistry, MemoryApplicationStateStore } from "@appport/core";
|
|
57
|
+
|
|
58
|
+
// 1. Define an application (PR18)
|
|
59
|
+
const application = defineApplication({
|
|
60
|
+
identity: { id: "invoicing", name: "Invoicing", version: "1.0.0" },
|
|
61
|
+
provides: [invoiceCreate, invoiceSend],
|
|
62
|
+
requires: [{ name: "payments.charge", version: 1 }],
|
|
63
|
+
implementations: { "invoice.create@1": createImpl, "invoice.send@1": sendImpl }
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// 2. Verify the application (PR19)
|
|
67
|
+
const verification = application.verify();
|
|
68
|
+
if (!verification.ready) throw new Error("Application verification failed");
|
|
69
|
+
|
|
70
|
+
// 3. Get the canonical manifest and fingerprint (PR19)
|
|
71
|
+
const manifest = application.manifest();
|
|
72
|
+
const fingerprint = application.fingerprint();
|
|
73
|
+
|
|
74
|
+
// 4. Register for durable tracking (PR20)
|
|
75
|
+
const store = new MemoryApplicationStateStore();
|
|
76
|
+
const registry = new ApplicationRegistry(store);
|
|
77
|
+
|
|
78
|
+
const registered = await registry.register({
|
|
79
|
+
identity: application.identity,
|
|
80
|
+
manifest,
|
|
81
|
+
fingerprint,
|
|
82
|
+
verification
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Tracked application state with identity, manifest, fingerprint, verification
|
|
86
|
+
console.log(registered.id, registered.status, registered.revision);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The registered application state is portable and contains no implementation
|
|
90
|
+
details — only the contract, identity, verification state, and lifecycle.
|
|
91
|
+
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AppBoundry Application Contract (F6)
|
|
3
|
+
*
|
|
4
|
+
* The singular, AppBoundry-owned description of an application: its identity,
|
|
5
|
+
* its contract revision, its canonical fingerprint, and the capabilities it
|
|
6
|
+
* provides and requires.
|
|
7
|
+
*
|
|
8
|
+
* A repository represents this contract with `appboundry.contract.json`. That
|
|
9
|
+
* document is an *attestation target*: it is a read-only representation of the
|
|
10
|
+
* contract AppBoundry owns. It is NOT an independently authored contract and it
|
|
11
|
+
* is NOT interchangeable with the runtime implementation manifest
|
|
12
|
+
* (see `runtime-manifest.ts`).
|
|
13
|
+
*
|
|
14
|
+
* The document therefore MUST NOT contain authorization grants, bindings,
|
|
15
|
+
* credentials, runtime process state, provider selections, execution state or
|
|
16
|
+
* mutable implementation state. Parsing rejects those fields explicitly.
|
|
17
|
+
*/
|
|
18
|
+
import { type ApplicationManifest, type CapabilityManifestEntry, type RequirementManifestEntry } from "./manifest.js";
|
|
19
|
+
import type { JsonValue } from "@appport/protocol";
|
|
20
|
+
/** Protocol identifier of the repository contract representation. */
|
|
21
|
+
export declare const APPBOUNDRY_CONTRACT_PROTOCOL = "AppBoundry/contract/1";
|
|
22
|
+
/** Canonical file name of the repository contract representation. */
|
|
23
|
+
export declare const APPBOUNDRY_CONTRACT_FILE = "appboundry.contract.json";
|
|
24
|
+
/**
|
|
25
|
+
* Repository representation of the authoritative AppBoundry contract.
|
|
26
|
+
*
|
|
27
|
+
* The fingerprint is self-describing: a document whose declared fingerprint
|
|
28
|
+
* disagrees with its own canonical content is invalid and can never attest.
|
|
29
|
+
*/
|
|
30
|
+
export interface AppBoundryContractDocument {
|
|
31
|
+
readonly protocol: typeof APPBOUNDRY_CONTRACT_PROTOCOL;
|
|
32
|
+
readonly application: {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly name: string;
|
|
35
|
+
readonly version: string;
|
|
36
|
+
};
|
|
37
|
+
readonly contractRevision: number;
|
|
38
|
+
readonly contractFingerprint: string;
|
|
39
|
+
readonly metadata?: Readonly<Record<string, JsonValue>>;
|
|
40
|
+
readonly provides: readonly CapabilityManifestEntry[];
|
|
41
|
+
readonly requires: readonly RequirementManifestEntry[];
|
|
42
|
+
}
|
|
43
|
+
export type AppBoundryContractErrorCode = "CONTRACT_DOCUMENT_INVALID" | "CONTRACT_DOCUMENT_NOT_A_CONTRACT" | "CONTRACT_DOCUMENT_FINGERPRINT_INVALID";
|
|
44
|
+
/** Explicit contract-document failure; never silently downgraded to a manifest. */
|
|
45
|
+
export declare class AppBoundryContractError extends Error {
|
|
46
|
+
readonly code: AppBoundryContractErrorCode;
|
|
47
|
+
constructor(code: AppBoundryContractErrorCode, message: string);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Project a contract document onto the canonical manifest shape used for
|
|
51
|
+
* fingerprinting. The projection exists so the AppBoundry contract and the
|
|
52
|
+
* authoritative application registration share one fingerprint algorithm
|
|
53
|
+
* without the two schemas becoming interchangeable.
|
|
54
|
+
*/
|
|
55
|
+
export declare function contractManifestProjection(contract: AppBoundryContractDocument): ApplicationManifest;
|
|
56
|
+
/** Canonical fingerprint of a contract document's own content. */
|
|
57
|
+
export declare function fingerprintAppBoundryContract(contract: AppBoundryContractDocument): string;
|
|
58
|
+
/**
|
|
59
|
+
* Derive the repository contract representation from the authoritative manifest.
|
|
60
|
+
*
|
|
61
|
+
* AppBoundry owns the contract; this only renders it for a repository to commit.
|
|
62
|
+
*/
|
|
63
|
+
export declare function appBoundryContractFromManifest(manifest: ApplicationManifest, contractRevision?: number): AppBoundryContractDocument;
|
|
64
|
+
/** Serialize the contract representation for `appboundry.contract.json`. */
|
|
65
|
+
export declare function serializeAppBoundryContract(contract: AppBoundryContractDocument): string;
|
|
66
|
+
/**
|
|
67
|
+
* Parse and validate a repository contract representation.
|
|
68
|
+
*
|
|
69
|
+
* Anything that is not an AppBoundry contract — most importantly a runtime
|
|
70
|
+
* implementation manifest — is rejected explicitly rather than coerced.
|
|
71
|
+
*/
|
|
72
|
+
export declare function parseAppBoundryContract(value: unknown): AppBoundryContractDocument;
|
|
73
|
+
/** Canonical key for a capability within a contract or coverage declaration. */
|
|
74
|
+
export declare function capabilityCoverageKey(capability: {
|
|
75
|
+
readonly name: string;
|
|
76
|
+
readonly version: number;
|
|
77
|
+
}): string;
|
|
78
|
+
/** Capabilities the contract declares, as canonical coverage keys. */
|
|
79
|
+
export declare function contractProvidedCoverage(contract: AppBoundryContractDocument): readonly string[];
|
|
80
|
+
//# sourceMappingURL=appboundry-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appboundry-contract.d.ts","sourceRoot":"","sources":["../src/appboundry-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAuB,KAAK,mBAAmB,EAAE,KAAK,uBAAuB,EAAE,KAAK,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAC3I,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qEAAqE;AACrE,eAAO,MAAM,4BAA4B,0BAA0B,CAAC;AAEpE,qEAAqE;AACrE,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AAmBnE;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,QAAQ,EAAE,OAAO,4BAA4B,CAAC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