@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.
Files changed (387) hide show
  1. package/LICENSE +126 -0
  2. package/README.md +39 -0
  3. package/dist/index.d.ts +14 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +14 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/node.d.ts +3 -0
  8. package/dist/node.d.ts.map +1 -0
  9. package/dist/node.js +3 -0
  10. package/dist/node.js.map +1 -0
  11. package/node_modules/@appport/authorization/README.md +28 -0
  12. package/node_modules/@appport/authorization/dist/index.d.ts +94 -0
  13. package/node_modules/@appport/authorization/dist/index.d.ts.map +1 -0
  14. package/node_modules/@appport/authorization/dist/index.js +131 -0
  15. package/node_modules/@appport/authorization/dist/index.js.map +1 -0
  16. package/node_modules/@appport/authorization/package.json +28 -0
  17. package/node_modules/@appport/client/README.md +35 -0
  18. package/node_modules/@appport/client/dist/channel.d.ts +14 -0
  19. package/node_modules/@appport/client/dist/channel.d.ts.map +1 -0
  20. package/node_modules/@appport/client/dist/channel.js +58 -0
  21. package/node_modules/@appport/client/dist/channel.js.map +1 -0
  22. package/node_modules/@appport/client/dist/client.d.ts +61 -0
  23. package/node_modules/@appport/client/dist/client.d.ts.map +1 -0
  24. package/node_modules/@appport/client/dist/client.js +214 -0
  25. package/node_modules/@appport/client/dist/client.js.map +1 -0
  26. package/node_modules/@appport/client/dist/contract.d.ts +55 -0
  27. package/node_modules/@appport/client/dist/contract.d.ts.map +1 -0
  28. package/node_modules/@appport/client/dist/contract.js +12 -0
  29. package/node_modules/@appport/client/dist/contract.js.map +1 -0
  30. package/node_modules/@appport/client/dist/discovery.d.ts +17 -0
  31. package/node_modules/@appport/client/dist/discovery.d.ts.map +1 -0
  32. package/node_modules/@appport/client/dist/discovery.js +56 -0
  33. package/node_modules/@appport/client/dist/discovery.js.map +1 -0
  34. package/node_modules/@appport/client/dist/duplex.d.ts +25 -0
  35. package/node_modules/@appport/client/dist/duplex.d.ts.map +1 -0
  36. package/node_modules/@appport/client/dist/duplex.js +194 -0
  37. package/node_modules/@appport/client/dist/duplex.js.map +1 -0
  38. package/node_modules/@appport/client/dist/index.d.ts +13 -0
  39. package/node_modules/@appport/client/dist/index.d.ts.map +1 -0
  40. package/node_modules/@appport/client/dist/index.js +13 -0
  41. package/node_modules/@appport/client/dist/index.js.map +1 -0
  42. package/node_modules/@appport/client/dist/transport.d.ts +42 -0
  43. package/node_modules/@appport/client/dist/transport.d.ts.map +1 -0
  44. package/node_modules/@appport/client/dist/transport.js +2 -0
  45. package/node_modules/@appport/client/dist/transport.js.map +1 -0
  46. package/node_modules/@appport/client/package.json +32 -0
  47. package/node_modules/@appport/core/README.md +91 -0
  48. package/node_modules/@appport/core/dist/appboundry-contract.d.ts +80 -0
  49. package/node_modules/@appport/core/dist/appboundry-contract.d.ts.map +1 -0
  50. package/node_modules/@appport/core/dist/appboundry-contract.js +160 -0
  51. package/node_modules/@appport/core/dist/appboundry-contract.js.map +1 -0
  52. package/node_modules/@appport/core/dist/application-implementation.d.ts +125 -0
  53. package/node_modules/@appport/core/dist/application-implementation.d.ts.map +1 -0
  54. package/node_modules/@appport/core/dist/application-implementation.js +220 -0
  55. package/node_modules/@appport/core/dist/application-implementation.js.map +1 -0
  56. package/node_modules/@appport/core/dist/application-lifecycle.d.ts +150 -0
  57. package/node_modules/@appport/core/dist/application-lifecycle.d.ts.map +1 -0
  58. package/node_modules/@appport/core/dist/application-lifecycle.js +70 -0
  59. package/node_modules/@appport/core/dist/application-lifecycle.js.map +1 -0
  60. package/node_modules/@appport/core/dist/application-source.d.ts +109 -0
  61. package/node_modules/@appport/core/dist/application-source.d.ts.map +1 -0
  62. package/node_modules/@appport/core/dist/application-source.js +186 -0
  63. package/node_modules/@appport/core/dist/application-source.js.map +1 -0
  64. package/node_modules/@appport/core/dist/application.d.ts +122 -0
  65. package/node_modules/@appport/core/dist/application.d.ts.map +1 -0
  66. package/node_modules/@appport/core/dist/application.js +515 -0
  67. package/node_modules/@appport/core/dist/application.js.map +1 -0
  68. package/node_modules/@appport/core/dist/artifact.d.ts +395 -0
  69. package/node_modules/@appport/core/dist/artifact.d.ts.map +1 -0
  70. package/node_modules/@appport/core/dist/artifact.js +392 -0
  71. package/node_modules/@appport/core/dist/artifact.js.map +1 -0
  72. package/node_modules/@appport/core/dist/assembly.d.ts +237 -0
  73. package/node_modules/@appport/core/dist/assembly.d.ts.map +1 -0
  74. package/node_modules/@appport/core/dist/assembly.js +458 -0
  75. package/node_modules/@appport/core/dist/assembly.js.map +1 -0
  76. package/node_modules/@appport/core/dist/authority-attestation.d.ts +34 -0
  77. package/node_modules/@appport/core/dist/authority-attestation.d.ts.map +1 -0
  78. package/node_modules/@appport/core/dist/authority-attestation.js +72 -0
  79. package/node_modules/@appport/core/dist/authority-attestation.js.map +1 -0
  80. package/node_modules/@appport/core/dist/authorization-grant.d.ts +107 -0
  81. package/node_modules/@appport/core/dist/authorization-grant.d.ts.map +1 -0
  82. package/node_modules/@appport/core/dist/authorization-grant.js +131 -0
  83. package/node_modules/@appport/core/dist/authorization-grant.js.map +1 -0
  84. package/node_modules/@appport/core/dist/binding.d.ts +294 -0
  85. package/node_modules/@appport/core/dist/binding.d.ts.map +1 -0
  86. package/node_modules/@appport/core/dist/binding.js +263 -0
  87. package/node_modules/@appport/core/dist/binding.js.map +1 -0
  88. package/node_modules/@appport/core/dist/builtins.d.ts +18 -0
  89. package/node_modules/@appport/core/dist/builtins.d.ts.map +1 -0
  90. package/node_modules/@appport/core/dist/builtins.js +38 -0
  91. package/node_modules/@appport/core/dist/builtins.js.map +1 -0
  92. package/node_modules/@appport/core/dist/capability.d.ts +94 -0
  93. package/node_modules/@appport/core/dist/capability.d.ts.map +1 -0
  94. package/node_modules/@appport/core/dist/capability.js +85 -0
  95. package/node_modules/@appport/core/dist/capability.js.map +1 -0
  96. package/node_modules/@appport/core/dist/concurrency.d.ts +16 -0
  97. package/node_modules/@appport/core/dist/concurrency.d.ts.map +1 -0
  98. package/node_modules/@appport/core/dist/concurrency.js +46 -0
  99. package/node_modules/@appport/core/dist/concurrency.js.map +1 -0
  100. package/node_modules/@appport/core/dist/context.d.ts +59 -0
  101. package/node_modules/@appport/core/dist/context.d.ts.map +1 -0
  102. package/node_modules/@appport/core/dist/context.js +14 -0
  103. package/node_modules/@appport/core/dist/context.js.map +1 -0
  104. package/node_modules/@appport/core/dist/contract-artifact.d.ts +15 -0
  105. package/node_modules/@appport/core/dist/contract-artifact.d.ts.map +1 -0
  106. package/node_modules/@appport/core/dist/contract-artifact.js +152 -0
  107. package/node_modules/@appport/core/dist/contract-artifact.js.map +1 -0
  108. package/node_modules/@appport/core/dist/contract-attestation.d.ts +68 -0
  109. package/node_modules/@appport/core/dist/contract-attestation.d.ts.map +1 -0
  110. package/node_modules/@appport/core/dist/contract-attestation.js +76 -0
  111. package/node_modules/@appport/core/dist/contract-attestation.js.map +1 -0
  112. package/node_modules/@appport/core/dist/crash-injection.d.ts +3 -0
  113. package/node_modules/@appport/core/dist/crash-injection.d.ts.map +1 -0
  114. package/node_modules/@appport/core/dist/crash-injection.js +8 -0
  115. package/node_modules/@appport/core/dist/crash-injection.js.map +1 -0
  116. package/node_modules/@appport/core/dist/events.d.ts +33 -0
  117. package/node_modules/@appport/core/dist/events.d.ts.map +1 -0
  118. package/node_modules/@appport/core/dist/events.js +79 -0
  119. package/node_modules/@appport/core/dist/events.js.map +1 -0
  120. package/node_modules/@appport/core/dist/execution-barrier.d.ts +13 -0
  121. package/node_modules/@appport/core/dist/execution-barrier.d.ts.map +1 -0
  122. package/node_modules/@appport/core/dist/execution-barrier.js +33 -0
  123. package/node_modules/@appport/core/dist/execution-barrier.js.map +1 -0
  124. package/node_modules/@appport/core/dist/execution-ledger.d.ts +81 -0
  125. package/node_modules/@appport/core/dist/execution-ledger.d.ts.map +1 -0
  126. package/node_modules/@appport/core/dist/execution-ledger.js +173 -0
  127. package/node_modules/@appport/core/dist/execution-ledger.js.map +1 -0
  128. package/node_modules/@appport/core/dist/execution.d.ts +387 -0
  129. package/node_modules/@appport/core/dist/execution.d.ts.map +1 -0
  130. package/node_modules/@appport/core/dist/execution.js +165 -0
  131. package/node_modules/@appport/core/dist/execution.js.map +1 -0
  132. package/node_modules/@appport/core/dist/idempotency.d.ts +36 -0
  133. package/node_modules/@appport/core/dist/idempotency.d.ts.map +1 -0
  134. package/node_modules/@appport/core/dist/idempotency.js +36 -0
  135. package/node_modules/@appport/core/dist/idempotency.js.map +1 -0
  136. package/node_modules/@appport/core/dist/implementation.d.ts +110 -0
  137. package/node_modules/@appport/core/dist/implementation.d.ts.map +1 -0
  138. package/node_modules/@appport/core/dist/implementation.js +65 -0
  139. package/node_modules/@appport/core/dist/implementation.js.map +1 -0
  140. package/node_modules/@appport/core/dist/index.d.ts +44 -0
  141. package/node_modules/@appport/core/dist/index.d.ts.map +1 -0
  142. package/node_modules/@appport/core/dist/index.js +44 -0
  143. package/node_modules/@appport/core/dist/index.js.map +1 -0
  144. package/node_modules/@appport/core/dist/invocation.d.ts +253 -0
  145. package/node_modules/@appport/core/dist/invocation.d.ts.map +1 -0
  146. package/node_modules/@appport/core/dist/invocation.js +258 -0
  147. package/node_modules/@appport/core/dist/invocation.js.map +1 -0
  148. package/node_modules/@appport/core/dist/manifest.d.ts +157 -0
  149. package/node_modules/@appport/core/dist/manifest.d.ts.map +1 -0
  150. package/node_modules/@appport/core/dist/manifest.js +255 -0
  151. package/node_modules/@appport/core/dist/manifest.js.map +1 -0
  152. package/node_modules/@appport/core/dist/memory-application-data-store.d.ts +19 -0
  153. package/node_modules/@appport/core/dist/memory-application-data-store.d.ts.map +1 -0
  154. package/node_modules/@appport/core/dist/memory-application-data-store.js +161 -0
  155. package/node_modules/@appport/core/dist/memory-application-data-store.js.map +1 -0
  156. package/node_modules/@appport/core/dist/operations.d.ts +61 -0
  157. package/node_modules/@appport/core/dist/operations.d.ts.map +1 -0
  158. package/node_modules/@appport/core/dist/operations.js +210 -0
  159. package/node_modules/@appport/core/dist/operations.js.map +1 -0
  160. package/node_modules/@appport/core/dist/public.d.ts +19 -0
  161. package/node_modules/@appport/core/dist/public.d.ts.map +1 -0
  162. package/node_modules/@appport/core/dist/public.js +18 -0
  163. package/node_modules/@appport/core/dist/public.js.map +1 -0
  164. package/node_modules/@appport/core/dist/registration.d.ts +165 -0
  165. package/node_modules/@appport/core/dist/registration.d.ts.map +1 -0
  166. package/node_modules/@appport/core/dist/registration.js +253 -0
  167. package/node_modules/@appport/core/dist/registration.js.map +1 -0
  168. package/node_modules/@appport/core/dist/registry.d.ts +29 -0
  169. package/node_modules/@appport/core/dist/registry.d.ts.map +1 -0
  170. package/node_modules/@appport/core/dist/registry.js +148 -0
  171. package/node_modules/@appport/core/dist/registry.js.map +1 -0
  172. package/node_modules/@appport/core/dist/repository-connection.d.ts +100 -0
  173. package/node_modules/@appport/core/dist/repository-connection.d.ts.map +1 -0
  174. package/node_modules/@appport/core/dist/repository-connection.js +57 -0
  175. package/node_modules/@appport/core/dist/repository-connection.js.map +1 -0
  176. package/node_modules/@appport/core/dist/resolver.d.ts +130 -0
  177. package/node_modules/@appport/core/dist/resolver.d.ts.map +1 -0
  178. package/node_modules/@appport/core/dist/resolver.js +252 -0
  179. package/node_modules/@appport/core/dist/resolver.js.map +1 -0
  180. package/node_modules/@appport/core/dist/runtime-manifest.d.ts +68 -0
  181. package/node_modules/@appport/core/dist/runtime-manifest.d.ts.map +1 -0
  182. package/node_modules/@appport/core/dist/runtime-manifest.js +84 -0
  183. package/node_modules/@appport/core/dist/runtime-manifest.js.map +1 -0
  184. package/node_modules/@appport/core/dist/sanitize.d.ts +14 -0
  185. package/node_modules/@appport/core/dist/sanitize.d.ts.map +1 -0
  186. package/node_modules/@appport/core/dist/sanitize.js +49 -0
  187. package/node_modules/@appport/core/dist/sanitize.js.map +1 -0
  188. package/node_modules/@appport/core/dist/server-internal.d.ts +5 -0
  189. package/node_modules/@appport/core/dist/server-internal.d.ts.map +1 -0
  190. package/node_modules/@appport/core/dist/server-internal.js +4 -0
  191. package/node_modules/@appport/core/dist/server-internal.js.map +1 -0
  192. package/node_modules/@appport/core/dist/sessions.d.ts +29 -0
  193. package/node_modules/@appport/core/dist/sessions.d.ts.map +1 -0
  194. package/node_modules/@appport/core/dist/sessions.js +39 -0
  195. package/node_modules/@appport/core/dist/sessions.js.map +1 -0
  196. package/node_modules/@appport/core/dist/sha256.d.ts +3 -0
  197. package/node_modules/@appport/core/dist/sha256.d.ts.map +1 -0
  198. package/node_modules/@appport/core/dist/sha256.js +46 -0
  199. package/node_modules/@appport/core/dist/sha256.js.map +1 -0
  200. package/node_modules/@appport/core/dist/source-verification.d.ts +53 -0
  201. package/node_modules/@appport/core/dist/source-verification.d.ts.map +1 -0
  202. package/node_modules/@appport/core/dist/source-verification.js +92 -0
  203. package/node_modules/@appport/core/dist/source-verification.js.map +1 -0
  204. package/node_modules/@appport/core/dist/state-context.d.ts +312 -0
  205. package/node_modules/@appport/core/dist/state-context.d.ts.map +1 -0
  206. package/node_modules/@appport/core/dist/state-context.js +100 -0
  207. package/node_modules/@appport/core/dist/state-context.js.map +1 -0
  208. package/node_modules/@appport/core/dist/state.d.ts +96 -0
  209. package/node_modules/@appport/core/dist/state.d.ts.map +1 -0
  210. package/node_modules/@appport/core/dist/state.js +89 -0
  211. package/node_modules/@appport/core/dist/state.js.map +1 -0
  212. package/node_modules/@appport/core/dist/streams.d.ts +38 -0
  213. package/node_modules/@appport/core/dist/streams.d.ts.map +1 -0
  214. package/node_modules/@appport/core/dist/streams.js +123 -0
  215. package/node_modules/@appport/core/dist/streams.js.map +1 -0
  216. package/node_modules/@appport/core/dist/telemetry.d.ts +42 -0
  217. package/node_modules/@appport/core/dist/telemetry.d.ts.map +1 -0
  218. package/node_modules/@appport/core/dist/telemetry.js +32 -0
  219. package/node_modules/@appport/core/dist/telemetry.js.map +1 -0
  220. package/node_modules/@appport/core/dist/wasm-engine.d.ts +22 -0
  221. package/node_modules/@appport/core/dist/wasm-engine.d.ts.map +1 -0
  222. package/node_modules/@appport/core/dist/wasm-engine.js +367 -0
  223. package/node_modules/@appport/core/dist/wasm-engine.js.map +1 -0
  224. package/node_modules/@appport/core/package.json +58 -0
  225. package/node_modules/@appport/mobile/README.md +10 -0
  226. package/node_modules/@appport/mobile/dist/index.d.ts +66 -0
  227. package/node_modules/@appport/mobile/dist/index.d.ts.map +1 -0
  228. package/node_modules/@appport/mobile/dist/index.js +182 -0
  229. package/node_modules/@appport/mobile/dist/index.js.map +1 -0
  230. package/node_modules/@appport/mobile/package.json +33 -0
  231. package/node_modules/@appport/protocol/README.md +41 -0
  232. package/node_modules/@appport/protocol/dist/blob.d.ts +46 -0
  233. package/node_modules/@appport/protocol/dist/blob.d.ts.map +1 -0
  234. package/node_modules/@appport/protocol/dist/blob.js +23 -0
  235. package/node_modules/@appport/protocol/dist/blob.js.map +1 -0
  236. package/node_modules/@appport/protocol/dist/compatibility.d.ts +25 -0
  237. package/node_modules/@appport/protocol/dist/compatibility.d.ts.map +1 -0
  238. package/node_modules/@appport/protocol/dist/compatibility.js +189 -0
  239. package/node_modules/@appport/protocol/dist/compatibility.js.map +1 -0
  240. package/node_modules/@appport/protocol/dist/envelopes.d.ts +175 -0
  241. package/node_modules/@appport/protocol/dist/envelopes.d.ts.map +1 -0
  242. package/node_modules/@appport/protocol/dist/envelopes.js +97 -0
  243. package/node_modules/@appport/protocol/dist/envelopes.js.map +1 -0
  244. package/node_modules/@appport/protocol/dist/errors.d.ts +74 -0
  245. package/node_modules/@appport/protocol/dist/errors.d.ts.map +1 -0
  246. package/node_modules/@appport/protocol/dist/errors.js +91 -0
  247. package/node_modules/@appport/protocol/dist/errors.js.map +1 -0
  248. package/node_modules/@appport/protocol/dist/ids.d.ts +12 -0
  249. package/node_modules/@appport/protocol/dist/ids.d.ts.map +1 -0
  250. package/node_modules/@appport/protocol/dist/ids.js +50 -0
  251. package/node_modules/@appport/protocol/dist/ids.js.map +1 -0
  252. package/node_modules/@appport/protocol/dist/index.d.ts +20 -0
  253. package/node_modules/@appport/protocol/dist/index.d.ts.map +1 -0
  254. package/node_modules/@appport/protocol/dist/index.js +20 -0
  255. package/node_modules/@appport/protocol/dist/index.js.map +1 -0
  256. package/node_modules/@appport/protocol/dist/jsonschema.d.ts +50 -0
  257. package/node_modules/@appport/protocol/dist/jsonschema.d.ts.map +1 -0
  258. package/node_modules/@appport/protocol/dist/jsonschema.js +6 -0
  259. package/node_modules/@appport/protocol/dist/jsonschema.js.map +1 -0
  260. package/node_modules/@appport/protocol/dist/manifest.d.ts +131 -0
  261. package/node_modules/@appport/protocol/dist/manifest.d.ts.map +1 -0
  262. package/node_modules/@appport/protocol/dist/manifest.js +20 -0
  263. package/node_modules/@appport/protocol/dist/manifest.js.map +1 -0
  264. package/node_modules/@appport/protocol/dist/names.d.ts +26 -0
  265. package/node_modules/@appport/protocol/dist/names.d.ts.map +1 -0
  266. package/node_modules/@appport/protocol/dist/names.js +85 -0
  267. package/node_modules/@appport/protocol/dist/names.js.map +1 -0
  268. package/node_modules/@appport/protocol/dist/operations.d.ts +34 -0
  269. package/node_modules/@appport/protocol/dist/operations.d.ts.map +1 -0
  270. package/node_modules/@appport/protocol/dist/operations.js +9 -0
  271. package/node_modules/@appport/protocol/dist/operations.js.map +1 -0
  272. package/node_modules/@appport/protocol/dist/session.d.ts +27 -0
  273. package/node_modules/@appport/protocol/dist/session.d.ts.map +1 -0
  274. package/node_modules/@appport/protocol/dist/session.js +7 -0
  275. package/node_modules/@appport/protocol/dist/session.js.map +1 -0
  276. package/node_modules/@appport/protocol/dist/validate.d.ts +37 -0
  277. package/node_modules/@appport/protocol/dist/validate.d.ts.map +1 -0
  278. package/node_modules/@appport/protocol/dist/validate.js +321 -0
  279. package/node_modules/@appport/protocol/dist/validate.js.map +1 -0
  280. package/node_modules/@appport/protocol/dist/version.d.ts +27 -0
  281. package/node_modules/@appport/protocol/dist/version.d.ts.map +1 -0
  282. package/node_modules/@appport/protocol/dist/version.js +26 -0
  283. package/node_modules/@appport/protocol/dist/version.js.map +1 -0
  284. package/node_modules/@appport/protocol/package.json +25 -0
  285. package/node_modules/@appport/schema/README.md +32 -0
  286. package/node_modules/@appport/schema/dist/builder.d.ts +85 -0
  287. package/node_modules/@appport/schema/dist/builder.d.ts.map +1 -0
  288. package/node_modules/@appport/schema/dist/builder.js +278 -0
  289. package/node_modules/@appport/schema/dist/builder.js.map +1 -0
  290. package/node_modules/@appport/schema/dist/from-json-schema.d.ts +12 -0
  291. package/node_modules/@appport/schema/dist/from-json-schema.d.ts.map +1 -0
  292. package/node_modules/@appport/schema/dist/from-json-schema.js +186 -0
  293. package/node_modules/@appport/schema/dist/from-json-schema.js.map +1 -0
  294. package/node_modules/@appport/schema/dist/index.d.ts +23 -0
  295. package/node_modules/@appport/schema/dist/index.d.ts.map +1 -0
  296. package/node_modules/@appport/schema/dist/index.js +22 -0
  297. package/node_modules/@appport/schema/dist/index.js.map +1 -0
  298. package/node_modules/@appport/schema/dist/standard.d.ts +46 -0
  299. package/node_modules/@appport/schema/dist/standard.d.ts.map +1 -0
  300. package/node_modules/@appport/schema/dist/standard.js +42 -0
  301. package/node_modules/@appport/schema/dist/standard.js.map +1 -0
  302. package/node_modules/@appport/schema/dist/types.d.ts +40 -0
  303. package/node_modules/@appport/schema/dist/types.d.ts.map +1 -0
  304. package/node_modules/@appport/schema/dist/types.js +19 -0
  305. package/node_modules/@appport/schema/dist/types.js.map +1 -0
  306. package/node_modules/@appport/schema/package.json +28 -0
  307. package/node_modules/@appport/server/README.md +39 -0
  308. package/node_modules/@appport/server/dist/connection.d.ts +45 -0
  309. package/node_modules/@appport/server/dist/connection.d.ts.map +1 -0
  310. package/node_modules/@appport/server/dist/connection.js +217 -0
  311. package/node_modules/@appport/server/dist/connection.js.map +1 -0
  312. package/node_modules/@appport/server/dist/fetch.d.ts +10 -0
  313. package/node_modules/@appport/server/dist/fetch.d.ts.map +1 -0
  314. package/node_modules/@appport/server/dist/fetch.js +50 -0
  315. package/node_modules/@appport/server/dist/fetch.js.map +1 -0
  316. package/node_modules/@appport/server/dist/http.d.ts +80 -0
  317. package/node_modules/@appport/server/dist/http.d.ts.map +1 -0
  318. package/node_modules/@appport/server/dist/http.js +306 -0
  319. package/node_modules/@appport/server/dist/http.js.map +1 -0
  320. package/node_modules/@appport/server/dist/index.d.ts +11 -0
  321. package/node_modules/@appport/server/dist/index.d.ts.map +1 -0
  322. package/node_modules/@appport/server/dist/index.js +11 -0
  323. package/node_modules/@appport/server/dist/index.js.map +1 -0
  324. package/node_modules/@appport/server/dist/node-entry.d.ts +4 -0
  325. package/node_modules/@appport/server/dist/node-entry.d.ts.map +1 -0
  326. package/node_modules/@appport/server/dist/node-entry.js +4 -0
  327. package/node_modules/@appport/server/dist/node-entry.js.map +1 -0
  328. package/node_modules/@appport/server/dist/node.d.ts +45 -0
  329. package/node_modules/@appport/server/dist/node.d.ts.map +1 -0
  330. package/node_modules/@appport/server/dist/node.js +190 -0
  331. package/node_modules/@appport/server/dist/node.js.map +1 -0
  332. package/node_modules/@appport/server/dist/server.d.ts +83 -0
  333. package/node_modules/@appport/server/dist/server.d.ts.map +1 -0
  334. package/node_modules/@appport/server/dist/server.js +114 -0
  335. package/node_modules/@appport/server/dist/server.js.map +1 -0
  336. package/node_modules/@appport/server/dist/websocket.d.ts +25 -0
  337. package/node_modules/@appport/server/dist/websocket.d.ts.map +1 -0
  338. package/node_modules/@appport/server/dist/websocket.js +221 -0
  339. package/node_modules/@appport/server/dist/websocket.js.map +1 -0
  340. package/node_modules/@appport/server/package.json +34 -0
  341. package/node_modules/@appport/transport-electron/README.md +56 -0
  342. package/node_modules/@appport/transport-electron/dist/index.d.ts +11 -0
  343. package/node_modules/@appport/transport-electron/dist/index.d.ts.map +1 -0
  344. package/node_modules/@appport/transport-electron/dist/index.js +11 -0
  345. package/node_modules/@appport/transport-electron/dist/index.js.map +1 -0
  346. package/node_modules/@appport/transport-electron/dist/main.d.ts +31 -0
  347. package/node_modules/@appport/transport-electron/dist/main.d.ts.map +1 -0
  348. package/node_modules/@appport/transport-electron/dist/main.js +61 -0
  349. package/node_modules/@appport/transport-electron/dist/main.js.map +1 -0
  350. package/node_modules/@appport/transport-electron/dist/preload.d.ts +22 -0
  351. package/node_modules/@appport/transport-electron/dist/preload.d.ts.map +1 -0
  352. package/node_modules/@appport/transport-electron/dist/preload.js +29 -0
  353. package/node_modules/@appport/transport-electron/dist/preload.js.map +1 -0
  354. package/node_modules/@appport/transport-electron/dist/renderer.d.ts +16 -0
  355. package/node_modules/@appport/transport-electron/dist/renderer.d.ts.map +1 -0
  356. package/node_modules/@appport/transport-electron/dist/renderer.js +36 -0
  357. package/node_modules/@appport/transport-electron/dist/renderer.js.map +1 -0
  358. package/node_modules/@appport/transport-electron/dist/types.d.ts +49 -0
  359. package/node_modules/@appport/transport-electron/dist/types.d.ts.map +1 -0
  360. package/node_modules/@appport/transport-electron/dist/types.js +5 -0
  361. package/node_modules/@appport/transport-electron/dist/types.js.map +1 -0
  362. package/node_modules/@appport/transport-electron/package.json +46 -0
  363. package/node_modules/@appport/transport-http/README.md +24 -0
  364. package/node_modules/@appport/transport-http/dist/index.d.ts +18 -0
  365. package/node_modules/@appport/transport-http/dist/index.d.ts.map +1 -0
  366. package/node_modules/@appport/transport-http/dist/index.js +223 -0
  367. package/node_modules/@appport/transport-http/dist/index.js.map +1 -0
  368. package/node_modules/@appport/transport-http/package.json +29 -0
  369. package/node_modules/@appport/transport-inprocess/README.md +24 -0
  370. package/node_modules/@appport/transport-inprocess/dist/index.d.ts +16 -0
  371. package/node_modules/@appport/transport-inprocess/dist/index.d.ts.map +1 -0
  372. package/node_modules/@appport/transport-inprocess/dist/index.js +30 -0
  373. package/node_modules/@appport/transport-inprocess/dist/index.js.map +1 -0
  374. package/node_modules/@appport/transport-inprocess/package.json +30 -0
  375. package/node_modules/@appport/transport-tauri/README.md +45 -0
  376. package/node_modules/@appport/transport-tauri/dist/index.d.ts +23 -0
  377. package/node_modules/@appport/transport-tauri/dist/index.d.ts.map +1 -0
  378. package/node_modules/@appport/transport-tauri/dist/index.js +44 -0
  379. package/node_modules/@appport/transport-tauri/dist/index.js.map +1 -0
  380. package/node_modules/@appport/transport-tauri/package.json +29 -0
  381. package/node_modules/@appport/transport-websocket/README.md +22 -0
  382. package/node_modules/@appport/transport-websocket/dist/index.d.ts +26 -0
  383. package/node_modules/@appport/transport-websocket/dist/index.d.ts.map +1 -0
  384. package/node_modules/@appport/transport-websocket/dist/index.js +72 -0
  385. package/node_modules/@appport/transport-websocket/dist/index.js.map +1 -0
  386. package/node_modules/@appport/transport-websocket/package.json +29 -0
  387. package/package.json +79 -0
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Application State Context & Transaction (PR27)
3
+ *
4
+ * Establishes the invariant:
5
+ * WASM execution is ephemeral; application state is durable.
6
+ *
7
+ * The ApplicationStateContext is the contract available to one invocation.
8
+ * It provides typed state access with isolation, authorization, and transaction semantics.
9
+ *
10
+ * State is scoped to:
11
+ * - Application identity (owns the state)
12
+ * - Invocation identity (unique per execution)
13
+ * - Transaction identity (unique per invocation)
14
+ *
15
+ * State operations:
16
+ * - get(key): Read value, observing transaction writes
17
+ * - set(key, value): Write value, isolated until commit
18
+ * - delete(key): Remove value, isolated until commit
19
+ * - query(pattern): Search state by key pattern
20
+ *
21
+ * Transaction lifecycle:
22
+ * - OPEN: Accepts reads and writes
23
+ * - COMMITTED: Durable, no mutations allowed
24
+ * - ABORTED: Discarded, no mutations allowed
25
+ */
26
+ /**
27
+ * Application state transaction lifecycle.
28
+ *
29
+ * Explicit state machine:
30
+ * OPEN → COMMITTED
31
+ * → ABORTED
32
+ *
33
+ * Invariants:
34
+ * - Transition to COMMITTED or ABORTED is explicit
35
+ * - No implicit auto-commit
36
+ * - Committed transactions cannot be mutated
37
+ * - Aborted transactions cannot be mutated
38
+ * - Both commit and abort are idempotent
39
+ * - Transaction identity is unique per invocation
40
+ */
41
+ export var ApplicationStateTransactionState;
42
+ (function (ApplicationStateTransactionState) {
43
+ /**
44
+ * Transaction is open and accepting operations.
45
+ * Reads and writes are allowed.
46
+ */
47
+ ApplicationStateTransactionState["OPEN"] = "OPEN";
48
+ /**
49
+ * Transaction has been committed durably.
50
+ * All writes are now visible to subsequent transactions.
51
+ * No further mutations are allowed.
52
+ */
53
+ ApplicationStateTransactionState["COMMITTED"] = "COMMITTED";
54
+ /**
55
+ * Transaction has been aborted.
56
+ * All writes have been discarded.
57
+ * No further mutations are allowed.
58
+ */
59
+ ApplicationStateTransactionState["ABORTED"] = "ABORTED";
60
+ })(ApplicationStateTransactionState || (ApplicationStateTransactionState = {}));
61
+ /**
62
+ * State operation error: operation rejected by authorization or state.
63
+ */
64
+ export class StateOperationError extends Error {
65
+ message;
66
+ code;
67
+ constructor(message, code = "other") {
68
+ super(`State operation failed: ${message}`);
69
+ this.message = message;
70
+ this.code = code;
71
+ this.name = "StateOperationError";
72
+ }
73
+ }
74
+ /**
75
+ * Transaction state error: operation attempted in wrong transaction state.
76
+ */
77
+ export class TransactionStateError extends Error {
78
+ currentState;
79
+ attemptedOperation;
80
+ constructor(currentState, attemptedOperation) {
81
+ super(`Transaction state error: Cannot ${attemptedOperation} in ${currentState} state`);
82
+ this.currentState = currentState;
83
+ this.attemptedOperation = attemptedOperation;
84
+ this.name = "TransactionStateError";
85
+ }
86
+ }
87
+ /**
88
+ * Commit failure error: transaction commit failed.
89
+ */
90
+ export class CommitFailureError extends Error {
91
+ transactionId;
92
+ message;
93
+ constructor(transactionId, message) {
94
+ super(`Commit failed for transaction ${transactionId}: ${message}`);
95
+ this.transactionId = transactionId;
96
+ this.message = message;
97
+ this.name = "CommitFailureError";
98
+ }
99
+ }
100
+ //# sourceMappingURL=state-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state-context.js","sourceRoot":"","sources":["../src/state-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAuFH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAN,IAAY,gCAoBX;AApBD,WAAY,gCAAgC;IAC1C;;;OAGG;IACH,iDAAa,CAAA;IAEb;;;;OAIG;IACH,2DAAuB,CAAA;IAEvB;;;;OAIG;IACH,uDAAmB,CAAA;AACrB,CAAC,EApBW,gCAAgC,KAAhC,gCAAgC,QAoB3C;AAyED;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAEjB;IACT;IAFlB,YAC2B,OAAe,EACxB,OAAkF,OAAO;QAEzG,KAAK,CAAC,2BAA2B,OAAO,EAAE,CAAC,CAAC;QAHnB,YAAO,GAAP,OAAO,CAAQ;QACxB,SAAI,GAAJ,IAAI,CAAqF;QAGzG,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAE5B;IACA;IAFlB,YACkB,YAA8C,EAC9C,kBAA0B;QAE1C,KAAK,CAAC,mCAAmC,kBAAkB,OAAO,YAAY,QAAQ,CAAC,CAAC;QAHxE,iBAAY,GAAZ,YAAY,CAAkC;QAC9C,uBAAkB,GAAlB,kBAAkB,CAAQ;QAG1C,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAEzB;IACS;IAF3B,YACkB,aAAqB,EACZ,OAAe;QAExC,KAAK,CAAC,iCAAiC,aAAa,KAAK,OAAO,EAAE,CAAC,CAAC;QAHpD,kBAAa,GAAb,aAAa,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QAGxC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Application State & Registration (PR20)
3
+ *
4
+ * Durable application state representation and registration lifecycle.
5
+ *
6
+ * An ApplicationState represents a registered, tracked application:
7
+ * - Identity (id, name, version)
8
+ * - Manifest (canonical contract)
9
+ * - Fingerprint (contract hash)
10
+ * - Verification state
11
+ * - Lifecycle state
12
+ * - Revision tracking
13
+ * - History/timestamps
14
+ *
15
+ * CRITICAL INVARIANT: ApplicationState contains NO implementation details.
16
+ * No functions, handlers, closures, runtime objects, or credentials.
17
+ */
18
+ import type { ApplicationManifest, ApplicationIdentity } from "./manifest.js";
19
+ import type { VerificationResult } from "./assembly.js";
20
+ /**
21
+ * Application lifecycle states.
22
+ *
23
+ * - "registered": Application has been successfully registered
24
+ * - "active": Application is operational and available
25
+ * - "retired": Application has been deprecated/removed
26
+ */
27
+ export type ApplicationLifecycleState = "registered" | "active" | "retired";
28
+ /**
29
+ * Durable application state: captures everything AppBoundry knows about
30
+ * an application without requiring its implementation to be present.
31
+ *
32
+ * This is suitable for storage, discovery, and transmission without
33
+ * exposing implementation details.
34
+ */
35
+ export interface ApplicationState {
36
+ /** Unique identity for this continuous registration incarnation. */
37
+ readonly registrationId: string;
38
+ /** Unique application identifier. */
39
+ readonly id: string;
40
+ /** Human-readable application name. */
41
+ readonly name: string;
42
+ /** Semantic version. */
43
+ readonly version: string;
44
+ /** Canonical application manifest (the application's contract). */
45
+ readonly manifest: ApplicationManifest;
46
+ /** SHA256 fingerprint of canonical manifest. */
47
+ readonly fingerprint: string;
48
+ /** Verification result at time of registration. */
49
+ readonly verification: {
50
+ readonly ready: boolean;
51
+ readonly errorCount: number;
52
+ readonly warningCount: number;
53
+ };
54
+ /** Application lifecycle state. */
55
+ readonly status: ApplicationLifecycleState;
56
+ /** Revision number (incremented on each update). */
57
+ readonly revision: number;
58
+ /** ISO 8601 timestamp when first registered. */
59
+ readonly createdAt: string;
60
+ /** ISO 8601 timestamp of last update. */
61
+ readonly updatedAt: string;
62
+ }
63
+ /**
64
+ * Options for registering a verified application.
65
+ */
66
+ export interface RegisterApplicationOptions {
67
+ /** The verified application identity. */
68
+ identity: ApplicationIdentity;
69
+ /** The canonical manifest (PR19). */
70
+ manifest: ApplicationManifest;
71
+ /** The fingerprint hash (PR19). */
72
+ fingerprint: string;
73
+ /** Verification result (PR18). */
74
+ verification: VerificationResult;
75
+ /** Optional initial lifecycle state. Defaults to "registered". */
76
+ status?: ApplicationLifecycleState;
77
+ }
78
+ /**
79
+ * Create an ApplicationState from registration options.
80
+ * Used internally during registration process.
81
+ */
82
+ export declare function createApplicationState(options: RegisterApplicationOptions, revision?: number): ApplicationState;
83
+ /**
84
+ * Update application state with new manifest and verification.
85
+ * Used for revision updates.
86
+ */
87
+ export declare function updateApplicationState(existing: ApplicationState, options: Omit<RegisterApplicationOptions, "identity">): ApplicationState;
88
+ /**
89
+ * Lifecycle state transition: mark application as active.
90
+ */
91
+ export declare function markApplicationActive(state: ApplicationState): ApplicationState;
92
+ /**
93
+ * Lifecycle state transition: retire application.
94
+ */
95
+ export declare function retireApplication(state: ApplicationState): ApplicationState;
96
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,uCAAuC;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,wBAAwB;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC;IAEvC,gDAAgD;IAChD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,mDAAmD;IACnD,QAAQ,CAAC,YAAY,EAAE;QACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;QACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;KAC/B,CAAC;IAEF,mCAAmC;IACnC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAE3C,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,gDAAgD;IAChD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,yCAAyC;IACzC,QAAQ,EAAE,mBAAmB,CAAC;IAE9B,qCAAqC;IACrC,QAAQ,EAAE,mBAAmB,CAAC;IAE9B,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IAEpB,kCAAkC;IAClC,YAAY,EAAE,kBAAkB,CAAC;IAEjC,kEAAkE;IAClE,MAAM,CAAC,EAAE,yBAAyB,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,0BAA0B,EACnC,QAAQ,GAAE,MAAU,GACnB,gBAAgB,CAoBlB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,IAAI,CAAC,0BAA0B,EAAE,UAAU,CAAC,GACpD,gBAAgB,CAgBlB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAQ/E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,CAQ3E"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Application State & Registration (PR20)
3
+ *
4
+ * Durable application state representation and registration lifecycle.
5
+ *
6
+ * An ApplicationState represents a registered, tracked application:
7
+ * - Identity (id, name, version)
8
+ * - Manifest (canonical contract)
9
+ * - Fingerprint (contract hash)
10
+ * - Verification state
11
+ * - Lifecycle state
12
+ * - Revision tracking
13
+ * - History/timestamps
14
+ *
15
+ * CRITICAL INVARIANT: ApplicationState contains NO implementation details.
16
+ * No functions, handlers, closures, runtime objects, or credentials.
17
+ */
18
+ import { randomUUID } from "node:crypto";
19
+ /**
20
+ * Create an ApplicationState from registration options.
21
+ * Used internally during registration process.
22
+ */
23
+ export function createApplicationState(options, revision = 1) {
24
+ const now = new Date().toISOString();
25
+ return {
26
+ registrationId: `reg_${randomUUID()}`,
27
+ id: options.identity.id,
28
+ name: options.identity.name,
29
+ version: options.identity.version,
30
+ manifest: options.manifest,
31
+ fingerprint: options.fingerprint,
32
+ verification: {
33
+ ready: options.verification.ready,
34
+ errorCount: options.verification.errors.length,
35
+ warningCount: options.verification.warnings.length
36
+ },
37
+ status: options.status ?? "registered",
38
+ revision,
39
+ createdAt: now,
40
+ updatedAt: now
41
+ };
42
+ }
43
+ /**
44
+ * Update application state with new manifest and verification.
45
+ * Used for revision updates.
46
+ */
47
+ export function updateApplicationState(existing, options) {
48
+ const now = new Date().toISOString();
49
+ return {
50
+ ...existing,
51
+ manifest: options.manifest,
52
+ fingerprint: options.fingerprint,
53
+ verification: {
54
+ ready: options.verification.ready,
55
+ errorCount: options.verification.errors.length,
56
+ warningCount: options.verification.warnings.length
57
+ },
58
+ status: options.status ?? existing.status,
59
+ revision: existing.revision + 1,
60
+ updatedAt: now
61
+ };
62
+ }
63
+ /**
64
+ * Lifecycle state transition: mark application as active.
65
+ */
66
+ export function markApplicationActive(state) {
67
+ if (state.status === "active")
68
+ return state;
69
+ return {
70
+ ...state,
71
+ status: "active",
72
+ revision: state.revision + 1,
73
+ updatedAt: new Date().toISOString()
74
+ };
75
+ }
76
+ /**
77
+ * Lifecycle state transition: retire application.
78
+ */
79
+ export function retireApplication(state) {
80
+ if (state.status === "retired")
81
+ return state;
82
+ return {
83
+ ...state,
84
+ status: "retired",
85
+ revision: state.revision + 1,
86
+ updatedAt: new Date().toISOString()
87
+ };
88
+ }
89
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA+EzC;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAmC,EACnC,WAAmB,CAAC;IAEpB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAErC,OAAO;QACL,cAAc,EAAE,OAAO,UAAU,EAAE,EAAE;QACrC,EAAE,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE;QACvB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;QAC3B,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO;QACjC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,YAAY,EAAE;YACZ,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK;YACjC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM;YAC9C,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM;SACnD;QACD,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,YAAY;QACtC,QAAQ;QACR,SAAS,EAAE,GAAG;QACd,SAAS,EAAE,GAAG;KACf,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAA0B,EAC1B,OAAqD;IAErD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAErC,OAAO;QACL,GAAG,QAAQ;QACX,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,YAAY,EAAE;YACZ,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK;YACjC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM;YAC9C,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM;SACnD;QACD,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM;QACzC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,GAAG,CAAC;QAC/B,SAAS,EAAE,GAAG;KACf,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAuB;IAC3D,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,OAAO;QACL,GAAG,KAAK;QACR,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC;QAC5B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB;IACvD,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC7C,OAAO;QACL,GAAG,KAAK;QACR,MAAM,EAAE,SAAS;QACjB,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,CAAC;QAC5B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { AppPortError } from "@appport/protocol";
2
+ /**
3
+ * A bounded async channel: the plumbing behind capability streams (§20).
4
+ *
5
+ * `push` resolves once the value is buffered below the high-water mark, which
6
+ * gives handlers natural backpressure without exposing transport details.
7
+ */
8
+ export declare class AsyncChannel<T> implements AsyncIterable<T> {
9
+ #private;
10
+ constructor(highWaterMark?: number);
11
+ get closed(): boolean;
12
+ get size(): number;
13
+ push(value: T): Promise<void>;
14
+ end(): void;
15
+ fail(reason: unknown): void;
16
+ [Symbol.asyncIterator](): AsyncIterator<T>;
17
+ }
18
+ /**
19
+ * The stream handle exposed to capability handlers through
20
+ * `context.createStream()` (§10). It is itself an async iterable, so a handler
21
+ * can create it, hand the writer half to some producer and return it.
22
+ */
23
+ export interface StreamContext<Chunk = unknown> extends AsyncIterable<Chunk> {
24
+ /** Emits one chunk. Resolves when the consumer has room for more. */
25
+ write(chunk: Chunk): Promise<void>;
26
+ /** Completes the stream normally. */
27
+ end(): void;
28
+ /** Terminates the stream with an error. */
29
+ fail(error: unknown): void;
30
+ /** Aborted when the client cancels or the connection drops (§21). */
31
+ readonly signal: AbortSignal;
32
+ readonly closed: boolean;
33
+ }
34
+ export declare function createStreamContext<Chunk>(signal: AbortSignal, highWaterMark?: number): StreamContext<Chunk>;
35
+ export declare function abortReason(signal: AbortSignal): AppPortError;
36
+ /** Turns any iterable, sync or async, into an async iterable. */
37
+ export declare function toAsyncIterable<T>(source: AsyncIterable<T> | Iterable<T>): AsyncIterable<T>;
38
+ //# sourceMappingURL=streams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAC;AAEzD;;;;;GAKG;AACH,qBAAa,YAAY,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;;gBAS1C,aAAa,SAAK;IAI9B,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAEK,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAcnC,GAAG,IAAI,IAAI;IAUX,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAgBpB,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC;CAqBlD;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa,CAAC,KAAK,GAAG,OAAO,CAAE,SAAQ,aAAa,CAAC,KAAK,CAAC;IAC1E,qEAAqE;IACrE,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,qCAAqC;IACrC,GAAG,IAAI,IAAI,CAAC;IACZ,2CAA2C;IAC3C,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,qEAAqE;IACrE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,SAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAgBxG;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,YAAY,CAI7D;AAED,iEAAiE;AACjE,wBAAuB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAMlG"}
@@ -0,0 +1,123 @@
1
+ import { AppPortError, errors } from "@appport/protocol";
2
+ /**
3
+ * A bounded async channel: the plumbing behind capability streams (§20).
4
+ *
5
+ * `push` resolves once the value is buffered below the high-water mark, which
6
+ * gives handlers natural backpressure without exposing transport details.
7
+ */
8
+ export class AsyncChannel {
9
+ #queue = [];
10
+ #pending = [];
11
+ #rejects = [];
12
+ #drain = [];
13
+ #highWaterMark;
14
+ #closed = false;
15
+ #failure;
16
+ constructor(highWaterMark = 64) {
17
+ this.#highWaterMark = Math.max(1, highWaterMark);
18
+ }
19
+ get closed() {
20
+ return this.#closed;
21
+ }
22
+ get size() {
23
+ return this.#queue.length;
24
+ }
25
+ async push(value) {
26
+ if (this.#closed)
27
+ throw errors.streamError("Stream is already closed");
28
+ const waiter = this.#pending.shift();
29
+ if (waiter) {
30
+ this.#rejects.shift();
31
+ waiter({ value, done: false });
32
+ return;
33
+ }
34
+ this.#queue.push(value);
35
+ if (this.#queue.length >= this.#highWaterMark) {
36
+ await new Promise((resolve) => this.#drain.push(resolve));
37
+ }
38
+ }
39
+ end() {
40
+ if (this.#closed)
41
+ return;
42
+ this.#closed = true;
43
+ while (this.#pending.length) {
44
+ this.#rejects.shift();
45
+ this.#pending.shift()({ value: undefined, done: true });
46
+ }
47
+ this.#releaseDrain();
48
+ }
49
+ fail(reason) {
50
+ if (this.#closed)
51
+ return;
52
+ this.#closed = true;
53
+ this.#failure = reason;
54
+ while (this.#pending.length) {
55
+ this.#pending.shift();
56
+ const reject = this.#rejects.shift();
57
+ reject?.(reason);
58
+ }
59
+ this.#releaseDrain();
60
+ }
61
+ #releaseDrain() {
62
+ while (this.#drain.length)
63
+ this.#drain.shift()();
64
+ }
65
+ async *[Symbol.asyncIterator]() {
66
+ for (;;) {
67
+ if (this.#queue.length > 0) {
68
+ const value = this.#queue.shift();
69
+ this.#releaseDrain();
70
+ yield value;
71
+ continue;
72
+ }
73
+ if (this.#failure !== undefined)
74
+ throw this.#failure;
75
+ if (this.#closed)
76
+ return;
77
+ const next = await new Promise((resolve, reject) => {
78
+ this.#pending.push(resolve);
79
+ this.#rejects.push(reject);
80
+ });
81
+ if (next.done) {
82
+ if (this.#failure !== undefined)
83
+ throw this.#failure;
84
+ return;
85
+ }
86
+ yield next.value;
87
+ }
88
+ }
89
+ }
90
+ export function createStreamContext(signal, highWaterMark = 64) {
91
+ const channel = new AsyncChannel(highWaterMark);
92
+ const onAbort = () => channel.fail(abortReason(signal));
93
+ if (signal.aborted)
94
+ queueMicrotask(onAbort);
95
+ else
96
+ signal.addEventListener("abort", onAbort, { once: true });
97
+ return {
98
+ write: (chunk) => channel.push(chunk),
99
+ end: () => channel.end(),
100
+ fail: (error) => channel.fail(error),
101
+ signal,
102
+ get closed() {
103
+ return channel.closed;
104
+ },
105
+ [Symbol.asyncIterator]: () => channel[Symbol.asyncIterator]()
106
+ };
107
+ }
108
+ export function abortReason(signal) {
109
+ const reason = signal.reason;
110
+ if (AppPortError.is(reason))
111
+ return reason;
112
+ return errors.cancelled();
113
+ }
114
+ /** Turns any iterable, sync or async, into an async iterable. */
115
+ export async function* toAsyncIterable(source) {
116
+ if (Symbol.asyncIterator in source) {
117
+ yield* source;
118
+ return;
119
+ }
120
+ for (const value of source)
121
+ yield value;
122
+ }
123
+ //# sourceMappingURL=streams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streams.js","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,42 @@
1
+ import type { ErrorCode } from "@appport/protocol";
2
+ /**
3
+ * Structured telemetry for one dispatched request (specification §53).
4
+ *
5
+ * The record carries identifiers and outcomes — never credentials, tokens or
6
+ * payload bodies. Implementations that want payload capture must opt in
7
+ * explicitly and are responsible for redaction.
8
+ */
9
+ export interface TelemetryRecord {
10
+ requestId: string;
11
+ traceId: string;
12
+ applicationId: string;
13
+ capability: string;
14
+ version: number;
15
+ kind: "request" | "stream";
16
+ transport: string;
17
+ /** Principal identifier, when a principal is present. Never a credential. */
18
+ principal?: string;
19
+ sessionId?: string;
20
+ startTime: number;
21
+ durationMs: number;
22
+ success: boolean;
23
+ errorCode?: ErrorCode;
24
+ /** Chunks emitted, for stream capabilities. */
25
+ chunks?: number;
26
+ /** True when the response was served from the idempotency store (§44). */
27
+ idempotentReplay?: boolean;
28
+ }
29
+ export interface TelemetrySink {
30
+ record(entry: TelemetryRecord): void;
31
+ }
32
+ export declare const noopTelemetry: TelemetrySink;
33
+ /** Collects records in memory. Useful in tests and in `appport dev`. */
34
+ export declare class MemoryTelemetry implements TelemetrySink {
35
+ #private;
36
+ readonly entries: TelemetryRecord[];
37
+ constructor(limit?: number);
38
+ record(entry: TelemetryRecord): void;
39
+ clear(): void;
40
+ }
41
+ export declare function combineTelemetry(sinks: readonly TelemetrySink[]): TelemetrySink;
42
+ //# sourceMappingURL=telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,aAAa,EAAE,aAAoC,CAAC;AAEjE,wEAAwE;AACxE,qBAAa,eAAgB,YAAW,aAAa;;IACnD,QAAQ,CAAC,OAAO,EAAE,eAAe,EAAE,CAAM;gBAG7B,KAAK,SAAM;IAIvB,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAKpC,KAAK,IAAI,IAAI;CAGd;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,aAAa,CAY/E"}
@@ -0,0 +1,32 @@
1
+ export const noopTelemetry = { record: () => { } };
2
+ /** Collects records in memory. Useful in tests and in `appport dev`. */
3
+ export class MemoryTelemetry {
4
+ entries = [];
5
+ #limit;
6
+ constructor(limit = 500) {
7
+ this.#limit = limit;
8
+ }
9
+ record(entry) {
10
+ this.entries.push(entry);
11
+ if (this.entries.length > this.#limit)
12
+ this.entries.shift();
13
+ }
14
+ clear() {
15
+ this.entries.length = 0;
16
+ }
17
+ }
18
+ export function combineTelemetry(sinks) {
19
+ return {
20
+ record(entry) {
21
+ for (const sink of sinks) {
22
+ try {
23
+ sink.record(entry);
24
+ }
25
+ catch {
26
+ // Telemetry must never break a request.
27
+ }
28
+ }
29
+ }
30
+ };
31
+ }
32
+ //# sourceMappingURL=telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAkCA,MAAM,CAAC,MAAM,aAAa,GAAkB,EAAE,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;AAEjE,wEAAwE;AACxE,MAAM,OAAO,eAAe;IACjB,OAAO,GAAsB,EAAE,CAAC;IACzC,MAAM,CAAS;IAEf,YAAY,KAAK,GAAG,GAAG;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,MAAM,CAAC,KAAsB;QAC3B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM;YAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IAC9D,CAAC;IAED,KAAK;QACH,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,UAAU,gBAAgB,CAAC,KAA+B;IAC9D,OAAO;QACL,MAAM,CAAC,KAAK;YACV,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;gBACzB,IAAI,CAAC;oBACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACrB,CAAC;gBAAC,MAAM,CAAC;oBACP,wCAAwC;gBAC1C,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * WASM Execution Engine Implementation (PR26)
3
+ *
4
+ * Materializes ExecutableArtifacts into ephemeral WASM instances.
5
+ * Uses Node.js native WebAssembly API with managed resource limits.
6
+ */
7
+ import type { ExecutableArtifact } from "./artifact.js";
8
+ import { type AuthorizedCapabilityBinding } from "./binding.js";
9
+ import type { CapabilityContext } from "./context.js";
10
+ import { type ExecutionInstance, type ExecutionInstanceResult, type ExecutionEngine, type ExecutionRequest, type ExecutionObservationRecord } from "./execution.js";
11
+ /**
12
+ * WASM Execution Engine: materializes artifacts into ephemeral instances.
13
+ */
14
+ export declare class WasmExecutionEngine implements ExecutionEngine {
15
+ #private;
16
+ execute<TOutput = unknown>(request: ExecutionRequest, context: CapabilityContext): Promise<{
17
+ result: ExecutionInstanceResult<TOutput>;
18
+ observation: ExecutionObservationRecord;
19
+ }>;
20
+ acquireInstance(artifact: ExecutableArtifact, binding: AuthorizedCapabilityBinding, context: CapabilityContext): Promise<ExecutionInstance>;
21
+ }
22
+ //# sourceMappingURL=wasm-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wasm-engine.d.ts","sourceRoot":"","sources":["../src/wasm-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAiC,KAAK,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAI/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAKhC,MAAM,gBAAgB,CAAC;AAkSxB;;GAEG;AACH,qBAAa,mBAAoB,YAAW,eAAe;;IAOnD,OAAO,CAAC,OAAO,GAAG,OAAO,EAC7B,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC;QACT,MAAM,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC;QACzC,WAAW,EAAE,0BAA0B,CAAC;KACzC,CAAC;IA0DI,eAAe,CACnB,QAAQ,EAAE,kBAAkB,EAC5B,OAAO,EAAE,2BAA2B,EACpC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,iBAAiB,CAAC;CA6E9B"}