@koda-sl/baker-cli 0.340.0-dev.10990633f → 0.340.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.
- package/README.md +36 -52
- package/dist/{chunk-D5P4COPD.js → chunk-FFOURYP5.js} +4 -4
- package/dist/chunk-FFOURYP5.js.map +1 -0
- package/dist/cli.js +2573 -3532
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-D5P4COPD.js.map +0 -1
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-
|
|
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
|
|
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-
|
|
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
|
|
|
@@ -3261,79 +3261,63 @@ baker winning-ads patterns --winners a_1,a_2,a_3 --duds a_9,a_8 --top-n 10 --out
|
|
|
3261
3261
|
|
|
3262
3262
|
---
|
|
3263
3263
|
|
|
3264
|
-
### Scheduled
|
|
3264
|
+
### Scheduled Actions (`baker scheduled-actions`)
|
|
3265
3265
|
|
|
3266
|
-
|
|
3266
|
+
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
3267
|
|
|
3268
3268
|
```bash
|
|
3269
|
-
baker scheduled-
|
|
3270
|
-
baker scheduled-
|
|
3271
|
-
baker scheduled-agents get <id-or-temp_agent_id>
|
|
3269
|
+
baker scheduled-actions list
|
|
3270
|
+
baker scheduled-actions get <id-or-temp_sched_id>
|
|
3272
3271
|
|
|
3273
|
-
baker scheduled-
|
|
3274
|
-
baker scheduled-
|
|
3275
|
-
baker scheduled-
|
|
3276
|
-
baker scheduled-agents create --name "Celebrate the first sale" --description "Once, ever" --prompt "Write the announcement." --trigger event.received --event purchase --occurrences 1
|
|
3272
|
+
baker scheduled-actions create --name "Weekly report" --description "Prepare report" --cron "0 9 * * MON" --timezone Europe/Madrid
|
|
3273
|
+
baker scheduled-actions create --name "Launch reminder" --description "Check launch" --run-at "2026-09-01T07:00:00Z" --disabled --no-spawn-agent
|
|
3274
|
+
baker scheduled-actions create --name "Spend review" --description "Review spend anomalies" --cron "0 9 * * MON" --prompt "Focus on blockers"
|
|
3277
3275
|
|
|
3278
|
-
baker scheduled-
|
|
3279
|
-
baker scheduled-
|
|
3280
|
-
baker scheduled-
|
|
3281
|
-
baker scheduled-
|
|
3276
|
+
baker scheduled-actions update <id-or-temp_sched_id> --enabled false
|
|
3277
|
+
baker scheduled-actions update <id-or-temp_sched_id> --run-at "2026-09-02T07:00:00Z" --spawn-agent true --prompt "Use the launch checklist"
|
|
3278
|
+
baker scheduled-actions update <id-or-temp_sched_id> --mode publish # runs go live unreviewed
|
|
3279
|
+
baker scheduled-actions update <id-or-temp_sched_id> --mode recommend # runs advise and change nothing
|
|
3280
|
+
baker scheduled-actions delete <id-or-temp_sched_id>
|
|
3282
3281
|
|
|
3283
|
-
baker scheduled-
|
|
3282
|
+
baker scheduled-actions trigger <id>
|
|
3284
3283
|
|
|
3285
|
-
baker scheduled-
|
|
3286
|
-
baker scheduled-
|
|
3287
|
-
baker scheduled-
|
|
3284
|
+
baker scheduled-actions templates --list # every recipe this company can run
|
|
3285
|
+
baker scheduled-actions templates --category measurement # one group only
|
|
3286
|
+
baker scheduled-actions create --template baker-ads --name "Weekly ad review" --description "..." --cron "0 8 * * MON"
|
|
3288
3287
|
```
|
|
3289
3288
|
|
|
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
3289
|
Rules:
|
|
3306
3290
|
|
|
3307
|
-
- `--cron
|
|
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
|
|
3309
|
-
-
|
|
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.
|
|
3291
|
+
- `--cron` and `--run-at` are mutually exclusive.
|
|
3292
|
+
- `--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.
|
|
3293
|
+
- Draft-created ids use `temp_sched_*`; use them with `get`, `update`, or `delete` before publish.
|
|
3315
3294
|
- Staged commands require `BAKER_CHAT_ID` to point to an `in_progress` chat.
|
|
3316
|
-
- `
|
|
3295
|
+
- `trigger` rejects `temp_sched_*` and only accepts published scheduled-action ids.
|
|
3317
3296
|
- Company Timezone is the default; `--timezone` is an explicit IANA override.
|
|
3318
|
-
- `--
|
|
3297
|
+
- `--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.
|
|
3298
|
+
- `--mode` supersedes `--spawn-agent`/`--no-spawn-agent`, which can only reach `remind` and `propose`. Passing both is rejected.
|
|
3299
|
+
- Scheduled actions spawn agents by default; create with `--no-spawn-agent` or update with `--spawn-agent false` to disable it.
|
|
3300
|
+
- `--prompt` maps to the scheduled action's additional spawned-agent instructions (`agentPrompt`), not a replacement for Baker's automatic spawned Work Action reference.
|
|
3301
|
+
- `--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.
|
|
3302
|
+
- `--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
3303
|
|
|
3320
3304
|
#### Marketplace recipes (`templates`)
|
|
3321
3305
|
|
|
3322
|
-
`templates` lists every recipe a company can
|
|
3306
|
+
`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
3307
|
|
|
3324
3308
|
```bash
|
|
3325
|
-
baker scheduled-
|
|
3309
|
+
baker scheduled-actions templates --list --drafts # include theirs not offered yet
|
|
3326
3310
|
|
|
3327
3311
|
# Writing one of theirs, in this order:
|
|
3328
|
-
baker scheduled-
|
|
3312
|
+
baker scheduled-actions templates --save weekly-posthog-check \
|
|
3329
3313
|
--name "Weekly PostHog check" \
|
|
3330
3314
|
--tagline "What moved in the funnel, from PostHog rather than GA4." \
|
|
3331
3315
|
--recipe-category measurement --frequency weekly \
|
|
3332
3316
|
--brief-file ./brief.md
|
|
3333
3317
|
|
|
3334
|
-
# ...
|
|
3335
|
-
baker scheduled-
|
|
3336
|
-
baker scheduled-
|
|
3318
|
+
# ...schedule it with --template, trigger it, read what the run produced, then:
|
|
3319
|
+
baker scheduled-actions templates --publish weekly-posthog-check
|
|
3320
|
+
baker scheduled-actions templates --delete weekly-posthog-check
|
|
3337
3321
|
```
|
|
3338
3322
|
|
|
3339
3323
|
- **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 +3435,7 @@ baker actions create --name "Build hero" --priority high --tags landing,creative
|
|
|
3451
3435
|
# (temp_hero_copy, not hero_copy) and is rejected with a VALIDATION_ERROR otherwise — the prefix is
|
|
3452
3436
|
# what tells a task staged in this chat apart from a published action id in link/update/complete/draft remove.
|
|
3453
3437
|
# 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-
|
|
3438
|
+
# create emits a hint to use `baker scheduled-actions create` instead of a Work Action.
|
|
3455
3439
|
# If it instead names work a surface executes in-chat (a GTM container change, a site tag, an ad-platform
|
|
3456
3440
|
# write, a page or form edit, or a value only the user has), create emits a do-it-now hint naming that
|
|
3457
3441
|
# surface — doing the work is the default, an action is the exception. One advisory hint per call: the
|
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
shouldEscalate
|
|
20
20
|
} from "./chunk-4VP5WWPR.js";
|
|
21
21
|
|
|
22
|
-
//
|
|
22
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js
|
|
23
23
|
var require_safe_stable_stringify = __commonJS({
|
|
24
|
-
"
|
|
24
|
+
"../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(exports, module) {
|
|
25
25
|
"use strict";
|
|
26
26
|
var { hasOwnProperty } = Object.prototype;
|
|
27
27
|
var stringify = configure2();
|
|
@@ -1113,7 +1113,7 @@ function resolveAdaptFormats(params) {
|
|
|
1113
1113
|
return params.formats ?? [];
|
|
1114
1114
|
}
|
|
1115
1115
|
|
|
1116
|
-
//
|
|
1116
|
+
// ../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/esm/wrapper.js
|
|
1117
1117
|
var import__ = __toESM(require_safe_stable_stringify(), 1);
|
|
1118
1118
|
var configure = import__.default.configure;
|
|
1119
1119
|
var wrapper_default = import__.default;
|
|
@@ -9804,4 +9804,4 @@ export {
|
|
|
9804
9804
|
defaultRegistry,
|
|
9805
9805
|
createEngineFromEnv
|
|
9806
9806
|
};
|
|
9807
|
-
//# sourceMappingURL=chunk-
|
|
9807
|
+
//# sourceMappingURL=chunk-FFOURYP5.js.map
|