@bolt-foundry/gambit-core 0.5.3-dev

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 (711) hide show
  1. package/esm/_dnt.polyfills.d.ts +12 -0
  2. package/esm/_dnt.polyfills.d.ts.map +1 -0
  3. package/esm/_dnt.polyfills.js +15 -0
  4. package/esm/_dnt.shims.d.ts +6 -0
  5. package/esm/_dnt.shims.d.ts.map +1 -0
  6. package/esm/_dnt.shims.js +61 -0
  7. package/esm/deps/jsr.io/@std/collections/1.1.3/_utils.d.ts +6 -0
  8. package/esm/deps/jsr.io/@std/collections/1.1.3/_utils.d.ts.map +1 -0
  9. package/esm/deps/jsr.io/@std/collections/1.1.3/_utils.js +18 -0
  10. package/esm/deps/jsr.io/@std/collections/1.1.3/deep_merge.d.ts +322 -0
  11. package/esm/deps/jsr.io/@std/collections/1.1.3/deep_merge.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@std/collections/1.1.3/deep_merge.js +95 -0
  13. package/esm/deps/jsr.io/@std/front-matter/1.0.9/_formats.d.ts +11 -0
  14. package/esm/deps/jsr.io/@std/front-matter/1.0.9/_formats.d.ts.map +1 -0
  15. package/esm/deps/jsr.io/@std/front-matter/1.0.9/_formats.js +28 -0
  16. package/esm/deps/jsr.io/@std/front-matter/1.0.9/_shared.d.ts +5 -0
  17. package/esm/deps/jsr.io/@std/front-matter/1.0.9/_shared.d.ts.map +1 -0
  18. package/esm/deps/jsr.io/@std/front-matter/1.0.9/_shared.js +8 -0
  19. package/esm/deps/jsr.io/@std/front-matter/1.0.9/any.d.ts +32 -0
  20. package/esm/deps/jsr.io/@std/front-matter/1.0.9/any.d.ts.map +1 -0
  21. package/esm/deps/jsr.io/@std/front-matter/1.0.9/any.js +48 -0
  22. package/esm/deps/jsr.io/@std/front-matter/1.0.9/json.d.ts +30 -0
  23. package/esm/deps/jsr.io/@std/front-matter/1.0.9/json.d.ts.map +1 -0
  24. package/esm/deps/jsr.io/@std/front-matter/1.0.9/json.js +35 -0
  25. package/esm/deps/jsr.io/@std/front-matter/1.0.9/toml.d.ts +30 -0
  26. package/esm/deps/jsr.io/@std/front-matter/1.0.9/toml.d.ts.map +1 -0
  27. package/esm/deps/jsr.io/@std/front-matter/1.0.9/toml.js +36 -0
  28. package/esm/deps/jsr.io/@std/front-matter/1.0.9/types.d.ts +7 -0
  29. package/esm/deps/jsr.io/@std/front-matter/1.0.9/types.d.ts.map +1 -0
  30. package/esm/deps/jsr.io/@std/front-matter/1.0.9/types.js +3 -0
  31. package/esm/deps/jsr.io/@std/front-matter/1.0.9/yaml.d.ts +33 -0
  32. package/esm/deps/jsr.io/@std/front-matter/1.0.9/yaml.d.ts.map +1 -0
  33. package/esm/deps/jsr.io/@std/front-matter/1.0.9/yaml.js +39 -0
  34. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
  35. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
  36. package/esm/deps/jsr.io/@std/internal/1.0.12/_os.js +12 -0
  37. package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
  38. package/esm/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
  39. package/esm/deps/jsr.io/@std/internal/1.0.12/os.js +5 -0
  40. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts +2 -0
  41. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
  42. package/esm/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +7 -0
  43. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts +4 -0
  44. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
  45. package/esm/deps/jsr.io/@std/path/1.1.4/_common/basename.js +40 -0
  46. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts +2 -0
  47. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts.map +1 -0
  48. package/esm/deps/jsr.io/@std/path/1.1.4/_common/common.js +23 -0
  49. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts +40 -0
  50. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
  51. package/esm/deps/jsr.io/@std/path/1.1.4/_common/constants.js +46 -0
  52. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts +2 -0
  53. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts.map +1 -0
  54. package/esm/deps/jsr.io/@std/path/1.1.4/_common/dirname.js +8 -0
  55. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts +4 -0
  56. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts.map +1 -0
  57. package/esm/deps/jsr.io/@std/path/1.1.4/_common/format.js +19 -0
  58. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
  59. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
  60. package/esm/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +9 -0
  61. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts +35 -0
  62. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts.map +1 -0
  63. package/esm/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js +235 -0
  64. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts +2 -0
  65. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
  66. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +8 -0
  67. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts +2 -0
  68. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
  69. package/esm/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +77 -0
  70. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts +2 -0
  71. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts.map +1 -0
  72. package/esm/deps/jsr.io/@std/path/1.1.4/_common/relative.js +9 -0
  73. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts +2 -0
  74. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
  75. package/esm/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +19 -0
  76. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts +2 -0
  77. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
  78. package/esm/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +15 -0
  79. package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
  80. package/esm/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
  81. package/esm/deps/jsr.io/@std/path/1.1.4/basename.js +35 -0
  82. package/esm/deps/jsr.io/@std/path/1.1.4/common.d.ts +28 -0
  83. package/esm/deps/jsr.io/@std/path/1.1.4/common.d.ts.map +1 -0
  84. package/esm/deps/jsr.io/@std/path/1.1.4/common.js +33 -0
  85. package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts +15 -0
  86. package/esm/deps/jsr.io/@std/path/1.1.4/constants.d.ts.map +1 -0
  87. package/esm/deps/jsr.io/@std/path/1.1.4/constants.js +17 -0
  88. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.d.ts +22 -0
  89. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.d.ts.map +1 -0
  90. package/esm/deps/jsr.io/@std/path/1.1.4/dirname.js +28 -0
  91. package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
  92. package/esm/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
  93. package/esm/deps/jsr.io/@std/path/1.1.4/extname.js +28 -0
  94. package/esm/deps/jsr.io/@std/path/1.1.4/format.d.ts +22 -0
  95. package/esm/deps/jsr.io/@std/path/1.1.4/format.d.ts.map +1 -0
  96. package/esm/deps/jsr.io/@std/path/1.1.4/format.js +27 -0
  97. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts +22 -0
  98. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts.map +1 -0
  99. package/esm/deps/jsr.io/@std/path/1.1.4/from_file_url.js +28 -0
  100. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts +77 -0
  101. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts.map +1 -0
  102. package/esm/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +83 -0
  103. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts +22 -0
  104. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
  105. package/esm/deps/jsr.io/@std/path/1.1.4/is_absolute.js +28 -0
  106. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts +17 -0
  107. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts.map +1 -0
  108. package/esm/deps/jsr.io/@std/path/1.1.4/is_glob.js +42 -0
  109. package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
  110. package/esm/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
  111. package/esm/deps/jsr.io/@std/path/1.1.4/join.js +29 -0
  112. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts +28 -0
  113. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts.map +1 -0
  114. package/esm/deps/jsr.io/@std/path/1.1.4/join_globs.js +34 -0
  115. package/esm/deps/jsr.io/@std/path/1.1.4/mod.d.ts +213 -0
  116. package/esm/deps/jsr.io/@std/path/1.1.4/mod.d.ts.map +1 -0
  117. package/esm/deps/jsr.io/@std/path/1.1.4/mod.js +216 -0
  118. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.d.ts +26 -0
  119. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.d.ts.map +1 -0
  120. package/esm/deps/jsr.io/@std/path/1.1.4/normalize.js +32 -0
  121. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts +29 -0
  122. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts.map +1 -0
  123. package/esm/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +35 -0
  124. package/esm/deps/jsr.io/@std/path/1.1.4/parse.d.ts +35 -0
  125. package/esm/deps/jsr.io/@std/path/1.1.4/parse.d.ts.map +1 -0
  126. package/esm/deps/jsr.io/@std/path/1.1.4/parse.js +39 -0
  127. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts +2 -0
  128. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
  129. package/esm/deps/jsr.io/@std/path/1.1.4/posix/_util.js +8 -0
  130. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
  131. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
  132. package/esm/deps/jsr.io/@std/path/1.1.4/posix/basename.js +52 -0
  133. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts +13 -0
  134. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts.map +1 -0
  135. package/esm/deps/jsr.io/@std/path/1.1.4/posix/constants.js +14 -0
  136. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts +30 -0
  137. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts.map +1 -0
  138. package/esm/deps/jsr.io/@std/path/1.1.4/posix/dirname.js +64 -0
  139. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
  140. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
  141. package/esm/deps/jsr.io/@std/path/1.1.4/posix/extname.js +93 -0
  142. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts +24 -0
  143. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts.map +1 -0
  144. package/esm/deps/jsr.io/@std/path/1.1.4/posix/format.js +28 -0
  145. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
  146. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
  147. package/esm/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +21 -0
  148. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts +72 -0
  149. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts.map +1 -0
  150. package/esm/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js +82 -0
  151. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts +17 -0
  152. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
  153. package/esm/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +23 -0
  154. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
  155. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
  156. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join.js +45 -0
  157. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts +20 -0
  158. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts.map +1 -0
  159. package/esm/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js +40 -0
  160. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
  161. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
  162. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +58 -0
  163. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts +20 -0
  164. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts.map +1 -0
  165. package/esm/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js +32 -0
  166. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts +25 -0
  167. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts.map +1 -0
  168. package/esm/deps/jsr.io/@std/path/1.1.4/posix/parse.js +115 -0
  169. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts +20 -0
  170. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts.map +1 -0
  171. package/esm/deps/jsr.io/@std/path/1.1.4/posix/relative.js +106 -0
  172. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts +17 -0
  173. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts.map +1 -0
  174. package/esm/deps/jsr.io/@std/path/1.1.4/posix/resolve.js +59 -0
  175. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts +17 -0
  176. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
  177. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +27 -0
  178. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts +16 -0
  179. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts.map +1 -0
  180. package/esm/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js +20 -0
  181. package/esm/deps/jsr.io/@std/path/1.1.4/relative.d.ts +24 -0
  182. package/esm/deps/jsr.io/@std/path/1.1.4/relative.d.ts.map +1 -0
  183. package/esm/deps/jsr.io/@std/path/1.1.4/relative.js +30 -0
  184. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.d.ts +22 -0
  185. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.d.ts.map +1 -0
  186. package/esm/deps/jsr.io/@std/path/1.1.4/resolve.js +30 -0
  187. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts +22 -0
  188. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
  189. package/esm/deps/jsr.io/@std/path/1.1.4/to_file_url.js +28 -0
  190. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts +21 -0
  191. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts.map +1 -0
  192. package/esm/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +29 -0
  193. package/esm/deps/jsr.io/@std/path/1.1.4/types.d.ts +38 -0
  194. package/esm/deps/jsr.io/@std/path/1.1.4/types.d.ts.map +1 -0
  195. package/esm/deps/jsr.io/@std/path/1.1.4/types.js +3 -0
  196. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts +4 -0
  197. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
  198. package/esm/deps/jsr.io/@std/path/1.1.4/windows/_util.js +15 -0
  199. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
  200. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
  201. package/esm/deps/jsr.io/@std/path/1.1.4/windows/basename.js +47 -0
  202. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts +13 -0
  203. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts.map +1 -0
  204. package/esm/deps/jsr.io/@std/path/1.1.4/windows/constants.js +14 -0
  205. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts +17 -0
  206. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts.map +1 -0
  207. package/esm/deps/jsr.io/@std/path/1.1.4/windows/dirname.js +113 -0
  208. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
  209. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
  210. package/esm/deps/jsr.io/@std/path/1.1.4/windows/extname.js +82 -0
  211. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts +24 -0
  212. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts.map +1 -0
  213. package/esm/deps/jsr.io/@std/path/1.1.4/windows/format.js +28 -0
  214. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
  215. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
  216. package/esm/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +30 -0
  217. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts +71 -0
  218. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts.map +1 -0
  219. package/esm/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js +82 -0
  220. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts +17 -0
  221. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
  222. package/esm/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +38 -0
  223. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
  224. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
  225. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join.js +77 -0
  226. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts +21 -0
  227. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts.map +1 -0
  228. package/esm/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js +41 -0
  229. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
  230. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
  231. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +135 -0
  232. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts +20 -0
  233. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts.map +1 -0
  234. package/esm/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js +32 -0
  235. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts +25 -0
  236. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts.map +1 -0
  237. package/esm/deps/jsr.io/@std/path/1.1.4/windows/parse.js +176 -0
  238. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts +23 -0
  239. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts.map +1 -0
  240. package/esm/deps/jsr.io/@std/path/1.1.4/windows/relative.js +131 -0
  241. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts +17 -0
  242. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts.map +1 -0
  243. package/esm/deps/jsr.io/@std/path/1.1.4/windows/resolve.js +154 -0
  244. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts +17 -0
  245. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
  246. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +34 -0
  247. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts +17 -0
  248. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts.map +1 -0
  249. package/esm/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js +49 -0
  250. package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts +93 -0
  251. package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts.map +1 -0
  252. package/esm/deps/jsr.io/@std/toml/1.0.11/_parser.js +753 -0
  253. package/esm/deps/jsr.io/@std/toml/1.0.11/parse.d.ts +21 -0
  254. package/esm/deps/jsr.io/@std/toml/1.0.11/parse.d.ts.map +1 -0
  255. package/esm/deps/jsr.io/@std/toml/1.0.11/parse.js +25 -0
  256. package/esm/deps/jsr.io/@std/yaml/1.0.10/_chars.d.ts +33 -0
  257. package/esm/deps/jsr.io/@std/yaml/1.0.10/_chars.d.ts.map +1 -0
  258. package/esm/deps/jsr.io/@std/yaml/1.0.10/_chars.js +48 -0
  259. package/esm/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts +66 -0
  260. package/esm/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts.map +1 -0
  261. package/esm/deps/jsr.io/@std/yaml/1.0.10/_loader_state.js +1427 -0
  262. package/esm/deps/jsr.io/@std/yaml/1.0.10/_schema.d.ts +44 -0
  263. package/esm/deps/jsr.io/@std/yaml/1.0.10/_schema.d.ts.map +1 -0
  264. package/esm/deps/jsr.io/@std/yaml/1.0.10/_schema.js +117 -0
  265. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/binary.d.ts +3 -0
  266. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/binary.d.ts.map +1 -0
  267. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/binary.js +103 -0
  268. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/bool.d.ts +3 -0
  269. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/bool.d.ts.map +1 -0
  270. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/bool.js +32 -0
  271. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/float.d.ts +3 -0
  272. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/float.d.ts.map +1 -0
  273. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/float.js +96 -0
  274. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/int.d.ts +3 -0
  275. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/int.d.ts.map +1 -0
  276. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/int.js +159 -0
  277. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/map.d.ts +3 -0
  278. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/map.d.ts.map +1 -0
  279. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/map.js +14 -0
  280. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/merge.d.ts +3 -0
  281. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/merge.d.ts.map +1 -0
  282. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/merge.js +10 -0
  283. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/nil.d.ts +3 -0
  284. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/nil.d.ts.map +1 -0
  285. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/nil.js +22 -0
  286. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/omap.d.ts +3 -0
  287. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/omap.d.ts.map +1 -0
  288. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/omap.js +29 -0
  289. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.d.ts +3 -0
  290. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.d.ts.map +1 -0
  291. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.js +19 -0
  292. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.d.ts +3 -0
  293. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.d.ts.map +1 -0
  294. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.js +30 -0
  295. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/seq.d.ts +3 -0
  296. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/seq.d.ts.map +1 -0
  297. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/seq.js +10 -0
  298. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/set.d.ts +3 -0
  299. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/set.d.ts.map +1 -0
  300. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/set.js +14 -0
  301. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/str.d.ts +3 -0
  302. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/str.d.ts.map +1 -0
  303. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/str.js +9 -0
  304. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.d.ts +3 -0
  305. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.d.ts.map +1 -0
  306. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.js +81 -0
  307. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.d.ts +3 -0
  308. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.d.ts.map +1 -0
  309. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.js +20 -0
  310. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type.d.ts +32 -0
  311. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type.d.ts.map +1 -0
  312. package/esm/deps/jsr.io/@std/yaml/1.0.10/_type.js +6 -0
  313. package/esm/deps/jsr.io/@std/yaml/1.0.10/_utils.d.ts +4 -0
  314. package/esm/deps/jsr.io/@std/yaml/1.0.10/_utils.d.ts.map +1 -0
  315. package/esm/deps/jsr.io/@std/yaml/1.0.10/_utils.js +13 -0
  316. package/esm/deps/jsr.io/@std/yaml/1.0.10/parse.d.ts +76 -0
  317. package/esm/deps/jsr.io/@std/yaml/1.0.10/parse.d.ts.map +1 -0
  318. package/esm/deps/jsr.io/@std/yaml/1.0.10/parse.js +93 -0
  319. package/esm/mod.d.ts +51 -0
  320. package/esm/mod.d.ts.map +1 -0
  321. package/esm/mod.js +20 -0
  322. package/esm/package.json +3 -0
  323. package/esm/src/constants.d.ts +15 -0
  324. package/esm/src/constants.d.ts.map +1 -0
  325. package/esm/src/constants.js +20 -0
  326. package/esm/src/definitions.d.ts +11 -0
  327. package/esm/src/definitions.d.ts.map +1 -0
  328. package/esm/src/definitions.js +14 -0
  329. package/esm/src/loader.d.ts +4 -0
  330. package/esm/src/loader.d.ts.map +1 -0
  331. package/esm/src/loader.js +179 -0
  332. package/esm/src/markdown.d.ts +5 -0
  333. package/esm/src/markdown.d.ts.map +1 -0
  334. package/esm/src/markdown.js +307 -0
  335. package/esm/src/openai_compat.d.ts +63 -0
  336. package/esm/src/openai_compat.d.ts.map +1 -0
  337. package/esm/src/openai_compat.js +272 -0
  338. package/esm/src/providers/openrouter.d.ts +8 -0
  339. package/esm/src/providers/openrouter.d.ts.map +1 -0
  340. package/esm/src/providers/openrouter.js +168 -0
  341. package/esm/src/render.d.ts +51 -0
  342. package/esm/src/render.d.ts.map +1 -0
  343. package/esm/src/render.js +188 -0
  344. package/esm/src/runtime.d.ts +35 -0
  345. package/esm/src/runtime.d.ts.map +1 -0
  346. package/esm/src/runtime.js +1368 -0
  347. package/esm/src/schema.d.ts +8 -0
  348. package/esm/src/schema.d.ts.map +1 -0
  349. package/esm/src/schema.js +45 -0
  350. package/esm/src/state.d.ts +34 -0
  351. package/esm/src/state.d.ts.map +1 -0
  352. package/esm/src/state.js +22 -0
  353. package/esm/src/types.d.ts +318 -0
  354. package/esm/src/types.d.ts.map +1 -0
  355. package/esm/src/types.js +1 -0
  356. package/package.json +32 -0
  357. package/script/_dnt.polyfills.d.ts +12 -0
  358. package/script/_dnt.polyfills.d.ts.map +1 -0
  359. package/script/_dnt.polyfills.js +16 -0
  360. package/script/_dnt.shims.d.ts +6 -0
  361. package/script/_dnt.shims.d.ts.map +1 -0
  362. package/script/_dnt.shims.js +65 -0
  363. package/script/deps/jsr.io/@std/collections/1.1.3/_utils.d.ts +6 -0
  364. package/script/deps/jsr.io/@std/collections/1.1.3/_utils.d.ts.map +1 -0
  365. package/script/deps/jsr.io/@std/collections/1.1.3/_utils.js +21 -0
  366. package/script/deps/jsr.io/@std/collections/1.1.3/deep_merge.d.ts +322 -0
  367. package/script/deps/jsr.io/@std/collections/1.1.3/deep_merge.d.ts.map +1 -0
  368. package/script/deps/jsr.io/@std/collections/1.1.3/deep_merge.js +98 -0
  369. package/script/deps/jsr.io/@std/front-matter/1.0.9/_formats.d.ts +11 -0
  370. package/script/deps/jsr.io/@std/front-matter/1.0.9/_formats.d.ts.map +1 -0
  371. package/script/deps/jsr.io/@std/front-matter/1.0.9/_formats.js +31 -0
  372. package/script/deps/jsr.io/@std/front-matter/1.0.9/_shared.d.ts +5 -0
  373. package/script/deps/jsr.io/@std/front-matter/1.0.9/_shared.d.ts.map +1 -0
  374. package/script/deps/jsr.io/@std/front-matter/1.0.9/_shared.js +11 -0
  375. package/script/deps/jsr.io/@std/front-matter/1.0.9/any.d.ts +32 -0
  376. package/script/deps/jsr.io/@std/front-matter/1.0.9/any.d.ts.map +1 -0
  377. package/script/deps/jsr.io/@std/front-matter/1.0.9/any.js +51 -0
  378. package/script/deps/jsr.io/@std/front-matter/1.0.9/json.d.ts +30 -0
  379. package/script/deps/jsr.io/@std/front-matter/1.0.9/json.d.ts.map +1 -0
  380. package/script/deps/jsr.io/@std/front-matter/1.0.9/json.js +38 -0
  381. package/script/deps/jsr.io/@std/front-matter/1.0.9/toml.d.ts +30 -0
  382. package/script/deps/jsr.io/@std/front-matter/1.0.9/toml.d.ts.map +1 -0
  383. package/script/deps/jsr.io/@std/front-matter/1.0.9/toml.js +39 -0
  384. package/script/deps/jsr.io/@std/front-matter/1.0.9/types.d.ts +7 -0
  385. package/script/deps/jsr.io/@std/front-matter/1.0.9/types.d.ts.map +1 -0
  386. package/script/deps/jsr.io/@std/front-matter/1.0.9/types.js +4 -0
  387. package/script/deps/jsr.io/@std/front-matter/1.0.9/yaml.d.ts +33 -0
  388. package/script/deps/jsr.io/@std/front-matter/1.0.9/yaml.d.ts.map +1 -0
  389. package/script/deps/jsr.io/@std/front-matter/1.0.9/yaml.js +42 -0
  390. package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts +2 -0
  391. package/script/deps/jsr.io/@std/internal/1.0.12/_os.d.ts.map +1 -0
  392. package/script/deps/jsr.io/@std/internal/1.0.12/_os.js +38 -0
  393. package/script/deps/jsr.io/@std/internal/1.0.12/os.d.ts +3 -0
  394. package/script/deps/jsr.io/@std/internal/1.0.12/os.d.ts.map +1 -0
  395. package/script/deps/jsr.io/@std/internal/1.0.12/os.js +8 -0
  396. package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts +2 -0
  397. package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.d.ts.map +1 -0
  398. package/script/deps/jsr.io/@std/path/1.1.4/_common/assert_path.js +10 -0
  399. package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts +4 -0
  400. package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.d.ts.map +1 -0
  401. package/script/deps/jsr.io/@std/path/1.1.4/_common/basename.js +45 -0
  402. package/script/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts +2 -0
  403. package/script/deps/jsr.io/@std/path/1.1.4/_common/common.d.ts.map +1 -0
  404. package/script/deps/jsr.io/@std/path/1.1.4/_common/common.js +26 -0
  405. package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts +40 -0
  406. package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.d.ts.map +1 -0
  407. package/script/deps/jsr.io/@std/path/1.1.4/_common/constants.js +49 -0
  408. package/script/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts +2 -0
  409. package/script/deps/jsr.io/@std/path/1.1.4/_common/dirname.d.ts.map +1 -0
  410. package/script/deps/jsr.io/@std/path/1.1.4/_common/dirname.js +11 -0
  411. package/script/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts +4 -0
  412. package/script/deps/jsr.io/@std/path/1.1.4/_common/format.d.ts.map +1 -0
  413. package/script/deps/jsr.io/@std/path/1.1.4/_common/format.js +23 -0
  414. package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts +2 -0
  415. package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.d.ts.map +1 -0
  416. package/script/deps/jsr.io/@std/path/1.1.4/_common/from_file_url.js +12 -0
  417. package/script/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts +35 -0
  418. package/script/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.d.ts.map +1 -0
  419. package/script/deps/jsr.io/@std/path/1.1.4/_common/glob_to_reg_exp.js +238 -0
  420. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts +2 -0
  421. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.d.ts.map +1 -0
  422. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize.js +11 -0
  423. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts +2 -0
  424. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.d.ts.map +1 -0
  425. package/script/deps/jsr.io/@std/path/1.1.4/_common/normalize_string.js +80 -0
  426. package/script/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts +2 -0
  427. package/script/deps/jsr.io/@std/path/1.1.4/_common/relative.d.ts.map +1 -0
  428. package/script/deps/jsr.io/@std/path/1.1.4/_common/relative.js +12 -0
  429. package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts +2 -0
  430. package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.d.ts.map +1 -0
  431. package/script/deps/jsr.io/@std/path/1.1.4/_common/strip_trailing_separators.js +22 -0
  432. package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts +2 -0
  433. package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.d.ts.map +1 -0
  434. package/script/deps/jsr.io/@std/path/1.1.4/_common/to_file_url.js +18 -0
  435. package/script/deps/jsr.io/@std/path/1.1.4/basename.d.ts +27 -0
  436. package/script/deps/jsr.io/@std/path/1.1.4/basename.d.ts.map +1 -0
  437. package/script/deps/jsr.io/@std/path/1.1.4/basename.js +38 -0
  438. package/script/deps/jsr.io/@std/path/1.1.4/common.d.ts +28 -0
  439. package/script/deps/jsr.io/@std/path/1.1.4/common.d.ts.map +1 -0
  440. package/script/deps/jsr.io/@std/path/1.1.4/common.js +36 -0
  441. package/script/deps/jsr.io/@std/path/1.1.4/constants.d.ts +15 -0
  442. package/script/deps/jsr.io/@std/path/1.1.4/constants.d.ts.map +1 -0
  443. package/script/deps/jsr.io/@std/path/1.1.4/constants.js +20 -0
  444. package/script/deps/jsr.io/@std/path/1.1.4/dirname.d.ts +22 -0
  445. package/script/deps/jsr.io/@std/path/1.1.4/dirname.d.ts.map +1 -0
  446. package/script/deps/jsr.io/@std/path/1.1.4/dirname.js +31 -0
  447. package/script/deps/jsr.io/@std/path/1.1.4/extname.d.ts +22 -0
  448. package/script/deps/jsr.io/@std/path/1.1.4/extname.d.ts.map +1 -0
  449. package/script/deps/jsr.io/@std/path/1.1.4/extname.js +31 -0
  450. package/script/deps/jsr.io/@std/path/1.1.4/format.d.ts +22 -0
  451. package/script/deps/jsr.io/@std/path/1.1.4/format.d.ts.map +1 -0
  452. package/script/deps/jsr.io/@std/path/1.1.4/format.js +30 -0
  453. package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts +22 -0
  454. package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.d.ts.map +1 -0
  455. package/script/deps/jsr.io/@std/path/1.1.4/from_file_url.js +31 -0
  456. package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts +77 -0
  457. package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.d.ts.map +1 -0
  458. package/script/deps/jsr.io/@std/path/1.1.4/glob_to_regexp.js +86 -0
  459. package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts +22 -0
  460. package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.d.ts.map +1 -0
  461. package/script/deps/jsr.io/@std/path/1.1.4/is_absolute.js +31 -0
  462. package/script/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts +17 -0
  463. package/script/deps/jsr.io/@std/path/1.1.4/is_glob.d.ts.map +1 -0
  464. package/script/deps/jsr.io/@std/path/1.1.4/is_glob.js +45 -0
  465. package/script/deps/jsr.io/@std/path/1.1.4/join.d.ts +23 -0
  466. package/script/deps/jsr.io/@std/path/1.1.4/join.d.ts.map +1 -0
  467. package/script/deps/jsr.io/@std/path/1.1.4/join.js +32 -0
  468. package/script/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts +28 -0
  469. package/script/deps/jsr.io/@std/path/1.1.4/join_globs.d.ts.map +1 -0
  470. package/script/deps/jsr.io/@std/path/1.1.4/join_globs.js +37 -0
  471. package/script/deps/jsr.io/@std/path/1.1.4/mod.d.ts +213 -0
  472. package/script/deps/jsr.io/@std/path/1.1.4/mod.d.ts.map +1 -0
  473. package/script/deps/jsr.io/@std/path/1.1.4/mod.js +232 -0
  474. package/script/deps/jsr.io/@std/path/1.1.4/normalize.d.ts +26 -0
  475. package/script/deps/jsr.io/@std/path/1.1.4/normalize.d.ts.map +1 -0
  476. package/script/deps/jsr.io/@std/path/1.1.4/normalize.js +35 -0
  477. package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts +29 -0
  478. package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.d.ts.map +1 -0
  479. package/script/deps/jsr.io/@std/path/1.1.4/normalize_glob.js +38 -0
  480. package/script/deps/jsr.io/@std/path/1.1.4/parse.d.ts +35 -0
  481. package/script/deps/jsr.io/@std/path/1.1.4/parse.d.ts.map +1 -0
  482. package/script/deps/jsr.io/@std/path/1.1.4/parse.js +42 -0
  483. package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts +2 -0
  484. package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.d.ts.map +1 -0
  485. package/script/deps/jsr.io/@std/path/1.1.4/posix/_util.js +11 -0
  486. package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts +39 -0
  487. package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.d.ts.map +1 -0
  488. package/script/deps/jsr.io/@std/path/1.1.4/posix/basename.js +55 -0
  489. package/script/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts +13 -0
  490. package/script/deps/jsr.io/@std/path/1.1.4/posix/constants.d.ts.map +1 -0
  491. package/script/deps/jsr.io/@std/path/1.1.4/posix/constants.js +17 -0
  492. package/script/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts +30 -0
  493. package/script/deps/jsr.io/@std/path/1.1.4/posix/dirname.d.ts.map +1 -0
  494. package/script/deps/jsr.io/@std/path/1.1.4/posix/dirname.js +67 -0
  495. package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts +37 -0
  496. package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.d.ts.map +1 -0
  497. package/script/deps/jsr.io/@std/path/1.1.4/posix/extname.js +96 -0
  498. package/script/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts +24 -0
  499. package/script/deps/jsr.io/@std/path/1.1.4/posix/format.d.ts.map +1 -0
  500. package/script/deps/jsr.io/@std/path/1.1.4/posix/format.js +31 -0
  501. package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts +16 -0
  502. package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.d.ts.map +1 -0
  503. package/script/deps/jsr.io/@std/path/1.1.4/posix/from_file_url.js +24 -0
  504. package/script/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts +72 -0
  505. package/script/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.d.ts.map +1 -0
  506. package/script/deps/jsr.io/@std/path/1.1.4/posix/glob_to_regexp.js +85 -0
  507. package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts +17 -0
  508. package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.d.ts.map +1 -0
  509. package/script/deps/jsr.io/@std/path/1.1.4/posix/is_absolute.js +26 -0
  510. package/script/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts +31 -0
  511. package/script/deps/jsr.io/@std/path/1.1.4/posix/join.d.ts.map +1 -0
  512. package/script/deps/jsr.io/@std/path/1.1.4/posix/join.js +48 -0
  513. package/script/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts +20 -0
  514. package/script/deps/jsr.io/@std/path/1.1.4/posix/join_globs.d.ts.map +1 -0
  515. package/script/deps/jsr.io/@std/path/1.1.4/posix/join_globs.js +43 -0
  516. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts +37 -0
  517. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.d.ts.map +1 -0
  518. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize.js +61 -0
  519. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts +20 -0
  520. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.d.ts.map +1 -0
  521. package/script/deps/jsr.io/@std/path/1.1.4/posix/normalize_glob.js +35 -0
  522. package/script/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts +25 -0
  523. package/script/deps/jsr.io/@std/path/1.1.4/posix/parse.d.ts.map +1 -0
  524. package/script/deps/jsr.io/@std/path/1.1.4/posix/parse.js +118 -0
  525. package/script/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts +20 -0
  526. package/script/deps/jsr.io/@std/path/1.1.4/posix/relative.d.ts.map +1 -0
  527. package/script/deps/jsr.io/@std/path/1.1.4/posix/relative.js +109 -0
  528. package/script/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts +17 -0
  529. package/script/deps/jsr.io/@std/path/1.1.4/posix/resolve.d.ts.map +1 -0
  530. package/script/deps/jsr.io/@std/path/1.1.4/posix/resolve.js +85 -0
  531. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts +17 -0
  532. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.d.ts.map +1 -0
  533. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_file_url.js +30 -0
  534. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts +16 -0
  535. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.d.ts.map +1 -0
  536. package/script/deps/jsr.io/@std/path/1.1.4/posix/to_namespaced_path.js +23 -0
  537. package/script/deps/jsr.io/@std/path/1.1.4/relative.d.ts +24 -0
  538. package/script/deps/jsr.io/@std/path/1.1.4/relative.d.ts.map +1 -0
  539. package/script/deps/jsr.io/@std/path/1.1.4/relative.js +33 -0
  540. package/script/deps/jsr.io/@std/path/1.1.4/resolve.d.ts +22 -0
  541. package/script/deps/jsr.io/@std/path/1.1.4/resolve.d.ts.map +1 -0
  542. package/script/deps/jsr.io/@std/path/1.1.4/resolve.js +33 -0
  543. package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts +22 -0
  544. package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.d.ts.map +1 -0
  545. package/script/deps/jsr.io/@std/path/1.1.4/to_file_url.js +31 -0
  546. package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts +21 -0
  547. package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.d.ts.map +1 -0
  548. package/script/deps/jsr.io/@std/path/1.1.4/to_namespaced_path.js +32 -0
  549. package/script/deps/jsr.io/@std/path/1.1.4/types.d.ts +38 -0
  550. package/script/deps/jsr.io/@std/path/1.1.4/types.d.ts.map +1 -0
  551. package/script/deps/jsr.io/@std/path/1.1.4/types.js +4 -0
  552. package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts +4 -0
  553. package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.d.ts.map +1 -0
  554. package/script/deps/jsr.io/@std/path/1.1.4/windows/_util.js +20 -0
  555. package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts +22 -0
  556. package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.d.ts.map +1 -0
  557. package/script/deps/jsr.io/@std/path/1.1.4/windows/basename.js +50 -0
  558. package/script/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts +13 -0
  559. package/script/deps/jsr.io/@std/path/1.1.4/windows/constants.d.ts.map +1 -0
  560. package/script/deps/jsr.io/@std/path/1.1.4/windows/constants.js +17 -0
  561. package/script/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts +17 -0
  562. package/script/deps/jsr.io/@std/path/1.1.4/windows/dirname.d.ts.map +1 -0
  563. package/script/deps/jsr.io/@std/path/1.1.4/windows/dirname.js +116 -0
  564. package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts +17 -0
  565. package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.d.ts.map +1 -0
  566. package/script/deps/jsr.io/@std/path/1.1.4/windows/extname.js +85 -0
  567. package/script/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts +24 -0
  568. package/script/deps/jsr.io/@std/path/1.1.4/windows/format.d.ts.map +1 -0
  569. package/script/deps/jsr.io/@std/path/1.1.4/windows/format.js +31 -0
  570. package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts +18 -0
  571. package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.d.ts.map +1 -0
  572. package/script/deps/jsr.io/@std/path/1.1.4/windows/from_file_url.js +33 -0
  573. package/script/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts +71 -0
  574. package/script/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.d.ts.map +1 -0
  575. package/script/deps/jsr.io/@std/path/1.1.4/windows/glob_to_regexp.js +85 -0
  576. package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts +17 -0
  577. package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.d.ts.map +1 -0
  578. package/script/deps/jsr.io/@std/path/1.1.4/windows/is_absolute.js +41 -0
  579. package/script/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts +18 -0
  580. package/script/deps/jsr.io/@std/path/1.1.4/windows/join.d.ts.map +1 -0
  581. package/script/deps/jsr.io/@std/path/1.1.4/windows/join.js +80 -0
  582. package/script/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts +21 -0
  583. package/script/deps/jsr.io/@std/path/1.1.4/windows/join_globs.d.ts.map +1 -0
  584. package/script/deps/jsr.io/@std/path/1.1.4/windows/join_globs.js +44 -0
  585. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts +19 -0
  586. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.d.ts.map +1 -0
  587. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize.js +138 -0
  588. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts +20 -0
  589. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.d.ts.map +1 -0
  590. package/script/deps/jsr.io/@std/path/1.1.4/windows/normalize_glob.js +35 -0
  591. package/script/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts +25 -0
  592. package/script/deps/jsr.io/@std/path/1.1.4/windows/parse.d.ts.map +1 -0
  593. package/script/deps/jsr.io/@std/path/1.1.4/windows/parse.js +179 -0
  594. package/script/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts +23 -0
  595. package/script/deps/jsr.io/@std/path/1.1.4/windows/relative.d.ts.map +1 -0
  596. package/script/deps/jsr.io/@std/path/1.1.4/windows/relative.js +134 -0
  597. package/script/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts +17 -0
  598. package/script/deps/jsr.io/@std/path/1.1.4/windows/resolve.d.ts.map +1 -0
  599. package/script/deps/jsr.io/@std/path/1.1.4/windows/resolve.js +180 -0
  600. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts +17 -0
  601. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.d.ts.map +1 -0
  602. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_file_url.js +37 -0
  603. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts +17 -0
  604. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.d.ts.map +1 -0
  605. package/script/deps/jsr.io/@std/path/1.1.4/windows/to_namespaced_path.js +52 -0
  606. package/script/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts +93 -0
  607. package/script/deps/jsr.io/@std/toml/1.0.11/_parser.d.ts.map +1 -0
  608. package/script/deps/jsr.io/@std/toml/1.0.11/_parser.js +781 -0
  609. package/script/deps/jsr.io/@std/toml/1.0.11/parse.d.ts +21 -0
  610. package/script/deps/jsr.io/@std/toml/1.0.11/parse.d.ts.map +1 -0
  611. package/script/deps/jsr.io/@std/toml/1.0.11/parse.js +28 -0
  612. package/script/deps/jsr.io/@std/yaml/1.0.10/_chars.d.ts +33 -0
  613. package/script/deps/jsr.io/@std/yaml/1.0.10/_chars.d.ts.map +1 -0
  614. package/script/deps/jsr.io/@std/yaml/1.0.10/_chars.js +55 -0
  615. package/script/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts +66 -0
  616. package/script/deps/jsr.io/@std/yaml/1.0.10/_loader_state.d.ts.map +1 -0
  617. package/script/deps/jsr.io/@std/yaml/1.0.10/_loader_state.js +1431 -0
  618. package/script/deps/jsr.io/@std/yaml/1.0.10/_schema.d.ts +44 -0
  619. package/script/deps/jsr.io/@std/yaml/1.0.10/_schema.d.ts.map +1 -0
  620. package/script/deps/jsr.io/@std/yaml/1.0.10/_schema.js +121 -0
  621. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/binary.d.ts +3 -0
  622. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/binary.d.ts.map +1 -0
  623. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/binary.js +106 -0
  624. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/bool.d.ts +3 -0
  625. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/bool.d.ts.map +1 -0
  626. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/bool.js +35 -0
  627. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/float.d.ts +3 -0
  628. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/float.d.ts.map +1 -0
  629. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/float.js +99 -0
  630. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/int.d.ts +3 -0
  631. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/int.d.ts.map +1 -0
  632. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/int.js +162 -0
  633. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/map.d.ts +3 -0
  634. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/map.d.ts.map +1 -0
  635. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/map.js +17 -0
  636. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/merge.d.ts +3 -0
  637. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/merge.d.ts.map +1 -0
  638. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/merge.js +13 -0
  639. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/nil.d.ts +3 -0
  640. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/nil.d.ts.map +1 -0
  641. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/nil.js +25 -0
  642. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/omap.d.ts +3 -0
  643. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/omap.d.ts.map +1 -0
  644. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/omap.js +32 -0
  645. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.d.ts +3 -0
  646. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.d.ts.map +1 -0
  647. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/pairs.js +22 -0
  648. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.d.ts +3 -0
  649. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.d.ts.map +1 -0
  650. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/regexp.js +33 -0
  651. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/seq.d.ts +3 -0
  652. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/seq.d.ts.map +1 -0
  653. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/seq.js +13 -0
  654. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/set.d.ts +3 -0
  655. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/set.d.ts.map +1 -0
  656. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/set.js +17 -0
  657. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/str.d.ts +3 -0
  658. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/str.d.ts.map +1 -0
  659. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/str.js +12 -0
  660. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.d.ts +3 -0
  661. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.d.ts.map +1 -0
  662. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/timestamp.js +84 -0
  663. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.d.ts +3 -0
  664. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.d.ts.map +1 -0
  665. package/script/deps/jsr.io/@std/yaml/1.0.10/_type/undefined.js +23 -0
  666. package/script/deps/jsr.io/@std/yaml/1.0.10/_type.d.ts +32 -0
  667. package/script/deps/jsr.io/@std/yaml/1.0.10/_type.d.ts.map +1 -0
  668. package/script/deps/jsr.io/@std/yaml/1.0.10/_type.js +7 -0
  669. package/script/deps/jsr.io/@std/yaml/1.0.10/_utils.d.ts +4 -0
  670. package/script/deps/jsr.io/@std/yaml/1.0.10/_utils.d.ts.map +1 -0
  671. package/script/deps/jsr.io/@std/yaml/1.0.10/_utils.js +18 -0
  672. package/script/deps/jsr.io/@std/yaml/1.0.10/parse.d.ts +76 -0
  673. package/script/deps/jsr.io/@std/yaml/1.0.10/parse.d.ts.map +1 -0
  674. package/script/deps/jsr.io/@std/yaml/1.0.10/parse.js +97 -0
  675. package/script/mod.d.ts +51 -0
  676. package/script/mod.d.ts.map +1 -0
  677. package/script/mod.js +30 -0
  678. package/script/package.json +3 -0
  679. package/script/src/constants.d.ts +15 -0
  680. package/script/src/constants.d.ts.map +1 -0
  681. package/script/src/constants.js +23 -0
  682. package/script/src/definitions.d.ts +11 -0
  683. package/script/src/definitions.d.ts.map +1 -0
  684. package/script/src/definitions.js +20 -0
  685. package/script/src/loader.d.ts +4 -0
  686. package/script/src/loader.d.ts.map +1 -0
  687. package/script/src/loader.js +206 -0
  688. package/script/src/markdown.d.ts +5 -0
  689. package/script/src/markdown.d.ts.map +1 -0
  690. package/script/src/markdown.js +335 -0
  691. package/script/src/openai_compat.d.ts +63 -0
  692. package/script/src/openai_compat.d.ts.map +1 -0
  693. package/script/src/openai_compat.js +276 -0
  694. package/script/src/providers/openrouter.d.ts +8 -0
  695. package/script/src/providers/openrouter.d.ts.map +1 -0
  696. package/script/src/providers/openrouter.js +197 -0
  697. package/script/src/render.d.ts +51 -0
  698. package/script/src/render.d.ts.map +1 -0
  699. package/script/src/render.js +192 -0
  700. package/script/src/runtime.d.ts +35 -0
  701. package/script/src/runtime.d.ts.map +1 -0
  702. package/script/src/runtime.js +1395 -0
  703. package/script/src/schema.d.ts +8 -0
  704. package/script/src/schema.d.ts.map +1 -0
  705. package/script/src/schema.js +51 -0
  706. package/script/src/state.d.ts +34 -0
  707. package/script/src/state.d.ts.map +1 -0
  708. package/script/src/state.js +49 -0
  709. package/script/src/types.d.ts +318 -0
  710. package/script/src/types.d.ts.map +1 -0
  711. package/script/src/types.js +2 -0
@@ -0,0 +1,335 @@
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.loadMarkdownCard = loadMarkdownCard;
27
+ exports.loadMarkdownDeck = loadMarkdownDeck;
28
+ exports.isMarkdownFile = isMarkdownFile;
29
+ const dntShim = __importStar(require("../_dnt.shims.js"));
30
+ const any_js_1 = require("../deps/jsr.io/@std/front-matter/1.0.9/any.js");
31
+ const path = __importStar(require("../deps/jsr.io/@std/path/1.1.4/mod.js"));
32
+ const constants_js_1 = require("./constants.js");
33
+ const definitions_js_1 = require("./definitions.js");
34
+ const loader_js_1 = require("./loader.js");
35
+ const schema_js_1 = require("./schema.js");
36
+ const logger = console;
37
+ const RESPOND_MARKER = "gambit://respond";
38
+ const INIT_MARKER = "gambit://init";
39
+ const END_MARKER = "gambit://end";
40
+ const INIT_TEXT = `
41
+ You will automatically receive a \`${constants_js_1.GAMBIT_TOOL_INIT}\` tool result at the start that provides run/context info.
42
+ `.trim();
43
+ const RESPOND_TEXT = `
44
+ When you are done, call the \`${constants_js_1.GAMBIT_TOOL_RESPOND}\` tool with a JSON object that includes your \`payload\` (validated output) and optional \`status\`/ \`message\`/ \`code\`/ \`meta\`. Do not end with normal assistant text; always finish by calling \`${constants_js_1.GAMBIT_TOOL_RESPOND}\`.
45
+ `.trim();
46
+ const END_TEXT = `
47
+ If the entire workflow is finished and no further user turns should be sent, call the \`${constants_js_1.GAMBIT_TOOL_END}\` tool with optional \`message\` and \`payload\` fields to explicitly end the session.
48
+ `.trim();
49
+ function toFileUrl(p) {
50
+ const abs = path.resolve(p);
51
+ return path.toFileUrl(abs).href;
52
+ }
53
+ async function maybeLoadSchema(schemaPath, basePath) {
54
+ if (!schemaPath || typeof schemaPath !== "string")
55
+ return undefined;
56
+ const resolved = path.resolve(path.dirname(basePath), schemaPath);
57
+ const mod = await Promise.resolve(`${toFileUrl(resolved)}`).then(s => __importStar(require(s)));
58
+ return mod.default;
59
+ }
60
+ function normalizeDeckRefs(refs, basePath) {
61
+ if (!Array.isArray(refs))
62
+ return [];
63
+ return refs
64
+ .filter((a) => a && typeof a === "object")
65
+ .map((a) => {
66
+ const rec = a;
67
+ const p = String(rec.path ?? "").trim();
68
+ if (!p) {
69
+ throw new Error("Deck reference must include a path");
70
+ }
71
+ const normalized = { ...rec };
72
+ normalized.path = path.resolve(path.dirname(basePath), p);
73
+ if (typeof rec.description !== "string")
74
+ delete normalized.description;
75
+ if (typeof rec.label !== "string")
76
+ delete normalized.label;
77
+ if (typeof rec.id !== "string")
78
+ delete normalized.id;
79
+ return normalized;
80
+ });
81
+ }
82
+ function mergeDeckRefs(...lists) {
83
+ const merged = new Map();
84
+ for (const list of lists) {
85
+ for (const entry of list) {
86
+ if (!entry?.path)
87
+ continue;
88
+ if (!merged.has(entry.path)) {
89
+ merged.set(entry.path, entry);
90
+ }
91
+ }
92
+ }
93
+ return Array.from(merged.values());
94
+ }
95
+ function normalizeActionDecks(entries, basePath) {
96
+ return normalizeDeckRefs(entries, basePath).map((entry) => {
97
+ const name = "name" in entry ? String(entry.name ?? "").trim() : "";
98
+ if (!name) {
99
+ throw new Error(`Action deck must include a name (${basePath})`);
100
+ }
101
+ return { ...entry, name };
102
+ });
103
+ }
104
+ async function expandEmbedsInBody(args) {
105
+ const { body, resolvedPath, stack } = args;
106
+ const regex = /!\[[^\]]*\]\(([^)]+)\)/g;
107
+ const embeds = [];
108
+ let respond = false;
109
+ let initHint = false;
110
+ let endHint = false;
111
+ let out = "";
112
+ let lastIndex = 0;
113
+ for (const match of body.matchAll(regex)) {
114
+ const matchIndex = match.index ?? 0;
115
+ const target = match[1];
116
+ out += body.slice(lastIndex, matchIndex);
117
+ if (target === RESPOND_MARKER) {
118
+ respond = true;
119
+ out += RESPOND_TEXT;
120
+ }
121
+ else if (target === INIT_MARKER) {
122
+ initHint = true;
123
+ out += INIT_TEXT;
124
+ }
125
+ else if (target === END_MARKER) {
126
+ endHint = true;
127
+ out += END_TEXT;
128
+ }
129
+ else {
130
+ const card = await (0, loader_js_1.loadCard)(target, resolvedPath, stack);
131
+ embeds.push(card);
132
+ if (card.body)
133
+ out += card.body;
134
+ }
135
+ lastIndex = matchIndex + match[0].length;
136
+ }
137
+ out += body.slice(lastIndex);
138
+ return { body: out, embeds, respond, initHint, endHint };
139
+ }
140
+ async function loadMarkdownCard(filePath, parentPath, stack = []) {
141
+ const resolved = parentPath
142
+ ? path.resolve(path.dirname(parentPath), filePath)
143
+ : path.resolve(filePath);
144
+ if (stack.includes(resolved)) {
145
+ throw new Error(`Card/embed cycle detected: ${[...stack, resolved].join(" -> ")}`);
146
+ }
147
+ const nextStack = [...stack, resolved];
148
+ const raw = await dntShim.Deno.readTextFile(resolved);
149
+ let attrs;
150
+ let body;
151
+ try {
152
+ const parsed = (0, any_js_1.extract)(raw);
153
+ attrs = parsed.attrs;
154
+ body = parsed.body;
155
+ }
156
+ catch (err) {
157
+ const message = err instanceof Error ? err.message : String(err);
158
+ throw new Error(`Failed to parse front matter in ${resolved}: ${message}`);
159
+ }
160
+ const candidate = attrs;
161
+ if ((0, definitions_js_1.isCardDefinition)(candidate)) {
162
+ // treat attrs as ts-shaped card
163
+ }
164
+ if (candidate.handlers) {
165
+ throw new Error(`Card at ${resolved} cannot declare handlers (deck-only)`);
166
+ }
167
+ const hasNewActionField = attrs.actionDecks;
168
+ const legacyActions = attrs.actions;
169
+ const actionDecks = normalizeActionDecks(hasNewActionField ?? legacyActions, resolved);
170
+ if (!hasNewActionField && legacyActions) {
171
+ logger.warn(`[gambit] card at ${resolved} uses deprecated "actions"; rename to "actionDecks"`);
172
+ }
173
+ actionDecks.forEach((a) => {
174
+ if (a.name.startsWith(constants_js_1.RESERVED_TOOL_PREFIX) &&
175
+ !constants_js_1.BUILTIN_TOOL_NAME_SET.has(a.name)) {
176
+ throw new Error(`Action name ${a.name} is reserved`);
177
+ }
178
+ if (!constants_js_1.TOOL_NAME_PATTERN.test(a.name) || a.name.length > constants_js_1.MAX_TOOL_NAME_LENGTH) {
179
+ throw new Error(`Action name ${a.name} must match ${constants_js_1.TOOL_NAME_PATTERN} and be <= ${constants_js_1.MAX_TOOL_NAME_LENGTH} characters`);
180
+ }
181
+ });
182
+ const inputFragment = await maybeLoadSchema(attrs.inputSchema, resolved);
183
+ const outputFragment = await maybeLoadSchema(attrs.outputSchema, resolved);
184
+ const replaced = await expandEmbedsInBody({
185
+ body,
186
+ resolvedPath: resolved,
187
+ stack: nextStack,
188
+ });
189
+ const cleanedBody = replaced.body;
190
+ const embeddedCards = replaced.embeds;
191
+ return {
192
+ kind: "gambit.card",
193
+ path: resolved,
194
+ body: cleanedBody.trim(),
195
+ allowEnd: replaced.endHint,
196
+ actionDecks,
197
+ actions: actionDecks,
198
+ testDecks: normalizeDeckRefs(attrs.testDecks, resolved),
199
+ graderDecks: normalizeDeckRefs(attrs.graderDecks, resolved),
200
+ cards: embeddedCards,
201
+ inputFragment,
202
+ outputFragment,
203
+ respond: replaced.respond,
204
+ };
205
+ }
206
+ async function loadMarkdownDeck(filePath, parentPath) {
207
+ const resolved = parentPath
208
+ ? path.resolve(path.dirname(parentPath), filePath)
209
+ : path.resolve(filePath);
210
+ const raw = await dntShim.Deno.readTextFile(resolved);
211
+ let attrs;
212
+ let body;
213
+ try {
214
+ const parsed = (0, any_js_1.extract)(raw);
215
+ attrs = parsed.attrs;
216
+ body = parsed.body;
217
+ }
218
+ catch (err) {
219
+ const message = err instanceof Error ? err.message : String(err);
220
+ throw new Error(`Failed to parse front matter in ${resolved}: ${message}`);
221
+ }
222
+ const deckAttrs = attrs;
223
+ const deckMeta = (deckAttrs.deck ?? deckAttrs);
224
+ const hasNewActionDecks = deckMeta.actionDecks;
225
+ const legacyDeckActions = deckMeta.actions;
226
+ const actionDecks = normalizeActionDecks(hasNewActionDecks ?? legacyDeckActions, resolved);
227
+ if (!hasNewActionDecks && legacyDeckActions) {
228
+ logger.warn(`[gambit] deck at ${resolved} uses deprecated "actions"; rename to "actionDecks"`);
229
+ }
230
+ actionDecks.forEach((a) => {
231
+ if (a.name.startsWith(constants_js_1.RESERVED_TOOL_PREFIX) &&
232
+ !constants_js_1.BUILTIN_TOOL_NAME_SET.has(a.name)) {
233
+ throw new Error(`Action name ${a.name} is reserved`);
234
+ }
235
+ if (!constants_js_1.TOOL_NAME_PATTERN.test(a.name) || a.name.length > constants_js_1.MAX_TOOL_NAME_LENGTH) {
236
+ throw new Error(`Action name ${a.name} must match ${constants_js_1.TOOL_NAME_PATTERN} and be <= ${constants_js_1.MAX_TOOL_NAME_LENGTH} characters`);
237
+ }
238
+ });
239
+ const replaced = await expandEmbedsInBody({
240
+ body,
241
+ resolvedPath: resolved,
242
+ stack: [resolved],
243
+ });
244
+ const cards = replaced.embeds;
245
+ const inputSchema = await maybeLoadSchema(deckMeta.inputSchema, resolved);
246
+ const outputSchema = await maybeLoadSchema(deckMeta.outputSchema, resolved);
247
+ const allCards = flattenCards(cards);
248
+ const cleanedBody = replaced.body;
249
+ const allowEnd = Boolean(deckMeta.allowEnd) ||
250
+ replaced.endHint ||
251
+ allCards.some((c) => c.allowEnd);
252
+ const mergedActions = {};
253
+ for (const card of allCards) {
254
+ for (const action of card.actionDecks ?? []) {
255
+ mergedActions[action.name] = action;
256
+ }
257
+ }
258
+ for (const action of actionDecks) {
259
+ mergedActions[action.name] = action;
260
+ }
261
+ let mergedInputSchema = inputSchema;
262
+ let mergedOutputSchema = outputSchema;
263
+ for (const card of allCards) {
264
+ mergedInputSchema = (0, schema_js_1.mergeZodObjects)(mergedInputSchema, card.inputFragment);
265
+ mergedOutputSchema = (0, schema_js_1.mergeZodObjects)(mergedOutputSchema, card.outputFragment);
266
+ }
267
+ const normalizeHandler = (cfg, kind) => {
268
+ if (!cfg)
269
+ return undefined;
270
+ const repeatMs = cfg.repeatMs ?? cfg.intervalMs;
271
+ if (cfg.intervalMs !== undefined && cfg.repeatMs === undefined) {
272
+ logger.warn(`[gambit] handlers.${kind}.intervalMs is deprecated; use repeatMs (${resolved})`);
273
+ }
274
+ return {
275
+ ...cfg,
276
+ repeatMs,
277
+ path: path.resolve(path.dirname(resolved), cfg.path),
278
+ };
279
+ };
280
+ const intervalAlias = deckMeta.handlers?.onInterval;
281
+ const onBusy = normalizeHandler(deckMeta.handlers?.onBusy ?? intervalAlias, intervalAlias ? "onInterval" : "onBusy");
282
+ if (!deckMeta.handlers?.onBusy && intervalAlias) {
283
+ logger.warn(`[gambit] handlers.onInterval is deprecated; use handlers.onBusy (${resolved})`);
284
+ }
285
+ const onIdle = normalizeHandler(deckMeta.handlers?.onIdle, "onIdle");
286
+ const handlers = deckMeta.handlers
287
+ ? {
288
+ onError: deckMeta.handlers.onError
289
+ ? {
290
+ ...deckMeta.handlers.onError,
291
+ path: path.resolve(path.dirname(resolved), deckMeta.handlers.onError.path),
292
+ }
293
+ : undefined,
294
+ onBusy,
295
+ onIdle,
296
+ }
297
+ : undefined;
298
+ const mergedActionDecks = Object.values(mergedActions);
299
+ const rootTestDecks = normalizeDeckRefs(deckMeta.testDecks, resolved);
300
+ const rootGraderDecks = normalizeDeckRefs(deckMeta.graderDecks, resolved);
301
+ const embeddedTestDecks = allCards.flatMap((card) => card.testDecks ?? []);
302
+ const embeddedGraderDecks = allCards.flatMap((card) => card.graderDecks ?? []);
303
+ return {
304
+ kind: "gambit.deck",
305
+ path: resolved,
306
+ body: cleanedBody.trim(),
307
+ allowEnd,
308
+ actionDecks: mergedActionDecks,
309
+ actions: mergedActionDecks,
310
+ testDecks: mergeDeckRefs(rootTestDecks, embeddedTestDecks),
311
+ graderDecks: mergeDeckRefs(rootGraderDecks, embeddedGraderDecks),
312
+ cards: allCards,
313
+ label: deckMeta.label,
314
+ modelParams: deckMeta.modelParams,
315
+ guardrails: deckMeta.guardrails,
316
+ inputSchema: mergedInputSchema,
317
+ outputSchema: mergedOutputSchema,
318
+ handlers,
319
+ respond: replaced.respond || allCards.some((c) => c.respond),
320
+ inlineEmbeds: true,
321
+ };
322
+ }
323
+ function isMarkdownFile(filePath) {
324
+ return filePath.endsWith(".md");
325
+ }
326
+ function flattenCards(cards) {
327
+ const flat = [];
328
+ for (const card of cards) {
329
+ flat.push(card);
330
+ const nested = card.cards ?? [];
331
+ if (nested.length)
332
+ flat.push(...flattenCards(nested));
333
+ }
334
+ return flat;
335
+ }
@@ -0,0 +1,63 @@
1
+ import type { Guardrails, ModelMessage, ModelProvider, ToolDefinition } from "./types.js";
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/src/openai_compat.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAEV,YAAY,EACZ,aAAa,EACb,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,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_js_1 = require("./constants.js");
6
+ const loader_js_1 = require("./loader.js");
7
+ const schema_js_1 = require("./schema.js");
8
+ const runtime_js_1 = require("./runtime.js");
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_js_1.RESERVED_TOOL_PREFIX)) {
69
+ throw new Error(`External tool name ${name} is reserved (prefix ${constants_js_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_js_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_js_1.DEFAULT_GUARDRAILS, ...args.guardrails };
146
+ const runId = randomId("run");
147
+ const deck = await (0, loader_js_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_js_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 "../types.js";
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/src/providers/openrouter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,aAAa,EAEd,MAAM,aAAa,CAAC;AAwBrB,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"}