@koda-sl/baker-cli 0.340.0-dev.10990633f → 0.341.0-dev.5221753c2

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
@@ -32,7 +32,7 @@ export BAKER_GSC_SITE_URL="https://example.com/"
32
32
  # Optional: default X Ads account ID (base36)
33
33
  export BAKER_X_ADS_ACCOUNT_ID="18ce53xyz"
34
34
 
35
- # Required for `baker actions ...` and `baker scheduled-agents create/update/delete` commands that stage against a chat
35
+ # Required for `baker actions ...` and `baker scheduled-actions create/update/delete` commands that stage against a chat
36
36
  export BAKER_CHAT_ID="<chat-id>"
37
37
  ```
38
38
 
@@ -43,7 +43,7 @@ export BAKER_CHAT_ID="<chat-id>"
43
43
  - `BAKER_GA4_PROPERTY_ID` — default GA4 property ID. Used when `--property-id` is not passed. If neither is set and exactly one property is connected, it is auto-selected.
44
44
  - `BAKER_GSC_SITE_URL` — default GSC site URL. Used when `--site-url` is not passed. If neither is set and exactly one site is verified, it is auto-selected.
45
45
  - `BAKER_X_ADS_ACCOUNT_ID` — default X Ads account ID (base36). Used when `--account-id` is not passed. If neither is set and exactly one X Ads account is connected, it is auto-selected.
46
- - `BAKER_CHAT_ID` — chat context for staged Work Action commands and staged Scheduled agent create/update/delete. `scheduled-agents run` does not require it. When set, it is also sent as an `x-baker-chat-id` header on every request, so library additions that apply immediately (images, videos, followed brands) are listed in that chat's changes as already applied.
46
+ - `BAKER_CHAT_ID` — chat context for staged Work Action commands and staged Scheduled Action create/update/delete. `scheduled-actions trigger` does not require it. When set, it is also sent as an `x-baker-chat-id` header on every request, so library additions that apply immediately (images, videos, followed brands) are listed in that chat's changes as already applied.
47
47
 
48
48
  ## Debug logging
49
49
 
@@ -689,7 +689,7 @@ Command groups: `budgets`, `campaigns`, `ad-groups`, `keywords` (add/update/remo
689
689
 
690
690
  **Amending a staged op** — `draft amend <ref> (--file patch.json | --patch '<json>')` merges a JSON patch into an already-staged op's payload (objects deep-merge, `null` deletes a key, arrays/scalars replace) and re-validates it in full. Always prefer this over removing and re-staging — it preserves the op's ref (so dependents don't break) and its position in the draft. `draft show <ref>` prints the full staged payload (including warnings/annotations) so you can verify a change looks right before publish.
691
691
 
692
- **Reading an earlier chat's changes** — `draft list` and `draft show` take `--chat <chat-id>` to read another chat in the same company instead of the current one. Every staged-draft family accepts it: `ads google|meta|linkedin draft list|show`, `tag-manager draft list|show`, `actions draft`, `tags draft`, and `scheduled-agents list|get`. A published draft is kept in full, so this returns what that chat actually wrote — every headline, bid and target — plus each op's outcome and error. Use it when asked to redo or reapply earlier work rather than reconstructing copy from a summary. Read-only: staging, `amend`, `remove` and `clear` stay bound to `BAKER_CHAT_ID`, so one chat can never edit another's draft. To re-run only the changes a publish failed to land, use the chat's **Retry** control in the dashboard — it re-sends exactly those and leaves the ones that applied untouched.
692
+ **Reading an earlier chat's changes** — `draft list` and `draft show` take `--chat <chat-id>` to read another chat in the same company instead of the current one. Every staged-draft family accepts it: `ads google|meta|linkedin draft list|show`, `tag-manager draft list|show`, `actions draft`, `tags draft`, and `scheduled-actions list|get`. A published draft is kept in full, so this returns what that chat actually wrote — every headline, bid and target — plus each op's outcome and error. Use it when asked to redo or reapply earlier work rather than reconstructing copy from a summary. Read-only: staging, `amend`, `remove` and `clear` stay bound to `BAKER_CHAT_ID`, so one chat can never edit another's draft. To re-run only the changes a publish failed to land, use the chat's **Retry** control in the dashboard — it re-sends exactly those and leaves the ones that applied untouched.
693
693
 
694
694
  **Already-satisfied writes aren't staged** — an update or pause/resume whose every field already holds the requested value on the live account is dropped instead of staged: the envelope returns `"staged": false, "noop": true` with a `reason` ("this ad is already Paused on Google Ads"), plus a hint. This is a success, not an error — there is nothing to publish. Only a positively-read live snapshot can trigger it; a failed or empty read always stages. Batch responses list the dropped ops under `skipped`, and `count` reflects what actually entered the draft.
695
695
 
@@ -1683,6 +1683,20 @@ baker gsc sitemaps --site-url "https://example.com/"
1683
1683
 
1684
1684
  ---
1685
1685
 
1686
+ ### Knowledge vault (`baker knowledge`)
1687
+
1688
+ Search the workspace's Knowledge vault — the `src/content/` collections declared in `src/collections/*.ts`, plus `src/brand/BRAND.md` — from any folder inside the workspace.
1689
+
1690
+ ```bash
1691
+ baker knowledge search "what objections do price-sensitive customers raise"
1692
+ baker knowledge search "best performing hooks" -c campaigns -n 8 # -c repeatable or comma-separated
1693
+ baker knowledge search "tarifa hogar" --keyword # exact terms only: instant, no network
1694
+ baker knowledge status # collections and index coverage
1695
+ baker knowledge index # bring the index up to date
1696
+ ```
1697
+
1698
+ `search` returns passages (`path`, `line`, `title`, `collection`, `score` 0–1, `snippet`; `--full` for the whole passage; `--min-score` to cut). It ranks by keyword and by meaning and then reranks, keeping its index in `.cache/knowledge/`. The index updates itself before each search, so edits are searchable at once. Without Baker credentials, or when the service is unreachable, it answers from keywords alone and a hint says so.
1699
+
1686
1700
  ### Competitive Intelligence (`baker research`)
1687
1701
 
1688
1702
  Market and competitor research powered by DataForSEO and AI-powered Google Search grounding. Shows who's competing for keywords, search intent classification, competitor keyword strategies, keyword gaps, landing page performance, and open-ended AI research.
@@ -3261,79 +3275,63 @@ baker winning-ads patterns --winners a_1,a_2,a_3 --duds a_9,a_8 --top-n 10 --out
3261
3275
 
3262
3276
  ---
3263
3277
 
3264
- ### Scheduled agents (`baker scheduled-agents`)
3278
+ ### Scheduled Actions (`baker scheduled-actions`)
3265
3279
 
3266
- A Scheduled agent is a **trigger** and a **prompt**. When the trigger fires, a Session opens with that prompt and does the job — there is no Task in between. `create`, `update`, and `delete` stage draft ops on `BAKER_CHAT_ID` and apply when the chat is published. `list` and `get` include draft state when `BAKER_CHAT_ID` is set. `run` fires a published item immediately and does not require a chat id.
3280
+ Manage company-scoped scheduled recipes that spawn Work Actions later or on a cadence. `create`, `update`, and `delete` stage draft ops on `BAKER_CHAT_ID` and apply when the chat is published. `list` and `get` include draft state when `BAKER_CHAT_ID` is set. `trigger` runs immediately on a published scheduled action and does not require a chat id. Use a regular Work Action instead when there is no date or cadence.
3267
3281
 
3268
3282
  ```bash
3269
- baker scheduled-agents triggers # every trigger there is
3270
- baker scheduled-agents list
3271
- baker scheduled-agents get <id-or-temp_agent_id>
3283
+ baker scheduled-actions list
3284
+ baker scheduled-actions get <id-or-temp_sched_id>
3272
3285
 
3273
- baker scheduled-agents create --name "Weekly report" --description "Prepare report" --prompt "Review last week's spend." --cron "0 9 * * MON" --timezone Europe/Madrid
3274
- baker scheduled-agents create --name "Launch reminder" --description "Check launch" --prompt "Check the launch checklist." --run-at "2026-09-01T07:00:00Z" --disabled
3275
- baker scheduled-agents create --name "Chase a new quote" --description "Follow up while it is warm" --prompt "Read the answers and draft the follow-up." --trigger form.submitted --form quote
3276
- baker scheduled-agents create --name "Celebrate the first sale" --description "Once, ever" --prompt "Write the announcement." --trigger event.received --event purchase --occurrences 1
3286
+ baker scheduled-actions create --name "Weekly report" --description "Prepare report" --cron "0 9 * * MON" --timezone Europe/Madrid
3287
+ baker scheduled-actions create --name "Launch reminder" --description "Check launch" --run-at "2026-09-01T07:00:00Z" --disabled --no-spawn-agent
3288
+ baker scheduled-actions create --name "Spend review" --description "Review spend anomalies" --cron "0 9 * * MON" --prompt "Focus on blockers"
3277
3289
 
3278
- baker scheduled-agents update <id-or-temp_agent_id> --enabled false
3279
- baker scheduled-agents update <id-or-temp_agent_id> --run-at "2026-09-02T07:00:00Z" --prompt "Use the launch checklist"
3280
- baker scheduled-agents update <id-or-temp_agent_id> --trigger experiment.ended
3281
- baker scheduled-agents delete <id-or-temp_agent_id>
3290
+ baker scheduled-actions update <id-or-temp_sched_id> --enabled false
3291
+ baker scheduled-actions update <id-or-temp_sched_id> --run-at "2026-09-02T07:00:00Z" --spawn-agent true --prompt "Use the launch checklist"
3292
+ baker scheduled-actions update <id-or-temp_sched_id> --mode publish # runs go live unreviewed
3293
+ baker scheduled-actions update <id-or-temp_sched_id> --mode recommend # runs advise and change nothing
3294
+ baker scheduled-actions delete <id-or-temp_sched_id>
3282
3295
 
3283
- baker scheduled-agents run <id>
3296
+ baker scheduled-actions trigger <id>
3284
3297
 
3285
- baker scheduled-agents templates --list # every recipe this company can run
3286
- baker scheduled-agents templates --category measurement # one group only
3287
- baker scheduled-agents create --template baker-ads --name "Weekly ad review" --description "..." --cron "0 8 * * MON"
3298
+ baker scheduled-actions templates --list # every recipe this company can run
3299
+ baker scheduled-actions templates --category measurement # one group only
3300
+ baker scheduled-actions create --template baker-ads --name "Weekly ad review" --description "..." --cron "0 8 * * MON"
3288
3301
  ```
3289
3302
 
3290
- Triggers:
3291
-
3292
- | `--trigger` | Fires when | Narrow it with |
3293
- |---|---|---|
3294
- | *(use `--run-at`)* | Once, at a time you pick | — |
3295
- | *(use `--cron`)* | On a repeating cadence | — |
3296
- | `webhook.received` | Another tool posts to this item's own private address | — |
3297
- | `event.received` | An event arrives from the site or a connected tool | `--event <name>` |
3298
- | `form.submitted` | Somebody sends answers from a Form | `--form <slug>` |
3299
- | `flow.step.submitted` | Somebody gets as far as one step of a Form | `--form <slug> --step <id>` |
3300
- | `experiment.ended` | Somebody ends an A/B test | `--experiment <id>` |
3301
- | `experiment.concluded` | The winner has been moved into the page | `--experiment <id>` |
3302
- | `task.completed` | A Task is closed | `--tag <slug>` |
3303
- | `task.claimed` | An agent picks up a Task | `--tag <slug>` |
3304
-
3305
3303
  Rules:
3306
3304
 
3307
- - `--cron`, `--run-at` and `--trigger` are mutually exclusive — an item has exactly one trigger.
3308
- - `--run-at` must be an ISO UTC timestamp ending in `Z`, and still in the future — a time that has already passed is refused when the op is staged. If a one-off's time passes while the chat is still open, publishing creates it **switched off** with the reason on it rather than dropping it.
3309
- - Leaving a narrowing flag off means "any" — any Form, any event, any test — including ones that do not exist yet.
3310
- - `--occurrences 1` runs only the first time the trigger ever fires; `--occurrences 1,3` the first and the third. Omit it to run every time. It counts firings of this item's trigger, so a firing that `--occurrences` declines is still counted.
3311
- - A signal-triggered item will not start a second run while its last one is still going, and never wakes itself.
3312
- - `--prompt` is the whole job: there is no mode and no `--spawn-agent`. If a run should only advise, the brief says so.
3313
- - Publishing every run's work unreviewed is a standing authorization only the user can grant, on the item in Baker. The API refuses `autoPublish` outright.
3314
- - Draft-created ids use `temp_agent_*`; use them with `get`, `update`, or `delete` before publish.
3305
+ - `--cron` and `--run-at` are mutually exclusive.
3306
+ - `--run-at` must be an ISO UTC timestamp ending in `Z`, and still in the future — a time that has already passed is refused when the op is staged. If a one-off's time passes while the chat is still open, publishing creates the task **switched off** with the reason on it rather than dropping it, so it is never lost.
3307
+ - Draft-created ids use `temp_sched_*`; use them with `get`, `update`, or `delete` before publish.
3315
3308
  - Staged commands require `BAKER_CHAT_ID` to point to an `in_progress` chat.
3316
- - `run` rejects `temp_agent_*` and only accepts published ids. It returns the `chatId` of the Session it opened.
3309
+ - `trigger` rejects `temp_sched_*` and only accepts published scheduled-action ids.
3317
3310
  - Company Timezone is the default; `--timezone` is an explicit IANA override.
3318
- - `--template <id>` copies a marketplace recipe's brief onto the item — a copy, not a link, so the owner can read and edit every word, and a later change to the recipe does not reach it. `--prompt` is appended after it. The same recipe can be used more than once.
3311
+ - `--mode` sets how far a run goes on its own: `remind` (opens the Task, runs nothing), `recommend` (writes up what it would change, touches nothing), `propose` (does the work, waits to be published — the default), `publish` (does the work and publishes it unreviewed). It applies when the chat is published, on the authority of whoever published it; a chat completed with no person behind it lands a `publish` task on `propose` instead.
3312
+ - `--mode` supersedes `--spawn-agent`/`--no-spawn-agent`, which can only reach `remind` and `propose`. Passing both is rejected.
3313
+ - Scheduled actions spawn agents by default; create with `--no-spawn-agent` or update with `--spawn-agent false` to disable it.
3314
+ - `--prompt` maps to the scheduled action's additional spawned-agent instructions (`agentPrompt`), not a replacement for Baker's automatic spawned Work Action reference.
3315
+ - `--prompt` requires a run that does the work: it is rejected alongside `--mode remind`, `--no-spawn-agent` (create) or `--spawn-agent false` (update), since a bypassed agent never reads it.
3316
+ - `--template <id>` binds the schedule to a marketplace recipe instead of a prompt you wrote. The row stores the id alone: name, brief and prompt resolve at fire time, so the job improves when the recipe does. `--description` carries what is true of this company. One row per recipe per company; a second `create` for the same id is refused.
3319
3317
 
3320
3318
  #### Marketplace recipes (`templates`)
3321
3319
 
3322
- `templates` lists every recipe a company can build an item from — the ones Baker maintains plus any the company wrote — and is also how one of theirs is written. Recipes we maintain take priority: a company recipe can never use one of our ids, and resolution reads ours first.
3320
+ `templates` lists every recipe a company can switch on — the ones Baker maintains plus any the company wrote — and is also how one of theirs is written. Recipes we maintain take priority: a company recipe can never use one of our ids, and resolution reads ours first.
3323
3321
 
3324
3322
  ```bash
3325
- baker scheduled-agents templates --list --drafts # include theirs not offered yet
3323
+ baker scheduled-actions templates --list --drafts # include theirs not offered yet
3326
3324
 
3327
3325
  # Writing one of theirs, in this order:
3328
- baker scheduled-agents templates --save weekly-posthog-check \
3326
+ baker scheduled-actions templates --save weekly-posthog-check \
3329
3327
  --name "Weekly PostHog check" \
3330
3328
  --tagline "What moved in the funnel, from PostHog rather than GA4." \
3331
3329
  --recipe-category measurement --frequency weekly \
3332
3330
  --brief-file ./brief.md
3333
3331
 
3334
- # ...build an item from it with --template, run that item, read what it produced, then:
3335
- baker scheduled-agents templates --publish weekly-posthog-check
3336
- baker scheduled-agents templates --delete weekly-posthog-check
3332
+ # ...schedule it with --template, trigger it, read what the run produced, then:
3333
+ baker scheduled-actions templates --publish weekly-posthog-check
3334
+ baker scheduled-actions templates --delete weekly-posthog-check
3337
3335
  ```
3338
3336
 
3339
3337
  - **Saving does not offer it.** A saved recipe is invisible and cannot be scheduled until `--publish`. The step between the two is running it: nothing enforces that, and it is the only way to know it produces anything worth reading.
@@ -3451,7 +3449,7 @@ baker actions create --name "Build hero" --priority high --tags landing,creative
3451
3449
  # (temp_hero_copy, not hero_copy) and is rejected with a VALIDATION_ERROR otherwise — the prefix is
3452
3450
  # what tells a task staged in this chat apart from a published action id in link/update/complete/draft remove.
3453
3451
  # If the name/description reads as recurring or future-dated (e.g. "weekly", "every Monday", "schedule"),
3454
- # create emits a hint to use `baker scheduled-agents create` instead of a Work Action.
3452
+ # create emits a hint to use `baker scheduled-actions create` instead of a Work Action.
3455
3453
  # If it instead names work a surface executes in-chat (a GTM container change, a site tag, an ad-platform
3456
3454
  # write, a page or form edit, or a value only the user has), create emits a do-it-now hint naming that
3457
3455
  # surface — doing the work is the default, an action is the exception. One advisory hint per call: the