You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/docs/content/docs/integrations/file.mdx
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,6 +139,7 @@ Create a new workspace file, either from text content or from an existing file.
139
139
|`fileInput`| file | No | An existing file to store in the workspace, such as one produced by an earlier tool. Use this for anything that is not text — PDFs, images, audio, archives. Provide exactly one of content or fileInput. |
140
140
|`contentType`| string | No | MIME type for new files \(e.g., "text/plain"\). Auto-detected from the file extension, or taken from the stored file, if omitted. |
141
141
|`overwrite`| boolean | No | Replace the contents of an existing file at the exact target path \(folder and name\) instead of creating a suffixed copy. Creates the file when that path does not exist yet. |
142
+
|`expectedRevision`| string | No | Refuse the write unless the file still holds the content this revision names, as returned by Get File or an earlier write. Use it so an edit computed from what you read cannot overwrite someone else’s change. |
142
143
143
144
#### Output
144
145
@@ -148,6 +149,8 @@ Create a new workspace file, either from text content or from an existing file.
148
149
|`name`| string | File name |
149
150
|`size`| number | File size in bytes |
150
151
|`url`| string | URL to access the file |
152
+
|`version`| number | Version number of the content this write recorded |
153
+
|`revision`| string | Opaque token for the content this write produced. Pass it back as expectedRevision to make a later write conditional on nothing having changed since. |
151
154
152
155
### File Append
153
156
@@ -171,6 +174,8 @@ Append content to an existing workspace file. The file must already exist. Conte
171
174
|`name`| string | File name |
172
175
|`size`| number | File size in bytes |
173
176
|`url`| string | URL to access the file |
177
+
|`version`| number | Version number of the content this write recorded |
178
+
|`revision`| string | Opaque token for the content this write produced. Pass it back as expectedRevision to make a later write conditional on nothing having changed since. |
174
179
175
180
### Apply File Edit
176
181
@@ -194,6 +199,7 @@ Apply one precise edit to an existing text file without rewriting it. Use search
194
199
|`startAnchor`| string | No | For delete_between, the complete first line to delete. The start anchor is removed. |
195
200
|`endAnchor`| string | No | For delete_between, the complete ending boundary line. The end anchor remains in the file. |
196
201
|`occurrence`| number | No | For anchored edits, which matching anchor occurrence to use, starting at 1. Defaults to 1. |
202
+
|`expectedRevision`| string | No | Refuse the edit unless the file still holds the content this revision names, as returned by Get File or an earlier write. Use it so an edit computed from what you read cannot overwrite someone else’s change. |
197
203
198
204
#### Output
199
205
@@ -203,6 +209,8 @@ Apply one precise edit to an existing text file without rewriting it. Use search
203
209
|`name`| string | File name |
204
210
|`size`| number | File size in bytes |
205
211
|`lineCount`| number | Lines in the file after the edit |
212
+
|`version`| number | Version number of the content this edit recorded |
213
+
|`revision`| string | Opaque token for the content this edit produced. Pass it back as expectedRevision to make a later write conditional on nothing having changed since. |
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/logs/components/log-details/components/file-download/file-download.tsx
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,8 @@ interface FileData {
17
17
url: string
18
18
storageProvider?: 's3'|'blob'|'gcs'|'local'
19
19
bucketName?: string
20
+
/** Workspace file version these bytes came from; absent on runs recorded before versioning. */
0 commit comments