@mevdragon/vidfarm-devcli 0.2.4 → 0.2.5

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/README.md CHANGED
@@ -51,7 +51,7 @@ The local CLI runs the same template contract used by the hosted platform, but w
51
51
 
52
52
  Use `vidfarm session` to print reusable auth headers and a sample `curl` request for the local REST API.
53
53
 
54
- For hosted preview-media uploads, use `vidfarm-devcli presign-preview-media`. It calls the authenticated Vidfarm API with `VIDFARM_API_KEY`, mints a presigned PUT URL under `developer/<user_id>/*`, stores each uploaded file under a UUID path segment while preserving the original filename, uploads the file automatically when `--file` is provided, and returns the resulting Vidfarm media URL.
54
+ For hosted preview-media uploads, use `vidfarm-devcli presign-preview-media`. It calls the authenticated Vidfarm API with `VIDFARM_API_KEY`, mints a presigned PUT URL under `developer/<user_id>/*`, stores each uploaded file under a UUID path segment while preserving the original filename, uploads the file automatically when `--file` is provided, and returns a public-read media URL for the uploaded object.
55
55
 
56
56
  ## What The Hosted Platform Expects From Templates
57
57
 
@@ -221,7 +221,7 @@ drafts/
221
221
 
222
222
  This is the preferred handoff shape for agent-driven template creation. A Vidfarm developer should be able to drag media into `drafts/preview/`, add rough notes to `drafts/source_notes.md`, then tell the agent to create a template from those relative paths.
223
223
 
224
- If the source media is not already present in the repo, upload it into the authenticated developer storage namespace first instead of inventing ad hoc external hosting. Use:
224
+ If the source media is not already present in the repo, upload it into the authenticated developer storage namespace first instead of inventing ad hoc external hosting. An agent can take a developer-provided local file path and run this directly:
225
225
 
226
226
  ```bash
227
227
  npx @mevdragon/vidfarm-devcli presign-preview-media \
@@ -229,7 +229,7 @@ npx @mevdragon/vidfarm-devcli presign-preview-media \
229
229
  --directory drafts/preview
230
230
  ```
231
231
 
232
- That command calls the hosted Vidfarm API with the user's `VIDFARM_API_KEY`, mints a presigned PUT URL scoped under `developer/<user_id>/*`, stores each uploaded file under a UUID path segment while preserving the original filename, uploads the file automatically when `--file` is provided, and returns both the `storage_key` and a Vidfarm `preview_media_url`. Agents should prefer that path for hosted preview uploads.
232
+ That command calls the hosted Vidfarm API with the user's `VIDFARM_API_KEY`, mints a presigned PUT URL scoped under `developer/<user_id>/*`, stores each uploaded file under a UUID path segment while preserving the original filename, uploads the file automatically when `--file` is provided, and returns both the `storage_key` and a public-read `preview_media_url`. Objects under `developer/<user_id>/*` may be read directly by URL but should not be treated as listable or writable without authenticated API access. Agents should prefer that path for hosted preview uploads whenever the input is a local media file path.
233
233
 
234
234
  ### 2. Start local runtime
235
235
 
package/dist/src/app.js CHANGED
@@ -983,14 +983,16 @@ app.post(`${USER_PREFIX}/me/developer/preview-media/presign`, async (c) => {
983
983
  const storageKey = storage.developerScopedKey(customer.id, directory, randomUUID(), fileName);
984
984
  const upload = await storage.createWriteUrl(storageKey, {
985
985
  contentType,
986
- publicRead: false,
986
+ publicRead: true,
987
987
  expiresIn: 3600
988
988
  });
989
+ const publicUrl = storage.getPublicUrl(storageKey) ?? buildAbsoluteUrl(c, `/template-media?key=${encodeURIComponent(storageKey)}`);
989
990
  return c.json({
990
991
  file_name: fileName,
991
992
  content_type: contentType,
992
993
  storage_key: storageKey,
993
- preview_media_url: buildAbsoluteUrl(c, `/template-media?key=${encodeURIComponent(storageKey)}`),
994
+ preview_media_url: publicUrl,
995
+ public_url: publicUrl,
994
996
  upload: {
995
997
  method: upload.method,
996
998
  url: upload.url,
package/dist/src/cli.js CHANGED
@@ -542,6 +542,7 @@ async function runPresignPreviewMediaCommand(argv) {
542
542
  content_type: payload.content_type,
543
543
  storage_key: payload.storage_key,
544
544
  preview_media_url: payload.preview_media_url,
545
+ public_url: payload.public_url ?? payload.preview_media_url,
545
546
  upload_result: uploadResult,
546
547
  upload: payload.upload,
547
548
  curl_upload_example: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mevdragon/vidfarm-devcli",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Developer CLI for running the Vidfarm local template platform.",
5
5
  "type": "module",
6
6
  "bin": {