@koda-sl/baker-cli 0.93.0 → 0.95.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 +35 -49
- package/dist/{chunk-LMVDA3EZ.js → chunk-RCPMJKI7.js} +13 -6
- package/dist/chunk-RCPMJKI7.js.map +1 -0
- package/dist/cli.js +792 -676
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.d.ts +5 -0
- package/dist/engine/index.js +1 -1
- package/package.json +2 -1
- package/dist/chunk-LMVDA3EZ.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
defaultRegistry,
|
|
10
10
|
generateCatalog,
|
|
11
11
|
validateCanvasDeep
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RCPMJKI7.js";
|
|
13
13
|
|
|
14
14
|
// src/cli.ts
|
|
15
|
-
import { defineCommand as
|
|
15
|
+
import { defineCommand as defineCommand143, runMain } from "citty";
|
|
16
16
|
|
|
17
17
|
// src/commands/actions/index.ts
|
|
18
|
-
import { defineCommand as
|
|
18
|
+
import { defineCommand as defineCommand13 } from "citty";
|
|
19
19
|
|
|
20
20
|
// src/commands/actions/claim.ts
|
|
21
21
|
import { defineCommand } from "citty";
|
|
@@ -465,6 +465,22 @@ function generateTempId() {
|
|
|
465
465
|
function isTempId(id) {
|
|
466
466
|
return id.startsWith("temp_");
|
|
467
467
|
}
|
|
468
|
+
var SCHEDULE_SIGNALS = [
|
|
469
|
+
/\brecurr(?:ing|ence)\b/i,
|
|
470
|
+
/\bcadence\b/i,
|
|
471
|
+
/\bcron\b/i,
|
|
472
|
+
/\bschedule[ds]?\b/i,
|
|
473
|
+
/\b(?:daily|weekly|monthly|quarterly|annual(?:ly)?|biweekly|nightly)\b/i,
|
|
474
|
+
/\bevery\s+(?:day|week|month|quarter|year|morning|monday|tuesday|wednesday|thursday|friday|saturday|sunday|\d)/i,
|
|
475
|
+
/\beach\s+(?:day|week|month|monday|tuesday|wednesday|thursday|friday|saturday|sunday)\b/i,
|
|
476
|
+
/\bremind(?:er|s)?\b/i,
|
|
477
|
+
/\brun\s+at\b/i
|
|
478
|
+
];
|
|
479
|
+
function looksScheduled(name, description) {
|
|
480
|
+
const haystack = `${name}
|
|
481
|
+
${description}`;
|
|
482
|
+
return SCHEDULE_SIGNALS.some((re) => re.test(haystack));
|
|
483
|
+
}
|
|
468
484
|
|
|
469
485
|
// src/commands/actions/claim.ts
|
|
470
486
|
registerSchema({
|
|
@@ -509,7 +525,7 @@ var claimCommand = defineCommand({
|
|
|
509
525
|
import { defineCommand as defineCommand2 } from "citty";
|
|
510
526
|
registerSchema({
|
|
511
527
|
command: "actions.complete",
|
|
512
|
-
description: "Stage completion of an action. Accepts a real action ID (must be claimed) or a temp ID from the same draft. The action becomes completed when the chat is published.",
|
|
528
|
+
description: "Stage completion of an action (it was DONE). Accepts a real action ID (must be claimed) or a temp ID from the same draft. The action becomes completed when the chat is published. Do NOT use this to drop an action you no longer want \u2014 to remove a staged op use `actions draft remove`, to close an unwanted published action use `actions discard`.",
|
|
513
529
|
args: {
|
|
514
530
|
id: { type: "string", description: "Action ID or temp ID", required: true },
|
|
515
531
|
note: { type: "string", description: "What was done \u2014 context for the team and AI", required: false }
|
|
@@ -547,7 +563,7 @@ var completeCommand = defineCommand2({
|
|
|
547
563
|
import { defineCommand as defineCommand3 } from "citty";
|
|
548
564
|
registerSchema({
|
|
549
565
|
command: "actions.create",
|
|
550
|
-
description: "Stage creation of a new action (applies when the chat is published). Returns a tempId you can use to link in the same draft. After creating, check if this action blocks or is blocked by other actions and wire dependencies with `baker actions link`.
|
|
566
|
+
description: "Stage creation of a new action (applies when the chat is published). Returns a tempId you can use to link in the same draft. After creating, check if this action blocks or is blocked by other actions and wire dependencies with `baker actions link`.",
|
|
551
567
|
args: {
|
|
552
568
|
name: { type: "string", description: "Action name (short, action-verb, \u22646 words)", required: true },
|
|
553
569
|
description: {
|
|
@@ -555,17 +571,7 @@ registerSchema({
|
|
|
555
571
|
description: "Context-complete description: what / why / where / done-when",
|
|
556
572
|
required: false
|
|
557
573
|
},
|
|
558
|
-
"temp-id": { type: "string", description: "Custom tempId (auto-generated if omitted)", required: false }
|
|
559
|
-
mission: {
|
|
560
|
-
type: "string",
|
|
561
|
-
description: "Attach the new action to this mission (id or missionTempId) as a step, in one atomic op",
|
|
562
|
-
required: false
|
|
563
|
-
},
|
|
564
|
-
order: {
|
|
565
|
-
type: "string",
|
|
566
|
-
description: "0-based position of the step within the mission (required when --mission is set)",
|
|
567
|
-
required: false
|
|
568
|
-
}
|
|
574
|
+
"temp-id": { type: "string", description: "Custom tempId (auto-generated if omitted)", required: false }
|
|
569
575
|
}
|
|
570
576
|
});
|
|
571
577
|
var createCommand = defineCommand3({
|
|
@@ -576,9 +582,7 @@ var createCommand = defineCommand3({
|
|
|
576
582
|
args: {
|
|
577
583
|
name: { type: "string", description: "Action name", required: false },
|
|
578
584
|
description: { type: "string", description: "Description", required: false, default: "" },
|
|
579
|
-
"temp-id": { type: "string", description: "Optional custom tempId", required: false }
|
|
580
|
-
mission: { type: "string", description: "Mission ref to attach this step to", required: false },
|
|
581
|
-
order: { type: "string", description: "0-based step position (required with --mission)", required: false }
|
|
585
|
+
"temp-id": { type: "string", description: "Optional custom tempId", required: false }
|
|
582
586
|
},
|
|
583
587
|
run: async ({ args }) => {
|
|
584
588
|
try {
|
|
@@ -586,31 +590,24 @@ var createCommand = defineCommand3({
|
|
|
586
590
|
if (!name || name.trim().length === 0) {
|
|
587
591
|
failValidation("--name is required.");
|
|
588
592
|
}
|
|
589
|
-
const mission = args.mission;
|
|
590
|
-
let order;
|
|
591
|
-
if (mission) {
|
|
592
|
-
order = Number.parseInt(args.order ?? "", 10);
|
|
593
|
-
if (Number.isNaN(order) || order < 0) {
|
|
594
|
-
failValidation("--order must be a non-negative integer when --mission is set.");
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
593
|
const chatId = requireChatId();
|
|
598
594
|
const tempId = args["temp-id"] || generateTempId();
|
|
599
595
|
const response = await apiPost("/api/actions/create", {
|
|
600
596
|
chatId,
|
|
601
597
|
tempId,
|
|
602
598
|
name,
|
|
603
|
-
description: args.description ?? ""
|
|
604
|
-
...mission ? { missionRef: mission, order } : {}
|
|
599
|
+
description: args.description ?? ""
|
|
605
600
|
});
|
|
606
601
|
const hints = [];
|
|
602
|
+
if (looksScheduled(name, args.description ?? "")) {
|
|
603
|
+
hints.push(
|
|
604
|
+
'This reads as recurring/scheduled work. If it should run on a cadence or a future date, create a Scheduled Action instead \u2014 baker scheduled-actions create --cron "0 9 * * MON" (or --run-at). Do NOT capture "set up a scheduled action" as a Work Action.'
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
607
|
hints.push(`Link dependencies: baker actions link --blocker <id> --blocked ${tempId}`);
|
|
608
608
|
if (!args.description) {
|
|
609
609
|
hints.push("Add description: baker actions update <tempId> --description '...' (what/why/where/done-when)");
|
|
610
610
|
}
|
|
611
|
-
if (mission) {
|
|
612
|
-
hints.push(`Attached to mission ${mission} at order ${order}.`);
|
|
613
|
-
}
|
|
614
611
|
writeJson({ ...response, hints });
|
|
615
612
|
} catch (err) {
|
|
616
613
|
failApi(err);
|
|
@@ -658,8 +655,133 @@ var discardCommand = defineCommand4({
|
|
|
658
655
|
}
|
|
659
656
|
});
|
|
660
657
|
|
|
661
|
-
// src/commands/actions/
|
|
658
|
+
// src/commands/actions/draft.ts
|
|
662
659
|
import { defineCommand as defineCommand5 } from "citty";
|
|
660
|
+
var REMOVE_OP_KINDS = ["update", "complete", "discard", "tagAdd", "tagRemove"];
|
|
661
|
+
registerSchema({
|
|
662
|
+
command: "actions.draft.list",
|
|
663
|
+
description: "Review the action ops staged in THIS chat's draft before publish (creates/updates/completes/discards/links). Staged ops are invisible to `actions list`/`status` until the chat publishes \u2014 use this to verify what will apply and catch duplicates.",
|
|
664
|
+
args: {}
|
|
665
|
+
});
|
|
666
|
+
registerSchema({
|
|
667
|
+
command: "actions.draft.remove",
|
|
668
|
+
description: "Drop a single staged action op from this chat's draft before publish. For a tempId, removing the create cascades into its complete/link/tagAdd ops. For a real action ID, pass --op to say which op to drop. Use this to UNDO a staged op \u2014 never stage `complete` to delete an action.",
|
|
669
|
+
args: {
|
|
670
|
+
ref: { type: "string", description: "tempId (temp_*) or real action ID to drop from the draft", required: true },
|
|
671
|
+
op: {
|
|
672
|
+
type: "string",
|
|
673
|
+
description: "Required for real action IDs: which op to drop (update|complete|discard|tagAdd|tagRemove)",
|
|
674
|
+
required: false
|
|
675
|
+
},
|
|
676
|
+
"tag-slug": { type: "string", description: "Tag slug (only for --op tagAdd|tagRemove)", required: false }
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
registerSchema({
|
|
680
|
+
command: "actions.draft.clear",
|
|
681
|
+
description: "Discard ALL staged action ops in this chat's draft before publish. Nothing applies on publish. Does not touch already-published actions.",
|
|
682
|
+
args: {}
|
|
683
|
+
});
|
|
684
|
+
var listCommand = defineCommand5({
|
|
685
|
+
meta: {
|
|
686
|
+
name: "list",
|
|
687
|
+
description: "Show every action op staged in this chat's draft, with footgun warnings. Example: baker actions draft"
|
|
688
|
+
},
|
|
689
|
+
run: async () => {
|
|
690
|
+
try {
|
|
691
|
+
const chatId = requireChatId();
|
|
692
|
+
const response = await apiPost("/api/actions/draft", { chatId });
|
|
693
|
+
writeJson(response);
|
|
694
|
+
} catch (err) {
|
|
695
|
+
failApi(err);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
var removeCommand = defineCommand5({
|
|
700
|
+
meta: {
|
|
701
|
+
name: "remove",
|
|
702
|
+
description: "Drop one staged op from the draft. Example: baker actions draft remove temp_abc123 | baker actions draft remove jx7... --op complete"
|
|
703
|
+
},
|
|
704
|
+
args: {
|
|
705
|
+
ref: { type: "positional", description: "tempId or real action ID", required: false },
|
|
706
|
+
op: {
|
|
707
|
+
type: "string",
|
|
708
|
+
description: "Op kind for real IDs: update|complete|discard|tagAdd|tagRemove",
|
|
709
|
+
required: false
|
|
710
|
+
},
|
|
711
|
+
"tag-slug": { type: "string", description: "Tag slug (for tagAdd|tagRemove)", required: false }
|
|
712
|
+
},
|
|
713
|
+
run: async ({ args }) => {
|
|
714
|
+
try {
|
|
715
|
+
const ref = args.ref;
|
|
716
|
+
if (!ref) {
|
|
717
|
+
failValidation("A tempId or action ID is required.");
|
|
718
|
+
}
|
|
719
|
+
const chatId = requireChatId();
|
|
720
|
+
if (isTempId(ref)) {
|
|
721
|
+
await apiPost("/api/actions/draft-op/remove", {
|
|
722
|
+
chatId,
|
|
723
|
+
target: { kind: "tempId", tempId: ref }
|
|
724
|
+
});
|
|
725
|
+
writeJson({ ok: true, data: { removed: ref, kind: "tempId" } });
|
|
726
|
+
return;
|
|
727
|
+
}
|
|
728
|
+
validateConvexId(ref);
|
|
729
|
+
const op = args.op;
|
|
730
|
+
if (!op || !REMOVE_OP_KINDS.includes(op)) {
|
|
731
|
+
failValidation(
|
|
732
|
+
`Removing a staged op for a real action ID requires --op (one of: ${REMOVE_OP_KINDS.join("|")}).`
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
const tagSlug = args["tag-slug"];
|
|
736
|
+
await apiPost("/api/actions/draft-op/remove", {
|
|
737
|
+
chatId,
|
|
738
|
+
target: { kind: "actionId", actionId: ref, opKind: op, ...tagSlug ? { tagSlug } : {} }
|
|
739
|
+
});
|
|
740
|
+
writeJson({ ok: true, data: { removed: ref, kind: "actionId", op } });
|
|
741
|
+
} catch (err) {
|
|
742
|
+
failApi(err);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
var clearCommand = defineCommand5({
|
|
747
|
+
meta: {
|
|
748
|
+
name: "clear",
|
|
749
|
+
description: "Discard every staged op in this chat's draft. Example: baker actions draft clear"
|
|
750
|
+
},
|
|
751
|
+
run: async () => {
|
|
752
|
+
try {
|
|
753
|
+
const chatId = requireChatId();
|
|
754
|
+
await apiPost("/api/actions/draft/clear", { chatId });
|
|
755
|
+
writeJson({ ok: true, data: { cleared: true } });
|
|
756
|
+
} catch (err) {
|
|
757
|
+
failApi(err);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
var draftCommand = defineCommand5({
|
|
762
|
+
meta: {
|
|
763
|
+
name: "draft",
|
|
764
|
+
description: "Review and edit the action ops staged in this chat BEFORE publish. Subcommands: list (default), remove, clear. Staged ops are invisible to `actions list`/`status` until publish, so check here before finishing."
|
|
765
|
+
},
|
|
766
|
+
subCommands: {
|
|
767
|
+
list: listCommand,
|
|
768
|
+
remove: removeCommand,
|
|
769
|
+
clear: clearCommand
|
|
770
|
+
},
|
|
771
|
+
// Bare `baker actions draft` (no subcommand) shows the staged ops.
|
|
772
|
+
run: async () => {
|
|
773
|
+
try {
|
|
774
|
+
const chatId = requireChatId();
|
|
775
|
+
const response = await apiPost("/api/actions/draft", { chatId });
|
|
776
|
+
writeJson(response);
|
|
777
|
+
} catch (err) {
|
|
778
|
+
failApi(err);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
});
|
|
782
|
+
|
|
783
|
+
// src/commands/actions/get.ts
|
|
784
|
+
import { defineCommand as defineCommand6 } from "citty";
|
|
663
785
|
registerSchema({
|
|
664
786
|
command: "actions.get",
|
|
665
787
|
description: "Get a single action with tags, blockers, blocked-by, and active-chat info.",
|
|
@@ -667,7 +789,7 @@ registerSchema({
|
|
|
667
789
|
id: { type: "string", description: "Action ID", required: true }
|
|
668
790
|
}
|
|
669
791
|
});
|
|
670
|
-
var getCommand =
|
|
792
|
+
var getCommand = defineCommand6({
|
|
671
793
|
meta: { name: "get", description: "Get a single action by ID. Example: baker actions get <action-id>" },
|
|
672
794
|
args: {
|
|
673
795
|
id: { type: "positional", description: "Action ID", required: false },
|
|
@@ -689,7 +811,7 @@ var getCommand = defineCommand5({
|
|
|
689
811
|
});
|
|
690
812
|
|
|
691
813
|
// src/commands/actions/link.ts
|
|
692
|
-
import { defineCommand as
|
|
814
|
+
import { defineCommand as defineCommand7 } from "citty";
|
|
693
815
|
registerSchema({
|
|
694
816
|
command: "actions.link",
|
|
695
817
|
description: "Stage a 'blocker -> blocked' dependency. Refs can be either action IDs or tempIds from create ops in the same draft.",
|
|
@@ -698,7 +820,7 @@ registerSchema({
|
|
|
698
820
|
blocked: { type: "string", description: "Blocked action ID or tempId", required: true }
|
|
699
821
|
}
|
|
700
822
|
});
|
|
701
|
-
var linkCommand =
|
|
823
|
+
var linkCommand = defineCommand7({
|
|
702
824
|
meta: {
|
|
703
825
|
name: "link",
|
|
704
826
|
description: "Stage a dependency link. Example: baker actions link --blocker <id> --blocked <id>"
|
|
@@ -728,7 +850,7 @@ var linkCommand = defineCommand6({
|
|
|
728
850
|
});
|
|
729
851
|
|
|
730
852
|
// src/commands/actions/list.ts
|
|
731
|
-
import { defineCommand as
|
|
853
|
+
import { defineCommand as defineCommand8 } from "citty";
|
|
732
854
|
registerSchema({
|
|
733
855
|
command: "actions.list",
|
|
734
856
|
description: "List actions for the current company. Default: pre-bucketed (claimable/myClaims/blocked/claimedByOthers/completed/discarded). Set --bucketed=false for a flat list filterable by --status.",
|
|
@@ -746,7 +868,7 @@ registerSchema({
|
|
|
746
868
|
}
|
|
747
869
|
}
|
|
748
870
|
});
|
|
749
|
-
var
|
|
871
|
+
var listCommand2 = defineCommand8({
|
|
750
872
|
meta: {
|
|
751
873
|
name: "list",
|
|
752
874
|
description: "List actions. Default: bucketed view (claimable, myClaims, blocked, claimedByOthers). Use --bucketed=false for raw filter by --status."
|
|
@@ -777,7 +899,7 @@ var listCommand = defineCommand7({
|
|
|
777
899
|
});
|
|
778
900
|
|
|
779
901
|
// src/commands/actions/release.ts
|
|
780
|
-
import { defineCommand as
|
|
902
|
+
import { defineCommand as defineCommand9 } from "citty";
|
|
781
903
|
registerSchema({
|
|
782
904
|
command: "actions.release",
|
|
783
905
|
description: "Release an action you previously claimed (no-op if you don't own the claim).",
|
|
@@ -785,7 +907,7 @@ registerSchema({
|
|
|
785
907
|
id: { type: "string", description: "Action ID", required: true }
|
|
786
908
|
}
|
|
787
909
|
});
|
|
788
|
-
var releaseCommand =
|
|
910
|
+
var releaseCommand = defineCommand9({
|
|
789
911
|
meta: {
|
|
790
912
|
name: "release",
|
|
791
913
|
description: "Release a claim you made on an action. Example: baker actions release <action-id>"
|
|
@@ -811,15 +933,15 @@ var releaseCommand = defineCommand8({
|
|
|
811
933
|
});
|
|
812
934
|
|
|
813
935
|
// src/commands/actions/status.ts
|
|
814
|
-
import { defineCommand as
|
|
936
|
+
import { defineCommand as defineCommand10 } from "citty";
|
|
815
937
|
registerSchema({
|
|
816
938
|
command: "actions.status",
|
|
817
|
-
description: "Resolve one or more Work Action refs by real action ID or temp_* ref in a single batch call.",
|
|
939
|
+
description: "Resolve one or more Work Action refs by real action ID or temp_* ref in a single batch call. When BAKER_CHAT_ID is set, a temp_* ref still staged in THIS chat resolves to status 'draft' (not 'not_found') \u2014 staged ops only become published actions on chat publish.",
|
|
818
940
|
args: {
|
|
819
941
|
refs: { type: "string", description: "One or more action refs: real action IDs or temp_* refs", required: true }
|
|
820
942
|
}
|
|
821
943
|
});
|
|
822
|
-
var statusCommand =
|
|
944
|
+
var statusCommand = defineCommand10({
|
|
823
945
|
meta: {
|
|
824
946
|
name: "status",
|
|
825
947
|
description: "Resolve Work Action refs by real ID or temp_* ref. Example: baker actions status temp_hero jx123"
|
|
@@ -833,7 +955,9 @@ var statusCommand = defineCommand9({
|
|
|
833
955
|
if (refs.length === 0) {
|
|
834
956
|
failValidation("At least one action ref is required.");
|
|
835
957
|
}
|
|
836
|
-
const
|
|
958
|
+
const { BAKER_CHAT_ID } = getEnv();
|
|
959
|
+
const body = BAKER_CHAT_ID ? { refs, chatId: BAKER_CHAT_ID } : { refs };
|
|
960
|
+
const response = await apiPost("/api/actions/status", body);
|
|
837
961
|
writeJson(response);
|
|
838
962
|
} catch (err) {
|
|
839
963
|
failApi(err);
|
|
@@ -842,7 +966,7 @@ var statusCommand = defineCommand9({
|
|
|
842
966
|
});
|
|
843
967
|
|
|
844
968
|
// src/commands/actions/unlink.ts
|
|
845
|
-
import { defineCommand as
|
|
969
|
+
import { defineCommand as defineCommand11 } from "citty";
|
|
846
970
|
registerSchema({
|
|
847
971
|
command: "actions.unlink",
|
|
848
972
|
description: "Stage removal of a 'blocker -> blocked' dependency. The blocked action must be claimed by current chat.",
|
|
@@ -851,7 +975,7 @@ registerSchema({
|
|
|
851
975
|
blocked: { type: "string", description: "Blocked action ID (must be claimed by current chat)", required: true }
|
|
852
976
|
}
|
|
853
977
|
});
|
|
854
|
-
var unlinkCommand =
|
|
978
|
+
var unlinkCommand = defineCommand11({
|
|
855
979
|
meta: {
|
|
856
980
|
name: "unlink",
|
|
857
981
|
description: "Stage removal of a dependency. Example: baker actions unlink --blocker <id> --blocked <id>"
|
|
@@ -883,7 +1007,7 @@ var unlinkCommand = defineCommand10({
|
|
|
883
1007
|
});
|
|
884
1008
|
|
|
885
1009
|
// src/commands/actions/update.ts
|
|
886
|
-
import { defineCommand as
|
|
1010
|
+
import { defineCommand as defineCommand12 } from "citty";
|
|
887
1011
|
registerSchema({
|
|
888
1012
|
command: "actions.update",
|
|
889
1013
|
description: "Stage an update on a claimed action (name and/or description). Applies on publish.",
|
|
@@ -893,7 +1017,7 @@ registerSchema({
|
|
|
893
1017
|
description: { type: "string", description: "New description", required: false }
|
|
894
1018
|
}
|
|
895
1019
|
});
|
|
896
|
-
var updateCommand =
|
|
1020
|
+
var updateCommand = defineCommand12({
|
|
897
1021
|
meta: {
|
|
898
1022
|
name: "update",
|
|
899
1023
|
description: 'Stage an update on a claimed action. Example: baker actions update <id> --name "New name"'
|
|
@@ -929,15 +1053,20 @@ var updateCommand = defineCommand11({
|
|
|
929
1053
|
});
|
|
930
1054
|
|
|
931
1055
|
// src/commands/actions/index.ts
|
|
932
|
-
var actionsCommand =
|
|
1056
|
+
var actionsCommand = defineCommand13({
|
|
933
1057
|
meta: {
|
|
934
1058
|
name: "actions",
|
|
935
|
-
description: `Manage action items for the current chat. Subcommands: list, get, status, claim, release, create, update, complete, discard, link, unlink.
|
|
1059
|
+
description: `Manage action items for the current chat. Subcommands: list, draft, get, status, claim, release, create, update, complete, discard, link, unlink.
|
|
1060
|
+
|
|
1061
|
+
Lifecycle: claim an action before working on it. Stage create/update/complete/discard/link via this CLI; they apply when the chat is published. Release if you decide not to work on it after all.
|
|
936
1062
|
|
|
937
|
-
|
|
1063
|
+
Staged vs published: create/update/complete/discard/link are STAGED in this chat's draft and are invisible to \`list\`/\`status\` until the chat publishes. Review them with \`actions draft\` before finishing. To drop a staged op, use \`actions draft remove <ref>\` \u2014 never stage \`complete\` to delete a staged action (that publishes it as already-completed, leaving a duplicate).
|
|
938
1064
|
|
|
939
1065
|
Examples:
|
|
940
|
-
baker actions list # bucketed view
|
|
1066
|
+
baker actions list # bucketed view of PUBLISHED actions
|
|
1067
|
+
baker actions draft # review what THIS chat has staged (pre-publish)
|
|
1068
|
+
baker actions draft remove temp_hero # drop a staged create (cascades its complete/link ops)
|
|
1069
|
+
baker actions draft clear # drop everything staged in this chat
|
|
941
1070
|
baker actions status temp_hero jx123 # batch resolve real IDs and temp_* refs
|
|
942
1071
|
baker actions claim <id>
|
|
943
1072
|
baker actions create --name "Build hero" --description "..."
|
|
@@ -945,7 +1074,8 @@ Examples:
|
|
|
945
1074
|
baker actions discard <id> --reason "obsolete"`
|
|
946
1075
|
},
|
|
947
1076
|
subCommands: {
|
|
948
|
-
list:
|
|
1077
|
+
list: listCommand2,
|
|
1078
|
+
draft: draftCommand,
|
|
949
1079
|
get: getCommand,
|
|
950
1080
|
status: statusCommand,
|
|
951
1081
|
claim: claimCommand,
|
|
@@ -960,13 +1090,13 @@ Examples:
|
|
|
960
1090
|
});
|
|
961
1091
|
|
|
962
1092
|
// src/commands/ads/index.ts
|
|
963
|
-
import { defineCommand as
|
|
1093
|
+
import { defineCommand as defineCommand73 } from "citty";
|
|
964
1094
|
|
|
965
1095
|
// src/commands/ads/google/index.ts
|
|
966
|
-
import { defineCommand as
|
|
1096
|
+
import { defineCommand as defineCommand24 } from "citty";
|
|
967
1097
|
|
|
968
1098
|
// src/commands/ads/google/accounts.ts
|
|
969
|
-
import { defineCommand as
|
|
1099
|
+
import { defineCommand as defineCommand14 } from "citty";
|
|
970
1100
|
|
|
971
1101
|
// src/commands/ads/cache.ts
|
|
972
1102
|
import { createHash } from "crypto";
|
|
@@ -1242,7 +1372,7 @@ function handleAccountsError(err) {
|
|
|
1242
1372
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
1243
1373
|
process.exit(1);
|
|
1244
1374
|
}
|
|
1245
|
-
var accountsCommand =
|
|
1375
|
+
var accountsCommand = defineCommand14({
|
|
1246
1376
|
meta: {
|
|
1247
1377
|
name: "accounts",
|
|
1248
1378
|
description: `List accessible Google Ads accounts. Returns customer IDs needed for all other commands.
|
|
@@ -1282,7 +1412,7 @@ Examples:
|
|
|
1282
1412
|
});
|
|
1283
1413
|
|
|
1284
1414
|
// src/commands/ads/google/changes.ts
|
|
1285
|
-
import { defineCommand as
|
|
1415
|
+
import { defineCommand as defineCommand15 } from "citty";
|
|
1286
1416
|
|
|
1287
1417
|
// src/commands/ads/field-descriptions.ts
|
|
1288
1418
|
var FIELD_DESCRIPTIONS = {
|
|
@@ -1834,7 +1964,7 @@ registerSchema({
|
|
|
1834
1964
|
output: { type: "string", description: "Format: json|csv|jsonl|md", required: false, default: "json" }
|
|
1835
1965
|
}
|
|
1836
1966
|
});
|
|
1837
|
-
var changesCommand =
|
|
1967
|
+
var changesCommand = defineCommand15({
|
|
1838
1968
|
meta: {
|
|
1839
1969
|
name: "changes",
|
|
1840
1970
|
description: `Get recent changes in a Google Ads account with performance data.
|
|
@@ -1885,7 +2015,7 @@ Examples:
|
|
|
1885
2015
|
});
|
|
1886
2016
|
|
|
1887
2017
|
// src/commands/ads/google/currency.ts
|
|
1888
|
-
import { defineCommand as
|
|
2018
|
+
import { defineCommand as defineCommand16 } from "citty";
|
|
1889
2019
|
registerSchema({
|
|
1890
2020
|
command: "ads.google.currency",
|
|
1891
2021
|
description: "Get the currency code for a Google Ads account. Returns currency_code, customer_id, account_name, and access_type. Call this before interpreting cost_micros values.",
|
|
@@ -1897,7 +2027,7 @@ registerSchema({
|
|
|
1897
2027
|
}
|
|
1898
2028
|
}
|
|
1899
2029
|
});
|
|
1900
|
-
var currencyCommand =
|
|
2030
|
+
var currencyCommand = defineCommand16({
|
|
1901
2031
|
meta: {
|
|
1902
2032
|
name: "currency",
|
|
1903
2033
|
description: `Get account currency code. Use this to interpret metrics.cost_micros values.
|
|
@@ -1946,10 +2076,10 @@ Examples:
|
|
|
1946
2076
|
});
|
|
1947
2077
|
|
|
1948
2078
|
// src/commands/ads/google/keywords/index.ts
|
|
1949
|
-
import { defineCommand as
|
|
2079
|
+
import { defineCommand as defineCommand21 } from "citty";
|
|
1950
2080
|
|
|
1951
2081
|
// src/commands/ads/google/keywords/discover.ts
|
|
1952
|
-
import { defineCommand as
|
|
2082
|
+
import { defineCommand as defineCommand17 } from "citty";
|
|
1953
2083
|
|
|
1954
2084
|
// src/geo-context.ts
|
|
1955
2085
|
var GOOGLE_ADS_LOCATIONS = [
|
|
@@ -2224,7 +2354,7 @@ function handleKeywordError(err) {
|
|
|
2224
2354
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
2225
2355
|
process.exit(1);
|
|
2226
2356
|
}
|
|
2227
|
-
var discoverCommand =
|
|
2357
|
+
var discoverCommand = defineCommand17({
|
|
2228
2358
|
meta: {
|
|
2229
2359
|
name: "discover",
|
|
2230
2360
|
description: `Discover new keyword ideas from seed keywords or competitor URLs.
|
|
@@ -2286,7 +2416,7 @@ Examples:
|
|
|
2286
2416
|
});
|
|
2287
2417
|
|
|
2288
2418
|
// src/commands/ads/google/keywords/languages.ts
|
|
2289
|
-
import { defineCommand as
|
|
2419
|
+
import { defineCommand as defineCommand18 } from "citty";
|
|
2290
2420
|
registerSchema({
|
|
2291
2421
|
command: "ads.google.keywords.languages",
|
|
2292
2422
|
description: "List all supported language IDs for --language flag in Google Ads keyword commands.",
|
|
@@ -2296,7 +2426,7 @@ var FIELDS = {
|
|
|
2296
2426
|
id: "Language ID to pass as --language",
|
|
2297
2427
|
name: "Language name"
|
|
2298
2428
|
};
|
|
2299
|
-
var languagesCommand =
|
|
2429
|
+
var languagesCommand = defineCommand18({
|
|
2300
2430
|
meta: {
|
|
2301
2431
|
name: "languages",
|
|
2302
2432
|
description: "List all supported language IDs for --language flag."
|
|
@@ -2307,7 +2437,7 @@ var languagesCommand = defineCommand17({
|
|
|
2307
2437
|
});
|
|
2308
2438
|
|
|
2309
2439
|
// src/commands/ads/google/keywords/locations.ts
|
|
2310
|
-
import { defineCommand as
|
|
2440
|
+
import { defineCommand as defineCommand19 } from "citty";
|
|
2311
2441
|
registerSchema({
|
|
2312
2442
|
command: "ads.google.keywords.locations",
|
|
2313
2443
|
description: "List all supported geo target IDs for --location flag in Google Ads keyword commands.",
|
|
@@ -2317,7 +2447,7 @@ var FIELDS2 = {
|
|
|
2317
2447
|
id: "Geo target ID to pass as --location",
|
|
2318
2448
|
name: "Country/region name"
|
|
2319
2449
|
};
|
|
2320
|
-
var locationsCommand =
|
|
2450
|
+
var locationsCommand = defineCommand19({
|
|
2321
2451
|
meta: {
|
|
2322
2452
|
name: "locations",
|
|
2323
2453
|
description: "List all supported geo target IDs for --location flag."
|
|
@@ -2328,7 +2458,7 @@ var locationsCommand = defineCommand18({
|
|
|
2328
2458
|
});
|
|
2329
2459
|
|
|
2330
2460
|
// src/commands/ads/google/keywords/metrics.ts
|
|
2331
|
-
import { defineCommand as
|
|
2461
|
+
import { defineCommand as defineCommand20 } from "citty";
|
|
2332
2462
|
registerSchema({
|
|
2333
2463
|
command: "ads.google.keywords.metrics",
|
|
2334
2464
|
description: "Get historical metrics for specific keywords. Returns { historical_metrics: [...] } with snake_case fields matching the Google Ads API. IMPORTANT: If --location and --language are omitted, defaults to United States (2840) and English (1000). The response includes a query_context object showing which location/language were used.",
|
|
@@ -2352,7 +2482,7 @@ registerSchema({
|
|
|
2352
2482
|
output: { type: "string", description: "Format: json|csv|jsonl|md", required: false, default: "json" }
|
|
2353
2483
|
}
|
|
2354
2484
|
});
|
|
2355
|
-
var metricsCommand =
|
|
2485
|
+
var metricsCommand = defineCommand20({
|
|
2356
2486
|
meta: {
|
|
2357
2487
|
name: "metrics",
|
|
2358
2488
|
description: `Get historical search metrics for specific keywords.
|
|
@@ -2439,7 +2569,7 @@ Examples:
|
|
|
2439
2569
|
});
|
|
2440
2570
|
|
|
2441
2571
|
// src/commands/ads/google/keywords/index.ts
|
|
2442
|
-
var keywordsCommand =
|
|
2572
|
+
var keywordsCommand = defineCommand21({
|
|
2443
2573
|
meta: {
|
|
2444
2574
|
name: "keywords",
|
|
2445
2575
|
description: `Keyword research tools. Subcommands: discover, metrics, locations, languages.
|
|
@@ -2459,8 +2589,8 @@ Examples:
|
|
|
2459
2589
|
});
|
|
2460
2590
|
|
|
2461
2591
|
// src/commands/ads/google/library/index.ts
|
|
2462
|
-
import { defineCommand as
|
|
2463
|
-
var listAdvertisers =
|
|
2592
|
+
import { defineCommand as defineCommand22 } from "citty";
|
|
2593
|
+
var listAdvertisers = defineCommand22({
|
|
2464
2594
|
meta: {
|
|
2465
2595
|
name: "list-advertisers",
|
|
2466
2596
|
description: "List tracked Google advertisers and their accounts"
|
|
@@ -2477,7 +2607,7 @@ var listAdvertisers = defineCommand21({
|
|
|
2477
2607
|
}
|
|
2478
2608
|
}
|
|
2479
2609
|
});
|
|
2480
|
-
var syncStatus =
|
|
2610
|
+
var syncStatus = defineCommand22({
|
|
2481
2611
|
meta: {
|
|
2482
2612
|
name: "sync-status",
|
|
2483
2613
|
description: "Check the sync status and ad counts of a Google account"
|
|
@@ -2497,7 +2627,7 @@ var syncStatus = defineCommand21({
|
|
|
2497
2627
|
writeAdsJson({ ok: true, data });
|
|
2498
2628
|
}
|
|
2499
2629
|
});
|
|
2500
|
-
var searchAds =
|
|
2630
|
+
var searchAds = defineCommand22({
|
|
2501
2631
|
meta: {
|
|
2502
2632
|
name: "search-ads",
|
|
2503
2633
|
description: "Search and filter Google ads for an account"
|
|
@@ -2554,7 +2684,7 @@ var searchAds = defineCommand21({
|
|
|
2554
2684
|
}
|
|
2555
2685
|
}
|
|
2556
2686
|
});
|
|
2557
|
-
var searchAdvertiser =
|
|
2687
|
+
var searchAdvertiser = defineCommand22({
|
|
2558
2688
|
meta: {
|
|
2559
2689
|
name: "search-advertiser",
|
|
2560
2690
|
description: "Search for an advertiser on the Google Ads Transparency Center"
|
|
@@ -2589,7 +2719,7 @@ var searchAdvertiser = defineCommand21({
|
|
|
2589
2719
|
function sleep(ms) {
|
|
2590
2720
|
return new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
2591
2721
|
}
|
|
2592
|
-
var track =
|
|
2722
|
+
var track = defineCommand22({
|
|
2593
2723
|
meta: {
|
|
2594
2724
|
name: "track",
|
|
2595
2725
|
description: "Track a new Google advertiser (from search results). Waits for initial sync to complete before returning."
|
|
@@ -2647,7 +2777,7 @@ var track = defineCommand21({
|
|
|
2647
2777
|
process.exit(1);
|
|
2648
2778
|
}
|
|
2649
2779
|
});
|
|
2650
|
-
var sync =
|
|
2780
|
+
var sync = defineCommand22({
|
|
2651
2781
|
meta: {
|
|
2652
2782
|
name: "sync",
|
|
2653
2783
|
description: "Trigger an immediate sync for a Google account. Waits for completion before returning."
|
|
@@ -2691,7 +2821,7 @@ var sync = defineCommand21({
|
|
|
2691
2821
|
process.exit(1);
|
|
2692
2822
|
}
|
|
2693
2823
|
});
|
|
2694
|
-
var searchCompetitors =
|
|
2824
|
+
var searchCompetitors = defineCommand22({
|
|
2695
2825
|
meta: {
|
|
2696
2826
|
name: "search-competitors",
|
|
2697
2827
|
description: "Search for competitors running Google ads for a keyword (DataForSEO)"
|
|
@@ -2723,7 +2853,7 @@ var searchCompetitors = defineCommand21({
|
|
|
2723
2853
|
}
|
|
2724
2854
|
}
|
|
2725
2855
|
});
|
|
2726
|
-
var library =
|
|
2856
|
+
var library = defineCommand22({
|
|
2727
2857
|
meta: {
|
|
2728
2858
|
name: "library",
|
|
2729
2859
|
description: "Manage and search the Google Ads Library"
|
|
@@ -2742,7 +2872,7 @@ var library = defineCommand21({
|
|
|
2742
2872
|
// src/commands/ads/google/query.ts
|
|
2743
2873
|
import { appendFileSync, existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
2744
2874
|
import { resolve } from "path";
|
|
2745
|
-
import { defineCommand as
|
|
2875
|
+
import { defineCommand as defineCommand23 } from "citty";
|
|
2746
2876
|
|
|
2747
2877
|
// src/commands/ads/google/preflight.ts
|
|
2748
2878
|
function buildCommand2(query, customerId) {
|
|
@@ -3198,7 +3328,7 @@ function handleQueryError(err, finalQuery, customerId) {
|
|
|
3198
3328
|
});
|
|
3199
3329
|
process.exit(1);
|
|
3200
3330
|
}
|
|
3201
|
-
var queryCommand =
|
|
3331
|
+
var queryCommand = defineCommand23({
|
|
3202
3332
|
meta: {
|
|
3203
3333
|
name: "query",
|
|
3204
3334
|
description: `Run GAQL queries against Google Ads. Supports raw GAQL, presets, pagination, file export, and caching.
|
|
@@ -3256,7 +3386,7 @@ Examples:
|
|
|
3256
3386
|
});
|
|
3257
3387
|
|
|
3258
3388
|
// src/commands/ads/google/index.ts
|
|
3259
|
-
var googleCommand =
|
|
3389
|
+
var googleCommand = defineCommand24({
|
|
3260
3390
|
meta: {
|
|
3261
3391
|
name: "google",
|
|
3262
3392
|
description: `Google Ads commands. Query campaigns, keywords, search terms, and more via GAQL.
|
|
@@ -3284,7 +3414,7 @@ Examples:
|
|
|
3284
3414
|
});
|
|
3285
3415
|
|
|
3286
3416
|
// src/commands/ads/linkedin/index.ts
|
|
3287
|
-
import { defineCommand as
|
|
3417
|
+
import { defineCommand as defineCommand42 } from "citty";
|
|
3288
3418
|
|
|
3289
3419
|
// src/commands/ads/linkedin/schemas.ts
|
|
3290
3420
|
registerSchema({
|
|
@@ -3584,7 +3714,7 @@ registerSchema({
|
|
|
3584
3714
|
});
|
|
3585
3715
|
|
|
3586
3716
|
// src/commands/ads/linkedin/account.ts
|
|
3587
|
-
import { defineCommand as
|
|
3717
|
+
import { defineCommand as defineCommand25 } from "citty";
|
|
3588
3718
|
|
|
3589
3719
|
// src/commands/ads/linkedin/shared.ts
|
|
3590
3720
|
var DAY_MS = 864e5;
|
|
@@ -3687,7 +3817,7 @@ function resolveStatusFilter(args) {
|
|
|
3687
3817
|
}
|
|
3688
3818
|
|
|
3689
3819
|
// src/commands/ads/linkedin/account.ts
|
|
3690
|
-
var accountCommand =
|
|
3820
|
+
var accountCommand = defineCommand25({
|
|
3691
3821
|
meta: {
|
|
3692
3822
|
name: "account",
|
|
3693
3823
|
description: `Single LinkedIn ad account detail (currency, status, type).
|
|
@@ -3721,9 +3851,9 @@ Examples:
|
|
|
3721
3851
|
});
|
|
3722
3852
|
|
|
3723
3853
|
// src/commands/ads/linkedin/accounts.ts
|
|
3724
|
-
import { defineCommand as
|
|
3854
|
+
import { defineCommand as defineCommand26 } from "citty";
|
|
3725
3855
|
var ACCOUNTS_TTL_MS = 60 * 60 * 1e3;
|
|
3726
|
-
var accountsCommand2 =
|
|
3856
|
+
var accountsCommand2 = defineCommand26({
|
|
3727
3857
|
meta: {
|
|
3728
3858
|
name: "accounts",
|
|
3729
3859
|
description: `List LinkedIn ad accounts in this company's connected scope.
|
|
@@ -3771,7 +3901,7 @@ Examples:
|
|
|
3771
3901
|
});
|
|
3772
3902
|
|
|
3773
3903
|
// src/commands/ads/linkedin/analytics.ts
|
|
3774
|
-
import { defineCommand as
|
|
3904
|
+
import { defineCommand as defineCommand27 } from "citty";
|
|
3775
3905
|
|
|
3776
3906
|
// src/commands/ads/linkedin/presets.ts
|
|
3777
3907
|
var INTENTS = {
|
|
@@ -4043,7 +4173,7 @@ function numberOf(v) {
|
|
|
4043
4173
|
}
|
|
4044
4174
|
return 0;
|
|
4045
4175
|
}
|
|
4046
|
-
var analyticsCommand =
|
|
4176
|
+
var analyticsCommand = defineCommand27({
|
|
4047
4177
|
meta: {
|
|
4048
4178
|
name: "analytics",
|
|
4049
4179
|
description: `Performance reporting \u2014 the workhorse for AI agents.
|
|
@@ -4171,7 +4301,7 @@ Examples \u2014 common AI questions:
|
|
|
4171
4301
|
|
|
4172
4302
|
// src/commands/ads/linkedin/audience-size.ts
|
|
4173
4303
|
import { readFileSync as readFileSync3 } from "fs";
|
|
4174
|
-
import { defineCommand as
|
|
4304
|
+
import { defineCommand as defineCommand28 } from "citty";
|
|
4175
4305
|
function loadTargeting(args) {
|
|
4176
4306
|
const inline = args.targeting;
|
|
4177
4307
|
if (inline) {
|
|
@@ -4193,7 +4323,7 @@ function loadTargeting(args) {
|
|
|
4193
4323
|
}
|
|
4194
4324
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
4195
4325
|
}
|
|
4196
|
-
var audienceSizeCommand =
|
|
4326
|
+
var audienceSizeCommand = defineCommand28({
|
|
4197
4327
|
meta: {
|
|
4198
4328
|
name: "audience-size",
|
|
4199
4329
|
description: `Estimate audience size for a targeting payload \u2014 pre-launch sanity check.
|
|
@@ -4238,7 +4368,7 @@ Examples:
|
|
|
4238
4368
|
});
|
|
4239
4369
|
|
|
4240
4370
|
// src/commands/ads/linkedin/audit.ts
|
|
4241
|
-
import { defineCommand as
|
|
4371
|
+
import { defineCommand as defineCommand29 } from "citty";
|
|
4242
4372
|
var SEVERITY_RANK = {
|
|
4243
4373
|
critical: 0,
|
|
4244
4374
|
high: 1,
|
|
@@ -4297,7 +4427,7 @@ function noteOf(f) {
|
|
|
4297
4427
|
const fix = f.fix?.explanation ?? "";
|
|
4298
4428
|
return [fix, ev].filter(Boolean).join(" \u2014 ");
|
|
4299
4429
|
}
|
|
4300
|
-
var auditCommand =
|
|
4430
|
+
var auditCommand = defineCommand29({
|
|
4301
4431
|
meta: {
|
|
4302
4432
|
name: "audit",
|
|
4303
4433
|
description: `Run a LinkedIn Ads playbook audit \u2014 30+ checks across Settings, Tracking,
|
|
@@ -4364,7 +4494,7 @@ Examples:
|
|
|
4364
4494
|
|
|
4365
4495
|
// src/commands/ads/linkedin/bid-pricing.ts
|
|
4366
4496
|
import { readFileSync as readFileSync4 } from "fs";
|
|
4367
|
-
import { defineCommand as
|
|
4497
|
+
import { defineCommand as defineCommand30 } from "citty";
|
|
4368
4498
|
function loadTargeting2(args) {
|
|
4369
4499
|
const inline = args.targeting;
|
|
4370
4500
|
if (inline) {
|
|
@@ -4386,7 +4516,7 @@ function loadTargeting2(args) {
|
|
|
4386
4516
|
}
|
|
4387
4517
|
handleLinkedinError(new Error("Pass --targeting-file <path> or --targeting '{...JSON...}'"));
|
|
4388
4518
|
}
|
|
4389
|
-
var bidPricingCommand =
|
|
4519
|
+
var bidPricingCommand = defineCommand30({
|
|
4390
4520
|
meta: {
|
|
4391
4521
|
name: "bid-pricing",
|
|
4392
4522
|
description: `Get LinkedIn's suggested bid range for a targeting + objective + cost type.
|
|
@@ -4436,8 +4566,8 @@ Examples:
|
|
|
4436
4566
|
});
|
|
4437
4567
|
|
|
4438
4568
|
// src/commands/ads/linkedin/campaign-groups.ts
|
|
4439
|
-
import { defineCommand as
|
|
4440
|
-
var campaignGroupsCommand =
|
|
4569
|
+
import { defineCommand as defineCommand31 } from "citty";
|
|
4570
|
+
var campaignGroupsCommand = defineCommand31({
|
|
4441
4571
|
meta: {
|
|
4442
4572
|
name: "campaign-groups",
|
|
4443
4573
|
description: `List LinkedIn campaign groups.
|
|
@@ -4480,8 +4610,8 @@ Examples:
|
|
|
4480
4610
|
});
|
|
4481
4611
|
|
|
4482
4612
|
// src/commands/ads/linkedin/campaigns.ts
|
|
4483
|
-
import { defineCommand as
|
|
4484
|
-
var campaignsCommand =
|
|
4613
|
+
import { defineCommand as defineCommand32 } from "citty";
|
|
4614
|
+
var campaignsCommand = defineCommand32({
|
|
4485
4615
|
meta: {
|
|
4486
4616
|
name: "campaigns",
|
|
4487
4617
|
description: `List LinkedIn campaigns.
|
|
@@ -4530,8 +4660,8 @@ Examples:
|
|
|
4530
4660
|
});
|
|
4531
4661
|
|
|
4532
4662
|
// src/commands/ads/linkedin/conversation.ts
|
|
4533
|
-
import { defineCommand as
|
|
4534
|
-
var conversationCommand =
|
|
4663
|
+
import { defineCommand as defineCommand33 } from "citty";
|
|
4664
|
+
var conversationCommand = defineCommand33({
|
|
4535
4665
|
meta: {
|
|
4536
4666
|
name: "conversation",
|
|
4537
4667
|
description: `Per-button click rates inside Sponsored Messaging / Conversation Ads.
|
|
@@ -4594,7 +4724,7 @@ Examples:
|
|
|
4594
4724
|
});
|
|
4595
4725
|
|
|
4596
4726
|
// src/commands/ads/linkedin/conversions.ts
|
|
4597
|
-
import { defineCommand as
|
|
4727
|
+
import { defineCommand as defineCommand34 } from "citty";
|
|
4598
4728
|
var DAY_MS2 = 864e5;
|
|
4599
4729
|
function healthOf(rules) {
|
|
4600
4730
|
const enabled = rules.filter((r) => r.enabled !== false);
|
|
@@ -4620,7 +4750,7 @@ function healthOf(rules) {
|
|
|
4620
4750
|
wrongLeadDedup: wrongDedup
|
|
4621
4751
|
};
|
|
4622
4752
|
}
|
|
4623
|
-
var listCmd =
|
|
4753
|
+
var listCmd = defineCommand34({
|
|
4624
4754
|
meta: {
|
|
4625
4755
|
name: "list",
|
|
4626
4756
|
description: `List conversion rules on the account.`
|
|
@@ -4648,7 +4778,7 @@ var listCmd = defineCommand33({
|
|
|
4648
4778
|
}
|
|
4649
4779
|
}
|
|
4650
4780
|
});
|
|
4651
|
-
var healthCmd =
|
|
4781
|
+
var healthCmd = defineCommand34({
|
|
4652
4782
|
meta: {
|
|
4653
4783
|
name: "health",
|
|
4654
4784
|
description: `5-point Insight Tag / CAPI health check (playbook \xA707).
|
|
@@ -4678,7 +4808,7 @@ Surfaces:
|
|
|
4678
4808
|
}
|
|
4679
4809
|
}
|
|
4680
4810
|
});
|
|
4681
|
-
var conversionsCommand =
|
|
4811
|
+
var conversionsCommand = defineCommand34({
|
|
4682
4812
|
meta: {
|
|
4683
4813
|
name: "conversions",
|
|
4684
4814
|
description: `Conversion rules \u2014 Insight Tag and Conversions API.
|
|
@@ -4694,8 +4824,8 @@ Subcommands:
|
|
|
4694
4824
|
});
|
|
4695
4825
|
|
|
4696
4826
|
// src/commands/ads/linkedin/creatives.ts
|
|
4697
|
-
import { defineCommand as
|
|
4698
|
-
var creativesCommand =
|
|
4827
|
+
import { defineCommand as defineCommand35 } from "citty";
|
|
4828
|
+
var creativesCommand = defineCommand35({
|
|
4699
4829
|
meta: {
|
|
4700
4830
|
name: "creatives",
|
|
4701
4831
|
description: `List LinkedIn creatives (ads).
|
|
@@ -4744,7 +4874,7 @@ Examples:
|
|
|
4744
4874
|
});
|
|
4745
4875
|
|
|
4746
4876
|
// src/commands/ads/linkedin/demographics.ts
|
|
4747
|
-
import { defineCommand as
|
|
4877
|
+
import { defineCommand as defineCommand36 } from "citty";
|
|
4748
4878
|
var DEFAULT_PIVOTS = ["job-title", "company", "industry", "seniority", "job-function", "company-size"];
|
|
4749
4879
|
function numberOf2(v) {
|
|
4750
4880
|
if (typeof v === "number") return Number.isFinite(v) ? v : 0;
|
|
@@ -4757,7 +4887,7 @@ function numberOf2(v) {
|
|
|
4757
4887
|
function topByImpressions(rows, limit) {
|
|
4758
4888
|
return [...rows].sort((a, b) => numberOf2(b.impressions) - numberOf2(a.impressions)).slice(0, limit);
|
|
4759
4889
|
}
|
|
4760
|
-
var demographicsCommand =
|
|
4890
|
+
var demographicsCommand = defineCommand36({
|
|
4761
4891
|
meta: {
|
|
4762
4892
|
name: "demographics",
|
|
4763
4893
|
description: `Sweep all firmographic pivots in one command \u2014 LinkedIn's superpower.
|
|
@@ -4854,8 +4984,8 @@ function resolveRange(args) {
|
|
|
4854
4984
|
}
|
|
4855
4985
|
|
|
4856
4986
|
// src/commands/ads/linkedin/facets.ts
|
|
4857
|
-
import { defineCommand as
|
|
4858
|
-
var listCmd2 =
|
|
4987
|
+
import { defineCommand as defineCommand37 } from "citty";
|
|
4988
|
+
var listCmd2 = defineCommand37({
|
|
4859
4989
|
meta: {
|
|
4860
4990
|
name: "list",
|
|
4861
4991
|
description: `List every targeting facet LinkedIn supports.
|
|
@@ -4883,7 +5013,7 @@ seniorities, titles, employers, growthRate, companyCategory, skills, etc.).`
|
|
|
4883
5013
|
}
|
|
4884
5014
|
}
|
|
4885
5015
|
});
|
|
4886
|
-
var valuesCmd =
|
|
5016
|
+
var valuesCmd = defineCommand37({
|
|
4887
5017
|
meta: {
|
|
4888
5018
|
name: "values",
|
|
4889
5019
|
description: `Look up entity values for a single facet \u2014 full list or typeahead search.
|
|
@@ -4924,7 +5054,7 @@ or the full URN (urn:li:adTargetingFacet:industries).`
|
|
|
4924
5054
|
}
|
|
4925
5055
|
}
|
|
4926
5056
|
});
|
|
4927
|
-
var facetsCommand =
|
|
5057
|
+
var facetsCommand = defineCommand37({
|
|
4928
5058
|
meta: {
|
|
4929
5059
|
name: "facets",
|
|
4930
5060
|
description: `LinkedIn targeting facets and entity lookup.
|
|
@@ -4942,7 +5072,7 @@ Subcommands:
|
|
|
4942
5072
|
|
|
4943
5073
|
// src/commands/ads/linkedin/forecast.ts
|
|
4944
5074
|
import { readFileSync as readFileSync5 } from "fs";
|
|
4945
|
-
import { defineCommand as
|
|
5075
|
+
import { defineCommand as defineCommand38 } from "citty";
|
|
4946
5076
|
function loadTargeting3(args) {
|
|
4947
5077
|
const inline = args.targeting;
|
|
4948
5078
|
if (inline) {
|
|
@@ -4972,7 +5102,7 @@ function parseMoney(raw) {
|
|
|
4972
5102
|
}
|
|
4973
5103
|
return { amount: m[1] ?? "0", currencyCode: m[2] ?? "USD" };
|
|
4974
5104
|
}
|
|
4975
|
-
var forecastCommand =
|
|
5105
|
+
var forecastCommand = defineCommand38({
|
|
4976
5106
|
meta: {
|
|
4977
5107
|
name: "forecast",
|
|
4978
5108
|
description: `Forecast reach + impressions + clicks + spend for a hypothetical campaign.
|
|
@@ -5019,9 +5149,9 @@ Examples:
|
|
|
5019
5149
|
});
|
|
5020
5150
|
|
|
5021
5151
|
// src/commands/ads/linkedin/leads.ts
|
|
5022
|
-
import { defineCommand as
|
|
5152
|
+
import { defineCommand as defineCommand39 } from "citty";
|
|
5023
5153
|
var DAY_MS3 = 864e5;
|
|
5024
|
-
var leadsCommand =
|
|
5154
|
+
var leadsCommand = defineCommand39({
|
|
5025
5155
|
meta: {
|
|
5026
5156
|
name: "leads",
|
|
5027
5157
|
description: `List Lead Gen Form responses (playbook \xA707).
|
|
@@ -5080,16 +5210,69 @@ Examples:
|
|
|
5080
5210
|
}
|
|
5081
5211
|
});
|
|
5082
5212
|
|
|
5213
|
+
// src/commands/ads/linkedin/resolve.ts
|
|
5214
|
+
import { defineCommand as defineCommand40 } from "citty";
|
|
5215
|
+
function toOrgUrn(raw) {
|
|
5216
|
+
const trimmed = raw.trim();
|
|
5217
|
+
if (trimmed.length === 0) {
|
|
5218
|
+
return null;
|
|
5219
|
+
}
|
|
5220
|
+
if (trimmed.startsWith("urn:li:")) {
|
|
5221
|
+
return trimmed;
|
|
5222
|
+
}
|
|
5223
|
+
return /^\d+$/.test(trimmed) ? `urn:li:organization:${trimmed}` : null;
|
|
5224
|
+
}
|
|
5225
|
+
var resolveCommand = defineCommand40({
|
|
5226
|
+
meta: {
|
|
5227
|
+
name: "resolve",
|
|
5228
|
+
description: `Resolve organization URNs to company names.
|
|
5229
|
+
|
|
5230
|
+
Examples:
|
|
5231
|
+
baker ads linkedin resolve --urns urn:li:organization:17719,urn:li:organization:19022
|
|
5232
|
+
baker ads linkedin resolve --ids 17719,19022 --output csv
|
|
5233
|
+
|
|
5234
|
+
Accepts --urns (full URNs) and/or --ids (bare numeric ids). Rows with no name
|
|
5235
|
+
couldn't be resolved \u2014 typically an org outside LinkedIn's targetable set.`
|
|
5236
|
+
},
|
|
5237
|
+
args: {
|
|
5238
|
+
urns: { type: "string", description: "Comma-separated org URNs (urn:li:organization:NNN)" },
|
|
5239
|
+
ids: { type: "string", description: "Comma-separated bare org ids (17719,19022)" },
|
|
5240
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
5241
|
+
output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
|
|
5242
|
+
},
|
|
5243
|
+
run: async ({ args }) => {
|
|
5244
|
+
const raw = [args.urns, args.ids].filter(Boolean).join(",").split(",");
|
|
5245
|
+
const urns = [...new Set(raw.map(toOrgUrn).filter((u) => u !== null))];
|
|
5246
|
+
if (urns.length === 0) {
|
|
5247
|
+
handleLinkedinError(new Error("Provide --urns or --ids (org URNs or bare numeric ids)."));
|
|
5248
|
+
}
|
|
5249
|
+
try {
|
|
5250
|
+
const data = await apiPost("/api/ads/linkedin/resolve-orgs", {
|
|
5251
|
+
urns,
|
|
5252
|
+
skipCache: Boolean(args["skip-cache"])
|
|
5253
|
+
});
|
|
5254
|
+
const fmt = csvOrJson(args);
|
|
5255
|
+
if (fmt !== "json") {
|
|
5256
|
+
writeAdsOutput(data, fmt);
|
|
5257
|
+
return;
|
|
5258
|
+
}
|
|
5259
|
+
writeAdsJson({ ok: true, data });
|
|
5260
|
+
} catch (err) {
|
|
5261
|
+
handleLinkedinError(err);
|
|
5262
|
+
}
|
|
5263
|
+
}
|
|
5264
|
+
});
|
|
5265
|
+
|
|
5083
5266
|
// src/commands/ads/linkedin/top-companies.ts
|
|
5084
|
-
import { defineCommand as
|
|
5085
|
-
var topCompaniesCommand =
|
|
5267
|
+
import { defineCommand as defineCommand41 } from "citty";
|
|
5268
|
+
var topCompaniesCommand = defineCommand41({
|
|
5086
5269
|
meta: {
|
|
5087
5270
|
name: "top-companies",
|
|
5088
5271
|
description: `Top companies whose employees saw / clicked / converted on a campaign.
|
|
5089
5272
|
|
|
5090
5273
|
Wrapper for: analytics --pivot company. Returns rows sorted by impressions desc.
|
|
5091
|
-
Each row's pivot[] contains
|
|
5092
|
-
|
|
5274
|
+
Each row's pivot[] contains { urn, id, name } \u2014 org names are resolved automatically.
|
|
5275
|
+
Cross-reference names against your target account list to spot audience leakage.
|
|
5093
5276
|
|
|
5094
5277
|
Demographic data is delayed 12-24h with a \u22653-event privacy floor.
|
|
5095
5278
|
|
|
@@ -5153,7 +5336,7 @@ Examples:
|
|
|
5153
5336
|
});
|
|
5154
5337
|
|
|
5155
5338
|
// src/commands/ads/linkedin/index.ts
|
|
5156
|
-
var linkedinCommand =
|
|
5339
|
+
var linkedinCommand = defineCommand42({
|
|
5157
5340
|
meta: {
|
|
5158
5341
|
name: "linkedin",
|
|
5159
5342
|
description: `LinkedIn Marketing API \u2014 AI-first command surface for B2B ad insights.
|
|
@@ -5173,7 +5356,8 @@ Performance \u2014 the workhorse (3 axes):
|
|
|
5173
5356
|
baker ads linkedin analytics \u2014 defaults: level=account, intent=baseline, last_7d, DAILY
|
|
5174
5357
|
baker ads linkedin analytics --intent revenue --last-days 28
|
|
5175
5358
|
baker ads linkedin analytics --level campaign --campaign-id 1234 --pivot job-title \u2014 LinkedIn's superpower (per-title perf)
|
|
5176
|
-
baker ads linkedin analytics --level campaign --campaign-id 1234 --pivot company \u2014 top companies seeing the ad (ABM gold)
|
|
5359
|
+
baker ads linkedin analytics --level campaign --campaign-id 1234 --pivot company \u2014 top companies seeing the ad (ABM gold; names auto-resolved)
|
|
5360
|
+
baker ads linkedin resolve --urns urn:li:organization:17719 \u2014 resolve org URNs to company names
|
|
5177
5361
|
baker ads linkedin analytics --level campaign --campaign-id 1234 --intent ranking \u2014 fatigue: derives frequency
|
|
5178
5362
|
baker ads linkedin analytics --list-intents
|
|
5179
5363
|
baker ads linkedin analytics --list-pivots
|
|
@@ -5191,6 +5375,7 @@ Account ID format:
|
|
|
5191
5375
|
analytics: analyticsCommand,
|
|
5192
5376
|
demographics: demographicsCommand,
|
|
5193
5377
|
"top-companies": topCompaniesCommand,
|
|
5378
|
+
resolve: resolveCommand,
|
|
5194
5379
|
facets: facetsCommand,
|
|
5195
5380
|
"audience-size": audienceSizeCommand,
|
|
5196
5381
|
"bid-pricing": bidPricingCommand,
|
|
@@ -5203,10 +5388,10 @@ Account ID format:
|
|
|
5203
5388
|
});
|
|
5204
5389
|
|
|
5205
5390
|
// src/commands/ads/meta/index.ts
|
|
5206
|
-
import { defineCommand as
|
|
5391
|
+
import { defineCommand as defineCommand55 } from "citty";
|
|
5207
5392
|
|
|
5208
5393
|
// src/commands/ads/meta/account.ts
|
|
5209
|
-
import { defineCommand as
|
|
5394
|
+
import { defineCommand as defineCommand43 } from "citty";
|
|
5210
5395
|
|
|
5211
5396
|
// src/commands/ads/meta/shared.ts
|
|
5212
5397
|
var DAY_MS4 = 864e5;
|
|
@@ -5285,7 +5470,7 @@ function resolveEffectiveStatus(args) {
|
|
|
5285
5470
|
}
|
|
5286
5471
|
|
|
5287
5472
|
// src/commands/ads/meta/account.ts
|
|
5288
|
-
var accountCommand2 =
|
|
5473
|
+
var accountCommand2 = defineCommand43({
|
|
5289
5474
|
meta: {
|
|
5290
5475
|
name: "account",
|
|
5291
5476
|
description: `Show single Meta ad account detail (currency, timezone, balance, business).
|
|
@@ -5312,8 +5497,8 @@ Examples:
|
|
|
5312
5497
|
});
|
|
5313
5498
|
|
|
5314
5499
|
// src/commands/ads/meta/accounts.ts
|
|
5315
|
-
import { defineCommand as
|
|
5316
|
-
var accountsCommand3 =
|
|
5500
|
+
import { defineCommand as defineCommand44 } from "citty";
|
|
5501
|
+
var accountsCommand3 = defineCommand44({
|
|
5317
5502
|
meta: {
|
|
5318
5503
|
name: "accounts",
|
|
5319
5504
|
description: `List Meta ad accounts in this company's connected scope.
|
|
@@ -5361,8 +5546,8 @@ Examples:
|
|
|
5361
5546
|
});
|
|
5362
5547
|
|
|
5363
5548
|
// src/commands/ads/meta/activities.ts
|
|
5364
|
-
import { defineCommand as
|
|
5365
|
-
var activitiesCommand =
|
|
5549
|
+
import { defineCommand as defineCommand45 } from "citty";
|
|
5550
|
+
var activitiesCommand = defineCommand45({
|
|
5366
5551
|
meta: {
|
|
5367
5552
|
name: "activities",
|
|
5368
5553
|
description: `Audit log of recent ad-account changes (created, paused, edited). Default lookback 7 days,
|
|
@@ -5399,8 +5584,8 @@ Examples:
|
|
|
5399
5584
|
});
|
|
5400
5585
|
|
|
5401
5586
|
// src/commands/ads/meta/ads.ts
|
|
5402
|
-
import { defineCommand as
|
|
5403
|
-
var adsListCommand =
|
|
5587
|
+
import { defineCommand as defineCommand46 } from "citty";
|
|
5588
|
+
var adsListCommand = defineCommand46({
|
|
5404
5589
|
meta: {
|
|
5405
5590
|
name: "ads",
|
|
5406
5591
|
description: `List ads in a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -5448,8 +5633,8 @@ Examples:
|
|
|
5448
5633
|
});
|
|
5449
5634
|
|
|
5450
5635
|
// src/commands/ads/meta/adsets.ts
|
|
5451
|
-
import { defineCommand as
|
|
5452
|
-
var adsetsCommand =
|
|
5636
|
+
import { defineCommand as defineCommand47 } from "citty";
|
|
5637
|
+
var adsetsCommand = defineCommand47({
|
|
5453
5638
|
meta: {
|
|
5454
5639
|
name: "adsets",
|
|
5455
5640
|
description: `List ad sets in a Meta ad account, optionally scoped to one campaign. Defaults to ACTIVE only.
|
|
@@ -5491,8 +5676,8 @@ Examples:
|
|
|
5491
5676
|
});
|
|
5492
5677
|
|
|
5493
5678
|
// src/commands/ads/meta/audiences.ts
|
|
5494
|
-
import { defineCommand as
|
|
5495
|
-
var audiencesCommand =
|
|
5679
|
+
import { defineCommand as defineCommand48 } from "citty";
|
|
5680
|
+
var audiencesCommand = defineCommand48({
|
|
5496
5681
|
meta: {
|
|
5497
5682
|
name: "audiences",
|
|
5498
5683
|
description: `List custom audiences for a Meta ad account. Includes lookalikes, website-pixel audiences,
|
|
@@ -5527,8 +5712,8 @@ Examples:
|
|
|
5527
5712
|
});
|
|
5528
5713
|
|
|
5529
5714
|
// src/commands/ads/meta/businesses.ts
|
|
5530
|
-
import { defineCommand as
|
|
5531
|
-
var businessesCommand =
|
|
5715
|
+
import { defineCommand as defineCommand49 } from "citty";
|
|
5716
|
+
var businessesCommand = defineCommand49({
|
|
5532
5717
|
meta: {
|
|
5533
5718
|
name: "businesses",
|
|
5534
5719
|
description: `List Meta Business Manager accounts the connected user has access to. Required for ad-studies and product-catalogs commands.
|
|
@@ -5558,8 +5743,8 @@ Examples:
|
|
|
5558
5743
|
});
|
|
5559
5744
|
|
|
5560
5745
|
// src/commands/ads/meta/campaigns.ts
|
|
5561
|
-
import { defineCommand as
|
|
5562
|
-
var campaignsCommand2 =
|
|
5746
|
+
import { defineCommand as defineCommand50 } from "citty";
|
|
5747
|
+
var campaignsCommand2 = defineCommand50({
|
|
5563
5748
|
meta: {
|
|
5564
5749
|
name: "campaigns",
|
|
5565
5750
|
description: `List campaigns for a Meta ad account. Defaults to ACTIVE only \u2014 pass --all-statuses to widen.
|
|
@@ -5603,8 +5788,8 @@ Examples:
|
|
|
5603
5788
|
});
|
|
5604
5789
|
|
|
5605
5790
|
// src/commands/ads/meta/creatives.ts
|
|
5606
|
-
import { defineCommand as
|
|
5607
|
-
var creativesCommand2 =
|
|
5791
|
+
import { defineCommand as defineCommand51 } from "citty";
|
|
5792
|
+
var creativesCommand2 = defineCommand51({
|
|
5608
5793
|
meta: {
|
|
5609
5794
|
name: "creatives",
|
|
5610
5795
|
description: `List ad creatives in an account, or fetch a single creative by ID.
|
|
@@ -5648,7 +5833,7 @@ Examples:
|
|
|
5648
5833
|
});
|
|
5649
5834
|
|
|
5650
5835
|
// src/commands/ads/meta/insights.ts
|
|
5651
|
-
import { defineCommand as
|
|
5836
|
+
import { defineCommand as defineCommand52 } from "citty";
|
|
5652
5837
|
|
|
5653
5838
|
// src/commands/ads/meta/presets.ts
|
|
5654
5839
|
var INSIGHTS_INTENTS = {
|
|
@@ -5853,7 +6038,7 @@ function sortRowsBySpendDesc(rows) {
|
|
|
5853
6038
|
return sb - sa;
|
|
5854
6039
|
});
|
|
5855
6040
|
}
|
|
5856
|
-
var insightsCommand =
|
|
6041
|
+
var insightsCommand = defineCommand52({
|
|
5857
6042
|
meta: {
|
|
5858
6043
|
name: "insights",
|
|
5859
6044
|
description: `Performance reporting \u2014 the main Meta tool for AI agents.
|
|
@@ -5954,8 +6139,8 @@ Async is automatic for heavy queries; pass --async to force it, or --no-async to
|
|
|
5954
6139
|
});
|
|
5955
6140
|
|
|
5956
6141
|
// src/commands/ads/meta/pixels.ts
|
|
5957
|
-
import { defineCommand as
|
|
5958
|
-
var pixelsCommand =
|
|
6142
|
+
import { defineCommand as defineCommand53 } from "citty";
|
|
6143
|
+
var pixelsCommand = defineCommand53({
|
|
5959
6144
|
meta: {
|
|
5960
6145
|
name: "pixels",
|
|
5961
6146
|
description: `List Meta Pixels for an ad account, or fetch firing stats for one pixel.
|
|
@@ -6026,7 +6211,7 @@ function emit(data, args) {
|
|
|
6026
6211
|
|
|
6027
6212
|
// src/commands/ads/meta/preview.ts
|
|
6028
6213
|
import { writeFileSync as writeFileSync3 } from "fs";
|
|
6029
|
-
import { defineCommand as
|
|
6214
|
+
import { defineCommand as defineCommand54 } from "citty";
|
|
6030
6215
|
var VALID_AD_FORMATS = [
|
|
6031
6216
|
"DESKTOP_FEED_STANDARD",
|
|
6032
6217
|
"MOBILE_FEED_STANDARD",
|
|
@@ -6060,7 +6245,7 @@ var VALID_AD_FORMATS = [
|
|
|
6060
6245
|
"MARKETPLACE_MOBILE",
|
|
6061
6246
|
"BIZ_DISCO_FEED_MOBILE"
|
|
6062
6247
|
];
|
|
6063
|
-
var previewCommand =
|
|
6248
|
+
var previewCommand = defineCommand54({
|
|
6064
6249
|
meta: {
|
|
6065
6250
|
name: "preview",
|
|
6066
6251
|
description: `Generate a Meta-hosted preview iframe for a creative or ad. Returns iframe HTML which you
|
|
@@ -6107,7 +6292,7 @@ Examples:
|
|
|
6107
6292
|
});
|
|
6108
6293
|
|
|
6109
6294
|
// src/commands/ads/meta/index.ts
|
|
6110
|
-
var metaCommand =
|
|
6295
|
+
var metaCommand = defineCommand55({
|
|
6111
6296
|
meta: {
|
|
6112
6297
|
name: "meta",
|
|
6113
6298
|
description: `Meta Marketing API \u2014 AI-first command surface (Facebook + Instagram ads).
|
|
@@ -6159,10 +6344,10 @@ Audit & review:
|
|
|
6159
6344
|
});
|
|
6160
6345
|
|
|
6161
6346
|
// src/commands/ads/x/index.ts
|
|
6162
|
-
import { defineCommand as
|
|
6347
|
+
import { defineCommand as defineCommand72 } from "citty";
|
|
6163
6348
|
|
|
6164
6349
|
// src/commands/ads/x/accounts.ts
|
|
6165
|
-
import { defineCommand as
|
|
6350
|
+
import { defineCommand as defineCommand56 } from "citty";
|
|
6166
6351
|
registerSchema({
|
|
6167
6352
|
command: "ads.x.accounts",
|
|
6168
6353
|
description: "List all accessible X Ads accounts. Returns accounts with id (base36), name, approval_status, timezone, currency. Run this first to find account IDs for other commands.",
|
|
@@ -6190,7 +6375,7 @@ function handleAccountsError2(err) {
|
|
|
6190
6375
|
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
6191
6376
|
process.exit(1);
|
|
6192
6377
|
}
|
|
6193
|
-
var accountsCommand4 =
|
|
6378
|
+
var accountsCommand4 = defineCommand56({
|
|
6194
6379
|
meta: {
|
|
6195
6380
|
name: "accounts",
|
|
6196
6381
|
description: `List accessible X Ads accounts. Returns account IDs needed for all other commands.
|
|
@@ -6230,7 +6415,7 @@ Examples:
|
|
|
6230
6415
|
});
|
|
6231
6416
|
|
|
6232
6417
|
// src/commands/ads/x/active-entities.ts
|
|
6233
|
-
import { defineCommand as
|
|
6418
|
+
import { defineCommand as defineCommand57 } from "citty";
|
|
6234
6419
|
|
|
6235
6420
|
// src/commands/ads/x/error-parser.ts
|
|
6236
6421
|
function mapXErrorCode(message) {
|
|
@@ -6381,7 +6566,7 @@ function parseCsv(v) {
|
|
|
6381
6566
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
6382
6567
|
return parts.length > 0 ? parts : void 0;
|
|
6383
6568
|
}
|
|
6384
|
-
var activeEntitiesCommand =
|
|
6569
|
+
var activeEntitiesCommand = defineCommand57({
|
|
6385
6570
|
meta: {
|
|
6386
6571
|
name: "active-entities",
|
|
6387
6572
|
description: `List entities with metric activity in a time range.
|
|
@@ -6439,7 +6624,7 @@ Examples:
|
|
|
6439
6624
|
});
|
|
6440
6625
|
|
|
6441
6626
|
// src/commands/ads/x/audiences.ts
|
|
6442
|
-
import { defineCommand as
|
|
6627
|
+
import { defineCommand as defineCommand58 } from "citty";
|
|
6443
6628
|
registerSchema({
|
|
6444
6629
|
command: "ads.x.audiences",
|
|
6445
6630
|
description: "List custom audiences for an X Ads account. Returns id, name, audience_size, audience_type, targetable status. Audiences need 100+ active users in the past 90 days to be targetable.",
|
|
@@ -6448,7 +6633,7 @@ registerSchema({
|
|
|
6448
6633
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6449
6634
|
}
|
|
6450
6635
|
});
|
|
6451
|
-
var audiencesCommand2 =
|
|
6636
|
+
var audiencesCommand2 = defineCommand58({
|
|
6452
6637
|
meta: {
|
|
6453
6638
|
name: "audiences",
|
|
6454
6639
|
description: `List X Ads custom audiences.
|
|
@@ -6497,7 +6682,7 @@ Examples:
|
|
|
6497
6682
|
});
|
|
6498
6683
|
|
|
6499
6684
|
// src/commands/ads/x/campaigns.ts
|
|
6500
|
-
import { defineCommand as
|
|
6685
|
+
import { defineCommand as defineCommand59 } from "citty";
|
|
6501
6686
|
|
|
6502
6687
|
// src/commands/ads/x/run-list.ts
|
|
6503
6688
|
function buildCleanParams(opts) {
|
|
@@ -6560,7 +6745,7 @@ registerSchema({
|
|
|
6560
6745
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6561
6746
|
}
|
|
6562
6747
|
});
|
|
6563
|
-
var campaignsCommand3 =
|
|
6748
|
+
var campaignsCommand3 = defineCommand59({
|
|
6564
6749
|
meta: {
|
|
6565
6750
|
name: "campaigns",
|
|
6566
6751
|
description: `List X Ads campaigns. Returns budget, schedule, funding instrument, status.
|
|
@@ -6602,7 +6787,7 @@ Examples:
|
|
|
6602
6787
|
});
|
|
6603
6788
|
|
|
6604
6789
|
// src/commands/ads/x/cards.ts
|
|
6605
|
-
import { defineCommand as
|
|
6790
|
+
import { defineCommand as defineCommand60 } from "citty";
|
|
6606
6791
|
registerSchema({
|
|
6607
6792
|
command: "ads.x.cards",
|
|
6608
6793
|
description: "List website cards, video cards, and carousels for an X Ads account.",
|
|
@@ -6611,7 +6796,7 @@ registerSchema({
|
|
|
6611
6796
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6612
6797
|
}
|
|
6613
6798
|
});
|
|
6614
|
-
var cardsCommand =
|
|
6799
|
+
var cardsCommand = defineCommand60({
|
|
6615
6800
|
meta: {
|
|
6616
6801
|
name: "cards",
|
|
6617
6802
|
description: `List X Ads cards (rich creatives).
|
|
@@ -6660,7 +6845,7 @@ Examples:
|
|
|
6660
6845
|
});
|
|
6661
6846
|
|
|
6662
6847
|
// src/commands/ads/x/funding.ts
|
|
6663
|
-
import { defineCommand as
|
|
6848
|
+
import { defineCommand as defineCommand61 } from "citty";
|
|
6664
6849
|
registerSchema({
|
|
6665
6850
|
command: "ads.x.funding",
|
|
6666
6851
|
description: "List funding instruments for an X Ads account. Returns id, type, currency, credit_limit_local_micro, funded_amount_local_micro, status. Falls back to BAKER_X_ADS_ACCOUNT_ID env var.",
|
|
@@ -6669,7 +6854,7 @@ registerSchema({
|
|
|
6669
6854
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6670
6855
|
}
|
|
6671
6856
|
});
|
|
6672
|
-
var fundingCommand =
|
|
6857
|
+
var fundingCommand = defineCommand61({
|
|
6673
6858
|
meta: {
|
|
6674
6859
|
name: "funding",
|
|
6675
6860
|
description: `List funding instruments for an X Ads account.
|
|
@@ -6718,7 +6903,7 @@ Examples:
|
|
|
6718
6903
|
});
|
|
6719
6904
|
|
|
6720
6905
|
// src/commands/ads/x/line-items.ts
|
|
6721
|
-
import { defineCommand as
|
|
6906
|
+
import { defineCommand as defineCommand62 } from "citty";
|
|
6722
6907
|
registerSchema({
|
|
6723
6908
|
command: "ads.x.lineItems",
|
|
6724
6909
|
description: "List line items (ad groups) for an X Ads account. Returns bid, product_type, objective, placements, schedule. Filter by campaign-ids or line-item-ids (CSV).",
|
|
@@ -6730,7 +6915,7 @@ registerSchema({
|
|
|
6730
6915
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6731
6916
|
}
|
|
6732
6917
|
});
|
|
6733
|
-
var lineItemsCommand =
|
|
6918
|
+
var lineItemsCommand = defineCommand62({
|
|
6734
6919
|
meta: {
|
|
6735
6920
|
name: "line-items",
|
|
6736
6921
|
description: `List X Ads line items (ad groups).
|
|
@@ -6771,7 +6956,7 @@ Examples:
|
|
|
6771
6956
|
});
|
|
6772
6957
|
|
|
6773
6958
|
// src/commands/ads/x/media.ts
|
|
6774
|
-
import { defineCommand as
|
|
6959
|
+
import { defineCommand as defineCommand63 } from "citty";
|
|
6775
6960
|
registerSchema({
|
|
6776
6961
|
command: "ads.x.media",
|
|
6777
6962
|
description: "List media assets in the X Ads media library (images, GIFs, videos). Filter by media-type (IMAGE, GIF, VIDEO).",
|
|
@@ -6781,7 +6966,7 @@ registerSchema({
|
|
|
6781
6966
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6782
6967
|
}
|
|
6783
6968
|
});
|
|
6784
|
-
var mediaCommand =
|
|
6969
|
+
var mediaCommand = defineCommand63({
|
|
6785
6970
|
meta: {
|
|
6786
6971
|
name: "media",
|
|
6787
6972
|
description: `List media assets in the X Ads media library.
|
|
@@ -6833,7 +7018,7 @@ Examples:
|
|
|
6833
7018
|
});
|
|
6834
7019
|
|
|
6835
7020
|
// src/commands/ads/x/promoted-tweets.ts
|
|
6836
|
-
import { defineCommand as
|
|
7021
|
+
import { defineCommand as defineCommand64 } from "citty";
|
|
6837
7022
|
registerSchema({
|
|
6838
7023
|
command: "ads.x.promotedTweets",
|
|
6839
7024
|
description: "List promoted tweets for an X Ads account. Returns id, line_item_id, tweet_id, approval_status. Filter by line-item-ids (CSV).",
|
|
@@ -6844,7 +7029,7 @@ registerSchema({
|
|
|
6844
7029
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
6845
7030
|
}
|
|
6846
7031
|
});
|
|
6847
|
-
var promotedTweetsCommand =
|
|
7032
|
+
var promotedTweetsCommand = defineCommand64({
|
|
6848
7033
|
meta: {
|
|
6849
7034
|
name: "promoted-tweets",
|
|
6850
7035
|
description: `List X Ads promoted tweets.
|
|
@@ -6898,11 +7083,11 @@ Examples:
|
|
|
6898
7083
|
});
|
|
6899
7084
|
|
|
6900
7085
|
// src/commands/ads/x/stats/index.ts
|
|
6901
|
-
import { defineCommand as
|
|
7086
|
+
import { defineCommand as defineCommand69 } from "citty";
|
|
6902
7087
|
|
|
6903
7088
|
// src/commands/ads/x/stats/job.ts
|
|
6904
7089
|
import { gunzipSync } from "zlib";
|
|
6905
|
-
import { defineCommand as
|
|
7090
|
+
import { defineCommand as defineCommand65 } from "citty";
|
|
6906
7091
|
var POLL_INTERVAL_MS2 = 1e4;
|
|
6907
7092
|
var DEADLINE_MS = 12 * 60 * 1e3;
|
|
6908
7093
|
var RESULT_CACHE_TTL_MS = 6 * 60 * 60 * 1e3;
|
|
@@ -6972,7 +7157,7 @@ async function pollUntilDone(accountId, jobId) {
|
|
|
6972
7157
|
function buildCacheKey(body) {
|
|
6973
7158
|
return `stats-job:${JSON.stringify(body)}`;
|
|
6974
7159
|
}
|
|
6975
|
-
var statsJobCommand =
|
|
7160
|
+
var statsJobCommand = defineCommand65({
|
|
6976
7161
|
meta: {
|
|
6977
7162
|
name: "job",
|
|
6978
7163
|
description: `Async X Ads stats job, sync from the CLI's perspective. Creates \u2192 polls \u2192 downloads \u2192 returns.
|
|
@@ -7077,7 +7262,7 @@ For fine-grained control (don't wait, poll yourself), use:
|
|
|
7077
7262
|
});
|
|
7078
7263
|
|
|
7079
7264
|
// src/commands/ads/x/stats/job-create.ts
|
|
7080
|
-
import { defineCommand as
|
|
7265
|
+
import { defineCommand as defineCommand66 } from "citty";
|
|
7081
7266
|
registerSchema({
|
|
7082
7267
|
command: "ads.x.statsJobCreate",
|
|
7083
7268
|
description: "Create an asynchronous X Ads stats job (range up to 90 days non-segmented, 45 days segmented). Returns a job id; poll with `stats job-status`. Times must be ISO 8601 hour-aligned.",
|
|
@@ -7100,7 +7285,7 @@ function parseCsv3(v) {
|
|
|
7100
7285
|
const parts = v.split(",").map((s) => s.trim()).filter(Boolean);
|
|
7101
7286
|
return parts.length > 0 ? parts : void 0;
|
|
7102
7287
|
}
|
|
7103
|
-
var statsJobCreateCommand =
|
|
7288
|
+
var statsJobCreateCommand = defineCommand66({
|
|
7104
7289
|
meta: {
|
|
7105
7290
|
name: "job-create",
|
|
7106
7291
|
description: `Create an async X Ads stats job (up to 90 days, supports segmentation).
|
|
@@ -7163,7 +7348,7 @@ Examples:
|
|
|
7163
7348
|
});
|
|
7164
7349
|
|
|
7165
7350
|
// src/commands/ads/x/stats/job-status.ts
|
|
7166
|
-
import { defineCommand as
|
|
7351
|
+
import { defineCommand as defineCommand67 } from "citty";
|
|
7167
7352
|
registerSchema({
|
|
7168
7353
|
command: "ads.x.statsJobStatus",
|
|
7169
7354
|
description: "Check the status of one or more X Ads stats jobs. Returns status (PROCESSING|SUCCESS|FAILED) and a downloadable url when SUCCESS. Pass --job-id or --job-ids (CSV).",
|
|
@@ -7173,7 +7358,7 @@ registerSchema({
|
|
|
7173
7358
|
"job-ids": { type: "string", description: "CSV of job IDs", required: false }
|
|
7174
7359
|
}
|
|
7175
7360
|
});
|
|
7176
|
-
var statsJobStatusCommand =
|
|
7361
|
+
var statsJobStatusCommand = defineCommand67({
|
|
7177
7362
|
meta: {
|
|
7178
7363
|
name: "job-status",
|
|
7179
7364
|
description: `Poll the status of an async X Ads stats job.
|
|
@@ -7214,7 +7399,7 @@ Examples:
|
|
|
7214
7399
|
});
|
|
7215
7400
|
|
|
7216
7401
|
// src/commands/ads/x/stats/sync.ts
|
|
7217
|
-
import { defineCommand as
|
|
7402
|
+
import { defineCommand as defineCommand68 } from "citty";
|
|
7218
7403
|
|
|
7219
7404
|
// src/commands/ads/x/presets.ts
|
|
7220
7405
|
var X_STATS_PRESETS = [
|
|
@@ -7373,7 +7558,7 @@ async function runSync(args, q) {
|
|
|
7373
7558
|
process.exit(1);
|
|
7374
7559
|
}
|
|
7375
7560
|
}
|
|
7376
|
-
var statsSyncCommand =
|
|
7561
|
+
var statsSyncCommand = defineCommand68({
|
|
7377
7562
|
meta: {
|
|
7378
7563
|
name: "sync",
|
|
7379
7564
|
description: `Synchronous X Ads analytics (max 7-day window).
|
|
@@ -7416,7 +7601,7 @@ Examples:
|
|
|
7416
7601
|
});
|
|
7417
7602
|
|
|
7418
7603
|
// src/commands/ads/x/stats/index.ts
|
|
7419
|
-
var statsCommand =
|
|
7604
|
+
var statsCommand = defineCommand69({
|
|
7420
7605
|
meta: {
|
|
7421
7606
|
name: "stats",
|
|
7422
7607
|
description: `X Ads analytics. Sync (\u22647 days, no segmentation) or async jobs (\u226490 days, segmentable).
|
|
@@ -7444,7 +7629,7 @@ Examples:
|
|
|
7444
7629
|
});
|
|
7445
7630
|
|
|
7446
7631
|
// src/commands/ads/x/targeting-constants.ts
|
|
7447
|
-
import { defineCommand as
|
|
7632
|
+
import { defineCommand as defineCommand70 } from "citty";
|
|
7448
7633
|
var ALLOWED_CONSTANTS = [
|
|
7449
7634
|
"locations",
|
|
7450
7635
|
"interests",
|
|
@@ -7472,7 +7657,7 @@ registerSchema({
|
|
|
7472
7657
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7473
7658
|
}
|
|
7474
7659
|
});
|
|
7475
|
-
var targetingConstantsCommand =
|
|
7660
|
+
var targetingConstantsCommand = defineCommand70({
|
|
7476
7661
|
meta: {
|
|
7477
7662
|
name: "targeting-constants",
|
|
7478
7663
|
description: `Lookup X Ads targeting constants.
|
|
@@ -7522,7 +7707,7 @@ Examples:
|
|
|
7522
7707
|
});
|
|
7523
7708
|
|
|
7524
7709
|
// src/commands/ads/x/targeting-criteria.ts
|
|
7525
|
-
import { defineCommand as
|
|
7710
|
+
import { defineCommand as defineCommand71 } from "citty";
|
|
7526
7711
|
registerSchema({
|
|
7527
7712
|
command: "ads.x.targetingCriteria",
|
|
7528
7713
|
description: "List targeting criteria attached to line items in an X Ads account. Returns targeting_type, targeting_value, name, operator_type per criterion. Filter by line-item-ids.",
|
|
@@ -7532,7 +7717,7 @@ registerSchema({
|
|
|
7532
7717
|
"no-cache": { type: "boolean", description: "Skip cache", required: false }
|
|
7533
7718
|
}
|
|
7534
7719
|
});
|
|
7535
|
-
var targetingCriteriaCommand =
|
|
7720
|
+
var targetingCriteriaCommand = defineCommand71({
|
|
7536
7721
|
meta: {
|
|
7537
7722
|
name: "targeting-criteria",
|
|
7538
7723
|
description: `List targeting criteria attached to line items.
|
|
@@ -7583,7 +7768,7 @@ Examples:
|
|
|
7583
7768
|
});
|
|
7584
7769
|
|
|
7585
7770
|
// src/commands/ads/x/index.ts
|
|
7586
|
-
var xCommand =
|
|
7771
|
+
var xCommand = defineCommand72({
|
|
7587
7772
|
meta: {
|
|
7588
7773
|
name: "x",
|
|
7589
7774
|
description: `X (Twitter) Ads commands. Read campaigns, line items, promoted tweets, creatives, audiences, and analytics.
|
|
@@ -7621,7 +7806,7 @@ The CLI auto-detects --account-id when exactly one X Ads account is connected, o
|
|
|
7621
7806
|
});
|
|
7622
7807
|
|
|
7623
7808
|
// src/commands/ads/index.ts
|
|
7624
|
-
var adsCommand =
|
|
7809
|
+
var adsCommand = defineCommand73({
|
|
7625
7810
|
meta: {
|
|
7626
7811
|
name: "ads",
|
|
7627
7812
|
description: `Ad platform commands. Each platform exposes its own native command surface \u2014 no forced parity.
|
|
@@ -7651,11 +7836,11 @@ Examples:
|
|
|
7651
7836
|
});
|
|
7652
7837
|
|
|
7653
7838
|
// src/commands/canvas/index.ts
|
|
7654
|
-
import { defineCommand as
|
|
7839
|
+
import { defineCommand as defineCommand80 } from "citty";
|
|
7655
7840
|
|
|
7656
7841
|
// src/commands/canvas/catalog.ts
|
|
7657
|
-
import { defineCommand as
|
|
7658
|
-
var catalogCommand =
|
|
7842
|
+
import { defineCommand as defineCommand74 } from "citty";
|
|
7843
|
+
var catalogCommand = defineCommand74({
|
|
7659
7844
|
meta: {
|
|
7660
7845
|
name: "catalog",
|
|
7661
7846
|
description: "Print the agent-facing node catalog (JSON Schema). Includes every registered node grouped by category."
|
|
@@ -7672,9 +7857,9 @@ import { execFile } from "child_process";
|
|
|
7672
7857
|
import { readdir, readFile, stat } from "fs/promises";
|
|
7673
7858
|
import path from "path";
|
|
7674
7859
|
import { promisify } from "util";
|
|
7675
|
-
import { defineCommand as
|
|
7860
|
+
import { defineCommand as defineCommand75 } from "citty";
|
|
7676
7861
|
var execFileAsync = promisify(execFile);
|
|
7677
|
-
var inspectCommand =
|
|
7862
|
+
var inspectCommand = defineCommand75({
|
|
7678
7863
|
meta: {
|
|
7679
7864
|
name: "inspect",
|
|
7680
7865
|
description: "Dump a one-page summary of a canvas run: per-node duration + cache status, list of output files in the run dir, and optionally three thumbnail frames per video output. Pass either a run_id (resolved against --outputs-dir) or an absolute run directory."
|
|
@@ -7783,7 +7968,7 @@ async function probeDuration(filePath) {
|
|
|
7783
7968
|
// src/commands/canvas/run.ts
|
|
7784
7969
|
import { readFile as readFile2 } from "fs/promises";
|
|
7785
7970
|
import path2 from "path";
|
|
7786
|
-
import { defineCommand as
|
|
7971
|
+
import { defineCommand as defineCommand76 } from "citty";
|
|
7787
7972
|
|
|
7788
7973
|
// src/commands/canvas/placeholders.ts
|
|
7789
7974
|
function unsuppliedPlaceholderAssets(canvas) {
|
|
@@ -7802,7 +7987,7 @@ function unsuppliedPlaceholderAssets(canvas) {
|
|
|
7802
7987
|
}
|
|
7803
7988
|
|
|
7804
7989
|
// src/commands/canvas/run.ts
|
|
7805
|
-
var runCommand =
|
|
7990
|
+
var runCommand = defineCommand76({
|
|
7806
7991
|
meta: { name: "run", description: "Validate and execute a canvas JSON file." },
|
|
7807
7992
|
args: {
|
|
7808
7993
|
file: { type: "positional", required: true, description: "Path to canvas JSON" },
|
|
@@ -7887,7 +8072,7 @@ var runCommand = defineCommand74({
|
|
|
7887
8072
|
// src/commands/canvas/scaffold-static-ad.ts
|
|
7888
8073
|
import { readFile as readFile3, writeFile } from "fs/promises";
|
|
7889
8074
|
import path3 from "path";
|
|
7890
|
-
import { defineCommand as
|
|
8075
|
+
import { defineCommand as defineCommand77 } from "citty";
|
|
7891
8076
|
|
|
7892
8077
|
// src/engine/scaffold/staticAd.ts
|
|
7893
8078
|
import { z as z2 } from "zod";
|
|
@@ -8206,7 +8391,7 @@ async function runVisionPasses(canvas) {
|
|
|
8206
8391
|
return fail("read_outputs", e instanceof Error ? e.message : String(e));
|
|
8207
8392
|
}
|
|
8208
8393
|
}
|
|
8209
|
-
var scaffoldStaticAdCommand =
|
|
8394
|
+
var scaffoldStaticAdCommand = defineCommand77({
|
|
8210
8395
|
meta: {
|
|
8211
8396
|
name: "scaffold-static-ad",
|
|
8212
8397
|
description: "Turn a source/inspiration image into a runnable static-ad canvas. Runs billed passes \u2014 image_describe (the blueprint, baked to prompt.json as the editable 'prompt'), an AI selection of the image's MAIN identity elements, and a structured global-layout pass (the column/row grid with per-region bounds and text sizes) \u2014 then scaffolds a canvas that wires one [TODO] ingest slot per element (logo/product/subject/badge + brand font) into image_generate. Edit prompt.json and drop the real assets, then `baker canvas run` it."
|
|
@@ -8300,7 +8485,7 @@ var scaffoldStaticAdCommand = defineCommand75({
|
|
|
8300
8485
|
// src/commands/canvas/scaffold-video.ts
|
|
8301
8486
|
import { cp, mkdir, readFile as readFile5, writeFile as writeFile2 } from "fs/promises";
|
|
8302
8487
|
import path5 from "path";
|
|
8303
|
-
import { defineCommand as
|
|
8488
|
+
import { defineCommand as defineCommand78 } from "citty";
|
|
8304
8489
|
|
|
8305
8490
|
// src/engine/nodes/local/lib/sceneDetect.ts
|
|
8306
8491
|
import { execFile as execFile2 } from "child_process";
|
|
@@ -8393,6 +8578,18 @@ async function detectSceneCutsPySceneDetect(filePath, opts = {}) {
|
|
|
8393
8578
|
}
|
|
8394
8579
|
|
|
8395
8580
|
// src/engine/scaffold/video.ts
|
|
8581
|
+
import { toCardinal as nwAr } from "n2words/ar-SA";
|
|
8582
|
+
import { toCardinal as nwDe } from "n2words/de-DE";
|
|
8583
|
+
import { toCardinal as nwEn } from "n2words/en-US";
|
|
8584
|
+
import { toCardinal as nwEs } from "n2words/es-ES";
|
|
8585
|
+
import { toCardinal as nwFr } from "n2words/fr-FR";
|
|
8586
|
+
import { toCardinal as nwHi } from "n2words/hi-IN";
|
|
8587
|
+
import { toCardinal as nwIt } from "n2words/it-IT";
|
|
8588
|
+
import { toCardinal as nwJa } from "n2words/ja-JP";
|
|
8589
|
+
import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
8590
|
+
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
8591
|
+
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
8592
|
+
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
8396
8593
|
import { z as z3 } from "zod";
|
|
8397
8594
|
|
|
8398
8595
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
@@ -8504,6 +8701,14 @@ var XFADE_BY_TYPE = {
|
|
|
8504
8701
|
swipe: "wipeleft",
|
|
8505
8702
|
zoom: "zoomin"
|
|
8506
8703
|
};
|
|
8704
|
+
var DEFAULT_VIDEO_RESOLUTION = "1080p";
|
|
8705
|
+
var VIDEO_MODELS_WITH_RESOLUTION = new Set(
|
|
8706
|
+
Object.entries(MODEL_REGISTRY.video_generate).filter(([, spec]) => "resolution" in spec.params).map(([id]) => id)
|
|
8707
|
+
);
|
|
8708
|
+
function videoResolutionParam(videoModel, resolution) {
|
|
8709
|
+
if (!VIDEO_MODELS_WITH_RESOLUTION.has(videoModel)) return {};
|
|
8710
|
+
return { resolution: resolution ?? DEFAULT_VIDEO_RESOLUTION };
|
|
8711
|
+
}
|
|
8507
8712
|
var WORDS_PER_SECOND = 2.5;
|
|
8508
8713
|
function estSpeechS(text) {
|
|
8509
8714
|
const words = text.trim().split(/\s+/).filter(Boolean).length;
|
|
@@ -8721,12 +8926,21 @@ var VideoBlueprint = z3.object({
|
|
|
8721
8926
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
8722
8927
|
identified_track: z3.object({ title: z3.string().optional(), artist: z3.string().optional() }).loose().nullish()
|
|
8723
8928
|
}).loose().optional(),
|
|
8724
|
-
cast: z3.array(
|
|
8929
|
+
cast: z3.array(
|
|
8930
|
+
z3.object({
|
|
8931
|
+
id: z3.string().optional(),
|
|
8932
|
+
description: z3.string().optional(),
|
|
8933
|
+
// The deconstruct's note on the target-market localization (e.g. "native
|
|
8934
|
+
// French speaker") — read to derive the spoken-track language code.
|
|
8935
|
+
market_localization_note: z3.string().optional()
|
|
8936
|
+
}).loose()
|
|
8937
|
+
).optional(),
|
|
8725
8938
|
voiceover: z3.object({
|
|
8726
8939
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
8727
8940
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
8728
8941
|
mode: z3.string().optional(),
|
|
8729
|
-
voice_description: z3.string().optional()
|
|
8942
|
+
voice_description: z3.string().optional(),
|
|
8943
|
+
persona: z3.string().optional()
|
|
8730
8944
|
}).loose().optional()
|
|
8731
8945
|
}).loose().optional(),
|
|
8732
8946
|
scenes: z3.array(Scene).min(1)
|
|
@@ -8882,7 +9096,8 @@ function buildElementSlots(elements) {
|
|
|
8882
9096
|
"spine",
|
|
8883
9097
|
"overlaid",
|
|
8884
9098
|
"captions",
|
|
8885
|
-
"
|
|
9099
|
+
"captions_premux",
|
|
9100
|
+
"captions_transcribe",
|
|
8886
9101
|
"audio_mix",
|
|
8887
9102
|
"final",
|
|
8888
9103
|
"music_bed"
|
|
@@ -8909,11 +9124,18 @@ function slotsForFrame(slots, sceneIndex, edge) {
|
|
|
8909
9124
|
return slots.filter((s) => s.presence.get(sceneIndex)?.has(edge));
|
|
8910
9125
|
}
|
|
8911
9126
|
var ACTOR_SHEET_MODEL = "google/gemini-3-pro-image-preview";
|
|
8912
|
-
|
|
9127
|
+
var SHEET_SUBJECT_TYPE = {
|
|
9128
|
+
person: "person",
|
|
9129
|
+
animal: "character",
|
|
9130
|
+
product: "product",
|
|
9131
|
+
location: "location"
|
|
9132
|
+
};
|
|
9133
|
+
function buildElementSheets(slots, nodes) {
|
|
8913
9134
|
for (const slot of slots) {
|
|
8914
|
-
const
|
|
8915
|
-
if (
|
|
8916
|
-
if (slot.
|
|
9135
|
+
const subjectType = SHEET_SUBJECT_TYPE[slot.type.toLowerCase()];
|
|
9136
|
+
if (!subjectType) continue;
|
|
9137
|
+
if (slot.sameAs) continue;
|
|
9138
|
+
if (slot.presence.size < 1) continue;
|
|
8917
9139
|
const sheetId = `${slot.id}_sheet`;
|
|
8918
9140
|
nodes.push({
|
|
8919
9141
|
id: sheetId,
|
|
@@ -8923,11 +9145,15 @@ function applyActorSheets(slots, nodes) {
|
|
|
8923
9145
|
params: {
|
|
8924
9146
|
model: ACTOR_SHEET_MODEL,
|
|
8925
9147
|
subject_description: slot.description ?? `the ${slot.type}`,
|
|
8926
|
-
subject_type:
|
|
8927
|
-
|
|
9148
|
+
subject_type: subjectType,
|
|
9149
|
+
// 4K: the sheet packs up to 8 cells (angles + tight face/detail close-ups), and
|
|
9150
|
+
// it's the ONE reference every frame grounds on — per-cell sharpness here
|
|
9151
|
+
// propagates to every clip, so it's worth the highest tier on this single asset.
|
|
9152
|
+
image_size: "4K"
|
|
8928
9153
|
}
|
|
8929
9154
|
});
|
|
8930
9155
|
slot.ref = `$ref:${sheetId}.sheet`;
|
|
9156
|
+
slot.sheetBacked = true;
|
|
8931
9157
|
}
|
|
8932
9158
|
}
|
|
8933
9159
|
function slotsForScene(slots, sceneIndex) {
|
|
@@ -8938,7 +9164,7 @@ function buildFramePrompt(edge, sceneIndex, framePrompt, present, hasAnchor, mod
|
|
|
8938
9164
|
const legend = [
|
|
8939
9165
|
...present.map((s) => `- ${s.label} \u2014 ${roleForSlot(s)}`),
|
|
8940
9166
|
...hasAnchor ? [
|
|
8941
|
-
"- ORIGINAL_FRAME \u2014 use ONLY for composition
|
|
9167
|
+
"- ORIGINAL_FRAME \u2014 use ONLY for composition: framing, camera angle, shot size, subject placement, pose, and proportions. IGNORE its text, logo, brand name, colors, AND the identity of every person/animal/object in it \u2014 those come from the labeled reference images above, never from this frame. It is a DIFFERENT brand's footage with DIFFERENT actors, here ONLY to anchor where things sit and how the shot is framed (e.g. a profile/side angle stays a profile/side angle), never who they are or what palette to use."
|
|
8942
9168
|
] : []
|
|
8943
9169
|
].join("\n");
|
|
8944
9170
|
const description = framePrompt?.trim() || `the ${edge} frame of scene ${sceneIndex + 1} \u2014 describe the full composition, subjects, setting, action, lighting, and palette here. (Edit this line to change ONLY this frame.)`;
|
|
@@ -9027,11 +9253,12 @@ function ingestFrameRef(url, edge, ctx, nodes) {
|
|
|
9027
9253
|
function buildFrameRef(edge, url, framePrompt, present, ctx, nodes) {
|
|
9028
9254
|
const tag = ctx.tag ?? "";
|
|
9029
9255
|
if (ctx.reuse && url) return ingestFrameRef(url, edge, ctx, nodes);
|
|
9030
|
-
const
|
|
9256
|
+
const castSlots = present.filter((s) => {
|
|
9031
9257
|
const t = s.type.toLowerCase();
|
|
9032
9258
|
return t === "person" || t === "animal";
|
|
9033
9259
|
});
|
|
9034
|
-
const
|
|
9260
|
+
const castIdentityLocked = castSlots.every((s) => s.sheetBacked);
|
|
9261
|
+
const useOriginalAnchor = Boolean(url) && (castSlots.length === 0 || castIdentityLocked);
|
|
9035
9262
|
const hasOriginal = useOriginalAnchor;
|
|
9036
9263
|
const originalRef = useOriginalAnchor && url ? ingestFrameRef(url, edge, ctx, nodes) : void 0;
|
|
9037
9264
|
const reference = [...present.map((s) => s.ref), ...originalRef ? [originalRef] : []];
|
|
@@ -9063,17 +9290,18 @@ function seedanceAudioLine(scene, mode, audio, nativeLine) {
|
|
|
9063
9290
|
}
|
|
9064
9291
|
return null;
|
|
9065
9292
|
}
|
|
9066
|
-
function buildSeedancePrompt(scene, sceneIndex, present, mode, audio, nativeLine) {
|
|
9293
|
+
function buildSeedancePrompt(scene, sceneIndex, present, mode, audio, nativeLine, nativeLang) {
|
|
9294
|
+
const loc = (s) => nativeLine ? localizeNumeralsForNative(s, nativeLang) : s;
|
|
9067
9295
|
const parts = [];
|
|
9068
9296
|
const summary = scene.summary?.trim();
|
|
9069
|
-
parts.push(summary ? `Scene ${sceneIndex + 1}: ${summary}` : `Scene ${sceneIndex + 1}`);
|
|
9070
|
-
if (scene.action_detail) parts.push(`Action: ${scene.action_detail}`);
|
|
9297
|
+
parts.push(summary ? `Scene ${sceneIndex + 1}: ${loc(summary)}` : `Scene ${sceneIndex + 1}`);
|
|
9298
|
+
if (scene.action_detail) parts.push(`Action: ${loc(scene.action_detail)}`);
|
|
9071
9299
|
const cm = scene.camera_motion;
|
|
9072
9300
|
if (cm) {
|
|
9073
9301
|
const camera = [cm.movement, cm.detail].filter(Boolean).join(" \u2014 ");
|
|
9074
9302
|
if (camera) parts.push(`Camera: ${camera}`);
|
|
9075
9303
|
}
|
|
9076
|
-
if (scene.motion_prompt) parts.push(`Motion: ${scene.motion_prompt}`);
|
|
9304
|
+
if (scene.motion_prompt) parts.push(`Motion: ${loc(scene.motion_prompt)}`);
|
|
9077
9305
|
if (present.length > 0) {
|
|
9078
9306
|
parts.push(
|
|
9079
9307
|
`Keep these consistent with their references: ${present.map((s) => `${s.label} (${s.description ?? s.type})`).join("; ")}`
|
|
@@ -9081,7 +9309,7 @@ function buildSeedancePrompt(scene, sceneIndex, present, mode, audio, nativeLine
|
|
|
9081
9309
|
}
|
|
9082
9310
|
if (nativeLine) {
|
|
9083
9311
|
parts.push(
|
|
9084
|
-
`The person speaks to camera. Lip-sync follows the dialogue verbatim; put delivery/emotion cues in [brackets]. Dialogue: "${nativeLine}"`
|
|
9312
|
+
`The person speaks to camera. Lip-sync follows the dialogue verbatim; put delivery/emotion cues in [brackets]. Dialogue: "${loc(nativeLine)}"`
|
|
9085
9313
|
);
|
|
9086
9314
|
} else {
|
|
9087
9315
|
const lines = (scene.dialogue ?? []).map((d) => d.line?.trim()).filter((l) => Boolean(l));
|
|
@@ -9089,7 +9317,7 @@ function buildSeedancePrompt(scene, sceneIndex, present, mode, audio, nativeLine
|
|
|
9089
9317
|
parts.push(`Spoken context (do not render as audio): ${lines.map((l) => `"${l}"`).join(" ")}`);
|
|
9090
9318
|
}
|
|
9091
9319
|
const transcript = (scene.transcript_slice ?? []).map((w) => w.text?.trim()).filter(Boolean).join(" ").trim();
|
|
9092
|
-
if (transcript) parts.push(`Transcript: ${transcript}`);
|
|
9320
|
+
if (transcript) parts.push(`Transcript: ${loc(transcript)}`);
|
|
9093
9321
|
const audioLine = seedanceAudioLine(scene, mode, audio, nativeLine);
|
|
9094
9322
|
if (audioLine) parts.push(audioLine);
|
|
9095
9323
|
parts.push(
|
|
@@ -9200,8 +9428,17 @@ function buildPerSpeakerVoiceConversion(segments, totalMs, nodes) {
|
|
|
9200
9428
|
function emitSceneClip(i, scene, present, mode, nativeTurn, ambientBroll, frames, lengths, out, opts, nodes, tag = "") {
|
|
9201
9429
|
const clipParams = {
|
|
9202
9430
|
model: opts.videoModel,
|
|
9203
|
-
prompt: buildSeedancePrompt(
|
|
9431
|
+
prompt: buildSeedancePrompt(
|
|
9432
|
+
scene,
|
|
9433
|
+
i,
|
|
9434
|
+
present,
|
|
9435
|
+
mode,
|
|
9436
|
+
Boolean(nativeTurn) || ambientBroll,
|
|
9437
|
+
nativeTurn?.text,
|
|
9438
|
+
opts.nativeLang
|
|
9439
|
+
),
|
|
9204
9440
|
duration: lengths.genDur,
|
|
9441
|
+
...videoResolutionParam(opts.videoModel, opts.resolution),
|
|
9205
9442
|
// Native talking scene → Seedance generates the spoken audio + lip-sync; an opt-in
|
|
9206
9443
|
// ambient b-roll beat generates diegetic ambient only; otherwise the clip is silent.
|
|
9207
9444
|
generate_audio: Boolean(nativeTurn) || ambientBroll
|
|
@@ -9305,7 +9542,7 @@ function buildCompositeScene(layout, regions, comp, scene, i, present, mode, nat
|
|
|
9305
9542
|
{ first, last },
|
|
9306
9543
|
lengths,
|
|
9307
9544
|
null,
|
|
9308
|
-
{ ar: opts.ar, videoModel: opts.videoModel },
|
|
9545
|
+
{ ar: opts.ar, videoModel: opts.videoModel, resolution: opts.resolution, nativeLang: opts.nativeLang },
|
|
9309
9546
|
nodes,
|
|
9310
9547
|
tag
|
|
9311
9548
|
);
|
|
@@ -9437,6 +9674,65 @@ var LANGUAGE_WORDS = [
|
|
|
9437
9674
|
[/\b(hindi)\b/, "hindi"],
|
|
9438
9675
|
[/\b(polish)\b/, "polish"]
|
|
9439
9676
|
];
|
|
9677
|
+
var LANGUAGE_ISO = {
|
|
9678
|
+
french: "fr",
|
|
9679
|
+
spanish: "es",
|
|
9680
|
+
english: "en",
|
|
9681
|
+
german: "de",
|
|
9682
|
+
italian: "it",
|
|
9683
|
+
portuguese: "pt",
|
|
9684
|
+
dutch: "nl",
|
|
9685
|
+
arabic: "ar",
|
|
9686
|
+
japanese: "ja",
|
|
9687
|
+
korean: "ko",
|
|
9688
|
+
hindi: "hi",
|
|
9689
|
+
polish: "pl"
|
|
9690
|
+
};
|
|
9691
|
+
function languageHaystacks(blueprint) {
|
|
9692
|
+
const vo = blueprint.global?.voiceover;
|
|
9693
|
+
const cast = blueprint.global?.cast ?? [];
|
|
9694
|
+
const dialogue = blueprint.scenes.flatMap((s) => s.dialogue ?? []);
|
|
9695
|
+
return [
|
|
9696
|
+
vo?.voice_description,
|
|
9697
|
+
vo?.persona,
|
|
9698
|
+
...cast.flatMap((c) => [c.market_localization_note, c.description]),
|
|
9699
|
+
...dialogue.map((l) => l.voice_description)
|
|
9700
|
+
].filter((s) => Boolean(s));
|
|
9701
|
+
}
|
|
9702
|
+
function deriveTtsLanguageCode(blueprint) {
|
|
9703
|
+
for (const text of languageHaystacks(blueprint)) {
|
|
9704
|
+
const name = parseVoiceTraits(text).language;
|
|
9705
|
+
if (name && LANGUAGE_ISO[name]) return LANGUAGE_ISO[name];
|
|
9706
|
+
}
|
|
9707
|
+
return void 0;
|
|
9708
|
+
}
|
|
9709
|
+
var INTEGER_SPELLERS = {
|
|
9710
|
+
fr: nwFr,
|
|
9711
|
+
es: nwEs,
|
|
9712
|
+
en: nwEn,
|
|
9713
|
+
de: nwDe,
|
|
9714
|
+
it: nwIt,
|
|
9715
|
+
pt: nwPt,
|
|
9716
|
+
nl: nwNl,
|
|
9717
|
+
pl: nwPl,
|
|
9718
|
+
ar: nwAr,
|
|
9719
|
+
ja: nwJa,
|
|
9720
|
+
ko: nwKo,
|
|
9721
|
+
hi: nwHi
|
|
9722
|
+
};
|
|
9723
|
+
function spellNumber(langCode, n) {
|
|
9724
|
+
const spell = langCode ? INTEGER_SPELLERS[langCode] : void 0;
|
|
9725
|
+
if (!spell || !Number.isFinite(n)) return String(n);
|
|
9726
|
+
try {
|
|
9727
|
+
return spell(n);
|
|
9728
|
+
} catch {
|
|
9729
|
+
return String(n);
|
|
9730
|
+
}
|
|
9731
|
+
}
|
|
9732
|
+
function localizeNumeralsForNative(text, langCode) {
|
|
9733
|
+
if (!langCode || !INTEGER_SPELLERS[langCode]) return text;
|
|
9734
|
+
return text.replace(/(?<![\w.,-])\d{1,9}(?![\w.,-])/g, (m) => spellNumber(langCode, Number.parseInt(m, 10)));
|
|
9735
|
+
}
|
|
9440
9736
|
function parseVoiceTraits(description) {
|
|
9441
9737
|
const d = description.toLowerCase();
|
|
9442
9738
|
const out = {};
|
|
@@ -9455,19 +9751,20 @@ function isOnCameraSpeaker(speaker, casts, cameraOn) {
|
|
|
9455
9751
|
if (NARRATOR_SPEAKERS.has(speaker.toLowerCase())) return false;
|
|
9456
9752
|
return casts.has(speaker);
|
|
9457
9753
|
}
|
|
9458
|
-
function makePresenterPresent(slots, canonical) {
|
|
9754
|
+
function makePresenterPresent(slots, canonical, opts = {}) {
|
|
9459
9755
|
const personSlots = slots.filter((s) => s.type.toLowerCase() === "person");
|
|
9460
9756
|
const bySpeaker = /* @__PURE__ */ new Map();
|
|
9461
9757
|
for (const slot of personSlots) if (slot.castId) bySpeaker.set(canonical(slot.castId), slot.presence);
|
|
9462
|
-
const solePerson = personSlots.length === 1 ? personSlots[0].presence : null;
|
|
9758
|
+
const solePerson = !opts.strict && personSlots.length === 1 ? personSlots[0].presence : null;
|
|
9463
9759
|
return (speaker, sceneIndex) => {
|
|
9464
9760
|
const presence = bySpeaker.get(speaker) ?? solePerson;
|
|
9465
|
-
if (!presence) return true;
|
|
9761
|
+
if (!presence) return opts.strict ? false : true;
|
|
9466
9762
|
return presence.has(sceneIndex);
|
|
9467
9763
|
};
|
|
9468
9764
|
}
|
|
9469
9765
|
var PAUSE_GAP_S = 0.6;
|
|
9470
|
-
var
|
|
9766
|
+
var SEEDANCE_SAFE_MAX_S = SEEDANCE_DURATIONS.find((d) => d >= 10) ?? 10;
|
|
9767
|
+
var PHRASE_MAX_S = SEEDANCE_SAFE_MAX_S;
|
|
9471
9768
|
function collapseVoiceover(blueprint) {
|
|
9472
9769
|
const casts = castIdSet(blueprint);
|
|
9473
9770
|
const cameraOn = onCameraDialogue(blueprint);
|
|
@@ -9481,16 +9778,18 @@ function collapseVoiceover(blueprint) {
|
|
|
9481
9778
|
const presenter = [...presenters][0];
|
|
9482
9779
|
return (speaker) => NARRATOR_SPEAKERS.has(speaker.toLowerCase()) ? presenter : speaker;
|
|
9483
9780
|
}
|
|
9484
|
-
function buildPhrases(blueprint, canonical, compositeScenes, presenterPresent) {
|
|
9781
|
+
function buildPhrases(blueprint, canonical, compositeScenes, presenterPresent, presentStrict) {
|
|
9485
9782
|
const casts = castIdSet(blueprint);
|
|
9486
9783
|
const cameraOn = onCameraDialogue(blueprint);
|
|
9487
9784
|
const sceneEndS = (i) => blueprint.scenes[i]?.end_s ?? blueprint.scenes[i]?.start_s ?? 0;
|
|
9488
9785
|
const multiSpeaker = /* @__PURE__ */ new Set();
|
|
9489
9786
|
blueprint.scenes.forEach((scene, i) => {
|
|
9490
|
-
const
|
|
9787
|
+
const onCamAll = new Set(
|
|
9491
9788
|
(scene.dialogue ?? []).map((l) => l.speaker ?? "voiceover").filter((sp) => isOnCameraSpeaker(sp, casts, cameraOn))
|
|
9492
9789
|
);
|
|
9493
|
-
|
|
9790
|
+
const onCamPresent = [...onCamAll].filter((sp) => presentStrict(canonical(sp), i));
|
|
9791
|
+
const effective = onCamPresent.length > 0 ? new Set(onCamPresent) : onCamAll;
|
|
9792
|
+
if (effective.size >= 2) multiSpeaker.add(i);
|
|
9494
9793
|
});
|
|
9495
9794
|
const lines = blueprint.scenes.flatMap(
|
|
9496
9795
|
(scene, sceneIndex) => compositeScenes.has(sceneIndex) ? [] : (scene.dialogue ?? []).filter((l) => Boolean(l.line?.trim())).map((l) => {
|
|
@@ -9629,8 +9928,9 @@ function emitPhraseClip(phrase, voiceNode, env, nodes, out) {
|
|
|
9629
9928
|
const genDur = ceilToSeedance(phraseLen);
|
|
9630
9929
|
const clipParams = {
|
|
9631
9930
|
model: env.opts.videoModel,
|
|
9632
|
-
prompt: buildSeedancePrompt(anchorScene, anchor, present, mode, true, phrase.text),
|
|
9931
|
+
prompt: buildSeedancePrompt(anchorScene, anchor, present, mode, true, phrase.text, env.ttsLanguageCode),
|
|
9633
9932
|
duration: genDur,
|
|
9933
|
+
...videoResolutionParam(env.opts.videoModel, env.opts.resolution),
|
|
9634
9934
|
generate_audio: true
|
|
9635
9935
|
};
|
|
9636
9936
|
if (env.ar) clipParams.aspect_ratio = env.ar;
|
|
@@ -9690,7 +9990,7 @@ function emitPhraseClip(phrase, voiceNode, env, nodes, out) {
|
|
|
9690
9990
|
});
|
|
9691
9991
|
}
|
|
9692
9992
|
}
|
|
9693
|
-
function emitPhraseTts(phrase, voiceNode, idx, used, nodes, out) {
|
|
9993
|
+
function emitPhraseTts(phrase, voiceNode, idx, used, nodes, out, languageCode) {
|
|
9694
9994
|
let id = sanitizeId2(`vo_ph${idx}_${phrase.speaker}`, `vo_ph${idx}`);
|
|
9695
9995
|
while (used.has(id)) id = `${id}_x`;
|
|
9696
9996
|
used.add(id);
|
|
@@ -9698,7 +9998,12 @@ function emitPhraseTts(phrase, voiceNode, idx, used, nodes, out) {
|
|
|
9698
9998
|
id,
|
|
9699
9999
|
type: "tts",
|
|
9700
10000
|
inputs: { voice_ref: `$ref:${voiceNode}.voice_id` },
|
|
9701
|
-
params: {
|
|
10001
|
+
params: {
|
|
10002
|
+
model: FIXED_TTS_MODEL,
|
|
10003
|
+
text: phrase.text,
|
|
10004
|
+
voice: "{{voice_ref}}",
|
|
10005
|
+
...languageCode ? { language_code: languageCode } : {}
|
|
10006
|
+
}
|
|
9702
10007
|
});
|
|
9703
10008
|
out.voTracks.push({ slot: id, ref: `$ref:${id}.audio`, start_s: phrase.start_s, end_s: phrase.end_s, kind: "vo" });
|
|
9704
10009
|
out.voSegments.push({
|
|
@@ -9741,17 +10046,34 @@ function emitCompositeInTimeline(composite, scene, i, isLast, env, canonical, en
|
|
|
9741
10046
|
nativeTurn,
|
|
9742
10047
|
lengths,
|
|
9743
10048
|
lengths.out,
|
|
9744
|
-
{
|
|
10049
|
+
{
|
|
10050
|
+
ar: env.ar,
|
|
10051
|
+
reuse: env.reuse,
|
|
10052
|
+
imageModel: env.opts.imageModel,
|
|
10053
|
+
videoModel: env.opts.videoModel,
|
|
10054
|
+
resolution: env.opts.resolution,
|
|
10055
|
+
nativeLang: env.ttsLanguageCode
|
|
10056
|
+
},
|
|
9745
10057
|
nodes,
|
|
9746
10058
|
out.voTracks,
|
|
9747
10059
|
out.nativeSegments,
|
|
9748
10060
|
out.clips
|
|
9749
10061
|
);
|
|
9750
10062
|
if (!nativeTurn && distinctSpeakers.size >= 2) {
|
|
9751
|
-
emitCompositeMultiSpeakerVoice(
|
|
10063
|
+
emitCompositeMultiSpeakerVoice(
|
|
10064
|
+
onCam,
|
|
10065
|
+
scene,
|
|
10066
|
+
i,
|
|
10067
|
+
canonical,
|
|
10068
|
+
ensureVoiceNode,
|
|
10069
|
+
usedVoIds,
|
|
10070
|
+
nodes,
|
|
10071
|
+
out,
|
|
10072
|
+
env.ttsLanguageCode
|
|
10073
|
+
);
|
|
9752
10074
|
}
|
|
9753
10075
|
}
|
|
9754
|
-
function emitCompositeMultiSpeakerVoice(onCam, scene, i, canonical, ensureVoiceNode, usedVoIds, nodes, out) {
|
|
10076
|
+
function emitCompositeMultiSpeakerVoice(onCam, scene, i, canonical, ensureVoiceNode, usedVoIds, nodes, out, languageCode) {
|
|
9755
10077
|
const bySpeaker = /* @__PURE__ */ new Map();
|
|
9756
10078
|
for (const l of onCam) {
|
|
9757
10079
|
const speaker = canonical(l.speaker ?? "voiceover");
|
|
@@ -9783,7 +10105,8 @@ function emitCompositeMultiSpeakerVoice(onCam, scene, i, canonical, ensureVoiceN
|
|
|
9783
10105
|
i,
|
|
9784
10106
|
usedVoIds,
|
|
9785
10107
|
nodes,
|
|
9786
|
-
out
|
|
10108
|
+
out,
|
|
10109
|
+
languageCode
|
|
9787
10110
|
);
|
|
9788
10111
|
}
|
|
9789
10112
|
}
|
|
@@ -9830,7 +10153,7 @@ function emitBrollScene(scene, i, isLast, env, nodes, out, prevEndFrame) {
|
|
|
9830
10153
|
{ first, last },
|
|
9831
10154
|
{ dur: lengths.dur, trimTarget: lengths.trimTarget, genDur: lengths.genDur },
|
|
9832
10155
|
lengths.out,
|
|
9833
|
-
{ ar: env.ar, videoModel: env.opts.videoModel },
|
|
10156
|
+
{ ar: env.ar, videoModel: env.opts.videoModel, resolution: env.opts.resolution, nativeLang: env.ttsLanguageCode },
|
|
9834
10157
|
nodes
|
|
9835
10158
|
);
|
|
9836
10159
|
if (ambientBroll) {
|
|
@@ -9866,7 +10189,8 @@ function buildTimeline(blueprint, slots, opts, nodes) {
|
|
|
9866
10189
|
reuse,
|
|
9867
10190
|
cameraOn: onCameraDialogue(blueprint),
|
|
9868
10191
|
casts: castIdSet(blueprint),
|
|
9869
|
-
ingestCache: /* @__PURE__ */ new Map()
|
|
10192
|
+
ingestCache: /* @__PURE__ */ new Map(),
|
|
10193
|
+
ttsLanguageCode: deriveTtsLanguageCode(blueprint)
|
|
9870
10194
|
};
|
|
9871
10195
|
const out = {
|
|
9872
10196
|
clips: [],
|
|
@@ -9877,7 +10201,8 @@ function buildTimeline(blueprint, slots, opts, nodes) {
|
|
|
9877
10201
|
sceneSlice: /* @__PURE__ */ new Map()
|
|
9878
10202
|
};
|
|
9879
10203
|
const presenterPresent = makePresenterPresent(slots, canonical);
|
|
9880
|
-
const
|
|
10204
|
+
const presentStrict = makePresenterPresent(slots, canonical, { strict: true });
|
|
10205
|
+
const phrases = buildPhrases(blueprint, canonical, compositeScenes, presenterPresent, presentStrict);
|
|
9881
10206
|
const usedVoIds = /* @__PURE__ */ new Set();
|
|
9882
10207
|
const claimed = /* @__PURE__ */ new Set();
|
|
9883
10208
|
phrases.forEach((phrase, k) => {
|
|
@@ -9887,7 +10212,7 @@ function buildTimeline(blueprint, slots, opts, nodes) {
|
|
|
9887
10212
|
for (const s of available) claimed.add(s);
|
|
9888
10213
|
emitPhraseClip({ ...phrase, shownScenes: available }, voiceNode, env, nodes, out);
|
|
9889
10214
|
} else {
|
|
9890
|
-
emitPhraseTts(phrase, voiceNode, k, usedVoIds, nodes, out);
|
|
10215
|
+
emitPhraseTts(phrase, voiceNode, k, usedVoIds, nodes, out, env.ttsLanguageCode);
|
|
9891
10216
|
}
|
|
9892
10217
|
});
|
|
9893
10218
|
const lastIndex = blueprint.scenes.length - 1;
|
|
@@ -10224,7 +10549,7 @@ function scaffoldVideoCanvas(input, elementsInput, opts) {
|
|
|
10224
10549
|
params: { source: "path", path: todoPath2(elements[i], slot.label), expect: "image" }
|
|
10225
10550
|
});
|
|
10226
10551
|
});
|
|
10227
|
-
|
|
10552
|
+
buildElementSheets(slots, nodes);
|
|
10228
10553
|
const { clips, voTracks, vo_segments, talking_scenes } = buildTimeline(blueprint, slots, opts, nodes);
|
|
10229
10554
|
let videoRef = buildSpine(clips, nodes);
|
|
10230
10555
|
let videoNode = "spine";
|
|
@@ -10241,22 +10566,8 @@ function scaffoldVideoCanvas(input, elementsInput, opts) {
|
|
|
10241
10566
|
videoRef = "$ref:overlaid.video";
|
|
10242
10567
|
videoNode = "overlaid";
|
|
10243
10568
|
}
|
|
10244
|
-
if (opts.captionsCompositionPath && opts.transcriptPath) {
|
|
10245
|
-
nodes.push({
|
|
10246
|
-
id: "captions_transcript",
|
|
10247
|
-
type: "ingest",
|
|
10248
|
-
params: { source: "path", path: opts.transcriptPath, expect: "json" }
|
|
10249
|
-
});
|
|
10250
|
-
nodes.push({
|
|
10251
|
-
id: "captions",
|
|
10252
|
-
type: "hyperframe_render",
|
|
10253
|
-
inputs: { background: videoRef, transcript: "$ref:captions_transcript.asset" },
|
|
10254
|
-
params: { composition: opts.captionsCompositionPath }
|
|
10255
|
-
});
|
|
10256
|
-
videoRef = "$ref:captions.video";
|
|
10257
|
-
videoNode = "captions";
|
|
10258
|
-
}
|
|
10259
10569
|
const tracks = [...voTracks, ...buildSfxMusic(blueprint, nodes)];
|
|
10570
|
+
let audioMixRef;
|
|
10260
10571
|
if (tracks.length > 0) {
|
|
10261
10572
|
const mixInputs = {};
|
|
10262
10573
|
for (const t of tracks) mixInputs[t.slot] = t.ref;
|
|
@@ -10277,10 +10588,54 @@ function scaffoldVideoCanvas(input, elementsInput, opts) {
|
|
|
10277
10588
|
...duck
|
|
10278
10589
|
}
|
|
10279
10590
|
});
|
|
10591
|
+
audioMixRef = "$ref:audio_mix.audio";
|
|
10592
|
+
}
|
|
10593
|
+
if (opts.captionsCompositionPath && audioMixRef) {
|
|
10594
|
+
nodes.push({
|
|
10595
|
+
id: "captions_premux",
|
|
10596
|
+
type: "ffmpeg",
|
|
10597
|
+
inputs: { video: videoRef, audio: audioMixRef },
|
|
10598
|
+
params: {
|
|
10599
|
+
args: [
|
|
10600
|
+
"-i",
|
|
10601
|
+
"{{in.video}}",
|
|
10602
|
+
"-i",
|
|
10603
|
+
"{{in.audio}}",
|
|
10604
|
+
"-map",
|
|
10605
|
+
"0:v:0",
|
|
10606
|
+
"-map",
|
|
10607
|
+
"1:a:0",
|
|
10608
|
+
"-c:v",
|
|
10609
|
+
"copy",
|
|
10610
|
+
"-c:a",
|
|
10611
|
+
"aac",
|
|
10612
|
+
"-shortest",
|
|
10613
|
+
"{{out.video}}"
|
|
10614
|
+
],
|
|
10615
|
+
outputs: { video: { kind: "video", ext: "mp4" } }
|
|
10616
|
+
}
|
|
10617
|
+
});
|
|
10618
|
+
const captionLanguage = deriveTtsLanguageCode(blueprint);
|
|
10619
|
+
nodes.push({
|
|
10620
|
+
id: "captions_transcribe",
|
|
10621
|
+
type: "video_transcribe",
|
|
10622
|
+
inputs: { video: "$ref:captions_premux.video" },
|
|
10623
|
+
params: captionLanguage ? { language: captionLanguage } : {}
|
|
10624
|
+
});
|
|
10625
|
+
nodes.push({
|
|
10626
|
+
id: "captions",
|
|
10627
|
+
type: "hyperframe_render",
|
|
10628
|
+
inputs: { background: videoRef, transcript: "$ref:captions_transcribe.transcript" },
|
|
10629
|
+
params: { composition: opts.captionsCompositionPath }
|
|
10630
|
+
});
|
|
10631
|
+
videoRef = "$ref:captions.video";
|
|
10632
|
+
videoNode = "captions";
|
|
10633
|
+
}
|
|
10634
|
+
if (audioMixRef) {
|
|
10280
10635
|
nodes.push({
|
|
10281
10636
|
id: "final",
|
|
10282
10637
|
type: "ffmpeg",
|
|
10283
|
-
inputs: { video: videoRef, audio:
|
|
10638
|
+
inputs: { video: videoRef, audio: audioMixRef },
|
|
10284
10639
|
params: {
|
|
10285
10640
|
args: [
|
|
10286
10641
|
"-i",
|
|
@@ -10333,9 +10688,27 @@ function buildVideoMeta(blueprint, meta) {
|
|
|
10333
10688
|
duration_s: blueprint.source?.duration_s ?? lastSceneEnd(blueprint),
|
|
10334
10689
|
vo_segments: [...meta.vo_segments].sort((a, b) => a.start_s - b.start_s),
|
|
10335
10690
|
talking_scenes: meta.talking_scenes,
|
|
10691
|
+
lip_sync_caution: buildLipSyncCaution(meta.vo_segments),
|
|
10336
10692
|
motion_board: buildMotionBoard(blueprint)
|
|
10337
10693
|
};
|
|
10338
10694
|
}
|
|
10695
|
+
function buildLipSyncCaution(segments) {
|
|
10696
|
+
const out = [];
|
|
10697
|
+
const byScene = /* @__PURE__ */ new Map();
|
|
10698
|
+
for (const s of segments) {
|
|
10699
|
+
const arr = byScene.get(s.scene) ?? [];
|
|
10700
|
+
arr.push(s);
|
|
10701
|
+
byScene.set(s.scene, arr);
|
|
10702
|
+
}
|
|
10703
|
+
for (const [scene, segs] of [...byScene.entries()].sort((a, b) => a[0] - b[0])) {
|
|
10704
|
+
const nativeSpeakers = new Set(segs.filter((s) => s.slot.endsWith("_conv")).map((s) => s.speaker));
|
|
10705
|
+
for (const speaker of nativeSpeakers) {
|
|
10706
|
+
const ttsOver = segs.filter((s) => !s.slot.endsWith("_conv") && s.speaker === speaker).map((s) => s.slot);
|
|
10707
|
+
if (ttsOver.length > 0) out.push({ scene, speaker, tts_over_native: ttsOver });
|
|
10708
|
+
}
|
|
10709
|
+
}
|
|
10710
|
+
return out;
|
|
10711
|
+
}
|
|
10339
10712
|
function sceneSpokenText(scene) {
|
|
10340
10713
|
return (scene.dialogue ?? []).map((d) => d.line?.trim()).filter((l) => Boolean(l)).join(" ") || null;
|
|
10341
10714
|
}
|
|
@@ -10504,14 +10877,36 @@ function buildVideoTodo(report, overlayCount, floatingCount, opts, blueprint) {
|
|
|
10504
10877
|
// "none detected" — re-watch the reference and fill the gaps with the right tool.
|
|
10505
10878
|
completeness_check: 'The scaffold mirrors the deconstruct\'s catalog, which UNDER-DETECTS \u2014 never trust a 0 count. Re-watch the reference frame-by-frame and add anything missing: (1) ON-IMAGE GRAPHICS not in floating_elements (dollar/coin icons, emojis, checkmarks, rating stars, price tags, arrows, progress bars, app UI) \u2192 source each with `baker images icon "<desc>"` / `baker images sticker` / `baker images gif` / `baker images logo <domain>` and add it as an <img class="ov pos-* " data-start data-dur> in video-overlay-composition/index.html (NEVER bake graphics into the frame plates). (2) SOUND CUES not in sound_effects (cha-ching/coin, whoosh, ding, pop, notification, keyboard) \u2192 add a `sound_effect` node (eleven_text_to_sound) and wire it onto `audio_mix` at its timestamp. (3) RECURRING people/animals/products/logos/sets with no el_* slot \u2192 add an `ingest` [TODO] slot and reference it from the frames they appear in. (4) Burned-in captions/text not in text_overlays \u2192 add an <img>-free <div class="ov"> in index.html. (5) ONE person playing MULTIPLE personas/wardrobes (skeptic vs believer, before vs after, two outfits) collapsed into a single el_* slot \u2192 split into one el_* slot PER look, each linked as the SAME individual via `same_as` so every outfit has its own reference image but the face/identity stays identical.',
|
|
10506
10879
|
scenes_clamped_to_15s: report.clamped_scenes,
|
|
10880
|
+
oversize_scenes: report.oversize_scenes.length > 0 ? {
|
|
10881
|
+
scenes: report.oversize_scenes,
|
|
10882
|
+
fix: "Each listed scene's own footage is longer than the gateway-safe ~10s clip ceiling, so its clip will fail the gateway (HTTP 524) \u2014 and the scaffold can't auto-split a single scene. Split each into two scenes in prompt.json (scene N+1's start frame = scene N's end frame, so the action stays continuous) before rendering."
|
|
10883
|
+
} : "none \u2014 every scene fits within the gateway-safe clip ceiling.",
|
|
10884
|
+
overstuffed_scenes: report.overstuffed_scenes.length > 0 ? {
|
|
10885
|
+
scenes: report.overstuffed_scenes,
|
|
10886
|
+
fix: "Each listed scene's estimated speech runs well past its window \u2014 the line will overrun the scene and push the picture off the audio timeline (lips fall behind). Shorten the copy in prompt.json or lengthen the scene before rendering."
|
|
10887
|
+
} : "none \u2014 every scene's spoken length fits its window.",
|
|
10507
10888
|
run_warning: "`baker canvas run` generates many billed image/video/audio assets \u2014 validate first, it is not free."
|
|
10508
10889
|
};
|
|
10509
10890
|
}
|
|
10891
|
+
var OVERSTUFF_RATIO = 1.3;
|
|
10892
|
+
function collectClipAdvisories(scene, i, out) {
|
|
10893
|
+
const round22 = (n) => Math.round(n * 100) / 100;
|
|
10894
|
+
const original = scene.duration_s ?? 5;
|
|
10895
|
+
if (original > 15) out.clamped.push({ scene: i, original_s: original, clip_s: snapToSeedance(original) });
|
|
10896
|
+
const window = sceneDurationS(scene);
|
|
10897
|
+
if (window > SEEDANCE_SAFE_MAX_S)
|
|
10898
|
+
out.oversize.push({ scene: i, scene_s: round22(window), clip_s: ceilToSeedance(window) });
|
|
10899
|
+
const speech = (scene.dialogue ?? []).reduce((s, line) => s + (line.line ? estSpeechS(line.line) : 0), 0);
|
|
10900
|
+
if (speech > window * OVERSTUFF_RATIO)
|
|
10901
|
+
out.overstuffed.push({ scene: i, scene_s: round22(window), est_speech_s: round22(speech) });
|
|
10902
|
+
}
|
|
10510
10903
|
function videoReport(input, elementsInput) {
|
|
10511
10904
|
const blueprint = VideoBlueprint.parse(input);
|
|
10512
10905
|
const elements = RecurringElements.parse(elementsInput);
|
|
10513
10906
|
const dialogue = [];
|
|
10514
10907
|
const clamped = [];
|
|
10908
|
+
const oversize = [];
|
|
10909
|
+
const overstuffed = [];
|
|
10515
10910
|
let sfxCount = 0;
|
|
10516
10911
|
let overlayCount = 0;
|
|
10517
10912
|
blueprint.scenes.forEach((scene, i) => {
|
|
@@ -10527,9 +10922,7 @@ function videoReport(input, elementsInput) {
|
|
|
10527
10922
|
}
|
|
10528
10923
|
sfxCount += (scene.sfx ?? []).length;
|
|
10529
10924
|
overlayCount += (scene.overlays ?? []).length;
|
|
10530
|
-
|
|
10531
|
-
const clip = snapToSeedance(original);
|
|
10532
|
-
if (original > 15) clamped.push({ scene: i, original_s: original, clip_s: clip });
|
|
10925
|
+
collectClipAdvisories(scene, i, { clamped, oversize, overstuffed });
|
|
10533
10926
|
});
|
|
10534
10927
|
return {
|
|
10535
10928
|
scene_count: blueprint.scenes.length,
|
|
@@ -10544,6 +10937,8 @@ function videoReport(input, elementsInput) {
|
|
|
10544
10937
|
sfx_count: sfxCount,
|
|
10545
10938
|
overlay_count: overlayCount,
|
|
10546
10939
|
clamped_scenes: clamped,
|
|
10940
|
+
oversize_scenes: oversize,
|
|
10941
|
+
overstuffed_scenes: overstuffed,
|
|
10547
10942
|
has_music: Boolean(blueprint.global?.music?.music_prompt)
|
|
10548
10943
|
};
|
|
10549
10944
|
}
|
|
@@ -10609,12 +11004,9 @@ async function loadTranscriptBestEffort(ref) {
|
|
|
10609
11004
|
async function stageCaptions(outDir, transcript) {
|
|
10610
11005
|
const text = transcript?.trim();
|
|
10611
11006
|
if (!text || text === "[]") return {};
|
|
10612
|
-
const transcriptPath = path5.join(outDir, "transcript.json");
|
|
10613
|
-
await writeFile2(transcriptPath, `${text}
|
|
10614
|
-
`, "utf8");
|
|
10615
11007
|
const compositionPath = path5.join(outDir, "tiktok-captions-composition");
|
|
10616
11008
|
await cp(SHIPPED_CAPTIONS_DIR, compositionPath, { recursive: true });
|
|
10617
|
-
return { compositionPath
|
|
11009
|
+
return { compositionPath };
|
|
10618
11010
|
}
|
|
10619
11011
|
function parseElements2(raw) {
|
|
10620
11012
|
const parsed = JSON.parse(raw);
|
|
@@ -10744,7 +11136,7 @@ async function runAnalysisPasses(deconstructCanvas, selectModel) {
|
|
|
10744
11136
|
return fail2("deconstruct", e instanceof Error ? e.message : String(e));
|
|
10745
11137
|
}
|
|
10746
11138
|
}
|
|
10747
|
-
var scaffoldVideoCommand =
|
|
11139
|
+
var scaffoldVideoCommand = defineCommand78({
|
|
10748
11140
|
meta: {
|
|
10749
11141
|
name: "scaffold-video",
|
|
10750
11142
|
description: "Turn a reference video into a runnable reproduction canvas in one command. Runs billed passes \u2014 video_deconstruct (the full scene-by-scene blueprint + transcript, baked to prompt.json as the editable 'prompt') and an AI selection of the video's RECURRING identity elements (person/animal/product/logo) \u2014 then scaffolds a pipeline where every scene boundary is a static-ad-grade frame (the blueprint as target_blueprint, a reference legend, the real frame as anchor) and each recurring element gets ONE shared [TODO] ingest slot wired into every frame it appears in. The clips feed Seedance an ultra-detailed motion brief (action, camera, dialogue, transcript). Edit prompt.json, drop the real source images, then `baker canvas run`."
|
|
@@ -10767,7 +11159,11 @@ var scaffoldVideoCommand = defineCommand76({
|
|
|
10767
11159
|
"deconstruct-model": { type: "string", description: "Override the video_deconstruct model id" },
|
|
10768
11160
|
"select-model": { type: "string", description: "Override the text_generate model id for element selection" },
|
|
10769
11161
|
"image-model": { type: "string", description: "Override the image_generate model id for frames" },
|
|
10770
|
-
"video-model": { type: "string", description: "Override the video_generate model id for clips" }
|
|
11162
|
+
"video-model": { type: "string", description: "Override the video_generate model id for clips" },
|
|
11163
|
+
resolution: {
|
|
11164
|
+
type: "string",
|
|
11165
|
+
description: `Output resolution for generated clips (e.g. "1080p"). Default 1080p \u2014 the highest the video model supports \u2014 so clips keep the keyframe sharpness instead of the model's low default.`
|
|
11166
|
+
}
|
|
10771
11167
|
},
|
|
10772
11168
|
async run({ args }) {
|
|
10773
11169
|
const videoPath = path5.resolve(String(args.file));
|
|
@@ -10816,10 +11212,10 @@ var scaffoldVideoCommand = defineCommand76({
|
|
|
10816
11212
|
videoModel,
|
|
10817
11213
|
overlayCompositionPath: compositionDest,
|
|
10818
11214
|
captionsCompositionPath: captions.compositionPath,
|
|
10819
|
-
transcriptPath: captions.transcriptPath,
|
|
10820
11215
|
blueprintPath,
|
|
10821
11216
|
frames,
|
|
10822
|
-
ambient: Boolean(args.ambient)
|
|
11217
|
+
ambient: Boolean(args.ambient),
|
|
11218
|
+
...args.resolution ? { resolution: String(args.resolution) } : {}
|
|
10823
11219
|
};
|
|
10824
11220
|
let canvas;
|
|
10825
11221
|
let report;
|
|
@@ -10868,6 +11264,8 @@ var scaffoldVideoCommand = defineCommand76({
|
|
|
10868
11264
|
overlay_count: report.overlay_count,
|
|
10869
11265
|
has_music: report.has_music,
|
|
10870
11266
|
scenes_clamped_to_15s: report.clamped_scenes,
|
|
11267
|
+
oversize_scenes: report.oversize_scenes,
|
|
11268
|
+
overstuffed_scenes: report.overstuffed_scenes,
|
|
10871
11269
|
note: "Drop ONE real source image at each el_* [TODO] (reused across every frame that element appears in), confirm each voice_select casting, then `baker canvas validate` and `baker canvas run`. Running generates many billed image/video/audio assets \u2014 it is not free."
|
|
10872
11270
|
}
|
|
10873
11271
|
},
|
|
@@ -10882,8 +11280,8 @@ var scaffoldVideoCommand = defineCommand76({
|
|
|
10882
11280
|
// src/commands/canvas/validate.ts
|
|
10883
11281
|
import { readFile as readFile6 } from "fs/promises";
|
|
10884
11282
|
import path6 from "path";
|
|
10885
|
-
import { defineCommand as
|
|
10886
|
-
var validateCommand =
|
|
11283
|
+
import { defineCommand as defineCommand79 } from "citty";
|
|
11284
|
+
var validateCommand = defineCommand79({
|
|
10887
11285
|
meta: {
|
|
10888
11286
|
name: "validate",
|
|
10889
11287
|
description: "Validate a canvas JSON file (no execution). Includes a per-node cost preview and runs each node's deep validators (composition meta checks for hyperframe_render/_snapshot)."
|
|
@@ -10925,7 +11323,7 @@ var validateCommand = defineCommand77({
|
|
|
10925
11323
|
});
|
|
10926
11324
|
|
|
10927
11325
|
// src/commands/canvas/index.ts
|
|
10928
|
-
var canvasCommand =
|
|
11326
|
+
var canvasCommand = defineCommand80({
|
|
10929
11327
|
meta: {
|
|
10930
11328
|
name: "canvas",
|
|
10931
11329
|
description: `Run Baker creative canvas JSON files locally. Local nodes execute in-process; remote nodes POST to the Convex backend gateway.
|
|
@@ -10951,10 +11349,10 @@ Subcommands:
|
|
|
10951
11349
|
});
|
|
10952
11350
|
|
|
10953
11351
|
// src/commands/ga4/index.ts
|
|
10954
|
-
import { defineCommand as
|
|
11352
|
+
import { defineCommand as defineCommand84 } from "citty";
|
|
10955
11353
|
|
|
10956
11354
|
// src/commands/ga4/audit.ts
|
|
10957
|
-
import { defineCommand as
|
|
11355
|
+
import { defineCommand as defineCommand81 } from "citty";
|
|
10958
11356
|
|
|
10959
11357
|
// src/commands/ga4/resolve.ts
|
|
10960
11358
|
async function fetchProperties(useCache = true) {
|
|
@@ -11017,7 +11415,7 @@ registerSchema({
|
|
|
11017
11415
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
11018
11416
|
}
|
|
11019
11417
|
});
|
|
11020
|
-
var auditCommand2 =
|
|
11418
|
+
var auditCommand2 = defineCommand81({
|
|
11021
11419
|
meta: {
|
|
11022
11420
|
name: "audit",
|
|
11023
11421
|
description: `Run all GA4 admin health checks. Returns property config with playbook warnings.
|
|
@@ -11069,7 +11467,7 @@ Examples:
|
|
|
11069
11467
|
});
|
|
11070
11468
|
|
|
11071
11469
|
// src/commands/ga4/properties.ts
|
|
11072
|
-
import { defineCommand as
|
|
11470
|
+
import { defineCommand as defineCommand82 } from "citty";
|
|
11073
11471
|
registerSchema({
|
|
11074
11472
|
command: "ga4.properties",
|
|
11075
11473
|
description: "List all accessible GA4 properties. Returns property IDs needed for query and audit commands. Run this first to find property IDs.",
|
|
@@ -11077,7 +11475,7 @@ registerSchema({
|
|
|
11077
11475
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
11078
11476
|
}
|
|
11079
11477
|
});
|
|
11080
|
-
var propertiesCommand =
|
|
11478
|
+
var propertiesCommand = defineCommand82({
|
|
11081
11479
|
meta: {
|
|
11082
11480
|
name: "properties",
|
|
11083
11481
|
description: `List accessible GA4 properties.
|
|
@@ -11127,7 +11525,7 @@ Examples:
|
|
|
11127
11525
|
// src/commands/ga4/query.ts
|
|
11128
11526
|
import { appendFileSync as appendFileSync2, existsSync as existsSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
|
|
11129
11527
|
import { resolve as resolve2 } from "path";
|
|
11130
|
-
import { defineCommand as
|
|
11528
|
+
import { defineCommand as defineCommand83 } from "citty";
|
|
11131
11529
|
|
|
11132
11530
|
// src/commands/ga4/presets.ts
|
|
11133
11531
|
var GA4_PRESETS = [
|
|
@@ -11259,7 +11657,7 @@ function handleError(err) {
|
|
|
11259
11657
|
});
|
|
11260
11658
|
process.exit(1);
|
|
11261
11659
|
}
|
|
11262
|
-
var queryCommand2 =
|
|
11660
|
+
var queryCommand2 = defineCommand83({
|
|
11263
11661
|
meta: {
|
|
11264
11662
|
name: "query",
|
|
11265
11663
|
description: `Run GA4 Data API reports. Preset-first with free-form escape hatch.
|
|
@@ -11330,7 +11728,7 @@ Free-form (escape hatch):
|
|
|
11330
11728
|
});
|
|
11331
11729
|
|
|
11332
11730
|
// src/commands/ga4/index.ts
|
|
11333
|
-
var ga4Command =
|
|
11731
|
+
var ga4Command = defineCommand84({
|
|
11334
11732
|
meta: {
|
|
11335
11733
|
name: "ga4",
|
|
11336
11734
|
description: `Google Analytics 4 commands. Audit property config, run playbook-aligned reports.
|
|
@@ -11353,12 +11751,12 @@ Examples:
|
|
|
11353
11751
|
});
|
|
11354
11752
|
|
|
11355
11753
|
// src/commands/gsc/index.ts
|
|
11356
|
-
import { defineCommand as
|
|
11754
|
+
import { defineCommand as defineCommand88 } from "citty";
|
|
11357
11755
|
|
|
11358
11756
|
// src/commands/gsc/query.ts
|
|
11359
11757
|
import { appendFileSync as appendFileSync3, existsSync as existsSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
|
|
11360
11758
|
import { resolve as resolve3 } from "path";
|
|
11361
|
-
import { defineCommand as
|
|
11759
|
+
import { defineCommand as defineCommand85 } from "citty";
|
|
11362
11760
|
|
|
11363
11761
|
// src/commands/gsc/presets.ts
|
|
11364
11762
|
var GSC_PRESETS = [
|
|
@@ -11546,7 +11944,7 @@ function handleError2(err) {
|
|
|
11546
11944
|
});
|
|
11547
11945
|
process.exit(1);
|
|
11548
11946
|
}
|
|
11549
|
-
var queryCommand3 =
|
|
11947
|
+
var queryCommand3 = defineCommand85({
|
|
11550
11948
|
meta: {
|
|
11551
11949
|
name: "query",
|
|
11552
11950
|
description: `Run GSC Search Analytics queries. Preset-first with free-form escape hatch.
|
|
@@ -11624,7 +12022,7 @@ Free-form (escape hatch):
|
|
|
11624
12022
|
});
|
|
11625
12023
|
|
|
11626
12024
|
// src/commands/gsc/sitemaps.ts
|
|
11627
|
-
import { defineCommand as
|
|
12025
|
+
import { defineCommand as defineCommand86 } from "citty";
|
|
11628
12026
|
registerSchema({
|
|
11629
12027
|
command: "gsc.sitemaps",
|
|
11630
12028
|
description: "List sitemaps for a Search Console site. Check sitemap health and errors.",
|
|
@@ -11633,7 +12031,7 @@ registerSchema({
|
|
|
11633
12031
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
11634
12032
|
}
|
|
11635
12033
|
});
|
|
11636
|
-
var sitemapsCommand =
|
|
12034
|
+
var sitemapsCommand = defineCommand86({
|
|
11637
12035
|
meta: {
|
|
11638
12036
|
name: "sitemaps",
|
|
11639
12037
|
description: `List sitemaps for a site. Check health and errors.
|
|
@@ -11683,7 +12081,7 @@ Examples:
|
|
|
11683
12081
|
});
|
|
11684
12082
|
|
|
11685
12083
|
// src/commands/gsc/sites.ts
|
|
11686
|
-
import { defineCommand as
|
|
12084
|
+
import { defineCommand as defineCommand87 } from "citty";
|
|
11687
12085
|
registerSchema({
|
|
11688
12086
|
command: "gsc.sites",
|
|
11689
12087
|
description: "List all verified Google Search Console sites. Returns site URLs needed for query and sitemaps commands.",
|
|
@@ -11691,7 +12089,7 @@ registerSchema({
|
|
|
11691
12089
|
"no-cache": { type: "boolean", description: "Skip cache, hit API directly", required: false }
|
|
11692
12090
|
}
|
|
11693
12091
|
});
|
|
11694
|
-
var sitesCommand =
|
|
12092
|
+
var sitesCommand = defineCommand87({
|
|
11695
12093
|
meta: {
|
|
11696
12094
|
name: "sites",
|
|
11697
12095
|
description: `List verified Search Console sites.
|
|
@@ -11739,7 +12137,7 @@ Examples:
|
|
|
11739
12137
|
});
|
|
11740
12138
|
|
|
11741
12139
|
// src/commands/gsc/index.ts
|
|
11742
|
-
var gscCommand =
|
|
12140
|
+
var gscCommand = defineCommand88({
|
|
11743
12141
|
meta: {
|
|
11744
12142
|
name: "gsc",
|
|
11745
12143
|
description: `Google Search Console commands. PPC-SEO arbitrage, brand halo analysis, negative keyword discovery.
|
|
@@ -11762,10 +12160,10 @@ Examples:
|
|
|
11762
12160
|
});
|
|
11763
12161
|
|
|
11764
12162
|
// src/commands/images/index.ts
|
|
11765
|
-
import { defineCommand as
|
|
12163
|
+
import { defineCommand as defineCommand111 } from "citty";
|
|
11766
12164
|
|
|
11767
12165
|
// src/commands/images/crop.ts
|
|
11768
|
-
import { defineCommand as
|
|
12166
|
+
import { defineCommand as defineCommand89 } from "citty";
|
|
11769
12167
|
|
|
11770
12168
|
// src/lib/image/crop-sprite.ts
|
|
11771
12169
|
import sharp from "sharp";
|
|
@@ -11890,7 +12288,7 @@ function emitError2(err) {
|
|
|
11890
12288
|
}
|
|
11891
12289
|
process.exit(1);
|
|
11892
12290
|
}
|
|
11893
|
-
var cropCommand =
|
|
12291
|
+
var cropCommand = defineCommand89({
|
|
11894
12292
|
meta: {
|
|
11895
12293
|
name: "crop",
|
|
11896
12294
|
description: "Crop a rectangular region from an image.\n\nExample: baker images crop sprite.png --x 0 --y 0 --width 64 --height 64 --output icon.png"
|
|
@@ -11926,7 +12324,7 @@ var cropCommand = defineCommand87({
|
|
|
11926
12324
|
});
|
|
11927
12325
|
|
|
11928
12326
|
// src/commands/images/delete.ts
|
|
11929
|
-
import { defineCommand as
|
|
12327
|
+
import { defineCommand as defineCommand90 } from "citty";
|
|
11930
12328
|
registerSchema({
|
|
11931
12329
|
command: "images.delete",
|
|
11932
12330
|
description: "Delete an image by ID",
|
|
@@ -11940,7 +12338,7 @@ registerSchema({
|
|
|
11940
12338
|
}
|
|
11941
12339
|
}
|
|
11942
12340
|
});
|
|
11943
|
-
var deleteCommand =
|
|
12341
|
+
var deleteCommand = defineCommand90({
|
|
11944
12342
|
meta: {
|
|
11945
12343
|
name: "delete",
|
|
11946
12344
|
description: "Delete an image by ID. Use --dry-run to preview. Example: baker images delete j571abc123 --dry-run"
|
|
@@ -11981,7 +12379,7 @@ var deleteCommand = defineCommand88({
|
|
|
11981
12379
|
});
|
|
11982
12380
|
|
|
11983
12381
|
// src/commands/images/dimensions.ts
|
|
11984
|
-
import { defineCommand as
|
|
12382
|
+
import { defineCommand as defineCommand91 } from "citty";
|
|
11985
12383
|
|
|
11986
12384
|
// src/lib/image/dimensions.ts
|
|
11987
12385
|
import { imageSize } from "image-size";
|
|
@@ -12004,7 +12402,7 @@ registerSchema({
|
|
|
12004
12402
|
target: { type: "string", description: "Local file path or remote http(s) URL", required: true }
|
|
12005
12403
|
}
|
|
12006
12404
|
});
|
|
12007
|
-
var dimensionsCommand =
|
|
12405
|
+
var dimensionsCommand = defineCommand91({
|
|
12008
12406
|
meta: {
|
|
12009
12407
|
name: "dimensions",
|
|
12010
12408
|
description: "Read image dimensions without decoding the full file.\n\nExample: baker images dimensions ./logo.png\nExample: baker images dimensions https://acme.com/hero.png"
|
|
@@ -12048,7 +12446,7 @@ var dimensionsCommand = defineCommand89({
|
|
|
12048
12446
|
});
|
|
12049
12447
|
|
|
12050
12448
|
// src/commands/images/extract.ts
|
|
12051
|
-
import { defineCommand as
|
|
12449
|
+
import { defineCommand as defineCommand92 } from "citty";
|
|
12052
12450
|
registerSchema({
|
|
12053
12451
|
command: "images.extract",
|
|
12054
12452
|
description: "Extract images from a URL via Firecrawl (formats: images).",
|
|
@@ -12064,7 +12462,7 @@ registerSchema({
|
|
|
12064
12462
|
}
|
|
12065
12463
|
}
|
|
12066
12464
|
});
|
|
12067
|
-
var extractCommand =
|
|
12465
|
+
var extractCommand = defineCommand92({
|
|
12068
12466
|
meta: {
|
|
12069
12467
|
name: "extract",
|
|
12070
12468
|
description: "Pull every image from a single URL via Firecrawl. ~$0.001/scrape. Cap auto-ingest at 20.\n\nExample: baker images extract https://stripe.com --auto-ingest 5"
|
|
@@ -12102,7 +12500,7 @@ var extractCommand = defineCommand90({
|
|
|
12102
12500
|
});
|
|
12103
12501
|
|
|
12104
12502
|
// src/commands/images/find.ts
|
|
12105
|
-
import { defineCommand as
|
|
12503
|
+
import { defineCommand as defineCommand93 } from "citty";
|
|
12106
12504
|
registerSchema({
|
|
12107
12505
|
command: "images.find",
|
|
12108
12506
|
description: "Fanout image search: library first, then opted-in external providers.",
|
|
@@ -12134,7 +12532,7 @@ registerSchema({
|
|
|
12134
12532
|
}
|
|
12135
12533
|
}
|
|
12136
12534
|
});
|
|
12137
|
-
var findCommand =
|
|
12535
|
+
var findCommand = defineCommand93({
|
|
12138
12536
|
meta: {
|
|
12139
12537
|
name: "find",
|
|
12140
12538
|
description: "Library-first fanout image search. Opt in to providers with --sources. `--fallback` short-circuits to externals only when library is thin. With --auto-ingest, ingested external hits return Baker-owned URLs.\n\nExample: baker images find 'office' --sources library,magnific --limit 20"
|
|
@@ -12181,7 +12579,7 @@ var findCommand = defineCommand91({
|
|
|
12181
12579
|
|
|
12182
12580
|
// src/commands/images/generate.ts
|
|
12183
12581
|
import { readFile as readFile8 } from "fs/promises";
|
|
12184
|
-
import { defineCommand as
|
|
12582
|
+
import { defineCommand as defineCommand94 } from "citty";
|
|
12185
12583
|
import sharp2 from "sharp";
|
|
12186
12584
|
var GENERATE_TIMEOUT_MS = 18e4;
|
|
12187
12585
|
var REFERENCE_MAX_EDGE = 1536;
|
|
@@ -12277,7 +12675,7 @@ async function resolveReferences(spec) {
|
|
|
12277
12675
|
}
|
|
12278
12676
|
return out;
|
|
12279
12677
|
}
|
|
12280
|
-
var generateCommand =
|
|
12678
|
+
var generateCommand = defineCommand94({
|
|
12281
12679
|
meta: {
|
|
12282
12680
|
name: "generate",
|
|
12283
12681
|
description: "Generate an image with AI and store it in the library (cost-tracked per request via OpenRouter usage). Models mirror the canvas: openai/gpt-5.4-image-2 (default \u2014 photoreal, cleanest text, best for ad/landing reproduction), google/gemini-3-pro-image-preview (Nano Banana Pro), google/gemini-3.5-flash & google/gemini-3.1-flash-image-preview (fast, extreme aspect ratios), recraft/recraft-v4.1-pro-vector (vector/SVG-style with palette control). The result is auto-ingested (describe + embed), so the next `baker images library` query finds it. Pass --reference with image URLs and/or local file paths (Pinterest, stock, brand assets, sandbox files) to ground generation in reality.\n\nExamples:\n baker images generate 'a friendly golden retriever sitting in a bright modern living room' --aspect-ratio 16:9\n baker images generate 'hero shot of a matte black water bottle on marble' --model google/gemini-3-pro-image-preview --image-size 2K\n baker images generate 'lifestyle photo matching this mood' --reference 'https://\u2026/ref1.jpg,https://\u2026/ref2.jpg'\n baker images generate 'put this product on a marble countertop, soft daylight' --reference './src/brand/logos/product.png,./refs/kitchen-mood.jpg'\n baker images generate 'flat geometric mascot, brand palette' --model recraft/recraft-v4.1-pro-vector --rgb-colors '[[10,10,10],[255,80,0]]'"
|
|
@@ -12329,7 +12727,7 @@ var generateCommand = defineCommand92({
|
|
|
12329
12727
|
});
|
|
12330
12728
|
|
|
12331
12729
|
// src/commands/images/get.ts
|
|
12332
|
-
import { defineCommand as
|
|
12730
|
+
import { defineCommand as defineCommand95 } from "citty";
|
|
12333
12731
|
registerSchema({
|
|
12334
12732
|
command: "images.get",
|
|
12335
12733
|
description: "Get a single image by ID",
|
|
@@ -12337,7 +12735,7 @@ registerSchema({
|
|
|
12337
12735
|
id: { type: "string", description: "Image ID", required: true }
|
|
12338
12736
|
}
|
|
12339
12737
|
});
|
|
12340
|
-
var getCommand2 =
|
|
12738
|
+
var getCommand2 = defineCommand95({
|
|
12341
12739
|
meta: { name: "get", description: "Get a single image by ID. Example: baker images get j571abc123" },
|
|
12342
12740
|
args: {
|
|
12343
12741
|
id: { type: "positional", description: "Image ID", required: false },
|
|
@@ -12373,7 +12771,7 @@ var getCommand2 = defineCommand93({
|
|
|
12373
12771
|
});
|
|
12374
12772
|
|
|
12375
12773
|
// src/commands/images/gif.ts
|
|
12376
|
-
import { defineCommand as
|
|
12774
|
+
import { defineCommand as defineCommand96 } from "citty";
|
|
12377
12775
|
registerSchema({
|
|
12378
12776
|
command: "images.gif",
|
|
12379
12777
|
description: "Search Giphy for GIFs / reaction memes (paid social creative).",
|
|
@@ -12405,7 +12803,7 @@ registerSchema({
|
|
|
12405
12803
|
}
|
|
12406
12804
|
}
|
|
12407
12805
|
});
|
|
12408
|
-
var gifCommand =
|
|
12806
|
+
var gifCommand = defineCommand96({
|
|
12409
12807
|
meta: {
|
|
12410
12808
|
name: "gif",
|
|
12411
12809
|
description: "Search Giphy for GIFs / reaction memes \u2014 built for paid-social creative (Meta, TikTok, LinkedIn, X). Free API. Each hit carries WebP + GIF + MP4 URLs in providerMeta so you can pick the right format per platform.\n\nExample: baker images gif 'this is fine' --limit 10\nExample: baker images gif 'office reaction' --rating pg --auto-ingest 2\nExample: baker images gif --trending --limit 25"
|
|
@@ -12452,7 +12850,7 @@ var gifCommand = defineCommand94({
|
|
|
12452
12850
|
});
|
|
12453
12851
|
|
|
12454
12852
|
// src/commands/images/google.ts
|
|
12455
|
-
import { defineCommand as
|
|
12853
|
+
import { defineCommand as defineCommand97 } from "citty";
|
|
12456
12854
|
registerSchema({
|
|
12457
12855
|
command: "images.google",
|
|
12458
12856
|
description: "Google Images search via the official Custom Search JSON API. Unverified source \u2014 inspect before placing.",
|
|
@@ -12488,7 +12886,7 @@ registerSchema({
|
|
|
12488
12886
|
}
|
|
12489
12887
|
}
|
|
12490
12888
|
});
|
|
12491
|
-
var googleCommand2 =
|
|
12889
|
+
var googleCommand2 = defineCommand97({
|
|
12492
12890
|
meta: {
|
|
12493
12891
|
name: "google",
|
|
12494
12892
|
description: "Google Images via the official Custom Search JSON API ($0.005/query, free 100/day). \u26A0 Source unverified \u2014 watermarks, low-res, mislabeled results are common. Use as last resort. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExample: baker images google 'industrial workshop' --type photo --size large --limit 20"
|
|
@@ -12536,7 +12934,7 @@ var googleCommand2 = defineCommand95({
|
|
|
12536
12934
|
});
|
|
12537
12935
|
|
|
12538
12936
|
// src/commands/images/icon.ts
|
|
12539
|
-
import { defineCommand as
|
|
12937
|
+
import { defineCommand as defineCommand98 } from "citty";
|
|
12540
12938
|
registerSchema({
|
|
12541
12939
|
command: "images.icon",
|
|
12542
12940
|
description: "Icon lookup via Iconify (200+ icon sets, free CDN).",
|
|
@@ -12562,7 +12960,7 @@ registerSchema({
|
|
|
12562
12960
|
}
|
|
12563
12961
|
}
|
|
12564
12962
|
});
|
|
12565
|
-
var iconCommand =
|
|
12963
|
+
var iconCommand = defineCommand98({
|
|
12566
12964
|
meta: {
|
|
12567
12965
|
name: "icon",
|
|
12568
12966
|
description: "Icon via Iconify (simple-icons, logos, lucide, devicon, heroicons, tabler, phosphor, material-symbols, \u2026). Free CDN, no API key.\n\nExample: baker images icon react --set devicon\nExample: baker images icon lucide:check --color '#0a0a0a'"
|
|
@@ -12602,7 +13000,7 @@ var iconCommand = defineCommand96({
|
|
|
12602
13000
|
});
|
|
12603
13001
|
|
|
12604
13002
|
// src/commands/images/ingest.ts
|
|
12605
|
-
import { defineCommand as
|
|
13003
|
+
import { defineCommand as defineCommand99 } from "citty";
|
|
12606
13004
|
registerSchema({
|
|
12607
13005
|
command: "images.ingest",
|
|
12608
13006
|
description: "Ingest a remote image URL into the library (full describe + embed).",
|
|
@@ -12614,7 +13012,7 @@ registerSchema({
|
|
|
12614
13012
|
context: { type: "string", description: "Description context hint", required: false }
|
|
12615
13013
|
}
|
|
12616
13014
|
});
|
|
12617
|
-
var ingestCommand =
|
|
13015
|
+
var ingestCommand = defineCommand99({
|
|
12618
13016
|
meta: {
|
|
12619
13017
|
name: "ingest",
|
|
12620
13018
|
description: "Download a remote URL and store it in the library. Hash-deduped on bytes + externalId.\n\nExample: baker images ingest https://img.freepik.com/free-photo/xyz.jpg --source magnific --external-id 12345"
|
|
@@ -12656,7 +13054,7 @@ var ingestCommand = defineCommand97({
|
|
|
12656
13054
|
});
|
|
12657
13055
|
|
|
12658
13056
|
// src/commands/images/library.ts
|
|
12659
|
-
import { defineCommand as
|
|
13057
|
+
import { defineCommand as defineCommand100 } from "citty";
|
|
12660
13058
|
registerSchema({
|
|
12661
13059
|
command: "images.library",
|
|
12662
13060
|
description: "Search the company image library. Returns only ready images.",
|
|
@@ -12682,7 +13080,7 @@ registerSchema({
|
|
|
12682
13080
|
}
|
|
12683
13081
|
}
|
|
12684
13082
|
});
|
|
12685
|
-
var libraryCommand =
|
|
13083
|
+
var libraryCommand = defineCommand100({
|
|
12686
13084
|
meta: {
|
|
12687
13085
|
name: "library",
|
|
12688
13086
|
description: "Search the company image library (hybrid BM25 + vector + Cohere rerank). Use this BEFORE any external provider.\n\nExample: baker images library 'hero banner' --aspect-ratio 16:9 --source magnific"
|
|
@@ -12739,7 +13137,7 @@ var libraryCommand = defineCommand98({
|
|
|
12739
13137
|
});
|
|
12740
13138
|
|
|
12741
13139
|
// src/commands/images/logo.ts
|
|
12742
|
-
import { defineCommand as
|
|
13140
|
+
import { defineCommand as defineCommand101 } from "citty";
|
|
12743
13141
|
registerSchema({
|
|
12744
13142
|
command: "images.logo",
|
|
12745
13143
|
description: "Brand logo lookup via Brandfetch CDN (fallback/404). Auto-ingests by default.",
|
|
@@ -12764,7 +13162,7 @@ registerSchema({
|
|
|
12764
13162
|
}
|
|
12765
13163
|
}
|
|
12766
13164
|
});
|
|
12767
|
-
var logoCommand =
|
|
13165
|
+
var logoCommand = defineCommand101({
|
|
12768
13166
|
meta: {
|
|
12769
13167
|
name: "logo",
|
|
12770
13168
|
description: "Brand logo via Brandfetch CDN. Returns up to 5 variants (icon, light/dark logo, light/dark symbol). Auto-ingests the first variant.\n\nExample: baker images logo stripe.com --variant logo"
|
|
@@ -12802,7 +13200,7 @@ var logoCommand = defineCommand99({
|
|
|
12802
13200
|
});
|
|
12803
13201
|
|
|
12804
13202
|
// src/commands/images/normalize.ts
|
|
12805
|
-
import { defineCommand as
|
|
13203
|
+
import { defineCommand as defineCommand102 } from "citty";
|
|
12806
13204
|
|
|
12807
13205
|
// src/lib/image/color-changer.ts
|
|
12808
13206
|
import quantize from "quantize";
|
|
@@ -13534,7 +13932,7 @@ function coerceRawArgs(args) {
|
|
|
13534
13932
|
"dry-run": bool(args["dry-run"])
|
|
13535
13933
|
};
|
|
13536
13934
|
}
|
|
13537
|
-
var normalizeCommand =
|
|
13935
|
+
var normalizeCommand = defineCommand102({
|
|
13538
13936
|
meta: {
|
|
13539
13937
|
name: "normalize",
|
|
13540
13938
|
description: `Normalize logos / images: declarative recolor + bg removal + trim + resize. Operates on local files; writes in-place by default.
|
|
@@ -13589,7 +13987,7 @@ Examples:
|
|
|
13589
13987
|
});
|
|
13590
13988
|
|
|
13591
13989
|
// src/commands/images/pinterest.ts
|
|
13592
|
-
import { defineCommand as
|
|
13990
|
+
import { defineCommand as defineCommand103 } from "citty";
|
|
13593
13991
|
registerSchema({
|
|
13594
13992
|
command: "images.pinterest",
|
|
13595
13993
|
description: "Pinterest image search via ScrapeCreators. Reference-grade real-world photography, product styling, interiors, fashion, food, and aesthetic mood boards. Inspect before placing \u2014 Pinterest is unverified, trademark-bearing web content.",
|
|
@@ -13609,7 +14007,7 @@ registerSchema({
|
|
|
13609
14007
|
}
|
|
13610
14008
|
}
|
|
13611
14009
|
});
|
|
13612
|
-
var pinterestCommand =
|
|
14010
|
+
var pinterestCommand = defineCommand103({
|
|
13613
14011
|
meta: {
|
|
13614
14012
|
name: "pinterest",
|
|
13615
14013
|
description: "Pinterest image search via ScrapeCreators ($0.00188/request). Best for photo-realistic reference imagery \u2014 lifestyle, interiors, fashion, food, product styling, and mood boards to brief AI generation against. \u26A0 Unverified, trademark-bearing web content \u2014 inspect and respect rights before placing on a customer page. Browse first; auto-ingest only the pins you commit to.\n\nExamples:\n baker images pinterest 'scandinavian living room'\n baker images pinterest 'minimalist skincare product photography' --limit 20\n baker images pinterest 'cozy coffee shop interior' --auto-ingest 2 --context 'Mood reference for hero photography'"
|
|
@@ -13649,7 +14047,7 @@ var pinterestCommand = defineCommand101({
|
|
|
13649
14047
|
});
|
|
13650
14048
|
|
|
13651
14049
|
// src/commands/images/screenshot.ts
|
|
13652
|
-
import { defineCommand as
|
|
14050
|
+
import { defineCommand as defineCommand104 } from "citty";
|
|
13653
14051
|
registerSchema({
|
|
13654
14052
|
command: "images.screenshot",
|
|
13655
14053
|
description: "Capture a website screenshot via ScreenshotOne. Auto-ingests on success.",
|
|
@@ -13665,7 +14063,7 @@ registerSchema({
|
|
|
13665
14063
|
}
|
|
13666
14064
|
}
|
|
13667
14065
|
});
|
|
13668
|
-
var screenshotCommand =
|
|
14066
|
+
var screenshotCommand = defineCommand104({
|
|
13669
14067
|
meta: {
|
|
13670
14068
|
name: "screenshot",
|
|
13671
14069
|
description: "Screenshot a URL via ScreenshotOne. $0.009/capture. Auto-ingests to library.\n\nExample: baker images screenshot https://stripe.com --full-page"
|
|
@@ -13715,7 +14113,7 @@ var screenshotCommand = defineCommand102({
|
|
|
13715
14113
|
});
|
|
13716
14114
|
|
|
13717
14115
|
// src/commands/images/search.ts
|
|
13718
|
-
import { defineCommand as
|
|
14116
|
+
import { defineCommand as defineCommand105 } from "citty";
|
|
13719
14117
|
registerSchema({
|
|
13720
14118
|
command: "images.search",
|
|
13721
14119
|
description: "Search images by text query. Only returns ready images.",
|
|
@@ -13731,7 +14129,7 @@ registerSchema({
|
|
|
13731
14129
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
13732
14130
|
}
|
|
13733
14131
|
});
|
|
13734
|
-
var searchCommand =
|
|
14132
|
+
var searchCommand = defineCommand105({
|
|
13735
14133
|
meta: {
|
|
13736
14134
|
name: "search",
|
|
13737
14135
|
description: "Semantic search images by text query. Uses hybrid BM25 + vector + reranking. Example: baker images search 'hero banner' --aspect-ratio 16:9 --tags logo"
|
|
@@ -13791,7 +14189,7 @@ var searchCommand = defineCommand103({
|
|
|
13791
14189
|
});
|
|
13792
14190
|
|
|
13793
14191
|
// src/commands/images/sticker.ts
|
|
13794
|
-
import { defineCommand as
|
|
14192
|
+
import { defineCommand as defineCommand106 } from "citty";
|
|
13795
14193
|
registerSchema({
|
|
13796
14194
|
command: "images.sticker",
|
|
13797
14195
|
description: "Search Giphy stickers \u2014 transparent-background overlays for ad creative.",
|
|
@@ -13823,7 +14221,7 @@ registerSchema({
|
|
|
13823
14221
|
}
|
|
13824
14222
|
}
|
|
13825
14223
|
});
|
|
13826
|
-
var stickerCommand =
|
|
14224
|
+
var stickerCommand = defineCommand106({
|
|
13827
14225
|
meta: {
|
|
13828
14226
|
name: "sticker",
|
|
13829
14227
|
description: "Search Giphy's sticker corpus \u2014 transparent-background WebPs / GIFs ideal for overlaying on ad creative (Meta, TikTok, Stories). Same Giphy free API as `baker images gif`; results carry WebP + GIF + MP4 URLs in providerMeta.\n\nExample: baker images sticker 'thumbs up' --limit 10\nExample: baker images sticker celebration --rating g --auto-ingest 3\nExample: baker images sticker --trending --limit 25"
|
|
@@ -13870,7 +14268,7 @@ var stickerCommand = defineCommand104({
|
|
|
13870
14268
|
});
|
|
13871
14269
|
|
|
13872
14270
|
// src/commands/images/stock.ts
|
|
13873
|
-
import { defineCommand as
|
|
14271
|
+
import { defineCommand as defineCommand107 } from "citty";
|
|
13874
14272
|
registerSchema({
|
|
13875
14273
|
command: "images.stock",
|
|
13876
14274
|
description: "Stock photo, vector illustration, icon-set, and PSD search via Magnific (Freepik's developer API).",
|
|
@@ -13928,7 +14326,7 @@ registerSchema({
|
|
|
13928
14326
|
}
|
|
13929
14327
|
}
|
|
13930
14328
|
});
|
|
13931
|
-
var stockCommand =
|
|
14329
|
+
var stockCommand = defineCommand107({
|
|
13932
14330
|
meta: {
|
|
13933
14331
|
name: "stock",
|
|
13934
14332
|
description: "Stock search via Magnific \u2014 Freepik's developer API (~250M assets: photos, vectors, illustrations, icons, PSDs). $0.002/req. With --auto-ingest, ingested hits return Baker-owned URLs.\n\nExamples:\n baker images stock 'minimalist office'\n baker images stock 'flat office workers' --type vector\n baker images stock 'hero photo of a kitchen' --type photo --orientation landscape --ai exclude\n baker images stock 'brand pattern' --color '#0a0a0a' --license freemium --auto-ingest 2"
|
|
@@ -13986,7 +14384,7 @@ var stockCommand = defineCommand105({
|
|
|
13986
14384
|
// src/commands/images/upload.ts
|
|
13987
14385
|
import { readFile as readFile9 } from "fs/promises";
|
|
13988
14386
|
import { extname as extname2 } from "path";
|
|
13989
|
-
import { defineCommand as
|
|
14387
|
+
import { defineCommand as defineCommand108 } from "citty";
|
|
13990
14388
|
var MIME_MAP = {
|
|
13991
14389
|
".png": "image/png",
|
|
13992
14390
|
".jpg": "image/jpeg",
|
|
@@ -14041,7 +14439,7 @@ function detectContentType(filePath) {
|
|
|
14041
14439
|
}
|
|
14042
14440
|
return mime;
|
|
14043
14441
|
}
|
|
14044
|
-
var uploadCommand =
|
|
14442
|
+
var uploadCommand = defineCommand108({
|
|
14045
14443
|
meta: {
|
|
14046
14444
|
name: "upload",
|
|
14047
14445
|
description: "Upload an image to the library \u2014 accepts a local file path OR a remote http(s) URL.\n\nLocal: reads bytes, sends to /api/images/upload, content-type auto-detected from extension.\nRemote: dispatches to /api/images/ingest with hash-dedup on bytes + externalId.\n\nExamples:\n baker images upload ./logo.png --source uploaded\n baker images upload ./cert.png --context 'ISO 27001 badge \u2014 enterprise tier'\n baker images upload https://acme.com/hero.png --source firecrawl --context 'Acme competitor pricing hero'"
|
|
@@ -14134,7 +14532,7 @@ async function uploadLocal(target, args) {
|
|
|
14134
14532
|
}
|
|
14135
14533
|
|
|
14136
14534
|
// src/commands/images/upscale.ts
|
|
14137
|
-
import { defineCommand as
|
|
14535
|
+
import { defineCommand as defineCommand109 } from "citty";
|
|
14138
14536
|
registerSchema({
|
|
14139
14537
|
command: "images.upscale",
|
|
14140
14538
|
description: "Upscale a library image via the backend (Replicate, cost-tracked). Waits for completion by default. The image must be status 'ready' and raster (not SVG/AVIF).",
|
|
@@ -14149,7 +14547,7 @@ registerSchema({
|
|
|
14149
14547
|
}
|
|
14150
14548
|
});
|
|
14151
14549
|
var POLL_INTERVAL_MS3 = 1500;
|
|
14152
|
-
var upscaleCommand =
|
|
14550
|
+
var upscaleCommand = defineCommand109({
|
|
14153
14551
|
meta: {
|
|
14154
14552
|
name: "upscale",
|
|
14155
14553
|
description: "Upscale a library image via the Convex backend (Replicate, cost-tracked at $0.05/image). Waits for completion by default.\n\nExample: baker images upscale j571abc123def\nExample: baker images upscale j571abc123def --max-wait 0 # fire-and-forget"
|
|
@@ -14204,7 +14602,7 @@ var upscaleCommand = defineCommand107({
|
|
|
14204
14602
|
});
|
|
14205
14603
|
|
|
14206
14604
|
// src/commands/images/use.ts
|
|
14207
|
-
import { defineCommand as
|
|
14605
|
+
import { defineCommand as defineCommand110 } from "citty";
|
|
14208
14606
|
registerSchema({
|
|
14209
14607
|
command: "images.use",
|
|
14210
14608
|
description: "Ingest a URL and wait for the library record to be ready.",
|
|
@@ -14220,7 +14618,7 @@ registerSchema({
|
|
|
14220
14618
|
}
|
|
14221
14619
|
});
|
|
14222
14620
|
var POLL_INTERVAL_MS4 = 1500;
|
|
14223
|
-
var useCommand =
|
|
14621
|
+
var useCommand = defineCommand110({
|
|
14224
14622
|
meta: {
|
|
14225
14623
|
name: "use",
|
|
14226
14624
|
description: "Sugar over `ingest`: download \u2192 store \u2192 wait until describe + embed complete \u2192 return ready library record.\n\nExample: baker images use https://cdn.example.com/hero.png --source uploaded"
|
|
@@ -14266,7 +14664,7 @@ var useCommand = defineCommand108({
|
|
|
14266
14664
|
});
|
|
14267
14665
|
|
|
14268
14666
|
// src/commands/images/index.ts
|
|
14269
|
-
var imagesCommand =
|
|
14667
|
+
var imagesCommand = defineCommand111({
|
|
14270
14668
|
meta: {
|
|
14271
14669
|
name: "images",
|
|
14272
14670
|
description: `Find, source, and normalize images. Subcommands route by provider so cost + license are explicit.
|
|
@@ -14331,292 +14729,11 @@ Paid transforms (run on the Convex backend, cost-tracked):
|
|
|
14331
14729
|
}
|
|
14332
14730
|
});
|
|
14333
14731
|
|
|
14334
|
-
// src/commands/missions/index.ts
|
|
14335
|
-
import { defineCommand as defineCommand116 } from "citty";
|
|
14336
|
-
|
|
14337
|
-
// src/commands/missions/add-action.ts
|
|
14338
|
-
import { defineCommand as defineCommand110 } from "citty";
|
|
14339
|
-
registerSchema({
|
|
14340
|
-
command: "missions.add-action",
|
|
14341
|
-
description: "Attach an action to a mission as an ordered step. Both --mission and --action accept a real id or a temp_* ref from a create op in the same draft. --order is the 0-based position in the plan. Applies on chat publish.",
|
|
14342
|
-
args: {
|
|
14343
|
-
mission: { type: "string", description: "Mission id or missionTempId", required: true },
|
|
14344
|
-
action: { type: "string", description: "Action id or tempId", required: true },
|
|
14345
|
-
order: { type: "string", description: "0-based position within the mission", required: true }
|
|
14346
|
-
}
|
|
14347
|
-
});
|
|
14348
|
-
var addActionCommand = defineCommand110({
|
|
14349
|
-
meta: {
|
|
14350
|
-
name: "add-action",
|
|
14351
|
-
description: "Attach an action to a mission as an ordered step. Example: baker missions add-action --mission <ref> --action <ref> --order 0"
|
|
14352
|
-
},
|
|
14353
|
-
args: {
|
|
14354
|
-
mission: { type: "string", description: "Mission ref", required: false },
|
|
14355
|
-
action: { type: "string", description: "Action ref", required: false },
|
|
14356
|
-
order: { type: "string", description: "0-based order", required: false }
|
|
14357
|
-
},
|
|
14358
|
-
run: async ({ args }) => {
|
|
14359
|
-
try {
|
|
14360
|
-
const mission = args.mission;
|
|
14361
|
-
const action = args.action;
|
|
14362
|
-
if (!mission || !action) {
|
|
14363
|
-
failValidation("--mission and --action are required.");
|
|
14364
|
-
}
|
|
14365
|
-
const order = Number.parseInt(args.order ?? "", 10);
|
|
14366
|
-
if (Number.isNaN(order) || order < 0) {
|
|
14367
|
-
failValidation("--order must be a non-negative integer.");
|
|
14368
|
-
}
|
|
14369
|
-
const chatId = requireChatId();
|
|
14370
|
-
await apiPost("/api/missions/add-action", {
|
|
14371
|
-
chatId,
|
|
14372
|
-
missionRef: mission,
|
|
14373
|
-
actionRef: action,
|
|
14374
|
-
order
|
|
14375
|
-
});
|
|
14376
|
-
writeOk();
|
|
14377
|
-
} catch (err) {
|
|
14378
|
-
failApi(err);
|
|
14379
|
-
}
|
|
14380
|
-
}
|
|
14381
|
-
});
|
|
14382
|
-
|
|
14383
|
-
// src/commands/missions/create.ts
|
|
14384
|
-
import { defineCommand as defineCommand111 } from "citty";
|
|
14385
|
-
registerSchema({
|
|
14386
|
-
command: "missions.create",
|
|
14387
|
-
description: "Open a Mission to group the ordered steps of a multi-step request. A Mission has a title and a markdown overview (what you're doing and why \u2014 the human-readable plan, written as numbered Phases with NO dates and NO effort sizing). Returns a missionTempId. Next: create the action steps with `baker actions create`, then attach each in order with `baker missions add-action`. Applies when the chat is published \u2014 publishing = the user approving the plan.",
|
|
14388
|
-
args: {
|
|
14389
|
-
title: { type: "string", description: "Mission title \u2014 the goal, short", required: true },
|
|
14390
|
-
overview: {
|
|
14391
|
-
type: "string",
|
|
14392
|
-
description: "Markdown overview: the plan as numbered Phases (goal / what it produces / what unlocks next). No calendar or effort framing.",
|
|
14393
|
-
required: false
|
|
14394
|
-
},
|
|
14395
|
-
"temp-id": { type: "string", description: "Custom missionTempId (auto-generated if omitted)", required: false }
|
|
14396
|
-
}
|
|
14397
|
-
});
|
|
14398
|
-
var createCommand2 = defineCommand111({
|
|
14399
|
-
meta: {
|
|
14400
|
-
name: "create",
|
|
14401
|
-
description: 'Open a Mission to group ordered steps. Example: baker missions create --title "Audit Google Ads" --overview "..."'
|
|
14402
|
-
},
|
|
14403
|
-
args: {
|
|
14404
|
-
title: { type: "string", description: "Mission title", required: false },
|
|
14405
|
-
overview: { type: "string", description: "Markdown overview (numbered Phases)", required: false, default: "" },
|
|
14406
|
-
"temp-id": { type: "string", description: "Optional custom missionTempId", required: false }
|
|
14407
|
-
},
|
|
14408
|
-
run: async ({ args }) => {
|
|
14409
|
-
try {
|
|
14410
|
-
const title = args.title;
|
|
14411
|
-
if (!title || title.trim().length === 0) {
|
|
14412
|
-
failValidation("--title is required.");
|
|
14413
|
-
}
|
|
14414
|
-
const chatId = requireChatId();
|
|
14415
|
-
const missionTempId = args["temp-id"] || generateTempId();
|
|
14416
|
-
const response = await apiPost("/api/missions/create", {
|
|
14417
|
-
chatId,
|
|
14418
|
-
missionTempId,
|
|
14419
|
-
title,
|
|
14420
|
-
overview: args.overview ?? ""
|
|
14421
|
-
});
|
|
14422
|
-
const hints = [
|
|
14423
|
-
`Add ordered steps: create each action, then baker missions add-action --mission ${missionTempId} --action <tempId> --order 0`
|
|
14424
|
-
];
|
|
14425
|
-
if (!args.overview) {
|
|
14426
|
-
hints.push(
|
|
14427
|
-
"Tip: pass --overview with the plan as numbered Phases (goal / produces / unlocks; no dates or effort sizing)."
|
|
14428
|
-
);
|
|
14429
|
-
}
|
|
14430
|
-
writeJson({ ...response, hints });
|
|
14431
|
-
} catch (err) {
|
|
14432
|
-
failApi(err);
|
|
14433
|
-
}
|
|
14434
|
-
}
|
|
14435
|
-
});
|
|
14436
|
-
|
|
14437
|
-
// src/commands/missions/get.ts
|
|
14438
|
-
import { defineCommand as defineCommand112 } from "citty";
|
|
14439
|
-
registerSchema({
|
|
14440
|
-
command: "missions.get",
|
|
14441
|
-
description: "Get one mission with its overview, progress, and ordered steps.",
|
|
14442
|
-
args: {
|
|
14443
|
-
id: { type: "string", description: "Mission ID", required: true }
|
|
14444
|
-
}
|
|
14445
|
-
});
|
|
14446
|
-
var getCommand3 = defineCommand112({
|
|
14447
|
-
meta: { name: "get", description: "Get a mission by ID. Example: baker missions get <mission-id>" },
|
|
14448
|
-
args: {
|
|
14449
|
-
id: { type: "positional", description: "Mission ID", required: false },
|
|
14450
|
-
"mission-id": { type: "string", description: "Mission ID (alternative to positional)", required: false }
|
|
14451
|
-
},
|
|
14452
|
-
run: async ({ args }) => {
|
|
14453
|
-
try {
|
|
14454
|
-
const id = args.id || args["mission-id"];
|
|
14455
|
-
if (!id) {
|
|
14456
|
-
failValidation("Mission ID is required.");
|
|
14457
|
-
}
|
|
14458
|
-
validateConvexId(id);
|
|
14459
|
-
const response = await apiPost("/api/missions/get", { missionId: id });
|
|
14460
|
-
writeJson(response);
|
|
14461
|
-
} catch (err) {
|
|
14462
|
-
failApi(err);
|
|
14463
|
-
}
|
|
14464
|
-
}
|
|
14465
|
-
});
|
|
14466
|
-
|
|
14467
|
-
// src/commands/missions/list.ts
|
|
14468
|
-
import { defineCommand as defineCommand113 } from "citty";
|
|
14469
|
-
registerSchema({
|
|
14470
|
-
command: "missions.list",
|
|
14471
|
-
description: "List the company's missions with per-mission progress (done/total) and ordered steps. Aborted missions are hidden unless --include-aborted.",
|
|
14472
|
-
args: {
|
|
14473
|
-
"include-aborted": {
|
|
14474
|
-
type: "boolean",
|
|
14475
|
-
description: "Include aborted missions (default: false)",
|
|
14476
|
-
required: false,
|
|
14477
|
-
default: false
|
|
14478
|
-
}
|
|
14479
|
-
}
|
|
14480
|
-
});
|
|
14481
|
-
var listCommand2 = defineCommand113({
|
|
14482
|
-
meta: {
|
|
14483
|
-
name: "list",
|
|
14484
|
-
description: "List missions with progress and ordered steps. Example: baker missions list"
|
|
14485
|
-
},
|
|
14486
|
-
args: {
|
|
14487
|
-
"include-aborted": { type: "boolean", description: "Include aborted missions", required: false, default: false }
|
|
14488
|
-
},
|
|
14489
|
-
run: async ({ args }) => {
|
|
14490
|
-
try {
|
|
14491
|
-
const body = {};
|
|
14492
|
-
if (args["include-aborted"] === true) {
|
|
14493
|
-
body.includeAborted = true;
|
|
14494
|
-
}
|
|
14495
|
-
const response = await apiPost("/api/missions/list", body);
|
|
14496
|
-
writeJson(response);
|
|
14497
|
-
} catch (err) {
|
|
14498
|
-
failApi(err);
|
|
14499
|
-
}
|
|
14500
|
-
}
|
|
14501
|
-
});
|
|
14502
|
-
|
|
14503
|
-
// src/commands/missions/set-status.ts
|
|
14504
|
-
import { defineCommand as defineCommand114 } from "citty";
|
|
14505
|
-
registerSchema({
|
|
14506
|
-
command: "missions.set-status",
|
|
14507
|
-
description: "Set a mission's status: accomplished (the goal is genuinely met), aborted (abandoned), or active (reopen). Do NOT mark accomplished just because all steps are closed \u2014 only when the goal is done. Applies on chat publish.",
|
|
14508
|
-
args: {
|
|
14509
|
-
id: { type: "string", description: "Mission ID", required: true },
|
|
14510
|
-
status: { type: "string", description: "active | accomplished | aborted", required: true }
|
|
14511
|
-
}
|
|
14512
|
-
});
|
|
14513
|
-
var setStatusCommand = defineCommand114({
|
|
14514
|
-
meta: {
|
|
14515
|
-
name: "set-status",
|
|
14516
|
-
description: "Set mission status. Example: baker missions set-status <id> --status accomplished"
|
|
14517
|
-
},
|
|
14518
|
-
args: {
|
|
14519
|
-
id: { type: "positional", description: "Mission ID", required: false },
|
|
14520
|
-
"mission-id": { type: "string", description: "Mission ID", required: false },
|
|
14521
|
-
status: { type: "string", description: "active | accomplished | aborted", required: false }
|
|
14522
|
-
},
|
|
14523
|
-
run: async ({ args }) => {
|
|
14524
|
-
try {
|
|
14525
|
-
const id = args.id || args["mission-id"];
|
|
14526
|
-
if (!id) {
|
|
14527
|
-
failValidation("Mission ID is required.");
|
|
14528
|
-
}
|
|
14529
|
-
validateConvexId(id);
|
|
14530
|
-
const status = args.status;
|
|
14531
|
-
if (status !== "active" && status !== "accomplished" && status !== "aborted") {
|
|
14532
|
-
failValidation("--status must be one of: active, accomplished, aborted.");
|
|
14533
|
-
}
|
|
14534
|
-
const chatId = requireChatId();
|
|
14535
|
-
await apiPost("/api/missions/set-status", { chatId, missionId: id, status });
|
|
14536
|
-
writeOk();
|
|
14537
|
-
} catch (err) {
|
|
14538
|
-
failApi(err);
|
|
14539
|
-
}
|
|
14540
|
-
}
|
|
14541
|
-
});
|
|
14542
|
-
|
|
14543
|
-
// src/commands/missions/update.ts
|
|
14544
|
-
import { defineCommand as defineCommand115 } from "citty";
|
|
14545
|
-
registerSchema({
|
|
14546
|
-
command: "missions.update",
|
|
14547
|
-
description: "Stage an update to a mission's title and/or overview (real mission id only). Applies on chat publish.",
|
|
14548
|
-
args: {
|
|
14549
|
-
id: { type: "string", description: "Mission ID", required: true },
|
|
14550
|
-
title: { type: "string", description: "New title", required: false },
|
|
14551
|
-
overview: { type: "string", description: "New markdown overview (numbered Phases)", required: false }
|
|
14552
|
-
}
|
|
14553
|
-
});
|
|
14554
|
-
var updateCommand2 = defineCommand115({
|
|
14555
|
-
meta: {
|
|
14556
|
-
name: "update",
|
|
14557
|
-
description: 'Stage a mission update. Example: baker missions update <id> --overview "..."'
|
|
14558
|
-
},
|
|
14559
|
-
args: {
|
|
14560
|
-
id: { type: "positional", description: "Mission ID", required: false },
|
|
14561
|
-
"mission-id": { type: "string", description: "Mission ID", required: false },
|
|
14562
|
-
title: { type: "string", description: "New title", required: false },
|
|
14563
|
-
overview: { type: "string", description: "New markdown overview", required: false }
|
|
14564
|
-
},
|
|
14565
|
-
run: async ({ args }) => {
|
|
14566
|
-
try {
|
|
14567
|
-
const id = args.id || args["mission-id"];
|
|
14568
|
-
if (!id) {
|
|
14569
|
-
failValidation("Mission ID is required.");
|
|
14570
|
-
}
|
|
14571
|
-
validateConvexId(id);
|
|
14572
|
-
if (args.title === void 0 && args.overview === void 0) {
|
|
14573
|
-
failValidation("Provide at least one of --title, --overview.");
|
|
14574
|
-
}
|
|
14575
|
-
const chatId = requireChatId();
|
|
14576
|
-
await apiPost("/api/missions/update", {
|
|
14577
|
-
chatId,
|
|
14578
|
-
missionId: id,
|
|
14579
|
-
title: args.title,
|
|
14580
|
-
overview: args.overview
|
|
14581
|
-
});
|
|
14582
|
-
writeOk();
|
|
14583
|
-
} catch (err) {
|
|
14584
|
-
failApi(err);
|
|
14585
|
-
}
|
|
14586
|
-
}
|
|
14587
|
-
});
|
|
14588
|
-
|
|
14589
|
-
// src/commands/missions/index.ts
|
|
14590
|
-
var missionsCommand = defineCommand116({
|
|
14591
|
-
meta: {
|
|
14592
|
-
name: "missions",
|
|
14593
|
-
description: `Group ordered actions into a Mission \u2014 one goal with a markdown overview (the plan) and ordered action "steps". Subcommands: list, get, create, add-action, update, set-status.
|
|
14594
|
-
|
|
14595
|
-
Use a mission whenever a request decomposes into 2+ ordered actions (audits, campaigns, multi-step plans). A single one-off capture stays a loose action.
|
|
14596
|
-
|
|
14597
|
-
Flow: create the mission \u2192 create each action step in order \u2192 attach each with add-action \u2192 wire hard dependencies with 'baker actions link' \u2192 publish the chat (= the user approving the plan). The overview is forward planning: write it as numbered Phases, no dates, no effort sizing. Mark accomplished/aborted explicitly \u2014 never auto-conclude from step status.
|
|
14598
|
-
|
|
14599
|
-
Examples:
|
|
14600
|
-
baker missions create --title "Audit Google Ads" --overview "..."
|
|
14601
|
-
baker missions add-action --mission <ref> --action <ref> --order 0
|
|
14602
|
-
baker missions list
|
|
14603
|
-
baker missions set-status <id> --status accomplished`
|
|
14604
|
-
},
|
|
14605
|
-
subCommands: {
|
|
14606
|
-
list: listCommand2,
|
|
14607
|
-
get: getCommand3,
|
|
14608
|
-
create: createCommand2,
|
|
14609
|
-
"add-action": addActionCommand,
|
|
14610
|
-
update: updateCommand2,
|
|
14611
|
-
"set-status": setStatusCommand
|
|
14612
|
-
}
|
|
14613
|
-
});
|
|
14614
|
-
|
|
14615
14732
|
// src/commands/research/index.ts
|
|
14616
|
-
import { defineCommand as
|
|
14733
|
+
import { defineCommand as defineCommand122 } from "citty";
|
|
14617
14734
|
|
|
14618
14735
|
// src/commands/research/advertisers.ts
|
|
14619
|
-
import { defineCommand as
|
|
14736
|
+
import { defineCommand as defineCommand112 } from "citty";
|
|
14620
14737
|
|
|
14621
14738
|
// src/commands/research/output.ts
|
|
14622
14739
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -14729,7 +14846,7 @@ var FIELDS3 = {
|
|
|
14729
14846
|
etv: "Estimated traffic value (USD)",
|
|
14730
14847
|
visibility: "SERP visibility score (0-1)"
|
|
14731
14848
|
};
|
|
14732
|
-
var advertisersCommand =
|
|
14849
|
+
var advertisersCommand = defineCommand112({
|
|
14733
14850
|
meta: {
|
|
14734
14851
|
name: "advertisers",
|
|
14735
14852
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -14776,7 +14893,7 @@ Examples:
|
|
|
14776
14893
|
});
|
|
14777
14894
|
|
|
14778
14895
|
// src/commands/research/autocomplete.ts
|
|
14779
|
-
import { defineCommand as
|
|
14896
|
+
import { defineCommand as defineCommand113 } from "citty";
|
|
14780
14897
|
registerSchema({
|
|
14781
14898
|
command: "research.autocomplete",
|
|
14782
14899
|
description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
@@ -14799,7 +14916,7 @@ registerSchema({
|
|
|
14799
14916
|
var FIELDS4 = {
|
|
14800
14917
|
suggestion: "Autocomplete suggestion from Google"
|
|
14801
14918
|
};
|
|
14802
|
-
var autocompleteCommand =
|
|
14919
|
+
var autocompleteCommand = defineCommand113({
|
|
14803
14920
|
meta: {
|
|
14804
14921
|
name: "autocomplete",
|
|
14805
14922
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -14845,7 +14962,7 @@ Examples:
|
|
|
14845
14962
|
});
|
|
14846
14963
|
|
|
14847
14964
|
// src/commands/research/countries.ts
|
|
14848
|
-
import { defineCommand as
|
|
14965
|
+
import { defineCommand as defineCommand114 } from "citty";
|
|
14849
14966
|
registerSchema({
|
|
14850
14967
|
command: "research.countries",
|
|
14851
14968
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -14902,7 +15019,7 @@ var FIELDS5 = {
|
|
|
14902
15019
|
code: "Country code to pass as --location",
|
|
14903
15020
|
name: "Country name"
|
|
14904
15021
|
};
|
|
14905
|
-
var countriesCommand =
|
|
15022
|
+
var countriesCommand = defineCommand114({
|
|
14906
15023
|
meta: {
|
|
14907
15024
|
name: "countries",
|
|
14908
15025
|
description: "List all supported country codes for --location flag."
|
|
@@ -14913,7 +15030,7 @@ var countriesCommand = defineCommand119({
|
|
|
14913
15030
|
});
|
|
14914
15031
|
|
|
14915
15032
|
// src/commands/research/intent.ts
|
|
14916
|
-
import { defineCommand as
|
|
15033
|
+
import { defineCommand as defineCommand115 } from "citty";
|
|
14917
15034
|
registerSchema({
|
|
14918
15035
|
command: "research.intent",
|
|
14919
15036
|
description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. IMPORTANT: If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
|
|
@@ -14936,7 +15053,7 @@ var FIELDS6 = {
|
|
|
14936
15053
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
14937
15054
|
probability: "Confidence score 0.0-1.0"
|
|
14938
15055
|
};
|
|
14939
|
-
var intentCommand =
|
|
15056
|
+
var intentCommand = defineCommand115({
|
|
14940
15057
|
meta: {
|
|
14941
15058
|
name: "intent",
|
|
14942
15059
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -14984,7 +15101,7 @@ Examples:
|
|
|
14984
15101
|
});
|
|
14985
15102
|
|
|
14986
15103
|
// src/commands/research/keyword-gap.ts
|
|
14987
|
-
import { defineCommand as
|
|
15104
|
+
import { defineCommand as defineCommand116 } from "citty";
|
|
14988
15105
|
registerSchema({
|
|
14989
15106
|
command: "research.keyword-gap",
|
|
14990
15107
|
description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
@@ -15013,7 +15130,7 @@ var FIELDS7 = {
|
|
|
15013
15130
|
cpc: "Cost per click USD",
|
|
15014
15131
|
their_position: "Competitor's ranking position"
|
|
15015
15132
|
};
|
|
15016
|
-
var keywordGapCommand =
|
|
15133
|
+
var keywordGapCommand = defineCommand116({
|
|
15017
15134
|
meta: {
|
|
15018
15135
|
name: "keyword-gap",
|
|
15019
15136
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -15087,7 +15204,7 @@ Examples:
|
|
|
15087
15204
|
});
|
|
15088
15205
|
|
|
15089
15206
|
// src/commands/research/keywords-for-site.ts
|
|
15090
|
-
import { defineCommand as
|
|
15207
|
+
import { defineCommand as defineCommand117 } from "citty";
|
|
15091
15208
|
registerSchema({
|
|
15092
15209
|
command: "research.keywords-for-site",
|
|
15093
15210
|
description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
@@ -15120,7 +15237,7 @@ var FIELDS8 = {
|
|
|
15120
15237
|
competition: "LOW, MEDIUM, or HIGH",
|
|
15121
15238
|
competition_index: "Competition score 0-100"
|
|
15122
15239
|
};
|
|
15123
|
-
var keywordsForSiteCommand =
|
|
15240
|
+
var keywordsForSiteCommand = defineCommand117({
|
|
15124
15241
|
meta: {
|
|
15125
15242
|
name: "keywords-for-site",
|
|
15126
15243
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -15173,7 +15290,7 @@ Examples:
|
|
|
15173
15290
|
});
|
|
15174
15291
|
|
|
15175
15292
|
// src/commands/research/languages.ts
|
|
15176
|
-
import { defineCommand as
|
|
15293
|
+
import { defineCommand as defineCommand118 } from "citty";
|
|
15177
15294
|
registerSchema({
|
|
15178
15295
|
command: "research.languages",
|
|
15179
15296
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -15203,7 +15320,7 @@ var FIELDS9 = {
|
|
|
15203
15320
|
code: "Language code to pass as --language",
|
|
15204
15321
|
name: "Language name (also accepted by --language)"
|
|
15205
15322
|
};
|
|
15206
|
-
var languagesCommand2 =
|
|
15323
|
+
var languagesCommand2 = defineCommand118({
|
|
15207
15324
|
meta: {
|
|
15208
15325
|
name: "languages",
|
|
15209
15326
|
description: "List all supported language codes for --language flag."
|
|
@@ -15214,7 +15331,7 @@ var languagesCommand2 = defineCommand123({
|
|
|
15214
15331
|
});
|
|
15215
15332
|
|
|
15216
15333
|
// src/commands/research/lighthouse.ts
|
|
15217
|
-
import { defineCommand as
|
|
15334
|
+
import { defineCommand as defineCommand119 } from "citty";
|
|
15218
15335
|
registerSchema({
|
|
15219
15336
|
command: "research.lighthouse",
|
|
15220
15337
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -15233,7 +15350,7 @@ var FIELDS10 = {
|
|
|
15233
15350
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
15234
15351
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
15235
15352
|
};
|
|
15236
|
-
var lighthouseCommand =
|
|
15353
|
+
var lighthouseCommand = defineCommand119({
|
|
15237
15354
|
meta: {
|
|
15238
15355
|
name: "lighthouse",
|
|
15239
15356
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -15271,7 +15388,7 @@ Examples:
|
|
|
15271
15388
|
});
|
|
15272
15389
|
|
|
15273
15390
|
// src/commands/research/relevant-pages.ts
|
|
15274
|
-
import { defineCommand as
|
|
15391
|
+
import { defineCommand as defineCommand120 } from "citty";
|
|
15275
15392
|
registerSchema({
|
|
15276
15393
|
command: "research.relevant-pages",
|
|
15277
15394
|
description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
@@ -15297,7 +15414,7 @@ var FIELDS11 = {
|
|
|
15297
15414
|
keywords: "Total organic keywords the page ranks for",
|
|
15298
15415
|
top_10: "Keywords in positions 1-10"
|
|
15299
15416
|
};
|
|
15300
|
-
var relevantPagesCommand =
|
|
15417
|
+
var relevantPagesCommand = defineCommand120({
|
|
15301
15418
|
meta: {
|
|
15302
15419
|
name: "relevant-pages",
|
|
15303
15420
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -15343,7 +15460,7 @@ Examples:
|
|
|
15343
15460
|
});
|
|
15344
15461
|
|
|
15345
15462
|
// src/commands/research/web.ts
|
|
15346
|
-
import { defineCommand as
|
|
15463
|
+
import { defineCommand as defineCommand121 } from "citty";
|
|
15347
15464
|
registerSchema({
|
|
15348
15465
|
command: "research.web",
|
|
15349
15466
|
description: "Search the web with AI to answer marketing questions \u2014 competitors, ICP, pricing, pain points, market trends. Three depth levels: medium (quick, default), high (thorough), xhigh (exhaustive deep research).",
|
|
@@ -15394,7 +15511,7 @@ async function runDeepResearch(question) {
|
|
|
15394
15511
|
}
|
|
15395
15512
|
throw new Error("Deep research timed out");
|
|
15396
15513
|
}
|
|
15397
|
-
var webCommand =
|
|
15514
|
+
var webCommand = defineCommand121({
|
|
15398
15515
|
meta: {
|
|
15399
15516
|
name: "web",
|
|
15400
15517
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -15454,7 +15571,7 @@ Examples:
|
|
|
15454
15571
|
});
|
|
15455
15572
|
|
|
15456
15573
|
// src/commands/research/index.ts
|
|
15457
|
-
var researchCommand =
|
|
15574
|
+
var researchCommand = defineCommand122({
|
|
15458
15575
|
meta: {
|
|
15459
15576
|
name: "research",
|
|
15460
15577
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -15494,10 +15611,10 @@ Examples:
|
|
|
15494
15611
|
});
|
|
15495
15612
|
|
|
15496
15613
|
// src/commands/scheduled-actions/index.ts
|
|
15497
|
-
import { defineCommand as
|
|
15614
|
+
import { defineCommand as defineCommand129 } from "citty";
|
|
15498
15615
|
|
|
15499
15616
|
// src/commands/scheduled-actions/create.ts
|
|
15500
|
-
import { defineCommand as
|
|
15617
|
+
import { defineCommand as defineCommand123 } from "citty";
|
|
15501
15618
|
|
|
15502
15619
|
// src/commands/scheduled-actions/shared.ts
|
|
15503
15620
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -15602,7 +15719,7 @@ registerSchema({
|
|
|
15602
15719
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
15603
15720
|
}
|
|
15604
15721
|
});
|
|
15605
|
-
var
|
|
15722
|
+
var createCommand2 = defineCommand123({
|
|
15606
15723
|
meta: {
|
|
15607
15724
|
name: "create",
|
|
15608
15725
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -15650,7 +15767,7 @@ var createCommand3 = defineCommand128({
|
|
|
15650
15767
|
});
|
|
15651
15768
|
|
|
15652
15769
|
// src/commands/scheduled-actions/delete.ts
|
|
15653
|
-
import { defineCommand as
|
|
15770
|
+
import { defineCommand as defineCommand124 } from "citty";
|
|
15654
15771
|
registerSchema({
|
|
15655
15772
|
command: "scheduled-actions.delete",
|
|
15656
15773
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -15658,7 +15775,7 @@ registerSchema({
|
|
|
15658
15775
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
15659
15776
|
}
|
|
15660
15777
|
});
|
|
15661
|
-
var deleteCommand2 =
|
|
15778
|
+
var deleteCommand2 = defineCommand124({
|
|
15662
15779
|
meta: {
|
|
15663
15780
|
name: "delete",
|
|
15664
15781
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -15687,7 +15804,7 @@ var deleteCommand2 = defineCommand129({
|
|
|
15687
15804
|
});
|
|
15688
15805
|
|
|
15689
15806
|
// src/commands/scheduled-actions/get.ts
|
|
15690
|
-
import { defineCommand as
|
|
15807
|
+
import { defineCommand as defineCommand125 } from "citty";
|
|
15691
15808
|
registerSchema({
|
|
15692
15809
|
command: "scheduled-actions.get",
|
|
15693
15810
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -15695,7 +15812,7 @@ registerSchema({
|
|
|
15695
15812
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
15696
15813
|
}
|
|
15697
15814
|
});
|
|
15698
|
-
var
|
|
15815
|
+
var getCommand3 = defineCommand125({
|
|
15699
15816
|
meta: {
|
|
15700
15817
|
name: "get",
|
|
15701
15818
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -15732,13 +15849,13 @@ var getCommand4 = defineCommand130({
|
|
|
15732
15849
|
});
|
|
15733
15850
|
|
|
15734
15851
|
// src/commands/scheduled-actions/list.ts
|
|
15735
|
-
import { defineCommand as
|
|
15852
|
+
import { defineCommand as defineCommand126 } from "citty";
|
|
15736
15853
|
registerSchema({
|
|
15737
15854
|
command: "scheduled-actions.list",
|
|
15738
15855
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set.",
|
|
15739
15856
|
args: {}
|
|
15740
15857
|
});
|
|
15741
|
-
var listCommand3 =
|
|
15858
|
+
var listCommand3 = defineCommand126({
|
|
15742
15859
|
meta: {
|
|
15743
15860
|
name: "list",
|
|
15744
15861
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set."
|
|
@@ -15759,7 +15876,7 @@ var listCommand3 = defineCommand131({
|
|
|
15759
15876
|
});
|
|
15760
15877
|
|
|
15761
15878
|
// src/commands/scheduled-actions/trigger.ts
|
|
15762
|
-
import { defineCommand as
|
|
15879
|
+
import { defineCommand as defineCommand127 } from "citty";
|
|
15763
15880
|
registerSchema({
|
|
15764
15881
|
command: "scheduled-actions.trigger",
|
|
15765
15882
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -15767,7 +15884,7 @@ registerSchema({
|
|
|
15767
15884
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
15768
15885
|
}
|
|
15769
15886
|
});
|
|
15770
|
-
var triggerCommand =
|
|
15887
|
+
var triggerCommand = defineCommand127({
|
|
15771
15888
|
meta: {
|
|
15772
15889
|
name: "trigger",
|
|
15773
15890
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -15804,7 +15921,7 @@ var triggerCommand = defineCommand132({
|
|
|
15804
15921
|
});
|
|
15805
15922
|
|
|
15806
15923
|
// src/commands/scheduled-actions/update.ts
|
|
15807
|
-
import { defineCommand as
|
|
15924
|
+
import { defineCommand as defineCommand128 } from "citty";
|
|
15808
15925
|
registerSchema({
|
|
15809
15926
|
command: "scheduled-actions.update",
|
|
15810
15927
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -15829,7 +15946,7 @@ registerSchema({
|
|
|
15829
15946
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
15830
15947
|
}
|
|
15831
15948
|
});
|
|
15832
|
-
var
|
|
15949
|
+
var updateCommand2 = defineCommand128({
|
|
15833
15950
|
meta: {
|
|
15834
15951
|
name: "update",
|
|
15835
15952
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -15899,7 +16016,7 @@ var updateCommand3 = defineCommand133({
|
|
|
15899
16016
|
});
|
|
15900
16017
|
|
|
15901
16018
|
// src/commands/scheduled-actions/index.ts
|
|
15902
|
-
var scheduledActionsCommand =
|
|
16019
|
+
var scheduledActionsCommand = defineCommand129({
|
|
15903
16020
|
meta: {
|
|
15904
16021
|
name: "scheduled-actions",
|
|
15905
16022
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -15916,17 +16033,17 @@ Examples:
|
|
|
15916
16033
|
},
|
|
15917
16034
|
subCommands: {
|
|
15918
16035
|
list: listCommand3,
|
|
15919
|
-
get:
|
|
15920
|
-
create:
|
|
15921
|
-
update:
|
|
16036
|
+
get: getCommand3,
|
|
16037
|
+
create: createCommand2,
|
|
16038
|
+
update: updateCommand2,
|
|
15922
16039
|
delete: deleteCommand2,
|
|
15923
16040
|
trigger: triggerCommand
|
|
15924
16041
|
}
|
|
15925
16042
|
});
|
|
15926
16043
|
|
|
15927
16044
|
// src/commands/schema.ts
|
|
15928
|
-
import { defineCommand as
|
|
15929
|
-
var schemaCommand =
|
|
16045
|
+
import { defineCommand as defineCommand130 } from "citty";
|
|
16046
|
+
var schemaCommand = defineCommand130({
|
|
15930
16047
|
meta: {
|
|
15931
16048
|
name: "schema",
|
|
15932
16049
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -15962,10 +16079,10 @@ var schemaCommand = defineCommand135({
|
|
|
15962
16079
|
});
|
|
15963
16080
|
|
|
15964
16081
|
// src/commands/testimonials/index.ts
|
|
15965
|
-
import { defineCommand as
|
|
16082
|
+
import { defineCommand as defineCommand134 } from "citty";
|
|
15966
16083
|
|
|
15967
16084
|
// src/commands/testimonials/get.ts
|
|
15968
|
-
import { defineCommand as
|
|
16085
|
+
import { defineCommand as defineCommand131 } from "citty";
|
|
15969
16086
|
registerSchema({
|
|
15970
16087
|
command: "testimonials.get",
|
|
15971
16088
|
description: "Get a single testimonial by ID",
|
|
@@ -15973,7 +16090,7 @@ registerSchema({
|
|
|
15973
16090
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
15974
16091
|
}
|
|
15975
16092
|
});
|
|
15976
|
-
var
|
|
16093
|
+
var getCommand4 = defineCommand131({
|
|
15977
16094
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
15978
16095
|
args: {
|
|
15979
16096
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -16010,7 +16127,7 @@ var getCommand5 = defineCommand136({
|
|
|
16010
16127
|
});
|
|
16011
16128
|
|
|
16012
16129
|
// src/commands/testimonials/list.ts
|
|
16013
|
-
import { defineCommand as
|
|
16130
|
+
import { defineCommand as defineCommand132 } from "citty";
|
|
16014
16131
|
registerSchema({
|
|
16015
16132
|
command: "testimonials.list",
|
|
16016
16133
|
description: "List testimonials with optional filters.",
|
|
@@ -16040,7 +16157,7 @@ registerSchema({
|
|
|
16040
16157
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
16041
16158
|
}
|
|
16042
16159
|
});
|
|
16043
|
-
var listCommand4 =
|
|
16160
|
+
var listCommand4 = defineCommand132({
|
|
16044
16161
|
meta: {
|
|
16045
16162
|
name: "list",
|
|
16046
16163
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -16089,7 +16206,7 @@ var listCommand4 = defineCommand137({
|
|
|
16089
16206
|
});
|
|
16090
16207
|
|
|
16091
16208
|
// src/commands/testimonials/search.ts
|
|
16092
|
-
import { defineCommand as
|
|
16209
|
+
import { defineCommand as defineCommand133 } from "citty";
|
|
16093
16210
|
registerSchema({
|
|
16094
16211
|
command: "testimonials.search",
|
|
16095
16212
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -16120,7 +16237,7 @@ registerSchema({
|
|
|
16120
16237
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
16121
16238
|
}
|
|
16122
16239
|
});
|
|
16123
|
-
var searchCommand2 =
|
|
16240
|
+
var searchCommand2 = defineCommand133({
|
|
16124
16241
|
meta: {
|
|
16125
16242
|
name: "search",
|
|
16126
16243
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -16191,7 +16308,7 @@ var searchCommand2 = defineCommand138({
|
|
|
16191
16308
|
});
|
|
16192
16309
|
|
|
16193
16310
|
// src/commands/testimonials/index.ts
|
|
16194
|
-
var testimonialsCommand =
|
|
16311
|
+
var testimonialsCommand = defineCommand134({
|
|
16195
16312
|
meta: {
|
|
16196
16313
|
name: "testimonials",
|
|
16197
16314
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list.
|
|
@@ -16203,17 +16320,17 @@ Examples:
|
|
|
16203
16320
|
baker testimonials list --source google --sentiment positive`
|
|
16204
16321
|
},
|
|
16205
16322
|
subCommands: {
|
|
16206
|
-
get:
|
|
16323
|
+
get: getCommand4,
|
|
16207
16324
|
search: searchCommand2,
|
|
16208
16325
|
list: listCommand4
|
|
16209
16326
|
}
|
|
16210
16327
|
});
|
|
16211
16328
|
|
|
16212
16329
|
// src/commands/videos/index.ts
|
|
16213
|
-
import { defineCommand as
|
|
16330
|
+
import { defineCommand as defineCommand139 } from "citty";
|
|
16214
16331
|
|
|
16215
16332
|
// src/commands/videos/delete.ts
|
|
16216
|
-
import { defineCommand as
|
|
16333
|
+
import { defineCommand as defineCommand135 } from "citty";
|
|
16217
16334
|
registerSchema({
|
|
16218
16335
|
command: "videos.delete",
|
|
16219
16336
|
description: "Delete a video by ID",
|
|
@@ -16227,7 +16344,7 @@ registerSchema({
|
|
|
16227
16344
|
}
|
|
16228
16345
|
}
|
|
16229
16346
|
});
|
|
16230
|
-
var deleteCommand3 =
|
|
16347
|
+
var deleteCommand3 = defineCommand135({
|
|
16231
16348
|
meta: {
|
|
16232
16349
|
name: "delete",
|
|
16233
16350
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -16268,7 +16385,7 @@ var deleteCommand3 = defineCommand140({
|
|
|
16268
16385
|
});
|
|
16269
16386
|
|
|
16270
16387
|
// src/commands/videos/get.ts
|
|
16271
|
-
import { defineCommand as
|
|
16388
|
+
import { defineCommand as defineCommand136 } from "citty";
|
|
16272
16389
|
registerSchema({
|
|
16273
16390
|
command: "videos.get",
|
|
16274
16391
|
description: "Get a single video by ID",
|
|
@@ -16276,7 +16393,7 @@ registerSchema({
|
|
|
16276
16393
|
id: { type: "string", description: "Video ID", required: true }
|
|
16277
16394
|
}
|
|
16278
16395
|
});
|
|
16279
|
-
var
|
|
16396
|
+
var getCommand5 = defineCommand136({
|
|
16280
16397
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
16281
16398
|
args: {
|
|
16282
16399
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -16313,7 +16430,7 @@ var getCommand6 = defineCommand141({
|
|
|
16313
16430
|
});
|
|
16314
16431
|
|
|
16315
16432
|
// src/commands/videos/search.ts
|
|
16316
|
-
import { defineCommand as
|
|
16433
|
+
import { defineCommand as defineCommand137 } from "citty";
|
|
16317
16434
|
registerSchema({
|
|
16318
16435
|
command: "videos.search",
|
|
16319
16436
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -16323,7 +16440,7 @@ registerSchema({
|
|
|
16323
16440
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
16324
16441
|
}
|
|
16325
16442
|
});
|
|
16326
|
-
var searchCommand3 =
|
|
16443
|
+
var searchCommand3 = defineCommand137({
|
|
16327
16444
|
meta: {
|
|
16328
16445
|
name: "search",
|
|
16329
16446
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -16372,7 +16489,7 @@ var searchCommand3 = defineCommand142({
|
|
|
16372
16489
|
// src/commands/videos/upload.ts
|
|
16373
16490
|
import { readFile as readFile10, stat as stat3 } from "fs/promises";
|
|
16374
16491
|
import { extname as extname3 } from "path";
|
|
16375
|
-
import { defineCommand as
|
|
16492
|
+
import { defineCommand as defineCommand138 } from "citty";
|
|
16376
16493
|
var MIME_MAP2 = {
|
|
16377
16494
|
".mp4": "video/mp4",
|
|
16378
16495
|
".mov": "video/quicktime",
|
|
@@ -16406,7 +16523,7 @@ function detectContentType2(filePath) {
|
|
|
16406
16523
|
}
|
|
16407
16524
|
return mime;
|
|
16408
16525
|
}
|
|
16409
|
-
var uploadCommand2 =
|
|
16526
|
+
var uploadCommand2 = defineCommand138({
|
|
16410
16527
|
meta: {
|
|
16411
16528
|
name: "upload",
|
|
16412
16529
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -16460,7 +16577,7 @@ var uploadCommand2 = defineCommand143({
|
|
|
16460
16577
|
});
|
|
16461
16578
|
|
|
16462
16579
|
// src/commands/videos/index.ts
|
|
16463
|
-
var videosCommand =
|
|
16580
|
+
var videosCommand = defineCommand139({
|
|
16464
16581
|
meta: {
|
|
16465
16582
|
name: "videos",
|
|
16466
16583
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete.
|
|
@@ -16473,7 +16590,7 @@ Examples:
|
|
|
16473
16590
|
baker videos delete <video-id> --dry-run`
|
|
16474
16591
|
},
|
|
16475
16592
|
subCommands: {
|
|
16476
|
-
get:
|
|
16593
|
+
get: getCommand5,
|
|
16477
16594
|
search: searchCommand3,
|
|
16478
16595
|
upload: uploadCommand2,
|
|
16479
16596
|
delete: deleteCommand3
|
|
@@ -16481,10 +16598,10 @@ Examples:
|
|
|
16481
16598
|
});
|
|
16482
16599
|
|
|
16483
16600
|
// src/commands/winning-ads/index.ts
|
|
16484
|
-
import { defineCommand as
|
|
16601
|
+
import { defineCommand as defineCommand142 } from "citty";
|
|
16485
16602
|
|
|
16486
16603
|
// src/commands/winning-ads/advertisers.ts
|
|
16487
|
-
import { defineCommand as
|
|
16604
|
+
import { defineCommand as defineCommand140 } from "citty";
|
|
16488
16605
|
registerSchema({
|
|
16489
16606
|
command: "winning-ads.advertisers",
|
|
16490
16607
|
description: "Resolve a brand name to advertiser_id(s) in the ad-dna corpus \u2014 to find your OWN advertiser (to --exclude-advertiser) or a competitor (to --advertiser-id).",
|
|
@@ -16497,7 +16614,7 @@ registerSchema({
|
|
|
16497
16614
|
function identity(record) {
|
|
16498
16615
|
return record;
|
|
16499
16616
|
}
|
|
16500
|
-
var advertisersCommand2 =
|
|
16617
|
+
var advertisersCommand2 = defineCommand140({
|
|
16501
16618
|
meta: {
|
|
16502
16619
|
name: "advertisers",
|
|
16503
16620
|
description: 'Resolve a brand name to advertiser_id(s). Use it to find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id. Example: baker winning-ads advertisers "Deel" --output md'
|
|
@@ -16548,7 +16665,7 @@ var advertisersCommand2 = defineCommand145({
|
|
|
16548
16665
|
});
|
|
16549
16666
|
|
|
16550
16667
|
// src/commands/winning-ads/search.ts
|
|
16551
|
-
import { defineCommand as
|
|
16668
|
+
import { defineCommand as defineCommand141 } from "citty";
|
|
16552
16669
|
registerSchema({
|
|
16553
16670
|
command: "winning-ads.search",
|
|
16554
16671
|
description: "Search the ad-dna corpus of scored winning ads. Returns a lean shortlist (advertiser, summary, scores, media_url) to pick a reference to reproduce.",
|
|
@@ -16656,7 +16773,7 @@ function buildSearchBody(args) {
|
|
|
16656
16773
|
}
|
|
16657
16774
|
return body;
|
|
16658
16775
|
}
|
|
16659
|
-
var searchCommand4 =
|
|
16776
|
+
var searchCommand4 = defineCommand141({
|
|
16660
16777
|
meta: {
|
|
16661
16778
|
name: "search",
|
|
16662
16779
|
description: "Search winning reference ads. Example: baker winning-ads search 'B2B SaaS before/after AI automation' --platform meta --format static --winner-category winner --exclude-advertiser adv_123 --output md"
|
|
@@ -16768,7 +16885,7 @@ var searchCommand4 = defineCommand146({
|
|
|
16768
16885
|
});
|
|
16769
16886
|
|
|
16770
16887
|
// src/commands/winning-ads/index.ts
|
|
16771
|
-
var winningAdsCommand =
|
|
16888
|
+
var winningAdsCommand = defineCommand142({
|
|
16772
16889
|
meta: {
|
|
16773
16890
|
name: "winning-ads",
|
|
16774
16891
|
description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
|
|
@@ -16808,7 +16925,7 @@ function getCliVersion() {
|
|
|
16808
16925
|
}
|
|
16809
16926
|
|
|
16810
16927
|
// src/cli.ts
|
|
16811
|
-
var main =
|
|
16928
|
+
var main = defineCommand143({
|
|
16812
16929
|
meta: {
|
|
16813
16930
|
name: "baker",
|
|
16814
16931
|
version: getCliVersion(),
|
|
@@ -16822,7 +16939,6 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
16822
16939
|
},
|
|
16823
16940
|
subCommands: {
|
|
16824
16941
|
actions: actionsCommand,
|
|
16825
|
-
missions: missionsCommand,
|
|
16826
16942
|
"scheduled-actions": scheduledActionsCommand,
|
|
16827
16943
|
ads: adsCommand,
|
|
16828
16944
|
ga4: ga4Command,
|