@nestm/storage 0.1.0-alpha.7 → 0.1.0-alpha.8
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.
- package/CHANGELOG.md +110 -0
- package/README.md +217 -18
- package/SECURITY.md +34 -5
- package/dist/ai-sdk/ai-sdk-workspace-tools.d.ts +14 -3
- package/dist/ai-sdk/ai-sdk-workspace-tools.d.ts.map +1 -1
- package/dist/ai-sdk/ai-sdk-workspace-tools.js +54 -23
- package/dist/ai-sdk/ai-sdk-workspace-tools.js.map +1 -1
- package/dist/ai-sdk/index.d.ts +1 -1
- package/dist/ai-sdk/index.d.ts.map +1 -1
- package/dist/ai-sdk/index.js.map +1 -1
- package/dist/files-sdk/files-sdk.driver.d.ts +54 -10
- package/dist/files-sdk/files-sdk.driver.d.ts.map +1 -1
- package/dist/files-sdk/files-sdk.driver.js +784 -63
- package/dist/files-sdk/files-sdk.driver.js.map +1 -1
- package/dist/files-sdk/fs/index.d.ts +4 -4
- package/dist/files-sdk/fs/index.d.ts.map +1 -1
- package/dist/files-sdk/fs/index.js +242 -9
- package/dist/files-sdk/fs/index.js.map +1 -1
- package/dist/files-sdk/index.d.ts +1 -1
- package/dist/files-sdk/index.d.ts.map +1 -1
- package/dist/files-sdk/index.js.map +1 -1
- package/dist/files-sdk/provider/index.d.ts +9 -5
- package/dist/files-sdk/provider/index.d.ts.map +1 -1
- package/dist/files-sdk/provider/index.js +53 -15
- package/dist/files-sdk/provider/index.js.map +1 -1
- package/dist/files-sdk/s3/construction-metadata.d.ts +7 -0
- package/dist/files-sdk/s3/construction-metadata.d.ts.map +1 -0
- package/dist/files-sdk/s3/construction-metadata.js +13 -0
- package/dist/files-sdk/s3/construction-metadata.js.map +1 -0
- package/dist/files-sdk/s3/index.d.ts +39 -19
- package/dist/files-sdk/s3/index.d.ts.map +1 -1
- package/dist/files-sdk/s3/index.js +936 -113
- package/dist/files-sdk/s3/index.js.map +1 -1
- package/dist/gateway/storage-gateway.controller.d.ts.map +1 -1
- package/dist/gateway/storage-gateway.controller.js +25 -5
- package/dist/gateway/storage-gateway.controller.js.map +1 -1
- package/dist/storage-etag.d.ts +13 -0
- package/dist/storage-etag.d.ts.map +1 -0
- package/dist/storage-etag.js +31 -0
- package/dist/storage-etag.js.map +1 -0
- package/dist/storage.client.d.ts +3 -1
- package/dist/storage.client.d.ts.map +1 -1
- package/dist/storage.client.js +87 -22
- package/dist/storage.client.js.map +1 -1
- package/dist/storage.driver.d.ts +21 -1
- package/dist/storage.driver.d.ts.map +1 -1
- package/dist/storage.driver.js.map +1 -1
- package/dist/storage.types.d.ts +90 -19
- package/dist/storage.types.d.ts.map +1 -1
- package/dist/storage.types.js.map +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/provider-conformance.d.ts +65 -0
- package/dist/testing/provider-conformance.d.ts.map +1 -0
- package/dist/testing/provider-conformance.js +853 -0
- package/dist/testing/provider-conformance.js.map +1 -0
- package/dist/workspace/index.d.ts +1 -0
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +1 -0
- package/dist/workspace/index.js.map +1 -1
- package/dist/workspace/storage-workspace.cursor.d.ts +68 -3
- package/dist/workspace/storage-workspace.cursor.d.ts.map +1 -1
- package/dist/workspace/storage-workspace.cursor.js +402 -39
- package/dist/workspace/storage-workspace.cursor.js.map +1 -1
- package/dist/workspace/storage-workspace.d.ts.map +1 -1
- package/dist/workspace/storage-workspace.js +54 -46
- package/dist/workspace/storage-workspace.js.map +1 -1
- package/dist/workspace/storage-workspace.types.d.ts +10 -2
- package/dist/workspace/storage-workspace.types.d.ts.map +1 -1
- package/dist/workspace/storage-workspace.types.js +1 -0
- package/dist/workspace/storage-workspace.types.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { tool } from 'ai';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { isStorageWorkspaceError, } from '../workspace/index.js';
|
|
3
|
+
import { STORAGE_WORKSPACE_MAX_CURSOR_BYTES, isStorageWorkspaceError, } from '../workspace/index.js';
|
|
4
4
|
import { StorageErrorCode, isStorageError, } from '../storage.error.js';
|
|
5
|
+
import { isCanonicalStorageEtag } from '../storage-etag.js';
|
|
5
6
|
export const AI_SDK_WORKSPACE_TOOL_NAMES = [
|
|
6
7
|
'workspace_list',
|
|
7
8
|
'workspace_stat',
|
|
@@ -44,7 +45,7 @@ const mutationToolNames = new Set([
|
|
|
44
45
|
]);
|
|
45
46
|
const utf8Encoder = new TextEncoder();
|
|
46
47
|
const forbiddenUnicodeCharacter = /\p{C}/u;
|
|
47
|
-
const workspaceCursor = /^[A-Za-z0-
|
|
48
|
+
const workspaceCursor = /^[A-Za-z0-9._-]+$/u;
|
|
48
49
|
const windowsDeviceName = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/iu;
|
|
49
50
|
function isLogicalPath(value) {
|
|
50
51
|
if (value.length === 0 ||
|
|
@@ -87,22 +88,20 @@ function searchQuery(maxBytes) {
|
|
|
87
88
|
})
|
|
88
89
|
.describe('Path pattern or text to find inside the mounted workspace.');
|
|
89
90
|
}
|
|
90
|
-
function boundedEtag(
|
|
91
|
+
function boundedEtag() {
|
|
91
92
|
return z
|
|
92
93
|
.string()
|
|
93
|
-
.
|
|
94
|
-
|
|
95
|
-
message: 'ETag contains forbidden characters.',
|
|
96
|
-
})
|
|
97
|
-
.refine((value) => utf8Encoder.encode(value).byteLength <= maxBytes, {
|
|
98
|
-
message: `ETag exceeds the ${maxBytes}-byte workspace limit.`,
|
|
94
|
+
.refine(isCanonicalStorageEtag, {
|
|
95
|
+
message: 'ETag must be a canonical bare value of at most 1,024 bytes.',
|
|
99
96
|
})
|
|
100
|
-
.describe('Exact ETag returned by the latest workspace stat or read.');
|
|
97
|
+
.describe('Exact canonical bare ETag returned by the latest workspace stat or read.');
|
|
101
98
|
}
|
|
102
|
-
function continuationCursor(description) {
|
|
99
|
+
function continuationCursor(description, maxBytes) {
|
|
103
100
|
return z
|
|
104
101
|
.string()
|
|
105
|
-
.
|
|
102
|
+
.min(1)
|
|
103
|
+
.max(Math.min(STORAGE_WORKSPACE_MAX_CURSOR_BYTES, maxBytes))
|
|
104
|
+
.regex(workspaceCursor, 'Cursor must be the bounded opaque token returned by the workspace.')
|
|
106
105
|
.optional()
|
|
107
106
|
.describe(description);
|
|
108
107
|
}
|
|
@@ -155,7 +154,29 @@ async function executeSafely(signal, operation) {
|
|
|
155
154
|
throw sanitizeToolError(error, signal);
|
|
156
155
|
}
|
|
157
156
|
}
|
|
157
|
+
async function executeCreateAware(signal, input, operation, mapCreateConflict) {
|
|
158
|
+
try {
|
|
159
|
+
return await operation();
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
const safeError = sanitizeToolError(error, signal);
|
|
163
|
+
if (input.mode === 'create' &&
|
|
164
|
+
safeError.code === StorageErrorCode.CONFLICT &&
|
|
165
|
+
mapCreateConflict !== undefined) {
|
|
166
|
+
try {
|
|
167
|
+
return await mapCreateConflict({ path: input.path });
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
throw new AiSdkWorkspaceToolError(StorageErrorCode.PROVIDER);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
throw safeError;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
158
176
|
function serializeFile(file) {
|
|
177
|
+
if (file.etag !== undefined && !isCanonicalStorageEtag(file.etag)) {
|
|
178
|
+
throw new Error('Workspace returned a malformed ETag.');
|
|
179
|
+
}
|
|
159
180
|
return {
|
|
160
181
|
kind: 'file',
|
|
161
182
|
path: file.path,
|
|
@@ -189,16 +210,18 @@ function serializePage(page) {
|
|
|
189
210
|
* The workspace remains the enforcing boundary if a retained tool reference
|
|
190
211
|
* is invoked after further narrowing.
|
|
191
212
|
*/
|
|
192
|
-
export function createAiSdkWorkspaceTools({ workspace, maxReadBytes: requestedMaxReadBytes, requireApproval = true, }) {
|
|
213
|
+
export function createAiSdkWorkspaceTools({ workspace, maxReadBytes: requestedMaxReadBytes, requireApproval = true, mapCreateConflict, }) {
|
|
193
214
|
const maxReadBytes = resolveReadLimit(workspace, requestedMaxReadBytes);
|
|
194
215
|
const tools = {};
|
|
195
216
|
const pathSchema = logicalPath('File path', workspace.limits.maxPathBytes);
|
|
196
217
|
const directorySchema = logicalPath('Directory path', workspace.limits.maxPathBytes);
|
|
197
|
-
const etagSchema = boundedEtag(
|
|
218
|
+
const etagSchema = boundedEtag();
|
|
198
219
|
if (workspace.allows('list')) {
|
|
199
220
|
tools.workspace_list = tool({
|
|
200
221
|
description: 'List files and directories inside the mounted workspace. Omit directory to list the workspace root.',
|
|
201
|
-
|
|
222
|
+
// Optional pagination and directory inputs are not compatible with
|
|
223
|
+
// OpenAI strict function schemas, which require every property.
|
|
224
|
+
strict: false,
|
|
202
225
|
inputSchema: z
|
|
203
226
|
.object({
|
|
204
227
|
directory: directorySchema.optional(),
|
|
@@ -207,7 +230,7 @@ export function createAiSdkWorkspaceTools({ workspace, maxReadBytes: requestedMa
|
|
|
207
230
|
.optional()
|
|
208
231
|
.describe('Whether to include descendants recursively.'),
|
|
209
232
|
limit: positiveIntegerAtMost(workspace.limits.maxPageSize, `Maximum entries to return, up to ${workspace.limits.maxPageSize}.`),
|
|
210
|
-
cursor: continuationCursor('Opaque
|
|
233
|
+
cursor: continuationCursor('Opaque cursor returned by a preceding list call. It may be replayed before expiry while its provider continuation remains valid; repeat the same directory, recursive, and limit options when continuing.', workspace.limits.maxCursorBytes),
|
|
211
234
|
})
|
|
212
235
|
.strict(),
|
|
213
236
|
execute: (input, { abortSignal }) => executeSafely(abortSignal, async () => serializePage(await workspace.list({
|
|
@@ -243,7 +266,8 @@ export function createAiSdkWorkspaceTools({ workspace, maxReadBytes: requestedMa
|
|
|
243
266
|
if (workspace.allows('search')) {
|
|
244
267
|
tools.workspace_search = tool({
|
|
245
268
|
description: 'Search logical paths inside the mounted workspace using a bounded glob, substring, or exact match. Omit directory to search from the workspace root.',
|
|
246
|
-
|
|
269
|
+
// Search intentionally has optional filters and cursor inputs.
|
|
270
|
+
strict: false,
|
|
247
271
|
inputSchema: z
|
|
248
272
|
.object({
|
|
249
273
|
query: searchQuery(workspace.limits.maxPathBytes),
|
|
@@ -254,7 +278,7 @@ export function createAiSdkWorkspaceTools({ workspace, maxReadBytes: requestedMa
|
|
|
254
278
|
.describe('Matching strategy; defaults to glob.'),
|
|
255
279
|
caseInsensitive: z.boolean().optional(),
|
|
256
280
|
limit: positiveIntegerAtMost(workspace.limits.maxSearchResults, `Maximum matches to return, up to ${workspace.limits.maxSearchResults}.`),
|
|
257
|
-
cursor: continuationCursor('Opaque
|
|
281
|
+
cursor: continuationCursor('Opaque cursor returned by a preceding search call. It may be replayed before expiry while its provider continuation remains valid; repeat the same query, directory, match, caseInsensitive, and limit options when continuing.', workspace.limits.maxCursorBytes),
|
|
258
282
|
})
|
|
259
283
|
.strict(),
|
|
260
284
|
execute: ({ query, directory, match, caseInsensitive, limit, cursor }, { abortSignal }) => executeSafely(abortSignal, async () => serializePage(await workspace.search(query, {
|
|
@@ -301,10 +325,13 @@ export function createAiSdkWorkspaceTools({ workspace, maxReadBytes: requestedMa
|
|
|
301
325
|
: canCreate
|
|
302
326
|
? 'Create a new UTF-8 text file inside the mounted workspace. The operation fails if the destination already exists.'
|
|
303
327
|
: 'Replace an existing UTF-8 text file inside the mounted workspace using its current ETag.',
|
|
304
|
-
|
|
328
|
+
// The combined create/replace schema is a discriminated union. OpenAI
|
|
329
|
+
// strict function tools reject its root-level oneOf, while the runtime
|
|
330
|
+
// Zod schema continues to validate every tool call in non-strict mode.
|
|
331
|
+
strict: !(canCreate && canReplace),
|
|
305
332
|
inputSchema,
|
|
306
333
|
needsApproval: resolveApproval('workspace_write_file', requireApproval),
|
|
307
|
-
execute: (input, { abortSignal }) =>
|
|
334
|
+
execute: (input, { abortSignal }) => executeCreateAware(abortSignal, input, async () => serializeFile(input.mode === 'create'
|
|
308
335
|
? await workspace.writeFile(input.path, input.content, {
|
|
309
336
|
mode: 'create',
|
|
310
337
|
...operationOptions(abortSignal),
|
|
@@ -313,7 +340,7 @@ export function createAiSdkWorkspaceTools({ workspace, maxReadBytes: requestedMa
|
|
|
313
340
|
mode: 'replace',
|
|
314
341
|
etag: input.etag,
|
|
315
342
|
...operationOptions(abortSignal),
|
|
316
|
-
}))),
|
|
343
|
+
})), mapCreateConflict),
|
|
317
344
|
});
|
|
318
345
|
}
|
|
319
346
|
const canCopy = workspace.allows('copy') &&
|
|
@@ -321,16 +348,20 @@ export function createAiSdkWorkspaceTools({ workspace, maxReadBytes: requestedMa
|
|
|
321
348
|
workspace.allows('create');
|
|
322
349
|
if (canCopy) {
|
|
323
350
|
tools.workspace_copy_file = tool({
|
|
324
|
-
description: 'Copy a file inside the mounted workspace. The source remains intact, and the operation fails if the destination already exists.',
|
|
351
|
+
description: 'Copy an exact observed version of a file inside the mounted workspace. The source remains intact, and the operation fails if the source changed or the destination already exists.',
|
|
325
352
|
strict: true,
|
|
326
353
|
inputSchema: z
|
|
327
354
|
.object({
|
|
328
355
|
source: logicalPath('Source file path', workspace.limits.maxPathBytes),
|
|
329
356
|
destination: logicalPath('Destination file path', workspace.limits.maxPathBytes),
|
|
357
|
+
etag: etagSchema.describe('Exact ETag of the source returned by the latest workspace stat or read.'),
|
|
330
358
|
})
|
|
331
359
|
.strict(),
|
|
332
360
|
needsApproval: resolveApproval('workspace_copy_file', requireApproval),
|
|
333
|
-
execute: ({ source, destination }, { abortSignal }) => executeSafely(abortSignal, async () => serializeFile(await workspace.copyFile(source, destination,
|
|
361
|
+
execute: ({ source, destination, etag }, { abortSignal }) => executeSafely(abortSignal, async () => serializeFile(await workspace.copyFile(source, destination, {
|
|
362
|
+
etag,
|
|
363
|
+
...operationOptions(abortSignal),
|
|
364
|
+
}))),
|
|
334
365
|
});
|
|
335
366
|
}
|
|
336
367
|
const canMove = workspace.allows('move') &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-sdk-workspace-tools.js","sourceRoot":"","sources":["../../src/ai-sdk/ai-sdk-workspace-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAgB,MAAM,IAAI,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,uBAAuB,GAKxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,gBAAgB,EAChB,cAAc,GAEf,MAAM,qBAAqB,CAAC;AAE7B,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,gBAAgB;IAChB,gBAAgB;IAChB,qBAAqB;IACrB,kBAAkB;IAClB,sBAAsB;IACtB,qBAAqB;IACrB,qBAAqB;IACrB,uBAAuB;CACf,CAAC;AAkCX,MAAM,mBAAmB,GAErB;IACF,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,6CAA6C;IAC3E,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAC7B,mDAAmD;IACrD,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EACzB,8HAA8H;IAChI,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAC1B,mDAAmD;IACrD,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,wCAAwC;IAC7E,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAC9B,sEAAsE;IACxE,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,sCAAsC;IAClE,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,oCAAoC;IAChE,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAC/B,sDAAsD;IACxD,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,iCAAiC;CAC/D,CAAC;AAEF;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACvC,IAAI,CAA8B;IAE3C,YAAY,IAAiC;QAC3C,KAAK,CAA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,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,KAAa;IAEb,OAAO,iBAAiB,CAAC,GAAG,CAAC,KAAuC,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import { tool, type ToolSet } from 'ai';\nimport { z } from 'zod';\n\nimport {\n isStorageWorkspaceError,\n type StorageWorkspace,\n type StorageWorkspaceEntry,\n type StorageWorkspaceFile,\n type StorageWorkspaceTextFile,\n} from '../workspace/index.js';\nimport {\n StorageErrorCode,\n isStorageError,\n type StorageErrorCode as StorageErrorCodeValue,\n} from '../storage.error.js';\n\nexport const AI_SDK_WORKSPACE_TOOL_NAMES = [\n 'workspace_list',\n 'workspace_stat',\n 'workspace_read_file',\n 'workspace_search',\n 'workspace_write_file',\n 'workspace_copy_file',\n 'workspace_move_file',\n 'workspace_delete_file',\n] as const;\n\nexport type AiSdkWorkspaceToolName =\n (typeof AI_SDK_WORKSPACE_TOOL_NAMES)[number];\n\nexport type AiSdkWorkspaceMutationToolName = Extract<\n AiSdkWorkspaceToolName,\n | 'workspace_write_file'\n | 'workspace_copy_file'\n | 'workspace_move_file'\n | 'workspace_delete_file'\n>;\n\n/**\n * Approval policy for mutation tools. An omitted entry defaults to requiring\n * approval, matching an omitted policy.\n */\nexport type AiSdkWorkspaceApprovalConfig =\n boolean | Partial<Record<AiSdkWorkspaceMutationToolName, boolean>>;\n\nexport interface CreateAiSdkWorkspaceToolsOptions {\n /** The already-mounted, policy-enforcing workspace exposed to the tools. */\n workspace: StorageWorkspace;\n /**\n * Optional tighter read ceiling. Values above the workspace ceiling are\n * clamped; the model cannot choose or raise this value.\n */\n maxReadBytes?: number;\n /** Mutation tools require approval by default. */\n requireApproval?: AiSdkWorkspaceApprovalConfig;\n}\n\nexport type AiSdkWorkspaceToolErrorCode = StorageErrorCodeValue;\n\nconst SAFE_ERROR_MESSAGES: Readonly<\n Record<AiSdkWorkspaceToolErrorCode, string>\n> = {\n [StorageErrorCode.NOT_FOUND]: 'The requested workspace path was not found.',\n [StorageErrorCode.UNAUTHORIZED]:\n 'This operation is not permitted in the workspace.',\n [StorageErrorCode.CONFLICT]:\n 'The operation conflicts with current workspace state. Refresh metadata and retry with the current ETag or a new destination.',\n [StorageErrorCode.READ_ONLY]:\n 'This operation is not permitted in the workspace.',\n [StorageErrorCode.INVALID_ARGUMENT]: 'The workspace tool input was rejected.',\n [StorageErrorCode.NOT_SUPPORTED]:\n 'This workspace operation is not supported by the configured storage.',\n [StorageErrorCode.ABORTED]: 'The workspace operation was aborted.',\n [StorageErrorCode.TIMEOUT]: 'The workspace operation timed out.',\n [StorageErrorCode.LIMIT_EXCEEDED]:\n 'The workspace operation exceeded a configured limit.',\n [StorageErrorCode.PROVIDER]: 'The workspace operation failed.',\n};\n\n/**\n * Safe error exposed at the AI tool boundary. It deliberately carries no\n * provider error, storage key, mount prefix, store name, or cause.\n */\nexport class AiSdkWorkspaceToolError extends Error {\n readonly code: AiSdkWorkspaceToolErrorCode;\n\n constructor(code: AiSdkWorkspaceToolErrorCode) {\n super(SAFE_ERROR_MESSAGES[code]);\n this.name = 'AiSdkWorkspaceToolError';\n this.code = code;\n }\n}\n\nexport interface AiSdkWorkspaceFileResult {\n kind: 'file';\n path: string;\n name: string;\n size: number;\n contentType: string;\n etag?: string;\n lastModified?: string;\n}\n\nexport interface AiSdkWorkspaceDirectoryResult {\n kind: 'directory';\n path: string;\n name: string;\n}\n\nexport type AiSdkWorkspaceEntryResult =\n AiSdkWorkspaceFileResult | AiSdkWorkspaceDirectoryResult;\n\nexport interface AiSdkWorkspaceTextFileResult extends AiSdkWorkspaceFileResult {\n text: string;\n}\n\nexport interface AiSdkWorkspacePageResult {\n entries: AiSdkWorkspaceEntryResult[];\n cursor?: string;\n}\n\nconst mutationToolNames = new Set<AiSdkWorkspaceMutationToolName>([\n 'workspace_write_file',\n 'workspace_copy_file',\n 'workspace_move_file',\n 'workspace_delete_file',\n]);\nconst utf8Encoder = new TextEncoder();\nconst forbiddenUnicodeCharacter = /\\p{C}/u;\nconst workspaceCursor = /^[A-Za-z0-9_-]{32}$/u;\nconst windowsDeviceName = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/iu;\n\nfunction isLogicalPath(value: string): boolean {\n if (\n value.length === 0 ||\n value.startsWith('/') ||\n value.endsWith('/') ||\n value !== value.normalize('NFC') ||\n value.includes('\\\\') ||\n forbiddenUnicodeCharacter.test(value)\n ) {\n return false;\n }\n\n return value\n .split('/')\n .every(\n (segment) =>\n segment.length > 0 &&\n segment !== '.' &&\n segment !== '..' &&\n !segment.includes(':') &&\n !segment.endsWith('.') &&\n !segment.endsWith(' ') &&\n !windowsDeviceName.test(segment),\n );\n}\n\nfunction logicalPath(label: string, maxBytes: number) {\n return z\n .string()\n .min(1)\n .refine(isLogicalPath, {\n message: `${label} must be a portable, NFC-normalized, relative POSIX workspace path.`,\n })\n .refine((value) => utf8Encoder.encode(value).byteLength <= maxBytes, {\n message: `${label} exceeds the ${maxBytes}-byte workspace path limit.`,\n })\n .describe(\n `${label}. Use an NFC-normalized relative POSIX path inside the mounted workspace. Empty, dot, parent, colon, trailing dot or space, and Windows reserved device segments are forbidden.`,\n );\n}\n\nfunction searchQuery(maxBytes: number) {\n return z\n .string()\n .min(1)\n .refine(\n (value) =>\n !value.includes('\\\\') && !forbiddenUnicodeCharacter.test(value),\n { message: 'Search query contains forbidden characters.' },\n )\n .refine((value) => utf8Encoder.encode(value).byteLength <= maxBytes, {\n message: `Search query exceeds the ${maxBytes}-byte workspace limit.`,\n })\n .describe('Path pattern or text to find inside the mounted workspace.');\n}\n\nfunction boundedEtag(maxBytes: number) {\n return z\n .string()\n .min(1)\n .refine((value) => !forbiddenUnicodeCharacter.test(value), {\n message: 'ETag contains forbidden characters.',\n })\n .refine((value) => utf8Encoder.encode(value).byteLength <= maxBytes, {\n message: `ETag exceeds the ${maxBytes}-byte workspace limit.`,\n })\n .describe('Exact ETag returned by the latest workspace stat or read.');\n}\n\nfunction continuationCursor(description: string) {\n return z\n .string()\n .regex(\n workspaceCursor,\n 'Cursor must be the opaque base64url token returned by the workspace.',\n )\n .optional()\n .describe(description);\n}\n\nfunction positiveIntegerAtMost(maximum: number, description: string) {\n return z\n .number()\n .int()\n .positive()\n .max(maximum)\n .optional()\n .describe(description);\n}\n\nfunction operationOptions(signal: AbortSignal | undefined): {\n signal?: AbortSignal;\n} {\n return signal === undefined ? {} : { signal };\n}\n\nfunction resolveApproval(\n toolName: AiSdkWorkspaceMutationToolName,\n config: AiSdkWorkspaceApprovalConfig,\n): boolean {\n return typeof config === 'boolean' ? config : (config[toolName] ?? true);\n}\n\nfunction resolveReadLimit(\n workspace: StorageWorkspace,\n requested: number | undefined,\n): number {\n const workspaceLimit = workspace.limits.maxReadBytes;\n if (!Number.isSafeInteger(workspaceLimit) || workspaceLimit <= 0) {\n throw new RangeError(\n 'workspace.limits.maxReadBytes must be a positive safe integer.',\n );\n }\n if (\n requested !== undefined &&\n (!Number.isSafeInteger(requested) || requested <= 0)\n ) {\n throw new RangeError('maxReadBytes must be a positive safe integer.');\n }\n return Math.min(requested ?? workspaceLimit, workspaceLimit);\n}\n\nfunction sanitizeToolError(\n error: unknown,\n signal: AbortSignal | undefined,\n): AiSdkWorkspaceToolError {\n if (error instanceof AiSdkWorkspaceToolError) {\n return error;\n }\n if (signal?.aborted === true) {\n return new AiSdkWorkspaceToolError(StorageErrorCode.ABORTED);\n }\n if (isStorageWorkspaceError(error)) {\n return new AiSdkWorkspaceToolError(error.code);\n }\n if (isStorageError(error)) {\n return new AiSdkWorkspaceToolError(error.code);\n }\n return new AiSdkWorkspaceToolError(StorageErrorCode.PROVIDER);\n}\n\nasync function executeSafely<Result>(\n signal: AbortSignal | undefined,\n operation: () => Promise<Result>,\n): Promise<Result> {\n try {\n return await operation();\n } catch (error) {\n throw sanitizeToolError(error, signal);\n }\n}\n\nfunction serializeFile(file: StorageWorkspaceFile): AiSdkWorkspaceFileResult {\n return {\n kind: 'file',\n path: file.path,\n name: file.name,\n size: file.size,\n contentType: file.contentType,\n ...(file.etag === undefined ? {} : { etag: file.etag }),\n ...(file.lastModified === undefined\n ? {}\n : { lastModified: file.lastModified.toISOString() }),\n };\n}\n\nfunction serializeEntry(\n entry: StorageWorkspaceEntry,\n): AiSdkWorkspaceEntryResult {\n return entry.kind === 'file'\n ? serializeFile(entry)\n : { kind: 'directory', path: entry.path, name: entry.name };\n}\n\nfunction serializeTextFile(\n file: StorageWorkspaceTextFile,\n): AiSdkWorkspaceTextFileResult {\n return { ...serializeFile(file), text: file.text };\n}\n\nfunction serializePage(page: {\n entries: StorageWorkspaceEntry[];\n cursor?: string;\n}): AiSdkWorkspacePageResult {\n return {\n entries: page.entries.map(serializeEntry),\n ...(page.cursor === undefined ? {} : { cursor: page.cursor }),\n };\n}\n\n/**\n * Creates Vercel AI SDK tools backed only by a mounted StorageWorkspace.\n *\n * A tool is omitted unless the workspace grants its required permission.\n * The workspace remains the enforcing boundary if a retained tool reference\n * is invoked after further narrowing.\n */\nexport function createAiSdkWorkspaceTools({\n workspace,\n maxReadBytes: requestedMaxReadBytes,\n requireApproval = true,\n}: CreateAiSdkWorkspaceToolsOptions): ToolSet {\n const maxReadBytes = resolveReadLimit(workspace, requestedMaxReadBytes);\n const tools: ToolSet = {};\n const pathSchema = logicalPath('File path', workspace.limits.maxPathBytes);\n const directorySchema = logicalPath(\n 'Directory path',\n workspace.limits.maxPathBytes,\n );\n const etagSchema = boundedEtag(workspace.limits.maxPathBytes);\n\n if (workspace.allows('list')) {\n tools.workspace_list = tool({\n description:\n 'List files and directories inside the mounted workspace. Omit directory to list the workspace root.',\n strict: true,\n inputSchema: z\n .object({\n directory: directorySchema.optional(),\n recursive: z\n .boolean()\n .optional()\n .describe('Whether to include descendants recursively.'),\n limit: positiveIntegerAtMost(\n workspace.limits.maxPageSize,\n `Maximum entries to return, up to ${workspace.limits.maxPageSize}.`,\n ),\n cursor: continuationCursor(\n 'Opaque one-use cursor returned by the preceding list call. Repeat the same directory, recursive, and limit options when continuing.',\n ),\n })\n .strict(),\n execute: (input, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializePage(\n await workspace.list({\n ...(input.directory === undefined\n ? {}\n : { directory: input.directory }),\n ...(input.recursive === undefined\n ? {}\n : { recursive: input.recursive }),\n ...(input.limit === undefined ? {} : { limit: input.limit }),\n ...(input.cursor === undefined ? {} : { cursor: input.cursor }),\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n if (workspace.allows('read')) {\n tools.workspace_stat = tool({\n description:\n 'Inspect a file inside the mounted workspace without reading its contents. Returns the ETag required for safe replace, move, and delete operations.',\n strict: true,\n inputSchema: z.object({ path: pathSchema }).strict(),\n execute: ({ path }, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializeFile(\n await workspace.stat(path, operationOptions(abortSignal)),\n ),\n ),\n });\n\n tools.workspace_read_file = tool({\n description: `Read a UTF-8 text file inside the mounted workspace. The result is bounded to ${maxReadBytes} bytes.`,\n strict: true,\n inputSchema: z.object({ path: pathSchema }).strict(),\n execute: ({ path }, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializeTextFile(\n await workspace.readText(path, {\n maxBytes: maxReadBytes,\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n if (workspace.allows('search')) {\n tools.workspace_search = tool({\n description:\n 'Search logical paths inside the mounted workspace using a bounded glob, substring, or exact match. Omit directory to search from the workspace root.',\n strict: true,\n inputSchema: z\n .object({\n query: searchQuery(workspace.limits.maxPathBytes),\n directory: directorySchema.optional(),\n match: z\n .enum(['glob', 'substring', 'exact'])\n .optional()\n .describe('Matching strategy; defaults to glob.'),\n caseInsensitive: z.boolean().optional(),\n limit: positiveIntegerAtMost(\n workspace.limits.maxSearchResults,\n `Maximum matches to return, up to ${workspace.limits.maxSearchResults}.`,\n ),\n cursor: continuationCursor(\n 'Opaque one-use cursor returned by the preceding search call. Repeat the same query, directory, match, caseInsensitive, and limit options when continuing.',\n ),\n })\n .strict(),\n execute: (\n { query, directory, match, caseInsensitive, limit, cursor },\n { abortSignal },\n ) =>\n executeSafely(abortSignal, async () =>\n serializePage(\n await workspace.search(query, {\n ...(directory === undefined ? {} : { directory }),\n ...(match === undefined ? {} : { match }),\n ...(caseInsensitive === undefined ? {} : { caseInsensitive }),\n ...(limit === undefined ? {} : { limit }),\n ...(cursor === undefined ? {} : { cursor }),\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n const canCreate = workspace.allows('create');\n const canReplace = workspace.allows('replace');\n if (canCreate || canReplace) {\n const commonWriteShape = {\n path: pathSchema,\n content: z\n .string()\n .refine(\n (value) =>\n utf8Encoder.encode(value).byteLength <=\n workspace.limits.maxWriteBytes,\n {\n message: `Content exceeds the ${workspace.limits.maxWriteBytes}-byte workspace write limit.`,\n },\n )\n .describe(\n `UTF-8 text to write. The workspace enforces its ${workspace.limits.maxWriteBytes}-byte write limit.`,\n ),\n };\n const createSchema = z\n .object({ ...commonWriteShape, mode: z.literal('create') })\n .strict();\n const replaceSchema = z\n .object({\n ...commonWriteShape,\n mode: z.literal('replace'),\n etag: etagSchema,\n })\n .strict();\n const inputSchema =\n canCreate && canReplace\n ? z.discriminatedUnion('mode', [createSchema, replaceSchema])\n : canCreate\n ? createSchema\n : replaceSchema;\n\n tools.workspace_write_file = tool({\n description:\n canCreate && canReplace\n ? 'Create a new UTF-8 text file or replace an existing file inside the mounted workspace. Create fails if the destination exists; replace requires its current ETag.'\n : canCreate\n ? 'Create a new UTF-8 text file inside the mounted workspace. The operation fails if the destination already exists.'\n : 'Replace an existing UTF-8 text file inside the mounted workspace using its current ETag.',\n strict: true,\n inputSchema,\n needsApproval: resolveApproval('workspace_write_file', requireApproval),\n execute: (input, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializeFile(\n input.mode === 'create'\n ? await workspace.writeFile(input.path, input.content, {\n mode: 'create',\n ...operationOptions(abortSignal),\n })\n : await workspace.writeFile(input.path, input.content, {\n mode: 'replace',\n etag: input.etag,\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n const canCopy =\n workspace.allows('copy') &&\n workspace.allows('read') &&\n workspace.allows('create');\n if (canCopy) {\n tools.workspace_copy_file = tool({\n description:\n 'Copy a file inside the mounted workspace. The source remains intact, and the operation fails if the destination already exists.',\n strict: true,\n inputSchema: z\n .object({\n source: logicalPath(\n 'Source file path',\n workspace.limits.maxPathBytes,\n ),\n destination: logicalPath(\n 'Destination file path',\n workspace.limits.maxPathBytes,\n ),\n })\n .strict(),\n needsApproval: resolveApproval('workspace_copy_file', requireApproval),\n execute: ({ source, destination }, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializeFile(\n await workspace.copyFile(\n source,\n destination,\n operationOptions(abortSignal),\n ),\n ),\n ),\n });\n }\n\n const canMove =\n workspace.allows('move') &&\n workspace.allows('read') &&\n workspace.allows('create') &&\n workspace.allows('delete');\n if (canMove) {\n tools.workspace_move_file = tool({\n description:\n \"Move a file inside the mounted workspace using the source's current ETag. The operation fails if the destination already exists. If source deletion cannot be confirmed, the destination is retained and the tool reports a conflict; inspect both paths before retrying.\",\n strict: true,\n inputSchema: z\n .object({\n source: logicalPath(\n 'Source file path',\n workspace.limits.maxPathBytes,\n ),\n destination: logicalPath(\n 'Destination file path',\n workspace.limits.maxPathBytes,\n ),\n etag: etagSchema.describe(\n 'Exact ETag of the source returned by the latest workspace stat or read.',\n ),\n })\n .strict(),\n needsApproval: resolveApproval('workspace_move_file', requireApproval),\n execute: ({ source, destination, etag }, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializeFile(\n await workspace.moveFile(source, destination, {\n etag,\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n if (workspace.allows('delete')) {\n tools.workspace_delete_file = tool({\n description:\n 'Delete a file inside the mounted workspace using its current ETag.',\n strict: true,\n inputSchema: z\n .object({\n path: pathSchema,\n etag: etagSchema,\n })\n .strict(),\n needsApproval: resolveApproval('workspace_delete_file', requireApproval),\n execute: ({ path, etag }, { abortSignal }) =>\n executeSafely(abortSignal, async () => {\n await workspace.deleteFile(path, {\n etag,\n ...operationOptions(abortSignal),\n });\n return { deleted: true as const, path };\n }),\n });\n }\n\n return tools;\n}\n\nexport function isAiSdkWorkspaceMutationToolName(\n value: string,\n): value is AiSdkWorkspaceMutationToolName {\n return mutationToolNames.has(value as AiSdkWorkspaceMutationToolName);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ai-sdk-workspace-tools.js","sourceRoot":"","sources":["../../src/ai-sdk/ai-sdk-workspace-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAgC,MAAM,IAAI,CAAC;AACxD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,kCAAkC,EAClC,uBAAuB,GAKxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,gBAAgB,EAChB,cAAc,GAEf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,gBAAgB;IAChB,gBAAgB;IAChB,qBAAqB;IACrB,kBAAkB;IAClB,sBAAsB;IACtB,qBAAqB;IACrB,qBAAqB;IACrB,uBAAuB;CACf,CAAC;AAmDX,MAAM,mBAAmB,GAErB;IACF,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAAE,6CAA6C;IAC3E,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAC7B,mDAAmD;IACrD,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EACzB,8HAA8H;IAChI,CAAC,gBAAgB,CAAC,SAAS,CAAC,EAC1B,mDAAmD;IACrD,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,wCAAwC;IAC7E,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAC9B,sEAAsE;IACxE,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,sCAAsC;IAClE,CAAC,gBA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AAC;AACf,CAAC;AAED,MAAM,UAAU,gCAAgC,CAC9C,KAAa;IAEb,OAAO,iBAAiB,CAAC,GAAG,CAAC,KAAuC,CAAC,CAAC;AACxE,CAAC","sourcesContent":["import { tool, type JSONValue, type ToolSet } from 'ai';\nimport { z } from 'zod';\n\nimport {\n STORAGE_WORKSPACE_MAX_CURSOR_BYTES,\n isStorageWorkspaceError,\n type StorageWorkspace,\n type StorageWorkspaceEntry,\n type StorageWorkspaceFile,\n type StorageWorkspaceTextFile,\n} from '../workspace/index.js';\nimport {\n StorageErrorCode,\n isStorageError,\n type StorageErrorCode as StorageErrorCodeValue,\n} from '../storage.error.js';\nimport { isCanonicalStorageEtag } from '../storage-etag.js';\n\nexport const AI_SDK_WORKSPACE_TOOL_NAMES = [\n 'workspace_list',\n 'workspace_stat',\n 'workspace_read_file',\n 'workspace_search',\n 'workspace_write_file',\n 'workspace_copy_file',\n 'workspace_move_file',\n 'workspace_delete_file',\n] as const;\n\nexport type AiSdkWorkspaceToolName =\n (typeof AI_SDK_WORKSPACE_TOOL_NAMES)[number];\n\nexport type AiSdkWorkspaceMutationToolName = Extract<\n AiSdkWorkspaceToolName,\n | 'workspace_write_file'\n | 'workspace_copy_file'\n | 'workspace_move_file'\n | 'workspace_delete_file'\n>;\n\n/**\n * Approval policy for mutation tools. An omitted entry defaults to requiring\n * approval, matching an omitted policy.\n */\nexport type AiSdkWorkspaceApprovalConfig =\n boolean | Partial<Record<AiSdkWorkspaceMutationToolName, boolean>>;\n\nexport interface AiSdkWorkspaceCreateConflict {\n /** The logical destination inside the mounted workspace. */\n readonly path: string;\n}\n\nexport type AiSdkWorkspaceCreateConflictMapper<Result extends JSONValue> = (\n conflict: AiSdkWorkspaceCreateConflict,\n) => PromiseLike<Result> | Result;\n\nexport interface CreateAiSdkWorkspaceToolsOptions<\n CreateConflictResult extends JSONValue = never,\n> {\n /** The already-mounted, policy-enforcing workspace exposed to the tools. */\n workspace: StorageWorkspace;\n /**\n * Optional tighter read ceiling. Values above the workspace ceiling are\n * clamped; the model cannot choose or raise this value.\n */\n maxReadBytes?: number;\n /** Mutation tools require approval by default. */\n requireApproval?: AiSdkWorkspaceApprovalConfig;\n /**\n * Maps an atomic create collision to an application result. When omitted,\n * the collision remains an AiSdkWorkspaceToolError like every other storage\n * failure. Replace conflicts are never mapped by this hook.\n */\n mapCreateConflict?: AiSdkWorkspaceCreateConflictMapper<CreateConflictResult>;\n}\n\nexport type AiSdkWorkspaceToolErrorCode = StorageErrorCodeValue;\n\nconst SAFE_ERROR_MESSAGES: Readonly<\n Record<AiSdkWorkspaceToolErrorCode, string>\n> = {\n [StorageErrorCode.NOT_FOUND]: 'The requested workspace path was not found.',\n [StorageErrorCode.UNAUTHORIZED]:\n 'This operation is not permitted in the workspace.',\n [StorageErrorCode.CONFLICT]:\n 'The operation conflicts with current workspace state. Refresh metadata and retry with the current ETag or a new destination.',\n [StorageErrorCode.READ_ONLY]:\n 'This operation is not permitted in the workspace.',\n [StorageErrorCode.INVALID_ARGUMENT]: 'The workspace tool input was rejected.',\n [StorageErrorCode.NOT_SUPPORTED]:\n 'This workspace operation is not supported by the configured storage.',\n [StorageErrorCode.ABORTED]: 'The workspace operation was aborted.',\n [StorageErrorCode.TIMEOUT]: 'The workspace operation timed out.',\n [StorageErrorCode.LIMIT_EXCEEDED]:\n 'The workspace operation exceeded a configured limit.',\n [StorageErrorCode.PROVIDER]: 'The workspace operation failed.',\n};\n\n/**\n * Safe error exposed at the AI tool boundary. It deliberately carries no\n * provider error, storage key, mount prefix, store name, or cause.\n */\nexport class AiSdkWorkspaceToolError extends Error {\n readonly code: AiSdkWorkspaceToolErrorCode;\n\n constructor(code: AiSdkWorkspaceToolErrorCode) {\n super(SAFE_ERROR_MESSAGES[code]);\n this.name = 'AiSdkWorkspaceToolError';\n this.code = code;\n }\n}\n\nexport interface AiSdkWorkspaceFileResult {\n kind: 'file';\n path: string;\n name: string;\n size: number;\n contentType: string;\n etag?: string;\n lastModified?: string;\n}\n\nexport interface AiSdkWorkspaceDirectoryResult {\n kind: 'directory';\n path: string;\n name: string;\n}\n\nexport type AiSdkWorkspaceEntryResult =\n AiSdkWorkspaceFileResult | AiSdkWorkspaceDirectoryResult;\n\nexport interface AiSdkWorkspaceTextFileResult extends AiSdkWorkspaceFileResult {\n text: string;\n}\n\nexport interface AiSdkWorkspacePageResult {\n entries: AiSdkWorkspaceEntryResult[];\n cursor?: string;\n}\n\nconst mutationToolNames = new Set<AiSdkWorkspaceMutationToolName>([\n 'workspace_write_file',\n 'workspace_copy_file',\n 'workspace_move_file',\n 'workspace_delete_file',\n]);\nconst utf8Encoder = new TextEncoder();\nconst forbiddenUnicodeCharacter = /\\p{C}/u;\nconst workspaceCursor = /^[A-Za-z0-9._-]+$/u;\nconst windowsDeviceName = /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\\..*)?$/iu;\n\nfunction isLogicalPath(value: string): boolean {\n if (\n value.length === 0 ||\n value.startsWith('/') ||\n value.endsWith('/') ||\n value !== value.normalize('NFC') ||\n value.includes('\\\\') ||\n forbiddenUnicodeCharacter.test(value)\n ) {\n return false;\n }\n\n return value\n .split('/')\n .every(\n (segment) =>\n segment.length > 0 &&\n segment !== '.' &&\n segment !== '..' &&\n !segment.includes(':') &&\n !segment.endsWith('.') &&\n !segment.endsWith(' ') &&\n !windowsDeviceName.test(segment),\n );\n}\n\nfunction logicalPath(label: string, maxBytes: number) {\n return z\n .string()\n .min(1)\n .refine(isLogicalPath, {\n message: `${label} must be a portable, NFC-normalized, relative POSIX workspace path.`,\n })\n .refine((value) => utf8Encoder.encode(value).byteLength <= maxBytes, {\n message: `${label} exceeds the ${maxBytes}-byte workspace path limit.`,\n })\n .describe(\n `${label}. Use an NFC-normalized relative POSIX path inside the mounted workspace. Empty, dot, parent, colon, trailing dot or space, and Windows reserved device segments are forbidden.`,\n );\n}\n\nfunction searchQuery(maxBytes: number) {\n return z\n .string()\n .min(1)\n .refine(\n (value) =>\n !value.includes('\\\\') && !forbiddenUnicodeCharacter.test(value),\n { message: 'Search query contains forbidden characters.' },\n )\n .refine((value) => utf8Encoder.encode(value).byteLength <= maxBytes, {\n message: `Search query exceeds the ${maxBytes}-byte workspace limit.`,\n })\n .describe('Path pattern or text to find inside the mounted workspace.');\n}\n\nfunction boundedEtag() {\n return z\n .string()\n .refine(isCanonicalStorageEtag, {\n message: 'ETag must be a canonical bare value of at most 1,024 bytes.',\n })\n .describe(\n 'Exact canonical bare ETag returned by the latest workspace stat or read.',\n );\n}\n\nfunction continuationCursor(description: string, maxBytes: number) {\n return z\n .string()\n .min(1)\n .max(Math.min(STORAGE_WORKSPACE_MAX_CURSOR_BYTES, maxBytes))\n .regex(\n workspaceCursor,\n 'Cursor must be the bounded opaque token returned by the workspace.',\n )\n .optional()\n .describe(description);\n}\n\nfunction positiveIntegerAtMost(maximum: number, description: string) {\n return z\n .number()\n .int()\n .positive()\n .max(maximum)\n .optional()\n .describe(description);\n}\n\nfunction operationOptions(signal: AbortSignal | undefined): {\n signal?: AbortSignal;\n} {\n return signal === undefined ? {} : { signal };\n}\n\nfunction resolveApproval(\n toolName: AiSdkWorkspaceMutationToolName,\n config: AiSdkWorkspaceApprovalConfig,\n): boolean {\n return typeof config === 'boolean' ? config : (config[toolName] ?? true);\n}\n\nfunction resolveReadLimit(\n workspace: StorageWorkspace,\n requested: number | undefined,\n): number {\n const workspaceLimit = workspace.limits.maxReadBytes;\n if (!Number.isSafeInteger(workspaceLimit) || workspaceLimit <= 0) {\n throw new RangeError(\n 'workspace.limits.maxReadBytes must be a positive safe integer.',\n );\n }\n if (\n requested !== undefined &&\n (!Number.isSafeInteger(requested) || requested <= 0)\n ) {\n throw new RangeError('maxReadBytes must be a positive safe integer.');\n }\n return Math.min(requested ?? workspaceLimit, workspaceLimit);\n}\n\nfunction sanitizeToolError(\n error: unknown,\n signal: AbortSignal | undefined,\n): AiSdkWorkspaceToolError {\n if (error instanceof AiSdkWorkspaceToolError) {\n return error;\n }\n if (signal?.aborted === true) {\n return new AiSdkWorkspaceToolError(StorageErrorCode.ABORTED);\n }\n if (isStorageWorkspaceError(error)) {\n return new AiSdkWorkspaceToolError(error.code);\n }\n if (isStorageError(error)) {\n return new AiSdkWorkspaceToolError(error.code);\n }\n return new AiSdkWorkspaceToolError(StorageErrorCode.PROVIDER);\n}\n\nasync function executeSafely<Result>(\n signal: AbortSignal | undefined,\n operation: () => Promise<Result>,\n): Promise<Result> {\n try {\n return await operation();\n } catch (error) {\n throw sanitizeToolError(error, signal);\n }\n}\n\nasync function executeCreateAware<\n Result,\n CreateConflictResult extends JSONValue,\n>(\n signal: AbortSignal | undefined,\n input: { mode: 'create' | 'replace'; path: string },\n operation: () => Promise<Result>,\n mapCreateConflict:\n AiSdkWorkspaceCreateConflictMapper<CreateConflictResult> | undefined,\n): Promise<CreateConflictResult | Result> {\n try {\n return await operation();\n } catch (error) {\n const safeError = sanitizeToolError(error, signal);\n if (\n input.mode === 'create' &&\n safeError.code === StorageErrorCode.CONFLICT &&\n mapCreateConflict !== undefined\n ) {\n try {\n return await mapCreateConflict({ path: input.path });\n } catch {\n throw new AiSdkWorkspaceToolError(StorageErrorCode.PROVIDER);\n }\n }\n throw safeError;\n }\n}\n\nfunction serializeFile(file: StorageWorkspaceFile): AiSdkWorkspaceFileResult {\n if (file.etag !== undefined && !isCanonicalStorageEtag(file.etag)) {\n throw new Error('Workspace returned a malformed ETag.');\n }\n return {\n kind: 'file',\n path: file.path,\n name: file.name,\n size: file.size,\n contentType: file.contentType,\n ...(file.etag === undefined ? {} : { etag: file.etag }),\n ...(file.lastModified === undefined\n ? {}\n : { lastModified: file.lastModified.toISOString() }),\n };\n}\n\nfunction serializeEntry(\n entry: StorageWorkspaceEntry,\n): AiSdkWorkspaceEntryResult {\n return entry.kind === 'file'\n ? serializeFile(entry)\n : { kind: 'directory', path: entry.path, name: entry.name };\n}\n\nfunction serializeTextFile(\n file: StorageWorkspaceTextFile,\n): AiSdkWorkspaceTextFileResult {\n return { ...serializeFile(file), text: file.text };\n}\n\nfunction serializePage(page: {\n entries: StorageWorkspaceEntry[];\n cursor?: string;\n}): AiSdkWorkspacePageResult {\n return {\n entries: page.entries.map(serializeEntry),\n ...(page.cursor === undefined ? {} : { cursor: page.cursor }),\n };\n}\n\n/**\n * Creates Vercel AI SDK tools backed only by a mounted StorageWorkspace.\n *\n * A tool is omitted unless the workspace grants its required permission.\n * The workspace remains the enforcing boundary if a retained tool reference\n * is invoked after further narrowing.\n */\nexport function createAiSdkWorkspaceTools<\n CreateConflictResult extends JSONValue = never,\n>({\n workspace,\n maxReadBytes: requestedMaxReadBytes,\n requireApproval = true,\n mapCreateConflict,\n}: CreateAiSdkWorkspaceToolsOptions<CreateConflictResult>): ToolSet {\n const maxReadBytes = resolveReadLimit(workspace, requestedMaxReadBytes);\n const tools: ToolSet = {};\n const pathSchema = logicalPath('File path', workspace.limits.maxPathBytes);\n const directorySchema = logicalPath(\n 'Directory path',\n workspace.limits.maxPathBytes,\n );\n const etagSchema = boundedEtag();\n\n if (workspace.allows('list')) {\n tools.workspace_list = tool({\n description:\n 'List files and directories inside the mounted workspace. Omit directory to list the workspace root.',\n // Optional pagination and directory inputs are not compatible with\n // OpenAI strict function schemas, which require every property.\n strict: false,\n inputSchema: z\n .object({\n directory: directorySchema.optional(),\n recursive: z\n .boolean()\n .optional()\n .describe('Whether to include descendants recursively.'),\n limit: positiveIntegerAtMost(\n workspace.limits.maxPageSize,\n `Maximum entries to return, up to ${workspace.limits.maxPageSize}.`,\n ),\n cursor: continuationCursor(\n 'Opaque cursor returned by a preceding list call. It may be replayed before expiry while its provider continuation remains valid; repeat the same directory, recursive, and limit options when continuing.',\n workspace.limits.maxCursorBytes,\n ),\n })\n .strict(),\n execute: (input, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializePage(\n await workspace.list({\n ...(input.directory === undefined\n ? {}\n : { directory: input.directory }),\n ...(input.recursive === undefined\n ? {}\n : { recursive: input.recursive }),\n ...(input.limit === undefined ? {} : { limit: input.limit }),\n ...(input.cursor === undefined ? {} : { cursor: input.cursor }),\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n if (workspace.allows('read')) {\n tools.workspace_stat = tool({\n description:\n 'Inspect a file inside the mounted workspace without reading its contents. Returns the ETag required for safe replace, move, and delete operations.',\n strict: true,\n inputSchema: z.object({ path: pathSchema }).strict(),\n execute: ({ path }, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializeFile(\n await workspace.stat(path, operationOptions(abortSignal)),\n ),\n ),\n });\n\n tools.workspace_read_file = tool({\n description: `Read a UTF-8 text file inside the mounted workspace. The result is bounded to ${maxReadBytes} bytes.`,\n strict: true,\n inputSchema: z.object({ path: pathSchema }).strict(),\n execute: ({ path }, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializeTextFile(\n await workspace.readText(path, {\n maxBytes: maxReadBytes,\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n if (workspace.allows('search')) {\n tools.workspace_search = tool({\n description:\n 'Search logical paths inside the mounted workspace using a bounded glob, substring, or exact match. Omit directory to search from the workspace root.',\n // Search intentionally has optional filters and cursor inputs.\n strict: false,\n inputSchema: z\n .object({\n query: searchQuery(workspace.limits.maxPathBytes),\n directory: directorySchema.optional(),\n match: z\n .enum(['glob', 'substring', 'exact'])\n .optional()\n .describe('Matching strategy; defaults to glob.'),\n caseInsensitive: z.boolean().optional(),\n limit: positiveIntegerAtMost(\n workspace.limits.maxSearchResults,\n `Maximum matches to return, up to ${workspace.limits.maxSearchResults}.`,\n ),\n cursor: continuationCursor(\n 'Opaque cursor returned by a preceding search call. It may be replayed before expiry while its provider continuation remains valid; repeat the same query, directory, match, caseInsensitive, and limit options when continuing.',\n workspace.limits.maxCursorBytes,\n ),\n })\n .strict(),\n execute: (\n { query, directory, match, caseInsensitive, limit, cursor },\n { abortSignal },\n ) =>\n executeSafely(abortSignal, async () =>\n serializePage(\n await workspace.search(query, {\n ...(directory === undefined ? {} : { directory }),\n ...(match === undefined ? {} : { match }),\n ...(caseInsensitive === undefined ? {} : { caseInsensitive }),\n ...(limit === undefined ? {} : { limit }),\n ...(cursor === undefined ? {} : { cursor }),\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n const canCreate = workspace.allows('create');\n const canReplace = workspace.allows('replace');\n if (canCreate || canReplace) {\n const commonWriteShape = {\n path: pathSchema,\n content: z\n .string()\n .refine(\n (value) =>\n utf8Encoder.encode(value).byteLength <=\n workspace.limits.maxWriteBytes,\n {\n message: `Content exceeds the ${workspace.limits.maxWriteBytes}-byte workspace write limit.`,\n },\n )\n .describe(\n `UTF-8 text to write. The workspace enforces its ${workspace.limits.maxWriteBytes}-byte write limit.`,\n ),\n };\n const createSchema = z\n .object({ ...commonWriteShape, mode: z.literal('create') })\n .strict();\n const replaceSchema = z\n .object({\n ...commonWriteShape,\n mode: z.literal('replace'),\n etag: etagSchema,\n })\n .strict();\n const inputSchema =\n canCreate && canReplace\n ? z.discriminatedUnion('mode', [createSchema, replaceSchema])\n : canCreate\n ? createSchema\n : replaceSchema;\n\n tools.workspace_write_file = tool<\n z.infer<typeof inputSchema>,\n unknown,\n Record<string, unknown>\n >({\n description:\n canCreate && canReplace\n ? 'Create a new UTF-8 text file or replace an existing file inside the mounted workspace. Create fails if the destination exists; replace requires its current ETag.'\n : canCreate\n ? 'Create a new UTF-8 text file inside the mounted workspace. The operation fails if the destination already exists.'\n : 'Replace an existing UTF-8 text file inside the mounted workspace using its current ETag.',\n // The combined create/replace schema is a discriminated union. OpenAI\n // strict function tools reject its root-level oneOf, while the runtime\n // Zod schema continues to validate every tool call in non-strict mode.\n strict: !(canCreate && canReplace),\n inputSchema,\n needsApproval: resolveApproval('workspace_write_file', requireApproval),\n execute: (input, { abortSignal }) =>\n executeCreateAware(\n abortSignal,\n input,\n async () =>\n serializeFile(\n input.mode === 'create'\n ? await workspace.writeFile(input.path, input.content, {\n mode: 'create',\n ...operationOptions(abortSignal),\n })\n : await workspace.writeFile(input.path, input.content, {\n mode: 'replace',\n etag: input.etag,\n ...operationOptions(abortSignal),\n }),\n ),\n mapCreateConflict,\n ),\n });\n }\n\n const canCopy =\n workspace.allows('copy') &&\n workspace.allows('read') &&\n workspace.allows('create');\n if (canCopy) {\n tools.workspace_copy_file = tool({\n description:\n 'Copy an exact observed version of a file inside the mounted workspace. The source remains intact, and the operation fails if the source changed or the destination already exists.',\n strict: true,\n inputSchema: z\n .object({\n source: logicalPath(\n 'Source file path',\n workspace.limits.maxPathBytes,\n ),\n destination: logicalPath(\n 'Destination file path',\n workspace.limits.maxPathBytes,\n ),\n etag: etagSchema.describe(\n 'Exact ETag of the source returned by the latest workspace stat or read.',\n ),\n })\n .strict(),\n needsApproval: resolveApproval('workspace_copy_file', requireApproval),\n execute: ({ source, destination, etag }, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializeFile(\n await workspace.copyFile(source, destination, {\n etag,\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n const canMove =\n workspace.allows('move') &&\n workspace.allows('read') &&\n workspace.allows('create') &&\n workspace.allows('delete');\n if (canMove) {\n tools.workspace_move_file = tool({\n description:\n \"Move a file inside the mounted workspace using the source's current ETag. The operation fails if the destination already exists. If source deletion cannot be confirmed, the destination is retained and the tool reports a conflict; inspect both paths before retrying.\",\n strict: true,\n inputSchema: z\n .object({\n source: logicalPath(\n 'Source file path',\n workspace.limits.maxPathBytes,\n ),\n destination: logicalPath(\n 'Destination file path',\n workspace.limits.maxPathBytes,\n ),\n etag: etagSchema.describe(\n 'Exact ETag of the source returned by the latest workspace stat or read.',\n ),\n })\n .strict(),\n needsApproval: resolveApproval('workspace_move_file', requireApproval),\n execute: ({ source, destination, etag }, { abortSignal }) =>\n executeSafely(abortSignal, async () =>\n serializeFile(\n await workspace.moveFile(source, destination, {\n etag,\n ...operationOptions(abortSignal),\n }),\n ),\n ),\n });\n }\n\n if (workspace.allows('delete')) {\n tools.workspace_delete_file = tool({\n description:\n 'Delete a file inside the mounted workspace using its current ETag.',\n strict: true,\n inputSchema: z\n .object({\n path: pathSchema,\n etag: etagSchema,\n })\n .strict(),\n needsApproval: resolveApproval('workspace_delete_file', requireApproval),\n execute: ({ path, etag }, { abortSignal }) =>\n executeSafely(abortSignal, async () => {\n await workspace.deleteFile(path, {\n etag,\n ...operationOptions(abortSignal),\n });\n return { deleted: true as const, path };\n }),\n });\n }\n\n return tools;\n}\n\nexport function isAiSdkWorkspaceMutationToolName(\n value: string,\n): value is AiSdkWorkspaceMutationToolName {\n return mutationToolNames.has(value as AiSdkWorkspaceMutationToolName);\n}\n"]}
|
package/dist/ai-sdk/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AI_SDK_WORKSPACE_TOOL_NAMES, AiSdkWorkspaceToolError, createAiSdkWorkspaceTools, isAiSdkWorkspaceMutationToolName, type AiSdkWorkspaceApprovalConfig, type AiSdkWorkspaceDirectoryResult, type AiSdkWorkspaceEntryResult, type AiSdkWorkspaceFileResult, type AiSdkWorkspaceMutationToolName, type AiSdkWorkspacePageResult, type AiSdkWorkspaceTextFileResult, type AiSdkWorkspaceToolErrorCode, type AiSdkWorkspaceToolName, type CreateAiSdkWorkspaceToolsOptions, } from './ai-sdk-workspace-tools.js';
|
|
1
|
+
export { AI_SDK_WORKSPACE_TOOL_NAMES, AiSdkWorkspaceToolError, createAiSdkWorkspaceTools, isAiSdkWorkspaceMutationToolName, type AiSdkWorkspaceApprovalConfig, type AiSdkWorkspaceCreateConflict, type AiSdkWorkspaceCreateConflictMapper, type AiSdkWorkspaceDirectoryResult, type AiSdkWorkspaceEntryResult, type AiSdkWorkspaceFileResult, type AiSdkWorkspaceMutationToolName, type AiSdkWorkspacePageResult, type AiSdkWorkspaceTextFileResult, type AiSdkWorkspaceToolErrorCode, type AiSdkWorkspaceToolName, type CreateAiSdkWorkspaceToolsOptions, } from './ai-sdk-workspace-tools.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai-sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,EAChC,KAAK,4BAA4B,EACjC,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,GACtC,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ai-sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,EAChC,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACjC,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EAClC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,gCAAgC,GACtC,MAAM,6BAA6B,CAAC"}
|
package/dist/ai-sdk/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai-sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ai-sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,yBAAyB,EACzB,gCAAgC,GAajC,MAAM,6BAA6B,CAAC","sourcesContent":["export {\n AI_SDK_WORKSPACE_TOOL_NAMES,\n AiSdkWorkspaceToolError,\n createAiSdkWorkspaceTools,\n isAiSdkWorkspaceMutationToolName,\n type AiSdkWorkspaceApprovalConfig,\n type AiSdkWorkspaceCreateConflict,\n type AiSdkWorkspaceCreateConflictMapper,\n type AiSdkWorkspaceDirectoryResult,\n type AiSdkWorkspaceEntryResult,\n type AiSdkWorkspaceFileResult,\n type AiSdkWorkspaceMutationToolName,\n type AiSdkWorkspacePageResult,\n type AiSdkWorkspaceTextFileResult,\n type AiSdkWorkspaceToolErrorCode,\n type AiSdkWorkspaceToolName,\n type CreateAiSdkWorkspaceToolsOptions,\n} from './ai-sdk-workspace-tools.js';\n"]}
|
|
@@ -1,22 +1,47 @@
|
|
|
1
1
|
import { type Adapter, type Body, type FilesOptions } from 'files-sdk';
|
|
2
2
|
import { StorageError } from '../storage.error.js';
|
|
3
3
|
import type { StorageDriver } from '../storage.driver.js';
|
|
4
|
-
import type { StorageBody, StorageConditionalDeleteOptions,
|
|
4
|
+
import type { StorageBody, StorageConditionalCopyDestinationCapability, StorageConditionalCopySourceCapability, StorageConditionalDeleteCapability, StorageConditionalDeleteOptions, StorageConditionalMultipartCompletionCapability, StorageConditionalReadCapability, StorageConditionalReadOptions, StorageConditionalUploadOptions, StorageConditionalWriteCapability, StorageDownloadOptions, StorageListOptions, StorageListResult, StorageObject, StorageObjectMetadata, StorageOperationOptions, StoragePhysicalKeyCapability, StoragePromotionOptions, StorageSearchOptions, StorageSignedUploadPolicyCapability, StorageSignedDownloadPolicyCapability, StorageSignedDownloadOptions, StorageSignedUpload, StorageSignedUploadOptions, StorageUploadOptions, StorageUploadResult } from '../storage.types.js';
|
|
5
5
|
export type FilesSdkDriverOptions<AdapterType extends Adapter> = FilesOptions<AdapterType>;
|
|
6
|
+
export type FilesSdkS3AdapterProvenance = 'native' | 'verified' | 'unverified';
|
|
7
|
+
/** Rejects adapters already carrying reserved storage S3 extensions. */
|
|
8
|
+
export declare function assertFilesSdkS3AdapterHasNoReservedExtensions(adapter: Adapter): void;
|
|
9
|
+
/** Records that an S3 adapter was constructed but not provider-decorated. */
|
|
10
|
+
export declare function markFilesSdkS3AdapterUndecorated(adapter: Adapter): void;
|
|
11
|
+
/** Records the provider verification state of one decorated S3 adapter. */
|
|
12
|
+
export declare function markFilesSdkS3AdapterProvenance(adapter: Adapter, provenance: FilesSdkS3AdapterProvenance): void;
|
|
13
|
+
/** Records final provider verification state on one stable raw S3 client. */
|
|
14
|
+
export declare function markFilesSdkS3RawClientProvenance(raw: object, adapter: Adapter, provenance: FilesSdkS3AdapterProvenance): void;
|
|
6
15
|
/**
|
|
7
16
|
* Optional adapter extension for providers that can conditionally copy an
|
|
8
17
|
* immutable source identity. Plain files-sdk adapters remain fully supported.
|
|
9
18
|
*/
|
|
10
19
|
export interface FilesSdkConditionalCopyAdapter {
|
|
11
|
-
readonly
|
|
20
|
+
readonly conditionalCopySource?: StorageConditionalCopySourceCapability;
|
|
21
|
+
readonly conditionalCopyDestination?: StorageConditionalCopyDestinationCapability;
|
|
12
22
|
promote(sourceKey: string, destinationKey: string, options: StoragePromotionOptions): Promise<void>;
|
|
13
23
|
}
|
|
14
|
-
/** Optional adapter extension for native compare-and-set
|
|
15
|
-
export interface
|
|
16
|
-
readonly
|
|
24
|
+
/** Optional adapter extension for native compare-and-set uploads. */
|
|
25
|
+
export interface FilesSdkConditionalUploadAdapter {
|
|
26
|
+
readonly conditionalCreate?: StorageConditionalWriteCapability;
|
|
27
|
+
readonly conditionalReplace?: StorageConditionalWriteCapability;
|
|
28
|
+
readonly conditionalMultipartCompletion?: StorageConditionalMultipartCompletionCapability;
|
|
17
29
|
uploadConditional(key: string, body: Body, options: StorageConditionalUploadOptions): Promise<StorageUploadResult>;
|
|
30
|
+
}
|
|
31
|
+
/** Optional adapter extension for native compare-and-delete. */
|
|
32
|
+
export interface FilesSdkConditionalDeleteAdapter {
|
|
33
|
+
readonly conditionalDelete: StorageConditionalDeleteCapability;
|
|
18
34
|
deleteConditional(key: string, options: StorageConditionalDeleteOptions): Promise<void>;
|
|
19
35
|
}
|
|
36
|
+
/** Optional adapter extension for an exact observed-identity read. */
|
|
37
|
+
export interface FilesSdkConditionalReadAdapter {
|
|
38
|
+
readonly conditionalRead: StorageConditionalReadCapability;
|
|
39
|
+
downloadConditional(key: string, options: StorageConditionalReadOptions): Promise<StorageObject>;
|
|
40
|
+
}
|
|
41
|
+
/** Optional provider key budget, measured after the driver prefix is applied. */
|
|
42
|
+
export interface FilesSdkPhysicalKeyAdapter {
|
|
43
|
+
readonly physicalKey: StoragePhysicalKeyCapability;
|
|
44
|
+
}
|
|
20
45
|
export interface FilesSdkSignedUploadPolicyAdapter {
|
|
21
46
|
readonly signedUploadPolicy: StorageSignedUploadPolicyCapability;
|
|
22
47
|
}
|
|
@@ -35,16 +60,34 @@ export declare class FilesSdkStorageDriver<AdapterType extends Adapter = Adapter
|
|
|
35
60
|
rangeRead: boolean;
|
|
36
61
|
resumableUpload: boolean;
|
|
37
62
|
serverSideCopy: boolean;
|
|
38
|
-
|
|
39
|
-
supported: boolean;
|
|
63
|
+
conditionalCopySource?: {
|
|
40
64
|
etag: boolean;
|
|
41
65
|
version: boolean;
|
|
42
66
|
};
|
|
43
|
-
|
|
67
|
+
conditionalCopyDestination?: {
|
|
44
68
|
create: boolean;
|
|
45
69
|
replace: boolean;
|
|
46
|
-
|
|
70
|
+
atomicWithSource: boolean;
|
|
71
|
+
};
|
|
72
|
+
conditionalDelete?: {
|
|
73
|
+
etag: boolean;
|
|
74
|
+
};
|
|
75
|
+
conditionalRead?: {
|
|
47
76
|
etag: boolean;
|
|
77
|
+
version: boolean;
|
|
78
|
+
};
|
|
79
|
+
conditionalCreate?: {
|
|
80
|
+
resultEtag: boolean;
|
|
81
|
+
};
|
|
82
|
+
conditionalReplace?: {
|
|
83
|
+
resultEtag: boolean;
|
|
84
|
+
};
|
|
85
|
+
conditionalMultipartCompletion?: {
|
|
86
|
+
create: boolean;
|
|
87
|
+
replace: boolean;
|
|
88
|
+
};
|
|
89
|
+
physicalKey?: {
|
|
90
|
+
maxBytes: number;
|
|
48
91
|
};
|
|
49
92
|
signedDownload: {
|
|
50
93
|
supported: boolean;
|
|
@@ -53,7 +96,7 @@ export declare class FilesSdkStorageDriver<AdapterType extends Adapter = Adapter
|
|
|
53
96
|
signedDownloadPolicy?: {
|
|
54
97
|
expiresIn: boolean;
|
|
55
98
|
};
|
|
56
|
-
signedUpload:
|
|
99
|
+
signedUpload: "runtime" | boolean;
|
|
57
100
|
signedUploadPolicy?: {
|
|
58
101
|
contentType: boolean;
|
|
59
102
|
sizeRange: boolean;
|
|
@@ -63,6 +106,7 @@ export declare class FilesSdkStorageDriver<AdapterType extends Adapter = Adapter
|
|
|
63
106
|
upload(key: string, body: StorageBody, options?: StorageUploadOptions): Promise<StorageUploadResult>;
|
|
64
107
|
uploadConditional(key: string, body: StorageBody, options: StorageConditionalUploadOptions): Promise<StorageUploadResult>;
|
|
65
108
|
download(key: string, options?: StorageDownloadOptions): Promise<StorageObject>;
|
|
109
|
+
downloadConditional(key: string, options: StorageConditionalReadOptions): Promise<StorageObject>;
|
|
66
110
|
head(key: string, options?: StorageOperationOptions): Promise<StorageObjectMetadata>;
|
|
67
111
|
exists(key: string, options?: StorageOperationOptions): Promise<boolean>;
|
|
68
112
|
delete(key: string, options?: StorageOperationOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files-sdk.driver.d.ts","sourceRoot":"","sources":["../../src/files-sdk/files-sdk.driver.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"files-sdk.driver.d.ts","sourceRoot":"","sources":["../../src/files-sdk/files-sdk.driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,OAAO,EACZ,KAAK,IAAI,EAET,KAAK,YAAY,EAWlB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,YAAY,EAGb,MAAM,qBAAqB,CAAC;AAK7B,OAAO,KAAK,EAAE,a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