@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,182 @@
1
+ import { AppPort } from "@appport/client";
2
+ import { AppPortError } from "@appport/protocol";
3
+ export class MobileAppPortClient {
4
+ connection = { state: "disconnected" };
5
+ session;
6
+ #client;
7
+ #options;
8
+ #subscriptions = new Set();
9
+ #stateListeners = new Set();
10
+ #lifecycleRelease;
11
+ #closed = false;
12
+ #reconnecting;
13
+ constructor(options, client) {
14
+ this.#options = options;
15
+ this.#client = client;
16
+ const lifecycle = options.lifecycle;
17
+ if (lifecycle) {
18
+ const subscription = lifecycle.addEventListener("change", (state) => { void this.setLifecycleState(state); });
19
+ this.#lifecycleRelease = () => subscription.remove();
20
+ }
21
+ }
22
+ static async connect(options) {
23
+ validateOptions(options);
24
+ const sessionId = await resolveSessionId(options);
25
+ const client = await AppPort.discover({ origin: options.url, headers: options.headers, fetch: options.fetch, WebSocket: options.WebSocket, sessionId });
26
+ const mobile = new MobileAppPortClient(options, client);
27
+ mobile.#connected(sessionId);
28
+ return capabilitySurface(mobile);
29
+ }
30
+ static discover(options) {
31
+ return MobileAppPortClient.connect({ ...options, url: options.origin });
32
+ }
33
+ get manifest() { return this.#client.manifest; }
34
+ onConnectionState(handler) {
35
+ this.#stateListeners.add(handler);
36
+ return () => this.#stateListeners.delete(handler);
37
+ }
38
+ events = {
39
+ on: async (name, handler) => {
40
+ const entry = { name, handler };
41
+ entry.release = await this.#client.events.subscribe(name, handler);
42
+ this.#subscriptions.add(entry);
43
+ return () => { entry.release?.(); this.#subscriptions.delete(entry); };
44
+ }
45
+ };
46
+ async call(name, input, options) {
47
+ try {
48
+ return await this.#client.call(name, input, options);
49
+ }
50
+ catch (error) {
51
+ if (!retryable(error) || this.#closed)
52
+ throw error;
53
+ await this.reconnect();
54
+ return this.#client.call(name, input, options);
55
+ }
56
+ }
57
+ stream(name, input, options) {
58
+ const underlying = this.#client.stream(name, input, options);
59
+ const self = this;
60
+ return {
61
+ cancel: (reason) => underlying.cancel(reason),
62
+ async *[Symbol.asyncIterator]() {
63
+ try {
64
+ yield* underlying;
65
+ }
66
+ catch (error) {
67
+ if (retryable(error) && !self.#closed)
68
+ void self.reconnect();
69
+ throw error;
70
+ }
71
+ }
72
+ };
73
+ }
74
+ async reconnect() {
75
+ if (this.#closed)
76
+ throw new AppPortError("CANCELLED", "The mobile client is closed");
77
+ if (this.#reconnecting)
78
+ return this.#reconnecting;
79
+ this.#reconnecting = this.#reconnectLoop().finally(() => { this.#reconnecting = undefined; });
80
+ return this.#reconnecting;
81
+ }
82
+ async #reconnectLoop() {
83
+ this.#setState("reconnecting");
84
+ await this.#client.close().catch(() => undefined);
85
+ const delays = this.#options.reconnect?.delaysMs ?? [1_000, 2_000, 4_000, 8_000, 16_000, 30_000];
86
+ let last;
87
+ for (const delay of [0, ...delays]) {
88
+ if (this.#closed)
89
+ return;
90
+ if (delay)
91
+ await wait(delay);
92
+ try {
93
+ const sessionId = await resolveSessionId(this.#options);
94
+ this.#client = await AppPort.discover({ origin: this.#options.url, headers: this.#options.headers, fetch: this.#options.fetch, WebSocket: this.#options.WebSocket, sessionId });
95
+ for (const entry of this.#subscriptions)
96
+ entry.release = await this.#client.events.subscribe(entry.name, entry.handler);
97
+ this.#connected(sessionId);
98
+ return;
99
+ }
100
+ catch (error) {
101
+ last = error;
102
+ }
103
+ }
104
+ this.#setState("disconnected");
105
+ throw new AppPortError("INTERNAL_ERROR", "Mobile reconnect attempts were exhausted", { retryable: true, cause: last });
106
+ }
107
+ async setLifecycleState(state) {
108
+ if (state === "active") {
109
+ if (!this.#closed && this.connection.state !== "connected")
110
+ await this.reconnect();
111
+ return;
112
+ }
113
+ if (state === "background" || state === "inactive") {
114
+ await this.#client.close();
115
+ this.#setState("disconnected");
116
+ }
117
+ }
118
+ async close() {
119
+ this.#closed = true;
120
+ this.#lifecycleRelease?.();
121
+ for (const entry of this.#subscriptions)
122
+ entry.release?.();
123
+ this.#subscriptions.clear();
124
+ await this.#client.close();
125
+ this.#setState("closed");
126
+ }
127
+ #connected(sessionId) {
128
+ this.#setState("connected");
129
+ this.session = { sessionId, applicationId: this.#client.manifest.application.id, connectedAt: new Date().toISOString(), transport: this.#client.transport.kind, state: "connected" };
130
+ }
131
+ #setState(state) {
132
+ this.connection.state = state;
133
+ if (this.session)
134
+ this.session.state = state;
135
+ for (const listener of this.#stateListeners)
136
+ listener(state);
137
+ }
138
+ }
139
+ function capabilitySurface(client) {
140
+ return new Proxy(client, {
141
+ get(target, property, receiver) {
142
+ // An async factory resolves its return value as a thenable. Capability
143
+ // namespaces must never synthesize a `then` property.
144
+ if (property === "then")
145
+ return undefined;
146
+ if (typeof property !== "string" || property in target) {
147
+ const value = Reflect.get(target, property, receiver);
148
+ return typeof value === "function" ? value.bind(target) : value;
149
+ }
150
+ return capabilityProxy(target, [property]);
151
+ }
152
+ });
153
+ }
154
+ function capabilityProxy(client, path) {
155
+ const invoke = (input, options) => {
156
+ const name = path.join(".");
157
+ return client.manifest?.capabilities.find((entry) => entry.name === name)?.kind === "stream" ? client.stream(name, input, options) : client.call(name, input, options);
158
+ };
159
+ return new Proxy(invoke, { get: (_target, property) => typeof property === "string" ? capabilityProxy(client, [...path, property]) : undefined, apply: (_target, _this, args) => invoke(args[0], args[1]) });
160
+ }
161
+ function validateOptions(options) {
162
+ const url = new URL(options.url);
163
+ if (url.protocol !== "https:" && url.protocol !== "http:")
164
+ throw new AppPortError("INVALID_REQUEST", "Mobile AppPort URLs must use http or https");
165
+ }
166
+ async function resolveSessionId(options, replace = false) {
167
+ if (options.sessionId && !replace)
168
+ return options.sessionId;
169
+ const key = options.storageKey ?? "appport.mobile.session";
170
+ if (!replace) {
171
+ const stored = await options.storage?.getItem(key);
172
+ if (stored)
173
+ return stored;
174
+ }
175
+ const id = `ses_${globalThis.crypto?.randomUUID?.().replaceAll("-", "") ?? Math.random().toString(36).slice(2)}`;
176
+ await options.storage?.setItem(key, id);
177
+ return id;
178
+ }
179
+ const retryable = (error) => error instanceof AppPortError && (error.retryable || error.code === "STREAM_ERROR" || error.code === "INTERNAL_ERROR");
180
+ const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
181
+ export const AppPortMobile = { connect: MobileAppPortClient.connect, discover: MobileAppPortClient.discover };
182
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4E,MAAM,iBAAiB,CAAC;AACpH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAgDjD,MAAM,OAAO,mBAAmB;IACrB,UAAU,GAAG,EAAE,KAAK,EAAE,cAAuC,EAAE,CAAC;IACzE,OAAO,CAA4B;IACnC,OAAO,CAAgB;IACd,QAAQ,CAAuB;IAC/B,cAAc,GAAG,IAAI,GAAG,EAAgB,CAAC;IACzC,eAAe,GAAG,IAAI,GAAG,EAA0C,CAAC;IAC7E,iBAAiB,CAAc;IAC/B,OAAO,GAAG,KAAK,CAAC;IAChB,aAAa,CAAiB;IAE9B,YAAoB,OAA6B,EAAE,MAAqB;QACtE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,SAAS,EAAE,CAAC;YACd,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GAAG,CAAC,KAAc,EAAE,EAAE,CAAC,KAAK,YAAY,YAAY,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,IAAI,KAAK,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC;AAC7J,MAAM,IAAI,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,mBAAmB,CAAC,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "@appport/mobile",
3
+ "version": "1.0.0",
4
+ "description": "Lifecycle-aware AppPort client for React Native, Expo, iOS and Android.",
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
+ "react-native": "./dist/index.js",
11
+ "sideEffects": false,
12
+ "exports": {
13
+ ".": {
14
+ "react-native": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js",
17
+ "default": "./dist/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "README.md"
23
+ ],
24
+ "scripts": {
25
+ "build": "tsc -b",
26
+ "clean": "tsc -b --clean"
27
+ },
28
+ "dependencies": {
29
+ "@appport/client": "1.0.0",
30
+ "@appport/protocol": "1.0.0"
31
+ },
32
+ "private": true
33
+ }
@@ -0,0 +1,41 @@
1
+ # @appport/protocol
2
+
3
+ The AppPort wire contract: envelope types, error codes, naming rules, manifest
4
+ shapes, structural validation and compatibility analysis.
5
+
6
+ This package is pure. It has no runtime dependencies and knows nothing about
7
+ transports, servers or clients — which is what makes it safe to depend on from
8
+ a browser bundle, an Electron preload script or a CLI.
9
+
10
+ ```ts
11
+ import { createRequest, parseClientEnvelope, PROTOCOL_ID } from "@appport/protocol";
12
+
13
+ const request = createRequest({
14
+ requestId: "req_01J...",
15
+ capability: { name: "documents.save", version: 1 },
16
+ input: { documentId: "doc_1", content: "hello" }
17
+ });
18
+
19
+ parseClientEnvelope(request); // throws AppPortError on a malformed envelope
20
+ ```
21
+
22
+ ## What is here
23
+
24
+ | Module | Contents |
25
+ | ---------------- | --------------------------------------------------------------- |
26
+ | `version` | `appport/1`, conformance levels |
27
+ | `envelopes` | request, response, event, subscribe, stream envelopes and guards |
28
+ | `validate` | protocol-level structural validation, decode and encode |
29
+ | `errors` | the standard error codes and `AppPortError` |
30
+ | `names` | capability, event, permission and application-id grammar |
31
+ | `ids` | ULID-based identifier helpers |
32
+ | `manifest` | manifest, discovery and transport descriptor types |
33
+ | `jsonschema` | the JSON Schema subset published in manifests |
34
+ | `session` | `Principal` and `Session` |
35
+ | `operations` | long-running operation records |
36
+ | `blob` | binary references |
37
+ | `compatibility` | breaking vs non-breaking manifest diffing |
38
+
39
+ Names are checked, not merely typed: `electron.documents.save` and
40
+ `ipc.saveDocument` are rejected, because a capability name that encodes a
41
+ transport breaks the protocol's central invariant.
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Binary references (specification §51).
3
+ *
4
+ * AppPort v1 carries references to binary content rather than embedding large
5
+ * blobs in JSON envelopes. Transfer of the bytes themselves is provided by the
6
+ * application or an extension, not by the core protocol.
7
+ */
8
+ export interface BlobRef {
9
+ type: "blob";
10
+ id: string;
11
+ size: number;
12
+ contentType: string;
13
+ /** Optional URL a client may fetch the bytes from, when the deployment offers one. */
14
+ url?: string;
15
+ /** Optional content digest, e.g. `sha256:...`. */
16
+ digest?: string;
17
+ }
18
+ export declare function isBlobRef(value: unknown): value is BlobRef;
19
+ export declare const BLOB_REF_SCHEMA: {
20
+ readonly type: "object";
21
+ readonly title: "BlobRef";
22
+ readonly properties: {
23
+ readonly type: {
24
+ readonly const: "blob";
25
+ };
26
+ readonly id: {
27
+ readonly type: "string";
28
+ };
29
+ readonly size: {
30
+ readonly type: "integer";
31
+ readonly minimum: 0;
32
+ };
33
+ readonly contentType: {
34
+ readonly type: "string";
35
+ };
36
+ readonly url: {
37
+ readonly type: "string";
38
+ };
39
+ readonly digest: {
40
+ readonly type: "string";
41
+ };
42
+ };
43
+ readonly required: readonly ["type", "id", "size", "contentType"];
44
+ readonly additionalProperties: false;
45
+ };
46
+ //# sourceMappingURL=blob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAS1D;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;CAalB,CAAC"}
@@ -0,0 +1,23 @@
1
+ export function isBlobRef(value) {
2
+ return (typeof value === "object" &&
3
+ value !== null &&
4
+ value.type === "blob" &&
5
+ typeof value.id === "string" &&
6
+ typeof value.size === "number" &&
7
+ typeof value.contentType === "string");
8
+ }
9
+ export const BLOB_REF_SCHEMA = {
10
+ type: "object",
11
+ title: "BlobRef",
12
+ properties: {
13
+ type: { const: "blob" },
14
+ id: { type: "string" },
15
+ size: { type: "integer", minimum: 0 },
16
+ contentType: { type: "string" },
17
+ url: { type: "string" },
18
+ digest: { type: "string" }
19
+ },
20
+ required: ["type", "id", "size", "contentType"],
21
+ additionalProperties: false
22
+ };
23
+ //# sourceMappingURL=blob.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob.js","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":"AAkBA,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACb,KAAiB,CAAC,IAAI,KAAK,MAAM;QAClC,OAAQ,KAAiB,CAAC,EAAE,KAAK,QAAQ;QACzC,OAAQ,KAAiB,CAAC,IAAI,KAAK,QAAQ;QAC3C,OAAQ,KAAiB,CAAC,WAAW,KAAK,QAAQ,CACnD,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,SAAS;IAChB,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;QACvB,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACtB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE;QACrC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC/B,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACvB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC3B;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC;IAC/C,oBAAoB,EAAE,KAAK;CACnB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { AppPortManifest } from "./manifest.js";
2
+ /**
3
+ * Backwards-compatibility analysis (specification §43).
4
+ *
5
+ * Adding an optional field, adding a capability or adding a capability version
6
+ * is non-breaking. Removing a required field, removing a capability version,
7
+ * changing a field's type, or tightening authorization is breaking.
8
+ */
9
+ export type ChangeSeverity = "breaking" | "non-breaking";
10
+ export interface ManifestChange {
11
+ severity: ChangeSeverity;
12
+ /** Machine-readable change kind, e.g. `capability.removed`. */
13
+ kind: string;
14
+ /** Where the change applies, e.g. `documents.save@1 input.content`. */
15
+ target: string;
16
+ message: string;
17
+ }
18
+ export interface CompatibilityReport {
19
+ compatible: boolean;
20
+ breaking: ManifestChange[];
21
+ nonBreaking: ManifestChange[];
22
+ }
23
+ /** Compares two manifests and classifies every difference. */
24
+ export declare function compareManifests(previous: AppPortManifest, next: AppPortManifest): CompatibilityReport;
25
+ //# sourceMappingURL=compatibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAA0B,MAAM,eAAe,CAAC;AAG7E;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,cAAc,CAAC;AAEzD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,WAAW,EAAE,cAAc,EAAE,CAAC;CAC/B;AA+HD,8DAA8D;AAC9D,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,GAAG,mBAAmB,CAwFtG"}
@@ -0,0 +1,189 @@
1
+ function typesOf(schema) {
2
+ if (!schema?.type)
3
+ return [];
4
+ return Array.isArray(schema.type) ? [...schema.type].sort() : [schema.type];
5
+ }
6
+ function sameType(a, b) {
7
+ const ta = typesOf(a);
8
+ const tb = typesOf(b);
9
+ if (ta.length !== tb.length)
10
+ return false;
11
+ return ta.every((t, i) => t === tb[i]);
12
+ }
13
+ function compareSchema(previous, next, target, direction, changes) {
14
+ if (!sameType(previous, next)) {
15
+ changes.push({
16
+ severity: "breaking",
17
+ kind: `${direction}.type-changed`,
18
+ target,
19
+ message: `type changed from ${typesOf(previous).join("|") || "any"} to ${typesOf(next).join("|") || "any"}`
20
+ });
21
+ return;
22
+ }
23
+ const previousProps = previous.properties ?? {};
24
+ const nextProps = next.properties ?? {};
25
+ const previousRequired = new Set(previous.required ?? []);
26
+ const nextRequired = new Set(next.required ?? []);
27
+ for (const [key, schema] of Object.entries(previousProps)) {
28
+ const nextSchema = nextProps[key];
29
+ if (!nextSchema) {
30
+ // Removing an input field the client may still send is tolerated for
31
+ // inputs only when it was optional; removing output fields is breaking.
32
+ const wasRequired = previousRequired.has(key);
33
+ changes.push({
34
+ severity: direction === "output" || wasRequired ? "breaking" : "non-breaking",
35
+ kind: `${direction}.field-removed`,
36
+ target: `${target}.${key}`,
37
+ message: `field "${key}" was removed`
38
+ });
39
+ continue;
40
+ }
41
+ compareSchema(schema, nextSchema, `${target}.${key}`, direction, changes);
42
+ }
43
+ for (const key of Object.keys(nextProps)) {
44
+ if (previousProps[key])
45
+ continue;
46
+ const required = nextRequired.has(key);
47
+ if (direction === "input") {
48
+ changes.push({
49
+ severity: required ? "breaking" : "non-breaking",
50
+ kind: "input.field-added",
51
+ target: `${target}.${key}`,
52
+ message: required ? `required field "${key}" was added` : `optional field "${key}" was added`
53
+ });
54
+ }
55
+ else {
56
+ changes.push({
57
+ severity: "non-breaking",
58
+ kind: "output.field-added",
59
+ target: `${target}.${key}`,
60
+ message: `field "${key}" was added`
61
+ });
62
+ }
63
+ }
64
+ for (const key of nextRequired) {
65
+ if (!previousRequired.has(key) && previousProps[key] && direction === "input") {
66
+ changes.push({
67
+ severity: "breaking",
68
+ kind: "input.field-now-required",
69
+ target: `${target}.${key}`,
70
+ message: `optional field "${key}" is now required`
71
+ });
72
+ }
73
+ }
74
+ for (const key of previousRequired) {
75
+ if (!nextRequired.has(key) && nextProps[key] && direction === "output") {
76
+ changes.push({
77
+ severity: "breaking",
78
+ kind: "output.field-now-optional",
79
+ target: `${target}.${key}`,
80
+ message: `guaranteed field "${key}" is no longer required`
81
+ });
82
+ }
83
+ }
84
+ }
85
+ function compareVersion(name, previous, next, changes) {
86
+ const target = `${name}@${previous.version}`;
87
+ if (previous.kind !== next.kind) {
88
+ changes.push({
89
+ severity: "breaking",
90
+ kind: "capability.kind-changed",
91
+ target,
92
+ message: `kind changed from ${previous.kind} to ${next.kind}`
93
+ });
94
+ }
95
+ compareSchema(previous.inputSchema, next.inputSchema, `${target} input`, "input", changes);
96
+ compareSchema(previous.outputSchema, next.outputSchema, `${target} output`, "output", changes);
97
+ const previousPermissions = new Set(previous.authorization);
98
+ for (const permission of next.authorization) {
99
+ if (!previousPermissions.has(permission)) {
100
+ changes.push({
101
+ severity: "breaking",
102
+ kind: "capability.authorization-tightened",
103
+ target,
104
+ message: `now requires permission "${permission}"`
105
+ });
106
+ }
107
+ }
108
+ }
109
+ /** Compares two manifests and classifies every difference. */
110
+ export function compareManifests(previous, next) {
111
+ const changes = [];
112
+ const nextCapabilities = new Map(next.capabilities.map((entry) => [entry.name, entry]));
113
+ for (const previousEntry of previous.capabilities) {
114
+ const nextEntry = nextCapabilities.get(previousEntry.name);
115
+ if (!nextEntry) {
116
+ changes.push({
117
+ severity: "breaking",
118
+ kind: "capability.removed",
119
+ target: previousEntry.name,
120
+ message: `capability "${previousEntry.name}" was removed`
121
+ });
122
+ continue;
123
+ }
124
+ const nextVersions = new Map(nextEntry.definitions.map((d) => [d.version, d]));
125
+ for (const previousVersion of previousEntry.definitions) {
126
+ const nextVersion = nextVersions.get(previousVersion.version);
127
+ if (!nextVersion) {
128
+ changes.push({
129
+ severity: "breaking",
130
+ kind: "capability.version-removed",
131
+ target: `${previousEntry.name}@${previousVersion.version}`,
132
+ message: `version ${previousVersion.version} was removed`
133
+ });
134
+ continue;
135
+ }
136
+ compareVersion(previousEntry.name, previousVersion, nextVersion, changes);
137
+ }
138
+ for (const nextVersion of nextEntry.definitions) {
139
+ if (!previousEntry.definitions.some((d) => d.version === nextVersion.version)) {
140
+ changes.push({
141
+ severity: "non-breaking",
142
+ kind: "capability.version-added",
143
+ target: `${nextEntry.name}@${nextVersion.version}`,
144
+ message: `version ${nextVersion.version} was added`
145
+ });
146
+ }
147
+ }
148
+ }
149
+ const previousCapabilities = new Set(previous.capabilities.map((entry) => entry.name));
150
+ for (const entry of next.capabilities) {
151
+ if (!previousCapabilities.has(entry.name)) {
152
+ changes.push({
153
+ severity: "non-breaking",
154
+ kind: "capability.added",
155
+ target: entry.name,
156
+ message: `capability "${entry.name}" was added`
157
+ });
158
+ }
159
+ }
160
+ const nextEvents = new Map(next.events.map((entry) => [entry.name, entry]));
161
+ for (const previousEvent of previous.events) {
162
+ const nextEvent = nextEvents.get(previousEvent.name);
163
+ if (!nextEvent) {
164
+ changes.push({
165
+ severity: "breaking",
166
+ kind: "event.removed",
167
+ target: previousEvent.name,
168
+ message: `event "${previousEvent.name}" was removed`
169
+ });
170
+ continue;
171
+ }
172
+ compareSchema(previousEvent.payloadSchema, nextEvent.payloadSchema, `${previousEvent.name} payload`, "output", changes);
173
+ }
174
+ const previousEvents = new Set(previous.events.map((entry) => entry.name));
175
+ for (const entry of next.events) {
176
+ if (!previousEvents.has(entry.name)) {
177
+ changes.push({
178
+ severity: "non-breaking",
179
+ kind: "event.added",
180
+ target: entry.name,
181
+ message: `event "${entry.name}" was added`
182
+ });
183
+ }
184
+ }
185
+ const breaking = changes.filter((change) => change.severity === "breaking");
186
+ const nonBreaking = changes.filter((change) => change.severity === "non-breaking");
187
+ return { compatible: breaking.length === 0, breaking, nonBreaking };
188
+ }
189
+ //# sourceMappingURL=compatibility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../src/compatibility.ts"],"names":[],"mappings":"AA2BA,SAAS,OAAO,CAAC,MAA8B;IAC7C,IAAI,CAAC,MAAM,EAAE,IAAI;QAAE,OAAO,EAAE,CAAC;IAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC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