@coasys/ad4m 0.13.0-test-flows-1 → 0.13.1-staging.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 (813) hide show
  1. package/README.md +1 -0
  2. package/lib/index.cjs +6796 -6849
  3. package/lib/index.js +6757 -6820
  4. package/lib/src/Ad4mClient.d.ts +12 -4
  5. package/lib/src/Ad4mClient.js +15 -11
  6. package/lib/src/Literal.js +3 -3
  7. package/lib/src/agent/Agent.d.ts +4 -1
  8. package/lib/src/agent/Agent.js +6 -0
  9. package/lib/src/agent/AgentClient.d.ts +9 -23
  10. package/lib/src/agent/AgentClient.js +68 -148
  11. package/lib/src/ai/AIClient.d.ts +10 -6
  12. package/lib/src/ai/AIClient.js +29 -27
  13. package/lib/src/apiClient.d.ts +54 -42
  14. package/lib/src/apiClient.js +279 -252
  15. package/lib/src/expression/Expression.d.ts +13 -4
  16. package/lib/src/expression/Expression.js +0 -1
  17. package/lib/src/expression/ExpressionClient.js +1 -1
  18. package/lib/src/generated/api/AIPromptExamples.d.ts +4 -0
  19. package/lib/src/generated/api/AIPromptExamples.js +2 -0
  20. package/lib/src/generated/api/AIPromptExamplesInput.d.ts +4 -0
  21. package/lib/src/generated/api/AIPromptExamplesInput.js +2 -0
  22. package/lib/src/generated/api/AITask.d.ts +11 -0
  23. package/lib/src/generated/api/AITaskInput.d.ts +8 -0
  24. package/lib/src/generated/api/AddAgentInfosRequest.d.ts +3 -0
  25. package/lib/src/generated/api/AddAgentInfosRequest.js +2 -0
  26. package/lib/src/generated/api/AddLinkExpressionRequest.d.ts +2 -2
  27. package/lib/src/generated/api/AddLinkRequest.d.ts +2 -2
  28. package/lib/src/generated/api/AddLinksBulkRequest.d.ts +2 -2
  29. package/lib/src/generated/api/AddSdnaRequest.d.ts +2 -2
  30. package/lib/src/generated/api/Agent.d.ts +6 -0
  31. package/lib/src/generated/api/AgentAddEntanglementProofsParams.d.ts +9 -0
  32. package/lib/src/generated/api/AgentByDidParams.d.ts +3 -0
  33. package/lib/src/generated/api/AgentByDidParams.js +2 -0
  34. package/lib/src/generated/api/AgentRemoveAppParams.d.ts +3 -0
  35. package/lib/src/generated/api/AgentRemoveAppParams.js +2 -0
  36. package/lib/src/generated/api/AgentRevokeTokenParams.d.ts +3 -0
  37. package/lib/src/generated/api/AgentRevokeTokenParams.js +2 -0
  38. package/lib/src/generated/api/AgentSignature.d.ts +4 -0
  39. package/lib/src/generated/api/AgentSignature.js +2 -0
  40. package/lib/src/generated/api/AgentStatus.d.ts +8 -0
  41. package/lib/src/generated/api/AgentStatusChangedEvent.d.ts +7 -0
  42. package/lib/src/generated/api/AgentUpdatedEvent.d.ts +7 -0
  43. package/lib/src/generated/api/AiAddModelParams.d.ts +4 -0
  44. package/lib/src/generated/api/AiAddTaskParams.d.ts +4 -0
  45. package/lib/src/generated/api/AiDiscoverModelsParams.d.ts +8 -0
  46. package/lib/src/generated/api/AiDiscoverModelsParams.js +2 -0
  47. package/lib/src/generated/api/AiGetDefaultModelParams.d.ts +4 -0
  48. package/lib/src/generated/api/AiIdParams.d.ts +3 -0
  49. package/lib/src/generated/api/AiIdParams.js +2 -0
  50. package/lib/src/generated/api/AiModelLoadingStatusParams.d.ts +7 -0
  51. package/lib/src/generated/api/AiModelLoadingStatusParams.js +2 -0
  52. package/lib/src/generated/api/AiSetDefaultModelParams.d.ts +5 -0
  53. package/lib/src/generated/api/AiSetDefaultModelParams.js +1 -0
  54. package/lib/src/generated/api/AiTranscriptionCloseParams.d.ts +3 -0
  55. package/lib/src/generated/api/AiTranscriptionCloseParams.js +2 -0
  56. package/lib/src/generated/api/AiTranscriptionOpenParams.d.ts +5 -0
  57. package/lib/src/generated/api/AiTranscriptionOpenParams.js +1 -0
  58. package/lib/src/generated/api/AiUpdateModelParams.d.ts +5 -0
  59. package/lib/src/generated/api/AiUpdateModelParams.js +1 -0
  60. package/lib/src/generated/api/AiUpdateTaskParams.d.ts +4 -0
  61. package/lib/src/generated/api/AiUpdateTaskParams.js +1 -0
  62. package/lib/src/generated/api/Apps.d.ts +7 -0
  63. package/lib/src/generated/api/Apps.js +1 -0
  64. package/lib/src/generated/api/AuthInfo.d.ts +10 -0
  65. package/lib/src/generated/api/AuthInfo.js +1 -0
  66. package/lib/src/generated/api/AuthInfoInput.d.ts +4 -4
  67. package/lib/src/generated/api/AutoProcessorEvent.d.ts +89 -0
  68. package/lib/src/generated/api/AutoProcessorEvent.js +1 -0
  69. package/lib/src/generated/api/AutoProcessorNeighbourhoodState.d.ts +32 -0
  70. package/lib/src/generated/api/AutoProcessorNeighbourhoodState.js +1 -0
  71. package/lib/src/generated/api/AutoProcessorStep.d.ts +7 -0
  72. package/lib/src/generated/api/AutoProcessorStep.js +2 -0
  73. package/lib/src/generated/api/BroadcastRequest.d.ts +5 -0
  74. package/lib/src/generated/api/BroadcastRequest.js +2 -0
  75. package/lib/src/generated/api/Capability.d.ts +5 -0
  76. package/lib/src/generated/api/Capability.js +1 -0
  77. package/lib/src/generated/api/CreateSubjectRequest.d.ts +2 -2
  78. package/lib/src/generated/api/CreateUserRequest.d.ts +4 -0
  79. package/lib/src/generated/api/CreateUserRequest.js +2 -0
  80. package/lib/src/generated/api/DateTime.d.ts +1 -0
  81. package/lib/src/generated/api/DateTime.js +2 -0
  82. package/lib/src/generated/api/DecoratedExpressionProof.d.ts +6 -0
  83. package/lib/src/generated/api/DecoratedExpressionProof.js +2 -0
  84. package/lib/src/generated/api/DecoratedLinkExpression.d.ts +10 -0
  85. package/lib/src/generated/api/DecoratedLinkExpression.js +1 -0
  86. package/lib/src/generated/api/DecoratedNeighbourhoodExpression.d.ts +8 -0
  87. package/lib/src/generated/api/DecoratedNeighbourhoodExpression.js +1 -0
  88. package/lib/src/generated/api/DecoratedPerspective.d.ts +4 -0
  89. package/lib/src/generated/api/DecoratedPerspective.js +1 -0
  90. package/lib/src/generated/api/DisposeQueryRequest.d.ts +3 -0
  91. package/lib/src/generated/api/DisposeQueryRequest.js +2 -0
  92. package/lib/src/generated/api/EntanglementProof.d.ts +8 -0
  93. package/lib/src/generated/api/EntanglementProof.js +2 -0
  94. package/lib/src/generated/api/EntanglementProofInput.d.ts +1 -1
  95. package/lib/src/generated/api/EntanglementProofPreflightRequest.d.ts +4 -0
  96. package/lib/src/generated/api/EntanglementProofPreflightRequest.js +2 -0
  97. package/lib/src/generated/api/EntanglementProofsWrapper.d.ts +7 -0
  98. package/lib/src/generated/api/EntanglementProofsWrapper.js +1 -0
  99. package/lib/src/generated/api/Events.d.ts +46 -0
  100. package/lib/src/generated/api/Events.js +17 -0
  101. package/lib/src/generated/api/ExceptionInfo.d.ts +7 -0
  102. package/lib/src/generated/api/ExceptionInfo.js +1 -0
  103. package/lib/src/generated/api/ExceptionOccurredEvent.d.ts +7 -0
  104. package/lib/src/generated/api/ExceptionOccurredEvent.js +1 -0
  105. package/lib/src/generated/api/ExceptionType.d.ts +1 -0
  106. package/lib/src/generated/api/ExceptionType.js +2 -0
  107. package/lib/src/generated/api/ExecuteCommandsRequest.d.ts +4 -2
  108. package/lib/src/generated/api/ExportRequest.d.ts +1 -1
  109. package/lib/src/generated/api/ExpressionInteractRequest.d.ts +5 -0
  110. package/lib/src/generated/api/ExpressionInteractRequest.js +1 -0
  111. package/lib/src/generated/api/ExpressionProofInput.d.ts +4 -4
  112. package/lib/src/generated/api/ExpressionRendered.d.ts +11 -0
  113. package/lib/src/generated/api/ExpressionRendered.js +1 -0
  114. package/lib/src/generated/api/ExpressionUrlRequest.d.ts +3 -0
  115. package/lib/src/generated/api/ExpressionUrlRequest.js +2 -0
  116. package/lib/src/generated/api/FireOutcome.d.ts +14 -0
  117. package/lib/src/generated/api/FireOutcome.js +2 -0
  118. package/lib/src/generated/api/FriendSendMessageRequest.d.ts +1 -1
  119. package/lib/src/generated/api/HostRate.d.ts +7 -0
  120. package/lib/src/generated/api/HostRate.js +2 -0
  121. package/lib/src/generated/api/HostingInfoResult.d.ts +13 -0
  122. package/lib/src/generated/api/HostingInfoResult.js +1 -0
  123. package/lib/src/generated/api/HostingInfoUser.d.ts +9 -0
  124. package/lib/src/generated/api/HostingInfoUser.js +2 -0
  125. package/lib/src/generated/api/HostingRequestPaymentResult.d.ts +4 -0
  126. package/lib/src/generated/api/HostingRequestPaymentResult.js +2 -0
  127. package/lib/src/generated/api/HostingUserInfo.d.ts +6 -0
  128. package/lib/src/generated/api/HostingUserInfo.js +2 -0
  129. package/lib/src/generated/api/HostingVersionInfo.d.ts +7 -0
  130. package/lib/src/generated/api/HostingVersionInfo.js +2 -0
  131. package/lib/src/generated/api/HostingWalletResult.d.ts +8 -0
  132. package/lib/src/generated/api/HostingWalletResult.js +1 -0
  133. package/lib/src/generated/api/Icon.d.ts +3 -0
  134. package/lib/src/generated/api/Icon.js +2 -0
  135. package/lib/src/generated/api/ImportResult.d.ts +15 -0
  136. package/lib/src/generated/api/ImportResult.js +1 -0
  137. package/lib/src/generated/api/ImportStats.d.ts +7 -0
  138. package/lib/src/generated/api/ImportStats.js +2 -0
  139. package/lib/src/generated/api/InteractionCall.d.ts +4 -0
  140. package/lib/src/generated/api/InteractionCall.js +2 -0
  141. package/lib/src/generated/api/InteractionCallWrapper.d.ts +6 -0
  142. package/lib/src/generated/api/InteractionCallWrapper.js +2 -0
  143. package/lib/src/generated/api/InteractionMeta.d.ts +6 -0
  144. package/lib/src/generated/api/InteractionMeta.js +1 -0
  145. package/lib/src/generated/api/InteractionParameter.d.ts +4 -0
  146. package/lib/src/generated/api/InteractionParameter.js +2 -0
  147. package/lib/src/generated/api/KeepAliveQueryRequest.d.ts +3 -0
  148. package/lib/src/generated/api/KeepAliveQueryRequest.js +2 -0
  149. package/lib/src/generated/api/LanguageAddressParams.d.ts +3 -0
  150. package/lib/src/generated/api/LanguageAddressParams.js +2 -0
  151. package/lib/src/generated/api/LanguageHandle.d.ts +9 -0
  152. package/lib/src/generated/api/LanguageHandle.js +1 -0
  153. package/lib/src/generated/api/LanguageListParams.d.ts +3 -0
  154. package/lib/src/generated/api/LanguageListParams.js +2 -0
  155. package/lib/src/generated/api/LanguageMeta.d.ts +11 -0
  156. package/lib/src/generated/api/LanguageMeta.js +2 -0
  157. package/lib/src/generated/api/LanguageMetaInput.d.ts +2 -2
  158. package/lib/src/generated/api/LanguageRef.d.ts +4 -0
  159. package/lib/src/generated/api/LanguageRef.js +2 -0
  160. package/lib/src/generated/api/LanguageSettingsWrapper.d.ts +6 -0
  161. package/lib/src/generated/api/LanguageSettingsWrapper.js +2 -0
  162. package/lib/src/generated/api/LanguageWriteSettingsParams.d.ts +4 -0
  163. package/lib/src/generated/api/LanguageWriteSettingsParams.js +2 -0
  164. package/lib/src/generated/api/LinkExpressionInput.d.ts +1 -1
  165. package/lib/src/generated/api/LinkInput.d.ts +1 -1
  166. package/lib/src/generated/api/LinkMutationRequest.d.ts +12 -0
  167. package/lib/src/generated/api/LinkMutationRequest.js +1 -0
  168. package/lib/src/generated/api/LinkMutationsRequest.d.ts +5 -0
  169. package/lib/src/generated/api/LinkMutationsRequest.js +1 -0
  170. package/lib/src/generated/api/LinkStatus.d.ts +1 -1
  171. package/lib/src/generated/api/LinkUpdateInput.d.ts +5 -0
  172. package/lib/src/generated/api/LinkUpdateInput.js +1 -0
  173. package/lib/src/generated/api/LocalModel.d.ts +7 -0
  174. package/lib/src/generated/api/LocalModel.js +1 -0
  175. package/lib/src/generated/api/LocalModelInput.d.ts +7 -0
  176. package/lib/src/generated/api/LocalModelInput.js +1 -0
  177. package/lib/src/generated/api/MessageReceivedEvent.d.ts +7 -0
  178. package/lib/src/generated/api/MessageReceivedEvent.js +1 -0
  179. package/lib/src/generated/api/Model.d.ts +10 -0
  180. package/lib/src/generated/api/Model.js +1 -0
  181. package/lib/src/generated/api/ModelApi.d.ts +17 -0
  182. package/lib/src/generated/api/ModelApi.js +1 -0
  183. package/lib/src/generated/api/ModelApiInput.d.ts +11 -0
  184. package/lib/src/generated/api/ModelApiInput.js +2 -0
  185. package/lib/src/generated/api/ModelApiType.d.ts +1 -0
  186. package/lib/src/generated/api/ModelApiType.js +2 -0
  187. package/lib/src/generated/api/ModelInput.d.ts +9 -0
  188. package/lib/src/generated/api/ModelInput.js +1 -0
  189. package/lib/src/generated/api/ModelType.d.ts +1 -1
  190. package/lib/src/generated/api/Neighbourhood.d.ts +5 -0
  191. package/lib/src/generated/api/Neighbourhood.js +1 -0
  192. package/lib/src/generated/api/NeighbourhoodBroadcastParams.d.ts +7 -0
  193. package/lib/src/generated/api/NeighbourhoodBroadcastParams.js +1 -0
  194. package/lib/src/generated/api/NeighbourhoodOnlineStatusParams.d.ts +6 -0
  195. package/lib/src/generated/api/NeighbourhoodOnlineStatusParams.js +1 -0
  196. package/lib/src/generated/api/NeighbourhoodPerspectivePayload.d.ts +7 -0
  197. package/lib/src/generated/api/NeighbourhoodPerspectivePayload.js +1 -0
  198. package/lib/src/generated/api/NeighbourhoodPhase.d.ts +6 -0
  199. package/lib/src/generated/api/NeighbourhoodPhase.js +2 -0
  200. package/lib/src/generated/api/NeighbourhoodSignalFilter.d.ts +8 -0
  201. package/lib/src/generated/api/NeighbourhoodSignalFilter.js +1 -0
  202. package/lib/src/generated/api/NeighbourhoodSignalParams.d.ts +7 -0
  203. package/lib/src/generated/api/NeighbourhoodSignalParams.js +1 -0
  204. package/lib/src/generated/api/NeighbourhoodSignedPerspective.d.ts +8 -0
  205. package/lib/src/generated/api/NeighbourhoodSignedPerspective.js +1 -0
  206. package/lib/src/generated/api/NeighbourhoodUuidParams.d.ts +3 -0
  207. package/lib/src/generated/api/NeighbourhoodUuidParams.js +2 -0
  208. package/lib/src/generated/api/Notification.d.ts +16 -0
  209. package/lib/src/generated/api/Notification.js +2 -0
  210. package/lib/src/generated/api/NotificationGrantRequest.d.ts +6 -0
  211. package/lib/src/generated/api/NotificationGrantRequest.js +2 -0
  212. package/lib/src/generated/api/NotificationInput.d.ts +1 -1
  213. package/lib/src/generated/api/NotificationTriggeredEvent.d.ts +9 -0
  214. package/lib/src/generated/api/NotificationTriggeredEvent.js +1 -0
  215. package/lib/src/generated/api/OnlineAgent.d.ts +5 -0
  216. package/lib/src/generated/api/OnlineAgent.js +1 -0
  217. package/lib/src/generated/api/OutputRef.d.ts +12 -0
  218. package/lib/src/generated/api/OutputRef.js +2 -0
  219. package/lib/src/generated/api/OverlayView.d.ts +24 -0
  220. package/lib/src/generated/api/OverlayView.js +1 -0
  221. package/lib/src/generated/api/Perspective.d.ts +4 -0
  222. package/lib/src/generated/api/Perspective.js +1 -0
  223. package/lib/src/generated/api/PerspectiveAddAutoProcessorParams.d.ts +26 -0
  224. package/lib/src/generated/api/PerspectiveAddAutoProcessorParams.js +2 -0
  225. package/lib/src/generated/api/PerspectiveAddLinkExpressionParams.d.ts +7 -0
  226. package/lib/src/generated/api/PerspectiveAddLinkExpressionParams.js +1 -0
  227. package/lib/src/generated/api/PerspectiveAddLinkParams.d.ts +7 -0
  228. package/lib/src/generated/api/PerspectiveAddLinkParams.js +1 -0
  229. package/lib/src/generated/api/PerspectiveAddLinksParams.d.ts +7 -0
  230. package/lib/src/generated/api/PerspectiveAddLinksParams.js +1 -0
  231. package/lib/src/generated/api/PerspectiveAddSdnaParams.d.ts +14 -0
  232. package/lib/src/generated/api/PerspectiveAddSdnaParams.js +1 -0
  233. package/lib/src/generated/api/PerspectiveAddSdnaResult.d.ts +4 -0
  234. package/lib/src/generated/api/PerspectiveAddSdnaResult.js +2 -0
  235. package/lib/src/generated/api/PerspectiveCommitBatchParams.d.ts +4 -0
  236. package/lib/src/generated/api/PerspectiveCommitBatchParams.js +2 -0
  237. package/lib/src/generated/api/PerspectiveCreateSubjectParams.d.ts +7 -0
  238. package/lib/src/generated/api/PerspectiveCreateSubjectParams.js +2 -0
  239. package/lib/src/generated/api/PerspectiveEvaluateGettersParams.d.ts +9 -0
  240. package/lib/src/generated/api/PerspectiveEvaluateGettersParams.js +2 -0
  241. package/lib/src/generated/api/PerspectiveExecuteCommandsParams.d.ts +7 -0
  242. package/lib/src/generated/api/PerspectiveExecuteCommandsParams.js +2 -0
  243. package/lib/src/generated/api/PerspectiveExpression.d.ts +8 -0
  244. package/lib/src/generated/api/PerspectiveExpression.js +1 -0
  245. package/lib/src/generated/api/PerspectiveFlowProposalParams.d.ts +4 -0
  246. package/lib/src/generated/api/PerspectiveFlowProposalParams.js +2 -0
  247. package/lib/src/generated/api/PerspectiveFlowReceiptVerdict.d.ts +12 -0
  248. package/lib/src/generated/api/PerspectiveFlowReceiptVerdict.js +1 -0
  249. package/lib/src/generated/api/PerspectiveFlowValidOutputsParams.d.ts +8 -0
  250. package/lib/src/generated/api/PerspectiveFlowValidOutputsParams.js +2 -0
  251. package/lib/src/generated/api/PerspectiveGetSubjectDataParams.d.ts +5 -0
  252. package/lib/src/generated/api/PerspectiveGetSubjectDataParams.js +2 -0
  253. package/lib/src/generated/api/PerspectiveHandle.d.ts +10 -0
  254. package/lib/src/generated/api/PerspectiveHandle.js +1 -0
  255. package/lib/src/generated/api/PerspectiveLinkDiff.d.ts +9 -0
  256. package/lib/src/generated/api/PerspectiveLinkDiff.js +1 -0
  257. package/lib/src/generated/api/PerspectiveLinkMutationsParams.d.ts +6 -0
  258. package/lib/src/generated/api/PerspectiveLinkMutationsParams.js +1 -0
  259. package/lib/src/generated/api/PerspectiveLinkUpdatedWithOwner.d.ts +7 -0
  260. package/lib/src/generated/api/PerspectiveLinkUpdatedWithOwner.js +1 -0
  261. package/lib/src/generated/api/PerspectiveLinkWithOwner.d.ts +6 -0
  262. package/lib/src/generated/api/PerspectiveLinkWithOwner.js +1 -0
  263. package/lib/src/generated/api/PerspectiveMintFlowReceiptParams.d.ts +4 -0
  264. package/lib/src/generated/api/PerspectiveMintFlowReceiptParams.js +2 -0
  265. package/lib/src/generated/api/PerspectiveMintFlowReceiptResult.d.ts +9 -0
  266. package/lib/src/generated/api/PerspectiveMintFlowReceiptResult.js +1 -0
  267. package/lib/src/generated/api/PerspectiveModelQueryParams.d.ts +8 -0
  268. package/lib/src/generated/api/PerspectiveModelQueryParams.js +2 -0
  269. package/lib/src/generated/api/PerspectiveModelSubscribeResult.d.ts +7 -0
  270. package/lib/src/generated/api/PerspectiveModelSubscribeResult.js +2 -0
  271. package/lib/src/generated/api/PerspectiveNamedShacl.d.ts +6 -0
  272. package/lib/src/generated/api/PerspectiveNamedShacl.js +1 -0
  273. package/lib/src/generated/api/PerspectiveProposeFlowTransitionParams.d.ts +8 -0
  274. package/lib/src/generated/api/PerspectiveProposeFlowTransitionParams.js +1 -0
  275. package/lib/src/generated/api/PerspectiveQueryLinksParams.d.ts +15 -0
  276. package/lib/src/generated/api/PerspectiveQueryLinksParams.js +2 -0
  277. package/lib/src/generated/api/PerspectiveQueryParams.d.ts +4 -0
  278. package/lib/src/generated/api/PerspectiveQueryParams.js +2 -0
  279. package/lib/src/generated/api/PerspectiveQuerySubscriptionFilter.d.ts +6 -0
  280. package/lib/src/generated/api/PerspectiveQuerySubscriptionFilter.js +2 -0
  281. package/lib/src/generated/api/PerspectiveReceiptOutcome.d.ts +1 -0
  282. package/lib/src/generated/api/PerspectiveReceiptOutcome.js +2 -0
  283. package/lib/src/generated/api/PerspectiveRejectFlowProposalResult.d.ts +3 -0
  284. package/lib/src/generated/api/PerspectiveRejectFlowProposalResult.js +2 -0
  285. package/lib/src/generated/api/PerspectiveRemoveAutoProcessorParams.d.ts +4 -0
  286. package/lib/src/generated/api/PerspectiveRemoveAutoProcessorParams.js +2 -0
  287. package/lib/src/generated/api/PerspectiveRemoveLinkParams.d.ts +6 -0
  288. package/lib/src/generated/api/PerspectiveRemoveLinkParams.js +1 -0
  289. package/lib/src/generated/api/PerspectiveRemoveLinksParams.d.ts +6 -0
  290. package/lib/src/generated/api/PerspectiveRemoveLinksParams.js +1 -0
  291. package/lib/src/generated/api/PerspectiveRemovedWithOwner.d.ts +5 -0
  292. package/lib/src/generated/api/PerspectiveRemovedWithOwner.js +2 -0
  293. package/lib/src/generated/api/PerspectiveResolveInterpretationParams.d.ts +8 -0
  294. package/lib/src/generated/api/PerspectiveResolveInterpretationParams.js +2 -0
  295. package/lib/src/generated/api/PerspectiveShacl.d.ts +5 -0
  296. package/lib/src/generated/api/PerspectiveShacl.js +1 -0
  297. package/lib/src/generated/api/PerspectiveShaclNameParams.d.ts +4 -0
  298. package/lib/src/generated/api/PerspectiveShaclNameParams.js +2 -0
  299. package/lib/src/generated/api/PerspectiveSparqlParams.d.ts +8 -0
  300. package/lib/src/generated/api/PerspectiveSparqlParams.js +2 -0
  301. package/lib/src/generated/api/PerspectiveState.d.ts +1 -0
  302. package/lib/src/generated/api/PerspectiveState.js +2 -0
  303. package/lib/src/generated/api/PerspectiveStateFilter.d.ts +7 -0
  304. package/lib/src/generated/api/PerspectiveStateFilter.js +1 -0
  305. package/lib/src/generated/api/PerspectiveSubjectClassesOfParams.d.ts +4 -0
  306. package/lib/src/generated/api/PerspectiveSubjectClassesOfParams.js +2 -0
  307. package/lib/src/generated/api/PerspectiveSubscribeQueryResult.d.ts +4 -0
  308. package/lib/src/generated/api/PerspectiveSubscribeQueryResult.js +2 -0
  309. package/lib/src/generated/api/PerspectiveSubscriptionParams.d.ts +4 -0
  310. package/lib/src/generated/api/PerspectiveSubscriptionParams.js +2 -0
  311. package/lib/src/generated/api/PerspectiveUnsignedInput.d.ts +4 -0
  312. package/lib/src/generated/api/PerspectiveUnsignedInput.js +1 -0
  313. package/lib/src/generated/api/PerspectiveUpdateLinkParams.d.ts +8 -0
  314. package/lib/src/generated/api/PerspectiveUpdateLinkParams.js +1 -0
  315. package/lib/src/generated/api/PerspectiveUpdateParams.d.ts +4 -0
  316. package/lib/src/generated/api/PerspectiveUpdateParams.js +2 -0
  317. package/lib/src/generated/api/PerspectiveUuidParams.d.ts +3 -0
  318. package/lib/src/generated/api/PerspectiveUuidParams.js +2 -0
  319. package/lib/src/generated/api/PerspectiveVerifyFlowReceiptParams.d.ts +9 -0
  320. package/lib/src/generated/api/PerspectiveVerifyFlowReceiptParams.js +1 -0
  321. package/lib/src/generated/api/PerspectiveWithOwner.d.ts +6 -0
  322. package/lib/src/generated/api/PerspectiveWithOwner.js +1 -0
  323. package/lib/src/generated/api/ProposeOutcome.d.ts +45 -0
  324. package/lib/src/generated/api/ProposeOutcome.js +1 -0
  325. package/lib/src/generated/api/PublicPerspectiveInput.d.ts +4 -0
  326. package/lib/src/generated/api/PublicPerspectiveInput.js +1 -0
  327. package/lib/src/generated/api/PublishNeighbourhoodRequest.d.ts +2 -2
  328. package/lib/src/generated/api/RemoveLinkRequest.d.ts +1 -1
  329. package/lib/src/generated/api/RemoveLinksBulkRequest.d.ts +1 -1
  330. package/lib/src/generated/api/RequestCapabilityRequest.d.ts +4 -0
  331. package/lib/src/generated/api/RequestCapabilityRequest.js +1 -0
  332. package/lib/src/generated/api/RequestPaymentRequest.d.ts +3 -0
  333. package/lib/src/generated/api/RequestPaymentRequest.js +2 -0
  334. package/lib/src/generated/api/Resource.d.ts +4 -0
  335. package/lib/src/generated/api/Resource.js +2 -0
  336. package/lib/src/generated/api/RpcMethods.d.ts +841 -0
  337. package/lib/src/generated/api/RpcMethods.js +86 -0
  338. package/lib/src/generated/api/RunInterpretationRequest.d.ts +27 -1
  339. package/lib/src/generated/api/RunInterpretationWithHarnessRequest.d.ts +52 -0
  340. package/lib/src/generated/api/RunInterpretationWithHarnessRequest.js +1 -0
  341. package/lib/src/generated/api/RuntimeComputeLogParams.d.ts +14 -0
  342. package/lib/src/generated/api/RuntimeComputeLogParams.js +2 -0
  343. package/lib/src/generated/api/RuntimeFriendStatusParams.d.ts +3 -0
  344. package/lib/src/generated/api/RuntimeFriendStatusParams.js +2 -0
  345. package/lib/src/generated/api/RuntimeGrantNotificationParams.d.ts +4 -0
  346. package/lib/src/generated/api/RuntimeGrantNotificationParams.js +2 -0
  347. package/lib/src/generated/api/RuntimeImportPerspectiveResult.d.ts +4 -0
  348. package/lib/src/generated/api/RuntimeImportPerspectiveResult.js +2 -0
  349. package/lib/src/generated/api/RuntimeImportResult.d.ts +6 -0
  350. package/lib/src/generated/api/RuntimeImportResult.js +1 -0
  351. package/lib/src/generated/api/RuntimeInfo.d.ts +5 -0
  352. package/lib/src/generated/api/RuntimeInfo.js +2 -0
  353. package/lib/src/generated/api/RuntimeNotificationIdParams.d.ts +3 -0
  354. package/lib/src/generated/api/RuntimeNotificationIdParams.js +2 -0
  355. package/lib/src/generated/api/RuntimeSendFriendMessageParams.d.ts +8 -0
  356. package/lib/src/generated/api/RuntimeSendFriendMessageParams.js +1 -0
  357. package/lib/src/generated/api/RuntimeSetFreeHostingEnabledParams.d.ts +3 -0
  358. package/lib/src/generated/api/RuntimeSetFreeHostingEnabledParams.js +2 -0
  359. package/lib/src/generated/api/RuntimeUnytSendHotParams.d.ts +4 -0
  360. package/lib/src/generated/api/RuntimeUnytSendHotParams.js +2 -0
  361. package/lib/src/generated/api/RuntimeUnytWalletHistoryParams.d.ts +4 -0
  362. package/lib/src/generated/api/RuntimeUnytWalletHistoryParams.js +2 -0
  363. package/lib/src/generated/api/RuntimeUpdateNotificationParams.d.ts +11 -0
  364. package/lib/src/generated/api/RuntimeUpdateNotificationParams.js +2 -0
  365. package/lib/src/generated/api/SentMessage.d.ts +5 -0
  366. package/lib/src/generated/api/SentMessage.js +1 -0
  367. package/lib/src/generated/api/SetHostRatesRequest.d.ts +4 -0
  368. package/lib/src/generated/api/SetHostRatesRequest.js +1 -0
  369. package/lib/src/generated/api/SetHotWalletAddressRequest.d.ts +3 -0
  370. package/lib/src/generated/api/SetHotWalletAddressRequest.js +2 -0
  371. package/lib/src/generated/api/SetOnlineStatusRequest.d.ts +4 -0
  372. package/lib/src/generated/api/SetOnlineStatusRequest.js +2 -0
  373. package/lib/src/generated/api/SetUnytMembraneProofRequest.d.ts +6 -0
  374. package/lib/src/generated/api/SetUnytMembraneProofRequest.js +2 -0
  375. package/lib/src/generated/api/SetUserFreeAccessRequest.d.ts +4 -0
  376. package/lib/src/generated/api/SetUserFreeAccessRequest.js +2 -0
  377. package/lib/src/generated/api/ShaclLinkTriple.d.ts +10 -0
  378. package/lib/src/generated/api/ShaclLinkTriple.js +2 -0
  379. package/lib/src/generated/api/SignalRequest.d.ts +5 -0
  380. package/lib/src/generated/api/SignalRequest.js +2 -0
  381. package/lib/src/generated/api/SubscribeQueryRequest.d.ts +3 -0
  382. package/lib/src/generated/api/SubscribeQueryRequest.js +2 -0
  383. package/lib/src/generated/api/TokenizerSource.d.ts +5 -0
  384. package/lib/src/generated/api/TokenizerSource.js +2 -0
  385. package/lib/src/generated/api/TokenizerSourceInput.d.ts +5 -0
  386. package/lib/src/generated/api/TokenizerSourceInput.js +2 -0
  387. package/lib/src/generated/api/TranscriptionTextFilter.d.ts +5 -0
  388. package/lib/src/generated/api/TranscriptionTextFilter.js +2 -0
  389. package/lib/src/generated/api/TriggeredNotification.d.ts +6 -0
  390. package/lib/src/generated/api/TriggeredNotification.js +1 -0
  391. package/lib/src/generated/api/TrustedAgentsWrapper.d.ts +6 -0
  392. package/lib/src/generated/api/TrustedAgentsWrapper.js +2 -0
  393. package/lib/src/generated/api/UnlockAgentRequest.d.ts +1 -1
  394. package/lib/src/generated/api/UnytVersionInfo.d.ts +19 -0
  395. package/lib/src/generated/api/UnytVersionInfo.js +2 -0
  396. package/lib/src/generated/api/UpdateLinkRequest.d.ts +1 -1
  397. package/lib/src/generated/api/UpdateProfileRequest.d.ts +5 -0
  398. package/lib/src/generated/api/UpdateProfileRequest.js +1 -0
  399. package/lib/src/generated/api/UserCreationResult.d.ts +5 -0
  400. package/lib/src/generated/api/UserCreationResult.js +2 -0
  401. package/lib/src/generated/api/UserStatistics.d.ts +2 -1
  402. package/lib/src/generated/api/UserStatistics.js +0 -1
  403. package/lib/src/generated/api/UsersAppInfo.d.ts +6 -0
  404. package/lib/src/generated/api/UsersAppInfo.js +2 -0
  405. package/lib/src/generated/api/UsersEmailParams.d.ts +3 -0
  406. package/lib/src/generated/api/UsersEmailParams.js +2 -0
  407. package/lib/src/generated/api/UsersEmailTestAction.d.ts +1 -0
  408. package/lib/src/generated/api/UsersEmailTestAction.js +2 -0
  409. package/lib/src/generated/api/UsersEmailTestParams.d.ts +14 -0
  410. package/lib/src/generated/api/UsersEmailTestParams.js +1 -0
  411. package/lib/src/generated/api/UsersEmailTestResult.d.ts +5 -0
  412. package/lib/src/generated/api/UsersEmailTestResult.js +2 -0
  413. package/lib/src/generated/api/UsersLoginParams.d.ts +8 -0
  414. package/lib/src/generated/api/UsersLoginParams.js +2 -0
  415. package/lib/src/generated/api/UsersRequestVerificationParams.d.ts +5 -0
  416. package/lib/src/generated/api/UsersRequestVerificationParams.js +1 -0
  417. package/lib/src/generated/api/UsersSetCreditsParams.d.ts +4 -0
  418. package/lib/src/generated/api/UsersSetCreditsParams.js +2 -0
  419. package/lib/src/generated/api/UsersVerifyEmailParams.d.ts +12 -0
  420. package/lib/src/generated/api/UsersVerifyEmailParams.js +2 -0
  421. package/lib/src/generated/api/ValidOutput.d.ts +29 -0
  422. package/lib/src/generated/api/ValidOutput.js +1 -0
  423. package/lib/src/generated/api/VoiceActivityParamsInput.d.ts +7 -0
  424. package/lib/src/generated/api/VoiceActivityParamsInput.js +2 -0
  425. package/lib/src/generated/api/index.d.ts +8 -0
  426. package/lib/src/generated/api/index.js +5 -3
  427. package/lib/src/generated/api/serde_json/JsonValue.d.ts +3 -0
  428. package/lib/src/generated/api/serde_json/JsonValue.js +2 -0
  429. package/lib/src/index.d.ts +2 -3
  430. package/lib/src/index.js +1 -3
  431. package/lib/src/language/LanguageClient.d.ts +3 -3
  432. package/lib/src/language/LanguageClient.js +6 -6
  433. package/lib/src/language/LanguageMeta.d.ts +1 -1
  434. package/lib/src/links/Links.d.ts +16 -5
  435. package/lib/src/links/Links.js +34 -0
  436. package/lib/src/model/Ad4mModel.js +131 -68
  437. package/lib/src/model/ModelQueryBuilder.d.ts +22 -1
  438. package/lib/src/model/ModelQueryBuilder.js +55 -16
  439. package/lib/src/model/decorators.d.ts +20 -2
  440. package/lib/src/model/decorators.js +43 -7
  441. package/lib/src/model/query-sparql.js +2 -3
  442. package/lib/src/model/shacl-gen.js +27 -9
  443. package/lib/src/model/types.d.ts +12 -0
  444. package/lib/src/neighbourhood/Neighbourhood.d.ts +1 -1
  445. package/lib/src/neighbourhood/NeighbourhoodClient.d.ts +5 -5
  446. package/lib/src/neighbourhood/NeighbourhoodClient.js +15 -15
  447. package/lib/src/notifyListeners.d.ts +2 -0
  448. package/lib/src/notifyListeners.js +12 -0
  449. package/lib/src/perspectives/AutoProcessor.d.ts +12 -80
  450. package/lib/src/perspectives/FlowInstance.d.ts +10 -2
  451. package/lib/src/perspectives/FlowInstance.js +23 -1
  452. package/lib/src/perspectives/FlowModels.d.ts +38 -1
  453. package/lib/src/perspectives/FlowModels.js +39 -2
  454. package/lib/src/perspectives/InterpretationModels.d.ts +2 -0
  455. package/lib/src/perspectives/InterpretationModels.js +6 -0
  456. package/lib/src/perspectives/Perspective.d.ts +8 -1
  457. package/lib/src/perspectives/Perspective.js +11 -0
  458. package/lib/src/perspectives/PerspectiveClient.d.ts +15 -51
  459. package/lib/src/perspectives/PerspectiveClient.js +58 -225
  460. package/lib/src/perspectives/PerspectiveDiff.d.ts +1 -1
  461. package/lib/src/perspectives/PerspectiveHandle.d.ts +15 -8
  462. package/lib/src/perspectives/PerspectiveHandle.js +25 -9
  463. package/lib/src/perspectives/PerspectiveProxy.d.ts +38 -64
  464. package/lib/src/perspectives/PerspectiveProxy.js +143 -215
  465. package/lib/src/perspectives/WakerSubscriptionManager.js +4 -8
  466. package/lib/src/runtime/RuntimeClient.d.ts +15 -27
  467. package/lib/src/runtime/RuntimeClient.js +57 -113
  468. package/lib/src/runtime/RuntimeTypes.d.ts +2 -2
  469. package/lib/src/runtime/RuntimeTypes.js +2 -2
  470. package/lib/src/shacl/SHACLFlow.d.ts +27 -2
  471. package/lib/src/shacl/SHACLFlow.js +55 -11
  472. package/lib/src/shacl/SHACLShape.d.ts +3 -0
  473. package/lib/src/shacl/SHACLShape.js +169 -321
  474. package/package.json +15 -16
  475. package/src/Ad4mClient.test.ts +403 -138
  476. package/src/Ad4mClient.ts +16 -12
  477. package/src/Literal.test.ts +32 -0
  478. package/src/Literal.ts +3 -3
  479. package/src/agent/Agent.ts +8 -0
  480. package/src/agent/AgentClient.ts +87 -195
  481. package/src/agent/mutatePublicPerspective.test.ts +110 -0
  482. package/src/ai/AIClient.ts +40 -43
  483. package/src/ai/transcription-stream.test.ts +54 -0
  484. package/src/apiClient.test.ts +613 -185
  485. package/src/apiClient.ts +282 -288
  486. package/src/cache/cache.test.ts +7 -8
  487. package/src/expression/Expression.ts +12 -3
  488. package/src/expression/ExpressionClient.ts +6 -7
  489. package/src/generated/api/AIPromptExamples.ts +3 -0
  490. package/src/generated/api/AIPromptExamplesInput.ts +3 -0
  491. package/src/generated/api/AITask.ts +4 -0
  492. package/src/generated/api/AITaskInput.ts +4 -0
  493. package/src/generated/api/AddAgentInfosRequest.ts +3 -0
  494. package/src/generated/api/AddLinkExpressionRequest.ts +1 -1
  495. package/src/generated/api/AddLinkRequest.ts +1 -1
  496. package/src/generated/api/AddLinksBulkRequest.ts +1 -1
  497. package/src/generated/api/AddSdnaRequest.ts +1 -1
  498. package/src/generated/api/Agent.ts +4 -0
  499. package/src/generated/api/AgentAddEntanglementProofsParams.ts +8 -0
  500. package/src/generated/api/AgentByDidParams.ts +3 -0
  501. package/src/generated/api/AgentRemoveAppParams.ts +3 -0
  502. package/src/generated/api/AgentRevokeTokenParams.ts +3 -0
  503. package/src/generated/api/AgentSignature.ts +3 -0
  504. package/src/generated/api/AgentStatus.ts +4 -0
  505. package/src/generated/api/AgentStatusChangedEvent.ts +7 -0
  506. package/src/generated/api/AgentUpdatedEvent.ts +7 -0
  507. package/src/generated/api/AiAddModelParams.ts +4 -0
  508. package/src/generated/api/AiAddTaskParams.ts +4 -0
  509. package/src/generated/api/AiDiscoverModelsParams.ts +7 -0
  510. package/src/generated/api/AiGetDefaultModelParams.ts +4 -0
  511. package/src/generated/api/AiIdParams.ts +3 -0
  512. package/src/generated/api/AiModelLoadingStatusParams.ts +6 -0
  513. package/src/generated/api/AiSetDefaultModelParams.ts +4 -0
  514. package/src/generated/api/AiTranscriptionCloseParams.ts +3 -0
  515. package/src/generated/api/AiTranscriptionOpenParams.ts +4 -0
  516. package/src/generated/api/AiUpdateModelParams.ts +4 -0
  517. package/src/generated/api/AiUpdateTaskParams.ts +4 -0
  518. package/src/generated/api/Apps.ts +4 -0
  519. package/src/generated/api/AuthInfo.ts +4 -0
  520. package/src/generated/api/AuthInfoInput.ts +1 -1
  521. package/src/generated/api/AutoProcessorEvent.ts +90 -0
  522. package/src/generated/api/AutoProcessorNeighbourhoodState.ts +33 -0
  523. package/src/generated/api/AutoProcessorStep.ts +9 -0
  524. package/src/generated/api/BroadcastRequest.ts +3 -0
  525. package/src/generated/api/Capability.ts +4 -0
  526. package/src/generated/api/CreateSubjectRequest.ts +1 -1
  527. package/src/generated/api/CreateUserRequest.ts +3 -0
  528. package/src/generated/api/DateTime.ts +3 -0
  529. package/src/generated/api/DecoratedExpressionProof.ts +3 -0
  530. package/src/generated/api/DecoratedLinkExpression.ts +6 -0
  531. package/src/generated/api/DecoratedNeighbourhoodExpression.ts +5 -0
  532. package/src/generated/api/DecoratedPerspective.ts +4 -0
  533. package/src/generated/api/DisposeQueryRequest.ts +3 -0
  534. package/src/generated/api/EntanglementProof.ts +3 -0
  535. package/src/generated/api/EntanglementProofInput.ts +1 -1
  536. package/src/generated/api/EntanglementProofPreflightRequest.ts +3 -0
  537. package/src/generated/api/EntanglementProofsWrapper.ts +7 -0
  538. package/src/generated/api/Events.ts +66 -0
  539. package/src/generated/api/ExceptionInfo.ts +4 -0
  540. package/src/generated/api/ExceptionOccurredEvent.ts +7 -0
  541. package/src/generated/api/ExceptionType.ts +3 -0
  542. package/src/generated/api/ExecuteCommandsRequest.ts +1 -1
  543. package/src/generated/api/ExportRequest.ts +1 -1
  544. package/src/generated/api/ExpressionInteractRequest.ts +4 -0
  545. package/src/generated/api/ExpressionProofInput.ts +1 -1
  546. package/src/generated/api/ExpressionRendered.ts +6 -0
  547. package/src/generated/api/ExpressionUrlRequest.ts +3 -0
  548. package/src/generated/api/FireOutcome.ts +11 -0
  549. package/src/generated/api/FriendSendMessageRequest.ts +1 -1
  550. package/src/generated/api/HostRate.ts +6 -0
  551. package/src/generated/api/HostingInfoResult.ts +13 -0
  552. package/src/generated/api/HostingInfoUser.ts +7 -0
  553. package/src/generated/api/HostingRequestPaymentResult.ts +3 -0
  554. package/src/generated/api/HostingUserInfo.ts +3 -0
  555. package/src/generated/api/HostingVersionInfo.ts +7 -0
  556. package/src/generated/api/HostingWalletResult.ts +8 -0
  557. package/src/generated/api/Icon.ts +3 -0
  558. package/src/generated/api/ImportResult.ts +4 -0
  559. package/src/generated/api/ImportStats.ts +3 -0
  560. package/src/generated/api/InteractionCall.ts +3 -0
  561. package/src/generated/api/InteractionCallWrapper.ts +6 -0
  562. package/src/generated/api/InteractionMeta.ts +4 -0
  563. package/src/generated/api/InteractionParameter.ts +3 -0
  564. package/src/generated/api/KeepAliveQueryRequest.ts +3 -0
  565. package/src/generated/api/LanguageAddressParams.ts +3 -0
  566. package/src/generated/api/LanguageHandle.ts +4 -0
  567. package/src/generated/api/LanguageListParams.ts +3 -0
  568. package/src/generated/api/LanguageMeta.ts +3 -0
  569. package/src/generated/api/LanguageMetaInput.ts +1 -1
  570. package/src/generated/api/LanguageRef.ts +3 -0
  571. package/src/generated/api/LanguageSettingsWrapper.ts +6 -0
  572. package/src/generated/api/LanguageWriteSettingsParams.ts +3 -0
  573. package/src/generated/api/LinkExpressionInput.ts +1 -1
  574. package/src/generated/api/LinkInput.ts +1 -1
  575. package/src/generated/api/LinkMutationRequest.ts +8 -0
  576. package/src/generated/api/LinkMutationsRequest.ts +4 -0
  577. package/src/generated/api/LinkStatus.ts +1 -1
  578. package/src/generated/api/LinkUpdateInput.ts +4 -0
  579. package/src/generated/api/LocalModel.ts +4 -0
  580. package/src/generated/api/LocalModelInput.ts +4 -0
  581. package/src/generated/api/MessageReceivedEvent.ts +7 -0
  582. package/src/generated/api/Model.ts +6 -0
  583. package/src/generated/api/ModelApi.ts +14 -0
  584. package/src/generated/api/ModelApiInput.ts +8 -0
  585. package/src/generated/api/ModelApiType.ts +3 -0
  586. package/src/generated/api/ModelInput.ts +6 -0
  587. package/src/generated/api/ModelType.ts +1 -1
  588. package/src/generated/api/Neighbourhood.ts +4 -0
  589. package/src/generated/api/NeighbourhoodBroadcastParams.ts +4 -0
  590. package/src/generated/api/NeighbourhoodOnlineStatusParams.ts +4 -0
  591. package/src/generated/api/NeighbourhoodPerspectivePayload.ts +9 -0
  592. package/src/generated/api/NeighbourhoodPhase.ts +8 -0
  593. package/src/generated/api/NeighbourhoodSignalFilter.ts +5 -0
  594. package/src/generated/api/NeighbourhoodSignalParams.ts +4 -0
  595. package/src/generated/api/NeighbourhoodSignedPerspective.ts +8 -0
  596. package/src/generated/api/NeighbourhoodUuidParams.ts +3 -0
  597. package/src/generated/api/Notification.ts +7 -0
  598. package/src/generated/api/NotificationGrantRequest.ts +6 -0
  599. package/src/generated/api/NotificationInput.ts +1 -1
  600. package/src/generated/api/NotificationTriggeredEvent.ts +8 -0
  601. package/src/generated/api/OnlineAgent.ts +4 -0
  602. package/src/generated/api/OutputRef.ts +11 -0
  603. package/src/generated/api/OverlayView.ts +25 -0
  604. package/src/generated/api/Perspective.ts +4 -0
  605. package/src/generated/api/PerspectiveAddAutoProcessorParams.ts +11 -0
  606. package/src/generated/api/PerspectiveAddLinkExpressionParams.ts +4 -0
  607. package/src/generated/api/PerspectiveAddLinkParams.ts +4 -0
  608. package/src/generated/api/PerspectiveAddLinksParams.ts +4 -0
  609. package/src/generated/api/PerspectiveAddSdnaParams.ts +7 -0
  610. package/src/generated/api/PerspectiveAddSdnaResult.ts +6 -0
  611. package/src/generated/api/PerspectiveCommitBatchParams.ts +3 -0
  612. package/src/generated/api/PerspectiveCreateSubjectParams.ts +3 -0
  613. package/src/generated/api/PerspectiveEvaluateGettersParams.ts +6 -0
  614. package/src/generated/api/PerspectiveExecuteCommandsParams.ts +3 -0
  615. package/src/generated/api/PerspectiveExpression.ts +5 -0
  616. package/src/generated/api/PerspectiveFlowProposalParams.ts +3 -0
  617. package/src/generated/api/PerspectiveFlowReceiptVerdict.ts +8 -0
  618. package/src/generated/api/PerspectiveFlowValidOutputsParams.ts +7 -0
  619. package/src/generated/api/PerspectiveGetSubjectDataParams.ts +3 -0
  620. package/src/generated/api/PerspectiveHandle.ts +5 -0
  621. package/src/generated/api/PerspectiveLinkDiff.ts +7 -0
  622. package/src/generated/api/PerspectiveLinkMutationsParams.ts +4 -0
  623. package/src/generated/api/PerspectiveLinkUpdatedWithOwner.ts +4 -0
  624. package/src/generated/api/PerspectiveLinkWithOwner.ts +4 -0
  625. package/src/generated/api/PerspectiveMintFlowReceiptParams.ts +3 -0
  626. package/src/generated/api/PerspectiveMintFlowReceiptResult.ts +9 -0
  627. package/src/generated/api/PerspectiveModelQueryParams.ts +6 -0
  628. package/src/generated/api/PerspectiveModelSubscribeResult.ts +6 -0
  629. package/src/generated/api/PerspectiveNamedShacl.ts +4 -0
  630. package/src/generated/api/PerspectiveProposeFlowTransitionParams.ts +4 -0
  631. package/src/generated/api/PerspectiveQueryLinksParams.ts +11 -0
  632. package/src/generated/api/PerspectiveQueryParams.ts +3 -0
  633. package/src/generated/api/PerspectiveQuerySubscriptionFilter.ts +3 -0
  634. package/src/generated/api/PerspectiveReceiptOutcome.ts +3 -0
  635. package/src/generated/api/PerspectiveRejectFlowProposalResult.ts +3 -0
  636. package/src/generated/api/PerspectiveRemoveAutoProcessorParams.ts +3 -0
  637. package/src/generated/api/PerspectiveRemoveLinkParams.ts +4 -0
  638. package/src/generated/api/PerspectiveRemoveLinksParams.ts +4 -0
  639. package/src/generated/api/PerspectiveRemovedWithOwner.ts +3 -0
  640. package/src/generated/api/PerspectiveResolveInterpretationParams.ts +6 -0
  641. package/src/generated/api/PerspectiveShacl.ts +4 -0
  642. package/src/generated/api/PerspectiveShaclNameParams.ts +3 -0
  643. package/src/generated/api/PerspectiveSparqlParams.ts +7 -0
  644. package/src/generated/api/PerspectiveState.ts +3 -0
  645. package/src/generated/api/PerspectiveStateFilter.ts +5 -0
  646. package/src/generated/api/PerspectiveSubjectClassesOfParams.ts +3 -0
  647. package/src/generated/api/PerspectiveSubscribeQueryResult.ts +3 -0
  648. package/src/generated/api/PerspectiveSubscriptionParams.ts +3 -0
  649. package/src/generated/api/PerspectiveUnsignedInput.ts +4 -0
  650. package/src/generated/api/PerspectiveUpdateLinkParams.ts +5 -0
  651. package/src/generated/api/PerspectiveUpdateParams.ts +3 -0
  652. package/src/generated/api/PerspectiveUuidParams.ts +3 -0
  653. package/src/generated/api/PerspectiveVerifyFlowReceiptParams.ts +9 -0
  654. package/src/generated/api/PerspectiveWithOwner.ts +4 -0
  655. package/src/generated/api/ProposeOutcome.ts +46 -0
  656. package/src/generated/api/PublicPerspectiveInput.ts +4 -0
  657. package/src/generated/api/PublishNeighbourhoodRequest.ts +2 -2
  658. package/src/generated/api/RemoveLinkRequest.ts +1 -1
  659. package/src/generated/api/RemoveLinksBulkRequest.ts +1 -1
  660. package/src/generated/api/RequestCapabilityRequest.ts +4 -0
  661. package/src/generated/api/RequestPaymentRequest.ts +3 -0
  662. package/src/generated/api/Resource.ts +3 -0
  663. package/src/generated/api/RpcMethods.ts +419 -0
  664. package/src/generated/api/RunInterpretationRequest.ts +28 -2
  665. package/src/generated/api/RunInterpretationWithHarnessRequest.ts +51 -0
  666. package/src/generated/api/RuntimeComputeLogParams.ts +15 -0
  667. package/src/generated/api/RuntimeFriendStatusParams.ts +3 -0
  668. package/src/generated/api/RuntimeGrantNotificationParams.ts +3 -0
  669. package/src/generated/api/RuntimeImportPerspectiveResult.ts +3 -0
  670. package/src/generated/api/RuntimeImportResult.ts +8 -0
  671. package/src/generated/api/RuntimeInfo.ts +3 -0
  672. package/src/generated/api/RuntimeNotificationIdParams.ts +3 -0
  673. package/src/generated/api/RuntimeSendFriendMessageParams.ts +8 -0
  674. package/src/generated/api/RuntimeSetFreeHostingEnabledParams.ts +3 -0
  675. package/src/generated/api/RuntimeUnytSendHotParams.ts +3 -0
  676. package/src/generated/api/RuntimeUnytWalletHistoryParams.ts +3 -0
  677. package/src/generated/api/RuntimeUpdateNotificationParams.ts +3 -0
  678. package/src/generated/api/SentMessage.ts +4 -0
  679. package/src/generated/api/SetHostRatesRequest.ts +4 -0
  680. package/src/generated/api/SetHotWalletAddressRequest.ts +3 -0
  681. package/src/generated/api/SetOnlineStatusRequest.ts +3 -0
  682. package/src/generated/api/SetUnytMembraneProofRequest.ts +7 -0
  683. package/src/generated/api/SetUserFreeAccessRequest.ts +3 -0
  684. package/src/generated/api/ShaclLinkTriple.ts +8 -0
  685. package/src/generated/api/SignalRequest.ts +3 -0
  686. package/src/generated/api/SubscribeQueryRequest.ts +3 -0
  687. package/src/generated/api/TokenizerSource.ts +3 -0
  688. package/src/generated/api/TokenizerSourceInput.ts +3 -0
  689. package/src/generated/api/TranscriptionTextFilter.ts +3 -0
  690. package/src/generated/api/TriggeredNotification.ts +4 -0
  691. package/src/generated/api/TrustedAgentsWrapper.ts +6 -0
  692. package/src/generated/api/UnlockAgentRequest.ts +1 -1
  693. package/src/generated/api/UnytVersionInfo.ts +20 -0
  694. package/src/generated/api/UpdateLinkRequest.ts +1 -1
  695. package/src/generated/api/UpdateProfileRequest.ts +4 -0
  696. package/src/generated/api/UserCreationResult.ts +3 -0
  697. package/src/generated/api/UserStatistics.ts +2 -1
  698. package/src/generated/api/UsersAppInfo.ts +6 -0
  699. package/src/generated/api/UsersEmailParams.ts +3 -0
  700. package/src/generated/api/UsersEmailTestAction.ts +3 -0
  701. package/src/generated/api/UsersEmailTestParams.ts +12 -0
  702. package/src/generated/api/UsersEmailTestResult.ts +7 -0
  703. package/src/generated/api/UsersLoginParams.ts +7 -0
  704. package/src/generated/api/UsersRequestVerificationParams.ts +4 -0
  705. package/src/generated/api/UsersSetCreditsParams.ts +3 -0
  706. package/src/generated/api/UsersVerifyEmailParams.ts +11 -0
  707. package/src/generated/api/ValidOutput.ts +30 -0
  708. package/src/generated/api/VoiceActivityParamsInput.ts +3 -0
  709. package/src/generated/api/index.ts +11 -2
  710. package/src/generated/api/serde_json/JsonValue.ts +3 -0
  711. package/src/index.ts +2 -3
  712. package/src/language/LanguageClient.ts +12 -13
  713. package/src/links/Links.ts +49 -3
  714. package/src/model/Ad4mModel.test.ts +308 -25
  715. package/src/model/Ad4mModel.ts +136 -73
  716. package/src/model/ModelQueryBuilder.ts +65 -18
  717. package/src/model/decorators.ts +64 -9
  718. package/src/model/query-sparql.ts +2 -3
  719. package/src/model/relation-filtering.test.ts +191 -0
  720. package/src/model/shacl-gen.ts +19 -9
  721. package/src/model/shacl-roundtrip.test.ts +52 -0
  722. package/src/model/types.ts +12 -0
  723. package/src/neighbourhood/NeighbourhoodClient.test.ts +60 -0
  724. package/src/neighbourhood/NeighbourhoodClient.ts +27 -27
  725. package/src/neighbourhood/NeighbourhoodProxy.test.ts +14 -9
  726. package/src/notifyListeners.test.ts +19 -0
  727. package/src/notifyListeners.ts +10 -0
  728. package/src/perspectives/AutoProcessor.ts +13 -82
  729. package/src/perspectives/FlowInstance.ts +29 -2
  730. package/src/perspectives/FlowModels.ts +47 -2
  731. package/src/perspectives/InterpretationModels.ts +4 -0
  732. package/src/perspectives/Perspective.ts +18 -2
  733. package/src/perspectives/PerspectiveClient.test.ts +122 -45
  734. package/src/perspectives/PerspectiveClient.ts +106 -303
  735. package/src/perspectives/PerspectiveHandle.ts +32 -9
  736. package/src/perspectives/PerspectiveProxy.test.ts +198 -194
  737. package/src/perspectives/PerspectiveProxy.ts +159 -226
  738. package/src/perspectives/WakerSubscriptionManager.test.ts +54 -1
  739. package/src/perspectives/WakerSubscriptionManager.ts +4 -8
  740. package/src/perspectives/link-updated-type.test.ts +55 -0
  741. package/src/perspectives/listener-leaks.test.ts +204 -0
  742. package/src/perspectives/shacl-rpc.test.ts +22 -27
  743. package/src/runtime/RuntimeClient.ts +75 -157
  744. package/src/runtime/RuntimeTypes.ts +3 -3
  745. package/src/shacl/SHACLFlow.test.ts +49 -1
  746. package/src/shacl/SHACLFlow.ts +66 -11
  747. package/src/shacl/SHACLShape.test.ts +160 -16
  748. package/src/shacl/SHACLShape.ts +160 -438
  749. package/lib/shims/reflect-metadata.d.ts +0 -0
  750. package/lib/shims/reflect-metadata.js +0 -0
  751. package/lib/shims/type-graphql.d.ts +0 -32
  752. package/lib/shims/type-graphql.js +0 -70
  753. package/lib/src/PubSub.d.ts +0 -17
  754. package/lib/src/PubSub.js +0 -17
  755. package/lib/src/agent/AgentResolver.d.ts +0 -30
  756. package/lib/src/agent/AgentResolver.js +0 -325
  757. package/lib/src/ai/AIResolver.d.ts +0 -75
  758. package/lib/src/ai/AIResolver.js +0 -455
  759. package/lib/src/buildSchema.d.ts +0 -1
  760. package/lib/src/buildSchema.js +0 -38
  761. package/lib/src/expression/ExpressionResolver.d.ts +0 -10
  762. package/lib/src/expression/ExpressionResolver.js +0 -106
  763. package/lib/src/language/LanguageContext.d.ts +0 -37
  764. package/lib/src/language/LanguageContext.js +0 -2
  765. package/lib/src/language/LanguageResolver.d.ts +0 -19
  766. package/lib/src/language/LanguageResolver.js +0 -143
  767. package/lib/src/links/Links.test.js +0 -33
  768. package/lib/src/model/Ad4mModel.test.js +0 -2055
  769. package/lib/src/model/Subject.d.ts +0 -25
  770. package/lib/src/model/Subject.js +0 -164
  771. package/lib/src/model/hydration-batch.d.ts +0 -34
  772. package/lib/src/model/hydration-batch.js +0 -147
  773. package/lib/src/model/hydration-batching.test.d.ts +0 -7
  774. package/lib/src/model/hydration-batching.test.js +0 -456
  775. package/lib/src/model/model-manifest.d.ts +0 -41
  776. package/lib/src/model/model-manifest.js +0 -11
  777. package/lib/src/model/prolog-facts.d.ts +0 -37
  778. package/lib/src/model/prolog-facts.js +0 -134
  779. package/lib/src/model/query-cache.test.js +0 -43
  780. package/lib/src/model/query-prolog.d.ts +0 -15
  781. package/lib/src/model/query-prolog.js +0 -140
  782. package/lib/src/model/query-sparql-batch.d.ts +0 -17
  783. package/lib/src/model/query-sparql-batch.js +0 -260
  784. package/lib/src/model/query-sparql.test.js +0 -312
  785. package/lib/src/model/relation-filtering.test.js +0 -838
  786. package/lib/src/model/subscription-delta.test.d.ts +0 -24
  787. package/lib/src/model/subscription-delta.test.js +0 -180
  788. package/lib/src/model/subscription-pool.d.ts +0 -39
  789. package/lib/src/model/subscription-pool.js +0 -165
  790. package/lib/src/neighbourhood/NeighbourhoodProxy.test.js +0 -73
  791. package/lib/src/neighbourhood/NeighbourhoodResolver.d.ts +0 -24
  792. package/lib/src/neighbourhood/NeighbourhoodResolver.js +0 -182
  793. package/lib/src/perspectives/Perspective.test.js +0 -20
  794. package/lib/src/perspectives/PerspectiveClient.test.js +0 -224
  795. package/lib/src/perspectives/PerspectiveResolver.d.ts +0 -56
  796. package/lib/src/perspectives/PerspectiveResolver.js +0 -519
  797. package/lib/src/runtime/RuntimeResolver.d.ts +0 -173
  798. package/lib/src/runtime/RuntimeResolver.js +0 -1122
  799. package/lib/src/schema.gql +0 -631
  800. package/lib/src/shacl/SHACLFlow.test.js +0 -205
  801. package/lib/src/shacl/SHACLShape.test.js +0 -418
  802. package/lib/src/unwrapApolloResult.d.ts +0 -2
  803. package/lib/src/unwrapApolloResult.js +0 -14
  804. /package/lib/src/{links/Links.test.d.ts → generated/api/AITask.js} +0 -0
  805. /package/lib/src/{model/Ad4mModel.test.d.ts → generated/api/AITaskInput.js} +0 -0
  806. /package/lib/src/{model/query-cache.test.d.ts → generated/api/Agent.js} +0 -0
  807. /package/lib/src/{model/query-sparql.test.d.ts → generated/api/AgentAddEntanglementProofsParams.js} +0 -0
  808. /package/lib/src/{model/relation-filtering.test.d.ts → generated/api/AgentStatus.js} +0 -0
  809. /package/lib/src/{neighbourhood/NeighbourhoodProxy.test.d.ts → generated/api/AgentStatusChangedEvent.js} +0 -0
  810. /package/lib/src/{perspectives/Perspective.test.d.ts → generated/api/AgentUpdatedEvent.js} +0 -0
  811. /package/lib/src/{perspectives/PerspectiveClient.test.d.ts → generated/api/AiAddModelParams.js} +0 -0
  812. /package/lib/src/{shacl/SHACLFlow.test.d.ts → generated/api/AiAddTaskParams.js} +0 -0
  813. /package/lib/src/{shacl/SHACLShape.test.d.ts → generated/api/AiGetDefaultModelParams.js} +0 -0
@@ -1,149 +1,108 @@
1
- import { ApiClient } from "../apiClient"
1
+ import {ApiClient, CallOptions } from '../apiClient'
2
2
  import { Perspective, PerspectiveExpression } from "../perspectives/Perspective"
3
- import { RuntimeInfo, ExceptionInfo, SentMessage, NotificationInput, Notification, TriggeredNotification, ImportResult, UserStatistics } from "./RuntimeTypes"
4
- import type {
5
- OpenLinkRequest,
6
- TrustedAgentsRequest,
7
- LinkLanguageTemplatesRequest,
8
- FriendsListRequest,
9
- VerifySignatureRequest,
10
- SetStatusRequest,
11
- FriendSendMessageRequest,
12
- ExportRequest,
13
- ImportRequest,
14
- SetMultiUserRequest,
15
- SetFreeHostingEnabledRequest,
16
- } from "../generated/api"
17
-
18
- export type MessageCallback = (message: PerspectiveExpression) => null
19
- export type ExceptionCallback = (info: ExceptionInfo) => null
20
- export type NotificationTriggeredCallback = (notification: TriggeredNotification) => null
21
- export type NotificationRequestedCallback = (notification: Notification) => null
22
-
23
- function normalizeExceptionType(type: ExceptionInfo['type'] | string): ExceptionInfo['type'] {
24
- if (typeof type !== 'string' || type === type.toUpperCase()) {
25
- return type as ExceptionInfo['type']
26
- }
27
-
28
- return type
29
- .replace(/([a-z0-9])([A-Z])/g, '$1_$2')
30
- .replace(/([A-Z])([A-Z][a-z])/g, '$1_$2')
31
- .toUpperCase() as ExceptionInfo['type']
32
- }
3
+ import { RuntimeInfo, SentMessage, NotificationInput, Notification, ImportResult, UserStatistics } from "./RuntimeTypes"
4
+ import type { HostRate, UnytVersionInfo } from "../generated/api"
33
5
 
34
6
  export class RuntimeClient {
35
7
  #apiClient: ApiClient
36
- #messageReceivedCallbacks: MessageCallback[]
37
- #exceptionOccurredCallbacks: ExceptionCallback[]
38
- #notificationTriggeredCallbacks: NotificationTriggeredCallback[]
39
- #notificationRequestedCallbacks: NotificationRequestedCallback[]
40
- #unsubscribers: (() => void)[]
41
8
 
42
- constructor(baseUrl: string, token?: string, subscribe: boolean = true, sharedApiClient?: ApiClient) {
9
+ constructor(baseUrl: string, token?: string, sharedApiClient?: ApiClient) {
43
10
  this.#apiClient = sharedApiClient || new ApiClient(baseUrl, token)
44
- this.#messageReceivedCallbacks = []
45
- this.#exceptionOccurredCallbacks = []
46
- this.#notificationTriggeredCallbacks = []
47
- this.#notificationRequestedCallbacks = []
48
- this.#unsubscribers = []
49
-
50
- if(subscribe) {
51
- this.subscribeMessageReceived()
52
- this.subscribeExceptionOccurred()
53
- this.subscribeNotificationTriggered()
54
- }
55
11
  }
56
12
 
57
13
  async info(): Promise<RuntimeInfo> {
58
- return this.#apiClient.call<RuntimeInfo>('runtime.info')
14
+ return this.#apiClient.call('runtime.info', {})
59
15
  }
60
16
 
61
17
  async tlsDomain(): Promise<string | null> {
62
- return this.#apiClient.call<string | null>('runtime.tlsDomain')
18
+ return this.#apiClient.call('runtime.tlsDomain', {})
63
19
  }
64
20
 
65
21
  async quit(): Promise<Boolean> {
66
- return this.#apiClient.call<Boolean>('runtime.quit')
22
+ return this.#apiClient.call('runtime.quit', {})
67
23
  }
68
24
 
69
25
  async openLink(url: string): Promise<Boolean> {
70
- return this.#apiClient.call<Boolean>('runtime.openLink', { url })
26
+ return this.#apiClient.call('runtime.openLink', { url })
71
27
  }
72
28
 
73
29
  async addTrustedAgents(agents: string[]): Promise<string[]> {
74
- return this.#apiClient.call<string[]>('agent.addTrustedAgents', { agents })
30
+ return this.#apiClient.call('agent.addTrustedAgents', { agents })
75
31
  }
76
32
 
77
33
  async deleteTrustedAgents(agents: string[]): Promise<string[]> {
78
- return this.#apiClient.call<string[]>('agent.deleteTrustedAgents', { agents })
34
+ return this.#apiClient.call('agent.deleteTrustedAgents', { agents })
79
35
  }
80
36
 
81
37
  async getTrustedAgents(): Promise<string[]> {
82
- return this.#apiClient.call<string[]>('agent.getTrustedAgents')
38
+ return this.#apiClient.call('agent.getTrustedAgents', {})
83
39
  }
84
40
 
85
41
  async addKnownLinkLanguageTemplates(addresses: string[]): Promise<string[]> {
86
- return this.#apiClient.call<string[]>('runtime.addLinkLanguageTemplates', { addresses })
42
+ return this.#apiClient.call('runtime.addLinkLanguageTemplates', { addresses })
87
43
  }
88
44
 
89
45
  async removeKnownLinkLanguageTemplates(addresses: string[]): Promise<string[]> {
90
- return this.#apiClient.call<string[]>('runtime.removeLinkLanguageTemplates', { addresses })
46
+ return this.#apiClient.call('runtime.removeLinkLanguageTemplates', { addresses })
91
47
  }
92
48
 
93
49
  async knownLinkLanguageTemplates(): Promise<string[]> {
94
- return this.#apiClient.call<string[]>('runtime.linkLanguageTemplates')
50
+ return this.#apiClient.call('runtime.linkLanguageTemplates', {})
95
51
  }
96
52
 
97
53
  async addFriends(dids: string[]): Promise<string[]> {
98
- return this.#apiClient.call<string[]>('runtime.addFriends', { dids })
54
+ return this.#apiClient.call('runtime.addFriends', { dids })
99
55
  }
100
56
 
101
57
  async removeFriends(dids: string[]): Promise<string[]> {
102
- return this.#apiClient.call<string[]>('runtime.removeFriends', { dids })
58
+ return this.#apiClient.call('runtime.removeFriends', { dids })
103
59
  }
104
60
 
105
61
  async friends(): Promise<string[]> {
106
- return this.#apiClient.call<string[]>('runtime.friends')
62
+ return this.#apiClient.call('runtime.friends', {})
107
63
  }
108
64
 
109
65
  async hcAgentInfos(): Promise<string[]> {
110
- return this.#apiClient.call<string[]>('runtime.hcAgentInfos')
66
+ return this.#apiClient.call('runtime.hcAgentInfos', {})
111
67
  }
112
68
 
113
69
  async getNetworkMetrics(): Promise<string> {
114
- return this.#apiClient.call<string>('runtime.networkMetrics')
70
+ return this.#apiClient.call('runtime.networkMetrics', {})
115
71
  }
116
72
 
117
- async restartHolochain(): Promise<boolean> {
118
- return this.#apiClient.call<boolean>('runtime.restartHolochain')
73
+ async restartHolochain(options?: CallOptions): Promise<boolean> {
74
+ return this.#apiClient.call('runtime.restartHolochain', {}, options)
119
75
  }
120
76
 
121
77
  async hcAddAgentInfos(agentInfos: string[]): Promise<boolean> {
122
- return this.#apiClient.call<boolean>('runtime.addHcAgentInfos', { agentInfos })
78
+ return this.#apiClient.call('runtime.addHcAgentInfos', { agentInfos })
123
79
  }
124
80
 
125
81
  async verifyStringSignedByDid(did: string, didSigningKeyId: string, data: string, signedData: string): Promise<boolean> {
126
- return this.#apiClient.call<boolean>('runtime.verifySignature', { did, didSigningKeyId, data, signedData })
82
+ // The executor resolves the key from the DID document; `didSigningKeyId` goes unused.
83
+ return this.#apiClient.call('runtime.verifySignature', { did, data, signedData })
127
84
  }
128
85
 
129
86
  async setStatus(perspective: Perspective): Promise<boolean> {
130
- return this.#apiClient.call<boolean>('runtime.setStatus', { status: perspective })
87
+ return this.#apiClient.call('runtime.setStatus', { status: Perspective.toWire(perspective) })
131
88
  }
132
89
 
133
90
  async friendStatus(did: string): Promise<PerspectiveExpression> {
134
- return this.#apiClient.call<PerspectiveExpression>('runtime.friendStatus', { did })
91
+ const status = await this.#apiClient.call('runtime.friendStatus', { did })
92
+ return status ? PerspectiveExpression.fromWire(status) : null
135
93
  }
136
94
 
137
95
  async friendSendMessage(did: string, message: Perspective): Promise<boolean> {
138
- return this.#apiClient.call<boolean>('runtime.sendFriendMessage', { did, message })
96
+ return this.#apiClient.call('runtime.sendFriendMessage', { did, message: Perspective.toWire(message) })
139
97
  }
140
98
 
141
- async messageInbox(filter?: string): Promise<PerspectiveExpression[]> {
142
- return this.#apiClient.call<PerspectiveExpression[]>('runtime.inbox', { filter })
99
+ async messageInbox(): Promise<PerspectiveExpression[]> {
100
+ return (await this.#apiClient.call('runtime.inbox', {})).map(PerspectiveExpression.fromWire)
143
101
  }
144
102
 
145
- async messageOutbox(filter?: string): Promise<SentMessage[]> {
146
- return this.#apiClient.call<SentMessage[]>('runtime.outbox', { filter })
103
+ async messageOutbox(): Promise<SentMessage[]> {
104
+ const sent = await this.#apiClient.call('runtime.outbox', {})
105
+ return sent.map(({ recipient, message }) => ({ recipient, message: PerspectiveExpression.fromWire(message) }))
147
106
  }
148
107
 
149
108
  async requestInstallNotification(notification: NotificationInput) {
@@ -151,177 +110,136 @@ export class RuntimeClient {
151
110
  }
152
111
 
153
112
  async grantNotification(id: string): Promise<boolean> {
154
- return this.#apiClient.call<boolean>('runtime.grantNotification', { id, granted: true })
113
+ return this.#apiClient.call('runtime.grantNotification', { id, granted: true })
155
114
  }
156
115
 
157
116
  async exportDb(filePath: string): Promise<boolean> {
158
- return this.#apiClient.call<boolean>('runtime.exportData', { type: "db", filePath })
117
+ return this.#apiClient.call('runtime.exportData', { type: "db", filePath })
159
118
  }
160
119
 
161
120
  async importDb(filePath: string): Promise<ImportResult> {
162
- return this.#apiClient.call<ImportResult>('runtime.importData', { type: "db", filePath })
121
+ const result = await this.#apiClient.call('runtime.importData', { type: "db", filePath })
122
+ if ('success' in result) throw new Error('runtime.importData answered a perspective import for type "db"')
123
+ return result
163
124
  }
164
125
 
165
126
  async notifications(): Promise<Notification[]> {
166
- return this.#apiClient.call<Notification[]>('runtime.notifications')
127
+ return this.#apiClient.call('runtime.notifications', {})
167
128
  }
168
129
 
169
130
  async updateNotification(id: string, notification: NotificationInput): Promise<boolean> {
170
- return this.#apiClient.call<boolean>('runtime.updateNotification', { ...notification, id })
131
+ return this.#apiClient.call('runtime.updateNotification', { ...notification, id })
171
132
  }
172
133
 
173
134
  async removeNotification(id: string): Promise<boolean> {
174
- return this.#apiClient.call<boolean>('runtime.deleteNotification', { id })
135
+ return this.#apiClient.call('runtime.deleteNotification', { id })
175
136
  }
176
137
 
177
138
  async exportPerspective(uuid: string, filePath: string): Promise<boolean> {
178
- return this.#apiClient.call<boolean>('runtime.exportData', { type: "perspective", perspectiveUuid: uuid, filePath })
139
+ return this.#apiClient.call('runtime.exportData', { type: "perspective", perspectiveUuid: uuid, filePath })
179
140
  }
180
141
 
181
142
  async importPerspective(filePath: string): Promise<boolean> {
182
- return this.#apiClient.call<boolean>('runtime.importData', { type: "perspective", filePath })
143
+ const result = await this.#apiClient.call('runtime.importData', { type: "perspective", filePath })
144
+ return 'success' in result && result.success
183
145
  }
184
146
 
185
147
  async multiUserEnabled(): Promise<boolean> {
186
- return this.#apiClient.call<boolean>('user.multiUserEnabled')
148
+ return this.#apiClient.call('user.multiUserEnabled', {})
187
149
  }
188
150
 
189
151
  async setMultiUserEnabled(enabled: boolean): Promise<boolean> {
190
- return this.#apiClient.call<boolean>('user.setMultiUserEnabled', { enabled })
152
+ return this.#apiClient.call('user.setMultiUserEnabled', { enabled })
191
153
  }
192
154
 
193
155
  async freeHostingEnabled(): Promise<boolean> {
194
- return this.#apiClient.call<boolean>('runtime.freeHostingEnabled')
156
+ return this.#apiClient.call('runtime.freeHostingEnabled', {})
195
157
  }
196
158
 
197
159
  async setFreeHostingEnabled(enabled: boolean): Promise<boolean> {
198
- return this.#apiClient.call<boolean>('runtime.setFreeHostingEnabled', { enabled })
160
+ return this.#apiClient.call('runtime.setFreeHostingEnabled', { enabled })
199
161
  }
200
162
 
201
163
  async listUsers(): Promise<UserStatistics[]> {
202
- return this.#apiClient.call<UserStatistics[]>('user.list')
164
+ return this.#apiClient.call('user.list', {})
203
165
  }
204
166
 
205
167
  async userWalletAddress(email: string): Promise<string | null> {
206
- return this.#apiClient.call<string | null>('user.wallet', { email })
168
+ return this.#apiClient.call('user.wallet', { email })
207
169
  }
208
170
 
209
171
  async emailTestModeEnable(): Promise<boolean> {
210
- return this.#apiClient.call<boolean>('user.emailTest', { action: 'enable' })
172
+ return (await this.#apiClient.call('user.emailTest', { action: 'enable' })) === true
211
173
  }
212
174
 
213
175
  async emailTestModeDisable(): Promise<boolean> {
214
- return this.#apiClient.call<boolean>('user.emailTest', { action: 'disable' })
176
+ return (await this.#apiClient.call('user.emailTest', { action: 'disable' })) === true
215
177
  }
216
178
 
217
179
  async emailTestGetCode(email: string): Promise<string | null> {
218
- return this.#apiClient.call<string | null>('user.emailTest', { action: 'get-code', email })
180
+ const code = await this.#apiClient.call('user.emailTest', { action: 'get-code', email })
181
+ return typeof code === 'string' ? code : null
219
182
  }
220
183
 
221
184
  async emailTestClearCodes(): Promise<boolean> {
222
- return this.#apiClient.call<boolean>('user.emailTest', { action: 'clear-codes' })
185
+ return (await this.#apiClient.call('user.emailTest', { action: 'clear-codes' })) === true
223
186
  }
224
187
 
225
188
  async emailTestSetExpiry(email: string, verificationType: string, expiresAt: number): Promise<boolean> {
226
- return this.#apiClient.call<boolean>('user.emailTest', { action: 'set-expiry', email, verificationType, expiresAt })
189
+ return (await this.#apiClient.call('user.emailTest', { action: 'set-expiry', email, verificationType, expiresAt })) === true
227
190
  }
228
191
 
229
192
  // ---- Unyt / mHOT methods ----
230
193
 
231
194
  async unytAgentKey(): Promise<string> {
232
- return this.#apiClient.call<string>('runtime.unytAgentKey')
195
+ return this.#apiClient.call('runtime.unytAgentKey', {})
233
196
  }
234
197
 
235
198
  async unytHotAgentPubkey(): Promise<string> {
236
- return this.#apiClient.call<string>('runtime.unytHotAgentPubkey')
199
+ return this.#apiClient.call('runtime.unytHotAgentPubkey', {})
237
200
  }
238
201
 
239
202
  async unytWalletBalance(): Promise<string> {
240
- return this.#apiClient.call<string>('runtime.unytWalletBalance')
203
+ return this.#apiClient.call('runtime.unytWalletBalance', {})
241
204
  }
242
205
 
243
206
  async unytWalletHistory(page?: number, perPage?: number): Promise<string> {
244
- return this.#apiClient.call<string>('runtime.unytWalletHistory', { page, perPage })
207
+ return this.#apiClient.call('runtime.unytWalletHistory', { page, perPage })
245
208
  }
246
209
 
247
- async unytVersionInfo(): Promise<string> {
248
- return this.#apiClient.call<string>('runtime.unytVersionInfo')
210
+ /** Installed and bundled DNA versions, and why the last install failed (`installError`). */
211
+ async unytVersionInfo(): Promise<UnytVersionInfo> {
212
+ return this.#apiClient.call('runtime.unytVersionInfo', {})
249
213
  }
250
214
 
251
- async unytSetMembraneProof(proof: string): Promise<{ success: boolean; message: string }> {
252
- return this.#apiClient.call<{ success: boolean; message: string }>('runtime.unytSetMembraneProof', { proof })
215
+ /** Stores the membrane proof (base64); the executor then installs the Unyt DNA in the
216
+ * background. Poll {@link unytVersionInfo} for the outcome. */
217
+ async setUnytMembraneProof(proof: string): Promise<boolean> {
218
+ return this.#apiClient.call('runtime.setUnytMembraneProof', { proof })
253
219
  }
254
220
 
255
221
  async unytReinstallDna(): Promise<{ success: boolean; message: string }> {
256
- return this.#apiClient.call<{ success: boolean; message: string }>('runtime.unytReinstallDna')
222
+ return this.#apiClient.call('runtime.unytReinstallDna', {})
257
223
  }
258
224
 
259
225
  async unytSendHot(recipient: string, amount: string): Promise<{ success: boolean; message: string }> {
260
- return this.#apiClient.call<{ success: boolean; message: string }>('runtime.unytSendHot', { recipient, amount })
226
+ return this.#apiClient.call('runtime.unytSendHot', { recipient, amount })
261
227
  }
262
228
 
263
229
  async setUserCredits(email: string, amount: number): Promise<boolean> {
264
- return this.#apiClient.call<boolean>('user.credits', { email, amount })
230
+ return this.#apiClient.call('user.credits', { email, amount })
265
231
  }
266
232
 
267
233
  async setUserFreeAccess(email: string, enabled: boolean): Promise<boolean> {
268
- return this.#apiClient.call<boolean>('user.freeAccess', { email, enabled })
269
- }
270
-
271
- async setHostRates(ratesJson: string): Promise<boolean> {
272
- return this.#apiClient.call<boolean>('runtime.setHostRates', { ratesJson })
234
+ return this.#apiClient.call('user.freeAccess', { email, enabled })
273
235
  }
274
236
 
275
- async getHostRates(): Promise<{ description: string; priceInHOT: number }[]> {
276
- const result = await this.#apiClient.call<string>('runtime.getHostRates')
277
- try {
278
- return JSON.parse(result)
279
- } catch {
280
- return []
281
- }
237
+ async setHostRates(rates: HostRate[]): Promise<boolean> {
238
+ return this.#apiClient.call('runtime.setHostRates', { rates })
282
239
  }
283
240
 
284
- addNotificationTriggeredCallback(cb: NotificationTriggeredCallback) {
285
- this.#notificationTriggeredCallbacks.push(cb)
241
+ async hostRates(): Promise<HostRate[]> {
242
+ return this.#apiClient.call('runtime.hostRates', {})
286
243
  }
287
244
 
288
- subscribeNotificationTriggered() {
289
- const unsub = this.#apiClient.subscribe((data) => {
290
- if (data.type === 'notification-triggered') {
291
- this.#notificationTriggeredCallbacks.forEach(cb => cb(data.notification as TriggeredNotification))
292
- }
293
- })
294
- this.#unsubscribers.push(unsub)
295
- }
296
-
297
- addMessageCallback(cb: MessageCallback) {
298
- this.#messageReceivedCallbacks.push(cb)
299
- }
300
-
301
- subscribeMessageReceived() {
302
- const unsub = this.#apiClient.subscribe((data) => {
303
- if (data.type === 'message-received') {
304
- this.#messageReceivedCallbacks.forEach(cb => cb(data.message as PerspectiveExpression))
305
- }
306
- })
307
- this.#unsubscribers.push(unsub)
308
- }
309
-
310
- addExceptionCallback(cb: ExceptionCallback) {
311
- this.#exceptionOccurredCallbacks.push(cb)
312
- }
313
-
314
- subscribeExceptionOccurred() {
315
- const unsub = this.#apiClient.subscribe((data) => {
316
- if (data.type === 'exception-occurred' && data.exception) {
317
- const exception = data.exception as ExceptionInfo
318
- const normalizedException = {
319
- ...exception,
320
- type: normalizeExceptionType(exception.type),
321
- }
322
- this.#exceptionOccurredCallbacks.forEach(cb => cb(normalizedException))
323
- }
324
- })
325
- this.#unsubscribers.push(unsub)
326
- }
327
245
  }
@@ -115,11 +115,11 @@ export class HostingUserInfo {
115
115
 
116
116
  export class PaymentRequestResult {
117
117
  success: boolean;
118
- message: string;
118
+ amountHOT: string;
119
119
 
120
- constructor(success: boolean, message: string) {
120
+ constructor(success: boolean, amountHOT: string) {
121
121
  this.success = success;
122
- this.message = message;
122
+ this.amountHOT = amountHOT;
123
123
  }
124
124
  }
125
125
 
@@ -19,7 +19,15 @@ describe('SHACLFlow', () => {
19
19
 
20
20
  it('generates correct transition URIs', () => {
21
21
  const flow = new SHACLFlow('TODO', 'todo://');
22
- expect(flow.transitionUri('ready', 'doing')).toBe('todo://TODO.readyTodoing');
22
+ expect(flow.transitionUri('ready', 'doing', 'Start')).toBe('todo://TODO.transition/ready/doing/Start');
23
+ });
24
+
25
+ it('encodes transition URI parts like the executor flow writer', () => {
26
+ // Same fixture as `transition_uri_encodes_parts_like_the_sdk` in
27
+ // rust-executor/src/perspectives/shacl_parser.rs.
28
+ const flow = new SHACLFlow('TODO', 'todo://');
29
+ expect(flow.transitionUri("in review", "a/b", "Fast-track!*'()~._"))
30
+ .toBe("todo://TODO.transition/in%20review/a%2Fb/Fast-track%21%2A%27%28%29~._");
23
31
  });
24
32
  });
25
33
 
@@ -961,4 +969,44 @@ describe('SHACLFlow', () => {
961
969
  expect(roundTripped.consensusRule?.fromRole?.where?.agent).toBe('$did');
962
970
  });
963
971
  });
972
+
973
+ describe('transition URIs', () => {
974
+ const byKey = (ts: FlowTransition[]) =>
975
+ ts.map(t => `${t.fromState}->${t.toState}:${t.actionName}:${JSON.stringify(t.actions)}`).sort();
976
+
977
+ const roundTrip = (flow: SHACLFlow) => SHACLFlow.fromLinks(flow.toLinks(), flow.flowUri);
978
+
979
+ it('keeps two transitions between the same states after toLinks -> fromLinks', () => {
980
+ const flow = new SHACLFlow('Review', 'review://');
981
+ flow.addState({ name: 'review', value: 0 });
982
+ flow.addState({ name: 'done', value: 1 });
983
+ flow.addTransition({ actionName: 'Approve', fromState: 'review', toState: 'done', actions: [{ action: 'addLink', source: 'this', predicate: 'review://by', target: 'approver' }] });
984
+ flow.addTransition({ actionName: 'Fast-track', fromState: 'review', toState: 'done', actions: [] });
985
+
986
+ expect(byKey(roundTrip(flow).transitions)).toEqual(byKey(flow.transitions));
987
+ });
988
+
989
+ it('does not collide "a" -> "Tob" with "aTo" -> "b"', () => {
990
+ const flow = new SHACLFlow('F', 'f://');
991
+ for (const [name, value] of [['a', 0], ['Tob', 1], ['aTo', 2], ['b', 3]] as const) {
992
+ flow.addState({ name, value });
993
+ }
994
+ flow.addTransition({ actionName: 'Go', fromState: 'a', toState: 'Tob', actions: [] });
995
+ flow.addTransition({ actionName: 'Go', fromState: 'aTo', toState: 'b', actions: [] });
996
+
997
+ expect(byKey(roundTrip(flow).transitions)).toEqual(byKey(flow.transitions));
998
+ });
999
+ });
1000
+
1001
+ describe('initial state ordering', () => {
1002
+ it('fromJSON sorts states by value', () => {
1003
+ const flow = new SHACLFlow('TODO', 'todo://');
1004
+ flow.addState({ name: 'done', value: 1 });
1005
+ flow.addState({ name: 'ready', value: 0 });
1006
+ flow.addState({ name: 'doing', value: 0.5 });
1007
+
1008
+ const fromJSON = SHACLFlow.fromJSON(flow.toJSON());
1009
+ expect(fromJSON.states.map(s => s.name)).toEqual(['ready', 'doing', 'done']);
1010
+ });
1011
+ });
964
1012
  });
@@ -180,6 +180,14 @@ export interface ConsensusRule {
180
180
  * query are counted. Two evaluation shapes (design §7.2):
181
181
  * Shape 1 — `didProperty` present: run once, extract DIDs from matches.
182
182
  * Shape 2 — `$did` templated in `where`: run per candidate.
183
+ *
184
+ * The executor refuses a rule with a key it does not know, anywhere in
185
+ * the rule (a misspelt `fromRole`, or `grantedByFlow` inside it), and a
186
+ * key written twice. `addFlow` rejects such a definition before storing
187
+ * it, with an error naming the state and the key. A definition that
188
+ * arrived by sync is refused when read: the edge fires for nobody and the
189
+ * executor log names the key. It does not drop the key and read a wider
190
+ * gate.
183
191
  */
184
192
  fromRole?: ModelQuery;
185
193
  }
@@ -338,6 +346,47 @@ export interface FlowTransition {
338
346
  * ```
339
347
  */
340
348
  export class SHACLFlow {
349
+ /**
350
+ * Every predicate {@link toLinks} writes from the flow's own URI. The
351
+ * flow's URI also carries links the definition does not own (a receipt
352
+ * index, for one), so replacing a definition removes only these from it.
353
+ * Keep in step with `toLinks`.
354
+ */
355
+ static readonly FLOW_LEVEL_PREDICATES: readonly string[] = [
356
+ "rdf://type",
357
+ "ad4m://flowName",
358
+ "ad4m://interpretationHint",
359
+ "ad4m://inputTypes",
360
+ "ad4m://outputTypes",
361
+ "ad4m://creationHint",
362
+ "ad4m://context",
363
+ "ad4m://consensusRule",
364
+ "ad4m://hasState",
365
+ "ad4m://hasTransition",
366
+ ];
367
+
368
+ /**
369
+ * Every predicate {@link toLinks} writes from a state's or a transition's
370
+ * URI, plus the retired `ad4m://stateCheck`, so a re-add still clears it
371
+ * from an older definition. These URIs can carry links the definition does
372
+ * not own too (an app's label on a state, for one), so replacing a
373
+ * definition removes only these from them. Keep in step with `toLinks`.
374
+ */
375
+ static readonly STATE_AND_TRANSITION_PREDICATES: readonly string[] = [
376
+ "rdf://type",
377
+ "ad4m://stateName",
378
+ "ad4m://stateValue",
379
+ "ad4m://interpretationHint",
380
+ "ad4m://requires",
381
+ "ad4m://semanticCheck",
382
+ "ad4m://consensusRule",
383
+ "ad4m://stateCheck",
384
+ "ad4m://actionName",
385
+ "ad4m://fromState",
386
+ "ad4m://toState",
387
+ "ad4m://transitionActions",
388
+ ];
389
+
341
390
  /** Flow name (e.g., "TODO") */
342
391
  public name: string;
343
392
 
@@ -488,10 +537,14 @@ export class SHACLFlow {
488
537
  }
489
538
 
490
539
  /**
491
- * Get a transition URI
540
+ * Get a transition URI: `{namespace}{name}.transition/{from}/{to}/{action}`.
541
+ * Each part is RFC 3986-encoded, so the URI is unique per transition. The
542
+ * executor's flow writer (`parse_flow_to_links`) builds the same URI.
492
543
  */
493
- transitionUri(fromState: string, toState: string): string {
494
- return `${this.namespace}${this.name}.${fromState}To${toState}`;
544
+ transitionUri(fromState: string, toState: string, actionName: string): string {
545
+ const part = (s: string) =>
546
+ encodeURIComponent(s).replace(/[!'()*]/g, c => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
547
+ return `${this.namespace}${this.name}.transition/${part(fromState)}/${part(toState)}/${part(actionName)}`;
495
548
  }
496
549
 
497
550
  /**
@@ -660,7 +713,7 @@ export class SHACLFlow {
660
713
 
661
714
  // Transitions
662
715
  for (const transition of this._transitions) {
663
- const transitionUri = this.transitionUri(transition.fromState, transition.toState);
716
+ const transitionUri = this.transitionUri(transition.fromState, transition.toState, transition.actionName);
664
717
  const fromStateUri = this.stateUri(transition.fromState);
665
718
  const toStateUri = this.stateUri(transition.toState);
666
719
 
@@ -764,7 +817,7 @@ export class SHACLFlow {
764
817
  if (inputTypesLink) {
765
818
  try {
766
819
  const jsonStr = inputTypesLink.target.replace(
767
- /^literal:\/\/string:|^literal:string:/,
820
+ /^literal:string:/,
768
821
  ""
769
822
  );
770
823
  const parsed = JSON.parse(decodeURIComponent(jsonStr));
@@ -782,7 +835,7 @@ export class SHACLFlow {
782
835
  if (outputTypesLink) {
783
836
  try {
784
837
  const jsonStr = outputTypesLink.target.replace(
785
- /^literal:\/\/string:|^literal:string:/,
838
+ /^literal:string:/,
786
839
  ""
787
840
  );
788
841
  const parsed = JSON.parse(decodeURIComponent(jsonStr));
@@ -819,7 +872,7 @@ export class SHACLFlow {
819
872
  if (contextLink) {
820
873
  try {
821
874
  const jsonStr = contextLink.target.replace(
822
- /^literal:\/\/string:|^literal:string:/,
875
+ /^literal:string:/,
823
876
  ""
824
877
  );
825
878
  const parsed = JSON.parse(decodeURIComponent(jsonStr));
@@ -840,7 +893,7 @@ export class SHACLFlow {
840
893
  if (consensusRuleLink) {
841
894
  try {
842
895
  const jsonStr = consensusRuleLink.target.replace(
843
- /^literal:\/\/string:|^literal:string:/,
896
+ /^literal:string:/,
844
897
  ""
845
898
  );
846
899
  const parsed = JSON.parse(decodeURIComponent(jsonStr));
@@ -906,7 +959,7 @@ export class SHACLFlow {
906
959
  if (requiresLink) {
907
960
  try {
908
961
  const jsonStr = requiresLink.target.replace(
909
- /^literal:\/\/string:|^literal:string:/,
962
+ /^literal:string:/,
910
963
  ""
911
964
  );
912
965
  const parsed = JSON.parse(decodeURIComponent(jsonStr));
@@ -944,7 +997,7 @@ export class SHACLFlow {
944
997
  if (stateConsensusLink) {
945
998
  try {
946
999
  const jsonStr = stateConsensusLink.target.replace(
947
- /^literal:\/\/string:|^literal:string:/,
1000
+ /^literal:string:/,
948
1001
  ""
949
1002
  );
950
1003
  const parsed = JSON.parse(decodeURIComponent(jsonStr));
@@ -1009,7 +1062,7 @@ export class SHACLFlow {
1009
1062
  let actions: AD4MAction[] = [];
1010
1063
  if (actionsLink) {
1011
1064
  try {
1012
- const jsonStr = actionsLink.target.replace(/^literal:\/\/string:|^literal:string:/, '');
1065
+ const jsonStr = actionsLink.target.replace(/^literal:string:/, '');
1013
1066
  actions = JSON.parse(decodeURIComponent(jsonStr));
1014
1067
  } catch {
1015
1068
  // Ignore parse errors
@@ -1107,6 +1160,8 @@ export class SHACLFlow {
1107
1160
  }
1108
1161
  flow.addState(sanitized);
1109
1162
  }
1163
+ // Same "states[0] is the initial state" ordering as fromLinks.
1164
+ flow._states.sort((a, b) => a.value - b.value);
1110
1165
  for (const transition of json.transitions || []) {
1111
1166
  flow.addTransition(transition);
1112
1167
  }