@koda-sl/baker-cli 0.299.0 → 0.300.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 CHANGED
@@ -3255,6 +3255,7 @@ baker tags draft # review the staged changes awaiting publish
3255
3255
 
3256
3256
  Notes:
3257
3257
 
3258
+ - **Both reads restate the write path, on stderr.** `list` and `draft` end with the two lines that say the approval form is the only way to change a tag, that it rides on every turn, and that a tag change is never a Task. They are there because a chat concluded from its tool list alone that the form did not exist, never called it, and filed the change as a Task for the user to carry out by hand. stdout stays the list, so piping it is unaffected; `--json` carries the same lines in the envelope's `hints`.
3258
3259
  - **`list` prints each tag's full readable config.** Every non-secret field is shown in full under the tag — the Clarity `projectId`, GA4 `measurementId`, the entire custom `code` snippet, etc. — so the agent reuses a stored value to pre-fill a follow-up change instead of asking the user for something already installed. Secrets are never among these fields. (`--json` emits the same data as the raw envelope.)
3259
3260
  - **Secrets never travel through this CLI or the chat.** Secret fields (`accessToken`, `apiSecret`, `authorizationToken`, `apiKey`, `conversionToken`, `oauthProviderId`) are entered only in the dashboard's secure tag form and flow straight into the staged draft; tool responses only ever name which secret fields are set/pending.
3260
3261
  - Staged creates get a server-generated `tag_temp_*` ref (returned in the tool result and printed by `list`). Use it (or a real tag id) as flow side-effect `tagIds` — the published tag keeps resolving under the temp ref.
package/dist/cli.js CHANGED
@@ -7374,13 +7374,29 @@ var SURFACE_RULES = [
7374
7374
  /\bhotjar\b/i,
7375
7375
  /\bgtm\s+snippet\b/i,
7376
7376
  /\bcapi\b/i,
7377
- /\b(?:install|add|remove|swap|instalar|colocar)\b[\s\S]*\b(?:snippet|script|tag)\b/i
7377
+ /\b(?:install|add|remove|swap|instalar|colocar|poner|anadir|agregar)\b[\s\S]*\b(?:snippet|script|tags?|etiquetas?|pixel)\b/i,
7378
+ // The product's own word for this object, in both languages. A tracking
7379
+ // script named in Spanish ("el código de seguimiento de HubSpot", "una
7380
+ // etiqueta tipo hubspot") matched none of the signals above, so the one
7381
+ // Task that most needed the redirect — file it, or show the form? — was
7382
+ // filed. `tag-manager` is evaluated first and still claims the container.
7383
+ /\btracking\s+(?:code|script|snippet|tag)\b/i,
7384
+ /\bcodigos?\s+de\s+seguimiento\b/i,
7385
+ /\bscripts?\s+de\s+seguimiento\b/i,
7386
+ /\betiquetas?\s+(?:de\s+seguimiento|de\s+medicion|tipo\s+\w+)\b/i
7378
7387
  ],
7379
7388
  // Two vetoes. A structured snippet is a Google Ads extension, not a script
7380
7389
  // on the page — `ads-write` claims it above, and this stops both rules
7381
7390
  // being able to answer. Server-side delivery is infrastructure nobody here
7382
7391
  // can provision, the same call `tag-manager` already makes for sGTM.
7383
- except: [/\bstructured\s+snippets?\b/i, /\bserver-?\s?side\b/i, /\bhosting\b/i],
7392
+ except: [
7393
+ /\bstructured\s+snippets?\b/i,
7394
+ /\bserver-?\s?side\b/i,
7395
+ /\bhosting\b/i,
7396
+ // A label on a campaign is an ad-platform object, and "etiqueta" is the
7397
+ // Spanish for both it and the script this rule owns.
7398
+ /\b(?:labels?|etiquetas?)\s+(?:de|en|a|to|on)\s+(?:las?\s+|los\s+|the\s+)?(?:campanas?|campaigns?|anuncios?|ads?|grupos?\s+de\s+anuncios|ad\s*groups?)\b/i
7399
+ ],
7384
7400
  hint: "This is a tag or script on the site \u2014 it goes through the `request_tag_input` approval form in this chat, which also collects any secret values (guide: `__tooling__/docs/tools/baker/tags.md`). Show the form instead of filing a Task."
7385
7401
  },
7386
7402
  {
@@ -57997,6 +58013,12 @@ function renderEffectiveEntry(entry) {
57997
58013
  return configLines.length > 0 ? `${header}
57998
58014
  ${configLines.join("\n")}` : header;
57999
58015
  }
58016
+ function tagsListHints() {
58017
+ return [
58018
+ "To create, edit or delete a tag, call the `request_tag_input` approval form (tool `mcp__baker_ui__request_tag_input`, server `baker_ui`) \u2014 it is attached to every turn of this chat and collects any secret values itself.",
58019
+ "Do NOT conclude the form is unavailable from your tool list: call it, and report what it returns. And never file a tag change as a Task \u2014 a Task hands the user work this chat can stage in one call."
58020
+ ];
58021
+ }
58000
58022
 
58001
58023
  // src/commands/tags/index.ts
58002
58024
  registerSchema({
@@ -58010,16 +58032,21 @@ async function listTags(json) {
58010
58032
  try {
58011
58033
  const chatId = requireChatId();
58012
58034
  const response = await apiPost("/api/tags/list", { chatId });
58035
+ const hints2 = tagsListHints();
58013
58036
  if (json) {
58014
- writeJson({ ok: true, data: response });
58037
+ writeJson({ ok: true, data: response, hints: hints2 });
58015
58038
  return;
58016
58039
  }
58017
58040
  if (response.tags.length === 0) {
58018
- process.stdout.write("No tags configured. Propose one with the request_tag_input tool (baker_ui).\n");
58019
- return;
58041
+ process.stdout.write("No tags configured.\n");
58042
+ } else {
58043
+ process.stdout.write(`${response.tags.map(renderEffectiveEntry).join("\n")}
58044
+ `);
58020
58045
  }
58021
- process.stdout.write(`${response.tags.map(renderEffectiveEntry).join("\n")}
58046
+ for (const hint of hints2) {
58047
+ process.stderr.write(`${hint}
58022
58048
  `);
58049
+ }
58023
58050
  } catch (err) {
58024
58051
  failApi3(err);
58025
58052
  }
@@ -58041,7 +58068,7 @@ async function listDraft4(chat) {
58041
58068
  try {
58042
58069
  const chatId = resolveChatId(chat);
58043
58070
  const response = await apiPost("/api/tags/draft", { chatId });
58044
- writeJson({ ok: true, data: response });
58071
+ writeJson({ ok: true, data: response, hints: tagsListHints() });
58045
58072
  } catch (err) {
58046
58073
  failApi3(err);
58047
58074
  }