@bolt-foundry/gambit 0.5.3-dev.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 (520) hide show
  1. package/.gitkeep +0 -0
  2. package/CHANGELOG.md +85 -0
  3. package/LICENSE +201 -0
  4. package/README.md +236 -0
  5. package/esm/_dnt.polyfills.d.ts +25 -0
  6. package/esm/_dnt.polyfills.d.ts.map +1 -0
  7. package/esm/_dnt.polyfills.js +1 -0
  8. package/esm/_dnt.shims.d.ts +6 -0
  9. package/esm/_dnt.shims.d.ts.map +1 -0
  10. package/esm/_dnt.shims.js +61 -0
  11. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
  12. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
  13. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.js +12 -0
  14. package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
  15. package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
  16. package/esm/deps/jsr.io/@std/internal/1.0.12/os.js +5 -0
  17. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts +2 -0
  18. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
  19. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +7 -0
  20. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts +4 -0
  21. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
  22. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.js +40 -0
  23. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts +2 -0
  24. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts.map +1 -0
  25. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.js +23 -0
  26. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts +40 -0
  27. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
  28. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.js +46 -0
  29. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts +2 -0
  30. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts.map +1 -0
  31. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.js +8 -0
  32. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts +4 -0
  33. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts.map +1 -0
  34. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.js +19 -0
  35. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
  36. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
  37. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +9 -0
  38. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts +35 -0
  39. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts.map +1 -0
  40. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js +235 -0
  41. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts +2 -0
  42. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
  43. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +8 -0
  44. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts +2 -0
  45. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
  46. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +77 -0
  47. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts +2 -0
  48. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts.map +1 -0
  49. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.js +9 -0
  50. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts +2 -0
  51. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
  52. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +19 -0
  53. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts +2 -0
  54. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
  55. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +15 -0
  56. package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
  57. package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
  58. package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +35 -0
  59. package/esm/deps/jsr.io/@std/path/1.1.4/common.d.ts +28 -0
  60. package/esm/deps/jsr.io/@std/path/1.1.4/common.d.ts.map +1 -0
  61. package/esm/deps/jsr.io/@std/path/1.1.4/common.js +33 -0
  62. package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts +15 -0
  63. package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts.map +1 -0
  64. package/esm/deps/jsr.io/@std/path/1.1.4/constants.js +17 -0
  65. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.d.ts +22 -0
  66. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.d.ts.map +1 -0
  67. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.js +28 -0
  68. package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
  69. package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
  70. package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +28 -0
  71. package/esm/deps/jsr.io/@std/path/1.1.4/format.d.ts +22 -0
  72. package/esm/deps/jsr.io/@std/path/1.1.4/format.d.ts.map +1 -0
  73. package/esm/deps/jsr.io/@std/path/1.1.4/format.js +27 -0
  74. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts +22 -0
  75. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts.map +1 -0
  76. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.js +28 -0
  77. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts +77 -0
  78. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts.map +1 -0
  79. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +83 -0
  80. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts +22 -0
  81. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
  82. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +28 -0
  83. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts +17 -0
  84. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts.map +1 -0
  85. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.js +42 -0
  86. package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
  87. package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
  88. package/esm/deps/jsr.io/@std/path/1.1.4/join.js +29 -0
  89. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts +28 -0
  90. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts.map +1 -0
  91. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.js +34 -0
  92. package/esm/deps/jsr.io/@std/path/1.1.4/mod.d.ts +213 -0
  93. package/esm/deps/jsr.io/@std/path/1.1.4/mod.d.ts.map +1 -0
  94. package/esm/deps/jsr.io/@std/path/1.1.4/mod.js +216 -0
  95. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.d.ts +26 -0
  96. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.d.ts.map +1 -0
  97. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.js +32 -0
  98. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts +29 -0
  99. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts.map +1 -0
  100. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +35 -0
  101. package/esm/deps/jsr.io/@std/path/1.1.4/parse.d.ts +35 -0
  102. package/esm/deps/jsr.io/@std/path/1.1.4/parse.d.ts.map +1 -0
  103. package/esm/deps/jsr.io/@std/path/1.1.4/parse.js +39 -0
  104. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts +2 -0
  105. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
  106. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.js +8 -0
  107. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
  108. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
  109. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.js +52 -0
  110. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts +13 -0
  111. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts.map +1 -0
  112. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.js +14 -0
  113. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts +30 -0
  114. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts.map +1 -0
  115. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.js +64 -0
  116. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
  117. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
  118. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.js +93 -0
  119. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts +24 -0
  120. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts.map +1 -0
  121. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.js +28 -0
  122. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
  123. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
  124. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +21 -0
  125. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts +72 -0
  126. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts.map +1 -0
  127. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js +82 -0
  128. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts +17 -0
  129. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
  130. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +23 -0
  131. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
  132. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
  133. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.js +45 -0
  134. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts +20 -0
  135. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts.map +1 -0
  136. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js +40 -0
  137. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
  138. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
  139. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +58 -0
  140. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts +20 -0
  141. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts.map +1 -0
  142. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js +32 -0
  143. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts +25 -0
  144. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts.map +1 -0
  145. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.js +115 -0
  146. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts +20 -0
  147. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts.map +1 -0
  148. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.js +106 -0
  149. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts +17 -0
  150. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts.map +1 -0
  151. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.js +59 -0
  152. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts +17 -0
  153. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
  154. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +27 -0
  155. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts +16 -0
  156. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts.map +1 -0
  157. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js +20 -0
  158. package/esm/deps/jsr.io/@std/path/1.1.4/relative.d.ts +24 -0
  159. package/esm/deps/jsr.io/@std/path/1.1.4/relative.d.ts.map +1 -0
  160. package/esm/deps/jsr.io/@std/path/1.1.4/relative.js +30 -0
  161. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.d.ts +22 -0
  162. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.d.ts.map +1 -0
  163. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.js +30 -0
  164. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts +22 -0
  165. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
  166. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +28 -0
  167. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts +21 -0
  168. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts.map +1 -0
  169. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +29 -0
  170. package/esm/deps/jsr.io/@std/path/1.1.4/types.d.ts +38 -0
  171. package/esm/deps/jsr.io/@std/path/1.1.4/types.d.ts.map +1 -0
  172. package/esm/deps/jsr.io/@std/path/1.1.4/types.js +3 -0
  173. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts +4 -0
  174. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
  175. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.js +15 -0
  176. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
  177. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
  178. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.js +47 -0
  179. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts +13 -0
  180. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts.map +1 -0
  181. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.js +14 -0
  182. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts +17 -0
  183. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts.map +1 -0
  184. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.js +113 -0
  185. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
  186. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
  187. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.js +82 -0
  188. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts +24 -0
  189. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts.map +1 -0
  190. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.js +28 -0
  191. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
  192. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
  193. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +30 -0
  194. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts +71 -0
  195. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts.map +1 -0
  196. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js +82 -0
  197. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts +17 -0
  198. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
  199. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +38 -0
  200. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
  201. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
  202. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.js +77 -0
  203. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts +21 -0
  204. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts.map +1 -0
  205. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js +41 -0
  206. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
  207. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
  208. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +135 -0
  209. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts +20 -0
  210. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts.map +1 -0
  211. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js +32 -0
  212. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts +25 -0
  213. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts.map +1 -0
  214. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.js +176 -0
  215. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts +23 -0
  216. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts.map +1 -0
  217. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.js +131 -0
  218. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts +17 -0
  219. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts.map +1 -0
  220. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.js +154 -0
  221. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts +17 -0
  222. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
  223. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +34 -0
  224. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts +17 -0
  225. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts.map +1 -0
  226. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js +49 -0
  227. package/esm/gambit/mod.d.ts +10 -0
  228. package/esm/gambit/mod.d.ts.map +1 -0
  229. package/esm/gambit/mod.js +9 -0
  230. package/esm/gambit/src/durable_streams.d.ts +9 -0
  231. package/esm/gambit/src/durable_streams.d.ts.map +1 -0
  232. package/esm/gambit/src/durable_streams.js +132 -0
  233. package/esm/gambit/src/server.d.ts +16 -0
  234. package/esm/gambit/src/server.d.ts.map +1 -0
  235. package/esm/gambit/src/server.js +2288 -0
  236. package/esm/gambit/src/test_bot.d.ts +5 -0
  237. package/esm/gambit/src/test_bot.d.ts.map +1 -0
  238. package/esm/gambit/src/test_bot.js +5 -0
  239. package/esm/gambit/src/trace.d.ts +4 -0
  240. package/esm/gambit/src/trace.d.ts.map +1 -0
  241. package/esm/gambit/src/trace.js +86 -0
  242. package/esm/gambit-core/mod.d.ts +50 -0
  243. package/esm/gambit-core/mod.d.ts.map +1 -0
  244. package/esm/gambit-core/mod.js +19 -0
  245. package/esm/gambit-core/src/definitions.d.ts +11 -0
  246. package/esm/gambit-core/src/definitions.d.ts.map +1 -0
  247. package/esm/gambit-core/src/definitions.js +14 -0
  248. package/esm/gambit-core/src/openai_compat.d.ts +63 -0
  249. package/esm/gambit-core/src/openai_compat.d.ts.map +1 -0
  250. package/esm/gambit-core/src/openai_compat.js +272 -0
  251. package/esm/gambit-core/src/providers/openrouter.d.ts +8 -0
  252. package/esm/gambit-core/src/providers/openrouter.d.ts.map +1 -0
  253. package/esm/gambit-core/src/providers/openrouter.js +168 -0
  254. package/esm/gambit-core/src/render.d.ts +51 -0
  255. package/esm/gambit-core/src/render.d.ts.map +1 -0
  256. package/esm/gambit-core/src/render.js +188 -0
  257. package/esm/gambit-core/src/schema.d.ts +8 -0
  258. package/esm/gambit-core/src/schema.d.ts.map +1 -0
  259. package/esm/gambit-core/src/schema.js +45 -0
  260. package/esm/package.json +3 -0
  261. package/package.json +33 -0
  262. package/script/_dnt.polyfills.d.ts +25 -0
  263. package/script/_dnt.polyfills.d.ts.map +1 -0
  264. package/script/_dnt.polyfills.js +2 -0
  265. package/script/_dnt.shims.d.ts +6 -0
  266. package/script/_dnt.shims.d.ts.map +1 -0
  267. package/script/_dnt.shims.js +65 -0
  268. package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
  269. package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
  270. package/script/deps/jsr.io/@std/internal/1.0.12/_os.js +38 -0
  271. package/script/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
  272. package/script/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
  273. package/script/deps/jsr.io/@std/internal/1.0.12/os.js +8 -0
  274. package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts +2 -0
  275. package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
  276. package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +10 -0
  277. package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts +4 -0
  278. package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
  279. package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.js +45 -0
  280. package/script/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts +2 -0
  281. package/script/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts.map +1 -0
  282. package/script/deps/jsr.io/@std/path/1.1.4/_common/common.js +26 -0
  283. package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts +40 -0
  284. package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
  285. package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.js +49 -0
  286. package/script/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts +2 -0
  287. package/script/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts.map +1 -0
  288. package/script/deps/jsr.io/@std/path/1.1.4/_common/dirname.js +11 -0
  289. package/script/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts +4 -0
  290. package/script/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts.map +1 -0
  291. package/script/deps/jsr.io/@std/path/1.1.4/_common/format.js +23 -0
  292. package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
  293. package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
  294. package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +12 -0
  295. package/script/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts +35 -0
  296. package/script/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts.map +1 -0
  297. package/script/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js +238 -0
  298. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts +2 -0
  299. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
  300. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +11 -0
  301. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts +2 -0
  302. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
  303. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +80 -0
  304. package/script/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts +2 -0
  305. package/script/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts.map +1 -0
  306. package/script/deps/jsr.io/@std/path/1.1.4/_common/relative.js +12 -0
  307. package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts +2 -0
  308. package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
  309. package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +22 -0
  310. package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts +2 -0
  311. package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
  312. package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +18 -0
  313. package/script/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
  314. package/script/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
  315. package/script/deps/jsr.io/@std/path/1.1.4/basename.js +38 -0
  316. package/script/deps/jsr.io/@std/path/1.1.4/common.d.ts +28 -0
  317. package/script/deps/jsr.io/@std/path/1.1.4/common.d.ts.map +1 -0
  318. package/script/deps/jsr.io/@std/path/1.1.4/common.js +36 -0
  319. package/script/deps/jsr.io/@std/path/1.1.4/constants.d.ts +15 -0
  320. package/script/deps/jsr.io/@std/path/1.1.4/constants.d.ts.map +1 -0
  321. package/script/deps/jsr.io/@std/path/1.1.4/constants.js +20 -0
  322. package/script/deps/jsr.io/@std/path/1.1.4/dirname.d.ts +22 -0
  323. package/script/deps/jsr.io/@std/path/1.1.4/dirname.d.ts.map +1 -0
  324. package/script/deps/jsr.io/@std/path/1.1.4/dirname.js +31 -0
  325. package/script/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
  326. package/script/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
  327. package/script/deps/jsr.io/@std/path/1.1.4/extname.js +31 -0
  328. package/script/deps/jsr.io/@std/path/1.1.4/format.d.ts +22 -0
  329. package/script/deps/jsr.io/@std/path/1.1.4/format.d.ts.map +1 -0
  330. package/script/deps/jsr.io/@std/path/1.1.4/format.js +30 -0
  331. package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts +22 -0
  332. package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts.map +1 -0
  333. package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.js +31 -0
  334. package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts +77 -0
  335. package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts.map +1 -0
  336. package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +86 -0
  337. package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts +22 -0
  338. package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
  339. package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.js +31 -0
  340. package/script/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts +17 -0
  341. package/script/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts.map +1 -0
  342. package/script/deps/jsr.io/@std/path/1.1.4/is_glob.js +45 -0
  343. package/script/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
  344. package/script/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
  345. package/script/deps/jsr.io/@std/path/1.1.4/join.js +32 -0
  346. package/script/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts +28 -0
  347. package/script/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts.map +1 -0
  348. package/script/deps/jsr.io/@std/path/1.1.4/join_globs.js +37 -0
  349. package/script/deps/jsr.io/@std/path/1.1.4/mod.d.ts +213 -0
  350. package/script/deps/jsr.io/@std/path/1.1.4/mod.d.ts.map +1 -0
  351. package/script/deps/jsr.io/@std/path/1.1.4/mod.js +232 -0
  352. package/script/deps/jsr.io/@std/path/1.1.4/normalize.d.ts +26 -0
  353. package/script/deps/jsr.io/@std/path/1.1.4/normalize.d.ts.map +1 -0
  354. package/script/deps/jsr.io/@std/path/1.1.4/normalize.js +35 -0
  355. package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts +29 -0
  356. package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts.map +1 -0
  357. package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +38 -0
  358. package/script/deps/jsr.io/@std/path/1.1.4/parse.d.ts +35 -0
  359. package/script/deps/jsr.io/@std/path/1.1.4/parse.d.ts.map +1 -0
  360. package/script/deps/jsr.io/@std/path/1.1.4/parse.js +42 -0
  361. package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts +2 -0
  362. package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
  363. package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.js +11 -0
  364. package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
  365. package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
  366. package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.js +55 -0
  367. package/script/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts +13 -0
  368. package/script/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts.map +1 -0
  369. package/script/deps/jsr.io/@std/path/1.1.4/posix/constants.js +17 -0
  370. package/script/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts +30 -0
  371. package/script/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts.map +1 -0
  372. package/script/deps/jsr.io/@std/path/1.1.4/posix/dirname.js +67 -0
  373. package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
  374. package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
  375. package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.js +96 -0
  376. package/script/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts +24 -0
  377. package/script/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts.map +1 -0
  378. package/script/deps/jsr.io/@std/path/1.1.4/posix/format.js +31 -0
  379. package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
  380. package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
  381. package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +24 -0
  382. package/script/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts +72 -0
  383. package/script/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts.map +1 -0
  384. package/script/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js +85 -0
  385. package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts +17 -0
  386. package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
  387. package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +26 -0
  388. package/script/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
  389. package/script/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
  390. package/script/deps/jsr.io/@std/path/1.1.4/posix/join.js +48 -0
  391. package/script/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts +20 -0
  392. package/script/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts.map +1 -0
  393. package/script/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js +43 -0
  394. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
  395. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
  396. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +61 -0
  397. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts +20 -0
  398. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts.map +1 -0
  399. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js +35 -0
  400. package/script/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts +25 -0
  401. package/script/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts.map +1 -0
  402. package/script/deps/jsr.io/@std/path/1.1.4/posix/parse.js +118 -0
  403. package/script/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts +20 -0
  404. package/script/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts.map +1 -0
  405. package/script/deps/jsr.io/@std/path/1.1.4/posix/relative.js +109 -0
  406. package/script/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts +17 -0
  407. package/script/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts.map +1 -0
  408. package/script/deps/jsr.io/@std/path/1.1.4/posix/resolve.js +85 -0
  409. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts +17 -0
  410. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
  411. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +30 -0
  412. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts +16 -0
  413. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts.map +1 -0
  414. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js +23 -0
  415. package/script/deps/jsr.io/@std/path/1.1.4/relative.d.ts +24 -0
  416. package/script/deps/jsr.io/@std/path/1.1.4/relative.d.ts.map +1 -0
  417. package/script/deps/jsr.io/@std/path/1.1.4/relative.js +33 -0
  418. package/script/deps/jsr.io/@std/path/1.1.4/resolve.d.ts +22 -0
  419. package/script/deps/jsr.io/@std/path/1.1.4/resolve.d.ts.map +1 -0
  420. package/script/deps/jsr.io/@std/path/1.1.4/resolve.js +33 -0
  421. package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts +22 -0
  422. package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
  423. package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.js +31 -0
  424. package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts +21 -0
  425. package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts.map +1 -0
  426. package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +32 -0
  427. package/script/deps/jsr.io/@std/path/1.1.4/types.d.ts +38 -0
  428. package/script/deps/jsr.io/@std/path/1.1.4/types.d.ts.map +1 -0
  429. package/script/deps/jsr.io/@std/path/1.1.4/types.js +4 -0
  430. package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts +4 -0
  431. package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
  432. package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.js +20 -0
  433. package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
  434. package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
  435. package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.js +50 -0
  436. package/script/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts +13 -0
  437. package/script/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts.map +1 -0
  438. package/script/deps/jsr.io/@std/path/1.1.4/windows/constants.js +17 -0
  439. package/script/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts +17 -0
  440. package/script/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts.map +1 -0
  441. package/script/deps/jsr.io/@std/path/1.1.4/windows/dirname.js +116 -0
  442. package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
  443. package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
  444. package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.js +85 -0
  445. package/script/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts +24 -0
  446. package/script/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts.map +1 -0
  447. package/script/deps/jsr.io/@std/path/1.1.4/windows/format.js +31 -0
  448. package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
  449. package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
  450. package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +33 -0
  451. package/script/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts +71 -0
  452. package/script/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts.map +1 -0
  453. package/script/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js +85 -0
  454. package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts +17 -0
  455. package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
  456. package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +41 -0
  457. package/script/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
  458. package/script/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
  459. package/script/deps/jsr.io/@std/path/1.1.4/windows/join.js +80 -0
  460. package/script/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts +21 -0
  461. package/script/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts.map +1 -0
  462. package/script/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js +44 -0
  463. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
  464. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
  465. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +138 -0
  466. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts +20 -0
  467. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts.map +1 -0
  468. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js +35 -0
  469. package/script/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts +25 -0
  470. package/script/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts.map +1 -0
  471. package/script/deps/jsr.io/@std/path/1.1.4/windows/parse.js +179 -0
  472. package/script/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts +23 -0
  473. package/script/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts.map +1 -0
  474. package/script/deps/jsr.io/@std/path/1.1.4/windows/relative.js +134 -0
  475. package/script/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts +17 -0
  476. package/script/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts.map +1 -0
  477. package/script/deps/jsr.io/@std/path/1.1.4/windows/resolve.js +180 -0
  478. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts +17 -0
  479. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
  480. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +37 -0
  481. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts +17 -0
  482. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts.map +1 -0
  483. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js +52 -0
  484. package/script/gambit/mod.d.ts +10 -0
  485. package/script/gambit/mod.d.ts.map +1 -0
  486. package/script/gambit/mod.js +27 -0
  487. package/script/gambit/src/durable_streams.d.ts +9 -0
  488. package/script/gambit/src/durable_streams.d.ts.map +1 -0
  489. package/script/gambit/src/durable_streams.js +136 -0
  490. package/script/gambit/src/server.d.ts +16 -0
  491. package/script/gambit/src/server.d.ts.map +1 -0
  492. package/script/gambit/src/server.js +2314 -0
  493. package/script/gambit/src/test_bot.d.ts +5 -0
  494. package/script/gambit/src/test_bot.d.ts.map +1 -0
  495. package/script/gambit/src/test_bot.js +8 -0
  496. package/script/gambit/src/trace.d.ts +4 -0
  497. package/script/gambit/src/trace.d.ts.map +1 -0
  498. package/script/gambit/src/trace.js +113 -0
  499. package/script/gambit-core/mod.d.ts +50 -0
  500. package/script/gambit-core/mod.d.ts.map +1 -0
  501. package/script/gambit-core/mod.js +29 -0
  502. package/script/gambit-core/src/definitions.d.ts +11 -0
  503. package/script/gambit-core/src/definitions.d.ts.map +1 -0
  504. package/script/gambit-core/src/definitions.js +20 -0
  505. package/script/gambit-core/src/openai_compat.d.ts +63 -0
  506. package/script/gambit-core/src/openai_compat.d.ts.map +1 -0
  507. package/script/gambit-core/src/openai_compat.js +276 -0
  508. package/script/gambit-core/src/providers/openrouter.d.ts +8 -0
  509. package/script/gambit-core/src/providers/openrouter.d.ts.map +1 -0
  510. package/script/gambit-core/src/providers/openrouter.js +197 -0
  511. package/script/gambit-core/src/render.d.ts +51 -0
  512. package/script/gambit-core/src/render.d.ts.map +1 -0
  513. package/script/gambit-core/src/render.js +192 -0
  514. package/script/gambit-core/src/schema.d.ts +8 -0
  515. package/script/gambit-core/src/schema.d.ts.map +1 -0
  516. package/script/gambit-core/src/schema.js +51 -0
  517. package/script/package.json +3 -0
  518. package/simulator-ui/.gitkeep +1 -0
  519. package/simulator-ui/bundle.js +22824 -0
  520. package/simulator-ui/bundle.js.map +7 -0
@@ -0,0 +1,5 @@
1
+ export declare function sanitizeNumber(value: unknown, fallback: number, { min, max }: {
2
+ min: number;
3
+ max: number;
4
+ }): number;
5
+ //# sourceMappingURL=test_bot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test_bot.d.ts","sourceRoot":"","sources":["../../../src/gambit/src/test_bot.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,MAAM,EAChB,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACzC,MAAM,CAGR"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sanitizeNumber = sanitizeNumber;
4
+ function sanitizeNumber(value, fallback, { min, max }) {
5
+ if (typeof value !== "number" || Number.isNaN(value))
6
+ return fallback;
7
+ return Math.max(min, Math.min(max, value));
8
+ }
@@ -0,0 +1,4 @@
1
+ import type { TraceEvent } from "@bolt-foundry/gambit-core/internal/types";
2
+ export declare function makeJsonlTracer(filePath: string): (event: TraceEvent) => void;
3
+ export declare function makeConsoleTracer(): (event: TraceEvent) => void;
4
+ //# sourceMappingURL=trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/gambit/src/trace.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAI3E,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAQ7E;AAED,wBAAgB,iBAAiB,IAAI,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAmI/D"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.makeJsonlTracer = makeJsonlTracer;
27
+ exports.makeConsoleTracer = makeConsoleTracer;
28
+ const dntShim = __importStar(require("../../_dnt.shims.js"));
29
+ const path = __importStar(require("../../deps/jsr.io/@std/path/1.1.4/mod.js"));
30
+ const logger = console;
31
+ function makeJsonlTracer(filePath) {
32
+ const resolved = path.resolve(filePath);
33
+ const dir = path.dirname(resolved);
34
+ dntShim.Deno.mkdirSync(dir, { recursive: true });
35
+ return (event) => {
36
+ const line = JSON.stringify(event);
37
+ dntShim.Deno.writeTextFileSync(resolved, line + "\n", { append: true });
38
+ };
39
+ }
40
+ function makeConsoleTracer() {
41
+ const started = new Map();
42
+ const now = () => performance.now();
43
+ const fmtMs = (start) => start !== undefined ? ` elapsed_ms=${Math.round(now() - start)}` : "";
44
+ return (event) => {
45
+ switch (event.type) {
46
+ case "run.start":
47
+ started.set(event.runId, now());
48
+ logger.log(`[trace] run.start runId=${event.runId}${event.deckPath ? ` deck=${event.deckPath}` : ""}${event.initialUserMessage !== undefined
49
+ ? ` initialUserMessage=${JSON.stringify(event.initialUserMessage)}`
50
+ : ""}${event.input !== undefined
51
+ ? ` input=${JSON.stringify(event.input)}`
52
+ : ""}`);
53
+ break;
54
+ case "run.end": {
55
+ const start = started.get(event.runId);
56
+ started.delete(event.runId);
57
+ logger.log(`[trace] run.end runId=${event.runId}${fmtMs(start)}`);
58
+ break;
59
+ }
60
+ case "message.user": {
61
+ logger.log(`[trace] message.user runId=${event.runId} actionCallId=${event.actionCallId} deck=${event.deckPath} content=${JSON.stringify(event.message?.content ?? "")}`);
62
+ break;
63
+ }
64
+ case "deck.start":
65
+ started.set(event.actionCallId, now());
66
+ logger.log(`[trace] deck.start runId=${event.runId} actionCallId=${event.actionCallId} deck=${event.deckPath}`);
67
+ break;
68
+ case "deck.end": {
69
+ const start = started.get(event.actionCallId);
70
+ started.delete(event.actionCallId);
71
+ logger.log(`[trace] deck.end runId=${event.runId} actionCallId=${event.actionCallId} deck=${event.deckPath}${fmtMs(start)}`);
72
+ break;
73
+ }
74
+ case "action.start":
75
+ started.set(event.actionCallId, now());
76
+ logger.log(`[trace] action.start runId=${event.runId} actionCallId=${event.actionCallId} name=${event.name} path=${event.path}`);
77
+ break;
78
+ case "action.end": {
79
+ const start = started.get(event.actionCallId);
80
+ started.delete(event.actionCallId);
81
+ logger.log(`[trace] action.end runId=${event.runId} actionCallId=${event.actionCallId} name=${event.name} path=${event.path}${fmtMs(start)}`);
82
+ break;
83
+ }
84
+ case "tool.call":
85
+ logger.log(`[trace] tool.call runId=${event.runId} actionCallId=${event.actionCallId} name=${event.name} args=${JSON.stringify(event.args)}`);
86
+ break;
87
+ case "tool.result":
88
+ logger.log(`[trace] tool.result runId=${event.runId} actionCallId=${event.actionCallId} name=${event.name} result=${JSON.stringify(event.result)}`);
89
+ break;
90
+ case "model.call":
91
+ logger.log(`[trace] model.call runId=${event.runId} actionCallId=${event.actionCallId} deck=${event.deckPath} model=${event.model ?? "(default)"} messages=${event.messageCount ?? event.messages.length} tools=${event.toolCount ?? event.tools?.length ?? 0} stream=${event.stream ?? false} stateMessages=${event.stateMessages ?? 0}`);
92
+ break;
93
+ case "model.result":
94
+ logger.log(`[trace] model.result runId=${event.runId} actionCallId=${event.actionCallId} deck=${event.deckPath} model=${event.model ?? "(default)"} finish=${event.finishReason} toolCalls=${event.toolCalls?.length ?? 0} stateMessages=${event.stateMessages ?? 0}`);
95
+ break;
96
+ case "log": {
97
+ const meta = event.meta !== undefined
98
+ ? ` meta=${JSON.stringify(event.meta)}`
99
+ : "";
100
+ const title = event.title ? ` title="${event.title}"` : "";
101
+ const msg = event.message ? ` msg="${event.message}"` : "";
102
+ logger.log(`[log] level=${event.level ?? "info"} runId=${event.runId} actionCallId=${event.actionCallId} deck=${event.deckPath}${title}${msg}${meta}`);
103
+ break;
104
+ }
105
+ case "monolog": {
106
+ logger.log(`[monolog] runId=${event.runId} actionCallId=${event.actionCallId} deck=${event.deckPath} content=${JSON.stringify(event.content)}`);
107
+ break;
108
+ }
109
+ default:
110
+ logger.log("[trace]", event);
111
+ }
112
+ };
113
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Gambit core exports for authoring and running decks/cards with runtime helpers.
3
+ *
4
+ * @module
5
+ */
6
+ /** Define a reusable card with shared behavior, tools, or guardrails. */
7
+ export { defineCard } from "./src/definitions.js";
8
+ /** Define a deck, the primary unit of execution. */
9
+ export { defineDeck } from "./src/definitions.js";
10
+ /** Action deck definition shape. */
11
+ export type { ActionDeckDefinition } from "@bolt-foundry/gambit-core/internal/types";
12
+ /** Card definition shape. */
13
+ export type { CardDefinition } from "@bolt-foundry/gambit-core/internal/types";
14
+ /** Deck definition shape. */
15
+ export type { DeckDefinition } from "@bolt-foundry/gambit-core/internal/types";
16
+ /** Reference to another deck. */
17
+ export type { DeckReferenceDefinition } from "@bolt-foundry/gambit-core/internal/types";
18
+ /** Execution context passed to decks. */
19
+ export type { ExecutionContext } from "@bolt-foundry/gambit-core/internal/types";
20
+ /** Grader deck definition shape. */
21
+ export type { GraderDeckDefinition } from "@bolt-foundry/gambit-core/internal/types";
22
+ /** Guardrails definition and hooks. */
23
+ export type { Guardrails } from "@bolt-foundry/gambit-core/internal/types";
24
+ /** JSON-serializable value type used throughout Gambit. */
25
+ export type { JSONValue } from "@bolt-foundry/gambit-core/internal/types";
26
+ /** Model provider interface for LLM backends. */
27
+ export type { ModelProvider } from "@bolt-foundry/gambit-core/internal/types";
28
+ /** Test deck definition shape. */
29
+ export type { TestDeckDefinition } from "@bolt-foundry/gambit-core/internal/types";
30
+ /** Check if a value is an explicit end-of-run signal. */
31
+ export { isGambitEndSignal } from "@bolt-foundry/gambit-core/internal/runtime";
32
+ /** Run a deck and return its execution result. */
33
+ export { runDeck } from "@bolt-foundry/gambit-core/internal/runtime";
34
+ /** Signal for explicitly ending a Gambit run. */
35
+ export type { GambitEndSignal } from "@bolt-foundry/gambit-core/internal/runtime";
36
+ /** OpenAI Chat Completions compatibility helper for a deck. */
37
+ export { chatCompletionsWithDeck } from "./src/openai_compat.js";
38
+ /** OpenAI-compatible request payload. */
39
+ export type { ChatCompletionsRequest } from "./src/openai_compat.js";
40
+ /** OpenAI-compatible response payload. */
41
+ export type { ChatCompletionsResponse } from "./src/openai_compat.js";
42
+ /** Render a deck to a human-readable outline or debug view. */
43
+ export { renderDeck } from "./src/render.js";
44
+ /** Options for deck rendering. */
45
+ export type { RenderDeckOptions } from "./src/render.js";
46
+ /** Result data from rendering a deck. */
47
+ export type { RenderDeckResult } from "./src/render.js";
48
+ /** Provider factory for OpenRouter-backed model calls. */
49
+ export { createOpenRouterProvider } from "./src/providers/openrouter.js";
50
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/gambit-core/mod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,yEAAyE;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,oDAAoD;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,oCAAoC;AACpC,YAAY,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,6BAA6B;AAC7B,YAAY,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC/E,6BAA6B;AAC7B,YAAY,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC/E,iCAAiC;AACjC,YAAY,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACxF,yCAAyC;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AACjF,oCAAoC;AACpC,YAAY,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AACrF,uCAAuC;AACvC,YAAY,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAC3E,2DAA2D;AAC3D,YAAY,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAC1E,iDAAiD;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAC9E,kCAAkC;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AACnF,yDAAyD;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,kDAAkD;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,4CAA4C,CAAC;AACrE,iDAAiD;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAClF,+DAA+D;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,yCAAyC;AACzC,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,0CAA0C;AAC1C,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,+DAA+D;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,kCAAkC;AAClC,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,yCAAyC;AACzC,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,0DAA0D;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createOpenRouterProvider = exports.renderDeck = exports.chatCompletionsWithDeck = exports.runDeck = exports.isGambitEndSignal = exports.defineDeck = exports.defineCard = void 0;
4
+ /**
5
+ * Gambit core exports for authoring and running decks/cards with runtime helpers.
6
+ *
7
+ * @module
8
+ */
9
+ /** Define a reusable card with shared behavior, tools, or guardrails. */
10
+ var definitions_js_1 = require("./src/definitions.js");
11
+ Object.defineProperty(exports, "defineCard", { enumerable: true, get: function () { return definitions_js_1.defineCard; } });
12
+ /** Define a deck, the primary unit of execution. */
13
+ var definitions_js_2 = require("./src/definitions.js");
14
+ Object.defineProperty(exports, "defineDeck", { enumerable: true, get: function () { return definitions_js_2.defineDeck; } });
15
+ /** Check if a value is an explicit end-of-run signal. */
16
+ var runtime_1 = require("@bolt-foundry/gambit-core/internal/runtime");
17
+ Object.defineProperty(exports, "isGambitEndSignal", { enumerable: true, get: function () { return runtime_1.isGambitEndSignal; } });
18
+ /** Run a deck and return its execution result. */
19
+ var runtime_2 = require("@bolt-foundry/gambit-core/internal/runtime");
20
+ Object.defineProperty(exports, "runDeck", { enumerable: true, get: function () { return runtime_2.runDeck; } });
21
+ /** OpenAI Chat Completions compatibility helper for a deck. */
22
+ var openai_compat_js_1 = require("./src/openai_compat.js");
23
+ Object.defineProperty(exports, "chatCompletionsWithDeck", { enumerable: true, get: function () { return openai_compat_js_1.chatCompletionsWithDeck; } });
24
+ /** Render a deck to a human-readable outline or debug view. */
25
+ var render_js_1 = require("./src/render.js");
26
+ Object.defineProperty(exports, "renderDeck", { enumerable: true, get: function () { return render_js_1.renderDeck; } });
27
+ /** Provider factory for OpenRouter-backed model calls. */
28
+ var openrouter_js_1 = require("./src/providers/openrouter.js");
29
+ Object.defineProperty(exports, "createOpenRouterProvider", { enumerable: true, get: function () { return openrouter_js_1.createOpenRouterProvider; } });
@@ -0,0 +1,11 @@
1
+ import type { CardDefinition, DeckDefinition } from "@bolt-foundry/gambit-core/internal/types";
2
+ import type { z } from "zod";
3
+ export declare function defineDeck<InputSchema extends z.ZodTypeAny, OutputSchema extends z.ZodTypeAny | undefined = undefined>(def: Omit<DeckDefinition<z.infer<InputSchema>>, "kind" | "inputSchema" | "outputSchema"> & {
4
+ inputSchema: InputSchema;
5
+ outputSchema?: OutputSchema;
6
+ }): DeckDefinition<z.infer<InputSchema>>;
7
+ export declare function defineDeck(def: Omit<DeckDefinition, "kind">): DeckDefinition;
8
+ export declare function defineCard(def: Omit<CardDefinition, "kind">): CardDefinition;
9
+ export declare function isDeckDefinition(value: unknown): value is DeckDefinition;
10
+ export declare function isCardDefinition(value: unknown): value is CardDefinition;
11
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../src/gambit-core/src/definitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC/F,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,wBAAgB,UAAU,CACxB,WAAW,SAAS,CAAC,CAAC,UAAU,EAChC,YAAY,SAAS,CAAC,CAAC,UAAU,GAAG,SAAS,GAAG,SAAS,EAEzD,GAAG,EACC,IAAI,CACJ,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,EACpC,MAAM,GAAG,aAAa,GAAG,cAAc,CACxC,GACC;IACA,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,GACF,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;AACxC,wBAAgB,UAAU,CACxB,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAChC,cAAc,CAAC;AAOlB,wBAAgB,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG,cAAc,CAE5E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAKxE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAKxE"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineDeck = defineDeck;
4
+ exports.defineCard = defineCard;
5
+ exports.isDeckDefinition = isDeckDefinition;
6
+ exports.isCardDefinition = isCardDefinition;
7
+ function defineDeck(def) {
8
+ return { kind: "gambit.deck", ...def };
9
+ }
10
+ function defineCard(def) {
11
+ return { kind: "gambit.card", ...def };
12
+ }
13
+ function isDeckDefinition(value) {
14
+ return Boolean(value && typeof value === "object" &&
15
+ value.kind === "gambit.deck");
16
+ }
17
+ function isCardDefinition(value) {
18
+ return Boolean(value && typeof value === "object" &&
19
+ value.kind === "gambit.card");
20
+ }
@@ -0,0 +1,63 @@
1
+ import type { Guardrails, ModelMessage, ModelProvider, ToolDefinition } from "@bolt-foundry/gambit-core/internal/types";
2
+ export declare const logger: Console;
3
+ export type ChatCompletionsRequest = {
4
+ model: string;
5
+ messages: Array<{
6
+ role: "system" | "user" | "assistant" | "tool";
7
+ content: string | null | Array<string | {
8
+ text?: string;
9
+ type?: string;
10
+ }>;
11
+ name?: string;
12
+ tool_call_id?: string;
13
+ tool_calls?: ModelMessage["tool_calls"];
14
+ }>;
15
+ tools?: Array<ToolDefinition>;
16
+ stream?: boolean;
17
+ temperature?: number;
18
+ top_p?: number;
19
+ frequency_penalty?: number;
20
+ presence_penalty?: number;
21
+ max_tokens?: number;
22
+ [key: string]: unknown;
23
+ };
24
+ export type ChatCompletionsResponse = {
25
+ id: string;
26
+ object: "chat.completion";
27
+ created: number;
28
+ model: string;
29
+ choices: Array<{
30
+ index: number;
31
+ message: ModelMessage;
32
+ finish_reason: "stop" | "tool_calls" | "length";
33
+ logprobs: null;
34
+ }>;
35
+ usage?: {
36
+ prompt_tokens: number;
37
+ completion_tokens: number;
38
+ total_tokens: number;
39
+ };
40
+ /**
41
+ * Non-OpenAI extension field containing the full transcript and metadata.
42
+ * Most clients will ignore unknown fields.
43
+ */
44
+ gambit?: {
45
+ deckPath: string;
46
+ messages: Array<ModelMessage>;
47
+ runId: string;
48
+ };
49
+ };
50
+ export declare function chatCompletionsWithDeck(args: {
51
+ deckPath: string;
52
+ request: ChatCompletionsRequest;
53
+ modelProvider: ModelProvider;
54
+ /**
55
+ * When true (default), Gambit will execute tool calls that match deck actions.
56
+ * Any other tool calls are returned to the caller as normal OpenAI tool calls.
57
+ */
58
+ executeDeckTools?: boolean;
59
+ guardrails?: Partial<Guardrails>;
60
+ defaultModel?: string;
61
+ onStreamText?: (chunk: string) => void;
62
+ }): Promise<ChatCompletionsResponse>;
63
+ //# sourceMappingURL=openai_compat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai_compat.d.ts","sourceRoot":"","sources":["../../../src/gambit-core/src/openai_compat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAEV,YAAY,EACZ,aAAa,EACb,cAAc,EACf,MAAM,0CAA0C,CAAC;AAElD,eAAO,MAAM,MAAM,SAAU,CAAC;AAO9B,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;QAC/C,OAAO,EACH,MAAM,GACN,IAAI,GACJ,KAAK,CAAC,MAAM,GAAG;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QACrD,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;KACzC,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,YAAY,CAAC;QACtB,aAAa,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAC;QAChD,QAAQ,EAAE,IAAI,CAAC;KAChB,CAAC,CAAC;IACH,KAAK,CAAC,EAAE;QACN,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF;;;OAGG;IACH,MAAM,CAAC,EAAE;QACP,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAoKF,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,sBAAsB,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAsJnC"}
@@ -0,0 +1,276 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logger = void 0;
4
+ exports.chatCompletionsWithDeck = chatCompletionsWithDeck;
5
+ const constants_1 = require("@bolt-foundry/gambit-core/internal/constants");
6
+ const loader_1 = require("@bolt-foundry/gambit-core/internal/loader");
7
+ const schema_js_1 = require("./schema.js");
8
+ const runtime_1 = require("@bolt-foundry/gambit-core/internal/runtime");
9
+ exports.logger = console;
10
+ function randomId(prefix) {
11
+ const suffix = crypto.randomUUID().replace(/-/g, "").slice(0, 24);
12
+ return `${prefix}-${suffix}`;
13
+ }
14
+ function normalizeContent(content) {
15
+ if (content === null)
16
+ return null;
17
+ if (typeof content === "string")
18
+ return content;
19
+ if (!Array.isArray(content))
20
+ return String(content);
21
+ return content
22
+ .map((c) => (typeof c === "string" ? c : (c.text ?? "")))
23
+ .join("");
24
+ }
25
+ function normalizeMessages(input) {
26
+ return input.map((m) => ({
27
+ role: m.role,
28
+ content: normalizeContent(m.content),
29
+ name: m.name,
30
+ tool_call_id: m.tool_call_id,
31
+ tool_calls: m.tool_calls && m.tool_calls.length > 0
32
+ ? m.tool_calls
33
+ : undefined,
34
+ }));
35
+ }
36
+ function providerParamsFromRequest(req) {
37
+ const out = {};
38
+ if (req.temperature !== undefined)
39
+ out.temperature = req.temperature;
40
+ if (req.top_p !== undefined)
41
+ out.top_p = req.top_p;
42
+ if (req.frequency_penalty !== undefined) {
43
+ out.frequency_penalty = req.frequency_penalty;
44
+ }
45
+ if (req.presence_penalty !== undefined) {
46
+ out.presence_penalty = req.presence_penalty;
47
+ }
48
+ if (req.max_tokens !== undefined)
49
+ out.max_tokens = req.max_tokens;
50
+ return Object.keys(out).length ? out : undefined;
51
+ }
52
+ function mergeToolDefs(gambitTools, externalTools) {
53
+ if (!externalTools?.length)
54
+ return gambitTools;
55
+ return [...gambitTools, ...externalTools];
56
+ }
57
+ function toolName(tool) {
58
+ return tool.function?.name ?? "";
59
+ }
60
+ function assertNoToolNameCollisions(args) {
61
+ if (!args.externalTools?.length)
62
+ return;
63
+ const gambit = new Set(args.gambitTools.map(toolName));
64
+ for (const t of args.externalTools) {
65
+ const name = toolName(t);
66
+ if (!name)
67
+ continue;
68
+ if (name.startsWith(constants_1.RESERVED_TOOL_PREFIX)) {
69
+ throw new Error(`External tool name ${name} is reserved (prefix ${constants_1.RESERVED_TOOL_PREFIX})`);
70
+ }
71
+ if (gambit.has(name)) {
72
+ throw new Error(`Tool name collision for ${name} between Gambit deck actions and external tools`);
73
+ }
74
+ }
75
+ }
76
+ async function buildGambitActionTools(deck) {
77
+ const tools = [];
78
+ const toolNameSet = new Set();
79
+ const actionPathByName = new Map();
80
+ for (const action of deck.actionDecks) {
81
+ const child = await (0, loader_1.loadDeck)(action.path, deck.path);
82
+ if (!child.inputSchema || !child.outputSchema) {
83
+ throw new Error(`Deck ${child.path} must declare inputSchema and outputSchema (non-root)`);
84
+ }
85
+ (0, schema_js_1.assertZodSchema)(child.inputSchema, "inputSchema");
86
+ (0, schema_js_1.assertZodSchema)(child.outputSchema, "outputSchema");
87
+ const params = (0, schema_js_1.toJsonSchema)(child.inputSchema);
88
+ tools.push({
89
+ type: "function",
90
+ function: {
91
+ name: action.name,
92
+ description: action.description,
93
+ parameters: params,
94
+ },
95
+ });
96
+ toolNameSet.add(action.name);
97
+ actionPathByName.set(action.name, action.path);
98
+ }
99
+ return { tools, toolNameSet, actionPathByName };
100
+ }
101
+ function deckSystemPrompt(deck) {
102
+ const parts = [];
103
+ const prompt = deck.body ?? deck.prompt;
104
+ if (prompt)
105
+ parts.push(prompt.trim());
106
+ for (const card of deck.cards) {
107
+ if (card.body)
108
+ parts.push(card.body.trim());
109
+ }
110
+ return parts.join("\n\n").trim();
111
+ }
112
+ function shouldPrependDeckSystem(messages, systemPrompt) {
113
+ if (!systemPrompt)
114
+ return false;
115
+ if (!messages.length)
116
+ return true;
117
+ const hasExact = messages.some((m) => m.role === "system" && m.content === systemPrompt);
118
+ return !hasExact;
119
+ }
120
+ function warnIfSystemMismatch(args) {
121
+ if (!args.systemPrompt)
122
+ return;
123
+ const existing = args.provided.find((m) => m.role === "system");
124
+ if (!existing)
125
+ return;
126
+ if (existing.content === args.systemPrompt)
127
+ return;
128
+ exports.logger.warn(`[gambit] chatCompletionsWithDeck: request includes a system message that does not match the deck prompt (${args.deckPath})`);
129
+ }
130
+ function toolResultContent(result) {
131
+ if (typeof result === "string")
132
+ return result;
133
+ try {
134
+ return JSON.stringify(result);
135
+ }
136
+ catch {
137
+ return String(result);
138
+ }
139
+ }
140
+ function normalizeError(err) {
141
+ return { message: err instanceof Error ? err.message : String(err) };
142
+ }
143
+ async function chatCompletionsWithDeck(args) {
144
+ const executeDeckTools = args.executeDeckTools ?? true;
145
+ const guardrails = { ...constants_1.DEFAULT_GUARDRAILS, ...args.guardrails };
146
+ const runId = randomId("run");
147
+ const deck = await (0, loader_1.loadDeck)(args.deckPath);
148
+ const systemPrompt = deckSystemPrompt(deck);
149
+ const providedMessages = normalizeMessages(args.request.messages);
150
+ const messages = [];
151
+ warnIfSystemMismatch({
152
+ provided: providedMessages,
153
+ systemPrompt,
154
+ deckPath: deck.path,
155
+ });
156
+ if (shouldPrependDeckSystem(providedMessages, systemPrompt)) {
157
+ messages.push({ role: "system", content: systemPrompt });
158
+ }
159
+ messages.push(...providedMessages);
160
+ const gambit = await buildGambitActionTools(deck);
161
+ assertNoToolNameCollisions({
162
+ gambitTools: gambit.tools,
163
+ externalTools: args.request.tools,
164
+ });
165
+ const tools = mergeToolDefs(gambit.tools, args.request.tools);
166
+ const start = performance.now();
167
+ let passes = 0;
168
+ while (passes < guardrails.maxPasses) {
169
+ passes++;
170
+ if (performance.now() - start > guardrails.timeoutMs) {
171
+ throw new Error("Timeout exceeded");
172
+ }
173
+ const model = args.request.model ?? args.defaultModel ??
174
+ (() => {
175
+ throw new Error("No model provided");
176
+ })();
177
+ const result = await args.modelProvider.chat({
178
+ model,
179
+ messages,
180
+ tools: tools.length ? tools : undefined,
181
+ stream: Boolean(args.request.stream),
182
+ onStreamText: args.onStreamText,
183
+ params: providerParamsFromRequest(args.request),
184
+ });
185
+ messages.push(result.message);
186
+ if (result.toolCalls && result.toolCalls.length > 0) {
187
+ const gambitCalls = result.toolCalls.filter((c) => gambit.toolNameSet.has(c.name));
188
+ const externalCalls = result.toolCalls.filter((c) => !gambit.toolNameSet.has(c.name));
189
+ if (!executeDeckTools || externalCalls.length > 0) {
190
+ return {
191
+ id: randomId("chatcmpl"),
192
+ object: "chat.completion",
193
+ created: Math.floor(Date.now() / 1000),
194
+ model,
195
+ choices: [{
196
+ index: 0,
197
+ message: result.message,
198
+ finish_reason: "tool_calls",
199
+ logprobs: null,
200
+ }],
201
+ usage: result.usage
202
+ ? {
203
+ prompt_tokens: result.usage.promptTokens,
204
+ completion_tokens: result.usage.completionTokens,
205
+ total_tokens: result.usage.totalTokens,
206
+ }
207
+ : undefined,
208
+ gambit: { deckPath: deck.path, messages, runId },
209
+ };
210
+ }
211
+ // Execute only deck-defined tool calls.
212
+ for (const call of gambitCalls) {
213
+ const actionPath = gambit.actionPathByName.get(call.name);
214
+ if (!actionPath)
215
+ continue;
216
+ try {
217
+ const childResult = await (0, runtime_1.runDeck)({
218
+ path: actionPath,
219
+ input: call.args,
220
+ modelProvider: args.modelProvider,
221
+ isRoot: false,
222
+ guardrails,
223
+ depth: 1,
224
+ parentActionCallId: call.id,
225
+ runId,
226
+ defaultModel: model,
227
+ modelOverride: undefined,
228
+ trace: undefined,
229
+ stream: Boolean(args.request.stream),
230
+ onStreamText: args.onStreamText,
231
+ inputProvided: true,
232
+ });
233
+ messages.push({
234
+ role: "tool",
235
+ name: call.name,
236
+ tool_call_id: call.id,
237
+ content: toolResultContent(childResult),
238
+ });
239
+ }
240
+ catch (err) {
241
+ messages.push({
242
+ role: "tool",
243
+ name: call.name,
244
+ tool_call_id: call.id,
245
+ content: JSON.stringify({ error: normalizeError(err) }),
246
+ });
247
+ }
248
+ }
249
+ continue;
250
+ }
251
+ if (result.finishReason === "tool_calls") {
252
+ throw new Error("Model requested tool_calls but provided none");
253
+ }
254
+ return {
255
+ id: randomId("chatcmpl"),
256
+ object: "chat.completion",
257
+ created: Math.floor(Date.now() / 1000),
258
+ model,
259
+ choices: [{
260
+ index: 0,
261
+ message: result.message,
262
+ finish_reason: result.finishReason,
263
+ logprobs: null,
264
+ }],
265
+ usage: result.usage
266
+ ? {
267
+ prompt_tokens: result.usage.promptTokens,
268
+ completion_tokens: result.usage.completionTokens,
269
+ total_tokens: result.usage.totalTokens,
270
+ }
271
+ : undefined,
272
+ gambit: { deckPath: deck.path, messages, runId },
273
+ };
274
+ }
275
+ throw new Error("Max passes exceeded without completing");
276
+ }
@@ -0,0 +1,8 @@
1
+ import type { ModelProvider } from "@bolt-foundry/gambit-core/internal/types";
2
+ export declare function createOpenRouterProvider(opts: {
3
+ apiKey: string;
4
+ baseURL?: string;
5
+ referer?: string;
6
+ title?: string;
7
+ }): ModelProvider;
8
+ //# sourceMappingURL=openrouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openrouter.d.ts","sourceRoot":"","sources":["../../../../src/gambit-core/src/providers/openrouter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,aAAa,EAEd,MAAM,0CAA0C,CAAC;AAwBlD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,aAAa,CAqLhB"}