@puku-ai/sdk 4.0.0 → 4.0.2

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 (583) hide show
  1. package/README.md +29 -10
  2. package/dist/index.d.ts +26 -0
  3. package/dist/index.js +32 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/vendor/_vendor/partial-json-parser/parser.d.ts +2 -0
  6. package/dist/vendor/_vendor/partial-json-parser/parser.js +223 -0
  7. package/dist/vendor/_vendor/partial-json-parser/parser.js.map +1 -0
  8. package/dist/vendor/api-promise.d.ts +2 -0
  9. package/dist/vendor/api-promise.js +3 -0
  10. package/dist/vendor/api-promise.js.map +1 -0
  11. package/dist/vendor/client.d.ts +399 -0
  12. package/dist/vendor/client.js +976 -0
  13. package/dist/vendor/client.js.map +1 -0
  14. package/dist/vendor/core/api-promise.d.ts +49 -0
  15. package/dist/vendor/core/api-promise.js +77 -0
  16. package/dist/vendor/core/api-promise.js.map +1 -0
  17. package/dist/vendor/core/api.d.ts +10 -0
  18. package/dist/vendor/core/api.js +2 -0
  19. package/dist/vendor/core/api.js.map +1 -0
  20. package/dist/vendor/core/credentials.d.ts +130 -0
  21. package/dist/vendor/core/credentials.js +274 -0
  22. package/dist/vendor/core/credentials.js.map +1 -0
  23. package/dist/vendor/core/error.d.ts +82 -0
  24. package/dist/vendor/core/error.js +140 -0
  25. package/dist/vendor/core/error.js.map +1 -0
  26. package/dist/vendor/core/middleware.d.ts +153 -0
  27. package/dist/vendor/core/middleware.js +168 -0
  28. package/dist/vendor/core/middleware.js.map +1 -0
  29. package/dist/vendor/core/pagination.d.ts +121 -0
  30. package/dist/vendor/core/pagination.js +207 -0
  31. package/dist/vendor/core/pagination.js.map +1 -0
  32. package/dist/vendor/core/resource.d.ts +5 -0
  33. package/dist/vendor/core/resource.js +8 -0
  34. package/dist/vendor/core/resource.js.map +1 -0
  35. package/dist/vendor/core/streaming.d.ts +41 -0
  36. package/dist/vendor/core/streaming.js +342 -0
  37. package/dist/vendor/core/streaming.js.map +1 -0
  38. package/dist/vendor/core/uploads.d.ts +2 -0
  39. package/dist/vendor/core/uploads.js +2 -0
  40. package/dist/vendor/core/uploads.js.map +1 -0
  41. package/dist/vendor/error.d.ts +2 -0
  42. package/dist/vendor/error.js +3 -0
  43. package/dist/vendor/error.js.map +1 -0
  44. package/dist/vendor/helpers/beta/environments.d.ts +22 -0
  45. package/dist/vendor/helpers/beta/environments.js +23 -0
  46. package/dist/vendor/helpers/beta/environments.js.map +1 -0
  47. package/dist/vendor/helpers/beta/json-schema.d.ts +36 -0
  48. package/dist/vendor/helpers/beta/json-schema.js +53 -0
  49. package/dist/vendor/helpers/beta/json-schema.js.map +1 -0
  50. package/dist/vendor/helpers/beta/mcp.d.ts +302 -0
  51. package/dist/vendor/helpers/beta/mcp.js +406 -0
  52. package/dist/vendor/helpers/beta/mcp.js.map +1 -0
  53. package/dist/vendor/helpers/beta/memory.d.ts +10 -0
  54. package/dist/vendor/helpers/beta/memory.js +15 -0
  55. package/dist/vendor/helpers/beta/memory.js.map +1 -0
  56. package/dist/vendor/helpers/beta/standard-schema.d.ts +44 -0
  57. package/dist/vendor/helpers/beta/standard-schema.js +54 -0
  58. package/dist/vendor/helpers/beta/standard-schema.js.map +1 -0
  59. package/dist/vendor/helpers/beta/zod.d.ts +32 -0
  60. package/dist/vendor/helpers/beta/zod.js +52 -0
  61. package/dist/vendor/helpers/beta/zod.js.map +1 -0
  62. package/dist/vendor/helpers/index.d.ts +2 -0
  63. package/dist/vendor/helpers/index.js +3 -0
  64. package/dist/vendor/helpers/index.js.map +1 -0
  65. package/dist/vendor/helpers/json-schema.d.ts +17 -0
  66. package/dist/vendor/helpers/json-schema.js +34 -0
  67. package/dist/vendor/helpers/json-schema.js.map +1 -0
  68. package/dist/vendor/helpers/zod.d.ts +12 -0
  69. package/dist/vendor/helpers/zod.js +42 -0
  70. package/dist/vendor/helpers/zod.js.map +1 -0
  71. package/dist/vendor/index.d.ts +16 -0
  72. package/dist/vendor/index.js +23 -0
  73. package/dist/vendor/index.js.map +1 -0
  74. package/dist/vendor/internal/builtin-types.d.ts +72 -0
  75. package/dist/vendor/internal/builtin-types.js +3 -0
  76. package/dist/vendor/internal/builtin-types.js.map +1 -0
  77. package/dist/vendor/internal/constants.d.ts +4 -0
  78. package/dist/vendor/internal/constants.js +10 -0
  79. package/dist/vendor/internal/constants.js.map +1 -0
  80. package/dist/vendor/internal/decoders/jsonl.d.ts +9 -0
  81. package/dist/vendor/internal/decoders/jsonl.js +37 -0
  82. package/dist/vendor/internal/decoders/jsonl.js.map +1 -0
  83. package/dist/vendor/internal/decoders/line.d.ts +16 -0
  84. package/dist/vendor/internal/decoders/line.js +105 -0
  85. package/dist/vendor/internal/decoders/line.js.map +1 -0
  86. package/dist/vendor/internal/detect-platform.d.ts +14 -0
  87. package/dist/vendor/internal/detect-platform.js +155 -0
  88. package/dist/vendor/internal/detect-platform.js.map +1 -0
  89. package/dist/vendor/internal/errors.d.ts +2 -0
  90. package/dist/vendor/internal/errors.js +38 -0
  91. package/dist/vendor/internal/errors.js.map +1 -0
  92. package/dist/vendor/internal/file-store.d.ts +135 -0
  93. package/dist/vendor/internal/file-store.js +529 -0
  94. package/dist/vendor/internal/file-store.js.map +1 -0
  95. package/dist/vendor/internal/headers.d.ts +28 -0
  96. package/dist/vendor/internal/headers.js +114 -0
  97. package/dist/vendor/internal/headers.js.map +1 -0
  98. package/dist/vendor/internal/message-stream-utils.d.ts +9 -0
  99. package/dist/vendor/internal/message-stream-utils.js +30 -0
  100. package/dist/vendor/internal/message-stream-utils.js.map +1 -0
  101. package/dist/vendor/internal/node.browser.d.ts +8 -0
  102. package/dist/vendor/internal/node.browser.js +19 -0
  103. package/dist/vendor/internal/node.browser.js.map +1 -0
  104. package/dist/vendor/internal/node.d.ts +13 -0
  105. package/dist/vendor/internal/node.js +14 -0
  106. package/dist/vendor/internal/node.js.map +1 -0
  107. package/dist/vendor/internal/parse.d.ts +17 -0
  108. package/dist/vendor/internal/parse.js +62 -0
  109. package/dist/vendor/internal/parse.js.map +1 -0
  110. package/dist/vendor/internal/qs/formats.d.ts +6 -0
  111. package/dist/vendor/internal/qs/formats.js +9 -0
  112. package/dist/vendor/internal/qs/formats.js.map +1 -0
  113. package/dist/vendor/internal/qs/index.d.ts +9 -0
  114. package/dist/vendor/internal/qs/index.js +10 -0
  115. package/dist/vendor/internal/qs/index.js.map +1 -0
  116. package/dist/vendor/internal/qs/stringify.d.ts +2 -0
  117. package/dist/vendor/internal/qs/stringify.js +274 -0
  118. package/dist/vendor/internal/qs/stringify.js.map +1 -0
  119. package/dist/vendor/internal/qs/types.d.ts +56 -0
  120. package/dist/vendor/internal/qs/types.js +2 -0
  121. package/dist/vendor/internal/qs/types.js.map +1 -0
  122. package/dist/vendor/internal/qs/utils.d.ts +14 -0
  123. package/dist/vendor/internal/qs/utils.js +217 -0
  124. package/dist/vendor/internal/qs/utils.js.map +1 -0
  125. package/dist/vendor/internal/request-options.d.ts +126 -0
  126. package/dist/vendor/internal/request-options.js +27 -0
  127. package/dist/vendor/internal/request-options.js.map +1 -0
  128. package/dist/vendor/internal/request-signal.d.ts +3 -0
  129. package/dist/vendor/internal/request-signal.js +45 -0
  130. package/dist/vendor/internal/request-signal.js.map +1 -0
  131. package/dist/vendor/internal/shim-types.d.ts +16 -0
  132. package/dist/vendor/internal/shim-types.js +3 -0
  133. package/dist/vendor/internal/shim-types.js.map +1 -0
  134. package/dist/vendor/internal/shims.d.ts +25 -0
  135. package/dist/vendor/internal/shims.js +85 -0
  136. package/dist/vendor/internal/shims.js.map +1 -0
  137. package/dist/vendor/internal/stainless-helper-header.d.ts +59 -0
  138. package/dist/vendor/internal/stainless-helper-header.js +83 -0
  139. package/dist/vendor/internal/stainless-helper-header.js.map +1 -0
  140. package/dist/vendor/internal/stream-utils.d.ts +7 -0
  141. package/dist/vendor/internal/stream-utils.js +35 -0
  142. package/dist/vendor/internal/stream-utils.js.map +1 -0
  143. package/dist/vendor/internal/to-file.d.ts +44 -0
  144. package/dist/vendor/internal/to-file.js +93 -0
  145. package/dist/vendor/internal/to-file.js.map +1 -0
  146. package/dist/vendor/internal/types.d.ts +62 -0
  147. package/dist/vendor/internal/types.js +3 -0
  148. package/dist/vendor/internal/types.js.map +1 -0
  149. package/dist/vendor/internal/uploads.d.ts +41 -0
  150. package/dist/vendor/internal/uploads.js +139 -0
  151. package/dist/vendor/internal/uploads.js.map +1 -0
  152. package/dist/vendor/internal/utils/abort.d.ts +11 -0
  153. package/dist/vendor/internal/utils/abort.js +22 -0
  154. package/dist/vendor/internal/utils/abort.js.map +1 -0
  155. package/dist/vendor/internal/utils/async-queue.d.ts +30 -0
  156. package/dist/vendor/internal/utils/async-queue.js +66 -0
  157. package/dist/vendor/internal/utils/async-queue.js.map +1 -0
  158. package/dist/vendor/internal/utils/backoff.d.ts +22 -0
  159. package/dist/vendor/internal/utils/backoff.js +36 -0
  160. package/dist/vendor/internal/utils/backoff.js.map +1 -0
  161. package/dist/vendor/internal/utils/base64.d.ts +2 -0
  162. package/dist/vendor/internal/utils/base64.js +33 -0
  163. package/dist/vendor/internal/utils/base64.js.map +1 -0
  164. package/dist/vendor/internal/utils/bytes.d.ts +3 -0
  165. package/dist/vendor/internal/utils/bytes.js +26 -0
  166. package/dist/vendor/internal/utils/bytes.js.map +1 -0
  167. package/dist/vendor/internal/utils/env.d.ts +8 -0
  168. package/dist/vendor/internal/utils/env.js +18 -0
  169. package/dist/vendor/internal/utils/env.js.map +1 -0
  170. package/dist/vendor/internal/utils/log.d.ts +46 -0
  171. package/dist/vendor/internal/utils/log.js +105 -0
  172. package/dist/vendor/internal/utils/log.js.map +1 -0
  173. package/dist/vendor/internal/utils/path.d.ts +14 -0
  174. package/dist/vendor/internal/utils/path.js +74 -0
  175. package/dist/vendor/internal/utils/path.js.map +1 -0
  176. package/dist/vendor/internal/utils/promise.d.ts +10 -0
  177. package/dist/vendor/internal/utils/promise.js +15 -0
  178. package/dist/vendor/internal/utils/promise.js.map +1 -0
  179. package/dist/vendor/internal/utils/query.d.ts +1 -0
  180. package/dist/vendor/internal/utils/query.js +6 -0
  181. package/dist/vendor/internal/utils/query.js.map +1 -0
  182. package/dist/vendor/internal/utils/sleep.d.ts +9 -0
  183. package/dist/vendor/internal/utils/sleep.js +24 -0
  184. package/dist/vendor/internal/utils/sleep.js.map +1 -0
  185. package/dist/vendor/internal/utils/time.d.ts +2 -0
  186. package/dist/vendor/internal/utils/time.js +5 -0
  187. package/dist/vendor/internal/utils/time.js.map +1 -0
  188. package/dist/vendor/internal/utils/uuid.d.ts +4 -0
  189. package/dist/vendor/internal/utils/uuid.js +15 -0
  190. package/dist/vendor/internal/utils/uuid.js.map +1 -0
  191. package/dist/vendor/internal/utils/values.d.ts +24 -0
  192. package/dist/vendor/internal/utils/values.js +106 -0
  193. package/dist/vendor/internal/utils/values.js.map +1 -0
  194. package/dist/vendor/internal/utils.d.ts +7 -0
  195. package/dist/vendor/internal/utils.js +9 -0
  196. package/dist/vendor/internal/utils.js.map +1 -0
  197. package/dist/vendor/lib/BetaMessageStream.d.ts +123 -0
  198. package/dist/vendor/lib/BetaMessageStream.js +662 -0
  199. package/dist/vendor/lib/BetaMessageStream.js.map +1 -0
  200. package/dist/vendor/lib/MessageStream.d.ts +122 -0
  201. package/dist/vendor/lib/MessageStream.js +609 -0
  202. package/dist/vendor/lib/MessageStream.js.map +1 -0
  203. package/dist/vendor/lib/beta-parser.d.ts +36 -0
  204. package/dist/vendor/lib/beta-parser.js +75 -0
  205. package/dist/vendor/lib/beta-parser.js.map +1 -0
  206. package/dist/vendor/lib/credentials/credential-chain.d.ts +38 -0
  207. package/dist/vendor/lib/credentials/credential-chain.js +208 -0
  208. package/dist/vendor/lib/credentials/credential-chain.js.map +1 -0
  209. package/dist/vendor/lib/credentials/identity-token.d.ts +10 -0
  210. package/dist/vendor/lib/credentials/identity-token.js +35 -0
  211. package/dist/vendor/lib/credentials/identity-token.js.map +1 -0
  212. package/dist/vendor/lib/credentials/oidc-federation.d.ts +39 -0
  213. package/dist/vendor/lib/credentials/oidc-federation.js +79 -0
  214. package/dist/vendor/lib/credentials/oidc-federation.js.map +1 -0
  215. package/dist/vendor/lib/credentials/token-cache.d.ts +53 -0
  216. package/dist/vendor/lib/credentials/token-cache.js +110 -0
  217. package/dist/vendor/lib/credentials/token-cache.js.map +1 -0
  218. package/dist/vendor/lib/credentials/types.d.ts +95 -0
  219. package/dist/vendor/lib/credentials/types.js +226 -0
  220. package/dist/vendor/lib/credentials/types.js.map +1 -0
  221. package/dist/vendor/lib/credentials/user-oauth.d.ts +20 -0
  222. package/dist/vendor/lib/credentials/user-oauth.js +94 -0
  223. package/dist/vendor/lib/credentials/user-oauth.js.map +1 -0
  224. package/dist/vendor/lib/credentials.d.ts +3 -0
  225. package/dist/vendor/lib/credentials.js +3 -0
  226. package/dist/vendor/lib/credentials.js.map +1 -0
  227. package/dist/vendor/lib/environments/index.d.ts +3 -0
  228. package/dist/vendor/lib/environments/index.js +4 -0
  229. package/dist/vendor/lib/environments/index.js.map +1 -0
  230. package/dist/vendor/lib/environments/poller.d.ts +94 -0
  231. package/dist/vendor/lib/environments/poller.js +218 -0
  232. package/dist/vendor/lib/environments/poller.js.map +1 -0
  233. package/dist/vendor/lib/environments/worker.d.ts +226 -0
  234. package/dist/vendor/lib/environments/worker.js +572 -0
  235. package/dist/vendor/lib/environments/worker.js.map +1 -0
  236. package/dist/vendor/lib/helper-client.d.ts +30 -0
  237. package/dist/vendor/lib/helper-client.js +55 -0
  238. package/dist/vendor/lib/helper-client.js.map +1 -0
  239. package/dist/vendor/lib/middleware.d.ts +97 -0
  240. package/dist/vendor/lib/middleware.js +775 -0
  241. package/dist/vendor/lib/middleware.js.map +1 -0
  242. package/dist/vendor/lib/parser.d.ts +31 -0
  243. package/dist/vendor/lib/parser.js +62 -0
  244. package/dist/vendor/lib/parser.js.map +1 -0
  245. package/dist/vendor/lib/sessions/accumulate.d.ts +22 -0
  246. package/dist/vendor/lib/sessions/accumulate.js +42 -0
  247. package/dist/vendor/lib/sessions/accumulate.js.map +1 -0
  248. package/dist/vendor/lib/standard-schema.d.ts +130 -0
  249. package/dist/vendor/lib/standard-schema.js +41 -0
  250. package/dist/vendor/lib/standard-schema.js.map +1 -0
  251. package/dist/vendor/lib/tools/BetaRunnableTool.d.ts +48 -0
  252. package/dist/vendor/lib/tools/BetaRunnableTool.js +26 -0
  253. package/dist/vendor/lib/tools/BetaRunnableTool.js.map +1 -0
  254. package/dist/vendor/lib/tools/BetaToolRunner.d.ts +160 -0
  255. package/dist/vendor/lib/tools/BetaToolRunner.js +497 -0
  256. package/dist/vendor/lib/tools/BetaToolRunner.js.map +1 -0
  257. package/dist/vendor/lib/tools/CompactionControl.d.ts +29 -0
  258. package/dist/vendor/lib/tools/CompactionControl.js +25 -0
  259. package/dist/vendor/lib/tools/CompactionControl.js.map +1 -0
  260. package/dist/vendor/lib/tools/SessionToolRunner.d.ts +178 -0
  261. package/dist/vendor/lib/tools/SessionToolRunner.js +737 -0
  262. package/dist/vendor/lib/tools/SessionToolRunner.js.map +1 -0
  263. package/dist/vendor/lib/tools/ToolError.d.ts +32 -0
  264. package/dist/vendor/lib/tools/ToolError.js +43 -0
  265. package/dist/vendor/lib/tools/ToolError.js.map +1 -0
  266. package/dist/vendor/lib/transform-json-schema.d.ts +2 -0
  267. package/dist/vendor/lib/transform-json-schema.js +111 -0
  268. package/dist/vendor/lib/transform-json-schema.js.map +1 -0
  269. package/dist/vendor/pagination.d.ts +2 -0
  270. package/dist/vendor/pagination.js +3 -0
  271. package/dist/vendor/pagination.js.map +1 -0
  272. package/dist/vendor/resource.d.ts +2 -0
  273. package/dist/vendor/resource.js +3 -0
  274. package/dist/vendor/resource.js.map +1 -0
  275. package/dist/vendor/resources/beta/agents/agents.d.ts +1128 -0
  276. package/dist/vendor/resources/beta/agents/agents.js +123 -0
  277. package/dist/vendor/resources/beta/agents/agents.js.map +1 -0
  278. package/dist/vendor/resources/beta/agents/index.d.ts +2 -0
  279. package/dist/vendor/resources/beta/agents/index.js +4 -0
  280. package/dist/vendor/resources/beta/agents/index.js.map +1 -0
  281. package/dist/vendor/resources/beta/agents/versions.d.ts +32 -0
  282. package/dist/vendor/resources/beta/agents/versions.js +32 -0
  283. package/dist/vendor/resources/beta/agents/versions.js.map +1 -0
  284. package/dist/vendor/resources/beta/agents.d.ts +1 -0
  285. package/dist/vendor/resources/beta/agents.js +3 -0
  286. package/dist/vendor/resources/beta/agents.js.map +1 -0
  287. package/dist/vendor/resources/beta/beta.d.ts +131 -0
  288. package/dist/vendor/resources/beta/beta.js +69 -0
  289. package/dist/vendor/resources/beta/beta.js.map +1 -0
  290. package/dist/vendor/resources/beta/deployment-runs.d.ts +305 -0
  291. package/dist/vendor/resources/beta/deployment-runs.js +51 -0
  292. package/dist/vendor/resources/beta/deployment-runs.js.map +1 -0
  293. package/dist/vendor/resources/beta/deployments.d.ts +698 -0
  294. package/dist/vendor/resources/beta/deployments.js +192 -0
  295. package/dist/vendor/resources/beta/deployments.js.map +1 -0
  296. package/dist/vendor/resources/beta/dreams.d.ts +335 -0
  297. package/dist/vendor/resources/beta/dreams.js +112 -0
  298. package/dist/vendor/resources/beta/dreams.js.map +1 -0
  299. package/dist/vendor/resources/beta/environments/environments.d.ts +432 -0
  300. package/dist/vendor/resources/beta/environments/environments.js +142 -0
  301. package/dist/vendor/resources/beta/environments/environments.js.map +1 -0
  302. package/dist/vendor/resources/beta/environments/index.d.ts +2 -0
  303. package/dist/vendor/resources/beta/environments/index.js +4 -0
  304. package/dist/vendor/resources/beta/environments/index.js.map +1 -0
  305. package/dist/vendor/resources/beta/environments/work.d.ts +500 -0
  306. package/dist/vendor/resources/beta/environments/work.js +251 -0
  307. package/dist/vendor/resources/beta/environments/work.js.map +1 -0
  308. package/dist/vendor/resources/beta/environments.d.ts +1 -0
  309. package/dist/vendor/resources/beta/environments.js +3 -0
  310. package/dist/vendor/resources/beta/environments.js.map +1 -0
  311. package/dist/vendor/resources/beta/files.d.ts +190 -0
  312. package/dist/vendor/resources/beta/files.js +120 -0
  313. package/dist/vendor/resources/beta/files.js.map +1 -0
  314. package/dist/vendor/resources/beta/index.d.ts +17 -0
  315. package/dist/vendor/resources/beta/index.js +19 -0
  316. package/dist/vendor/resources/beta/index.js.map +1 -0
  317. package/dist/vendor/resources/beta/memory-stores/index.d.ts +3 -0
  318. package/dist/vendor/resources/beta/memory-stores/index.js +5 -0
  319. package/dist/vendor/resources/beta/memory-stores/index.js.map +1 -0
  320. package/dist/vendor/resources/beta/memory-stores/memories.d.ts +346 -0
  321. package/dist/vendor/resources/beta/memory-stores/memories.js +126 -0
  322. package/dist/vendor/resources/beta/memory-stores/memories.js.map +1 -0
  323. package/dist/vendor/resources/beta/memory-stores/memory-stores.d.ts +230 -0
  324. package/dist/vendor/resources/beta/memory-stores/memory-stores.js +137 -0
  325. package/dist/vendor/resources/beta/memory-stores/memory-stores.js.map +1 -0
  326. package/dist/vendor/resources/beta/memory-stores/memory-versions.d.ts +252 -0
  327. package/dist/vendor/resources/beta/memory-stores/memory-versions.js +77 -0
  328. package/dist/vendor/resources/beta/memory-stores/memory-versions.js.map +1 -0
  329. package/dist/vendor/resources/beta/memory-stores.d.ts +1 -0
  330. package/dist/vendor/resources/beta/memory-stores.js +3 -0
  331. package/dist/vendor/resources/beta/memory-stores.js.map +1 -0
  332. package/dist/vendor/resources/beta/messages/batches.d.ts +685 -0
  333. package/dist/vendor/resources/beta/messages/batches.js +203 -0
  334. package/dist/vendor/resources/beta/messages/batches.js.map +1 -0
  335. package/dist/vendor/resources/beta/messages/index.d.ts +3 -0
  336. package/dist/vendor/resources/beta/messages/index.js +5 -0
  337. package/dist/vendor/resources/beta/messages/index.js.map +1 -0
  338. package/dist/vendor/resources/beta/messages/messages.d.ts +5376 -0
  339. package/dist/vendor/resources/beta/messages/messages.js +158 -0
  340. package/dist/vendor/resources/beta/messages/messages.js.map +1 -0
  341. package/dist/vendor/resources/beta/messages.d.ts +1 -0
  342. package/dist/vendor/resources/beta/messages.js +3 -0
  343. package/dist/vendor/resources/beta/messages.js.map +1 -0
  344. package/dist/vendor/resources/beta/models.d.ts +217 -0
  345. package/dist/vendor/resources/beta/models.js +56 -0
  346. package/dist/vendor/resources/beta/models.js.map +1 -0
  347. package/dist/vendor/resources/beta/organization/api-keys.d.ts +176 -0
  348. package/dist/vendor/resources/beta/organization/api-keys.js +52 -0
  349. package/dist/vendor/resources/beta/organization/api-keys.js.map +1 -0
  350. package/dist/vendor/resources/beta/organization/compliance-settings.d.ts +73 -0
  351. package/dist/vendor/resources/beta/organization/compliance-settings.js +48 -0
  352. package/dist/vendor/resources/beta/organization/compliance-settings.js.map +1 -0
  353. package/dist/vendor/resources/beta/organization/external-keys.d.ts +271 -0
  354. package/dist/vendor/resources/beta/organization/external-keys.js +115 -0
  355. package/dist/vendor/resources/beta/organization/external-keys.js.map +1 -0
  356. package/dist/vendor/resources/beta/organization/federation/federation.d.ts +13 -0
  357. package/dist/vendor/resources/beta/organization/federation/federation.js +13 -0
  358. package/dist/vendor/resources/beta/organization/federation/federation.js.map +1 -0
  359. package/dist/vendor/resources/beta/organization/federation/index.d.ts +3 -0
  360. package/dist/vendor/resources/beta/organization/federation/index.js +5 -0
  361. package/dist/vendor/resources/beta/organization/federation/index.js.map +1 -0
  362. package/dist/vendor/resources/beta/organization/federation/issuers.d.ts +352 -0
  363. package/dist/vendor/resources/beta/organization/federation/issuers.js +165 -0
  364. package/dist/vendor/resources/beta/organization/federation/issuers.js.map +1 -0
  365. package/dist/vendor/resources/beta/organization/federation/rules/index.d.ts +2 -0
  366. package/dist/vendor/resources/beta/organization/federation/rules/index.js +4 -0
  367. package/dist/vendor/resources/beta/organization/federation/rules/index.js.map +1 -0
  368. package/dist/vendor/resources/beta/organization/federation/rules/rules.d.ts +467 -0
  369. package/dist/vendor/resources/beta/organization/federation/rules/rules.js +190 -0
  370. package/dist/vendor/resources/beta/organization/federation/rules/rules.js.map +1 -0
  371. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.d.ts +123 -0
  372. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.js +110 -0
  373. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.js.map +1 -0
  374. package/dist/vendor/resources/beta/organization/federation/rules.d.ts +1 -0
  375. package/dist/vendor/resources/beta/organization/federation/rules.js +3 -0
  376. package/dist/vendor/resources/beta/organization/federation/rules.js.map +1 -0
  377. package/dist/vendor/resources/beta/organization/federation.d.ts +1 -0
  378. package/dist/vendor/resources/beta/organization/federation.js +3 -0
  379. package/dist/vendor/resources/beta/organization/federation.js.map +1 -0
  380. package/dist/vendor/resources/beta/organization/index.d.ts +10 -0
  381. package/dist/vendor/resources/beta/organization/index.js +12 -0
  382. package/dist/vendor/resources/beta/organization/index.js.map +1 -0
  383. package/dist/vendor/resources/beta/organization/invites.d.ts +161 -0
  384. package/dist/vendor/resources/beta/organization/invites.js +72 -0
  385. package/dist/vendor/resources/beta/organization/invites.js.map +1 -0
  386. package/dist/vendor/resources/beta/organization/organization.d.ts +72 -0
  387. package/dist/vendor/resources/beta/organization/organization.js +54 -0
  388. package/dist/vendor/resources/beta/organization/organization.js.map +1 -0
  389. package/dist/vendor/resources/beta/organization/rate-limits.d.ts +76 -0
  390. package/dist/vendor/resources/beta/organization/rate-limits.js +27 -0
  391. package/dist/vendor/resources/beta/organization/rate-limits.js.map +1 -0
  392. package/dist/vendor/resources/beta/organization/service-accounts/index.d.ts +2 -0
  393. package/dist/vendor/resources/beta/organization/service-accounts/index.js +4 -0
  394. package/dist/vendor/resources/beta/organization/service-accounts/index.js.map +1 -0
  395. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.d.ts +257 -0
  396. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.js +166 -0
  397. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.js.map +1 -0
  398. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.d.ts +140 -0
  399. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.js +121 -0
  400. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.js.map +1 -0
  401. package/dist/vendor/resources/beta/organization/service-accounts.d.ts +1 -0
  402. package/dist/vendor/resources/beta/organization/service-accounts.js +3 -0
  403. package/dist/vendor/resources/beta/organization/service-accounts.js.map +1 -0
  404. package/dist/vendor/resources/beta/organization/users.d.ts +123 -0
  405. package/dist/vendor/resources/beta/organization/users.js +63 -0
  406. package/dist/vendor/resources/beta/organization/users.js.map +1 -0
  407. package/dist/vendor/resources/beta/organization/workspaces/index.d.ts +4 -0
  408. package/dist/vendor/resources/beta/organization/workspaces/index.js +6 -0
  409. package/dist/vendor/resources/beta/organization/workspaces/index.js.map +1 -0
  410. package/dist/vendor/resources/beta/organization/workspaces/members.d.ts +134 -0
  411. package/dist/vendor/resources/beta/organization/workspaces/members.js +98 -0
  412. package/dist/vendor/resources/beta/organization/workspaces/members.js.map +1 -0
  413. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.d.ts +82 -0
  414. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.js +30 -0
  415. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.js.map +1 -0
  416. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.d.ts +209 -0
  417. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.js +185 -0
  418. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.js.map +1 -0
  419. package/dist/vendor/resources/beta/organization/workspaces/workspaces.d.ts +302 -0
  420. package/dist/vendor/resources/beta/organization/workspaces/workspaces.js +104 -0
  421. package/dist/vendor/resources/beta/organization/workspaces/workspaces.js.map +1 -0
  422. package/dist/vendor/resources/beta/organization/workspaces.d.ts +1 -0
  423. package/dist/vendor/resources/beta/organization/workspaces.js +3 -0
  424. package/dist/vendor/resources/beta/organization/workspaces.js.map +1 -0
  425. package/dist/vendor/resources/beta/organization.d.ts +1 -0
  426. package/dist/vendor/resources/beta/organization.js +3 -0
  427. package/dist/vendor/resources/beta/organization.js.map +1 -0
  428. package/dist/vendor/resources/beta/sessions/events.d.ts +1513 -0
  429. package/dist/vendor/resources/beta/sessions/events.js +115 -0
  430. package/dist/vendor/resources/beta/sessions/events.js.map +1 -0
  431. package/dist/vendor/resources/beta/sessions/index.d.ts +4 -0
  432. package/dist/vendor/resources/beta/sessions/index.js +6 -0
  433. package/dist/vendor/resources/beta/sessions/index.js.map +1 -0
  434. package/dist/vendor/resources/beta/sessions/resources.d.ts +227 -0
  435. package/dist/vendor/resources/beta/sessions/resources.js +128 -0
  436. package/dist/vendor/resources/beta/sessions/resources.js.map +1 -0
  437. package/dist/vendor/resources/beta/sessions/sessions.d.ts +866 -0
  438. package/dist/vendor/resources/beta/sessions/sessions.js +150 -0
  439. package/dist/vendor/resources/beta/sessions/sessions.js.map +1 -0
  440. package/dist/vendor/resources/beta/sessions/threads/events.d.ts +77 -0
  441. package/dist/vendor/resources/beta/sessions/threads/events.js +57 -0
  442. package/dist/vendor/resources/beta/sessions/threads/events.js.map +1 -0
  443. package/dist/vendor/resources/beta/sessions/threads/index.d.ts +2 -0
  444. package/dist/vendor/resources/beta/sessions/threads/index.js +4 -0
  445. package/dist/vendor/resources/beta/sessions/threads/index.js.map +1 -0
  446. package/dist/vendor/resources/beta/sessions/threads/threads.d.ts +195 -0
  447. package/dist/vendor/resources/beta/sessions/threads/threads.js +80 -0
  448. package/dist/vendor/resources/beta/sessions/threads/threads.js.map +1 -0
  449. package/dist/vendor/resources/beta/sessions/threads.d.ts +1 -0
  450. package/dist/vendor/resources/beta/sessions/threads.js +3 -0
  451. package/dist/vendor/resources/beta/sessions/threads.js.map +1 -0
  452. package/dist/vendor/resources/beta/sessions.d.ts +1 -0
  453. package/dist/vendor/resources/beta/sessions.js +3 -0
  454. package/dist/vendor/resources/beta/sessions.js.map +1 -0
  455. package/dist/vendor/resources/beta/skills/index.d.ts +2 -0
  456. package/dist/vendor/resources/beta/skills/index.js +4 -0
  457. package/dist/vendor/resources/beta/skills/index.js.map +1 -0
  458. package/dist/vendor/resources/beta/skills/skills.d.ts +178 -0
  459. package/dist/vendor/resources/beta/skills/skills.js +96 -0
  460. package/dist/vendor/resources/beta/skills/skills.js.map +1 -0
  461. package/dist/vendor/resources/beta/skills/versions.d.ts +181 -0
  462. package/dist/vendor/resources/beta/skills/versions.js +125 -0
  463. package/dist/vendor/resources/beta/skills/versions.js.map +1 -0
  464. package/dist/vendor/resources/beta/skills.d.ts +1 -0
  465. package/dist/vendor/resources/beta/skills.js +3 -0
  466. package/dist/vendor/resources/beta/skills.js.map +1 -0
  467. package/dist/vendor/resources/beta/tunnels/certificates.d.ts +162 -0
  468. package/dist/vendor/resources/beta/tunnels/certificates.js +125 -0
  469. package/dist/vendor/resources/beta/tunnels/certificates.js.map +1 -0
  470. package/dist/vendor/resources/beta/tunnels/index.d.ts +2 -0
  471. package/dist/vendor/resources/beta/tunnels/index.js +4 -0
  472. package/dist/vendor/resources/beta/tunnels/index.js.map +1 -0
  473. package/dist/vendor/resources/beta/tunnels/tunnels.d.ts +211 -0
  474. package/dist/vendor/resources/beta/tunnels/tunnels.js +173 -0
  475. package/dist/vendor/resources/beta/tunnels/tunnels.js.map +1 -0
  476. package/dist/vendor/resources/beta/tunnels.d.ts +1 -0
  477. package/dist/vendor/resources/beta/tunnels.js +3 -0
  478. package/dist/vendor/resources/beta/tunnels.js.map +1 -0
  479. package/dist/vendor/resources/beta/user-profiles.d.ts +244 -0
  480. package/dist/vendor/resources/beta/user-profiles.js +114 -0
  481. package/dist/vendor/resources/beta/user-profiles.js.map +1 -0
  482. package/dist/vendor/resources/beta/vaults/credentials.d.ts +715 -0
  483. package/dist/vendor/resources/beta/vaults/credentials.js +173 -0
  484. package/dist/vendor/resources/beta/vaults/credentials.js.map +1 -0
  485. package/dist/vendor/resources/beta/vaults/index.d.ts +2 -0
  486. package/dist/vendor/resources/beta/vaults/index.js +4 -0
  487. package/dist/vendor/resources/beta/vaults/index.js.map +1 -0
  488. package/dist/vendor/resources/beta/vaults/vaults.d.ts +191 -0
  489. package/dist/vendor/resources/beta/vaults/vaults.js +141 -0
  490. package/dist/vendor/resources/beta/vaults/vaults.js.map +1 -0
  491. package/dist/vendor/resources/beta/vaults.d.ts +1 -0
  492. package/dist/vendor/resources/beta/vaults.js +3 -0
  493. package/dist/vendor/resources/beta/vaults.js.map +1 -0
  494. package/dist/vendor/resources/beta/webhooks.d.ts +464 -0
  495. package/dist/vendor/resources/beta/webhooks.js +29 -0
  496. package/dist/vendor/resources/beta/webhooks.js.map +1 -0
  497. package/dist/vendor/resources/beta.d.ts +1 -0
  498. package/dist/vendor/resources/beta.js +3 -0
  499. package/dist/vendor/resources/beta.js.map +1 -0
  500. package/dist/vendor/resources/completions.d.ts +172 -0
  501. package/dist/vendor/resources/completions.js +19 -0
  502. package/dist/vendor/resources/completions.js.map +1 -0
  503. package/dist/vendor/resources/files.d.ts +104 -0
  504. package/dist/vendor/resources/files.js +48 -0
  505. package/dist/vendor/resources/files.js.map +1 -0
  506. package/dist/vendor/resources/index.d.ts +7 -0
  507. package/dist/vendor/resources/index.js +9 -0
  508. package/dist/vendor/resources/index.js.map +1 -0
  509. package/dist/vendor/resources/messages/batches.d.ts +312 -0
  510. package/dist/vendor/resources/messages/batches.js +157 -0
  511. package/dist/vendor/resources/messages/batches.js.map +1 -0
  512. package/dist/vendor/resources/messages/index.d.ts +2 -0
  513. package/dist/vendor/resources/messages/index.js +4 -0
  514. package/dist/vendor/resources/messages/index.js.map +1 -0
  515. package/dist/vendor/resources/messages/messages.d.ts +3886 -0
  516. package/dist/vendor/resources/messages/messages.js +130 -0
  517. package/dist/vendor/resources/messages/messages.js.map +1 -0
  518. package/dist/vendor/resources/messages.d.ts +1 -0
  519. package/dist/vendor/resources/messages.js +3 -0
  520. package/dist/vendor/resources/messages.js.map +1 -0
  521. package/dist/vendor/resources/models.d.ts +196 -0
  522. package/dist/vendor/resources/models.js +41 -0
  523. package/dist/vendor/resources/models.js.map +1 -0
  524. package/dist/vendor/resources/shared.d.ts +43 -0
  525. package/dist/vendor/resources/shared.js +3 -0
  526. package/dist/vendor/resources/shared.js.map +1 -0
  527. package/dist/vendor/resources/skills/index.d.ts +2 -0
  528. package/dist/vendor/resources/skills/index.js +4 -0
  529. package/dist/vendor/resources/skills/index.js.map +1 -0
  530. package/dist/vendor/resources/skills/skills.d.ts +128 -0
  531. package/dist/vendor/resources/skills/skills.js +36 -0
  532. package/dist/vendor/resources/skills/skills.js.map +1 -0
  533. package/dist/vendor/resources/skills/versions.d.ts +103 -0
  534. package/dist/vendor/resources/skills/versions.js +37 -0
  535. package/dist/vendor/resources/skills/versions.js.map +1 -0
  536. package/dist/vendor/resources/skills.d.ts +1 -0
  537. package/dist/vendor/resources/skills.js +3 -0
  538. package/dist/vendor/resources/skills.js.map +1 -0
  539. package/dist/vendor/resources/top-level.d.ts +1 -0
  540. package/dist/vendor/resources/top-level.js +3 -0
  541. package/dist/vendor/resources/top-level.js.map +1 -0
  542. package/dist/vendor/resources.d.ts +1 -0
  543. package/dist/vendor/resources.js +2 -0
  544. package/dist/vendor/resources.js.map +1 -0
  545. package/dist/vendor/streaming.d.ts +2 -0
  546. package/dist/vendor/streaming.js +3 -0
  547. package/dist/vendor/streaming.js.map +1 -0
  548. package/dist/vendor/tools/agent-toolset/fs-util.d.ts +74 -0
  549. package/dist/vendor/tools/agent-toolset/fs-util.js +184 -0
  550. package/dist/vendor/tools/agent-toolset/fs-util.js.map +1 -0
  551. package/dist/vendor/tools/agent-toolset/memories.d.ts +172 -0
  552. package/dist/vendor/tools/agent-toolset/memories.js +910 -0
  553. package/dist/vendor/tools/agent-toolset/memories.js.map +1 -0
  554. package/dist/vendor/tools/agent-toolset/node.browser.d.ts +80 -0
  555. package/dist/vendor/tools/agent-toolset/node.browser.js +129 -0
  556. package/dist/vendor/tools/agent-toolset/node.browser.js.map +1 -0
  557. package/dist/vendor/tools/agent-toolset/node.d.ts +191 -0
  558. package/dist/vendor/tools/agent-toolset/node.js +886 -0
  559. package/dist/vendor/tools/agent-toolset/node.js.map +1 -0
  560. package/dist/vendor/tools/agent-toolset/skills.d.ts +73 -0
  561. package/dist/vendor/tools/agent-toolset/skills.js +320 -0
  562. package/dist/vendor/tools/agent-toolset/skills.js.map +1 -0
  563. package/dist/vendor/tools/agent-toolset/sync-interval.d.ts +18 -0
  564. package/dist/vendor/tools/agent-toolset/sync-interval.js +25 -0
  565. package/dist/vendor/tools/agent-toolset/sync-interval.js.map +1 -0
  566. package/dist/vendor/tools/memory/node.browser.d.ts +26 -0
  567. package/dist/vendor/tools/memory/node.browser.js +44 -0
  568. package/dist/vendor/tools/memory/node.browser.js.map +1 -0
  569. package/dist/vendor/tools/memory/node.d.ts +17 -0
  570. package/dist/vendor/tools/memory/node.js +327 -0
  571. package/dist/vendor/tools/memory/node.js.map +1 -0
  572. package/dist/vendor/uploads.d.ts +2 -0
  573. package/dist/vendor/uploads.js +3 -0
  574. package/dist/vendor/uploads.js.map +1 -0
  575. package/dist/vendor/version.d.ts +1 -0
  576. package/dist/vendor/version.js +2 -0
  577. package/dist/vendor/version.js.map +1 -0
  578. package/package.json +7 -14
  579. package/sdk.cjs +6 -6
  580. package/sdk.cjs.map +18 -18
  581. package/sdk.d.ts +10 -10
  582. package/sdk.mjs +21 -21
  583. package/sdk.mjs.map +18 -18
@@ -0,0 +1,103 @@
1
+ import { APIResource } from '../../core/resource';
2
+ import { APIPromise } from '../../core/api-promise';
3
+ import { PageCursor, type PageCursorParams, PagePromise } from '../../core/pagination';
4
+ import { type Uploadable } from '../../core/uploads';
5
+ import { RequestOptions } from '../../internal/request-options';
6
+ export declare class Versions extends APIResource {
7
+ /**
8
+ * Create Skill Version
9
+ */
10
+ create(skillID: string, body: VersionCreateParams, options?: RequestOptions): APIPromise<SkillVersion>;
11
+ /**
12
+ * Get Skill Version
13
+ */
14
+ retrieve(version: string, params: VersionRetrieveParams, options?: RequestOptions): APIPromise<SkillVersion>;
15
+ /**
16
+ * List Skill Versions
17
+ */
18
+ list(skillID: string, query?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<SkillVersionsPageCursor, SkillVersion>;
19
+ /**
20
+ * Delete Skill Version
21
+ */
22
+ delete(version: string, params: VersionDeleteParams, options?: RequestOptions): APIPromise<DeletedSkillVersion>;
23
+ }
24
+ export type SkillVersionsPageCursor = PageCursor<SkillVersion>;
25
+ export interface DeletedSkillVersion {
26
+ /**
27
+ * Unique identifier for this Skill Version. The id addresses the version in paths
28
+ * and pins it in references.
29
+ */
30
+ id: string;
31
+ /**
32
+ * Deleted object type.
33
+ *
34
+ * For Skill Versions, this is always `"skill_version_deleted"`.
35
+ */
36
+ type: 'skill_version_deleted';
37
+ }
38
+ export interface SkillVersion {
39
+ /**
40
+ * Unique identifier for this Skill Version. The id addresses the version in paths
41
+ * and pins it in references.
42
+ */
43
+ id: string;
44
+ /**
45
+ * ISO 8601 timestamp of when the skill was created.
46
+ */
47
+ created_at: string;
48
+ /**
49
+ * Description of the skill version.
50
+ *
51
+ * This is extracted from the SKILL.md file in the skill upload.
52
+ */
53
+ description: string;
54
+ /**
55
+ * The Skill's immutable kebab-case slug, set at creation from the first upload's
56
+ * SKILL.md frontmatter `name` (or its enclosing directory). Every later upload
57
+ * must resolve to the same value. Also the top-level directory of the Skill's
58
+ * mounted files and the base name of a downloaded archive.
59
+ */
60
+ name: string;
61
+ /**
62
+ * Unique identifier for the skill.
63
+ *
64
+ * The format and length of IDs may change over time.
65
+ */
66
+ skill_id: string;
67
+ /**
68
+ * Object type.
69
+ *
70
+ * For Skill Versions, this is always `"skill_version"`.
71
+ */
72
+ type: 'skill_version';
73
+ }
74
+ export interface VersionCreateParams {
75
+ /**
76
+ * Files to upload for the skill.
77
+ *
78
+ * All files must be in the same top-level directory and must include a SKILL.md
79
+ * file at the root of that directory.
80
+ */
81
+ files: Array<Uploadable>;
82
+ }
83
+ export interface VersionRetrieveParams {
84
+ /**
85
+ * Unique identifier for the skill.
86
+ *
87
+ * The format and length of IDs may change over time.
88
+ */
89
+ skill_id: string;
90
+ }
91
+ export interface VersionListParams extends PageCursorParams {
92
+ }
93
+ export interface VersionDeleteParams {
94
+ /**
95
+ * Unique identifier for the skill.
96
+ *
97
+ * The format and length of IDs may change over time.
98
+ */
99
+ skill_id: string;
100
+ }
101
+ export declare namespace Versions {
102
+ export { type DeletedSkillVersion as DeletedSkillVersion, type SkillVersion as SkillVersion, type SkillVersionsPageCursor as SkillVersionsPageCursor, type VersionCreateParams as VersionCreateParams, type VersionRetrieveParams as VersionRetrieveParams, type VersionListParams as VersionListParams, type VersionDeleteParams as VersionDeleteParams, };
103
+ }
@@ -0,0 +1,37 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from '../../core/resource.js';
3
+ import { PageCursor } from '../../core/pagination.js';
4
+ import { multipartFormRequestOptions } from '../../internal/uploads.js';
5
+ import { path } from '../../internal/utils/path.js';
6
+ export class Versions extends APIResource {
7
+ /**
8
+ * Create Skill Version
9
+ */
10
+ create(skillID, body, options) {
11
+ return this._client.post(path `/v1/skills/${skillID}/versions`, multipartFormRequestOptions({ body, ...options }, this._client, false));
12
+ }
13
+ /**
14
+ * Get Skill Version
15
+ */
16
+ retrieve(version, params, options) {
17
+ const { skill_id } = params;
18
+ return this._client.get(path `/v1/skills/${skill_id}/versions/${version}`, options);
19
+ }
20
+ /**
21
+ * List Skill Versions
22
+ */
23
+ list(skillID, query = {}, options) {
24
+ return this._client.getAPIList(path `/v1/skills/${skillID}/versions`, (PageCursor), {
25
+ query,
26
+ ...options,
27
+ });
28
+ }
29
+ /**
30
+ * Delete Skill Version
31
+ */
32
+ delete(version, params, options) {
33
+ const { skill_id } = params;
34
+ return this._client.delete(path `/v1/skills/${skill_id}/versions/${version}`, options);
35
+ }
36
+ }
37
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../src/vendor/resources/skills/versions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,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/index';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export * from './skills/index.js';
3
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../src/vendor/resources/skills.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export {};
3
+ //# sourceMappingURL=top-level.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-level.js","sourceRoot":"","sources":["../../../src/vendor/resources/top-level.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
@@ -0,0 +1 @@
1
+ export * from './resources/index';
@@ -0,0 +1,2 @@
1
+ export * from './resources/index.js';
2
+ //# sourceMappingURL=resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/vendor/resources.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** @deprecated Import from ./core/streaming instead */
2
+ export * from './core/streaming';
@@ -0,0 +1,3 @@
1
+ /** @deprecated Import from ./core/streaming instead */
2
+ export * from './core/streaming.js';
3
+ //# sourceMappingURL=streaming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.js","sourceRoot":"","sources":["../../src/vendor/streaming.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Shared, Node-only filesystem helpers for the agent toolset's file tools:
3
+ * path confinement (symlink-aware), an atomic write, and language-independent
4
+ * error messages. Kept out of `node.ts` so the tool implementations stay focused
5
+ * and these helpers can be reused by every file tool.
6
+ */
7
+ /** Mode for directories the file tools create — not world-writable under a 0 umask. */
8
+ export declare const DIR_CREATE_MODE = 493;
9
+ /** Mode for files the file tools create. */
10
+ export declare const FILE_CREATE_MODE = 420;
11
+ /** True when `p` is `root` itself or lexically contained within it. */
12
+ export declare function isWithin(root: string, p: string): boolean;
13
+ /**
14
+ * The first entry of `roots` whose canonical form contains the
15
+ * already-canonical `target`, returned as configured; `undefined` when none
16
+ * does. Each root goes through {@link canonicalize} at check time, exactly like
17
+ * the workdir in {@link confineToRoot}, so granting access (`allowedRoots`)
18
+ * and refusing writes (`readOnlyRoots`) can never resolve the same entry two
19
+ * different ways.
20
+ */
21
+ export declare function containingRoot(roots: readonly string[], target: string): Promise<string | undefined>;
22
+ /** The `code` of a Node system error, or `undefined` for anything else. */
23
+ export declare function errnoCode(err: unknown): string | undefined;
24
+ /**
25
+ * Fully resolve `abs`: `realpath` the longest existing ancestor and re-append
26
+ * the rest, but never re-append a component that is itself a symlink — read the
27
+ * link and continue from its target instead. This handles paths being created
28
+ * (write/edit) without letting a symlink leaf (e.g. a dangling one pointing
29
+ * outside a confinement root) slip through unresolved.
30
+ *
31
+ * Returns a symlink-free path or throws an errno-carrying error (`ELOOP` for a
32
+ * cycle or more than {@link MAX_SYMLINK_HOPS} links, the `lstat`/`realpath`
33
+ * error for an unreadable component); it never returns `abs` unresolved. Only
34
+ * symlink hops count against the cap, so any depth of not-yet-existing
35
+ * directories still resolves.
36
+ */
37
+ export declare function canonicalize(abs: string): Promise<string>;
38
+ /**
39
+ * Resolve `p` against `root` and confine it to `root` or one of `allowedRoots`
40
+ * (absolute paths, resolved at check time exactly like `root`).
41
+ *
42
+ * Absolute and relative inputs go through the same canonicalise-then-contain
43
+ * check — an absolute path that lands inside a permitted root is accepted,
44
+ * only paths that resolve *outside* all of them are rejected. Every symlink in
45
+ * `p` (including the leaf, even a dangling one) is resolved before the
46
+ * confinement check, and the resolved path is what the caller then operates
47
+ * on, so a symlink inside `root` that points outside it can neither pass the
48
+ * check nor be followed afterwards. `..` is collapsed lexically before any
49
+ * symlink is followed. A path that cannot be resolved (symlink loop, unreadable
50
+ * component) is rejected with a `ToolError` naming `p`, never the host's
51
+ * absolute path.
52
+ *
53
+ * Residual TOCTOU: a component could still be swapped for a symlink between this
54
+ * call and the eventual `fs` operation. Closing that fully needs per-component
55
+ * `O_NOFOLLOW`/`openat`, which Node does not expose ergonomically; this is why a
56
+ * sandbox is still recommended for the toolset as a whole.
57
+ */
58
+ export declare function confineToRoot(root: string, p: string, opts?: {
59
+ allowedRoots?: readonly string[];
60
+ }): Promise<string>;
61
+ /**
62
+ * Atomically write `content` to `targetPath`: write a sibling temp file, fsync
63
+ * it, then rename over the target. The rename is atomic on most filesystems, so
64
+ * a crash mid-write never leaves the target half-written.
65
+ */
66
+ export declare function atomicWriteFile(targetPath: string, content: string): Promise<void>;
67
+ /**
68
+ * Map a thrown filesystem error to a consistent, language-independent message,
69
+ * so the model sees the same wording regardless of the runtime (Node's raw
70
+ * `ENOENT: no such file...` text would otherwise leak through). Codes we don't
71
+ * special-case render as the bare code, never Node's message, which embeds the
72
+ * host's absolute path.
73
+ */
74
+ export declare function fsErrorMessage(err: unknown, file: string): string;
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Shared, Node-only filesystem helpers for the agent toolset's file tools:
3
+ * path confinement (symlink-aware), an atomic write, and language-independent
4
+ * error messages. Kept out of `node.ts` so the tool implementations stay focused
5
+ * and these helpers can be reused by every file tool.
6
+ */
7
+ import { crypto, fs as nodefs, path } from '../../internal/node.js';
8
+ import { ToolError } from '../../lib/tools/ToolError.js';
9
+ const fs = nodefs.promises;
10
+ /** Mode for directories the file tools create — not world-writable under a 0 umask. */
11
+ export const DIR_CREATE_MODE = 0o755;
12
+ /** Mode for files the file tools create. */
13
+ export const FILE_CREATE_MODE = 0o644;
14
+ /** True when `p` is `root` itself or lexically contained within it. */
15
+ export function isWithin(root, p) {
16
+ const rel = path.relative(root, p);
17
+ return rel === '' || (!rel.startsWith('..' + path.sep) && rel !== '..' && !path.isAbsolute(rel));
18
+ }
19
+ /**
20
+ * The first entry of `roots` whose canonical form contains the
21
+ * already-canonical `target`, returned as configured; `undefined` when none
22
+ * does. Each root goes through {@link canonicalize} at check time, exactly like
23
+ * the workdir in {@link confineToRoot}, so granting access (`allowedRoots`)
24
+ * and refusing writes (`readOnlyRoots`) can never resolve the same entry two
25
+ * different ways.
26
+ */
27
+ export async function containingRoot(roots, target) {
28
+ for (const root of roots) {
29
+ if (isWithin(await canonicalize(path.resolve(root)), target))
30
+ return root;
31
+ }
32
+ return undefined;
33
+ }
34
+ /** Matches Linux MAXSYMLINKS, the threshold at which `realpath` itself reports ELOOP. */
35
+ const MAX_SYMLINK_HOPS = 40;
36
+ /** The `code` of a Node system error, or `undefined` for anything else. */
37
+ export function errnoCode(err) {
38
+ const code = err?.code;
39
+ return typeof code === 'string' ? code : undefined;
40
+ }
41
+ /**
42
+ * Fully resolve `abs`: `realpath` the longest existing ancestor and re-append
43
+ * the rest, but never re-append a component that is itself a symlink — read the
44
+ * link and continue from its target instead. This handles paths being created
45
+ * (write/edit) without letting a symlink leaf (e.g. a dangling one pointing
46
+ * outside a confinement root) slip through unresolved.
47
+ *
48
+ * Returns a symlink-free path or throws an errno-carrying error (`ELOOP` for a
49
+ * cycle or more than {@link MAX_SYMLINK_HOPS} links, the `lstat`/`realpath`
50
+ * error for an unreadable component); it never returns `abs` unresolved. Only
51
+ * symlink hops count against the cap, so any depth of not-yet-existing
52
+ * directories still resolves.
53
+ */
54
+ export async function canonicalize(abs) {
55
+ const tail = [];
56
+ let prefix = abs;
57
+ let hops = 0;
58
+ for (;;) {
59
+ let real;
60
+ try {
61
+ real = await fs.realpath(prefix);
62
+ }
63
+ catch (realpathErr) {
64
+ let isLink;
65
+ try {
66
+ isLink = (await fs.lstat(prefix)).isSymbolicLink();
67
+ }
68
+ catch (lstatErr) {
69
+ const code = errnoCode(lstatErr);
70
+ if (code !== 'ENOENT' && code !== 'ENOTDIR')
71
+ throw lstatErr;
72
+ const parent = path.dirname(prefix);
73
+ if (parent === prefix)
74
+ throw lstatErr;
75
+ tail.push(path.basename(prefix));
76
+ prefix = parent;
77
+ continue;
78
+ }
79
+ if (!isLink)
80
+ throw realpathErr;
81
+ if (++hops > MAX_SYMLINK_HOPS) {
82
+ throw Object.assign(new Error('too many levels of symbolic links'), { code: 'ELOOP' });
83
+ }
84
+ prefix = path.resolve(path.dirname(prefix), await fs.readlink(prefix));
85
+ continue;
86
+ }
87
+ return tail.length ? path.join(real, ...tail.reverse()) : real;
88
+ }
89
+ }
90
+ /**
91
+ * Resolve `p` against `root` and confine it to `root` or one of `allowedRoots`
92
+ * (absolute paths, resolved at check time exactly like `root`).
93
+ *
94
+ * Absolute and relative inputs go through the same canonicalise-then-contain
95
+ * check — an absolute path that lands inside a permitted root is accepted,
96
+ * only paths that resolve *outside* all of them are rejected. Every symlink in
97
+ * `p` (including the leaf, even a dangling one) is resolved before the
98
+ * confinement check, and the resolved path is what the caller then operates
99
+ * on, so a symlink inside `root` that points outside it can neither pass the
100
+ * check nor be followed afterwards. `..` is collapsed lexically before any
101
+ * symlink is followed. A path that cannot be resolved (symlink loop, unreadable
102
+ * component) is rejected with a `ToolError` naming `p`, never the host's
103
+ * absolute path.
104
+ *
105
+ * Residual TOCTOU: a component could still be swapped for a symlink between this
106
+ * call and the eventual `fs` operation. Closing that fully needs per-component
107
+ * `O_NOFOLLOW`/`openat`, which Node does not expose ergonomically; this is why a
108
+ * sandbox is still recommended for the toolset as a whole.
109
+ */
110
+ export async function confineToRoot(root, p, opts) {
111
+ const allowedRoots = opts?.allowedRoots ?? [];
112
+ const realRoot = await canonicalize(path.resolve(root));
113
+ let real;
114
+ try {
115
+ real = await canonicalize(path.resolve(realRoot, p));
116
+ }
117
+ catch (err) {
118
+ throw new ToolError(fsErrorMessage(err, `path ${JSON.stringify(p)}`));
119
+ }
120
+ if (isWithin(realRoot, real) || (await containingRoot(allowedRoots, real)) !== undefined) {
121
+ return real;
122
+ }
123
+ const permitted = allowedRoots.length ?
124
+ "the session's working directory and its other permitted directories"
125
+ : "the session's working directory";
126
+ throw new ToolError(`path ${JSON.stringify(p)} is outside ${permitted}`);
127
+ }
128
+ /**
129
+ * Atomically write `content` to `targetPath`: write a sibling temp file, fsync
130
+ * it, then rename over the target. The rename is atomic on most filesystems, so
131
+ * a crash mid-write never leaves the target half-written.
132
+ */
133
+ export async function atomicWriteFile(targetPath, content) {
134
+ const dir = path.dirname(targetPath);
135
+ const tempPath = path.join(dir, `.tmp-${process.pid}-${crypto.randomUUID()}`);
136
+ let handle;
137
+ try {
138
+ handle = await fs.open(tempPath, 'wx', FILE_CREATE_MODE);
139
+ await handle.writeFile(content, 'utf-8');
140
+ await handle.sync();
141
+ await handle.close();
142
+ handle = undefined;
143
+ await fs.rename(tempPath, targetPath);
144
+ }
145
+ catch (err) {
146
+ if (handle)
147
+ await handle.close().catch(() => { });
148
+ await fs.unlink(tempPath).catch(() => { });
149
+ throw err;
150
+ }
151
+ }
152
+ /**
153
+ * Map a thrown filesystem error to a consistent, language-independent message,
154
+ * so the model sees the same wording regardless of the runtime (Node's raw
155
+ * `ENOENT: no such file...` text would otherwise leak through). Codes we don't
156
+ * special-case render as the bare code, never Node's message, which embeds the
157
+ * host's absolute path.
158
+ */
159
+ export function fsErrorMessage(err, file) {
160
+ const code = errnoCode(err);
161
+ switch (code) {
162
+ case 'ENOENT':
163
+ return `${file}: no such file or directory`;
164
+ case 'EACCES':
165
+ case 'EPERM':
166
+ return `${file}: permission denied`;
167
+ case 'ENOTDIR':
168
+ return `${file}: not a directory`;
169
+ case 'EISDIR':
170
+ return `${file}: is a directory`;
171
+ case 'ELOOP':
172
+ return `${file}: too many levels of symbolic links`;
173
+ case 'ENAMETOOLONG':
174
+ return `${file}: file name too long`;
175
+ case 'ENOSPC':
176
+ return `${file}: no space left on device`;
177
+ case 'EMFILE':
178
+ case 'ENFILE':
179
+ return `${file}: too many open files`;
180
+ default:
181
+ return `${file}: ${code !== undefined ? `i/o error (${code})` : 'i/o error'}`;
182
+ }
183
+ }
184
+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AE,CAAC;QACb,KAAK,QAAQ;YACX,OAAO,GAAG,IAAI,6BAA6B,CAAC;QAC9C,KAAK,QAAQ,CAAC;QACd,KAAK,OAAO;YACV,OAAO,GAAG,IAAI,qBAAqB,CAAC;QACtC,KAAK,SAAS;YACZ,OAAO,GAAG,IAAI,mBAAmB,CAAC;QACpC,KAAK,QAAQ;YACX,OAAO,GAAG,IAAI,kBAAkB,CAAC;QACnC,KAAK,OAAO;YACV,OAAO,GAAG,IAAI,qCAAqC,CAAC;QACtD,KAAK,cAAc;YACjB,OAAO,GAAG,IAAI,sBAAsB,CAAC;QACvC,KAAK,QAAQ;YACX,OAAO,GAAG,IAAI,2BAA2B,CAAC;QAC5C,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,GAAG,IAAI,uBAAuB,CAAC;QACxC;YACE,OAAO,GAAG,IAAI,KAAK,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,IAAI,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IAClF,CAAC;AACH,CAAC"}
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Session-level memory-store download and sync.
3
+ *
4
+ * A session may have several memory stores attached. This module resolves
5
+ * where each store's folder goes on disk, opens a {@link LocalFileStore}
6
+ * there, and reconciles each folder with its remote store — the merge rules
7
+ * live on {@link SessionMemoryStores}.
8
+ *
9
+ * Node-only (it sits on the filesystem-backed FileStore); like `skills.ts`,
10
+ * it is reachable through the shimmed `node.ts` entry point.
11
+ */
12
+ import type { PukuAI } from '../../client';
13
+ import { PukuError } from '../../core/error';
14
+ import type { BetaManagedAgentsSession } from '../../resources/beta/sessions/sessions';
15
+ export { DEFAULT_MEMORY_SYNC_INTERVAL_MS, MIN_MEMORY_SYNC_INTERVAL_MS } from './sync-interval';
16
+ /**
17
+ * Whether a locally deleted file may delete its memory on the server:
18
+ * `"enabled"` sends the delete, `"log_only"` runs the checks but only logs,
19
+ * `"disabled"` never deletes.
20
+ */
21
+ export type MemoryDeleteMode = 'enabled' | 'log_only' | 'disabled';
22
+ /**
23
+ * Time bound the worker puts on each teardown pass — the final
24
+ * {@link SessionMemoryStores.finish}, then {@link SessionMemoryStores.flushWrites} —
25
+ * so a slow server cannot stall teardown.
26
+ */
27
+ export declare const MEMORY_FLUSH_TIMEOUT_MS = 30000;
28
+ /**
29
+ * Marker file stamped into every store folder; a sync trusts the folder only
30
+ * when it matches. Never itself syncs.
31
+ */
32
+ export declare const MARKER_PATH = ".puku-memory-store";
33
+ /** How long a file must stay missing locally before its server delete goes out. */
34
+ export declare const DELETE_CORROBORATION_MS = 30000;
35
+ /**
36
+ * How many uploads one store's flush keeps in flight. At ~0.3s per upload,
37
+ * 32 clears the server's 2000-memories-per-store cap inside
38
+ * {@link MEMORY_FLUSH_TIMEOUT_MS}.
39
+ */
40
+ export declare const UPLOAD_CONCURRENCY = 32;
41
+ /**
42
+ * A session's memory stores could not be mounted.
43
+ *
44
+ * Thrown by {@link SessionMemoryStores.download} when a store cannot be
45
+ * materialised on disk, and by the environment worker when a work item for a
46
+ * session that has memory stores carried no sessions token to reach them with.
47
+ */
48
+ export declare class SessionMemoryError extends PukuError {
49
+ constructor(message: string, cause?: unknown);
50
+ }
51
+ export interface SessionMemoryStoresOptions {
52
+ /** Base directory for the `{workdir}/memory/<name>` fallback store location. */
53
+ workdir: string;
54
+ /**
55
+ * How often (milliseconds) {@link SessionMemoryStores.syncIfDue} actually
56
+ * syncs. Defaults to {@link DEFAULT_MEMORY_SYNC_INTERVAL_MS} (15s); values
57
+ * below {@link MIN_MEMORY_SYNC_INTERVAL_MS} (5s) are rejected.
58
+ */
59
+ syncIntervalMs?: number;
60
+ /** See {@link MemoryDeleteMode}. Defaults to `"enabled"`. */
61
+ syncDeletions?: MemoryDeleteMode;
62
+ }
63
+ /**
64
+ * The memory stores attached to one session, materialised on disk.
65
+ *
66
+ * {@link SessionMemoryStores.download} opens a {@link LocalFileStore} at each
67
+ * attached store's directory (its `mount_path`, or a workdir fallback — see
68
+ * {@link SessionMemoryStores.download}), pulls its memories, and records each
69
+ * one's `content_sha256` as the sync baseline. Each sync
70
+ * ({@link SessionMemoryStores.syncIfDue} on the worker's cadence,
71
+ * {@link SessionMemoryStores.finish} once at the end) reconciles disk against
72
+ * server, per store and per path:
73
+ *
74
+ * - a memory changed only remotely is written to disk;
75
+ * - a file changed only locally is uploaded — an update with a
76
+ * `content_sha256` precondition, or a create for a new file;
77
+ * - a file changed on both sides logs a warning and takes the server version;
78
+ * - a file the server refuses (too large, invalid content) is skipped —
79
+ * warned once and retried only after the file changes; other files keep
80
+ * syncing;
81
+ * - a file deleted locally is deleted on the server after a delay and a
82
+ * re-check — never on the first sync that notices, and only up to a
83
+ * per-sync cap. `syncDeletions` gates it;
84
+ * - a memory deleted on the server is deleted on disk — unless the local
85
+ * file holds un-pushed edits: a writable store re-creates the memory
86
+ * from the file, a read-only one keeps the file unsynced;
87
+ * - a store attached read-only pulls but never pushes.
88
+ *
89
+ * A download pulls the whole store, so it lists with content included. The
90
+ * recurring syncs instead run two phases: a content-free listing (paths and
91
+ * shas) drives the merge decisions, then only the memories actually being
92
+ * written to disk are fetched, a bounded number at a time. A sync that finds
93
+ * nothing changed moves no content at all.
94
+ *
95
+ * A file whose write to disk failed is never in the baseline, so its absence
96
+ * reads as a failed download — it is pulled again, never deleted. A write
97
+ * never re-creates a store folder that vanished mid-sync: it fails, and the
98
+ * next sync's scan finds whatever is at the path by then — nothing
99
+ * (re-downloaded) or someone else's files (left alone) — under the rules
100
+ * below.
101
+ *
102
+ * A store folder that loses its {@link MARKER_PATH} marker, is emptied,
103
+ * or vanishes is re-downloaded rather than treated as a mass local
104
+ * delete; a folder whose marker names another store is left as found —
105
+ * nothing pushed, nothing deleted.
106
+ *
107
+ * Two things about the store's directory make
108
+ * {@link SessionMemoryStores.download} refuse the session outright, with
109
+ * {@link SessionMemoryError}: a `mount_path` that is not a clean absolute
110
+ * path, and a directory already sitting at that path.
111
+ *
112
+ * {@link SessionMemoryStores.download} throws on the first store it cannot
113
+ * materialise. The syncs never throw: mid-session, one bad store or one bad
114
+ * file is logged and the rest continue. Instances are not safe for concurrent
115
+ * use. The worker builds one on its token-scoped sub-client (the memory
116
+ * endpoints reject the environment key): `syncIfDue` after each tool call,
117
+ * `finish` once at a clean end, a bounded {@link SessionMemoryStores.flushWrites}
118
+ * in every teardown, `dispose` last.
119
+ */
120
+ export declare class SessionMemoryStores {
121
+ #private;
122
+ constructor(client: PukuAI, opts: SessionMemoryStoresOptions);
123
+ /**
124
+ * Every attached store's root directory.
125
+ *
126
+ * The worker lists these as the file tools' allowed roots so a store
127
+ * mounted outside the workdir stays reachable.
128
+ */
129
+ get roots(): string[];
130
+ /**
131
+ * Root directories of stores attached read-only.
132
+ *
133
+ * The file tools consult this to refuse writes into read-only stores.
134
+ */
135
+ get readOnlyRoots(): string[];
136
+ /**
137
+ * Download every attached store's memories to disk.
138
+ *
139
+ * `session` arrives already fetched — one snapshot shared with the skills
140
+ * download, so the two cannot disagree about the resources.
141
+ */
142
+ download(session: BetaManagedAgentsSession): Promise<void>;
143
+ /**
144
+ * The session's last sync — skips the delete wait, so calling it twice
145
+ * would undo the protection; it throws instead.
146
+ */
147
+ finish(): Promise<void>;
148
+ /** @internal — reconcile every store once; the tests' deterministic driver */
149
+ syncAll(final: boolean): Promise<void>;
150
+ /** Sync when `syncIntervalMs` has elapsed since the last one. Never throws. */
151
+ syncIfDue(): Promise<void>;
152
+ /**
153
+ * Upload new and changed files; send no deletes and pull nothing.
154
+ *
155
+ * The push-only rescue pass for a session ending on an error or
156
+ * cancel — best-effort, bounded by the caller: once `signal` aborts no
157
+ * further upload starts, each store cut off part-way logs how many
158
+ * changed files it had not finished uploading, and this resolves without
159
+ * waiting for requests already in flight. Each store uploads up to
160
+ * {@link UPLOAD_CONCURRENCY} files at a time. Skips read-only stores,
161
+ * refused files, files the server already holds, and folders that fail
162
+ * the marker check. Never throws.
163
+ */
164
+ flushWrites(signal?: AbortSignal): Promise<void>;
165
+ /**
166
+ * Remove every store directory that {@link SessionMemoryStores.download}
167
+ * created. Pre-existing directories are left alone — that is
168
+ * {@link FileStore.dispose}'s own rule. A folder that fails the marker
169
+ * check is kept too — sync left it as found, so must dispose.
170
+ */
171
+ dispose(): Promise<void>;
172
+ }