@vurb/core 3.2.0

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 (642) hide show
  1. package/README.md +677 -0
  2. package/dist/cli/args.d.ts +26 -0
  3. package/dist/cli/args.d.ts.map +1 -0
  4. package/dist/cli/args.js +117 -0
  5. package/dist/cli/args.js.map +1 -0
  6. package/dist/cli/commands/create.d.ts +11 -0
  7. package/dist/cli/commands/create.d.ts.map +1 -0
  8. package/dist/cli/commands/create.js +121 -0
  9. package/dist/cli/commands/create.js.map +1 -0
  10. package/dist/cli/commands/deploy.d.ts +3 -0
  11. package/dist/cli/commands/deploy.d.ts.map +1 -0
  12. package/dist/cli/commands/deploy.js +268 -0
  13. package/dist/cli/commands/deploy.js.map +1 -0
  14. package/dist/cli/commands/dev.d.ts +9 -0
  15. package/dist/cli/commands/dev.d.ts.map +1 -0
  16. package/dist/cli/commands/dev.js +58 -0
  17. package/dist/cli/commands/dev.js.map +1 -0
  18. package/dist/cli/commands/lock.d.ts +5 -0
  19. package/dist/cli/commands/lock.d.ts.map +1 -0
  20. package/dist/cli/commands/lock.js +94 -0
  21. package/dist/cli/commands/lock.js.map +1 -0
  22. package/dist/cli/commands/remote.d.ts +3 -0
  23. package/dist/cli/commands/remote.d.ts.map +1 -0
  24. package/dist/cli/commands/remote.js +37 -0
  25. package/dist/cli/commands/remote.js.map +1 -0
  26. package/dist/cli/constants.d.ts +18 -0
  27. package/dist/cli/constants.d.ts.map +1 -0
  28. package/dist/cli/constants.js +95 -0
  29. package/dist/cli/constants.js.map +1 -0
  30. package/dist/cli/progress.d.ts +34 -0
  31. package/dist/cli/progress.d.ts.map +1 -0
  32. package/dist/cli/progress.js +102 -0
  33. package/dist/cli/progress.js.map +1 -0
  34. package/dist/cli/rc.d.ts +11 -0
  35. package/dist/cli/rc.d.ts.map +1 -0
  36. package/dist/cli/rc.js +75 -0
  37. package/dist/cli/rc.js.map +1 -0
  38. package/dist/cli/registry.d.ts +25 -0
  39. package/dist/cli/registry.d.ts.map +1 -0
  40. package/dist/cli/registry.js +86 -0
  41. package/dist/cli/registry.js.map +1 -0
  42. package/dist/cli/scaffold.d.ts +10 -0
  43. package/dist/cli/scaffold.d.ts.map +1 -0
  44. package/dist/cli/scaffold.js +105 -0
  45. package/dist/cli/scaffold.js.map +1 -0
  46. package/dist/cli/templates/config.d.ts +14 -0
  47. package/dist/cli/templates/config.d.ts.map +1 -0
  48. package/dist/cli/templates/config.js +133 -0
  49. package/dist/cli/templates/config.js.map +1 -0
  50. package/dist/cli/templates/constants.d.ts +9 -0
  51. package/dist/cli/templates/constants.d.ts.map +1 -0
  52. package/dist/cli/templates/constants.js +9 -0
  53. package/dist/cli/templates/constants.js.map +1 -0
  54. package/dist/cli/templates/core.d.ts +14 -0
  55. package/dist/cli/templates/core.d.ts.map +1 -0
  56. package/dist/cli/templates/core.js +186 -0
  57. package/dist/cli/templates/core.js.map +1 -0
  58. package/dist/cli/templates/cursor.d.ts +8 -0
  59. package/dist/cli/templates/cursor.d.ts.map +1 -0
  60. package/dist/cli/templates/cursor.js +13 -0
  61. package/dist/cli/templates/cursor.js.map +1 -0
  62. package/dist/cli/templates/index.d.ts +17 -0
  63. package/dist/cli/templates/index.d.ts.map +1 -0
  64. package/dist/cli/templates/index.js +27 -0
  65. package/dist/cli/templates/index.js.map +1 -0
  66. package/dist/cli/templates/middleware.d.ts +7 -0
  67. package/dist/cli/templates/middleware.d.ts.map +1 -0
  68. package/dist/cli/templates/middleware.js +34 -0
  69. package/dist/cli/templates/middleware.js.map +1 -0
  70. package/dist/cli/templates/presenter.d.ts +7 -0
  71. package/dist/cli/templates/presenter.d.ts.map +1 -0
  72. package/dist/cli/templates/presenter.js +46 -0
  73. package/dist/cli/templates/presenter.js.map +1 -0
  74. package/dist/cli/templates/prompt.d.ts +7 -0
  75. package/dist/cli/templates/prompt.d.ts.map +1 -0
  76. package/dist/cli/templates/prompt.js +42 -0
  77. package/dist/cli/templates/prompt.js.map +1 -0
  78. package/dist/cli/templates/readme.d.ts +8 -0
  79. package/dist/cli/templates/readme.d.ts.map +1 -0
  80. package/dist/cli/templates/readme.js +173 -0
  81. package/dist/cli/templates/readme.js.map +1 -0
  82. package/dist/cli/templates/testing.d.ts +11 -0
  83. package/dist/cli/templates/testing.d.ts.map +1 -0
  84. package/dist/cli/templates/testing.js +101 -0
  85. package/dist/cli/templates/testing.js.map +1 -0
  86. package/dist/cli/templates/tools.d.ts +13 -0
  87. package/dist/cli/templates/tools.d.ts.map +1 -0
  88. package/dist/cli/templates/tools.js +63 -0
  89. package/dist/cli/templates/tools.js.map +1 -0
  90. package/dist/cli/templates/vectors/database.d.ts +9 -0
  91. package/dist/cli/templates/vectors/database.d.ts.map +1 -0
  92. package/dist/cli/templates/vectors/database.js +82 -0
  93. package/dist/cli/templates/vectors/database.js.map +1 -0
  94. package/dist/cli/templates/vectors/index.d.ts +9 -0
  95. package/dist/cli/templates/vectors/index.d.ts.map +1 -0
  96. package/dist/cli/templates/vectors/index.js +9 -0
  97. package/dist/cli/templates/vectors/index.js.map +1 -0
  98. package/dist/cli/templates/vectors/oauth.d.ts +10 -0
  99. package/dist/cli/templates/vectors/oauth.d.ts.map +1 -0
  100. package/dist/cli/templates/vectors/oauth.js +76 -0
  101. package/dist/cli/templates/vectors/oauth.js.map +1 -0
  102. package/dist/cli/templates/vectors/openapi.d.ts +10 -0
  103. package/dist/cli/templates/vectors/openapi.d.ts.map +1 -0
  104. package/dist/cli/templates/vectors/openapi.js +106 -0
  105. package/dist/cli/templates/vectors/openapi.js.map +1 -0
  106. package/dist/cli/templates/vectors/workflow.d.ts +7 -0
  107. package/dist/cli/templates/vectors/workflow.d.ts.map +1 -0
  108. package/dist/cli/templates/vectors/workflow.js +49 -0
  109. package/dist/cli/templates/vectors/workflow.js.map +1 -0
  110. package/dist/cli/types.d.ts +36 -0
  111. package/dist/cli/types.d.ts.map +1 -0
  112. package/dist/cli/types.js +10 -0
  113. package/dist/cli/types.js.map +1 -0
  114. package/dist/cli/utils.d.ts +27 -0
  115. package/dist/cli/utils.d.ts.map +1 -0
  116. package/dist/cli/utils.js +73 -0
  117. package/dist/cli/utils.js.map +1 -0
  118. package/dist/cli/vurb.d.ts +15 -0
  119. package/dist/cli/vurb.d.ts.map +1 -0
  120. package/dist/cli/vurb.js +87 -0
  121. package/dist/cli/vurb.js.map +1 -0
  122. package/dist/client/InferRouter.d.ts +92 -0
  123. package/dist/client/InferRouter.d.ts.map +1 -0
  124. package/dist/client/InferRouter.js +31 -0
  125. package/dist/client/InferRouter.js.map +1 -0
  126. package/dist/client/VurbClient.d.ts +282 -0
  127. package/dist/client/VurbClient.d.ts.map +1 -0
  128. package/dist/client/VurbClient.js +287 -0
  129. package/dist/client/VurbClient.js.map +1 -0
  130. package/dist/client/createTypedRegistry.d.ts +25 -0
  131. package/dist/client/createTypedRegistry.d.ts.map +1 -0
  132. package/dist/client/createTypedRegistry.js +74 -0
  133. package/dist/client/createTypedRegistry.js.map +1 -0
  134. package/dist/client/index.d.ts +6 -0
  135. package/dist/client/index.d.ts.map +1 -0
  136. package/dist/client/index.js +4 -0
  137. package/dist/client/index.js.map +1 -0
  138. package/dist/converters/ConverterBase.d.ts +68 -0
  139. package/dist/converters/ConverterBase.d.ts.map +1 -0
  140. package/dist/converters/ConverterBase.js +62 -0
  141. package/dist/converters/ConverterBase.js.map +1 -0
  142. package/dist/converters/GroupConverter.d.ts +33 -0
  143. package/dist/converters/GroupConverter.d.ts.map +1 -0
  144. package/dist/converters/GroupConverter.js +26 -0
  145. package/dist/converters/GroupConverter.js.map +1 -0
  146. package/dist/converters/PromptConverter.d.ts +33 -0
  147. package/dist/converters/PromptConverter.d.ts.map +1 -0
  148. package/dist/converters/PromptConverter.js +26 -0
  149. package/dist/converters/PromptConverter.js.map +1 -0
  150. package/dist/converters/ResourceConverter.d.ts +35 -0
  151. package/dist/converters/ResourceConverter.d.ts.map +1 -0
  152. package/dist/converters/ResourceConverter.js +28 -0
  153. package/dist/converters/ResourceConverter.js.map +1 -0
  154. package/dist/converters/ToolAnnotationsConverter.d.ts +33 -0
  155. package/dist/converters/ToolAnnotationsConverter.d.ts.map +1 -0
  156. package/dist/converters/ToolAnnotationsConverter.js +26 -0
  157. package/dist/converters/ToolAnnotationsConverter.js.map +1 -0
  158. package/dist/converters/ToolConverter.d.ts +35 -0
  159. package/dist/converters/ToolConverter.d.ts.map +1 -0
  160. package/dist/converters/ToolConverter.js +28 -0
  161. package/dist/converters/ToolConverter.js.map +1 -0
  162. package/dist/converters/index.d.ts +7 -0
  163. package/dist/converters/index.d.ts.map +1 -0
  164. package/dist/converters/index.js +7 -0
  165. package/dist/converters/index.js.map +1 -0
  166. package/dist/core/StandardSchema.d.ts +178 -0
  167. package/dist/core/StandardSchema.d.ts.map +1 -0
  168. package/dist/core/StandardSchema.js +174 -0
  169. package/dist/core/StandardSchema.js.map +1 -0
  170. package/dist/core/builder/ActionGroupBuilder.d.ts +208 -0
  171. package/dist/core/builder/ActionGroupBuilder.d.ts.map +1 -0
  172. package/dist/core/builder/ActionGroupBuilder.js +193 -0
  173. package/dist/core/builder/ActionGroupBuilder.js.map +1 -0
  174. package/dist/core/builder/ErrorBuilder.d.ts +59 -0
  175. package/dist/core/builder/ErrorBuilder.d.ts.map +1 -0
  176. package/dist/core/builder/ErrorBuilder.js +99 -0
  177. package/dist/core/builder/ErrorBuilder.js.map +1 -0
  178. package/dist/core/builder/FluentRouter.d.ts +96 -0
  179. package/dist/core/builder/FluentRouter.d.ts.map +1 -0
  180. package/dist/core/builder/FluentRouter.js +116 -0
  181. package/dist/core/builder/FluentRouter.js.map +1 -0
  182. package/dist/core/builder/FluentSchemaHelpers.d.ts +237 -0
  183. package/dist/core/builder/FluentSchemaHelpers.d.ts.map +1 -0
  184. package/dist/core/builder/FluentSchemaHelpers.js +227 -0
  185. package/dist/core/builder/FluentSchemaHelpers.js.map +1 -0
  186. package/dist/core/builder/FluentToolBuilder.d.ts +419 -0
  187. package/dist/core/builder/FluentToolBuilder.d.ts.map +1 -0
  188. package/dist/core/builder/FluentToolBuilder.js +643 -0
  189. package/dist/core/builder/FluentToolBuilder.js.map +1 -0
  190. package/dist/core/builder/GroupedToolBuilder.d.ts +832 -0
  191. package/dist/core/builder/GroupedToolBuilder.d.ts.map +1 -0
  192. package/dist/core/builder/GroupedToolBuilder.js +1306 -0
  193. package/dist/core/builder/GroupedToolBuilder.js.map +1 -0
  194. package/dist/core/builder/ParamDescriptors.d.ts +142 -0
  195. package/dist/core/builder/ParamDescriptors.d.ts.map +1 -0
  196. package/dist/core/builder/ParamDescriptors.js +164 -0
  197. package/dist/core/builder/ParamDescriptors.js.map +1 -0
  198. package/dist/core/builder/ToolDefinitionCompiler.d.ts +37 -0
  199. package/dist/core/builder/ToolDefinitionCompiler.d.ts.map +1 -0
  200. package/dist/core/builder/ToolDefinitionCompiler.js +72 -0
  201. package/dist/core/builder/ToolDefinitionCompiler.js.map +1 -0
  202. package/dist/core/builder/defineTool.d.ts +180 -0
  203. package/dist/core/builder/defineTool.d.ts.map +1 -0
  204. package/dist/core/builder/defineTool.js +164 -0
  205. package/dist/core/builder/defineTool.js.map +1 -0
  206. package/dist/core/builder/index.d.ts +13 -0
  207. package/dist/core/builder/index.d.ts.map +1 -0
  208. package/dist/core/builder/index.js +13 -0
  209. package/dist/core/builder/index.js.map +1 -0
  210. package/dist/core/createGroup.d.ts +140 -0
  211. package/dist/core/createGroup.d.ts.map +1 -0
  212. package/dist/core/createGroup.js +144 -0
  213. package/dist/core/createGroup.js.map +1 -0
  214. package/dist/core/execution/ConcurrencyGuard.d.ts +103 -0
  215. package/dist/core/execution/ConcurrencyGuard.d.ts.map +1 -0
  216. package/dist/core/execution/ConcurrencyGuard.js +147 -0
  217. package/dist/core/execution/ConcurrencyGuard.js.map +1 -0
  218. package/dist/core/execution/EgressGuard.d.ts +72 -0
  219. package/dist/core/execution/EgressGuard.d.ts.map +1 -0
  220. package/dist/core/execution/EgressGuard.js +163 -0
  221. package/dist/core/execution/EgressGuard.js.map +1 -0
  222. package/dist/core/execution/ExecutionPipeline.d.ts +67 -0
  223. package/dist/core/execution/ExecutionPipeline.d.ts.map +1 -0
  224. package/dist/core/execution/ExecutionPipeline.js +176 -0
  225. package/dist/core/execution/ExecutionPipeline.js.map +1 -0
  226. package/dist/core/execution/MiddlewareCompiler.d.ts +35 -0
  227. package/dist/core/execution/MiddlewareCompiler.d.ts.map +1 -0
  228. package/dist/core/execution/MiddlewareCompiler.js +111 -0
  229. package/dist/core/execution/MiddlewareCompiler.js.map +1 -0
  230. package/dist/core/execution/MutationSerializer.d.ts +78 -0
  231. package/dist/core/execution/MutationSerializer.d.ts.map +1 -0
  232. package/dist/core/execution/MutationSerializer.js +106 -0
  233. package/dist/core/execution/MutationSerializer.js.map +1 -0
  234. package/dist/core/execution/PipelineHooks.d.ts +46 -0
  235. package/dist/core/execution/PipelineHooks.d.ts.map +1 -0
  236. package/dist/core/execution/PipelineHooks.js +66 -0
  237. package/dist/core/execution/PipelineHooks.js.map +1 -0
  238. package/dist/core/execution/ProgressHelper.d.ts +67 -0
  239. package/dist/core/execution/ProgressHelper.d.ts.map +1 -0
  240. package/dist/core/execution/ProgressHelper.js +59 -0
  241. package/dist/core/execution/ProgressHelper.js.map +1 -0
  242. package/dist/core/execution/ValidationErrorFormatter.d.ts +34 -0
  243. package/dist/core/execution/ValidationErrorFormatter.d.ts.map +1 -0
  244. package/dist/core/execution/ValidationErrorFormatter.js +193 -0
  245. package/dist/core/execution/ValidationErrorFormatter.js.map +1 -0
  246. package/dist/core/execution/index.d.ts +9 -0
  247. package/dist/core/execution/index.d.ts.map +1 -0
  248. package/dist/core/execution/index.js +9 -0
  249. package/dist/core/execution/index.js.map +1 -0
  250. package/dist/core/index.d.ts +34 -0
  251. package/dist/core/index.d.ts.map +1 -0
  252. package/dist/core/index.js +29 -0
  253. package/dist/core/index.js.map +1 -0
  254. package/dist/core/initVurb.d.ts +295 -0
  255. package/dist/core/initVurb.d.ts.map +1 -0
  256. package/dist/core/initVurb.js +171 -0
  257. package/dist/core/initVurb.js.map +1 -0
  258. package/dist/core/middleware/ContextDerivation.d.ts +124 -0
  259. package/dist/core/middleware/ContextDerivation.d.ts.map +1 -0
  260. package/dist/core/middleware/ContextDerivation.js +117 -0
  261. package/dist/core/middleware/ContextDerivation.js.map +1 -0
  262. package/dist/core/middleware/index.d.ts +4 -0
  263. package/dist/core/middleware/index.d.ts.map +1 -0
  264. package/dist/core/middleware/index.js +3 -0
  265. package/dist/core/middleware/index.js.map +1 -0
  266. package/dist/core/registry/ToolFilterEngine.d.ts +27 -0
  267. package/dist/core/registry/ToolFilterEngine.d.ts.map +1 -0
  268. package/dist/core/registry/ToolFilterEngine.js +45 -0
  269. package/dist/core/registry/ToolFilterEngine.js.map +1 -0
  270. package/dist/core/registry/ToolRegistry.d.ts +259 -0
  271. package/dist/core/registry/ToolRegistry.d.ts.map +1 -0
  272. package/dist/core/registry/ToolRegistry.js +343 -0
  273. package/dist/core/registry/ToolRegistry.js.map +1 -0
  274. package/dist/core/registry/index.d.ts +4 -0
  275. package/dist/core/registry/index.d.ts.map +1 -0
  276. package/dist/core/registry/index.js +3 -0
  277. package/dist/core/registry/index.js.map +1 -0
  278. package/dist/core/response.d.ts +289 -0
  279. package/dist/core/response.d.ts.map +1 -0
  280. package/dist/core/response.js +286 -0
  281. package/dist/core/response.js.map +1 -0
  282. package/dist/core/result.d.ts +93 -0
  283. package/dist/core/result.d.ts.map +1 -0
  284. package/dist/core/result.js +66 -0
  285. package/dist/core/result.js.map +1 -0
  286. package/dist/core/schema/AnnotationAggregator.d.ts +11 -0
  287. package/dist/core/schema/AnnotationAggregator.d.ts.map +1 -0
  288. package/dist/core/schema/AnnotationAggregator.js +40 -0
  289. package/dist/core/schema/AnnotationAggregator.js.map +1 -0
  290. package/dist/core/schema/DescriptionGenerator.d.ts +12 -0
  291. package/dist/core/schema/DescriptionGenerator.d.ts.map +1 -0
  292. package/dist/core/schema/DescriptionGenerator.js +81 -0
  293. package/dist/core/schema/DescriptionGenerator.js.map +1 -0
  294. package/dist/core/schema/SchemaGenerator.d.ts +15 -0
  295. package/dist/core/schema/SchemaGenerator.d.ts.map +1 -0
  296. package/dist/core/schema/SchemaGenerator.js +192 -0
  297. package/dist/core/schema/SchemaGenerator.js.map +1 -0
  298. package/dist/core/schema/SchemaUtils.d.ts +26 -0
  299. package/dist/core/schema/SchemaUtils.d.ts.map +1 -0
  300. package/dist/core/schema/SchemaUtils.js +85 -0
  301. package/dist/core/schema/SchemaUtils.js.map +1 -0
  302. package/dist/core/schema/ToonDescriptionGenerator.d.ts +3 -0
  303. package/dist/core/schema/ToonDescriptionGenerator.d.ts.map +1 -0
  304. package/dist/core/schema/ToonDescriptionGenerator.js +65 -0
  305. package/dist/core/schema/ToonDescriptionGenerator.js.map +1 -0
  306. package/dist/core/schema/index.d.ts +7 -0
  307. package/dist/core/schema/index.d.ts.map +1 -0
  308. package/dist/core/schema/index.js +7 -0
  309. package/dist/core/schema/index.js.map +1 -0
  310. package/dist/core/serialization/JsonSerializer.d.ts +71 -0
  311. package/dist/core/serialization/JsonSerializer.d.ts.map +1 -0
  312. package/dist/core/serialization/JsonSerializer.js +192 -0
  313. package/dist/core/serialization/JsonSerializer.js.map +1 -0
  314. package/dist/core/serialization/index.d.ts +7 -0
  315. package/dist/core/serialization/index.d.ts.map +1 -0
  316. package/dist/core/serialization/index.js +7 -0
  317. package/dist/core/serialization/index.js.map +1 -0
  318. package/dist/core/types.d.ts +303 -0
  319. package/dist/core/types.d.ts.map +1 -0
  320. package/dist/core/types.js +17 -0
  321. package/dist/core/types.js.map +1 -0
  322. package/dist/domain/Annotations.d.ts +42 -0
  323. package/dist/domain/Annotations.d.ts.map +1 -0
  324. package/dist/domain/Annotations.js +16 -0
  325. package/dist/domain/Annotations.js.map +1 -0
  326. package/dist/domain/BaseModel.d.ts +50 -0
  327. package/dist/domain/BaseModel.d.ts.map +1 -0
  328. package/dist/domain/BaseModel.js +41 -0
  329. package/dist/domain/BaseModel.js.map +1 -0
  330. package/dist/domain/Group.d.ts +99 -0
  331. package/dist/domain/Group.d.ts.map +1 -0
  332. package/dist/domain/Group.js +172 -0
  333. package/dist/domain/Group.js.map +1 -0
  334. package/dist/domain/GroupItem.d.ts +46 -0
  335. package/dist/domain/GroupItem.d.ts.map +1 -0
  336. package/dist/domain/GroupItem.js +58 -0
  337. package/dist/domain/GroupItem.js.map +1 -0
  338. package/dist/domain/Icon.d.ts +41 -0
  339. package/dist/domain/Icon.d.ts.map +1 -0
  340. package/dist/domain/Icon.js +15 -0
  341. package/dist/domain/Icon.js.map +1 -0
  342. package/dist/domain/Prompt.d.ts +49 -0
  343. package/dist/domain/Prompt.d.ts.map +1 -0
  344. package/dist/domain/Prompt.js +59 -0
  345. package/dist/domain/Prompt.js.map +1 -0
  346. package/dist/domain/PromptArgument.d.ts +23 -0
  347. package/dist/domain/PromptArgument.d.ts.map +1 -0
  348. package/dist/domain/PromptArgument.js +27 -0
  349. package/dist/domain/PromptArgument.js.map +1 -0
  350. package/dist/domain/Resource.d.ts +37 -0
  351. package/dist/domain/Resource.d.ts.map +1 -0
  352. package/dist/domain/Resource.js +39 -0
  353. package/dist/domain/Resource.js.map +1 -0
  354. package/dist/domain/Role.d.ts +23 -0
  355. package/dist/domain/Role.d.ts.map +1 -0
  356. package/dist/domain/Role.js +24 -0
  357. package/dist/domain/Role.js.map +1 -0
  358. package/dist/domain/Tool.d.ts +39 -0
  359. package/dist/domain/Tool.d.ts.map +1 -0
  360. package/dist/domain/Tool.js +41 -0
  361. package/dist/domain/Tool.js.map +1 -0
  362. package/dist/domain/ToolAnnotations.d.ts +48 -0
  363. package/dist/domain/ToolAnnotations.d.ts.map +1 -0
  364. package/dist/domain/ToolAnnotations.js +15 -0
  365. package/dist/domain/ToolAnnotations.js.map +1 -0
  366. package/dist/domain/index.d.ts +16 -0
  367. package/dist/domain/index.d.ts.map +1 -0
  368. package/dist/domain/index.js +13 -0
  369. package/dist/domain/index.js.map +1 -0
  370. package/dist/domain/utils.d.ts +6 -0
  371. package/dist/domain/utils.d.ts.map +1 -0
  372. package/dist/domain/utils.js +12 -0
  373. package/dist/domain/utils.js.map +1 -0
  374. package/dist/edge-stub.d.ts +73 -0
  375. package/dist/edge-stub.d.ts.map +1 -0
  376. package/dist/edge-stub.js +83 -0
  377. package/dist/edge-stub.js.map +1 -0
  378. package/dist/exposition/ExpositionCompiler.d.ts +66 -0
  379. package/dist/exposition/ExpositionCompiler.d.ts.map +1 -0
  380. package/dist/exposition/ExpositionCompiler.js +279 -0
  381. package/dist/exposition/ExpositionCompiler.js.map +1 -0
  382. package/dist/exposition/index.d.ts +4 -0
  383. package/dist/exposition/index.d.ts.map +1 -0
  384. package/dist/exposition/index.js +2 -0
  385. package/dist/exposition/index.js.map +1 -0
  386. package/dist/exposition/types.d.ts +58 -0
  387. package/dist/exposition/types.d.ts.map +1 -0
  388. package/dist/exposition/types.js +11 -0
  389. package/dist/exposition/types.js.map +1 -0
  390. package/dist/fsm/StateMachineGate.d.ts +294 -0
  391. package/dist/fsm/StateMachineGate.d.ts.map +1 -0
  392. package/dist/fsm/StateMachineGate.js +400 -0
  393. package/dist/fsm/StateMachineGate.js.map +1 -0
  394. package/dist/index.d.ts +148 -0
  395. package/dist/index.d.ts.map +1 -0
  396. package/dist/index.js +112 -0
  397. package/dist/index.js.map +1 -0
  398. package/dist/introspection/BehaviorDigest.d.ts +112 -0
  399. package/dist/introspection/BehaviorDigest.d.ts.map +1 -0
  400. package/dist/introspection/BehaviorDigest.js +149 -0
  401. package/dist/introspection/BehaviorDigest.js.map +1 -0
  402. package/dist/introspection/CapabilityLockfile.d.ts +261 -0
  403. package/dist/introspection/CapabilityLockfile.d.ts.map +1 -0
  404. package/dist/introspection/CapabilityLockfile.js +395 -0
  405. package/dist/introspection/CapabilityLockfile.js.map +1 -0
  406. package/dist/introspection/ContractAwareSelfHealing.d.ts +90 -0
  407. package/dist/introspection/ContractAwareSelfHealing.d.ts.map +1 -0
  408. package/dist/introspection/ContractAwareSelfHealing.js +132 -0
  409. package/dist/introspection/ContractAwareSelfHealing.js.map +1 -0
  410. package/dist/introspection/ContractDiff.d.ts +91 -0
  411. package/dist/introspection/ContractDiff.d.ts.map +1 -0
  412. package/dist/introspection/ContractDiff.js +466 -0
  413. package/dist/introspection/ContractDiff.js.map +1 -0
  414. package/dist/introspection/CryptoAttestation.d.ts +143 -0
  415. package/dist/introspection/CryptoAttestation.d.ts.map +1 -0
  416. package/dist/introspection/CryptoAttestation.js +192 -0
  417. package/dist/introspection/CryptoAttestation.js.map +1 -0
  418. package/dist/introspection/EntitlementScanner.d.ts +177 -0
  419. package/dist/introspection/EntitlementScanner.d.ts.map +1 -0
  420. package/dist/introspection/EntitlementScanner.js +459 -0
  421. package/dist/introspection/EntitlementScanner.js.map +1 -0
  422. package/dist/introspection/GovernanceObserver.d.ts +88 -0
  423. package/dist/introspection/GovernanceObserver.d.ts.map +1 -0
  424. package/dist/introspection/GovernanceObserver.js +136 -0
  425. package/dist/introspection/GovernanceObserver.js.map +1 -0
  426. package/dist/introspection/IntrospectionResource.d.ts +20 -0
  427. package/dist/introspection/IntrospectionResource.d.ts.map +1 -0
  428. package/dist/introspection/IntrospectionResource.js +112 -0
  429. package/dist/introspection/IntrospectionResource.js.map +1 -0
  430. package/dist/introspection/ManifestCompiler.d.ts +33 -0
  431. package/dist/introspection/ManifestCompiler.d.ts.map +1 -0
  432. package/dist/introspection/ManifestCompiler.js +88 -0
  433. package/dist/introspection/ManifestCompiler.js.map +1 -0
  434. package/dist/introspection/SemanticProbe.d.ts +207 -0
  435. package/dist/introspection/SemanticProbe.d.ts.map +1 -0
  436. package/dist/introspection/SemanticProbe.js +274 -0
  437. package/dist/introspection/SemanticProbe.js.map +1 -0
  438. package/dist/introspection/TokenEconomics.d.ts +210 -0
  439. package/dist/introspection/TokenEconomics.d.ts.map +1 -0
  440. package/dist/introspection/TokenEconomics.js +292 -0
  441. package/dist/introspection/TokenEconomics.js.map +1 -0
  442. package/dist/introspection/ToolContract.d.ts +161 -0
  443. package/dist/introspection/ToolContract.d.ts.map +1 -0
  444. package/dist/introspection/ToolContract.js +218 -0
  445. package/dist/introspection/ToolContract.js.map +1 -0
  446. package/dist/introspection/canonicalize.d.ts +35 -0
  447. package/dist/introspection/canonicalize.d.ts.map +1 -0
  448. package/dist/introspection/canonicalize.js +72 -0
  449. package/dist/introspection/canonicalize.js.map +1 -0
  450. package/dist/introspection/index.d.ts +26 -0
  451. package/dist/introspection/index.d.ts.map +1 -0
  452. package/dist/introspection/index.js +24 -0
  453. package/dist/introspection/index.js.map +1 -0
  454. package/dist/introspection/types.d.ts +120 -0
  455. package/dist/introspection/types.d.ts.map +1 -0
  456. package/dist/introspection/types.js +13 -0
  457. package/dist/introspection/types.js.map +1 -0
  458. package/dist/observability/DebugObserver.d.ts +185 -0
  459. package/dist/observability/DebugObserver.d.ts.map +1 -0
  460. package/dist/observability/DebugObserver.js +102 -0
  461. package/dist/observability/DebugObserver.js.map +1 -0
  462. package/dist/observability/TelemetryBus.d.ts +88 -0
  463. package/dist/observability/TelemetryBus.d.ts.map +1 -0
  464. package/dist/observability/TelemetryBus.js +463 -0
  465. package/dist/observability/TelemetryBus.js.map +1 -0
  466. package/dist/observability/TelemetryEvent.d.ts +177 -0
  467. package/dist/observability/TelemetryEvent.d.ts.map +1 -0
  468. package/dist/observability/TelemetryEvent.js +2 -0
  469. package/dist/observability/TelemetryEvent.js.map +1 -0
  470. package/dist/observability/Tracing.d.ts +155 -0
  471. package/dist/observability/Tracing.d.ts.map +1 -0
  472. package/dist/observability/Tracing.js +67 -0
  473. package/dist/observability/Tracing.js.map +1 -0
  474. package/dist/observability/index.d.ts +13 -0
  475. package/dist/observability/index.d.ts.map +1 -0
  476. package/dist/observability/index.js +12 -0
  477. package/dist/observability/index.js.map +1 -0
  478. package/dist/presenter/PostProcessor.d.ts +52 -0
  479. package/dist/presenter/PostProcessor.d.ts.map +1 -0
  480. package/dist/presenter/PostProcessor.js +148 -0
  481. package/dist/presenter/PostProcessor.js.map +1 -0
  482. package/dist/presenter/Presenter.d.ts +575 -0
  483. package/dist/presenter/Presenter.d.ts.map +1 -0
  484. package/dist/presenter/Presenter.js +768 -0
  485. package/dist/presenter/Presenter.js.map +1 -0
  486. package/dist/presenter/PresenterValidationError.d.ts +42 -0
  487. package/dist/presenter/PresenterValidationError.d.ts.map +1 -0
  488. package/dist/presenter/PresenterValidationError.js +55 -0
  489. package/dist/presenter/PresenterValidationError.js.map +1 -0
  490. package/dist/presenter/RedactEngine.d.ts +110 -0
  491. package/dist/presenter/RedactEngine.d.ts.map +1 -0
  492. package/dist/presenter/RedactEngine.js +128 -0
  493. package/dist/presenter/RedactEngine.js.map +1 -0
  494. package/dist/presenter/ResponseBuilder.d.ts +262 -0
  495. package/dist/presenter/ResponseBuilder.d.ts.map +1 -0
  496. package/dist/presenter/ResponseBuilder.js +374 -0
  497. package/dist/presenter/ResponseBuilder.js.map +1 -0
  498. package/dist/presenter/SelectUtils.d.ts +78 -0
  499. package/dist/presenter/SelectUtils.d.ts.map +1 -0
  500. package/dist/presenter/SelectUtils.js +141 -0
  501. package/dist/presenter/SelectUtils.js.map +1 -0
  502. package/dist/presenter/ZodDescriptionExtractor.d.ts +54 -0
  503. package/dist/presenter/ZodDescriptionExtractor.d.ts.map +1 -0
  504. package/dist/presenter/ZodDescriptionExtractor.js +131 -0
  505. package/dist/presenter/ZodDescriptionExtractor.js.map +1 -0
  506. package/dist/presenter/definePresenter.d.ts +193 -0
  507. package/dist/presenter/definePresenter.d.ts.map +1 -0
  508. package/dist/presenter/definePresenter.js +99 -0
  509. package/dist/presenter/definePresenter.js.map +1 -0
  510. package/dist/presenter/index.d.ts +21 -0
  511. package/dist/presenter/index.d.ts.map +1 -0
  512. package/dist/presenter/index.js +28 -0
  513. package/dist/presenter/index.js.map +1 -0
  514. package/dist/presenter/suggest.d.ts +39 -0
  515. package/dist/presenter/suggest.d.ts.map +1 -0
  516. package/dist/presenter/suggest.js +41 -0
  517. package/dist/presenter/suggest.js.map +1 -0
  518. package/dist/presenter/typeHelpers.d.ts +147 -0
  519. package/dist/presenter/typeHelpers.d.ts.map +1 -0
  520. package/dist/presenter/typeHelpers.js +152 -0
  521. package/dist/presenter/typeHelpers.js.map +1 -0
  522. package/dist/presenter/ui.d.ts +205 -0
  523. package/dist/presenter/ui.d.ts.map +1 -0
  524. package/dist/presenter/ui.js +222 -0
  525. package/dist/presenter/ui.js.map +1 -0
  526. package/dist/prompt/CursorCodec.d.ts +43 -0
  527. package/dist/prompt/CursorCodec.d.ts.map +1 -0
  528. package/dist/prompt/CursorCodec.js +171 -0
  529. package/dist/prompt/CursorCodec.js.map +1 -0
  530. package/dist/prompt/FluentPromptBuilder.d.ts +155 -0
  531. package/dist/prompt/FluentPromptBuilder.d.ts.map +1 -0
  532. package/dist/prompt/FluentPromptBuilder.js +195 -0
  533. package/dist/prompt/FluentPromptBuilder.js.map +1 -0
  534. package/dist/prompt/HydrationSandbox.d.ts +55 -0
  535. package/dist/prompt/HydrationSandbox.d.ts.map +1 -0
  536. package/dist/prompt/HydrationSandbox.js +122 -0
  537. package/dist/prompt/HydrationSandbox.js.map +1 -0
  538. package/dist/prompt/PromptExecutionPipeline.d.ts +61 -0
  539. package/dist/prompt/PromptExecutionPipeline.d.ts.map +1 -0
  540. package/dist/prompt/PromptExecutionPipeline.js +177 -0
  541. package/dist/prompt/PromptExecutionPipeline.js.map +1 -0
  542. package/dist/prompt/PromptMessage.d.ts +133 -0
  543. package/dist/prompt/PromptMessage.d.ts.map +1 -0
  544. package/dist/prompt/PromptMessage.js +182 -0
  545. package/dist/prompt/PromptMessage.js.map +1 -0
  546. package/dist/prompt/PromptRegistry.d.ts +236 -0
  547. package/dist/prompt/PromptRegistry.d.ts.map +1 -0
  548. package/dist/prompt/PromptRegistry.js +399 -0
  549. package/dist/prompt/PromptRegistry.js.map +1 -0
  550. package/dist/prompt/definePrompt.d.ts +111 -0
  551. package/dist/prompt/definePrompt.d.ts.map +1 -0
  552. package/dist/prompt/definePrompt.js +130 -0
  553. package/dist/prompt/definePrompt.js.map +1 -0
  554. package/dist/prompt/index.d.ts +12 -0
  555. package/dist/prompt/index.d.ts.map +1 -0
  556. package/dist/prompt/index.js +13 -0
  557. package/dist/prompt/index.js.map +1 -0
  558. package/dist/prompt/types.d.ts +425 -0
  559. package/dist/prompt/types.d.ts.map +1 -0
  560. package/dist/prompt/types.js +19 -0
  561. package/dist/prompt/types.js.map +1 -0
  562. package/dist/sandbox/SandboxEngine.d.ts +225 -0
  563. package/dist/sandbox/SandboxEngine.d.ts.map +1 -0
  564. package/dist/sandbox/SandboxEngine.js +437 -0
  565. package/dist/sandbox/SandboxEngine.js.map +1 -0
  566. package/dist/sandbox/SandboxGuard.d.ts +47 -0
  567. package/dist/sandbox/SandboxGuard.d.ts.map +1 -0
  568. package/dist/sandbox/SandboxGuard.js +127 -0
  569. package/dist/sandbox/SandboxGuard.js.map +1 -0
  570. package/dist/sandbox/index.d.ts +23 -0
  571. package/dist/sandbox/index.d.ts.map +1 -0
  572. package/dist/sandbox/index.js +26 -0
  573. package/dist/sandbox/index.js.map +1 -0
  574. package/dist/server/DevServer.d.ts +120 -0
  575. package/dist/server/DevServer.d.ts.map +1 -0
  576. package/dist/server/DevServer.js +252 -0
  577. package/dist/server/DevServer.js.map +1 -0
  578. package/dist/server/ServerAttachment.d.ts +354 -0
  579. package/dist/server/ServerAttachment.d.ts.map +1 -0
  580. package/dist/server/ServerAttachment.js +709 -0
  581. package/dist/server/ServerAttachment.js.map +1 -0
  582. package/dist/server/ServerResolver.d.ts +24 -0
  583. package/dist/server/ServerResolver.d.ts.map +1 -0
  584. package/dist/server/ServerResolver.js +50 -0
  585. package/dist/server/ServerResolver.js.map +1 -0
  586. package/dist/server/autoDiscover.d.ts +75 -0
  587. package/dist/server/autoDiscover.d.ts.map +1 -0
  588. package/dist/server/autoDiscover.js +164 -0
  589. package/dist/server/autoDiscover.js.map +1 -0
  590. package/dist/server/index.d.ts +12 -0
  591. package/dist/server/index.d.ts.map +1 -0
  592. package/dist/server/index.js +11 -0
  593. package/dist/server/index.js.map +1 -0
  594. package/dist/server/startServer.d.ts +81 -0
  595. package/dist/server/startServer.d.ts.map +1 -0
  596. package/dist/server/startServer.js +143 -0
  597. package/dist/server/startServer.js.map +1 -0
  598. package/dist/state-sync/CausalEngine.d.ts +28 -0
  599. package/dist/state-sync/CausalEngine.d.ts.map +1 -0
  600. package/dist/state-sync/CausalEngine.js +17 -0
  601. package/dist/state-sync/CausalEngine.js.map +1 -0
  602. package/dist/state-sync/DescriptionDecorator.d.ts +31 -0
  603. package/dist/state-sync/DescriptionDecorator.d.ts.map +1 -0
  604. package/dist/state-sync/DescriptionDecorator.js +38 -0
  605. package/dist/state-sync/DescriptionDecorator.js.map +1 -0
  606. package/dist/state-sync/GlobMatcher.d.ts +29 -0
  607. package/dist/state-sync/GlobMatcher.d.ts.map +1 -0
  608. package/dist/state-sync/GlobMatcher.js +79 -0
  609. package/dist/state-sync/GlobMatcher.js.map +1 -0
  610. package/dist/state-sync/PolicyEngine.d.ts +75 -0
  611. package/dist/state-sync/PolicyEngine.d.ts.map +1 -0
  612. package/dist/state-sync/PolicyEngine.js +107 -0
  613. package/dist/state-sync/PolicyEngine.js.map +1 -0
  614. package/dist/state-sync/PolicyValidator.d.ts +67 -0
  615. package/dist/state-sync/PolicyValidator.d.ts.map +1 -0
  616. package/dist/state-sync/PolicyValidator.js +122 -0
  617. package/dist/state-sync/PolicyValidator.js.map +1 -0
  618. package/dist/state-sync/ResponseDecorator.d.ts +33 -0
  619. package/dist/state-sync/ResponseDecorator.d.ts.map +1 -0
  620. package/dist/state-sync/ResponseDecorator.js +20 -0
  621. package/dist/state-sync/ResponseDecorator.js.map +1 -0
  622. package/dist/state-sync/StateSyncBuilder.d.ts +77 -0
  623. package/dist/state-sync/StateSyncBuilder.d.ts.map +1 -0
  624. package/dist/state-sync/StateSyncBuilder.js +129 -0
  625. package/dist/state-sync/StateSyncBuilder.js.map +1 -0
  626. package/dist/state-sync/StateSyncLayer.d.ts +107 -0
  627. package/dist/state-sync/StateSyncLayer.d.ts.map +1 -0
  628. package/dist/state-sync/StateSyncLayer.js +158 -0
  629. package/dist/state-sync/StateSyncLayer.js.map +1 -0
  630. package/dist/state-sync/index.d.ts +27 -0
  631. package/dist/state-sync/index.d.ts.map +1 -0
  632. package/dist/state-sync/index.js +27 -0
  633. package/dist/state-sync/index.js.map +1 -0
  634. package/dist/state-sync/types.d.ts +174 -0
  635. package/dist/state-sync/types.d.ts.map +1 -0
  636. package/dist/state-sync/types.js +17 -0
  637. package/dist/state-sync/types.js.map +1 -0
  638. package/dist/testing/MvaMetaSymbol.d.ts +45 -0
  639. package/dist/testing/MvaMetaSymbol.d.ts.map +1 -0
  640. package/dist/testing/MvaMetaSymbol.js +34 -0
  641. package/dist/testing/MvaMetaSymbol.js.map +1 -0
  642. package/package.json +153 -0
@@ -0,0 +1,294 @@
1
+ /**
2
+ * StateMachineGate — Temporal Anti-Hallucination Engine
3
+ *
4
+ * Zero-hallucination tool ordering via finite state machines.
5
+ * Tools bound to FSM states are **physically removed** from
6
+ * `tools/list` when the current state doesn't match — the LLM
7
+ * cannot call what doesn't exist in its reality.
8
+ *
9
+ * Powered by XState v5 (optional peer dependency, lazy-loaded).
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const gate = new StateMachineGate({
14
+ * id: 'checkout',
15
+ * initial: 'empty',
16
+ * states: {
17
+ * empty: { on: { ADD_ITEM: 'has_items' } },
18
+ * has_items: { on: { CHECKOUT: 'payment', CLEAR: 'empty' } },
19
+ * payment: { on: { PAY: 'confirmed', CANCEL: 'has_items' } },
20
+ * confirmed: { on: { RESET: 'empty' } },
21
+ * },
22
+ * });
23
+ *
24
+ * gate.bindTool('cart_add_item', ['empty', 'has_items'], 'ADD_ITEM');
25
+ * gate.bindTool('cart_checkout', ['has_items'], 'CHECKOUT');
26
+ * gate.bindTool('cart_pay', ['payment'], 'PAY');
27
+ * ```
28
+ *
29
+ * ## Architecture
30
+ *
31
+ * ```
32
+ * ┌──────────────────────────────────────────────────────┐
33
+ * │ Boot: StateMachineGate(config) │
34
+ * │ │
35
+ * │ XState createMachine() → createActor() → .start() │
36
+ * │ │ │
37
+ * │ ▼ │
38
+ * │ tools/list request │
39
+ * │ │ │
40
+ * │ ▼ │
41
+ * │ gate.getVisibleTools(allTools) │
42
+ * │ → filter by current FSM state │
43
+ * │ → return only allowed tools │
44
+ * │ │ │
45
+ * │ ▼ │
46
+ * │ tools/call succeeds │
47
+ * │ → gate.transition(event) │
48
+ * │ → FSM advances → list_changed notification │
49
+ * └──────────────────────────────────────────────────────┘
50
+ * ```
51
+ *
52
+ * @module
53
+ */
54
+ /**
55
+ * Configuration for a finite state machine definition.
56
+ *
57
+ * Uses the same shape as XState v5 `createMachine()` config,
58
+ * but only the subset needed for tool gating.
59
+ */
60
+ export interface FsmConfig {
61
+ /** Unique identifier for this state machine */
62
+ id?: string;
63
+ /** Initial state when a new session starts */
64
+ initial: string;
65
+ /** State definitions with event transitions */
66
+ states: Record<string, {
67
+ /** Events that trigger transitions: `{ EVENT_NAME: 'target_state' }` */
68
+ on?: Record<string, string>;
69
+ /** Set to `'final'` to mark a terminal state */
70
+ type?: 'final';
71
+ }>;
72
+ }
73
+ /**
74
+ * External state store for serverless/edge deployments.
75
+ *
76
+ * When MCP runs over Streamable HTTP (Vercel, Cloudflare Workers),
77
+ * there is no persistent process — FSM state must be externalized.
78
+ * The `sessionId` comes from the `Mcp-Session-Id` header.
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * const fsmStore: FsmStateStore = {
83
+ * load: async (sessionId) => {
84
+ * const data = await redis.get(`fsm:${sessionId}`);
85
+ * return data ? JSON.parse(data) : undefined;
86
+ * },
87
+ * save: async (sessionId, snapshot) => {
88
+ * await redis.set(`fsm:${sessionId}`, JSON.stringify(snapshot), { EX: 3600 });
89
+ * },
90
+ * };
91
+ * ```
92
+ */
93
+ export interface FsmStateStore {
94
+ /** Load persisted FSM state for a session. Returns `undefined` for new sessions. */
95
+ load(sessionId: string): Promise<FsmSnapshot | undefined>;
96
+ /** Save FSM state after a transition. */
97
+ save(sessionId: string, snapshot: FsmSnapshot): Promise<void>;
98
+ }
99
+ /**
100
+ * Serializable FSM state snapshot for persistence.
101
+ */
102
+ export interface FsmSnapshot {
103
+ /** Current FSM state value */
104
+ state: string;
105
+ /** Timestamp of last transition */
106
+ updatedAt: number;
107
+ }
108
+ /**
109
+ * Result of a state transition attempt.
110
+ */
111
+ export interface TransitionResult {
112
+ /** Whether the FSM state actually changed */
113
+ changed: boolean;
114
+ /** The FSM state before the transition */
115
+ previousState: string;
116
+ /** The FSM state after the transition */
117
+ currentState: string;
118
+ }
119
+ /**
120
+ * Reset the XState module cache so that `loadXState()` will
121
+ * re-attempt the dynamic import on next call.
122
+ *
123
+ * Intended for test environments where `xstate` availability
124
+ * may change between test suites via dynamic mocking.
125
+ *
126
+ * @public
127
+ */
128
+ export declare function resetXStateCache(): void;
129
+ /**
130
+ * Pre-load `xstate` at boot time (optional optimization).
131
+ *
132
+ * Call during server startup to avoid the first-use dynamic import latency.
133
+ * Returns `true` if xstate is available, `false` otherwise.
134
+ *
135
+ * @example
136
+ * ```typescript
137
+ * import { initFsmEngine } from 'vurb';
138
+ * const available = await initFsmEngine();
139
+ * if (!available) console.warn('xstate not installed — FSM gating disabled');
140
+ * ```
141
+ */
142
+ export declare function initFsmEngine(): Promise<boolean>;
143
+ /**
144
+ * Temporal Anti-Hallucination Engine.
145
+ *
146
+ * Wraps an XState v5 finite state machine and controls which MCP tools
147
+ * are visible to the LLM based on the current workflow state.
148
+ *
149
+ * **Hard constraint**: Tools not bound to the current state are removed
150
+ * from `tools/list` entirely — the LLM physically cannot call them.
151
+ *
152
+ * **Soft constraint**: `suggestActions` (HATEOAS) continues to recommend
153
+ * the best next action within the visible set. Zero conflict.
154
+ */
155
+ export declare class StateMachineGate {
156
+ private readonly _config;
157
+ private readonly _bindings;
158
+ private readonly _transitionCallbacks;
159
+ private _actor;
160
+ private _currentState;
161
+ private _initialized;
162
+ /**
163
+ * @param config - FSM definition (states, transitions, initial state)
164
+ */
165
+ constructor(config: FsmConfig);
166
+ /**
167
+ * Initialize the XState actor (lazy-loaded).
168
+ *
169
+ * Called automatically on first use. Can be called explicitly
170
+ * at boot time for eager initialization.
171
+ *
172
+ * @returns `true` if XState is available and the actor started
173
+ */
174
+ init(): Promise<boolean>;
175
+ /**
176
+ * Bind a tool to specific FSM states.
177
+ *
178
+ * The tool will only appear in `tools/list` when the FSM
179
+ * is in one of the specified states.
180
+ *
181
+ * @param toolName - MCP tool name (flat: `cart_add_item`, grouped: `cart`)
182
+ * @param allowedStates - FSM states where this tool is visible
183
+ * @param transitionEvent - Event to send on successful execution (optional)
184
+ * @returns `this` for chaining
185
+ *
186
+ * @example
187
+ * ```typescript
188
+ * gate.bindTool('cart_add_item', ['empty', 'has_items'], 'ADD_ITEM');
189
+ * gate.bindTool('cart_checkout', ['has_items'], 'CHECKOUT');
190
+ * ```
191
+ */
192
+ bindTool(toolName: string, allowedStates: string[], transitionEvent?: string): StateMachineGate;
193
+ /**
194
+ * Get the current FSM state.
195
+ */
196
+ get currentState(): string;
197
+ /**
198
+ * Check if a specific tool is allowed in the current FSM state.
199
+ *
200
+ * Tools **not** registered via `bindTool()` are always visible
201
+ * (ungated — they don't participate in FSM gating).
202
+ *
203
+ * @param toolName - MCP tool name to check
204
+ * @returns `true` if the tool should appear in `tools/list`
205
+ */
206
+ isToolAllowed(toolName: string): boolean;
207
+ /**
208
+ * Filter a list of tool names by the current FSM state.
209
+ *
210
+ * @param toolNames - All registered tool names
211
+ * @returns Only the tools allowed in the current state
212
+ */
213
+ getVisibleToolNames(toolNames: string[]): string[];
214
+ /**
215
+ * Get the transition event for a tool (if any).
216
+ *
217
+ * @param toolName - MCP tool name
218
+ * @returns The event string, or `undefined` if no transition is bound
219
+ */
220
+ getTransitionEvent(toolName: string): string | undefined;
221
+ /**
222
+ * Check if any tools are bound to this FSM gate.
223
+ *
224
+ * @returns `true` if at least one tool is state-gated
225
+ */
226
+ get hasBindings(): boolean;
227
+ /**
228
+ * Send an event to the FSM, potentially triggering a state transition.
229
+ *
230
+ * @param eventType - The event to send (e.g. `'ADD_ITEM'`, `'CHECKOUT'`)
231
+ * @returns Result indicating whether the state changed
232
+ */
233
+ transition(eventType: string): Promise<TransitionResult>;
234
+ /**
235
+ * Manual state transition fallback when XState is not installed.
236
+ *
237
+ * Reads the FSM config directly to determine the next state.
238
+ * This provides basic FSM gating even without `xstate` installed,
239
+ * though without XState's guards, actions, and advanced features.
240
+ *
241
+ * @internal
242
+ */
243
+ private _transitionManual;
244
+ /**
245
+ * Register a callback that fires when the FSM state changes.
246
+ *
247
+ * Used by `ServerAttachment` to emit `notifications/tools/list_changed`
248
+ * when a state transition makes tools appear or disappear.
249
+ *
250
+ * @param callback - Function to call on state change
251
+ * @returns Unsubscribe function
252
+ */
253
+ onTransition(callback: () => void): () => void;
254
+ /**
255
+ * Create a serializable snapshot of the current FSM state.
256
+ *
257
+ * Used with `FsmStateStore` for serverless deployments where
258
+ * FSM state must survive across request boundaries.
259
+ *
260
+ * @returns Serializable snapshot
261
+ */
262
+ snapshot(): FsmSnapshot;
263
+ /**
264
+ * Restore FSM state from a persisted snapshot.
265
+ *
266
+ * Resets the XState actor (if running) so the next `transition()`
267
+ * re-initializes the machine starting from the restored state.
268
+ * This ensures restore → transition works correctly in
269
+ * serverless/edge deployments (Vercel, Cloudflare Workers).
270
+ *
271
+ * @param snap - Previously saved snapshot
272
+ */
273
+ restore(snap: FsmSnapshot): void;
274
+ /**
275
+ * Create a lightweight clone of this gate with the same config
276
+ * and bindings but independent mutable state.
277
+ *
278
+ * Used in serverless/edge deployments where concurrent requests
279
+ * must not share `_currentState`. Each request gets its own clone,
280
+ * restores session state into it, transitions, and saves — without
281
+ * interfering with other concurrent requests.
282
+ *
283
+ * The clone starts **uninitialized** (no XState actor) so the first
284
+ * `transition()` call will create a fresh actor from the cloned state.
285
+ *
286
+ * @returns A new `StateMachineGate` with identical config and bindings
287
+ */
288
+ clone(): StateMachineGate;
289
+ /**
290
+ * Stop the XState actor and release resources.
291
+ */
292
+ dispose(): void;
293
+ }
294
+ //# sourceMappingURL=StateMachineGate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateMachineGate.d.ts","sourceRoot":"","sources":["../../src/fsm/StateMachineGate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAIH;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACtB,+CAA+C;IAC/C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;QACnB,wEAAwE;QACxE,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC5B,gDAAgD;QAChD,IAAI,CAAC,EAAE,OAAO,CAAC;KAClB,CAAC,CAAC;CACN;AAcD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,aAAa;IAC1B,oFAAoF;IACpF,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAC1D,yCAAyC;IACzC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,6CAA6C;IAC7C,OAAO,EAAE,OAAO,CAAC;IACjB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;CACxB;AA6BD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAGvC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAEtD;AAID;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAgB;IACzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqC;IAC/D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAyB;IAC9D,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAS;IAE7B;;OAEG;gBACS,MAAM,EAAE,SAAS;IAO7B;;;;;;;OAOG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAwC9B;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,gBAAgB;IAW/F;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;;;;;;;OAQG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAMxC;;;;;OAKG;IACH,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAIlD;;;;;OAKG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIxD;;;;OAIG;IACH,IAAI,WAAW,IAAI,OAAO,CAEzB;IAID;;;;;OAKG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuB9D;;;;;;;;OAQG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;;;;;;;OAQG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAU9C;;;;;;;OAOG;IACH,QAAQ,IAAI,WAAW;IAOvB;;;;;;;;;OASG;IACH,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAiBhC;;;;;;;;;;;;;OAaG;IACH,KAAK,IAAI,gBAAgB;IAczB;;OAEG;IACH,OAAO,IAAI,IAAI;CAOlB"}
@@ -0,0 +1,400 @@
1
+ /**
2
+ * StateMachineGate — Temporal Anti-Hallucination Engine
3
+ *
4
+ * Zero-hallucination tool ordering via finite state machines.
5
+ * Tools bound to FSM states are **physically removed** from
6
+ * `tools/list` when the current state doesn't match — the LLM
7
+ * cannot call what doesn't exist in its reality.
8
+ *
9
+ * Powered by XState v5 (optional peer dependency, lazy-loaded).
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * const gate = new StateMachineGate({
14
+ * id: 'checkout',
15
+ * initial: 'empty',
16
+ * states: {
17
+ * empty: { on: { ADD_ITEM: 'has_items' } },
18
+ * has_items: { on: { CHECKOUT: 'payment', CLEAR: 'empty' } },
19
+ * payment: { on: { PAY: 'confirmed', CANCEL: 'has_items' } },
20
+ * confirmed: { on: { RESET: 'empty' } },
21
+ * },
22
+ * });
23
+ *
24
+ * gate.bindTool('cart_add_item', ['empty', 'has_items'], 'ADD_ITEM');
25
+ * gate.bindTool('cart_checkout', ['has_items'], 'CHECKOUT');
26
+ * gate.bindTool('cart_pay', ['payment'], 'PAY');
27
+ * ```
28
+ *
29
+ * ## Architecture
30
+ *
31
+ * ```
32
+ * ┌──────────────────────────────────────────────────────┐
33
+ * │ Boot: StateMachineGate(config) │
34
+ * │ │
35
+ * │ XState createMachine() → createActor() → .start() │
36
+ * │ │ │
37
+ * │ ▼ │
38
+ * │ tools/list request │
39
+ * │ │ │
40
+ * │ ▼ │
41
+ * │ gate.getVisibleTools(allTools) │
42
+ * │ → filter by current FSM state │
43
+ * │ → return only allowed tools │
44
+ * │ │ │
45
+ * │ ▼ │
46
+ * │ tools/call succeeds │
47
+ * │ → gate.transition(event) │
48
+ * │ → FSM advances → list_changed notification │
49
+ * └──────────────────────────────────────────────────────┘
50
+ * ```
51
+ *
52
+ * @module
53
+ */
54
+ // ── Lazy XState Loading ──────────────────────────────────
55
+ /** Cached XState module reference */
56
+ let xstateModule = null;
57
+ /** Whether we already attempted to load XState */
58
+ let xstateLoadAttempted = false;
59
+ /**
60
+ * Lazily load the `xstate` module.
61
+ *
62
+ * Returns `null` if `xstate` is not installed — the framework
63
+ * degrades gracefully (all tools remain visible, no gating).
64
+ *
65
+ * @internal
66
+ */
67
+ async function loadXState() {
68
+ if (xstateLoadAttempted)
69
+ return xstateModule;
70
+ xstateLoadAttempted = true;
71
+ try {
72
+ xstateModule = await import('xstate');
73
+ return xstateModule;
74
+ }
75
+ catch {
76
+ return null;
77
+ }
78
+ }
79
+ /**
80
+ * Reset the XState module cache so that `loadXState()` will
81
+ * re-attempt the dynamic import on next call.
82
+ *
83
+ * Intended for test environments where `xstate` availability
84
+ * may change between test suites via dynamic mocking.
85
+ *
86
+ * @public
87
+ */
88
+ export function resetXStateCache() {
89
+ xstateLoadAttempted = false;
90
+ xstateModule = null;
91
+ }
92
+ /**
93
+ * Pre-load `xstate` at boot time (optional optimization).
94
+ *
95
+ * Call during server startup to avoid the first-use dynamic import latency.
96
+ * Returns `true` if xstate is available, `false` otherwise.
97
+ *
98
+ * @example
99
+ * ```typescript
100
+ * import { initFsmEngine } from 'vurb';
101
+ * const available = await initFsmEngine();
102
+ * if (!available) console.warn('xstate not installed — FSM gating disabled');
103
+ * ```
104
+ */
105
+ export async function initFsmEngine() {
106
+ return (await loadXState()) !== null;
107
+ }
108
+ // ── StateMachineGate ─────────────────────────────────────
109
+ /**
110
+ * Temporal Anti-Hallucination Engine.
111
+ *
112
+ * Wraps an XState v5 finite state machine and controls which MCP tools
113
+ * are visible to the LLM based on the current workflow state.
114
+ *
115
+ * **Hard constraint**: Tools not bound to the current state are removed
116
+ * from `tools/list` entirely — the LLM physically cannot call them.
117
+ *
118
+ * **Soft constraint**: `suggestActions` (HATEOAS) continues to recommend
119
+ * the best next action within the visible set. Zero conflict.
120
+ */
121
+ export class StateMachineGate {
122
+ _config;
123
+ _bindings = new Map();
124
+ _transitionCallbacks = [];
125
+ _actor = null;
126
+ _currentState;
127
+ _initialized = false;
128
+ /**
129
+ * @param config - FSM definition (states, transitions, initial state)
130
+ */
131
+ constructor(config) {
132
+ this._config = config;
133
+ this._currentState = config.initial;
134
+ }
135
+ // ── Initialization ───────────────────────────────────
136
+ /**
137
+ * Initialize the XState actor (lazy-loaded).
138
+ *
139
+ * Called automatically on first use. Can be called explicitly
140
+ * at boot time for eager initialization.
141
+ *
142
+ * @returns `true` if XState is available and the actor started
143
+ */
144
+ async init() {
145
+ if (this._initialized)
146
+ return this._actor !== null;
147
+ const xstate = await loadXState();
148
+ if (!xstate) {
149
+ this._initialized = true;
150
+ return false;
151
+ }
152
+ try {
153
+ // Use _currentState as initial — it may have been set by restore()
154
+ // before init() was called (serverless/edge: restore → transition → init)
155
+ const machineConfig = this._currentState !== this._config.initial
156
+ ? { ...this._config, initial: this._currentState }
157
+ : this._config;
158
+ const machine = xstate.createMachine(machineConfig);
159
+ this._actor = xstate.createActor(machine);
160
+ this._actor.subscribe((snapshot) => {
161
+ const newState = typeof snapshot.value === 'string'
162
+ ? snapshot.value
163
+ : Object.keys(snapshot.value)[0] ?? this._config.initial;
164
+ if (newState !== this._currentState) {
165
+ this._currentState = newState;
166
+ for (const cb of this._transitionCallbacks) {
167
+ cb();
168
+ }
169
+ }
170
+ });
171
+ this._actor.start();
172
+ this._initialized = true;
173
+ return true;
174
+ }
175
+ catch {
176
+ this._initialized = true;
177
+ return false;
178
+ }
179
+ }
180
+ // ── Tool Binding ─────────────────────────────────────
181
+ /**
182
+ * Bind a tool to specific FSM states.
183
+ *
184
+ * The tool will only appear in `tools/list` when the FSM
185
+ * is in one of the specified states.
186
+ *
187
+ * @param toolName - MCP tool name (flat: `cart_add_item`, grouped: `cart`)
188
+ * @param allowedStates - FSM states where this tool is visible
189
+ * @param transitionEvent - Event to send on successful execution (optional)
190
+ * @returns `this` for chaining
191
+ *
192
+ * @example
193
+ * ```typescript
194
+ * gate.bindTool('cart_add_item', ['empty', 'has_items'], 'ADD_ITEM');
195
+ * gate.bindTool('cart_checkout', ['has_items'], 'CHECKOUT');
196
+ * ```
197
+ */
198
+ bindTool(toolName, allowedStates, transitionEvent) {
199
+ const binding = {
200
+ allowedStates: new Set(allowedStates),
201
+ };
202
+ if (transitionEvent !== undefined)
203
+ binding.transitionEvent = transitionEvent;
204
+ this._bindings.set(toolName, binding);
205
+ return this;
206
+ }
207
+ // ── State Queries ────────────────────────────────────
208
+ /**
209
+ * Get the current FSM state.
210
+ */
211
+ get currentState() {
212
+ return this._currentState;
213
+ }
214
+ /**
215
+ * Check if a specific tool is allowed in the current FSM state.
216
+ *
217
+ * Tools **not** registered via `bindTool()` are always visible
218
+ * (ungated — they don't participate in FSM gating).
219
+ *
220
+ * @param toolName - MCP tool name to check
221
+ * @returns `true` if the tool should appear in `tools/list`
222
+ */
223
+ isToolAllowed(toolName) {
224
+ const binding = this._bindings.get(toolName);
225
+ if (!binding)
226
+ return true; // Ungated tools are always visible
227
+ return binding.allowedStates.has(this._currentState);
228
+ }
229
+ /**
230
+ * Filter a list of tool names by the current FSM state.
231
+ *
232
+ * @param toolNames - All registered tool names
233
+ * @returns Only the tools allowed in the current state
234
+ */
235
+ getVisibleToolNames(toolNames) {
236
+ return toolNames.filter(name => this.isToolAllowed(name));
237
+ }
238
+ /**
239
+ * Get the transition event for a tool (if any).
240
+ *
241
+ * @param toolName - MCP tool name
242
+ * @returns The event string, or `undefined` if no transition is bound
243
+ */
244
+ getTransitionEvent(toolName) {
245
+ return this._bindings.get(toolName)?.transitionEvent;
246
+ }
247
+ /**
248
+ * Check if any tools are bound to this FSM gate.
249
+ *
250
+ * @returns `true` if at least one tool is state-gated
251
+ */
252
+ get hasBindings() {
253
+ return this._bindings.size > 0;
254
+ }
255
+ // ── State Transitions ────────────────────────────────
256
+ /**
257
+ * Send an event to the FSM, potentially triggering a state transition.
258
+ *
259
+ * @param eventType - The event to send (e.g. `'ADD_ITEM'`, `'CHECKOUT'`)
260
+ * @returns Result indicating whether the state changed
261
+ */
262
+ async transition(eventType) {
263
+ const previousState = this._currentState;
264
+ // Ensure initialized
265
+ if (!this._initialized) {
266
+ await this.init();
267
+ }
268
+ if (this._actor) {
269
+ // XState actor handles the transition
270
+ this._actor.send({ type: eventType });
271
+ }
272
+ else {
273
+ // Fallback: manual transition without XState
274
+ this._transitionManual(eventType);
275
+ }
276
+ return {
277
+ changed: this._currentState !== previousState,
278
+ previousState,
279
+ currentState: this._currentState,
280
+ };
281
+ }
282
+ /**
283
+ * Manual state transition fallback when XState is not installed.
284
+ *
285
+ * Reads the FSM config directly to determine the next state.
286
+ * This provides basic FSM gating even without `xstate` installed,
287
+ * though without XState's guards, actions, and advanced features.
288
+ *
289
+ * @internal
290
+ */
291
+ _transitionManual(eventType) {
292
+ const stateConfig = this._config.states[this._currentState];
293
+ if (!stateConfig?.on)
294
+ return;
295
+ const target = stateConfig.on[eventType];
296
+ if (target && this._config.states[target]) {
297
+ const previousState = this._currentState;
298
+ this._currentState = target;
299
+ if (previousState !== this._currentState) {
300
+ for (const cb of this._transitionCallbacks) {
301
+ cb();
302
+ }
303
+ }
304
+ }
305
+ }
306
+ // ── Transition Callbacks ─────────────────────────────
307
+ /**
308
+ * Register a callback that fires when the FSM state changes.
309
+ *
310
+ * Used by `ServerAttachment` to emit `notifications/tools/list_changed`
311
+ * when a state transition makes tools appear or disappear.
312
+ *
313
+ * @param callback - Function to call on state change
314
+ * @returns Unsubscribe function
315
+ */
316
+ onTransition(callback) {
317
+ this._transitionCallbacks.push(callback);
318
+ return () => {
319
+ const idx = this._transitionCallbacks.indexOf(callback);
320
+ if (idx >= 0)
321
+ this._transitionCallbacks.splice(idx, 1);
322
+ };
323
+ }
324
+ // ── Persistence (Serverless/Edge) ────────────────────
325
+ /**
326
+ * Create a serializable snapshot of the current FSM state.
327
+ *
328
+ * Used with `FsmStateStore` for serverless deployments where
329
+ * FSM state must survive across request boundaries.
330
+ *
331
+ * @returns Serializable snapshot
332
+ */
333
+ snapshot() {
334
+ return {
335
+ state: this._currentState,
336
+ updatedAt: Date.now(),
337
+ };
338
+ }
339
+ /**
340
+ * Restore FSM state from a persisted snapshot.
341
+ *
342
+ * Resets the XState actor (if running) so the next `transition()`
343
+ * re-initializes the machine starting from the restored state.
344
+ * This ensures restore → transition works correctly in
345
+ * serverless/edge deployments (Vercel, Cloudflare Workers).
346
+ *
347
+ * @param snap - Previously saved snapshot
348
+ */
349
+ restore(snap) {
350
+ if (this._config.states[snap.state]) {
351
+ this._currentState = snap.state;
352
+ // If the actor is already running, stop it and mark as
353
+ // uninitialized so the next transition() call will re-create
354
+ // the machine starting from the restored state.
355
+ if (this._actor) {
356
+ this._actor.stop();
357
+ this._actor = null;
358
+ this._initialized = false;
359
+ }
360
+ }
361
+ }
362
+ // ── Clone (Serverless Isolation) ─────────────────────
363
+ /**
364
+ * Create a lightweight clone of this gate with the same config
365
+ * and bindings but independent mutable state.
366
+ *
367
+ * Used in serverless/edge deployments where concurrent requests
368
+ * must not share `_currentState`. Each request gets its own clone,
369
+ * restores session state into it, transitions, and saves — without
370
+ * interfering with other concurrent requests.
371
+ *
372
+ * The clone starts **uninitialized** (no XState actor) so the first
373
+ * `transition()` call will create a fresh actor from the cloned state.
374
+ *
375
+ * @returns A new `StateMachineGate` with identical config and bindings
376
+ */
377
+ clone() {
378
+ const copy = new StateMachineGate(this._config);
379
+ for (const [toolName, binding] of this._bindings) {
380
+ copy._bindings.set(toolName, {
381
+ allowedStates: new Set(binding.allowedStates),
382
+ ...(binding.transitionEvent !== undefined ? { transitionEvent: binding.transitionEvent } : {}),
383
+ });
384
+ }
385
+ copy._currentState = this._currentState;
386
+ return copy;
387
+ }
388
+ // ── Cleanup ──────────────────────────────────────────
389
+ /**
390
+ * Stop the XState actor and release resources.
391
+ */
392
+ dispose() {
393
+ if (this._actor) {
394
+ this._actor.stop();
395
+ this._actor = null;
396
+ }
397
+ this._transitionCallbacks.length = 0;
398
+ }
399
+ }
400
+ //# sourceMappingURL=StateMachineGate.js.map