@koda-sl/baker-cli 0.846.0 → 0.847.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +1 -0
  2. package/dist/{ads-47ISOFKG.js → ads-2SBIPZJI.js} +3 -3
  3. package/dist/{analytics-IXZHQ2ZZ.js → analytics-MZ5A66JO.js} +13 -13
  4. package/dist/{chunk-LSNLFNDJ.js → chunk-37NXS55Q.js} +2 -2
  5. package/dist/{chunk-V34Q2PYJ.js → chunk-HORX3JLB.js} +2 -2
  6. package/dist/{chunk-5TKGCYSU.js → chunk-OQQN2UJS.js} +2 -2
  7. package/dist/{chunk-ZWLYPZWW.js → chunk-SCK7U53A.js} +3 -3
  8. package/dist/{chunk-SXZ537Q2.js → chunk-STWMK24H.js} +2 -2
  9. package/dist/{chunk-PNOKIJFM.js → chunk-T7GAC2WG.js} +8 -2
  10. package/dist/chunk-T7GAC2WG.js.map +1 -0
  11. package/dist/cli.js +3 -3
  12. package/dist/{funnel-UFYTP7LR.js → funnel-YR3ROIPN.js} +3 -3
  13. package/dist/{google-RX4QDXLD.js → google-BFBRJRZP.js} +2 -2
  14. package/dist/{lookup-VGSMSP7E.js → lookup-IAY43D6F.js} +4 -4
  15. package/dist/{performance-LYCO7VAB.js → performance-GIUF4NDE.js} +2 -2
  16. package/dist/{plan-JS42ZMCZ.js → plan-LVTD6FZI.js} +3 -3
  17. package/dist/{questionnaire-S7UADGOY.js → questionnaire-7Y4QYVC6.js} +3 -3
  18. package/dist/{sends-WF4IKUFF.js → sends-TCVUTCLV.js} +66 -16
  19. package/dist/sends-TCVUTCLV.js.map +1 -0
  20. package/dist/{sources-OVLH6OZ2.js → sources-RA2KD7VO.js} +4 -4
  21. package/dist/{unstage-JZAIRBVA.js → unstage-6QVKZITE.js} +3 -3
  22. package/dist/{url-options-JK525H2M.js → url-options-E6FNFBE3.js} +2 -2
  23. package/package.json +1 -1
  24. package/dist/chunk-PNOKIJFM.js.map +0 -1
  25. package/dist/sends-WF4IKUFF.js.map +0 -1
  26. /package/dist/{ads-47ISOFKG.js.map → ads-2SBIPZJI.js.map} +0 -0
  27. /package/dist/{analytics-IXZHQ2ZZ.js.map → analytics-MZ5A66JO.js.map} +0 -0
  28. /package/dist/{chunk-LSNLFNDJ.js.map → chunk-37NXS55Q.js.map} +0 -0
  29. /package/dist/{chunk-V34Q2PYJ.js.map → chunk-HORX3JLB.js.map} +0 -0
  30. /package/dist/{chunk-5TKGCYSU.js.map → chunk-OQQN2UJS.js.map} +0 -0
  31. /package/dist/{chunk-ZWLYPZWW.js.map → chunk-SCK7U53A.js.map} +0 -0
  32. /package/dist/{chunk-SXZ537Q2.js.map → chunk-STWMK24H.js.map} +0 -0
  33. /package/dist/{funnel-UFYTP7LR.js.map → funnel-YR3ROIPN.js.map} +0 -0
  34. /package/dist/{google-RX4QDXLD.js.map → google-BFBRJRZP.js.map} +0 -0
  35. /package/dist/{lookup-VGSMSP7E.js.map → lookup-IAY43D6F.js.map} +0 -0
  36. /package/dist/{performance-LYCO7VAB.js.map → performance-GIUF4NDE.js.map} +0 -0
  37. /package/dist/{plan-JS42ZMCZ.js.map → plan-LVTD6FZI.js.map} +0 -0
  38. /package/dist/{questionnaire-S7UADGOY.js.map → questionnaire-7Y4QYVC6.js.map} +0 -0
  39. /package/dist/{sources-OVLH6OZ2.js.map → sources-RA2KD7VO.js.map} +0 -0
  40. /package/dist/{unstage-JZAIRBVA.js.map → unstage-6QVKZITE.js.map} +0 -0
  41. /package/dist/{url-options-JK525H2M.js.map → url-options-E6FNFBE3.js.map} +0 -0
package/dist/cli.js CHANGED
@@ -694,9 +694,9 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
694
694
  capabilities: () => import("./capabilities-O42RDOEU.js").then((m) => m.capabilitiesCommand),
695
695
  actions: () => import("./actions-SYQXXHUZ.js").then((m) => m.actionsCommand),
696
696
  "scheduled-agents": () => import("./scheduled-agents-6W2PJFSE.js").then((m) => m.scheduledAgentsCommand),
697
- ads: () => import("./ads-47ISOFKG.js").then((m) => m.adsCommand),
697
+ ads: () => import("./ads-2SBIPZJI.js").then((m) => m.adsCommand),
698
698
  brand: () => import("./brand-SDDWXOOT.js").then((m) => m.brandCommand),
699
- analytics: () => import("./analytics-IXZHQ2ZZ.js").then((m) => m.analyticsCommand),
699
+ analytics: () => import("./analytics-MZ5A66JO.js").then((m) => m.analyticsCommand),
700
700
  experiment: () => import("./experiment-WEWASTVO.js").then((m) => m.experimentCommand),
701
701
  ga4: () => import("./ga4-XVCLJG6R.js").then((m) => m.ga4Command),
702
702
  gsc: () => import("./gsc-WR65MURL.js").then((m) => m.gscCommand),
@@ -708,7 +708,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
708
708
  rules: () => import("./rules-UB4ZDOIJ.js").then((m) => m.rulesCommand),
709
709
  files: () => import("./files-CVB5LNVZ.js").then((m) => m.filesCommand),
710
710
  flows: () => import("./flows-XSFCYM74.js").then((m) => m.flowsCommand),
711
- funnel: () => import("./funnel-UFYTP7LR.js").then((m) => m.funnelCommand),
711
+ funnel: () => import("./funnel-YR3ROIPN.js").then((m) => m.funnelCommand),
712
712
  images: () => import("./images-DTTTHKY5.js").then((m) => m.imagesCommand),
713
713
  studio: () => import("./studio-RMYKICEJ.js").then((m) => m.studioCommand),
714
714
  avatars: () => import("./avatars-YBG37NV5.js").then((m) => m.avatarsCommand),
@@ -2,7 +2,7 @@ import {
2
2
  flowEventKeys,
3
3
  parseFields,
4
4
  renderMarkdown
5
- } from "./chunk-5TKGCYSU.js";
5
+ } from "./chunk-OQQN2UJS.js";
6
6
  import {
7
7
  flowDataPath,
8
8
  listFlowSlugs
@@ -11,7 +11,7 @@ import {
11
11
  FUNNEL_VERTICALS,
12
12
  funnelRequestSchema
13
13
  } from "./chunk-5YOMORZ2.js";
14
- import "./chunk-PNOKIJFM.js";
14
+ import "./chunk-T7GAC2WG.js";
15
15
  import "./chunk-5TURKO4J.js";
16
16
  import {
17
17
  repeatedValues
@@ -698,4 +698,4 @@ function workspaceForms() {
698
698
  export {
699
699
  funnelCommand
700
700
  };
701
- //# sourceMappingURL=funnel-UFYTP7LR.js.map
701
+ //# sourceMappingURL=funnel-YR3ROIPN.js.map
@@ -3730,7 +3730,7 @@ Full guide: __tooling__/docs/tools/baker/ads-google.md`
3730
3730
  subCommands: {
3731
3731
  accounts: () => import("./accounts-S7CRQTBB.js").then((m) => m.accountsCommand),
3732
3732
  currency: () => import("./currency-GMVPN52V.js").then((m) => m.currencyCommand),
3733
- "url-options": () => import("./url-options-JK525H2M.js").then((m) => m.urlOptionsCommand),
3733
+ "url-options": () => import("./url-options-E6FNFBE3.js").then((m) => m.urlOptionsCommand),
3734
3734
  changes: () => import("./changes-JOJR4K4H.js").then((m) => m.changesCommand),
3735
3735
  invoices: () => import("./account-reads-R6FLJJQ2.js").then((m) => m.invoicesCommand),
3736
3736
  "identity-verification": () => import("./account-reads-R6FLJJQ2.js").then((m) => m.identityVerificationCommand),
@@ -3747,4 +3747,4 @@ Full guide: __tooling__/docs/tools/baker/ads-google.md`
3747
3747
  export {
3748
3748
  googleCommand
3749
3749
  };
3750
- //# sourceMappingURL=google-RX4QDXLD.js.map
3750
+ //# sourceMappingURL=google-BFBRJRZP.js.map
@@ -3,9 +3,9 @@ import {
3
3
  lookupReport,
4
4
  peopleArgs,
5
5
  peopleLimitError
6
- } from "./chunk-ZWLYPZWW.js";
7
- import "./chunk-SXZ537Q2.js";
8
- import "./chunk-PNOKIJFM.js";
6
+ } from "./chunk-SCK7U53A.js";
7
+ import "./chunk-STWMK24H.js";
8
+ import "./chunk-T7GAC2WG.js";
9
9
  import "./chunk-5TURKO4J.js";
10
10
  import "./chunk-NYUWPJ4K.js";
11
11
  import "./chunk-NKQWDEB7.js";
@@ -23,4 +23,4 @@ export {
23
23
  peopleArgs,
24
24
  peopleLimitError
25
25
  };
26
- //# sourceMappingURL=lookup-VGSMSP7E.js.map
26
+ //# sourceMappingURL=lookup-IAY43D6F.js.map
@@ -2,7 +2,7 @@ import {
2
2
  ANALYTICS_BUSY_FIX,
3
3
  isAnalyticsBusy,
4
4
  retryOnceIfBusy
5
- } from "./chunk-PNOKIJFM.js";
5
+ } from "./chunk-T7GAC2WG.js";
6
6
  import "./chunk-5TURKO4J.js";
7
7
  import {
8
8
  withWindowSpellings
@@ -6290,4 +6290,4 @@ Full guide: __tooling__/docs/tools/baker/ads-performance.md`
6290
6290
  export {
6291
6291
  performanceCommand
6292
6292
  };
6293
- //# sourceMappingURL=performance-LYCO7VAB.js.map
6293
+ //# sourceMappingURL=performance-GIUF4NDE.js.map
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-ZWANN4QQ.js";
7
7
  import {
8
8
  trackingPlanErrorEnvelope
9
- } from "./chunk-SXZ537Q2.js";
9
+ } from "./chunk-STWMK24H.js";
10
10
  import {
11
11
  ANALYTICS_EVENT_DOORS
12
- } from "./chunk-PNOKIJFM.js";
12
+ } from "./chunk-T7GAC2WG.js";
13
13
  import "./chunk-5TURKO4J.js";
14
14
  import "./chunk-QB72UFAO.js";
15
15
  import "./chunk-D5FY4FAK.js";
@@ -210,4 +210,4 @@ var planCommand = defineCommand({
210
210
  export {
211
211
  planCommand
212
212
  };
213
- //# sourceMappingURL=plan-JS42ZMCZ.js.map
213
+ //# sourceMappingURL=plan-LVTD6FZI.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  questionnaireErrorEnvelope
3
- } from "./chunk-SXZ537Q2.js";
4
- import "./chunk-PNOKIJFM.js";
3
+ } from "./chunk-STWMK24H.js";
4
+ import "./chunk-T7GAC2WG.js";
5
5
  import "./chunk-5TURKO4J.js";
6
6
  import "./chunk-NYUWPJ4K.js";
7
7
  import "./chunk-NKQWDEB7.js";
@@ -100,4 +100,4 @@ var questionnaireCommand = defineCommand({
100
100
  export {
101
101
  questionnaireCommand
102
102
  };
103
- //# sourceMappingURL=questionnaire-S7UADGOY.js.map
103
+ //# sourceMappingURL=questionnaire-7Y4QYVC6.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  ConversionArgsError,
3
3
  onlyOnce
4
- } from "./chunk-V34Q2PYJ.js";
4
+ } from "./chunk-HORX3JLB.js";
5
5
  import {
6
6
  sendsRequestSchema
7
- } from "./chunk-PNOKIJFM.js";
7
+ } from "./chunk-T7GAC2WG.js";
8
8
  import "./chunk-5TURKO4J.js";
9
9
  import {
10
10
  SEND_PLATFORMS,
@@ -33,7 +33,13 @@ import { defineCommand } from "citty";
33
33
  var SET_FLAGS = ["--source-event", "--platform", "--tag", "--event"];
34
34
  function parseSendsArgs(raw, argv, now = Date.now()) {
35
35
  const set = parseSetFlags(raw, argv, now);
36
+ const platform = set === void 0 ? readPlatform(raw, argv) : void 0;
36
37
  const remove = onlyOnce(raw.remove, "--remove", argv);
38
+ if (platform !== void 0 && remove !== void 0) {
39
+ throw new ConversionArgsError(
40
+ "--platform narrows a read, and --remove stages a change: a removal is answered in full, never narrowed. Drop --platform."
41
+ );
42
+ }
37
43
  const days = raw.days === void 0 ? void 0 : Number(raw.days);
38
44
  if (days !== void 0 && (!Number.isInteger(days) || days <= 0 || days > 400)) {
39
45
  throw new ConversionArgsError("--days must be a whole number of days, from 1 to 400.");
@@ -42,12 +48,25 @@ function parseSendsArgs(raw, argv, now = Date.now()) {
42
48
  return {
43
49
  ...set === void 0 ? {} : { set },
44
50
  ...remove === void 0 ? {} : { remove },
51
+ ...platform === void 0 ? {} : { platform },
45
52
  ...days === void 0 ? {} : { days },
46
53
  ...uploads,
47
54
  ...raw.history === true ? { history: true } : {},
48
55
  full: raw.full === true
49
56
  };
50
57
  }
58
+ function readPlatform(raw, argv) {
59
+ const platform = onlyOnce(raw.platform, "--platform", argv);
60
+ return platform === void 0 ? void 0 : sendPlatform(platform);
61
+ }
62
+ function sendPlatform(platform) {
63
+ if (!isSendPlatform(platform)) {
64
+ throw new ConversionArgsError(
65
+ `"${platform}" is not somewhere a conversion can be sent \u2014 --platform is one of ${SEND_PLATFORMS.join(", ")}.`
66
+ );
67
+ }
68
+ return platform;
69
+ }
51
70
  function parseUploadsFlags(raw, argv) {
52
71
  const uploads = onlyOnce(raw.uploads, "--uploads", argv);
53
72
  if (raw.uploads !== void 0 && uploads === void 0) {
@@ -106,9 +125,10 @@ function parseSetFlags(raw, argv, now) {
106
125
  const given = SET_FLAGS.filter((flag) => values[flag] !== void 0);
107
126
  const set = raw.set === true;
108
127
  if (!set) {
109
- if (given.length > 0) {
128
+ const shaping = sendOnlyFlags(raw, argv);
129
+ if (shaping.length > 0 || given.some((flag) => flag !== "--platform")) {
110
130
  throw new ConversionArgsError(
111
- `${given.join(", ")} describe a send, so add --set to stage it. Without --set the command only reads.`
131
+ `${[...given, ...shaping].join(", ")} describe a send, so add --set to stage it. Without --set the command only reads, and --platform on its own narrows that read to one platform.`
112
132
  );
113
133
  }
114
134
  return void 0;
@@ -119,12 +139,7 @@ function parseSetFlags(raw, argv, now) {
119
139
  `--set needs ${SET_FLAGS.join(", ")}; missing ${missing.join(", ")}. Copy --tag from platforms[].tags of a plain \`baker analytics sends\`, never from memory.`
120
140
  );
121
141
  }
122
- const platform = values["--platform"] ?? "";
123
- if (!isSendPlatform(platform)) {
124
- throw new ConversionArgsError(
125
- `"${platform}" is not somewhere a conversion can be sent \u2014 --platform is one of ${SEND_PLATFORMS.join(", ")}.`
126
- );
127
- }
142
+ const platform = sendPlatform(values["--platform"] ?? "");
128
143
  const event = values["--event"] ?? "";
129
144
  const templated = sendEventProblem(platform, event);
130
145
  if (templated !== null) {
@@ -143,6 +158,14 @@ function parseSetFlags(raw, argv, now) {
143
158
  ...parameters === void 0 ? {} : { parameters }
144
159
  };
145
160
  }
161
+ function sendOnlyFlags(raw, argv) {
162
+ return [
163
+ ...raw.parameter !== void 0 || argv.some((arg) => arg === "--parameter" || arg.startsWith("--parameter=")) ? ["--parameter"] : [],
164
+ ...raw.from === void 0 ? [] : ["--from"],
165
+ ...raw.account === void 0 ? [] : ["--account"],
166
+ ...raw.id === void 0 ? [] : ["--id"]
167
+ ];
168
+ }
146
169
  function originFlag(raw, argv) {
147
170
  const from = onlyOnce(raw.from, "--from", argv) ?? "any";
148
171
  if (from === "any") return { origin: "any" };
@@ -163,7 +186,8 @@ function sendsWrite(args2) {
163
186
  ...args2.uploads === void 0 ? {} : { uploads: args2.uploads },
164
187
  ...args2.failedOnly === void 0 ? {} : { failedOnly: args2.failedOnly },
165
188
  ...args2.skippedOnly === void 0 ? {} : { skippedOnly: args2.skippedOnly },
166
- ...args2.history === void 0 ? {} : { history: args2.history }
189
+ ...args2.history === void 0 ? {} : { history: args2.history },
190
+ ...args2.platform === void 0 ? {} : { platform: args2.platform }
167
191
  };
168
192
  const parsed = sendsRequestSchema.safeParse(body);
169
193
  if (!parsed.success) {
@@ -174,8 +198,9 @@ function sendsWrite(args2) {
174
198
  }
175
199
  return parsed.data;
176
200
  }
177
- function sendsView(response, full) {
178
- const { carries, templateFields, history, ...rest } = response.data;
201
+ function sendsView(response, full, platform) {
202
+ const data = platform === void 0 ? response.data : onlyTo(response.data, platform);
203
+ const { carries, templateFields, history, ...rest } = data;
179
204
  return {
180
205
  ok: true,
181
206
  data: {
@@ -186,6 +211,30 @@ function sendsView(response, full) {
186
211
  ...response.hints && response.hints.length > 0 ? { hints: response.hints } : {}
187
212
  };
188
213
  }
214
+ function onlyTo(data, platform) {
215
+ const sends = data.sends.filter((send) => send.platform === platform);
216
+ const ids = new Set(sends.map((send) => send.id));
217
+ const pick = (counts) => platform in counts ? { [platform]: counts[platform] ?? 0 } : {};
218
+ return {
219
+ ...data,
220
+ sends,
221
+ ...data.staged === void 0 ? {} : {
222
+ staged: {
223
+ set: data.staged.set.filter((send) => send.platform === platform),
224
+ remove: data.staged.remove.filter((id) => ids.has(id))
225
+ }
226
+ },
227
+ platforms: data.platforms.filter((row) => row.platform === platform),
228
+ parameters: data.parameters.filter((row) => row.platform === platform),
229
+ events: data.events.map(
230
+ (event) => event.match === void 0 ? event : {
231
+ ...event,
232
+ match: { ...event.match, platforms: pick(event.match.platforms), withheld: pick(event.match.withheld) }
233
+ }
234
+ ),
235
+ ...data.history === void 0 ? {} : { history: data.history.filter((row) => ids.has(row.sendId)) }
236
+ };
237
+ }
189
238
  function historyView(row, full) {
190
239
  const at = (ms) => new Date(ms).toISOString();
191
240
  const removed = row.integrationRemovedAt;
@@ -220,7 +269,7 @@ var args = {
220
269
  },
221
270
  platform: {
222
271
  type: "string",
223
- description: `Where it goes: one of ${SEND_PLATFORMS.join(", ")}`,
272
+ description: `Where it goes: one of ${SEND_PLATFORMS.join(", ")}. With --set, the send's destination; without it, narrows the read to that platform's sends (live and staged), its tags, parameters and each event's match there \u2014 \`baker analytics sends --platform meta\``,
224
273
  required: false
225
274
  },
226
275
  tag: {
@@ -304,6 +353,7 @@ Start here:
304
353
  baker analytics sends --set --source-event page:lead_completed_step_2 --platform meta --tag <tagId> --event Lead \u2014 an event the pixel and/or the API send; uploaded once per event id
305
354
  baker analytics sends --set --source-event page:deal_won --platform meta --tag <tagId> --event {{properties.plan}} \u2014 a Meta event named after what each one carries
306
355
  baker analytics sends --remove s1 \u2014 stop one
356
+ baker analytics sends --platform meta \u2014 only what goes to Meta: its sends, tags, parameters and each event's match there
307
357
  baker analytics sends --days 7 \u2014 outcomes over the last week
308
358
  baker analytics sends --uploads s1 --failed \u2014 the refused uploads, each with the event and why: the platform's own words, or Baker's code when it never left Baker
309
359
  baker analytics sends --uploads s1 --skipped \u2014 the events never uploaded, each with what the platform needed and they lacked
@@ -324,7 +374,7 @@ An empty \`events[]\` means none of the client's systems sends an event yet and
324
374
  try {
325
375
  const parsed = parseSendsArgs(raw, process.argv);
326
376
  const response = await apiPost("/api/analytics/sends", sendsWrite(parsed));
327
- writeJsonEnvelope(sendsView(response, parsed.full));
377
+ writeJsonEnvelope(sendsView(response, parsed.full, parsed.platform));
328
378
  } catch (err) {
329
379
  handleError(err);
330
380
  }
@@ -352,4 +402,4 @@ export {
352
402
  sendsView,
353
403
  sendsWrite
354
404
  };
355
- //# sourceMappingURL=sends-WF4IKUFF.js.map
405
+ //# sourceMappingURL=sends-TCVUTCLV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/commands/analytics/sends.ts"],"sourcesContent":["/**\n * `baker analytics sends` — where this company's system events are sent, and\n * changing it.\n *\n * A send hangs off an event one of the client's own systems raises, by its\n * key: `page:deal_won` from HubSpot → Meta Purchase. Every such event is\n * uploaded to the platform with who the person is, the click that brought\n * them and the amount forwarded automatically. Nothing is mapped. What happens\n * on a page or in a Form is not sendable here: the page's own pixels and the\n * Form's own side effects already send those.\n *\n * A write STAGES: it lands when the chat is published, and from then on it\n * spends ad budget on every event under the key. The dashboard's Sources page\n * applies at once because the person clicking is the review; an agent's\n * proposal gets its review at Publish.\n */\n\nimport {\n isSendPlatform,\n SEND_PLATFORMS,\n type SendPlatform,\n type SendsRequest,\n type SendsResponse,\n sendEventProblem,\n sendsRequestSchema,\n} from \"@baker/api/analytics\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiPost } from \"../../client.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { writeJsonEnvelope } from \"../ads/output.ts\";\nimport { ConversionArgsError, onlyOnce } from \"./conversionArgs.ts\";\n\nexport interface SendsArgs {\n set?: {\n id: string;\n eventKey: string;\n platform: string;\n tagId: string;\n event: string;\n account?: string;\n parameters?: Record<string, string>;\n };\n remove?: string;\n /** On a read: only what goes to this platform. */\n platform?: SendPlatform;\n days?: number;\n /** One send's uploads, by id, and whether only the refused ones. */\n uploads?: string;\n failedOnly?: boolean;\n /** With `uploads`: only the events it skipped, for want of anything to match. */\n skippedOnly?: boolean;\n /** When each live send was set up, and whether its integration was removed. */\n history?: boolean;\n full: boolean;\n}\n\nconst SET_FLAGS = [\"--source-event\", \"--platform\", \"--tag\", \"--event\"] as const;\n\n/**\n * The flags, checked for the shapes that would otherwise stage the wrong\n * send in silence. Pure, so the refusals are tier-1 tested.\n */\nexport function parseSendsArgs(raw: Record<string, unknown>, argv: readonly string[], now = Date.now()): SendsArgs {\n const set = parseSetFlags(raw, argv, now);\n const platform = set === undefined ? readPlatform(raw, argv) : undefined;\n const remove = onlyOnce(raw.remove, \"--remove\", argv);\n if (platform !== undefined && remove !== undefined) {\n throw new ConversionArgsError(\n \"--platform narrows a read, and --remove stages a change: a removal is answered in full, never narrowed. Drop --platform.\",\n );\n }\n\n const days = raw.days === undefined ? undefined : Number(raw.days);\n if (days !== undefined && (!Number.isInteger(days) || days <= 0 || days > 400)) {\n throw new ConversionArgsError(\"--days must be a whole number of days, from 1 to 400.\");\n }\n\n const uploads = parseUploadsFlags(raw, argv);\n\n return {\n ...(set === undefined ? {} : { set }),\n ...(remove === undefined ? {} : { remove }),\n ...(platform === undefined ? {} : { platform }),\n ...(days === undefined ? {} : { days }),\n ...uploads,\n ...(raw.history === true ? { history: true } : {}),\n full: raw.full === true,\n };\n}\n\n/** `--platform` without `--set`: the destination a read is narrowed to. */\nfunction readPlatform(raw: Record<string, unknown>, argv: readonly string[]): SendPlatform | undefined {\n const platform = onlyOnce(raw.platform, \"--platform\", argv);\n return platform === undefined ? undefined : sendPlatform(platform);\n}\n\nfunction sendPlatform(platform: string): SendPlatform {\n if (!isSendPlatform(platform)) {\n throw new ConversionArgsError(\n `\"${platform}\" is not somewhere a conversion can be sent — --platform is one of ${SEND_PLATFORMS.join(\", \")}.`,\n );\n }\n return platform;\n}\n\n/** `--uploads <sendId>` and its narrowings: a named live send, never an empty one. */\nfunction parseUploadsFlags(\n raw: Record<string, unknown>,\n argv: readonly string[],\n): Pick<SendsArgs, \"uploads\" | \"failedOnly\" | \"skippedOnly\"> {\n const uploads = onlyOnce(raw.uploads, \"--uploads\", argv);\n if (raw.uploads !== undefined && uploads === undefined) {\n throw new ConversionArgsError(\n \"--uploads takes the id of a live send (`sends[].id`); read them first with `baker analytics sends`.\",\n );\n }\n if (raw.failed === true && uploads === undefined) {\n throw new ConversionArgsError(\"--failed narrows --uploads <sendId> to the refused ones; name the send.\");\n }\n if (raw.skipped === true && uploads === undefined) {\n throw new ConversionArgsError(\n \"--skipped narrows --uploads <sendId> to the events it never uploaded; name the send.\",\n );\n }\n return {\n ...(uploads === undefined ? {} : { uploads }),\n ...(raw.failed === true ? { failedOnly: true } : {}),\n ...(raw.skipped === true ? { skippedOnly: true } : {}),\n };\n}\n\n/** The value a repeated flag carries at this position, in either spelling, or nothing. */\nfunction flagValueAt(argv: readonly string[], flag: string, index: number): string | undefined {\n const arg = argv[index] ?? \"\";\n if (arg === flag) return argv[index + 1];\n return arg.startsWith(`${flag}=`) ? arg.slice(flag.length + 1) : undefined;\n}\n\n/**\n * Every `--parameter name=template` on the command line, in order. Read off\n * argv rather than the parsed args because citty keeps only the last value\n * of a repeated flag — the defect that once staged one of three UTMs.\n */\nexport function parseParameterArgs(argv: readonly string[]): Record<string, string> | undefined {\n const parameters: Record<string, string> = {};\n for (let index = 0; index < argv.length; index += 1) {\n const pair = flagValueAt(argv, \"--parameter\", index);\n if (pair === undefined) continue;\n const eq = pair.indexOf(\"=\");\n const name = (eq === -1 ? pair : pair.slice(0, eq)).trim();\n const template = eq === -1 ? \"\" : pair.slice(eq + 1).trim();\n if (name === \"\" || template === \"\") {\n throw new ConversionArgsError(\n `--parameter needs <name>=<template>, like --parameter content_name={{properties.plan}}; got \"${pair}\".`,\n );\n }\n parameters[name] = template;\n }\n return Object.keys(parameters).length === 0 ? undefined : parameters;\n}\n\n/**\n * The send `--set` describes, or nothing on a read.\n *\n * The four flags are only meaningful together and only under `--set` (but\n * `--platform` alone, which narrows a read — `readPlatform`): a send\n * described without it would answer ok and stage nothing, and a `--set` with\n * a piece missing would be refused by the server with the field named but not\n * the flag.\n */\nfunction parseSetFlags(raw: Record<string, unknown>, argv: readonly string[], now: number): SendsArgs[\"set\"] {\n if (raw.conversion !== undefined) {\n throw new ConversionArgsError(\n \"--conversion is gone: a send is on a system's EVENT, not a conversion. Pass --source-event <key> — one of events[].eventKey from a plain `baker analytics sends` (page:<name>).\",\n );\n }\n const values = {\n \"--source-event\": onlyOnce(raw[\"source-event\"] ?? raw.sourceEvent, \"--source-event\", argv),\n \"--platform\": onlyOnce(raw.platform, \"--platform\", argv),\n \"--tag\": onlyOnce(raw.tag, \"--tag\", argv),\n \"--event\": onlyOnce(raw.event, \"--event\", argv),\n };\n const given = SET_FLAGS.filter((flag) => values[flag] !== undefined);\n const set = raw.set === true;\n\n if (!set) {\n // `--platform` alone narrows a read; with any other piece of a send it describes one.\n const shaping = sendOnlyFlags(raw, argv);\n if (shaping.length > 0 || given.some((flag) => flag !== \"--platform\")) {\n throw new ConversionArgsError(\n `${[...given, ...shaping].join(\", \")} describe a send, so add --set to stage it. Without --set the command only reads, and --platform on its own narrows that read to one platform.`,\n );\n }\n return undefined;\n }\n\n const missing = SET_FLAGS.filter((flag) => values[flag] === undefined);\n if (missing.length > 0) {\n throw new ConversionArgsError(\n `--set needs ${SET_FLAGS.join(\", \")}; missing ${missing.join(\", \")}. Copy --tag from platforms[].tags of a plain \\`baker analytics sends\\`, never from memory.`,\n );\n }\n const platform = sendPlatform(values[\"--platform\"] ?? \"\");\n\n const event = values[\"--event\"] ?? \"\";\n const templated = sendEventProblem(platform, event);\n if (templated !== null) {\n throw new ConversionArgsError(`--event ${event} cannot be sent to ${platform}. ${templated}`);\n }\n\n const account = onlyOnce(raw.account, \"--account\", argv);\n const parameters = parseParameterArgs(argv);\n return {\n id: onlyOnce(raw.id, \"--id\", argv) ?? sendIdFor(now),\n eventKey: values[\"--source-event\"] ?? \"\",\n ...originFlag(raw, argv),\n platform,\n tagId: values[\"--tag\"] ?? \"\",\n event,\n ...(account === undefined ? {} : { account }),\n ...(parameters === undefined ? {} : { parameters }),\n };\n}\n\n/** The options that only shape a staged send, given on the command line. */\nfunction sendOnlyFlags(raw: Record<string, unknown>, argv: readonly string[]): string[] {\n return [\n ...(raw.parameter !== undefined || argv.some((arg) => arg === \"--parameter\" || arg.startsWith(\"--parameter=\"))\n ? [\"--parameter\"]\n : []),\n ...(raw.from === undefined ? [] : [\"--from\"]),\n ...(raw.account === undefined ? [] : [\"--account\"]),\n ...(raw.id === undefined ? [] : [\"--id\"]),\n ];\n}\n\n/**\n * Which door's events `--set` uploads, as the send spells it: every door the\n * event arrives by (`origin: \"any\"`, the default — one event, one set of\n * destinations, uploaded once when the pixel and the API both report it under\n * one event id), or only the pixel's (`website`) or only the API's and the\n * integrations' (no field at all).\n */\nfunction originFlag(raw: Record<string, unknown>, argv: readonly string[]): { origin?: \"website\" | \"any\" } {\n const from = onlyOnce(raw.from, \"--from\", argv) ?? \"any\";\n if (from === \"any\") return { origin: \"any\" };\n if (from === \"api\") return {};\n if (from === \"pixel\") return { origin: \"website\" };\n throw new ConversionArgsError(\n `--from is any, pixel or api; got \"${from}\". any — the default — uploads the event whichever door it arrives by, once when the pixel and the API both report it with the same event id; pixel only what Baker's pixel sent from the client's website; api only what the API or an integration sent.`,\n );\n}\n\n/** A short id a person can type, when the caller did not choose one. */\nfunction sendIdFor(now: number): string {\n return `s${now.toString(36).slice(-5)}`;\n}\n\n/**\n * The request body, validated against the shared schema here rather than only\n * on the server, so a malformed send is named before a round trip.\n */\nexport function sendsWrite(args: SendsArgs): SendsRequest {\n const body = {\n ...(args.set === undefined ? {} : { set: [args.set] }),\n ...(args.remove === undefined ? {} : { remove: [args.remove] }),\n ...(args.days === undefined ? {} : { days: args.days }),\n ...(args.uploads === undefined ? {} : { uploads: args.uploads }),\n ...(args.failedOnly === undefined ? {} : { failedOnly: args.failedOnly }),\n ...(args.skippedOnly === undefined ? {} : { skippedOnly: args.skippedOnly }),\n ...(args.history === undefined ? {} : { history: args.history }),\n ...(args.platform === undefined ? {} : { platform: args.platform }),\n };\n const parsed = sendsRequestSchema.safeParse(body);\n if (!parsed.success) {\n const issue = parsed.error.issues[0];\n throw new ConversionArgsError(\n `That send cannot be staged — ${issue?.path.join(\".\") || \"set\"}: ${issue?.message ?? \"invalid\"}. Run \\`baker schema analytics.sends\\` for the exact shape.`,\n );\n }\n return parsed.data;\n}\n\n/**\n * What to print. Compact by default: the sends with their outcomes, the\n * platforms with the tags that can send (where a `tagId` is copied from), and\n * the system events that can be sent. `carries` — every field a send forwards\n * — is the same list every time, so it is behind `--full`. A send's history is\n * the day it was set up and the day its integration was removed; the instants\n * are behind `--full`.\n */\nexport function sendsView(response: SendsResponse, full: boolean, platform?: SendPlatform): Record<string, unknown> {\n const data = platform === undefined ? response.data : onlyTo(response.data, platform);\n const { carries, templateFields, history, ...rest } = data;\n return {\n ok: true,\n data: {\n ...rest,\n ...(history === undefined ? {} : { history: history.map((row) => historyView(row, full)) }),\n ...(full ? { carries, templateFields } : {}),\n },\n ...(response.hints && response.hints.length > 0 ? { hints: response.hints } : {}),\n };\n}\n\ntype SendsData = SendsResponse[\"data\"];\n\n/**\n * The read narrowed to one destination: its sends, live and staged, its\n * platform row and parameters, and each event's match on it alone. The\n * events themselves stay — any of them can be sent there.\n */\nfunction onlyTo(data: SendsData, platform: SendPlatform): SendsData {\n const sends = data.sends.filter((send) => send.platform === platform);\n const ids = new Set(sends.map((send) => send.id));\n const pick = (counts: Record<string, number>) => (platform in counts ? { [platform]: counts[platform] ?? 0 } : {});\n return {\n ...data,\n sends,\n ...(data.staged === undefined\n ? {}\n : {\n staged: {\n set: data.staged.set.filter((send) => send.platform === platform),\n remove: data.staged.remove.filter((id) => ids.has(id)),\n },\n }),\n platforms: data.platforms.filter((row) => row.platform === platform),\n parameters: data.parameters.filter((row) => row.platform === platform),\n events: data.events.map((event) =>\n event.match === undefined\n ? event\n : {\n ...event,\n match: { ...event.match, platforms: pick(event.match.platforms), withheld: pick(event.match.withheld) },\n },\n ),\n ...(data.history === undefined ? {} : { history: data.history.filter((row) => ids.has(row.sendId)) }),\n };\n}\n\ntype SendHistoryRow = NonNullable<SendsResponse[\"data\"][\"history\"]>[number];\n\nfunction historyView(row: SendHistoryRow, full: boolean): Record<string, string> {\n const at = (ms: number) => new Date(ms).toISOString();\n const removed = row.integrationRemovedAt;\n if (full) {\n return {\n sendId: row.sendId,\n createdAt: at(row.createdAt),\n ...(removed === undefined ? {} : { integrationRemovedAt: at(removed) }),\n };\n }\n return {\n sendId: row.sendId,\n setUpOn: at(row.createdAt).slice(0, 10),\n ...(removed === undefined ? {} : { integrationRemovedOn: at(removed).slice(0, 10) }),\n };\n}\n\nconst args = {\n set: {\n type: \"boolean\",\n description:\n \"Stage a send, described by --source-event, --platform, --tag and --event. It applies when this chat is published, and from then on every event arriving under that key is uploaded to the platform and spends ad budget — say so to the client, never that it is a preview\",\n required: false,\n },\n \"source-event\": {\n type: \"string\",\n description:\n \"The event to send, by key — one of `events[].eventKey` from a plain `baker analytics sends`: a Source's own event (page:<source name>), or a named event the client's server posts. A Form's or a page's event is refused: the page's own pixels and the Form's side effects already send those\",\n required: false,\n },\n from: {\n type: \"string\",\n description:\n \"Which door's events the send uploads: `any` (default) — the event whichever door it arrives by, uploaded once when the pixel and the API both report it with the same event id; `pixel` — only what Baker's pixel sent from the client's own website (an `events[]` row with origin `website`); `api` — only what the client's server posted or an integration like HubSpot sent\",\n required: false,\n },\n platform: {\n type: \"string\",\n description: `Where it goes: one of ${SEND_PLATFORMS.join(\", \")}. With --set, the send's destination; without it, narrows the read to that platform's sends (live and staged), its tags, parameters and each event's match there — \\`baker analytics sends --platform meta\\``,\n required: false,\n },\n tag: {\n type: \"string\",\n description:\n \"The tag on Tracking that sends it. COPY the id from `platforms[].tags[].tagId` in the response — it is only listed there when the tag holds its server credential, and one typed from memory is refused\",\n required: false,\n },\n event: {\n type: \"string\",\n description:\n 'What the platform calls it — `platforms[].eventMeans` says what each one takes: a Meta or Google Analytics event name (Purchase, Lead, generate_lead), a Google Ads conversion action id copied from `platforms[].conversionActions`, or the conversion label the person gives you (staged as its id; never type an id: one the account does not hold is refused), a LinkedIn conversion rule id, an X event tag id. On Meta and Google Analytics it may be WRITTEN FROM THE EVENT with the same {{path}} mentions --parameter takes: --event {{properties.plan}} sends each event under the plan it carries, --event \"Purchase {{properties.tier}}\" mixes text and a field. An event carrying nothing there is not uploaded. Google Ads, LinkedIn and X take an id THEY issued, so a template is refused there — pass what varies as a --parameter instead. For a GOOGLE ADS id, list the account\\'s conversion actions first and pick by name — `baker ads google query \"SELECT conversion_action.id, conversion_action.name, conversion_action.primary_for_goal FROM conversion_action WHERE conversion_action.status = \\'ENABLED\\'\"` — never guess: Google accepts an upload against an id the account does not hold and files it against nothing',\n required: false,\n },\n account: {\n type: \"string\",\n description: \"LinkedIn only: the ad account the conversion rule belongs to\",\n required: false,\n },\n parameter: {\n type: \"string\",\n description:\n \"<name>=<template>, repeatable, with --set: an EXTRA parameter the platform receives with every upload, beyond who, the click and the amount — Meta's custom_data (content_name, content_category, or your own), a GA4 event parameter, a Google Ads custom variable (must exist in the account), X's contents (content_name, num_items…); LinkedIn takes none. The template is text with {{path}} mentions over the event: its own properties as {{properties.<key>}} (a HubSpot event's --field properties.<key> rows, a server event's `properties`), and the fields `templateFields` lists (--full): value, value_currency, event_name, page_path, city, country, gclid… Example: --parameter content_name={{properties.plan}} --parameter content_category=hubspot. `parameters[]` in the response says what each platform takes\",\n required: false,\n },\n uploads: {\n type: \"string\",\n description:\n \"The id of a send (`sends[].id`) whose uploads to list, newest first over --days: which event went, when, `outcome` (success | failed | pending | skipped) and in `error` what a skipped event was missing, or why a failed one failed — a platform's code followed by its own words after the colon (auth_failed, invalid_token, invalid_event, invalid_parameter, bad_request) when the platform refused it (ChatGPT Ads' refusal is its own answer as it gave it, often JSON, with no code in front), or one of Baker's own codes (strict_denied, blocked_by_gpc, no_matchable_identifier, no_identifier, event_too_old, or a setup code such as tag_not_found; analytics.md lists them) when Baker refused it before sending and the platform never received it — the rows behind `sends[].outcome`. With --failed, only the refused ones; with --skipped, only the skipped ones\",\n required: false,\n },\n failed: {\n type: \"boolean\",\n description: \"With --uploads: only the failed uploads — refused by the platform, or by Baker before sending\",\n required: false,\n },\n skipped: {\n type: \"boolean\",\n description:\n \"With --uploads: only the events the send never uploaded because they carried nothing the platform matches a person by — each `error` names what was missing (a Meta click id or cookie, an email, a gclid…)\",\n required: false,\n },\n history: {\n type: \"boolean\",\n description:\n \"Also return `history[]`: the day each live send was set up (`setUpOn`) and, when an integration named after its event was removed since, the day it was (`integrationRemovedOn`) — read it before removing or explaining a send whose event no longer arrives. --full gives the instants\",\n required: false,\n },\n id: {\n type: \"string\",\n description:\n \"The send's id, when changing one that exists (`sends[].id` for a live one, `staged.set[].id` for one staged in this chat, like s1). Left out, a new id is minted and a NEW send is staged — so re-running a --set you already ran is refused, naming the send it would duplicate\",\n required: false,\n },\n remove: {\n type: \"string\",\n description: \"The id of a send to stop, from `sends[].id`. Staged like a set: it stops when the chat is published\",\n required: false,\n },\n days: {\n type: \"string\",\n description: \"How many days the outcome beside each send covers (default 30, up to 400)\",\n required: false,\n },\n full: {\n type: \"boolean\",\n description:\n \"Also return `carries` and `templateFields`: every field a send forwards and a template may read, the same for every send; with --history, the exact instants\",\n required: false,\n },\n} as const;\n\nregisterSchema({\n command: \"analytics.sends\",\n routes: [\"POST /api/analytics/sends\"],\n effect: \"stage\",\n description: \"Read where this company's system events are sent, or stage a change\",\n args,\n});\n\nexport const sendsCommand = defineCommand({\n meta: {\n name: \"sends\",\n description: `Where this company's SYSTEM EVENTS are sent — Meta, Google Ads, LinkedIn, X, Google Analytics — and what happened to each upload. A send belongs to an event one of the client's own systems raises, by key: page:deal_won from HubSpot → Meta Purchase means every \"deal_won\" HubSpot reports is uploaded to Meta with who the person is, the click that brought them and the amount forwarded automatically. There is nothing to map. What happens on a page or in a Form is never sent from here — the page's pixels and the Form's own side effects do that — and a send is never set on a funnel step: the step reads the sends of the events behind its ways in.\n\nStart here:\n baker analytics sends — the sends in effect, each with its outcome; the platforms and the tags that can send; the system events (events[]) that can be sent\n baker analytics sends --set --source-event page:deal_won --platform meta --tag <tagId> --event Purchase\n baker analytics sends --set --source-event page:deal_won --platform googleAds --tag <tagId> --event 987654321\n baker analytics sends --set --source-event page:deal_won --platform meta --tag <tagId> --event Purchase --parameter content_name={{properties.plan}}\n baker analytics sends --set --source-event page:lead_completed_step_2 --platform meta --tag <tagId> --event Lead — an event the pixel and/or the API send; uploaded once per event id\n baker analytics sends --set --source-event page:deal_won --platform meta --tag <tagId> --event {{properties.plan}} — a Meta event named after what each one carries\n baker analytics sends --remove s1 — stop one\n baker analytics sends --platform meta — only what goes to Meta: its sends, tags, parameters and each event's match there\n baker analytics sends --days 7 — outcomes over the last week\n baker analytics sends --uploads s1 --failed — the refused uploads, each with the event and why: the platform's own words, or Baker's code when it never left Baker\n baker analytics sends --uploads s1 --skipped — the events never uploaded, each with what the platform needed and they lacked\n baker analytics sends --history — when each send was set up, and whether the integration its event came from was removed\n\nThree things to hold on to:\n it is STAGED — a set or a remove lands when this chat is published, and from then on it SPENDS AD BUDGET on every \"<event>\" that arrives. Tell the client that plainly; never call a published send a preview.\n the tagId is COPIED — from \\`platforms[].tags\\` in the response, which lists only the tags on Tracking that hold their server credential. One typed from memory is refused; each platform says \\`canSend\\`, and one that cannot says what to add on Tracking (\\`platforms[].setupHint\\`).\n the outcome is what happened — \\`sends[].outcome\\` counts what was sent, what failed and why (\\`lastError\\`: the platform's words, or Baker's own code when Baker refused the upload before sending), and what was SKIPPED: an event carrying nothing the platform matches a person by is never uploaded (Meta: a Meta click id or cookie, an email or your own customer id; Google Ads: gclid, wbraid, gbraid, an email or a phone; LinkedIn: li_fat_id or an email; X: twclid or an email; Google Analytics: nothing), counted in \\`skipped\\` with \\`lastSkipReason\\`.\n check the MATCH before staging — \\`events[].match\\` says, for the last 30 days of each event, how many arrived, how many each platform could match, and how many it could but the cookie consent setting keeps from it (\\`withheld\\`). A send to a platform matching 0 of 14, none withheld, skips all 14: say so to the client, and ask for the click id or the email to be sent with the event instead. A withheld event already carries the identifier, so ask for the person's choice to be sent with it (\\`consent.marketing: granted\\`), or another setting — never more identifiers. \"Nothing sent yet\" means no event under that name has fired since the send was set. \\`--uploads <id>\\` lists the rows behind the count, \\`--failed\\` only the refused ones — read it before telling a client a send \"failed\".\n a Meta or GA4 event name can be WRITTEN FROM THE EVENT — \\`--event {{properties.plan}}\\` sends each event under its own plan, so one Source covers every value instead of one Source, one send and one conversion action per value. Only where the platform takes a name of your own: Google Ads, LinkedIn and X take an id they issued and refuse a template.\n extra parameters are optional — \\`--parameter <name>=<template>\\` adds what the platform receives beyond who, the click and the amount: \\`{{properties.<key>}}\\` reads a property the event carries (a HubSpot event's \\`--field properties.<key>\\` rows), \\`{{value}}\\`, \\`{{page_path}}\\`, \\`{{city}}\\`… read the event's fields. \\`parameters[]\\` in the response says what each platform takes and the names it knows; LinkedIn takes none.\n\nAn empty \\`events[]\\` means none of the client's systems sends an event yet and there is nothing to send: make a Source with \\`baker analytics sources\\` (a HubSpot event, or the server's address), then send its event.`,\n },\n args,\n run: async ({ args: raw }) => {\n try {\n const parsed = parseSendsArgs(raw as Record<string, unknown>, process.argv);\n const response = await apiPost<SendsResponse>(\"/api/analytics/sends\", sendsWrite(parsed));\n writeJsonEnvelope(sendsView(response, parsed.full, parsed.platform));\n } catch (err) {\n handleError(err);\n }\n },\n});\n\nfunction handleError(err: unknown): never {\n if (err instanceof ConversionArgsError) {\n writeJsonEnvelope({ ok: false, error: { code: \"VALIDATION_ERROR\", message: err.message } });\n process.exit(1);\n }\n if (err instanceof ApiError) {\n writeJsonEnvelope({ ok: false, error: { code: err.code, message: err.message } });\n process.exit(1);\n }\n writeJsonEnvelope({\n ok: false,\n error: { code: \"NETWORK_ERROR\", message: err instanceof Error ? err.message : \"Unexpected error\" },\n });\n process.exit(1);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,qBAAqB;AA8B9B,IAAM,YAAY,CAAC,kBAAkB,cAAc,SAAS,SAAS;AAM9D,SAAS,eAAe,KAA8B,MAAyB,MAAM,KAAK,IAAI,GAAc;AACjH,QAAM,MAAM,cAAc,KAAK,MAAM,GAAG;AACxC,QAAM,WAAW,QAAQ,SAAY,aAAa,KAAK,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AoB,SAAS,IAAI,QAAQ,EAAE,CAAC;AAC1F,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,MAAI,eAAe,UAAU;AAC3B,sBAAkB,EAAE,IAAI,OAAO,OAAO,EAAE,MAAM,IAAI,MAAM,SAAS,IAAI,QAAQ,EAAE,CAAC;AAChF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,oBAAkB;AAAA,IAChB,IAAI;AAAA,IACJ,OAAO,EAAE,MAAM,iBAAiB,SAAS,eAAe,QAAQ,IAAI,UAAU,mBAAmB;AAAA,EACnG,CAAC;AACD,UAAQ,KAAK,CAAC;AAChB;","names":["args"]}
@@ -5,13 +5,13 @@ import {
5
5
  import {
6
6
  hubspotRefusal
7
7
  } from "./chunk-DYWTXF5J.js";
8
- import "./chunk-LSNLFNDJ.js";
8
+ import "./chunk-37NXS55Q.js";
9
9
  import {
10
10
  ConversionArgsError,
11
11
  onlyOnce
12
- } from "./chunk-V34Q2PYJ.js";
12
+ } from "./chunk-HORX3JLB.js";
13
13
  import "./chunk-GRQ2AXDX.js";
14
- import "./chunk-PNOKIJFM.js";
14
+ import "./chunk-T7GAC2WG.js";
15
15
  import "./chunk-5TURKO4J.js";
16
16
  import "./chunk-NYUWPJ4K.js";
17
17
  import {
@@ -460,4 +460,4 @@ export {
460
460
  sourcesCommand,
461
461
  sourcesRequest
462
462
  };
463
- //# sourceMappingURL=sources-OVLH6OZ2.js.map
463
+ //# sourceMappingURL=sources-RA2KD7VO.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  analyticsErrorEnvelope
3
- } from "./chunk-SXZ537Q2.js";
3
+ } from "./chunk-STWMK24H.js";
4
4
  import {
5
5
  ANALYTICS_UNSTAGE_KINDS
6
- } from "./chunk-PNOKIJFM.js";
6
+ } from "./chunk-T7GAC2WG.js";
7
7
  import "./chunk-5TURKO4J.js";
8
8
  import "./chunk-NYUWPJ4K.js";
9
9
  import "./chunk-NKQWDEB7.js";
@@ -98,4 +98,4 @@ export {
98
98
  unstageBody,
99
99
  unstageCommand
100
100
  };
101
- //# sourceMappingURL=unstage-JZAIRBVA.js.map
101
+ //# sourceMappingURL=unstage-6QVKZITE.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  mappingCommandFor,
3
3
  proposeMappingFromTemplate
4
- } from "./chunk-PNOKIJFM.js";
4
+ } from "./chunk-T7GAC2WG.js";
5
5
  import "./chunk-5TURKO4J.js";
6
6
  import {
7
7
  parseApiError
@@ -134,4 +134,4 @@ Examples:
134
134
  export {
135
135
  urlOptionsCommand
136
136
  };
137
- //# sourceMappingURL=url-options-JK525H2M.js.map
137
+ //# sourceMappingURL=url-options-E6FNFBE3.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koda-sl/baker-cli",
3
- "version": "0.846.0",
3
+ "version": "0.847.0",
4
4
  "description": "AI-agent-first CLI for interacting with Baker, including the Baker creative canvas.",
5
5
  "type": "module",
6
6
  "bin": {