@koda-sl/baker-cli 0.204.0 → 0.209.0

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 (27) hide show
  1. package/README.md +56 -3
  2. package/dist/{chunk-UZYVSPCA.js → chunk-3E33AGNR.js} +2 -2
  3. package/dist/{chunk-SVHFT7AN.js → chunk-3WODSPNZ.js} +4 -4
  4. package/dist/{chunk-2R2DEPG7.js → chunk-CRXSLYEX.js} +3 -3
  5. package/dist/{chunk-5MPIOGRO.js → chunk-E2WYWHJJ.js} +370 -221
  6. package/dist/chunk-E2WYWHJJ.js.map +1 -0
  7. package/dist/{chunk-KHHD26LZ.js → chunk-FUSTYLP5.js} +3 -3
  8. package/dist/{chunk-6NZG2TCM.js → chunk-IRNM3T6B.js} +6 -1
  9. package/dist/{chunk-6NZG2TCM.js.map → chunk-IRNM3T6B.js.map} +1 -1
  10. package/dist/cli.js +732 -121
  11. package/dist/cli.js.map +1 -1
  12. package/dist/client-CF6ZORCO.js +15 -0
  13. package/dist/engine/index.js +3 -3
  14. package/dist/{env-FF7ZB5W5.js → env-7SCX7HAH.js} +4 -2
  15. package/dist/{output-YGPWST77.js → output-4YIOSWOG.js} +5 -5
  16. package/dist/{shared-CRWB5B7P.js → shared-EBF5DEDJ.js} +6 -6
  17. package/package.json +1 -1
  18. package/dist/chunk-5MPIOGRO.js.map +0 -1
  19. package/dist/client-MP7BKFKM.js +0 -15
  20. /package/dist/{chunk-UZYVSPCA.js.map → chunk-3E33AGNR.js.map} +0 -0
  21. /package/dist/{chunk-SVHFT7AN.js.map → chunk-3WODSPNZ.js.map} +0 -0
  22. /package/dist/{chunk-2R2DEPG7.js.map → chunk-CRXSLYEX.js.map} +0 -0
  23. /package/dist/{chunk-KHHD26LZ.js.map → chunk-FUSTYLP5.js.map} +0 -0
  24. /package/dist/{client-MP7BKFKM.js.map → client-CF6ZORCO.js.map} +0 -0
  25. /package/dist/{env-FF7ZB5W5.js.map → env-7SCX7HAH.js.map} +0 -0
  26. /package/dist/{output-YGPWST77.js.map → output-4YIOSWOG.js.map} +0 -0
  27. /package/dist/{shared-CRWB5B7P.js.map → shared-EBF5DEDJ.js.map} +0 -0
package/README.md CHANGED
@@ -2454,15 +2454,16 @@ Get a single video by ID. `--full` includes the auto-generated **transcript** (B
2454
2454
  baker videos get j571abc123 --full --output md
2455
2455
  ```
2456
2456
 
2457
- ### `baker videos upload <file>`
2457
+ ### `baker videos upload <file|url>`
2458
2458
 
2459
- Upload a video file via Mux direct upload.
2459
+ Upload a video. A local path is uploaded directly; an `http(s)` URL is routed to `baker videos ingest`.
2460
2460
 
2461
2461
  ```bash
2462
2462
  baker videos upload ./demo.mp4
2463
2463
  baker videos upload ./demo.mp4 --dry-run
2464
2464
  baker videos upload ./testimonial-maria.mp4 \
2465
2465
  --context "Testimonial from Maria, a real customer, filmed on her phone for the autumn campaign"
2466
+ baker videos upload https://www.youtube.com/watch?v=abc123
2466
2467
  ```
2467
2468
 
2468
2469
  Supported extensions: `.mp4`, `.mov`, `.webm`, `.avi`, `.mkv`
@@ -2480,6 +2481,55 @@ baker videos group --group-key "instagram:Cx7Ab9"
2480
2481
 
2481
2482
  Same lookup as `baker images group` and takes either kind of id; the two exist so the noun you happen to hold does not decide whether you can ask.
2482
2483
 
2484
+ ### `baker videos ingest <url>`
2485
+
2486
+ Add a video to the library from a link — a direct video file, or a page on YouTube, TikTok, Vimeo, or Instagram.
2487
+
2488
+ ```bash
2489
+ baker videos ingest https://cdn.example.com/hero-loop.mp4 # → { videoId, via: "direct" }
2490
+ baker videos ingest https://www.youtube.com/watch?v=abc123 # → { videoId, via: "download" }
2491
+ baker videos ingest https://vimeo.com/12345 --external-id vim:12345
2492
+ ```
2493
+
2494
+ Two routes, chosen from the URL and reported as `via`:
2495
+
2496
+ - **direct** — the URL ends in a video extension, so Baker fetches the file itself. Nothing is downloaded locally and there is no size limit.
2497
+ - **download** — anything else. The video is downloaded locally, stored, and then ingested. Videos longer than **3 hours** are refused up front, from the link's metadata, before anything is fetched. The downloaded file itself is capped at 16 GB.
2498
+
2499
+ A direct URL that Baker cannot fetch retries automatically on the download route and reports `fallbackFrom`. Force the download route with `--download`.
2500
+
2501
+ Re-ingesting the same link returns the existing row with `deduped: true` instead of transcoding it twice. On the download route the key is the provider's own id, so the same clip pasted as a share link, a shorts link or a watch link folds into one row; on the direct route it is the URL itself. Pass `--external-id` to supply your own key.
2502
+
2503
+ | Flag | Purpose |
2504
+ |---|---|
2505
+ | `--source` | Provenance. Inferred from the link's host when omitted, and that inference covers 20 video platforms — `youtube`, `instagram`, `tiktok`, `twitter`, `facebook`, `reddit`, `vimeo`, `dailymotion`, `twitch`, `bluesky`, `bilibili`, `vk`, `ok`, `pinterest`, `tumblr`, `snapchat`, `loom`, `streamable`, `newgrounds`, `rutube` — plus `uploaded` and `url`. A link from anywhere else still ingests, recorded as `url`. |
2506
+ | `--external-id` | Dedupe key — re-running the same link returns the existing video. Derived from the link automatically on the download route. |
2507
+ | `--external-url` | Canonical page URL. Defaults to the input for a page URL. |
2508
+ | `--download` | Skip the direct attempt and always download. |
2509
+ | `--country` | Two-letter country to fetch from (`US`, `DE`, `JP`). Use when a video is blocked in the region Baker fetches from. |
2510
+ | `--context` | What you know that the video cannot show — campaign, who is on camera, intended use. Feeds the analysis, exactly as on `upload`. |
2511
+ | `--dry-run` | Preview the resolved route and parameters. |
2512
+
2513
+ Baker fetches directly first and only pays for a proxied connection when the site refuses it. `--country` pins those paid connections to a specific place — it does not change the first, free attempt. The result names both the exit used (`egress`) and the country, so a geo-targeted fetch is never invisible after the fact. A region failure says so and suggests the flag; other failures don't, because a different country would not fix them.
2514
+
2515
+ ### Vimeo needs a signed-in session
2516
+
2517
+ Vimeo has removed every anonymous download path — measured against all four of yt-dlp's clients, and the failure is identical through direct, datacenter and residential exits, so it is neither an IP nor a fingerprint problem. Set `VIMEO_COOKIE` on the Convex deployment to the value of the `vimeo` cookie from a logged-in browser session (`npx convex env set VIMEO_COOKIE '<value>'`). That one cookie is sufficient; the rest of the jar is not needed.
2518
+
2519
+ Use an account created for this and holding nothing else — the value travels in sandbox-wide environment that the agent can read. Unset, Vimeo simply fails with a message telling the user to upload the file instead. The session expires, and when it does the failure says so explicitly rather than surfacing Vimeo's opaque 401.
2520
+
2521
+ An audio-only link (a music or podcast page) is refused up front — there is no picture to store in a video library. A download is also given a time budget scaled to the video's length, capped at 15 minutes, because the turn is blocked while it runs; a video that outruns it says so and points at `upload`.
2522
+
2523
+ The download route caps the pull at 1080p — Baker re-encodes for streaming anyway, so fetching a 4K master (what modern YouTube serves by default) only makes the download slower for pixels that get discarded.
2524
+
2525
+ **Blocked downloads climb the egress ladder automatically.** The download route goes through the same **direct → datacenter → residential** ladder as every other outbound read (`@baker/proxy`; see [Operations](../../docs/operations.md) → Egress Proxy). There is no proxy flag on any command and nothing to opt into — the unproxied attempt always runs first, so a paid exit costs nothing until a host actually refuses us, and with no `OXYLABS_*` credentials in the environment this is a single plain download.
2526
+
2527
+ A rung only opens on evidence that *who we are* was the problem — a 403/429/451, a WAF connection reset, or a bot wall like YouTube's "Sign in to confirm you're not a bot". A private video, a deleted one, a 404 or an unsupported URL fails identically from every address on earth, so it stops after one attempt instead of burning a timeout per tier. That decision is `shouldEscalate`'s, shared with the capture engine and the ad-media downloaders; yt-dlp's stderr is only *parsed* into the signal it takes (`src/lib/ytDlpSignal.ts`), never allowed to judge for itself.
2528
+
2529
+ Requires `yt-dlp` on `PATH` (present in the Baker Runtime). Private, age-restricted, or region-locked videos cannot be downloaded — the error carries a `fix` pointing at `baker videos upload <file>`.
2530
+
2531
+ **yt-dlp goes stale, and that looks like a broken video.** Large platforms change their players every few weeks and an out-of-date `yt-dlp` then resolves *no* formats at all, failing with "Requested format is not available" or "Only images are available" rather than anything that names the real cause. The error classifies this case separately and says the link is probably fine. The Runtime image installs `yt-dlp` unpinned at build time (`packages/e2b-template/src/template.ts`), so it ages with the image — if platform ingests start failing across the board, rebuild the template before investigating anything else. Direct file URLs don't depend on `yt-dlp` at all and keep working regardless.
2532
+
2483
2533
  ### `baker videos delete <id>`
2484
2534
 
2485
2535
  Delete a video by ID.
@@ -2950,7 +3000,7 @@ baker history list --category ads --full # ad writes with raw metadata
2950
3000
 
2951
3001
  ---
2952
3002
 
2953
- ### `baker hubspot forms list | view | submissions` · `baker hubspot workflows list` · `baker hubspot pipelines list` · `baker hubspot contacts summary | lookup` · `baker hubspot meetings list | view`
3003
+ ### `baker hubspot forms list | view | submissions` · `baker hubspot workflows list | view` · `baker hubspot pipelines list` · `baker hubspot contacts summary | lookup` · `baker hubspot meetings list | view`
2954
3004
 
2955
3005
  Read-only view of the company's **connected HubSpot account** — the forms and meeting links (calendars) that live there, the leads those forms received, and the workflows, deal pipelines, and contact records a lead runs through afterwards. Fetched from HubSpot live on every call; nothing is cached and nothing is ever written back.
2956
3006
 
@@ -2966,6 +3016,8 @@ baker hubspot forms view <formId> --as-node # the form.external blob for a f
2966
3016
  baker hubspot forms submissions <formId> # how many leads it received, and when
2967
3017
  baker hubspot forms submissions <formId> --days 90 --full
2968
3018
  baker hubspot workflows list --enabled-only # what runs after a lead is captured
3019
+ baker hubspot workflows view <workflowId> # enrolment, branches in order, what each step writes
3020
+ baker hubspot workflows view <workflowId> --full # + the values each branch compares
2969
3021
  baker hubspot pipelines list # where a lead lands, and the stages after it
2970
3022
  baker hubspot contacts summary --days 30 # are recent leads being worked? (counts only)
2971
3023
  baker hubspot contacts lookup lead@example.com # was this one lead picked up?
@@ -2978,6 +3030,7 @@ baker hubspot meetings view <slug> --as-node # the form.external blob for a f
2978
3030
  **`forms view`:** positional `<formId>`; `--full` adds the untouched HubSpot payload; `--as-node` returns the resource blob instead of the readable view.
2979
3031
  **`forms submissions`:** positional `<formId>`; `--days <1-365>` (default 30) sets the window; `--full` adds each submission's field values. The default response is counts and dates only — `total`, `inWindow`, `lastSubmittedAt`, and per-day counts — because submissions carry the lead's own contact details. `truncated: true` means the page budget ran out before the window was covered, so `inWindow` is a floor rather than an exact count.
2980
3032
  **`workflows list` flags:** `--search <text>`, `--enabled-only`. Disabled workflows are listed too — a form wired to one that is off looks connected and does nothing.
3033
+ **`workflows view`:** positional `<workflowId>` (the id from `workflows list`, and the one in HubSpot's own URL — the command translates it to HubSpot's separate internal flow id for you). Returns the enrolment criteria and whether it re-enrols (`null` = HubSpot does not report it for that criteria type, so it is unknown rather than off), plus every step with the property it writes. On a `LIST_BRANCH` step, branches come back in **evaluation order** (`order: 1` wins over `order: 2`) — a broad branch above a narrower one silently swallows the records the narrow one was written for, and HubSpot reports nothing. A `STATIC_BRANCH` matches on a value rather than top down, so its `order` is display only. `steps` is **not** in execution order; follow `nextActionId`. `--full` adds the raw payload, the only place the branch filter criteria (which property is compared to which value) can be read.
2981
3034
  **`pipelines list`:** no flags; stages come back in the order they run in HubSpot.
2982
3035
  **`contacts summary` flags:** `--days <1-365>` (default 30) over contact creation date. Returns counts only — total contacts, how many have an owner, and the lifecycle-stage split — never a name or an email. `truncated: true` means the page budget ran out, so the counts are floors.
2983
3036
  **`contacts lookup`:** positional `<email>`; returns that contact's lifecycle stage, owner, the account (company) it was filed under, and associated deals with their stage. `dealsReadable: false` / `companyReadable: false` mean the connection does not cover deals or accounts, so an empty `deals` or a null `company` is unknown rather than absent. `found: false` means no contact with that email — the lead never reached the CRM, which is a finding rather than an error.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  debugLogSetting
3
- } from "./chunk-6NZG2TCM.js";
3
+ } from "./chunk-IRNM3T6B.js";
4
4
 
5
5
  // src/debugLog.ts
6
6
  import { appendFileSync, mkdirSync, renameSync, statSync } from "fs";
@@ -150,4 +150,4 @@ export {
150
150
  readBodyForLog,
151
151
  installStreamTaps
152
152
  };
153
- //# sourceMappingURL=chunk-UZYVSPCA.js.map
153
+ //# sourceMappingURL=chunk-3E33AGNR.js.map
@@ -2,13 +2,13 @@ import {
2
2
  handleConnectionError,
3
3
  needsConnectionFix,
4
4
  writeAdsJson
5
- } from "./chunk-KHHD26LZ.js";
5
+ } from "./chunk-FUSTYLP5.js";
6
6
  import {
7
7
  ApiError
8
- } from "./chunk-2R2DEPG7.js";
8
+ } from "./chunk-CRXSLYEX.js";
9
9
  import {
10
10
  getEnv
11
- } from "./chunk-6NZG2TCM.js";
11
+ } from "./chunk-IRNM3T6B.js";
12
12
 
13
13
  // src/commands/ads/meta/shared.ts
14
14
  var DAY_MS = 864e5;
@@ -108,4 +108,4 @@ export {
108
108
  csvOrJson,
109
109
  resolveEffectiveStatus
110
110
  };
111
- //# sourceMappingURL=chunk-SVHFT7AN.js.map
111
+ //# sourceMappingURL=chunk-3WODSPNZ.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  debugLogHttp,
3
3
  readBodyForLog
4
- } from "./chunk-UZYVSPCA.js";
4
+ } from "./chunk-3E33AGNR.js";
5
5
  import {
6
6
  getEnv
7
- } from "./chunk-6NZG2TCM.js";
7
+ } from "./chunk-IRNM3T6B.js";
8
8
 
9
9
  // src/client.ts
10
10
  var MAX_RATE_LIMIT_RETRIES = 3;
@@ -198,4 +198,4 @@ export {
198
198
  apiGet,
199
199
  apiPost
200
200
  };
201
- //# sourceMappingURL=chunk-2R2DEPG7.js.map
201
+ //# sourceMappingURL=chunk-CRXSLYEX.js.map