@koda-sl/baker-cli 0.367.0-dev.7e4c749ba → 0.367.0-dev.e105093e4
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 +2 -2
- package/dist/cli.js +205 -181
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -705,7 +705,7 @@ Command groups: `budgets`, `campaigns`, `ad-groups`, `keywords` (add/update/remo
|
|
|
705
705
|
|
|
706
706
|
**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.
|
|
707
707
|
|
|
708
|
-
**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
|
|
708
|
+
**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` (`list` leaves briefs out; `get <id>` or `list --full` returns them). 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.
|
|
709
709
|
|
|
710
710
|
**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.
|
|
711
711
|
|
|
@@ -3293,7 +3293,7 @@ A Scheduled agent is a **trigger** and a **prompt**. When the trigger fires, a S
|
|
|
3293
3293
|
|
|
3294
3294
|
```bash
|
|
3295
3295
|
baker scheduled-agents triggers # every trigger there is
|
|
3296
|
-
baker scheduled-agents list
|
|
3296
|
+
baker scheduled-agents list # id, name, trigger, status; briefs left out (--full for everything)
|
|
3297
3297
|
baker scheduled-agents get <id-or-temp_agent_id>
|
|
3298
3298
|
|
|
3299
3299
|
baker scheduled-agents create --name "Weekly report" --description "Prepare report" --prompt "Review last week's spend." --cron "0 9 * * MON" --timezone Europe/Madrid
|
package/dist/cli.js
CHANGED
|
@@ -1819,17 +1819,6 @@ var linkedinDraftOpInputSchema = z3.discriminatedUnion("kind", [
|
|
|
1819
1819
|
updateOp("leadForm.update", leadFormUpdateSchema)
|
|
1820
1820
|
]);
|
|
1821
1821
|
|
|
1822
|
-
// ../api/src/ads-linkedin/search-statuses.ts
|
|
1823
|
-
var LINKEDIN_SEARCH_STATUSES = {
|
|
1824
|
-
campaignGroups: ["ACTIVE", "PAUSED", "ARCHIVED", "CANCELED", "DRAFT", "PENDING_DELETION", "REMOVED"],
|
|
1825
|
-
campaigns: ["ACTIVE", "PAUSED", "ARCHIVED", "COMPLETED", "CANCELED", "DRAFT", "PENDING_DELETION", "REMOVED"],
|
|
1826
|
-
creatives: ["ACTIVE", "PAUSED", "ARCHIVED", "CANCELED", "DRAFT", "PENDING_DELETION", "REMOVED"]
|
|
1827
|
-
};
|
|
1828
|
-
function unsupportedLinkedinSearchStatuses(level, statuses) {
|
|
1829
|
-
const accepted = LINKEDIN_SEARCH_STATUSES[level];
|
|
1830
|
-
return statuses.filter((status) => !accepted.includes(status));
|
|
1831
|
-
}
|
|
1832
|
-
|
|
1833
1822
|
// ../api/src/ads-linkedin/wire.ts
|
|
1834
1823
|
import { z as z7 } from "zod";
|
|
1835
1824
|
|
|
@@ -7169,34 +7158,10 @@ function parseConditionsExpression(expression) {
|
|
|
7169
7158
|
}
|
|
7170
7159
|
|
|
7171
7160
|
// ../api/src/scheduledAgents.ts
|
|
7172
|
-
import { z as
|
|
7173
|
-
var scheduledAgentRunsAsSchema = z24.object({
|
|
7174
|
-
/** The person each run acts as; null when nobody owns it, so only the company's tools load. */
|
|
7175
|
-
name: z24.string().nullable(),
|
|
7176
|
-
/** That person's own connected tools. */
|
|
7177
|
-
personalTools: z24.array(z24.string()),
|
|
7178
|
-
/** The company's and organization's tools, and the platforms Baker connects to directly. */
|
|
7179
|
-
companyTools: z24.array(z24.string()),
|
|
7180
|
-
/** Set up, but nobody has signed in to them, so a run gets nothing from them. */
|
|
7181
|
-
notSignedIn: z24.array(z24.string()).optional(),
|
|
7182
|
-
/** The company switched connected tools off: only the platforms load. */
|
|
7183
|
-
toolsOff: z24.literal(true).optional()
|
|
7184
|
-
});
|
|
7185
|
-
var AUTO_PUBLISH_REFUSAL = 'Publishing every run unreviewed is a standing authorization only the user can grant, on the item itself, so it is recorded against their name. Stage the item without it, and once this chat is published ask the user to switch on "Publish its work on its own" (under "When a run finishes") on the item in Scheduled agents.';
|
|
7186
|
-
var scheduledAgentsUnstageRequestSchema = z24.object({
|
|
7187
|
-
chatId: z24.string().min(1),
|
|
7188
|
-
/** The item: a published id or a temp_agent_* id this chat staged. */
|
|
7189
|
-
ref: z24.string().min(1),
|
|
7190
|
-
/** One change of it, by its `index` in `list`'s draft. Left out, every change staged on it. */
|
|
7191
|
-
index: z24.number().int().min(0).optional()
|
|
7192
|
-
});
|
|
7193
|
-
var scheduledAgentsUnstageResponseSchema = z24.object({
|
|
7194
|
-
ok: z24.literal(true),
|
|
7195
|
-
data: z24.object({ ref: z24.string(), removed: z24.number().int().min(1) })
|
|
7196
|
-
});
|
|
7161
|
+
import { z as z25 } from "zod";
|
|
7197
7162
|
|
|
7198
7163
|
// ../api/src/scheduledAgentTriggers.ts
|
|
7199
|
-
import { z as
|
|
7164
|
+
import { z as z24 } from "zod";
|
|
7200
7165
|
var TRIGGER_GROUPS = {
|
|
7201
7166
|
time: { label: "Time", blurb: "On a clock you set." },
|
|
7202
7167
|
incoming: { label: "Incoming", blurb: "Another tool or your site calls in." },
|
|
@@ -7562,151 +7527,231 @@ var TRIGGER_TARGETS = {
|
|
|
7562
7527
|
"review.received": [target("sourceId", { open: false })],
|
|
7563
7528
|
"advertiser.new_ads": [target("advertiserId", { open: false })]
|
|
7564
7529
|
};
|
|
7565
|
-
var triggerTargetOptionSchema =
|
|
7566
|
-
value:
|
|
7567
|
-
label:
|
|
7530
|
+
var triggerTargetOptionSchema = z24.object({
|
|
7531
|
+
value: z24.string(),
|
|
7532
|
+
label: z24.string(),
|
|
7568
7533
|
/** A second line: a status, a tag list, where it comes from. */
|
|
7569
|
-
detail:
|
|
7534
|
+
detail: z24.string().optional(),
|
|
7570
7535
|
/** A mark: a path under the dashboard's `/logos/`, or an absolute image URL. */
|
|
7571
|
-
logo:
|
|
7536
|
+
logo: z24.string().optional()
|
|
7572
7537
|
});
|
|
7573
|
-
var scheduledAgentTriggerSchema =
|
|
7574
|
-
|
|
7575
|
-
kind:
|
|
7538
|
+
var scheduledAgentTriggerSchema = z24.discriminatedUnion("kind", [
|
|
7539
|
+
z24.object({
|
|
7540
|
+
kind: z24.literal("time.once"),
|
|
7576
7541
|
/** Epoch ms. Must still be in the future when the item is written. */
|
|
7577
|
-
runAt:
|
|
7542
|
+
runAt: z24.number(),
|
|
7578
7543
|
/** IANA zone. Defaults to the company's. */
|
|
7579
|
-
tz:
|
|
7544
|
+
tz: z24.string()
|
|
7580
7545
|
}),
|
|
7581
|
-
|
|
7582
|
-
kind:
|
|
7546
|
+
z24.object({
|
|
7547
|
+
kind: z24.literal("time.cron"),
|
|
7583
7548
|
/** Five-field cron expression. */
|
|
7584
|
-
cronspec:
|
|
7585
|
-
tz:
|
|
7549
|
+
cronspec: z24.string(),
|
|
7550
|
+
tz: z24.string()
|
|
7586
7551
|
}),
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
kind:
|
|
7552
|
+
z24.object({ kind: z24.literal("webhook.received") }),
|
|
7553
|
+
z24.object({
|
|
7554
|
+
kind: z24.literal("app.event"),
|
|
7590
7555
|
/** The connected tool, by its toolkit slug: `gmail`, `slack`. */
|
|
7591
|
-
toolkit:
|
|
7556
|
+
toolkit: z24.string(),
|
|
7592
7557
|
/** What happens in it, by the tool's own trigger id: `GMAIL_NEW_GMAIL_MESSAGE`. */
|
|
7593
|
-
appEvent:
|
|
7558
|
+
appEvent: z24.string(),
|
|
7594
7559
|
/** Which connected account — a tool can be connected more than once. */
|
|
7595
|
-
account:
|
|
7560
|
+
account: z24.string(),
|
|
7596
7561
|
/** The tool's own settings for the event (a label, a channel, a repository), as JSON text. */
|
|
7597
|
-
configJson:
|
|
7562
|
+
configJson: z24.string().optional()
|
|
7598
7563
|
}),
|
|
7599
|
-
|
|
7600
|
-
kind:
|
|
7564
|
+
z24.object({
|
|
7565
|
+
kind: z24.literal("event.received"),
|
|
7601
7566
|
/** Absent = any event. */
|
|
7602
|
-
eventName:
|
|
7567
|
+
eventName: z24.string().optional()
|
|
7603
7568
|
}),
|
|
7604
|
-
|
|
7605
|
-
kind:
|
|
7569
|
+
z24.object({
|
|
7570
|
+
kind: z24.literal("connection.created"),
|
|
7606
7571
|
/** Absent = any tool. An OAuth provider type, or a Composio toolkit slug. */
|
|
7607
|
-
provider:
|
|
7572
|
+
provider: z24.string().optional()
|
|
7608
7573
|
}),
|
|
7609
|
-
|
|
7610
|
-
kind:
|
|
7611
|
-
provider:
|
|
7574
|
+
z24.object({
|
|
7575
|
+
kind: z24.literal("connection.removed"),
|
|
7576
|
+
provider: z24.string().optional()
|
|
7612
7577
|
}),
|
|
7613
|
-
|
|
7614
|
-
kind:
|
|
7578
|
+
z24.object({
|
|
7579
|
+
kind: z24.literal("form.submitted"),
|
|
7615
7580
|
/** Absent = any Form. */
|
|
7616
|
-
flowId:
|
|
7581
|
+
flowId: z24.string().optional()
|
|
7617
7582
|
}),
|
|
7618
|
-
|
|
7619
|
-
kind:
|
|
7620
|
-
flowId:
|
|
7621
|
-
stepId:
|
|
7583
|
+
z24.object({
|
|
7584
|
+
kind: z24.literal("flow.step.submitted"),
|
|
7585
|
+
flowId: z24.string(),
|
|
7586
|
+
stepId: z24.string()
|
|
7622
7587
|
}),
|
|
7623
|
-
|
|
7624
|
-
kind:
|
|
7588
|
+
z24.object({
|
|
7589
|
+
kind: z24.literal("landing.created"),
|
|
7625
7590
|
/** Absent = any page. A page's slug. */
|
|
7626
|
-
page:
|
|
7591
|
+
page: z24.string().optional(),
|
|
7627
7592
|
/** Absent = any tag. */
|
|
7628
|
-
tag:
|
|
7593
|
+
tag: z24.string().optional()
|
|
7629
7594
|
}),
|
|
7630
|
-
|
|
7631
|
-
kind:
|
|
7632
|
-
page:
|
|
7633
|
-
tag:
|
|
7595
|
+
z24.object({
|
|
7596
|
+
kind: z24.literal("landing.published"),
|
|
7597
|
+
page: z24.string().optional(),
|
|
7598
|
+
tag: z24.string().optional()
|
|
7634
7599
|
}),
|
|
7635
|
-
|
|
7636
|
-
kind:
|
|
7600
|
+
z24.object({
|
|
7601
|
+
kind: z24.literal("experiment.started"),
|
|
7637
7602
|
/** Absent = any test. */
|
|
7638
|
-
experimentId:
|
|
7603
|
+
experimentId: z24.string().optional()
|
|
7639
7604
|
}),
|
|
7640
|
-
|
|
7641
|
-
kind:
|
|
7642
|
-
experimentId:
|
|
7605
|
+
z24.object({
|
|
7606
|
+
kind: z24.literal("experiment.decided"),
|
|
7607
|
+
experimentId: z24.string().optional()
|
|
7643
7608
|
}),
|
|
7644
|
-
|
|
7645
|
-
kind:
|
|
7646
|
-
experimentId:
|
|
7609
|
+
z24.object({
|
|
7610
|
+
kind: z24.literal("experiment.ended"),
|
|
7611
|
+
experimentId: z24.string().optional()
|
|
7647
7612
|
}),
|
|
7648
|
-
|
|
7649
|
-
kind:
|
|
7650
|
-
experimentId:
|
|
7613
|
+
z24.object({
|
|
7614
|
+
kind: z24.literal("experiment.concluded"),
|
|
7615
|
+
experimentId: z24.string().optional()
|
|
7651
7616
|
}),
|
|
7652
|
-
|
|
7653
|
-
kind:
|
|
7617
|
+
z24.object({
|
|
7618
|
+
kind: z24.literal("task.created"),
|
|
7654
7619
|
/** Absent = any Task. */
|
|
7655
|
-
tag:
|
|
7620
|
+
tag: z24.string().optional()
|
|
7656
7621
|
}),
|
|
7657
|
-
|
|
7658
|
-
kind:
|
|
7622
|
+
z24.object({
|
|
7623
|
+
kind: z24.literal("task.claimed"),
|
|
7659
7624
|
/** Absent = any Task. One Task, by id. */
|
|
7660
|
-
taskId:
|
|
7661
|
-
tag:
|
|
7625
|
+
taskId: z24.string().optional(),
|
|
7626
|
+
tag: z24.string().optional()
|
|
7662
7627
|
}),
|
|
7663
|
-
|
|
7664
|
-
kind:
|
|
7665
|
-
taskId:
|
|
7666
|
-
tag:
|
|
7628
|
+
z24.object({
|
|
7629
|
+
kind: z24.literal("task.completed"),
|
|
7630
|
+
taskId: z24.string().optional(),
|
|
7631
|
+
tag: z24.string().optional()
|
|
7667
7632
|
}),
|
|
7668
|
-
|
|
7669
|
-
kind:
|
|
7633
|
+
z24.object({
|
|
7634
|
+
kind: z24.literal("session.published"),
|
|
7670
7635
|
/** Absent = any agent. Only the runs of this Scheduled agent. */
|
|
7671
|
-
agentId:
|
|
7636
|
+
agentId: z24.string().optional()
|
|
7672
7637
|
}),
|
|
7673
|
-
|
|
7674
|
-
kind:
|
|
7675
|
-
agentId:
|
|
7638
|
+
z24.object({
|
|
7639
|
+
kind: z24.literal("session.publish_failed"),
|
|
7640
|
+
agentId: z24.string().optional()
|
|
7676
7641
|
}),
|
|
7677
|
-
|
|
7678
|
-
kind:
|
|
7642
|
+
z24.object({
|
|
7643
|
+
kind: z24.literal("knowledge.updated"),
|
|
7679
7644
|
/** Absent = any collection. */
|
|
7680
|
-
collection:
|
|
7645
|
+
collection: z24.string().optional()
|
|
7681
7646
|
}),
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
kind:
|
|
7686
|
-
provider:
|
|
7647
|
+
z24.object({ kind: z24.literal("brand.updated") }),
|
|
7648
|
+
z24.object({ kind: z24.literal("creative.created") }),
|
|
7649
|
+
z24.object({
|
|
7650
|
+
kind: z24.literal("connection.needs_reconnect"),
|
|
7651
|
+
provider: z24.string().optional()
|
|
7687
7652
|
}),
|
|
7688
|
-
|
|
7689
|
-
kind:
|
|
7653
|
+
z24.object({
|
|
7654
|
+
kind: z24.literal("session.publish_incomplete"),
|
|
7690
7655
|
/** Absent = any platform. One of `PUBLISH_PLATFORMS`. */
|
|
7691
|
-
platform:
|
|
7692
|
-
agentId:
|
|
7656
|
+
platform: z24.string().optional(),
|
|
7657
|
+
agentId: z24.string().optional()
|
|
7693
7658
|
}),
|
|
7694
|
-
|
|
7695
|
-
kind:
|
|
7659
|
+
z24.object({
|
|
7660
|
+
kind: z24.literal("review.received"),
|
|
7696
7661
|
/** Absent = any review source. */
|
|
7697
|
-
sourceId:
|
|
7662
|
+
sourceId: z24.string().optional()
|
|
7698
7663
|
}),
|
|
7699
|
-
|
|
7700
|
-
kind:
|
|
7664
|
+
z24.object({
|
|
7665
|
+
kind: z24.literal("advertiser.new_ads"),
|
|
7701
7666
|
/** Absent = any followed advertiser. */
|
|
7702
|
-
advertiserId:
|
|
7667
|
+
advertiserId: z24.string().optional()
|
|
7703
7668
|
})
|
|
7704
7669
|
]);
|
|
7705
|
-
var occurrencesSchema =
|
|
7670
|
+
var occurrencesSchema = z24.array(z24.number().int().positive()).max(32);
|
|
7706
7671
|
function firstTimes(count2) {
|
|
7707
7672
|
return Array.from({ length: Math.max(0, Math.floor(count2)) }, (_, index) => index + 1);
|
|
7708
7673
|
}
|
|
7709
7674
|
|
|
7675
|
+
// ../api/src/scheduledAgents.ts
|
|
7676
|
+
var scheduledAgentRunsAsSchema = z25.object({
|
|
7677
|
+
/** The person each run acts as; null when nobody owns it, so only the company's tools load. */
|
|
7678
|
+
name: z25.string().nullable(),
|
|
7679
|
+
/** That person's own connected tools. */
|
|
7680
|
+
personalTools: z25.array(z25.string()),
|
|
7681
|
+
/** The company's and organization's tools, and the platforms Baker connects to directly. */
|
|
7682
|
+
companyTools: z25.array(z25.string()),
|
|
7683
|
+
/** Set up, but nobody has signed in to them, so a run gets nothing from them. */
|
|
7684
|
+
notSignedIn: z25.array(z25.string()).optional(),
|
|
7685
|
+
/** The company switched connected tools off: only the platforms load. */
|
|
7686
|
+
toolsOff: z25.literal(true).optional()
|
|
7687
|
+
});
|
|
7688
|
+
var AUTO_PUBLISH_REFUSAL = 'Publishing every run unreviewed is a standing authorization only the user can grant, on the item itself, so it is recorded against their name. Stage the item without it, and once this chat is published ask the user to switch on "Publish its work on its own" (under "When a run finishes") on the item in Scheduled agents.';
|
|
7689
|
+
var scheduledAgentsUnstageRequestSchema = z25.object({
|
|
7690
|
+
chatId: z25.string().min(1),
|
|
7691
|
+
/** The item: a published id or a temp_agent_* id this chat staged. */
|
|
7692
|
+
ref: z25.string().min(1),
|
|
7693
|
+
/** One change of it, by its `index` in `list`'s draft. Left out, every change staged on it. */
|
|
7694
|
+
index: z25.number().int().min(0).optional()
|
|
7695
|
+
});
|
|
7696
|
+
var scheduledAgentsUnstageResponseSchema = z25.object({
|
|
7697
|
+
ok: z25.literal(true),
|
|
7698
|
+
data: z25.object({ ref: z25.string(), removed: z25.number().int().min(1) })
|
|
7699
|
+
});
|
|
7700
|
+
var scheduledAgentsListRequestSchema = z25.object({
|
|
7701
|
+
/** Also return what this chat staged. */
|
|
7702
|
+
chatId: z25.string().min(1).optional(),
|
|
7703
|
+
/** Every item and staged change as stored, briefs included. Left out, the compact view below. */
|
|
7704
|
+
full: z25.boolean().optional()
|
|
7705
|
+
});
|
|
7706
|
+
var scheduledAgentListItemSchema = z25.object({
|
|
7707
|
+
id: z25.string(),
|
|
7708
|
+
name: z25.string(),
|
|
7709
|
+
description: z25.string(),
|
|
7710
|
+
enabled: z25.boolean(),
|
|
7711
|
+
trigger: scheduledAgentTriggerSchema,
|
|
7712
|
+
occurrences: occurrencesSchema.optional(),
|
|
7713
|
+
conditions: conditionsSchema.optional(),
|
|
7714
|
+
cooldownMinutes: z25.number().optional(),
|
|
7715
|
+
/** ISO. Only a one-off knows its next moment. */
|
|
7716
|
+
nextRunAt: z25.string().optional(),
|
|
7717
|
+
/** ISO. */
|
|
7718
|
+
lastRunAt: z25.string().optional(),
|
|
7719
|
+
firedCount: z25.number(),
|
|
7720
|
+
totalRuns: z25.number(),
|
|
7721
|
+
templateName: z25.string().optional(),
|
|
7722
|
+
publishesOwnWork: z25.literal(true).optional(),
|
|
7723
|
+
/** Whether the connected tool is reporting to an `app.event` item. */
|
|
7724
|
+
listening: z25.object({ status: z25.string(), reason: z25.string().optional() }).optional()
|
|
7725
|
+
});
|
|
7726
|
+
var scheduledAgentStagedChangeSchema = z25.object({
|
|
7727
|
+
index: z25.number().int().min(0),
|
|
7728
|
+
kind: z25.enum(["create", "update", "delete"]),
|
|
7729
|
+
/** The published id, or the temp_agent_* id a create returned. */
|
|
7730
|
+
ref: z25.string(),
|
|
7731
|
+
name: z25.string(),
|
|
7732
|
+
description: z25.string().optional(),
|
|
7733
|
+
trigger: scheduledAgentTriggerSchema.optional(),
|
|
7734
|
+
enabled: z25.boolean().optional(),
|
|
7735
|
+
/** For an update: the fields it changes. */
|
|
7736
|
+
changes: z25.array(z25.string()).optional(),
|
|
7737
|
+
result: z25.object({
|
|
7738
|
+
status: z25.enum(["applied", "skipped", "failed"]),
|
|
7739
|
+
reason: z25.string().optional(),
|
|
7740
|
+
scheduledAgentId: z25.string().optional()
|
|
7741
|
+
}).optional()
|
|
7742
|
+
});
|
|
7743
|
+
var scheduledAgentsListResponseSchema = z25.object({
|
|
7744
|
+
ok: z25.literal(true),
|
|
7745
|
+
data: z25.object({
|
|
7746
|
+
published: z25.array(scheduledAgentListItemSchema),
|
|
7747
|
+
draft: z25.object({
|
|
7748
|
+
status: z25.enum(["active", "publishing", "discarded", "applied"]).nullable(),
|
|
7749
|
+
ops: z25.array(scheduledAgentStagedChangeSchema)
|
|
7750
|
+
}).nullable()
|
|
7751
|
+
}),
|
|
7752
|
+
hints: z25.array(z25.string()).optional()
|
|
7753
|
+
});
|
|
7754
|
+
|
|
7710
7755
|
// ../api/src/studio.ts
|
|
7711
7756
|
import { z as z26 } from "zod";
|
|
7712
7757
|
var studioGenerationStatusSchema = z26.enum(["running", "completed", "partial", "failed"]);
|
|
@@ -19827,6 +19872,10 @@ Full guide: __tooling__/docs/tools/baker/ads-google.md`
|
|
|
19827
19872
|
// src/commands/ads/linkedin/index.ts
|
|
19828
19873
|
import { defineCommand as defineCommand53 } from "citty";
|
|
19829
19874
|
|
|
19875
|
+
// src/commands/ads/linkedin/write-shared.ts
|
|
19876
|
+
import { createHash } from "crypto";
|
|
19877
|
+
import { readFileSync as readFileSync5 } from "fs";
|
|
19878
|
+
|
|
19830
19879
|
// src/commands/ads/linkedin/shared.ts
|
|
19831
19880
|
var DAY_MS2 = 864e5;
|
|
19832
19881
|
function handleLinkedinError(err) {
|
|
@@ -19919,48 +19968,18 @@ function daysAgoIso2(days) {
|
|
|
19919
19968
|
function csvOrJson2(args5) {
|
|
19920
19969
|
return args5.output ?? "json";
|
|
19921
19970
|
}
|
|
19922
|
-
function
|
|
19923
|
-
return `CSV of statuses (${LINKEDIN_SEARCH_STATUSES[level].join(",")})`;
|
|
19924
|
-
}
|
|
19925
|
-
function statusFilterError(level, statuses) {
|
|
19926
|
-
const unsupported = unsupportedLinkedinSearchStatuses(level, statuses);
|
|
19927
|
-
if (unsupported.length === 0) {
|
|
19928
|
-
return null;
|
|
19929
|
-
}
|
|
19930
|
-
const accepted = LINKEDIN_SEARCH_STATUSES[level].join(",");
|
|
19931
|
-
return {
|
|
19932
|
-
ok: false,
|
|
19933
|
-
error: {
|
|
19934
|
-
code: "INVALID_STATUS",
|
|
19935
|
-
message: `LinkedIn does not accept status ${unsupported.join(", ")} for this listing.`,
|
|
19936
|
-
fix: {
|
|
19937
|
-
action: "retry_with_flag",
|
|
19938
|
-
explanation: `Re-run with --statuses from ${accepted}, or --all-statuses to drop the filter.`
|
|
19939
|
-
},
|
|
19940
|
-
retryable: false
|
|
19941
|
-
}
|
|
19942
|
-
};
|
|
19943
|
-
}
|
|
19944
|
-
function resolveStatusFilter(args5, level) {
|
|
19971
|
+
function resolveStatusFilter(args5) {
|
|
19945
19972
|
if (args5["all-statuses"]) {
|
|
19946
19973
|
return void 0;
|
|
19947
19974
|
}
|
|
19948
19975
|
const explicit = args5.statuses;
|
|
19949
|
-
if (
|
|
19950
|
-
return
|
|
19976
|
+
if (explicit) {
|
|
19977
|
+
return explicit.split(",").map((s) => s.trim().toUpperCase()).filter(Boolean);
|
|
19951
19978
|
}
|
|
19952
|
-
|
|
19953
|
-
const error = statusFilterError(level, statuses);
|
|
19954
|
-
if (error) {
|
|
19955
|
-
writeAdsJson(error);
|
|
19956
|
-
process.exit(1);
|
|
19957
|
-
}
|
|
19958
|
-
return statuses;
|
|
19979
|
+
return ["ACTIVE"];
|
|
19959
19980
|
}
|
|
19960
19981
|
|
|
19961
19982
|
// src/commands/ads/linkedin/write-shared.ts
|
|
19962
|
-
import { createHash } from "crypto";
|
|
19963
|
-
import { readFileSync as readFileSync5 } from "fs";
|
|
19964
19983
|
var TOTAL_BUDGET_HELP = "Lifetime budget \u2014 on something already running it must exceed spend to date, or LinkedIn rejects it";
|
|
19965
19984
|
function bareAccountId(args5) {
|
|
19966
19985
|
const raw = resolveAccountIdArg2(args5);
|
|
@@ -20287,7 +20306,7 @@ registerSchema({
|
|
|
20287
20306
|
"account-id": { type: "string", description: "Account ID", required: false },
|
|
20288
20307
|
"account-urn": { type: "string", description: "Alias for --account-id", required: false },
|
|
20289
20308
|
"all-statuses": { type: "boolean", description: "Drop the ACTIVE filter", required: false },
|
|
20290
|
-
statuses: { type: "string", description:
|
|
20309
|
+
statuses: { type: "string", description: "CSV of statuses", required: false },
|
|
20291
20310
|
limit: { type: "string", description: "Max rows (default 500)", required: false },
|
|
20292
20311
|
"no-cache": NO_CACHE_ARG,
|
|
20293
20312
|
output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
|
|
@@ -20301,7 +20320,7 @@ registerSchema({
|
|
|
20301
20320
|
"account-urn": { type: "string", description: "Alias", required: false },
|
|
20302
20321
|
"campaign-group-id": { type: "string", description: "Filter by campaign group", required: false },
|
|
20303
20322
|
"all-statuses": { type: "boolean", description: "Drop the ACTIVE filter", required: false },
|
|
20304
|
-
statuses: { type: "string", description:
|
|
20323
|
+
statuses: { type: "string", description: "CSV of statuses", required: false },
|
|
20305
20324
|
limit: { type: "string", description: "Max rows", required: false },
|
|
20306
20325
|
"no-cache": NO_CACHE_ARG,
|
|
20307
20326
|
output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
|
|
@@ -20315,7 +20334,7 @@ registerSchema({
|
|
|
20315
20334
|
"account-urn": { type: "string", description: "Alias", required: false },
|
|
20316
20335
|
"campaign-id": { type: "string", description: "Filter by campaign", required: false },
|
|
20317
20336
|
"all-statuses": { type: "boolean", description: "Drop the ACTIVE filter", required: false },
|
|
20318
|
-
statuses: { type: "string", description:
|
|
20337
|
+
statuses: { type: "string", description: "CSV of statuses", required: false },
|
|
20319
20338
|
fields: {
|
|
20320
20339
|
type: "string",
|
|
20321
20340
|
description: "CSV of dotted paths to return instead of the compact row, e.g. id,content.textAd.landingPage",
|
|
@@ -22684,7 +22703,7 @@ var listArgs = {
|
|
|
22684
22703
|
"account-id": { type: "string", description: "Numeric account ID or urn:li:sponsoredAccount:N" },
|
|
22685
22704
|
"account-urn": { type: "string", description: "Alias for --account-id" },
|
|
22686
22705
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
|
|
22687
|
-
statuses: { type: "string", description:
|
|
22706
|
+
statuses: { type: "string", description: "CSV of statuses (ACTIVE,PAUSED,ARCHIVED,COMPLETED,DRAFT)" },
|
|
22688
22707
|
limit: { type: "string", description: "Max rows (default: 500)" },
|
|
22689
22708
|
"no-cache": NO_CACHE_ARG,
|
|
22690
22709
|
output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
|
|
@@ -22699,7 +22718,7 @@ var campaignGroupsListCommand = defineCommand40({
|
|
|
22699
22718
|
const accountId = resolveAccountIdArg2(args5);
|
|
22700
22719
|
try {
|
|
22701
22720
|
const params = { "account-id": accountId };
|
|
22702
|
-
const statuses = resolveStatusFilter(args5
|
|
22721
|
+
const statuses = resolveStatusFilter(args5);
|
|
22703
22722
|
if (statuses) params.statuses = statuses.join(",");
|
|
22704
22723
|
if (args5.limit) params.limit = String(args5.limit);
|
|
22705
22724
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
@@ -22750,7 +22769,7 @@ var listArgs2 = {
|
|
|
22750
22769
|
"account-urn": { type: "string", description: "Alias for --account-id" },
|
|
22751
22770
|
"campaign-group-id": { type: "string", description: "Filter by campaign group" },
|
|
22752
22771
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
|
|
22753
|
-
statuses: { type: "string", description:
|
|
22772
|
+
statuses: { type: "string", description: "CSV of statuses" },
|
|
22754
22773
|
limit: { type: "string", description: "Max rows (default: 500)" },
|
|
22755
22774
|
"no-cache": NO_CACHE_ARG,
|
|
22756
22775
|
output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
|
|
@@ -22765,7 +22784,7 @@ var campaignsListCommand = defineCommand41({
|
|
|
22765
22784
|
const accountId = resolveAccountIdArg2(args5);
|
|
22766
22785
|
try {
|
|
22767
22786
|
const params = { "account-id": accountId };
|
|
22768
|
-
const statuses = resolveStatusFilter(args5
|
|
22787
|
+
const statuses = resolveStatusFilter(args5);
|
|
22769
22788
|
if (statuses) params.statuses = statuses.join(",");
|
|
22770
22789
|
if (args5["campaign-group-id"]) params["campaign-group-id"] = String(args5["campaign-group-id"]);
|
|
22771
22790
|
if (args5.limit) params.limit = String(args5.limit);
|
|
@@ -23085,7 +23104,7 @@ var listArgs3 = {
|
|
|
23085
23104
|
"account-urn": { type: "string", description: "Alias for --account-id" },
|
|
23086
23105
|
"campaign-id": { type: "string", description: "Filter by campaign ID" },
|
|
23087
23106
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
|
|
23088
|
-
statuses: { type: "string", description:
|
|
23107
|
+
statuses: { type: "string", description: "CSV of intended statuses (ACTIVE,PAUSED,DRAFT,ARCHIVED)" },
|
|
23089
23108
|
fields: {
|
|
23090
23109
|
type: "string",
|
|
23091
23110
|
description: "CSV of dotted paths to return instead of the compact row, e.g. id,content.textAd.landingPage"
|
|
@@ -23105,7 +23124,7 @@ var creativesListCommand = defineCommand44({
|
|
|
23105
23124
|
const accountId = resolveAccountIdArg2(args5);
|
|
23106
23125
|
try {
|
|
23107
23126
|
const params = { "account-id": accountId };
|
|
23108
|
-
const statuses = resolveStatusFilter(args5
|
|
23127
|
+
const statuses = resolveStatusFilter(args5);
|
|
23109
23128
|
if (statuses) params.statuses = statuses.join(",");
|
|
23110
23129
|
if (args5["campaign-id"]) params["campaign-id"] = String(args5["campaign-id"]);
|
|
23111
23130
|
if (args5.limit) params.limit = String(args5.limit);
|
|
@@ -63987,27 +64006,32 @@ var getCommand4 = defineCommand199({
|
|
|
63987
64006
|
|
|
63988
64007
|
// src/commands/scheduled-agents/list.ts
|
|
63989
64008
|
import { defineCommand as defineCommand200 } from "citty";
|
|
64009
|
+
var FULL_DESCRIPTION = "Return every item and staged change as stored, briefs included (tens of KB). Prefer `get <id>` for one item.";
|
|
63990
64010
|
registerSchema({
|
|
63991
64011
|
command: "scheduled-agents.list",
|
|
63992
|
-
description: "List published
|
|
64012
|
+
description: "List scheduled agents compactly: each published item's id, name, trigger, enabled and run counts, and each change this chat staged (index, kind, ref, name, trigger). Briefs are left out \u2014 `get <id>` returns one item in full, --full returns everything as stored. Includes draft state when BAKER_CHAT_ID is set, or --chat <id> to read an earlier chat's staged items instead.",
|
|
63993
64013
|
args: {
|
|
63994
|
-
chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
|
|
64014
|
+
chat: { type: "string", description: CHAT_READ_ARG.description, required: false },
|
|
64015
|
+
full: { type: "boolean", description: FULL_DESCRIPTION, required: false }
|
|
63995
64016
|
}
|
|
63996
64017
|
});
|
|
63997
64018
|
var listCommand17 = defineCommand200({
|
|
63998
64019
|
meta: {
|
|
63999
64020
|
name: "list",
|
|
64000
|
-
description: "List scheduled agents
|
|
64021
|
+
description: "List scheduled agents: id, name, trigger and status for each, plus this chat's staged changes when BAKER_CHAT_ID is set (or --chat <id> for an earlier chat's). Briefs are left out. Start here: baker scheduled-agents list; then baker scheduled-agents get <id> for one item's brief."
|
|
64022
|
+
},
|
|
64023
|
+
args: {
|
|
64024
|
+
chat: CHAT_READ_ARG,
|
|
64025
|
+
full: { type: "boolean", description: FULL_DESCRIPTION, required: false, default: false }
|
|
64001
64026
|
},
|
|
64002
|
-
args: { chat: CHAT_READ_ARG },
|
|
64003
64027
|
run: async ({ args: args5 }) => {
|
|
64004
64028
|
try {
|
|
64005
64029
|
const env = getEnv();
|
|
64006
|
-
const body = {};
|
|
64007
64030
|
const chatId = typeof args5.chat === "string" && args5.chat.length > 0 ? args5.chat : env.BAKER_CHAT_ID;
|
|
64008
|
-
|
|
64009
|
-
|
|
64010
|
-
|
|
64031
|
+
const body = {
|
|
64032
|
+
...chatId ? { chatId } : {},
|
|
64033
|
+
...args5.full === true ? { full: true } : {}
|
|
64034
|
+
};
|
|
64011
64035
|
const response = await apiPost("/api/scheduled-agents/list", body);
|
|
64012
64036
|
writeJson(response);
|
|
64013
64037
|
} catch (err) {
|