@visulima/storage 1.0.9 → 1.0.11

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 (174) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/adapter/nuxt/module.d.ts +9 -8
  3. package/dist/ai/ai-sdk/index.d.ts +52 -59
  4. package/dist/ai/claude/index.d.ts +105 -119
  5. package/dist/ai/openai/index.d.ts +87 -99
  6. package/dist/ai/tanstack/index.d.ts +54 -61
  7. package/dist/handler/http/fetch/index.d.ts +202 -201
  8. package/dist/handler/http/fetch/index.js +1 -1
  9. package/dist/handler/http/hono/index.d.ts +60 -59
  10. package/dist/handler/http/hono/index.js +1 -1
  11. package/dist/handler/http/nextjs/index.d.ts +55 -54
  12. package/dist/handler/http/nextjs/index.js +1 -1
  13. package/dist/handler/http/node/index.d.ts +234 -246
  14. package/dist/handler/http/node/index.js +1 -1
  15. package/dist/handler/http/solid-start/index.d.ts +55 -54
  16. package/dist/handler/http/solid-start/index.js +1 -1
  17. package/dist/index.d.ts +71 -70
  18. package/dist/index.js +1 -1
  19. package/dist/packem_shared/{AbstractBaseStorage-CiPEMcuo.js → AbstractBaseStorage-CLsYmMZg.js} +1 -1
  20. package/dist/packem_shared/AwsLightStorage-DGSPFUqr.js +1 -0
  21. package/dist/packem_shared/AzureStorage-DvKk_hhz.js +1 -0
  22. package/dist/packem_shared/BoxMetaStorage-CJsyeQ63.js +1 -0
  23. package/dist/packem_shared/{BoxStorage-DbGqBLux.js → BoxStorage-CmM95wi2.js} +1 -1
  24. package/dist/packem_shared/BunS3MetaStorage-CJsyeQ63.js +1 -0
  25. package/dist/packem_shared/{BunS3Storage-DNvimm9e.js → BunS3Storage-B_roVJ29.js} +1 -1
  26. package/dist/packem_shared/BunnyMetaStorage-CJsyeQ63.js +1 -0
  27. package/dist/packem_shared/{BunnyStorage-C7d0opLL.js → BunnyStorage-eZ1QDVaY.js} +1 -1
  28. package/dist/packem_shared/CloudinaryMetaStorage-Bv_YCZ0Q.js +1 -0
  29. package/dist/packem_shared/{CloudinaryStorage-Dc3XA2lP.js → CloudinaryStorage-CpH2f0Fv.js} +1 -1
  30. package/dist/packem_shared/DiskStorage-DzjjqCzo.js +1 -0
  31. package/dist/packem_shared/{DiskStorageWithChecksum-vFCubS6K.js → DiskStorageWithChecksum-MZkDEyts.js} +1 -1
  32. package/dist/packem_shared/DropboxMetaStorage-CJsyeQ63.js +1 -0
  33. package/dist/packem_shared/{DropboxStorage-CY9Ggu3m.js → DropboxStorage-BB9NoWK2.js} +1 -1
  34. package/dist/packem_shared/{Files-CpIcMjP0.js → Files-DyMJ9FPN.js} +1 -1
  35. package/dist/packem_shared/FirebaseMetaStorage-Bv_YCZ0Q.js +1 -0
  36. package/dist/packem_shared/{FirebaseStorage-D6O9CJXN.js → FirebaseStorage-BgbxzYNC.js} +1 -1
  37. package/dist/packem_shared/FtpMetaStorage-CJsyeQ63.js +1 -0
  38. package/dist/packem_shared/{FtpStorage-DbEjbq8z.js → FtpStorage-CNqXDz7P.js} +1 -1
  39. package/dist/packem_shared/{GCSMetaStorage-DT8K6zdm.js → GCSMetaStorage-gEhWlpfS.js} +1 -1
  40. package/dist/packem_shared/{GCStorage-6BHkFlEs.js → GCStorage-CRd5vjok.js} +1 -1
  41. package/dist/packem_shared/GoogleDriveMetaStorage-B0gLF7Io.js +1 -0
  42. package/dist/packem_shared/{GoogleDriveStorage-Bklsz7Bh.js → GoogleDriveStorage-Du7uBhSm.js} +1 -1
  43. package/dist/packem_shared/{LocalMetaStorage-BhicZnNl.js → LocalMetaStorage-CcGfFG39.js} +1 -1
  44. package/dist/packem_shared/{MemoryStorage-9gbWd09l.js → MemoryStorage-ChKyI6OY.js} +1 -1
  45. package/dist/packem_shared/{Multipart-D0ok6BBy.js → Multipart-C35TR2qL.js} +1 -1
  46. package/dist/packem_shared/{Multipart-CQjYqU--.js → Multipart-V64Bg5dt.js} +1 -1
  47. package/dist/packem_shared/NetlifyBlobMetaStorage-Bv_YCZ0Q.js +1 -0
  48. package/dist/packem_shared/NetlifyBlobStorage-CZsr_0DF.js +1 -0
  49. package/dist/packem_shared/OneDriveMetaStorage-B0gLF7Io.js +1 -0
  50. package/dist/packem_shared/{OneDriveStorage-CP6MvGAa.js → OneDriveStorage-B8qFgMq1.js} +1 -1
  51. package/dist/packem_shared/PocketBaseMetaStorage-Cm3v8g1-.js +1 -0
  52. package/dist/packem_shared/{PocketBaseStorage-2qhbI2PW.js → PocketBaseStorage-D2vMN-oY.js} +1 -1
  53. package/dist/packem_shared/{Rest-CI_BiZPv.js → Rest-B7g1sgkq.js} +1 -1
  54. package/dist/packem_shared/{Rest-DvfN4-kf.js → Rest-BrEMYgxZ.js} +1 -1
  55. package/dist/packem_shared/{S3Storage-YGeNk3Tt.js → S3Storage-CTe_BMDl.js} +1 -1
  56. package/dist/packem_shared/SftpMetaStorage-CJsyeQ63.js +1 -0
  57. package/dist/packem_shared/{SftpStorage-2Hz396Xr.js → SftpStorage-BKeAzuej.js} +1 -1
  58. package/dist/packem_shared/SharePointMetaStorage-CJsyeQ63.js +1 -0
  59. package/dist/packem_shared/{SharePointStorage-CrX2Pk6C.js → SharePointStorage-Dtnt5-wk.js} +1 -1
  60. package/dist/packem_shared/SupabaseMetaStorage-B0gLF7Io.js +1 -0
  61. package/dist/packem_shared/{SupabaseStorage-Dc_DBX29.js → SupabaseStorage-CmGQjqXf.js} +1 -1
  62. package/dist/packem_shared/{Tus-BlBZykIL.js → Tus-CJBgnJrn.js} +1 -1
  63. package/dist/packem_shared/{Tus-BBVt2ky3.js → Tus-D9c7KDnl.js} +1 -1
  64. package/dist/packem_shared/UploadThingMetaStorage-Bv_YCZ0Q.js +1 -0
  65. package/dist/packem_shared/{UploadThingStorage-BChykYSe.js → UploadThingStorage-DZ4zNvDH.js} +1 -1
  66. package/dist/packem_shared/VercelBlobMetaStorage-CJsyeQ63.js +1 -0
  67. package/dist/packem_shared/{VercelBlobStorage-CsRyPfw3.js → VercelBlobStorage-DDNEofR3.js} +1 -1
  68. package/dist/packem_shared/{approval.d-CMAYH9GF.d.ts → approval.d-C-d-t94D.d.ts} +6 -6
  69. package/dist/packem_shared/{base-handler-core-D-9Ku1h-.js → base-handler-core-BJP9jHCE.js} +1 -1
  70. package/dist/packem_shared/{base-handler-fetch-CfkNakv8.js → base-handler-fetch-yrYrukwL.js} +1 -1
  71. package/dist/packem_shared/base-handler-node-C8P9rkaH.js +1 -0
  72. package/dist/packem_shared/{createRetryWrapper-CxgiV_hH.js → createRetryWrapper-DgmeHPNF.js} +1 -1
  73. package/dist/packem_shared/disk-storage-DqnnFQAQ.js +1 -0
  74. package/dist/packem_shared/disk-storage-with-checksum.d-Dgwyza8a.d.ts +146 -0
  75. package/dist/packem_shared/{executors.d-BZP2rWo3.d.ts → executors.d-B9dIy3NT.d.ts} +3 -2
  76. package/dist/packem_shared/files.d-CmSZi3M0.d.ts +655 -0
  77. package/dist/packem_shared/gcs-meta-storage-C9F78Sqq.js +1 -0
  78. package/dist/packem_shared/local-meta-storage-BELb1YwO.js +11 -0
  79. package/dist/packem_shared/{local-meta-storage.d-D9PBfkn6.d.ts → local-meta-storage.d-cRTXr1kb.d.ts} +7 -7
  80. package/dist/packem_shared/media-transformer.d-C8tn4J2Z.d.ts +331 -0
  81. package/dist/packem_shared/{memory-storage.d-4EU1cMt1.d.ts → memory-storage.d-BNZvDG1b.d.ts} +32 -40
  82. package/dist/packem_shared/path-C-OWflAo-_mqb5p5d.js +1 -0
  83. package/dist/packem_shared/{rest-base-e0reNDE_.js → rest-base-BQ_dhWyV.js} +1 -1
  84. package/dist/packem_shared/s3-base-storage-CX94H-Za.js +1 -0
  85. package/dist/packem_shared/{s3-base-storage.d-BQgP5B-t.d.ts → s3-base-storage.d-ks99NSs-.d.ts} +64 -70
  86. package/dist/packem_shared/storage-DR7qdwBN.js +1 -0
  87. package/dist/packem_shared/storage.d-DwdJrArF.d.ts +1186 -0
  88. package/dist/packem_shared/tus-base.d-BKBoJVy0.d.ts +103 -0
  89. package/dist/packem_shared/types.d-B1_xZIhu.d.ts +104 -0
  90. package/dist/packem_shared/{types.d-CrUWY4On.d.ts → types.d-BEUv414z.d.ts} +134 -134
  91. package/dist/packem_shared/{types.d-CggTCgXr.d.ts → types.d-D7Zlz5RE.d.ts} +3 -3
  92. package/dist/storage/aws/clients/index.d.ts +388 -388
  93. package/dist/storage/aws/index.d.ts +110 -113
  94. package/dist/storage/aws/index.js +1 -1
  95. package/dist/storage/aws-light/index.d.ts +64 -67
  96. package/dist/storage/aws-light/index.js +1 -1
  97. package/dist/storage/azure/index.d.ts +134 -139
  98. package/dist/storage/azure/index.js +1 -1
  99. package/dist/storage/box/index.d.ts +89 -92
  100. package/dist/storage/box/index.js +1 -1
  101. package/dist/storage/bun-s3/index.d.ts +71 -76
  102. package/dist/storage/bun-s3/index.js +1 -1
  103. package/dist/storage/bunny/index.d.ts +52 -55
  104. package/dist/storage/bunny/index.js +1 -1
  105. package/dist/storage/cloudinary/index.d.ts +54 -59
  106. package/dist/storage/cloudinary/index.js +1 -1
  107. package/dist/storage/dropbox/index.d.ts +59 -62
  108. package/dist/storage/dropbox/index.js +1 -1
  109. package/dist/storage/firebase/index.d.ts +74 -79
  110. package/dist/storage/firebase/index.js +1 -1
  111. package/dist/storage/ftp/index.d.ts +38 -43
  112. package/dist/storage/ftp/index.js +1 -1
  113. package/dist/storage/gcs/index.d.ts +90 -95
  114. package/dist/storage/gcs/index.js +1 -1
  115. package/dist/storage/google-drive/index.d.ts +69 -72
  116. package/dist/storage/google-drive/index.js +1 -1
  117. package/dist/storage/local/index.d.ts +4 -3
  118. package/dist/storage/local/index.js +1 -1
  119. package/dist/storage/memory/index.d.ts +3 -2
  120. package/dist/storage/memory/index.js +1 -1
  121. package/dist/storage/netlify-blob/index.d.ts +86 -93
  122. package/dist/storage/netlify-blob/index.js +1 -1
  123. package/dist/storage/onedrive/index.d.ts +44 -53
  124. package/dist/storage/onedrive/index.js +1 -1
  125. package/dist/storage/pocketbase/index.d.ts +67 -72
  126. package/dist/storage/pocketbase/index.js +1 -1
  127. package/dist/storage/sftp/index.d.ts +40 -45
  128. package/dist/storage/sftp/index.js +1 -1
  129. package/dist/storage/sharepoint/index.d.ts +96 -95
  130. package/dist/storage/sharepoint/index.js +1 -1
  131. package/dist/storage/supabase/index.d.ts +50 -55
  132. package/dist/storage/supabase/index.js +1 -1
  133. package/dist/storage/uploadthing/index.d.ts +34 -37
  134. package/dist/storage/uploadthing/index.js +1 -1
  135. package/dist/storage/vercel-blob/index.d.ts +110 -115
  136. package/dist/storage/vercel-blob/index.js +1 -1
  137. package/dist/transformer/audio-transformer.d.ts +97 -96
  138. package/dist/transformer/image-transformer.d.ts +423 -422
  139. package/dist/transformer/index.d.ts +35 -34
  140. package/dist/transformer/video-transformer.d.ts +112 -111
  141. package/package.json +2 -2
  142. package/dist/packem_shared/AwsLightStorage-BK-WPL0h.js +0 -1
  143. package/dist/packem_shared/AzureStorage-1UvDIQZd.js +0 -1
  144. package/dist/packem_shared/BoxMetaStorage-BSn6Qfnf.js +0 -1
  145. package/dist/packem_shared/BunS3MetaStorage-BSn6Qfnf.js +0 -1
  146. package/dist/packem_shared/BunnyMetaStorage-BSn6Qfnf.js +0 -1
  147. package/dist/packem_shared/CloudinaryMetaStorage-DPVnmNe5.js +0 -1
  148. package/dist/packem_shared/DiskStorage-CI07TVNu.js +0 -1
  149. package/dist/packem_shared/DropboxMetaStorage-BSn6Qfnf.js +0 -1
  150. package/dist/packem_shared/FirebaseMetaStorage-DPVnmNe5.js +0 -1
  151. package/dist/packem_shared/FtpMetaStorage-BSn6Qfnf.js +0 -1
  152. package/dist/packem_shared/GoogleDriveMetaStorage-Cbwa1CHV.js +0 -1
  153. package/dist/packem_shared/NetlifyBlobMetaStorage-DPVnmNe5.js +0 -1
  154. package/dist/packem_shared/NetlifyBlobStorage-CkpCCoN1.js +0 -1
  155. package/dist/packem_shared/OneDriveMetaStorage-Cbwa1CHV.js +0 -1
  156. package/dist/packem_shared/PocketBaseMetaStorage-DOTLwVE7.js +0 -1
  157. package/dist/packem_shared/SftpMetaStorage-BSn6Qfnf.js +0 -1
  158. package/dist/packem_shared/SharePointMetaStorage-BSn6Qfnf.js +0 -1
  159. package/dist/packem_shared/SupabaseMetaStorage-Cbwa1CHV.js +0 -1
  160. package/dist/packem_shared/UploadThingMetaStorage-DPVnmNe5.js +0 -1
  161. package/dist/packem_shared/VercelBlobMetaStorage-BSn6Qfnf.js +0 -1
  162. package/dist/packem_shared/base-handler-node-BF1v1qDa.js +0 -1
  163. package/dist/packem_shared/disk-storage-CsQcYW3s.js +0 -1
  164. package/dist/packem_shared/disk-storage-with-checksum.d-B-VGEsfl.d.ts +0 -156
  165. package/dist/packem_shared/files.d-CH0iLBNC.d.ts +0 -655
  166. package/dist/packem_shared/gcs-meta-storage-B7BnctnV.js +0 -1
  167. package/dist/packem_shared/local-meta-storage-iuJnu90B.js +0 -11
  168. package/dist/packem_shared/media-transformer.d-Quf4ai47.d.ts +0 -331
  169. package/dist/packem_shared/path-0oTTdkvl-DvWvbDbh.js +0 -1
  170. package/dist/packem_shared/s3-base-storage-BoTyhuzO.js +0 -1
  171. package/dist/packem_shared/storage-0j5nCAUp.js +0 -1
  172. package/dist/packem_shared/storage.d-CEM1upWM.d.ts +0 -1176
  173. package/dist/packem_shared/tus-base.d-DLzKE54M.d.ts +0 -106
  174. package/dist/packem_shared/types.d-Bon9GVVe.d.ts +0 -104
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## @visulima/storage [1.0.11](https://github.com/visulima/visulima/compare/%40visulima%2Fstorage%401.0.10...%40visulima%2Fstorage%401.0.11) (2026-08-02)
2
+
3
+
4
+ ### Dependencies
5
+
6
+ * **@visulima/pagination:** upgraded to 6.0.0
7
+ * **@visulima/fs:** upgraded to 5.1.0
8
+ * **@visulima/humanizer:** upgraded to 3.1.0
9
+ * **@visulima/path:** upgraded to 3.1.0
10
+
11
+ ## @visulima/storage [1.0.10](https://github.com/visulima/visulima/compare/%40visulima%2Fstorage%401.0.9...%40visulima%2Fstorage%401.0.10) (2026-07-27)
12
+
13
+
14
+ ### Dependencies
15
+
16
+ * **@visulima/fs:** upgraded to 5.0.11
17
+
1
18
  ## @visulima/storage [1.0.9](https://github.com/visulima/visulima/compare/%40visulima%2Fstorage%401.0.8...%40visulima%2Fstorage%401.0.9) (2026-07-27)
2
19
 
3
20
 
@@ -1,16 +1,17 @@
1
- import { U as UploadOptions } from "../../packem_shared/types.d-CggTCgXr.js";
2
- import { U as UploadFile, B as BaseStorage } from "../../packem_shared/storage.d-CEM1upWM.js";
1
+ import { U as UploadOptions } from "../../packem_shared/types.d-D7Zlz5RE.js";
2
+ import { U as UploadFile, B as BaseStorage } from "../../packem_shared/storage.d-DwdJrArF.js";
3
3
  import 'node:stream';
4
4
  import 'node:events';
5
5
  import 'node:http';
6
6
  import '@visulima/pagination';
7
- import "../../packem_shared/media-transformer.d-Quf4ai47.js";
8
- import "../../packem_shared/types.d-CrUWY4On.js";
7
+ import "../../packem_shared/media-transformer.d-C8tn4J2Z.js";
8
+ import "../../packem_shared/types.d-BEUv414z.js";
9
+ import 'node:timers';
9
10
  import 'node:crypto';
10
11
  import 'lru-cache';
11
12
  /**
12
- * CORS configuration for upload endpoints
13
- */
13
+ * CORS configuration for upload endpoints
14
+ */
14
15
  interface CorsOptions {
15
16
  /** Allowed CORS headers */
16
17
  headers?: string[];
@@ -20,8 +21,8 @@ interface CorsOptions {
20
21
  origin?: string | string[];
21
22
  }
22
23
  /**
23
- * Configuration options for the Nuxt storage module
24
- */
24
+ * Configuration options for the Nuxt storage module
25
+ */
25
26
  interface ModuleOptions {
26
27
  /** Base path for upload routes (default: '/api/upload') */
27
28
  basePath?: string;
@@ -1,26 +1,27 @@
1
- import { F as Files } from "../../packem_shared/files.d-CH0iLBNC.js";
1
+ import { F as Files } from "../../packem_shared/files.d-CmSZi3M0.js";
2
2
  import 'node:stream';
3
+ import 'node:timers';
3
4
  import 'node:crypto';
4
5
  import 'node:http';
5
6
  import 'lru-cache';
6
- import { C as CopyFileInput, D as DeleteFileInput, a as DownloadFileInput, G as GetFileMetadataInput, b as GetFileUrlInput, L as ListFilesInput, S as SignUploadUrlInput, U as UploadFileInput, F as FileToolName, A as ApprovalConfig, c as FileReadToolName } from "../../packem_shared/approval.d-CMAYH9GF.js";
7
- export type { d as FileWriteToolName } from "../../packem_shared/approval.d-CMAYH9GF.js";
7
+ import { C as CopyFileInput, D as DeleteFileInput, a as DownloadFileInput, G as GetFileMetadataInput, b as GetFileUrlInput, L as ListFilesInput, S as SignUploadUrlInput, U as UploadFileInput, F as FileToolName, A as ApprovalConfig, c as FileReadToolName } from "../../packem_shared/approval.d-C-d-t94D.js";
8
+ export type { d as FileWriteToolName } from "../../packem_shared/approval.d-C-d-t94D.js";
8
9
  import { Tool } from 'ai';
9
- import { e as executors } from "../../packem_shared/executors.d-BZP2rWo3.js";
10
- import "../../packem_shared/storage.d-CEM1upWM.js";
10
+ import { e as executors } from "../../packem_shared/executors.d-B9dIy3NT.js";
11
+ import "../../packem_shared/storage.d-DwdJrArF.js";
11
12
  import 'zod';
12
13
  /**
13
- * Common options accepted by every write-tool factory.
14
- */
14
+ * Common options accepted by every write-tool factory.
15
+ */
15
16
  interface ToolOptions {
16
17
  needsApproval?: boolean;
17
18
  }
18
19
  /**
19
- * Per-tool overrides for customizing AI SDK `tool()` properties without
20
- * changing the underlying implementation. Core properties (`execute`,
21
- * `inputSchema`, `outputSchema`) are intentionally excluded — those drive
22
- * the tool's behavior and contract and shouldn't be patched at this layer.
23
- */
20
+ * Per-tool overrides for customizing AI SDK `tool()` properties without
21
+ * changing the underlying implementation. Core properties (`execute`,
22
+ * `inputSchema`, `outputSchema`) are intentionally excluded — those drive
23
+ * the tool's behavior and contract and shouldn't be patched at this layer.
24
+ */
24
25
  type ToolOverrides = Partial<Pick<Tool, "description" | "needsApproval" | "onInputAvailable" | "onInputDelta" | "onInputStart" | "providerOptions" | "toModelOutput">>;
25
26
  type ListFilesOutput = Awaited<ReturnType<typeof executors.listFiles>>;
26
27
  type GetFileMetadataOutput = Awaited<ReturnType<typeof executors.getFileMetadata>>;
@@ -34,40 +35,32 @@ declare const listFiles: (files: Files) => Tool<ListFilesInput, ListFilesOutput>
34
35
  declare const getFileMetadata: (files: Files) => Tool<GetFileMetadataInput, GetFileMetadataOutput>;
35
36
  declare const downloadFile: (files: Files) => Tool<DownloadFileInput, DownloadFileOutput>;
36
37
  declare const getFileUrl: (files: Files) => Tool<GetFileUrlInput, GetFileUrlOutput>;
37
- declare const uploadFile: (files: Files, {
38
- needsApproval
39
- }?: ToolOptions) => Tool<UploadFileInput, UploadFileOutput>;
40
- declare const deleteFile: (files: Files, {
41
- needsApproval
42
- }?: ToolOptions) => Tool<DeleteFileInput, DeleteFileOutput>;
43
- declare const copyFile: (files: Files, {
44
- needsApproval
45
- }?: ToolOptions) => Tool<CopyFileInput, CopyFileOutput>;
46
- declare const signUploadUrl: (files: Files, {
47
- needsApproval
48
- }?: ToolOptions) => Tool<SignUploadUrlInput, SignUploadUrlOutput>;
38
+ declare const uploadFile: (files: Files, { needsApproval }?: ToolOptions) => Tool<UploadFileInput, UploadFileOutput>;
39
+ declare const deleteFile: (files: Files, { needsApproval }?: ToolOptions) => Tool<DeleteFileInput, DeleteFileOutput>;
40
+ declare const copyFile: (files: Files, { needsApproval }?: ToolOptions) => Tool<CopyFileInput, CopyFileOutput>;
41
+ declare const signUploadUrl: (files: Files, { needsApproval }?: ToolOptions) => Tool<SignUploadUrlInput, SignUploadUrlOutput>;
49
42
  interface FileToolsOptions {
50
43
  /**
51
- * The configured `Files` instance the tools will operate against.
52
- * Each tool delegates to the methods on this instance.
53
- */
44
+ * The configured `Files` instance the tools will operate against.
45
+ * Each tool delegates to the methods on this instance.
46
+ */
54
47
  files: Files;
55
48
  /**
56
- * Per-tool overrides for customizing tool behavior (description, title,
57
- * needsApproval, etc.) without changing the underlying implementation.
58
- * `execute` and `inputSchema` cannot be overridden.
59
- */
49
+ * Per-tool overrides for customizing tool behavior (description, title,
50
+ * needsApproval, etc.) without changing the underlying implementation.
51
+ * `execute` and `inputSchema` cannot be overridden.
52
+ */
60
53
  overrides?: Partial<Record<FileToolName, ToolOverrides>>;
61
54
  /**
62
- * When `true`, write tools (`uploadFile`, `deleteFile`, `copyFile`,
63
- * `signUploadUrl`) are omitted entirely. The model cannot mutate the
64
- * bucket regardless of approval configuration.
65
- */
55
+ * When `true`, write tools (`uploadFile`, `deleteFile`, `copyFile`,
56
+ * `signUploadUrl`) are omitted entirely. The model cannot mutate the
57
+ * bucket regardless of approval configuration.
58
+ */
66
59
  readOnly?: boolean;
67
60
  /**
68
- * Approval gating for write tools. Defaults to `true` (all writes
69
- * require approval). See {@link ApprovalConfig}.
70
- */
61
+ * Approval gating for write tools. Defaults to `true` (all writes
62
+ * require approval). See {@link ApprovalConfig}.
63
+ */
71
64
  requireApproval?: ApprovalConfig;
72
65
  }
73
66
  interface FileTools {
@@ -82,27 +75,27 @@ interface FileTools {
82
75
  }
83
76
  type ReadOnlyFileTools = Pick<FileTools, FileReadToolName>;
84
77
  /**
85
- * Create a set of visulima/storage tools for the Vercel AI SDK.
86
- *
87
- * Write operations require user approval by default. Control globally or
88
- * per-tool via `requireApproval`, or strip writes entirely with
89
- * `readOnly: true`.
90
- * @example
91
- * ```ts
92
- * import { Files } from "@visulima/storage";
93
- * import { S3Storage } from "@visulima/storage/provider/aws";
94
- * import { createFileTools } from "@visulima/storage/ai/sdk";
95
- * import { generateText } from "ai";
96
- *
97
- * const files = new Files({ adapter: new S3Storage({ bucket: "uploads" }) });
98
- *
99
- * const result = await generateText({
100
- * model,
101
- * tools: createFileTools({ files }),
102
- * prompt: "Find every CSV under reports/ and summarize the latest one.",
103
- * });
104
- * ```
105
- */
78
+ * Create a set of visulima/storage tools for the Vercel AI SDK.
79
+ *
80
+ * Write operations require user approval by default. Control globally or
81
+ * per-tool via `requireApproval`, or strip writes entirely with
82
+ * `readOnly: true`.
83
+ * @example
84
+ * ```ts
85
+ * import { Files } from "@visulima/storage";
86
+ * import { S3Storage } from "@visulima/storage/provider/aws";
87
+ * import { createFileTools } from "@visulima/storage/ai/sdk";
88
+ * import { generateText } from "ai";
89
+ *
90
+ * const files = new Files({ adapter: new S3Storage({ bucket: "uploads" }) });
91
+ *
92
+ * const result = await generateText({
93
+ * model,
94
+ * tools: createFileTools({ files }),
95
+ * prompt: "Find every CSV under reports/ and summarize the latest one.",
96
+ * });
97
+ * ```
98
+ */
106
99
  declare function createFileTools(options: FileToolsOptions & {
107
100
  readOnly: true;
108
101
  }): ReadOnlyFileTools;
@@ -1,25 +1,26 @@
1
1
  import { SdkMcpToolDefinition, CanUseTool, McpSdkServerConfigWithInstance } from '@anthropic-ai/claude-agent-sdk';
2
- import { F as Files } from "../../packem_shared/files.d-CH0iLBNC.js";
2
+ import { F as Files } from "../../packem_shared/files.d-CmSZi3M0.js";
3
3
  import 'node:stream';
4
+ import 'node:timers';
4
5
  import 'node:crypto';
5
6
  import 'node:http';
6
7
  import 'lru-cache';
7
- import { T as TOOL_SCHEMAS, F as FileToolName, A as ApprovalConfig } from "../../packem_shared/approval.d-CMAYH9GF.js";
8
- export type { c as FileReadToolName, d as FileWriteToolName } from "../../packem_shared/approval.d-CMAYH9GF.js";
9
- import "../../packem_shared/storage.d-CEM1upWM.js";
8
+ import { T as TOOL_SCHEMAS, F as FileToolName, A as ApprovalConfig } from "../../packem_shared/approval.d-C-d-t94D.js";
9
+ export type { c as FileReadToolName, d as FileWriteToolName } from "../../packem_shared/approval.d-C-d-t94D.js";
10
+ import "../../packem_shared/storage.d-DwdJrArF.js";
10
11
  import 'zod';
11
12
  /**
12
- * MCP tool annotations as accepted by `tool()` and exposed on
13
- * `SdkMcpToolDefinition`. Re-derived from the SDK rather than imported from
14
- * `@modelcontextprotocol/sdk` directly to avoid taking on a second peer
15
- * dependency.
16
- */
13
+ * MCP tool annotations as accepted by `tool()` and exposed on
14
+ * `SdkMcpToolDefinition`. Re-derived from the SDK rather than imported from
15
+ * `@modelcontextprotocol/sdk` directly to avoid taking on a second peer
16
+ * dependency.
17
+ */
17
18
  type ToolAnnotations = NonNullable<SdkMcpToolDefinition["annotations"]>;
18
19
  /**
19
- * Per-tool overrides for `createClaudeFileTools`. `name`, `inputSchema`, and
20
- * `handler` are intentionally not overridable — the contract that drives tool
21
- * behavior should not be patched at this layer.
22
- */
20
+ * Per-tool overrides for `createClaudeFileTools`. `name`, `inputSchema`, and
21
+ * `handler` are intentionally not overridable — the contract that drives tool
22
+ * behavior should not be patched at this layer.
23
+ */
23
24
  interface ClaudeToolOverrides {
24
25
  annotations?: ToolAnnotations;
25
26
  description?: string;
@@ -39,139 +40,124 @@ declare const claudeListFiles: (files: Files) => SdkMcpToolDefinition<ListFilesS
39
40
  declare const claudeGetFileMetadata: (files: Files) => SdkMcpToolDefinition<GetFileMetadataShape>;
40
41
  declare const claudeDownloadFile: (files: Files) => SdkMcpToolDefinition<DownloadFileShape>;
41
42
  declare const claudeGetFileUrl: (files: Files) => SdkMcpToolDefinition<GetFileUrlShape>;
42
- declare const claudeUploadFile: (files: Files, {
43
- annotations
44
- }?: ClaudeWriteToolOptions) => SdkMcpToolDefinition<UploadFileShape>;
45
- declare const claudeDeleteFile: (files: Files, {
46
- annotations
47
- }?: ClaudeWriteToolOptions) => SdkMcpToolDefinition<DeleteFileShape>;
48
- declare const claudeCopyFile: (files: Files, {
49
- annotations
50
- }?: ClaudeWriteToolOptions) => SdkMcpToolDefinition<CopyFileShape>;
51
- declare const claudeSignUploadUrl: (files: Files, {
52
- annotations
53
- }?: ClaudeWriteToolOptions) => SdkMcpToolDefinition<SignUploadUrlShape>;
43
+ declare const claudeUploadFile: (files: Files, { annotations }?: ClaudeWriteToolOptions) => SdkMcpToolDefinition<UploadFileShape>;
44
+ declare const claudeDeleteFile: (files: Files, { annotations }?: ClaudeWriteToolOptions) => SdkMcpToolDefinition<DeleteFileShape>;
45
+ declare const claudeCopyFile: (files: Files, { annotations }?: ClaudeWriteToolOptions) => SdkMcpToolDefinition<CopyFileShape>;
46
+ declare const claudeSignUploadUrl: (files: Files, { annotations }?: ClaudeWriteToolOptions) => SdkMcpToolDefinition<SignUploadUrlShape>;
54
47
  interface ClaudeFileToolsOptions {
55
48
  /**
56
- * The configured `Files` instance the tools will operate against.
57
- */
49
+ * The configured `Files` instance the tools will operate against.
50
+ */
58
51
  files: Files;
59
52
  /**
60
- * Per-tool overrides for `description` / `annotations` without touching
61
- * the underlying handler or input schema.
62
- */
53
+ * Per-tool overrides for `description` / `annotations` without touching
54
+ * the underlying handler or input schema.
55
+ */
63
56
  overrides?: Partial<Record<FileToolName, ClaudeToolOverrides>>;
64
57
  /**
65
- * When `true`, write tools (`uploadFile`, `deleteFile`, `copyFile`,
66
- * `signUploadUrl`) are omitted from the MCP server. The model cannot
67
- * mutate the bucket regardless of approval configuration.
68
- */
58
+ * When `true`, write tools (`uploadFile`, `deleteFile`, `copyFile`,
59
+ * `signUploadUrl`) are omitted from the MCP server. The model cannot
60
+ * mutate the bucket regardless of approval configuration.
61
+ */
69
62
  readOnly?: boolean;
70
63
  /**
71
- * Approval gating reflected by {@link ClaudeFileTools.needsApproval} and
72
- * the bundled {@link ClaudeFileTools.canUseTool}. Defaults to `true`
73
- * (every write requires approval). Pass `false` to disable, or an object
74
- * keyed by write-tool name for fine-grained control.
75
- */
64
+ * Approval gating reflected by {@link ClaudeFileTools.needsApproval} and
65
+ * the bundled {@link ClaudeFileTools.canUseTool}. Defaults to `true`
66
+ * (every write requires approval). Pass `false` to disable, or an object
67
+ * keyed by write-tool name for fine-grained control.
68
+ */
76
69
  requireApproval?: ApprovalConfig;
77
70
  /**
78
- * Name of the in-process MCP server that wraps these tools. Affects the
79
- * `mcp__&lt;server-name>__&lt;tool-name>` strings the agent uses to address
80
- * each tool. Defaults to `"files"`.
81
- */
71
+ * Name of the in-process MCP server that wraps these tools. Affects the
72
+ * `mcp__&lt;server-name>__&lt;tool-name>` strings the agent uses to address
73
+ * each tool. Defaults to `"files"`.
74
+ */
82
75
  serverName?: string;
83
76
  /**
84
- * MCP server `version` metadata. Defaults to `"1.0.0"`.
85
- */
77
+ * MCP server `version` metadata. Defaults to `"1.0.0"`.
78
+ */
86
79
  serverVersion?: string;
87
80
  }
88
81
  interface ClaudeFileTools {
89
82
  /**
90
- * Pass into `query({ options: { allowedTools: tools.allowedTools } })`.
91
- * Each entry is of the form `mcp__&lt;serverName>__&lt;toolName>`.
92
- */
83
+ * Pass into `query({ options: { allowedTools: tools.allowedTools } })`.
84
+ * Each entry is of the form `mcp__&lt;serverName>__&lt;toolName>`.
85
+ */
93
86
  allowedTools: string[];
94
87
  /**
95
- * Ready-made `canUseTool` callback. Allows reads unconditionally, allows
96
- * writes whose `needsApproval` resolves to `false`, denies the rest with
97
- * a `"requires approval"` message. Pass directly into `query()`, or
98
- * compose your own using {@link ClaudeFileTools.needsApproval}.
99
- */
88
+ * Ready-made `canUseTool` callback. Allows reads unconditionally, allows
89
+ * writes whose `needsApproval` resolves to `false`, denies the rest with
90
+ * a `"requires approval"` message. Pass directly into `query()`, or
91
+ * compose your own using {@link ClaudeFileTools.needsApproval}.
92
+ */
100
93
  canUseTool: CanUseTool;
101
94
  /**
102
- * Pass into `query({ options: { mcpServers: tools.mcpServers } })`.
103
- */
95
+ * Pass into `query({ options: { mcpServers: tools.mcpServers } })`.
96
+ */
104
97
  mcpServers: Record<string, McpSdkServerConfigWithInstance>;
105
98
  /**
106
- * Whether the named tool is approval-gated under the configured
107
- * `requireApproval`. Accepts both bare names (`"uploadFile"`) and the
108
- * MCP-prefixed form (`"mcp__files__uploadFile"`). Read tools and unknown
109
- * names return `false`.
110
- */
99
+ * Whether the named tool is approval-gated under the configured
100
+ * `requireApproval`. Accepts both bare names (`"uploadFile"`) and the
101
+ * MCP-prefixed form (`"mcp__files__uploadFile"`). Read tools and unknown
102
+ * names return `false`.
103
+ */
111
104
  needsApproval: (toolName: string) => boolean;
112
105
  /**
113
- * The raw SDK MCP server instance — same value as
114
- * `mcpServers[serverName]`. Exposed for callers that want to compose it
115
- * into a larger `mcpServers` map.
116
- */
106
+ * The raw SDK MCP server instance — same value as
107
+ * `mcpServers[serverName]`. Exposed for callers that want to compose it
108
+ * into a larger `mcpServers` map.
109
+ */
117
110
  server: McpSdkServerConfigWithInstance;
118
111
  /**
119
- * The MCP server name used in the `mcp__&lt;server>__*` prefix.
120
- */
112
+ * The MCP server name used in the `mcp__&lt;server>__*` prefix.
113
+ */
121
114
  serverName: string;
122
115
  }
123
116
  /**
124
- * Create storage tools shaped for the Claude Agent SDK
125
- * (`@anthropic-ai/claude-agent-sdk`).
126
- *
127
- * The Claude Agent SDK consumes tools by way of an in-process MCP server +
128
- * an `allowedTools` allow-list + a `canUseTool` approval callback. The
129
- * returned bundle gives you all three, plus the raw server instance and a
130
- * `needsApproval()` helper if you want to wire your own `canUseTool`.
131
- * @example
132
- * ```ts
133
- * import { query } from "@anthropic-ai/claude-agent-sdk";
134
- * import { Files } from "@visulima/storage";
135
- * import { S3Storage } from "@visulima/storage/provider/aws";
136
- * import { createClaudeFileTools } from "@visulima/storage/ai/claude";
137
- *
138
- * const files = new Files({ adapter: new S3Storage({ bucket: "uploads" }) });
139
- * const tools = createClaudeFileTools({ files });
140
- *
141
- * for await (const message of query({
142
- * prompt: "List my files.",
143
- * options: {
144
- * mcpServers: tools.mcpServers,
145
- * allowedTools: tools.allowedTools,
146
- * canUseTool: tools.canUseTool,
147
- * },
148
- * })) {
149
- * // handle messages
150
- * }
151
- * ```
152
- * @example Read-only agent
153
- * ```ts
154
- * createClaudeFileTools({ files, readOnly: true })
155
- * ```
156
- * @example Granular approval
157
- * ```ts
158
- * createClaudeFileTools({
159
- * files,
160
- * requireApproval: {
161
- * copyFile: false,
162
- * deleteFile: true,
163
- * signUploadUrl: true,
164
- * uploadFile: false,
165
- * },
166
- * })
167
- * ```
168
- */
169
- declare const createClaudeFileTools: ({
170
- files,
171
- overrides,
172
- readOnly,
173
- requireApproval,
174
- serverName,
175
- serverVersion
176
- }: ClaudeFileToolsOptions) => ClaudeFileTools;
117
+ * Create storage tools shaped for the Claude Agent SDK
118
+ * (`@anthropic-ai/claude-agent-sdk`).
119
+ *
120
+ * The Claude Agent SDK consumes tools by way of an in-process MCP server +
121
+ * an `allowedTools` allow-list + a `canUseTool` approval callback. The
122
+ * returned bundle gives you all three, plus the raw server instance and a
123
+ * `needsApproval()` helper if you want to wire your own `canUseTool`.
124
+ * @example
125
+ * ```ts
126
+ * import { query } from "@anthropic-ai/claude-agent-sdk";
127
+ * import { Files } from "@visulima/storage";
128
+ * import { S3Storage } from "@visulima/storage/provider/aws";
129
+ * import { createClaudeFileTools } from "@visulima/storage/ai/claude";
130
+ *
131
+ * const files = new Files({ adapter: new S3Storage({ bucket: "uploads" }) });
132
+ * const tools = createClaudeFileTools({ files });
133
+ *
134
+ * for await (const message of query({
135
+ * prompt: "List my files.",
136
+ * options: {
137
+ * mcpServers: tools.mcpServers,
138
+ * allowedTools: tools.allowedTools,
139
+ * canUseTool: tools.canUseTool,
140
+ * },
141
+ * })) {
142
+ * // handle messages
143
+ * }
144
+ * ```
145
+ * @example Read-only agent
146
+ * ```ts
147
+ * createClaudeFileTools({ files, readOnly: true })
148
+ * ```
149
+ * @example Granular approval
150
+ * ```ts
151
+ * createClaudeFileTools({
152
+ * files,
153
+ * requireApproval: {
154
+ * copyFile: false,
155
+ * deleteFile: true,
156
+ * signUploadUrl: true,
157
+ * uploadFile: false,
158
+ * },
159
+ * })
160
+ * ```
161
+ */
162
+ declare const createClaudeFileTools: ({ files, overrides, readOnly, requireApproval, serverName, serverVersion }: ClaudeFileToolsOptions) => ClaudeFileTools;
177
163
  export { type ApprovalConfig, ClaudeFileTools, ClaudeFileToolsOptions, type ClaudeToolOverrides, type ClaudeWriteToolOptions, type FileToolName, type ToolAnnotations, claudeCopyFile, claudeDeleteFile, claudeDownloadFile, claudeGetFileMetadata, claudeGetFileUrl, claudeListFiles, claudeSignUploadUrl, claudeUploadFile, createClaudeFileTools };