@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,529 @@
1
+ /**
2
+ * `FileStore` — one confined folder; a relative path cannot escape it.
3
+ *
4
+ * Beta scope: symlinks are refused or skipped wherever the store meets them,
5
+ * but there is no hardening against a process racing the store's own
6
+ * syscalls; fsync durability, non-POSIX hosts, and read-size caps are out of
7
+ * scope.
8
+ */
9
+ import { crypto, fs, path } from './node.js';
10
+ import { encodeUTF8 } from './utils/bytes.js';
11
+ const fsp = fs.promises;
12
+ const C = fs.constants;
13
+ // Owner-only regardless of umask: the store holds downloaded user/model content.
14
+ const OWNER_ONLY_DIR_MODE = 0o700;
15
+ const OWNER_ONLY_FILE_MODE = 0o600;
16
+ const OWNER_ONLY_EXEC_MODE = 0o700;
17
+ // 0 where the platform lacks them; `open` refuses such platforms.
18
+ const O_NOFOLLOW = C.O_NOFOLLOW ?? 0;
19
+ const O_NONBLOCK = C.O_NONBLOCK ?? 0;
20
+ /** A refused operation — input the store will not act on. OS errors propagate with their `.code`. */
21
+ export class FileStoreError extends Error {
22
+ static ESCAPES_ROOT = 'escapes the store root';
23
+ static IS_A_SYMLINK = 'is a symlink';
24
+ static NOT_A_FILE = 'is not a regular file';
25
+ static NOT_A_DIRECTORY = 'is not a directory';
26
+ static NOT_UTF8 = 'is not valid utf-8';
27
+ static MOVE_DESTINATION_EXISTS = 'already exists';
28
+ reason;
29
+ relPath;
30
+ constructor(reason, relPath) {
31
+ super(`path ${JSON.stringify(relPath)} ${reason}`);
32
+ this.name = 'FileStoreError';
33
+ this.reason = reason;
34
+ this.relPath = relPath;
35
+ }
36
+ }
37
+ /** Resolve `root`; creates nothing — only {@link FileStore.createRoot} makes the folder. */
38
+ export async function openFileStore(root, opts) {
39
+ return FileStore.open(root, opts);
40
+ }
41
+ /**
42
+ * True for a path usable verbatim as a store location: absolute, with no `..`
43
+ * components. Paths are judged in POSIX terms — they are wire values naming
44
+ * locations inside a POSIX container, not host-native paths.
45
+ */
46
+ export function isPathLegal(p) {
47
+ return p.startsWith('/') && !p.split('/').includes('..');
48
+ }
49
+ /**
50
+ * One confined folder of regular files.
51
+ *
52
+ * Every `relPath` is relative to the root (a leading `/` also means the root)
53
+ * and refused with {@link FileStoreError} when it escapes. The store holds
54
+ * regular files only: symlinks are refused on read and skipped by listings —
55
+ * {@link findSymlinks} reports them. A `relPath` resolving to the root itself
56
+ * is banned by this interface: `put` and `get` refuse it, `move` and `remove`
57
+ * do nothing. A store opened with `utf8: true` refuses binary content the
58
+ * same way — on `put` of such bytes and on `get` of such a file. Only
59
+ * {@link createRoot} makes the root: writes create directories below it,
60
+ * never the root itself, so a root removed while the store is open stays
61
+ * removed and the write fails with `ENOENT`.
62
+ */
63
+ export class FileStore {
64
+ rootPath;
65
+ /** True ⇒ this open created the root, so {@link dispose} removes it. */
66
+ removedOnDispose;
67
+ /** Set iff the store refuses non-UTF-8 content; {@link requireUtf8} decodes against it, on both put and get. */
68
+ decoder;
69
+ /** `hashtree`'s advisory cache; every hit re-validates against a fresh stat. */
70
+ hashes = new Map();
71
+ static isPathLegal = isPathLegal;
72
+ /** @internal — use {@link FileStore.open} / {@link openFileStore}. */
73
+ constructor(root, removedOnDispose, utf8Only = false) {
74
+ this.rootPath = root;
75
+ this.removedOnDispose = removedOnDispose;
76
+ this.decoder = utf8Only ? new TextDecoder('utf-8', { fatal: true }) : undefined;
77
+ }
78
+ /** Resolve `root`; creates nothing — only {@link createRoot} makes the folder. */
79
+ static async open(root, opts) {
80
+ // A deployment condition, not refused caller input — hence not FileStoreError.
81
+ if (!platformSupported()) {
82
+ throw new Error('FileStore requires O_NOFOLLOW support on this platform');
83
+ }
84
+ let removedOnDispose = false;
85
+ try {
86
+ // lstat, not a follow-and-swallow existence check: following symlinks or
87
+ // swallowing permission errors would mark a real directory ours to
88
+ // delete on dispose.
89
+ await fsp.lstat(root);
90
+ }
91
+ catch (e) {
92
+ if (e.code !== 'ENOENT')
93
+ throw e;
94
+ removedOnDispose = true;
95
+ }
96
+ return new FileStore(path.resolve(root), removedOnDispose, opts?.utf8 ?? false);
97
+ }
98
+ /** Create the root directory and any missing ancestors; already existing is fine. */
99
+ async createRoot() {
100
+ await makeDirAndAncestors(this.rootPath);
101
+ }
102
+ /** The resolved root, and what {@link dispose} will do to it. */
103
+ root() {
104
+ return { path: this.rootPath, removedOnDispose: this.removedOnDispose };
105
+ }
106
+ /**
107
+ * Remove the root iff `open` created it; pre-existing roots are kept.
108
+ *
109
+ * Wired to `Symbol.asyncDispose` at runtime when the host provides it, so
110
+ * `await using` works on engines with explicit resource management.
111
+ */
112
+ async dispose() {
113
+ if (!this.removedOnDispose)
114
+ return;
115
+ await fsp.rm(this.rootPath, { recursive: true, force: true });
116
+ }
117
+ /**
118
+ * Write `data` (`string` UTF-8 or bytes) atomically to the file at `relPath`.
119
+ *
120
+ * Missing directories below the root are created; a missing root is not —
121
+ * the write fails with `ENOENT`.
122
+ */
123
+ async put(relPath, data, opts) {
124
+ // "dir/." names a directory just like a trailing "/".
125
+ const tail = relPath.replace(/\\/g, '/');
126
+ if (tail.endsWith('/') || tail.endsWith('/.') || tail === '' || tail === '.') {
127
+ throw new FileStoreError(FileStoreError.NOT_A_FILE, relPath);
128
+ }
129
+ const dest = this.resolveUnderRoot(relPath);
130
+ const payload = typeof data === 'string' ? encodeUTF8(data) : data;
131
+ this.requireUtf8(relPath, payload);
132
+ await makeDirsBelowRoot(this.rootPath, path.dirname(dest));
133
+ await replaceViaTemp(dest, payload, opts?.executable ?? false);
134
+ }
135
+ /** The file's bytes; `null` when absent. */
136
+ async get(relPath) {
137
+ const dest = this.resolveUnderRoot(relPath);
138
+ let handle;
139
+ try {
140
+ handle = await openRegularFile(relPath, dest);
141
+ }
142
+ catch (e) {
143
+ if (e.code === 'ENOENT')
144
+ return null;
145
+ throw e;
146
+ }
147
+ let data;
148
+ try {
149
+ const buf = await handle.readFile();
150
+ data = new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
151
+ }
152
+ finally {
153
+ await handle.close();
154
+ }
155
+ this.requireUtf8(relPath, data);
156
+ return data;
157
+ }
158
+ /** The relative path of every file under the directory `under`. */
159
+ async ls(under = '/') {
160
+ const base = this.resolveUnderRoot(under);
161
+ return new Set((await filenamesInDir(this.rootPath, under, base)).map(([rel]) => rel));
162
+ }
163
+ /**
164
+ * Every symlink under `under` — listings skip them and reads refuse them,
165
+ * so a caller that must know they exist asks here.
166
+ */
167
+ async findSymlinks(under = '/') {
168
+ const base = this.resolveUnderRoot(under);
169
+ return symlinksInDir(this.rootPath, under, base);
170
+ }
171
+ /**
172
+ * `{relPath: sha256Hex}` of every file under the directory `under`.
173
+ *
174
+ * Unchanged files — same size, mtime, and ctime since the last call —
175
+ * reuse their recorded hash instead of being re-read.
176
+ */
177
+ async hashtree(under = '/') {
178
+ const base = this.resolveUnderRoot(under);
179
+ const walkStartNs = _internals.nowNs();
180
+ // Null prototype so a file named `__proto__` (or `constructor`) is an
181
+ // ordinary own key instead of a silent prototype write / inherited read.
182
+ const out = Object.create(null);
183
+ for (const [rel, full] of await filenamesInDir(this.rootPath, under, base)) {
184
+ const sha = await this.hashViaCache(rel, full, walkStartNs);
185
+ if (sha !== null)
186
+ out[rel] = sha;
187
+ }
188
+ return out;
189
+ }
190
+ /** One file's sha256; `null` when absent. Shares {@link hashtree}'s cache. */
191
+ async hashFile(relPath) {
192
+ const dest = this.resolveUnderRoot(relPath);
193
+ let st;
194
+ try {
195
+ st = await fsp.lstat(dest, { bigint: true });
196
+ }
197
+ catch (e) {
198
+ if (e.code === 'ENOENT')
199
+ return null;
200
+ throw e;
201
+ }
202
+ if (st.isSymbolicLink())
203
+ throw new FileStoreError(FileStoreError.IS_A_SYMLINK, relPath);
204
+ if (!st.isFile())
205
+ throw new FileStoreError(FileStoreError.NOT_A_FILE, relPath);
206
+ const rel = path.relative(this.rootPath, dest).split(path.sep).join('/');
207
+ return this.hashViaCache(rel, dest, _internals.nowNs());
208
+ }
209
+ /**
210
+ * Rename `src` to `dst`; an existing `dst` is refused. The banned store
211
+ * root as either end does nothing.
212
+ */
213
+ async move(src, dst) {
214
+ const s = this.resolveUnderRoot(src);
215
+ const d = this.resolveUnderRoot(dst);
216
+ if (s === this.rootPath || d === this.rootPath)
217
+ return;
218
+ // stat, not lstat: a dangling symlink at dst reads as absent and is
219
+ // atomically replaced by the rename, like any other rename target.
220
+ const dstExists = await fsp.stat(d).then(() => true, () => false);
221
+ if (dstExists)
222
+ throw new FileStoreError(FileStoreError.MOVE_DESTINATION_EXISTS, dst);
223
+ await makeDirsBelowRoot(this.rootPath, path.dirname(d));
224
+ await fsp.rename(s, d);
225
+ }
226
+ /** Delete a file or subtree; absent — and the banned store root — do nothing. */
227
+ async remove(relPath) {
228
+ const dest = this.resolveUnderRoot(relPath);
229
+ if (dest === this.rootPath)
230
+ return;
231
+ let st;
232
+ try {
233
+ // lstat: a dangling symlink must still be unlinked.
234
+ st = await fsp.lstat(dest, { bigint: true });
235
+ }
236
+ catch (e) {
237
+ if (e.code === 'ENOENT')
238
+ return;
239
+ throw e;
240
+ }
241
+ if (st.isDirectory()) {
242
+ await fsp.rm(dest, { recursive: true, force: true });
243
+ }
244
+ else {
245
+ try {
246
+ await fsp.unlink(dest);
247
+ }
248
+ catch (e) {
249
+ if (e.code !== 'ENOENT')
250
+ throw e;
251
+ }
252
+ }
253
+ }
254
+ resolveUnderRoot(relPath) {
255
+ const norm = relPath.replace(/\\/g, '/').replace(/^\/+/, '');
256
+ const parts = norm.split('/').filter((p) => p !== '' && p !== '.');
257
+ if (path.posix.isAbsolute(norm) || parts.includes('..')) {
258
+ throw new FileStoreError(FileStoreError.ESCAPES_ROOT, relPath);
259
+ }
260
+ return parts.length === 0 ? this.rootPath : path.join(this.rootPath, ...parts);
261
+ }
262
+ requireUtf8(relPath, data) {
263
+ if (!this.decoder)
264
+ return;
265
+ try {
266
+ this.decoder.decode(data);
267
+ }
268
+ catch {
269
+ throw new FileStoreError(FileStoreError.NOT_UTF8, relPath);
270
+ }
271
+ }
272
+ async hashViaCache(rel, full, walkStartNs) {
273
+ let st;
274
+ try {
275
+ st = await fsp.lstat(full, { bigint: true });
276
+ }
277
+ catch (e) {
278
+ if (e.code === 'ENOENT')
279
+ return null; // vanished since the walk: not in this snapshot
280
+ throw e;
281
+ }
282
+ if (!st.isFile())
283
+ return null;
284
+ const cached = this.hashes.get(rel);
285
+ let sha;
286
+ if (cached !== undefined && unchangedSinceHashed(cached, st)) {
287
+ sha = cached.sha;
288
+ }
289
+ else {
290
+ try {
291
+ sha = await _internals.hashFile(full);
292
+ }
293
+ catch (e) {
294
+ const code = e.code;
295
+ if (code === 'ENOENT' || e instanceof FileStoreError)
296
+ return null;
297
+ // FreeBSD reports EMLINK rather than ELOOP for O_NOFOLLOW.
298
+ if (code === 'ELOOP' || code === 'EMLINK')
299
+ return null;
300
+ throw e;
301
+ }
302
+ }
303
+ if (oldEnoughToCache(st, walkStartNs)) {
304
+ this.hashes.set(rel, { mtimeNs: st.mtimeNs, ctimeNs: st.ctimeNs, size: st.size, sha });
305
+ }
306
+ return sha;
307
+ }
308
+ }
309
+ function platformSupported() {
310
+ return O_NOFOLLOW !== 0;
311
+ }
312
+ async function makeDirAndAncestors(dir) {
313
+ const missing = [];
314
+ let current = dir;
315
+ for (;;) {
316
+ try {
317
+ await fsp.stat(current);
318
+ break;
319
+ }
320
+ catch (e) {
321
+ const code = e.code;
322
+ if (code !== 'ENOENT' && code !== 'ENOTDIR' && code !== 'ELOOP')
323
+ throw e;
324
+ }
325
+ missing.push(current);
326
+ const parent = path.dirname(current);
327
+ if (parent === current)
328
+ break;
329
+ current = parent;
330
+ }
331
+ for (const directory of missing.reverse()) {
332
+ try {
333
+ await fsp.mkdir(directory, { mode: OWNER_ONLY_DIR_MODE });
334
+ }
335
+ catch (e) {
336
+ if (e.code !== 'EEXIST')
337
+ throw e;
338
+ }
339
+ }
340
+ }
341
+ async function makeDirsBelowRoot(root, dir) {
342
+ // Never the root itself: only createRoot() makes it, so a write racing an
343
+ // rm -rf of the folder fails with ENOENT instead of re-creating it.
344
+ const below = path.relative(root, dir);
345
+ if (below === '')
346
+ return;
347
+ let current = root;
348
+ for (const part of below.split(path.sep)) {
349
+ current = path.join(current, part);
350
+ try {
351
+ await fsp.mkdir(current, { mode: OWNER_ONLY_DIR_MODE });
352
+ }
353
+ catch (e) {
354
+ if (e.code !== 'EEXIST')
355
+ throw e;
356
+ }
357
+ }
358
+ }
359
+ async function replaceViaTemp(dest, data, isExecutable) {
360
+ const mode = isExecutable ? OWNER_ONLY_EXEC_MODE : OWNER_ONLY_FILE_MODE;
361
+ const tmp = path.join(path.dirname(dest), `.fs-${crypto.randomBytes(8).toString('hex')}.tmp`);
362
+ let handle;
363
+ try {
364
+ handle = await fsp.open(tmp, C.O_WRONLY | C.O_CREAT | C.O_EXCL | O_NOFOLLOW, mode);
365
+ await handle.writeFile(data);
366
+ await handle.close();
367
+ handle = undefined;
368
+ await fsp.rename(tmp, dest);
369
+ }
370
+ catch (err) {
371
+ // Best-effort temp cleanup; never mask the original error.
372
+ if (handle)
373
+ await handle.close().catch(() => { });
374
+ await fsp.unlink(tmp).catch(() => { });
375
+ throw err;
376
+ }
377
+ }
378
+ async function openRegularFile(relPath, dest) {
379
+ // O_NONBLOCK: a FIFO fails the fstat check below instead of blocking the open.
380
+ let handle;
381
+ try {
382
+ handle = await fsp.open(dest, C.O_RDONLY | O_NOFOLLOW | O_NONBLOCK);
383
+ }
384
+ catch (e) {
385
+ // FreeBSD reports EMLINK rather than ELOOP for O_NOFOLLOW.
386
+ const code = e.code;
387
+ if (code === 'ELOOP' || code === 'EMLINK') {
388
+ throw new FileStoreError(FileStoreError.IS_A_SYMLINK, relPath);
389
+ }
390
+ throw e;
391
+ }
392
+ try {
393
+ const st = await handle.stat();
394
+ if (!st.isFile())
395
+ throw new FileStoreError(FileStoreError.NOT_A_FILE, relPath);
396
+ }
397
+ catch (e) {
398
+ await handle.close().catch(() => { });
399
+ throw e;
400
+ }
401
+ return handle;
402
+ }
403
+ /** sha256 of a file's contents, streamed — constant memory on any file size. */
404
+ async function hashFile(full) {
405
+ const digest = crypto.createHash('sha256');
406
+ const handle = await openRegularFile(path.basename(full), full);
407
+ const buf = new Uint8Array(1024 * 1024);
408
+ try {
409
+ for (;;) {
410
+ const { bytesRead } = await handle.read(buf, 0, buf.length);
411
+ if (bytesRead === 0)
412
+ break;
413
+ digest.update(buf.subarray(0, bytesRead));
414
+ }
415
+ }
416
+ finally {
417
+ await handle.close();
418
+ }
419
+ return digest.digest('hex');
420
+ }
421
+ /**
422
+ * `[rel, path]` for every regular file under the directory `base`; an absent
423
+ * `base` is empty, a present non-directory is refused. The walk never
424
+ * descends symlinked directories.
425
+ */
426
+ async function filenamesInDir(root, under, base) {
427
+ if (!(await requireDir(under, base)))
428
+ return [];
429
+ const out = [];
430
+ await walk(base, (full, entry) => {
431
+ if (entry.isFile())
432
+ out.push([path.relative(root, full).split(path.sep).join('/'), full]);
433
+ });
434
+ out.sort();
435
+ return out;
436
+ }
437
+ async function symlinksInDir(root, under, base) {
438
+ const relOf = (full) => path.relative(root, full).split(path.sep).join('/');
439
+ let st;
440
+ try {
441
+ st = await fsp.lstat(base, { bigint: true });
442
+ }
443
+ catch (e) {
444
+ const code = e.code;
445
+ if (code === 'ENOENT' || code === 'ENOTDIR')
446
+ return new Set();
447
+ throw e;
448
+ }
449
+ if (st.isSymbolicLink())
450
+ return new Set([relOf(base)]);
451
+ if (!st.isDirectory())
452
+ throw new FileStoreError(FileStoreError.NOT_A_DIRECTORY, under);
453
+ const out = new Set();
454
+ // Symlinks to directories are reported, never descended, like the rest.
455
+ await walk(base, (full, entry) => {
456
+ if (entry.isSymbolicLink())
457
+ out.add(relOf(full));
458
+ });
459
+ return out;
460
+ }
461
+ /** `false` when `base` is absent, refused when present but not a directory. */
462
+ async function requireDir(under, base) {
463
+ let st;
464
+ try {
465
+ st = await fsp.lstat(base, { bigint: true });
466
+ }
467
+ catch (e) {
468
+ // Absent — including "under a file" (ENOTDIR) — is an empty listing.
469
+ const code = e.code;
470
+ if (code === 'ENOENT' || code === 'ENOTDIR')
471
+ return false;
472
+ throw e;
473
+ }
474
+ if (!st.isDirectory())
475
+ throw new FileStoreError(FileStoreError.NOT_A_DIRECTORY, under);
476
+ return true;
477
+ }
478
+ /** Visit every entry under `base` without descending symlinked directories. */
479
+ async function walk(base, visit) {
480
+ const stack = [base];
481
+ while (stack.length) {
482
+ const dir = stack.pop();
483
+ let entries;
484
+ try {
485
+ entries = await fsp.readdir(dir, { withFileTypes: true });
486
+ }
487
+ catch (e) {
488
+ if (e.code === 'ENOENT')
489
+ continue; // a listing is a snapshot, not a lock
490
+ throw e;
491
+ }
492
+ for (const entry of entries) {
493
+ const full = path.join(dir, entry.name);
494
+ visit(full, entry);
495
+ if (entry.isDirectory() && !entry.isSymbolicLink())
496
+ stack.push(full);
497
+ }
498
+ }
499
+ }
500
+ function unchangedSinceHashed(cached, st) {
501
+ return st.mtimeNs === cached.mtimeNs && st.ctimeNs === cached.ctimeNs && st.size === cached.size;
502
+ }
503
+ function oldEnoughToCache(st, walkStartNs) {
504
+ const newestNs = st.mtimeNs > st.ctimeNs ? st.mtimeNs : st.ctimeNs;
505
+ return newestNs < walkStartNs - _internals.timestampTrustMarginNs;
506
+ }
507
+ // Filesystems stamp times with coarse clocks, so a rewrite shortly after a
508
+ // hashed write can reuse the exact stamps. Files younger than the margin are
509
+ // simply re-hashed next walk.
510
+ const TIMESTAMP_TRUST_MARGIN_NS = 2000000000n;
511
+ /** Test seam — the hasher, the trust margin, and the walk clock. @internal */
512
+ export const _internals = {
513
+ hashFile,
514
+ timestampTrustMarginNs: TIMESTAMP_TRUST_MARGIN_NS,
515
+ nowNs: () => BigInt(Date.now()) * 1000000n,
516
+ };
517
+ export const LocalFileStore = FileStore;
518
+ // Wire `Symbol.asyncDispose` at runtime when the host provides it — the
519
+ // repo's tsconfig targets ES2020 so the type-level `AsyncDisposable` lib is
520
+ // not available, but `await using` callers on newer engines still work.
521
+ const asyncDispose = Symbol.asyncDispose;
522
+ if (asyncDispose) {
523
+ Object.defineProperty(FileStore.prototype, asyncDispose, {
524
+ value: FileStore.prototype.dispose,
525
+ configurable: true,
526
+ writable: true,
527
+ });
528
+ }
529
+ //# sourceMappingURL=file-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-store.js","sourceRoot":"","sources":["../../../src/vendor/internal/file-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC;AACxB,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC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,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC;IACnE,OAAO,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAC,sBAAsB,CAAC;AACpE,CAAC;AAED,2EAA2E;AAC3E,6EAA6E;AAC7E,8BAA8B;AAC9B,MAAM,yBAAyB,GAAG,WAAc,CAAC;AAEjD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ;IACR,sBAAsB,EAAE,yBAAyB;IACjD,KAAK,EAAE,GAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,QAAU;CACrD,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,CAAC;AAExC,wEAAwE;AACxE,4EAA4E;AAC5E,wEAAwE;AACxE,MAAM,YAAY,GAAI,MAAoC,CAAC,YAAY,CAAC;AACxE,IAAI,YAAY,EAAE,CAAC;IACjB,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,SAAS,EAAE,YAAY,EAAE;QACvD,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,OAAO;QAClC,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,28 @@
1
+ type HeaderValue = string | undefined | null;
2
+ export type HeadersLike = Headers | readonly HeaderValue[][] | Record<string, HeaderValue | readonly HeaderValue[]> | undefined | null | NullableHeaders;
3
+ declare const brand_privateNullableHeaders: symbol & {
4
+ description: "brand.privateNullableHeaders";
5
+ };
6
+ /**
7
+ * @internal
8
+ * Users can pass explicit nulls to unset default headers. When we parse them
9
+ * into a standard headers type we need to preserve that information.
10
+ */
11
+ export type NullableHeaders = {
12
+ /** Brand check, prevent users from creating a NullableHeaders. */
13
+ [_: typeof brand_privateNullableHeaders]: true;
14
+ /** Parsed headers. */
15
+ values: Headers;
16
+ /** Set of lowercase header names explicitly set to null. */
17
+ nulls: Set<string>;
18
+ };
19
+ /**
20
+ * Headers whose values accumulate across {@link buildHeaders} sources instead
21
+ * of the later source's value replacing the earlier one. Values are
22
+ * comma-appended (deduplicated, order-preserving) into a single header line.
23
+ */
24
+ export declare const APPEND_HEADERS: ReadonlySet<string>;
25
+ export declare const appendHeaderValue: (existing: string | null, addition: string) => string;
26
+ export declare const buildHeaders: (newHeaders: HeadersLike[]) => NullableHeaders;
27
+ export declare const isEmptyHeaders: (headers: HeadersLike) => boolean;
28
+ export {};