@koda-sl/baker-cli 0.868.0-dev.5be0a9a76 → 0.868.0-dev.dd070597a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -3
- package/dist/{account-reads-SUWXGTGW.js → account-reads-3LP4F3L4.js} +2 -2
- package/dist/{add-TKHBYZF6.js → add-ZMOFKHFR.js} +2 -2
- package/dist/{ads-U33JFGCR.js → ads-O76TVWHX.js} +2 -2
- package/dist/{chunk-TY4MTOTL.js → chunk-MIIY3MVK.js} +1 -22
- package/dist/chunk-MIIY3MVK.js.map +1 -0
- package/dist/{chunk-LZ5DS4UB.js → chunk-N366L5EF.js} +32 -4
- package/dist/chunk-N366L5EF.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/{conversion-upload-command-Y4ABNNAT.js → conversion-upload-command-HJOVSWZD.js} +2 -2
- package/dist/{draft-CLNMIQXV.js → draft-OLSFLDME.js} +2 -2
- package/dist/{flows-FRWZWHXZ.js → flows-PP6BRBD7.js} +3 -3
- package/dist/{forecast-JAPRYH4F.js → forecast-AQDB4LLG.js} +2 -2
- package/dist/{google-HHKFDH7I.js → google-HLE7YIYM.js} +57 -40
- package/dist/google-HLE7YIYM.js.map +1 -0
- package/dist/{search-terms-WLOW2FPP.js → search-terms-WKEPRHN2.js} +2 -2
- package/dist/{tags-DFCLKJX7.js → tags-IQ6BCRLE.js} +15 -26
- package/dist/tags-IQ6BCRLE.js.map +1 -0
- package/dist/{themes-Q5CSF6TJ.js → themes-2T5BOIZU.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-LZ5DS4UB.js.map +0 -1
- package/dist/chunk-TY4MTOTL.js.map +0 -1
- package/dist/google-HHKFDH7I.js.map +0 -1
- package/dist/tags-DFCLKJX7.js.map +0 -1
- /package/dist/{account-reads-SUWXGTGW.js.map → account-reads-3LP4F3L4.js.map} +0 -0
- /package/dist/{add-TKHBYZF6.js.map → add-ZMOFKHFR.js.map} +0 -0
- /package/dist/{ads-U33JFGCR.js.map → ads-O76TVWHX.js.map} +0 -0
- /package/dist/{conversion-upload-command-Y4ABNNAT.js.map → conversion-upload-command-HJOVSWZD.js.map} +0 -0
- /package/dist/{draft-CLNMIQXV.js.map → draft-OLSFLDME.js.map} +0 -0
- /package/dist/{flows-FRWZWHXZ.js.map → flows-PP6BRBD7.js.map} +0 -0
- /package/dist/{forecast-JAPRYH4F.js.map → forecast-AQDB4LLG.js.map} +0 -0
- /package/dist/{search-terms-WLOW2FPP.js.map → search-terms-WKEPRHN2.js.map} +0 -0
- /package/dist/{themes-Q5CSF6TJ.js.map → themes-2T5BOIZU.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/tags/index.ts"],"sourcesContent":["import type { TagsDraftListResponse, TagsListResponse, TagsUnstageRequest, TagsUnstageResponse } from \"@baker/api\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { requireChatId, resolveChatId } from \"../../env.ts\";\nimport { rowsAsData, writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { CHAT_READ_ARG } from \"../chat-arg.ts\";\nimport {\n COLLAPSED_HINT,\n failApi,\n failValidation,\n type ListedTag,\n listedTag,\n renderEffectiveEntry,\n tagsListHints,\n} from \"./shared.ts\";\n\nconst LIST_OUTPUT_DESCRIPTION =\n \"Output format: json|md. Default: json (the envelope); md prints one readable block per tag\";\nconst LIST_FULL_DESCRIPTION =\n \"Print every config value whole, a custom `code` script included (by default a long value shows as its size)\";\nconst LIST_JSON_DESCRIPTION = \"Same as the default: the JSON envelope (kept for older calls)\";\n\nregisterSchema({\n command: \"tags.list\",\n description:\n \"Effective marketing tags for this chat: production tags overlaid with the changes staged in this chat, as the JSON envelope (`data` is one row per tag; `--output md` for a readable block per tag). Each tag's readable config is included (secrets are never included) — e.g. the Clarity projectId or GA4 measurementId — so reuse a stored value to pre-fill a follow-up change instead of asking the user for something we already have. A long value (a custom `code` script) shows as its size under `collapsed`; `--full` prints it whole. The printed refs (tag ids or tag_temp_*) are exactly what flow side-effect tagIds should reference. Read-only — every tag change (create, edit, delete) goes through the request_tag_input approval tool; `baker tags unstage` takes back one this chat staged.\",\n args: {\n output: { type: \"string\", description: LIST_OUTPUT_DESCRIPTION, required: false, default: \"json\" },\n full: { type: \"boolean\", description: LIST_FULL_DESCRIPTION, required: false },\n json: { type: \"boolean\", description: LIST_JSON_DESCRIPTION, required: false },\n },\n});\n\nasync function listTags(output: unknown, full: boolean): Promise<void> {\n try {\n const chatId = requireChatId();\n const response = await apiPost<TagsListResponse>(\"/api/tags/list\", { chatId });\n const tags: ListedTag[] = full ? response.tags : response.tags.map(listedTag);\n const hints = [...tagsListHints(), ...(tags.some((tag) => tag.collapsed) ? [COLLAPSED_HINT] : [])];\n if (output !== \"md\") {\n writeJson({ ok: true, ...rowsAsData({ tags }, \"tags\"), hints });\n return;\n }\n if (tags.length === 0) {\n process.stdout.write(\"No tags configured.\\n\");\n } else {\n process.stdout.write(`${tags.map(renderEffectiveEntry).join(\"\\n\")}\\n`);\n }\n // stdout stays the list and nothing else, so a reader piping it keeps\n // parsing it; the hints go to stderr, where the agent still reads them.\n for (const hint of hints) {\n process.stderr.write(`${hint}\\n`);\n }\n } catch (err) {\n failApi(err);\n }\n}\n\nconst listArgs = {\n output: { type: \"string\", description: LIST_OUTPUT_DESCRIPTION, default: \"json\" },\n full: { type: \"boolean\", description: LIST_FULL_DESCRIPTION },\n json: { type: \"boolean\", description: LIST_JSON_DESCRIPTION },\n} as const;\n\nconst listCommand = defineCommand({\n meta: {\n name: \"list\",\n description:\n \"Effective tags for this chat (production + staged) as the JSON envelope, with each tag's readable config (secrets excluded) — reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. A custom `code` script shows as its size; --full prints it. Start here: baker tags list | baker tags list --output md\",\n },\n args: listArgs,\n run: async ({ args }) => {\n await listTags(args.output, args.full === true);\n },\n});\n\nasync function listDraft(chat?: unknown): Promise<void> {\n try {\n const chatId = resolveChatId(chat);\n const response = await apiPost<TagsDraftListResponse>(\"/api/tags/draft\", { chatId });\n writeJson({ ok: true, data: response, hints: tagsListHints() });\n } catch (err) {\n failApi(err);\n }\n}\n\nconst draftCommand = defineCommand({\n meta: {\n name: \"draft\",\n description:\n \"Review the tag changes staged in this chat (read-only). Staged changes were approved via request_tag_input and apply when the chat is published. To drop one, `baker tags unstage <ref>` with the ref printed here (or --all); to amend one, propose a follow-up change through the same tool. Takes --chat <id> to read an earlier chat's staged changes instead.\",\n },\n args: { chat: CHAT_READ_ARG },\n run: async ({ args }) => {\n await listDraft(args.chat);\n },\n});\n\nregisterSchema({\n command: \"tags.unstage\",\n description:\n \"Take back a tag change this chat staged, before Publish — the same as discarding its row in the change review. Pass the ref `baker tags draft` prints (a tag id, or tag_temp_* for a staged create), or --all for every staged tag change. Taking back a staged create also drops the secrets the user entered for it. Never touches a live tag: to change or remove one, propose the change through request_tag_input.\",\n args: {\n ref: { type: \"string\", description: \"The staged change's ref, from `baker tags draft`\", required: false },\n all: { type: \"boolean\", description: \"Take back every tag change staged in this chat\", required: false },\n },\n});\n\n/** The request for one unstage, checked before the round trip. */\nexport function unstageBody(args: { ref?: string; all?: boolean }, chatId: string): TagsUnstageRequest {\n const ref = args.ref?.trim();\n if (args.all === true && ref) {\n failValidation(\"Pass one ref to take back that change, or --all for every staged tag change — not both.\");\n }\n if (args.all === true) {\n return { chatId, all: true };\n }\n if (!ref) {\n failValidation(\"Pass the ref of the staged change (from `baker tags draft`), or --all.\");\n }\n return { chatId, ref };\n}\n\nconst unstageCommand = defineCommand({\n meta: {\n name: \"unstage\",\n description:\n \"Take back a tag change this chat staged, before Publish. Examples: baker tags unstage tag_temp_abc123 | baker tags unstage --all\",\n },\n args: {\n ref: { type: \"positional\", description: \"The staged change's ref, from `baker tags draft`\", required: false },\n all: { type: \"boolean\", description: \"Take back every tag change staged in this chat\", required: false },\n },\n run: async ({ args }) => {\n try {\n const body = unstageBody(\n {\n ...(typeof args.ref === \"string\" ? { ref: args.ref } : {}),\n ...(args.all === true ? { all: true } : {}),\n },\n requireChatId(),\n );\n const response = await apiPost<TagsUnstageResponse>(\"/api/tags/draft-op/remove\", body);\n writeJson({\n ...response,\n hints: [\"Taken back: it does not apply when the chat is published. Live tags are unchanged.\"],\n });\n } catch (err) {\n failApi(err);\n }\n },\n});\n\nexport const tagsCommand = defineCommand({\n meta: {\n name: \"tags\",\n description: `Read the client's marketing/analytics tags (Meta pixel, GA4, Google Ads, GTM, Clarity, Hotjar, …) — production tags plus the changes staged in this chat.\n\nEvery tag change — create, edit, or delete — goes through the request_tag_input tool (baker_ui MCP server): propose one or more changes (each becomes a tab in one approval form), pre-fill the non-secret fields you know, and the user reviews, fills secrets, and approves or skips each. Secret values (accessToken, apiSecret, authorizationToken, apiKey, conversionToken, OAuth connections) never pass through the CLI or the chat.\n\nRefs: \\`baker tags list\\` prints each tag's ref — a real tag id, or tag_temp_* for creates staged in this chat. Use these refs as flow side-effect tagIds; they keep resolving after publish.\n\n\\`baker tags list\\` prints the JSON envelope (\\`--output md\\` to read it), with each tag's readable config (secrets excluded) — the Clarity projectId, GA4 measurementId, etc.; a custom \\`code\\` script shows as its size until \\`--full\\`. Reuse a stored value to pre-fill a follow-up change instead of asking the user for something already installed.\n\nTo take back a change this chat staged (before Publish), \\`baker tags unstage <ref>\\` — the ref \\`baker tags draft\\` prints — or \\`--all\\`. It never touches a live tag.\n\nExamples:\n baker tags list # production + staged, config + secret status, as the JSON envelope\n baker tags list --output md --full # readable, custom code scripts whole\n baker tags draft # review the staged changes awaiting publish\n baker tags unstage tag_temp_abc123 # take back one staged change\nFull guide: __tooling__/docs/tools/baker/tags.md`,\n },\n subCommands: {\n list: listCommand,\n draft: draftCommand,\n unstage: unstageCommand,\n },\n // Bare `baker tags` lists the effective tags. `args` stays so citty knows this\n // command's flags when it scans rawArgs for a subcommand name, and `default` (not\n // `run`) dispatches the bare invocation — citty falls through to `run` after a\n // subcommand, so a `run` here would also list on every `baker tags draft`.\n args: listArgs,\n default: \"list\",\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;AAgB9B,IAAM,0BACJ;AACF,IAAM,wBACJ;AACF,IAAM,wBAAwB;AAE9B,eAAe;AAAA,EACb,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM;AAAA,IACJ,QAAQ,EAAE,MAAM,UAAU,aAAa,yBAAyB,UAAU,OAAO,SAAS,OAAO;AAAA,IACjG,MAAM,EAAE,MAAM,WAAW,aAAa,uBAAuB,UAAU,MAAM;AAAA,IAC7E,MAAM,EAAE,MAAM,WAAW,aAAa,uBAAuB,UAAU,MAAM;AAAA,EAC/E;AACF,CAAC;AAED,eAAe,SAAS,QAAiB,MAA8B;AACrE,MAAI;AACF,UAAM,SAAS,cAAc;AAC7B,UAAM,WAAW,MAAM,QAA0B,kBAAkB,EAAE,OAAO,CAAC;AAC7E,UAAM,OAAoB,OAAO,SAAS,OAAO,SAAS,KAAK,IAAI,SAAS;AAC5E,UAAM,QAAQ,CAAC,GAAG,cAAc,GAAG,GAAI,KAAK,KAAK,CAAC,QAAQ,IAAI,SAAS,IAAI,CAAC,cAAc,IAAI,CAAC,CAAE;AACjG,QAAI,WAAW,MAAM;AACnB,gBAAU,EAAE,IAAI,MAAM,GAAG,WAAW,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAC9D;AAAA,IACF;AACA,QAAI,KAAK,WAAW,GAAG;AACrB,cAAQ,OAAO,MAAM,uBAAuB;AAAA,IAC9C,OAAO;AACL,cAAQ,OAAO,MAAM,GAAG,KAAK,IAAI,oBAAoB,EAAE,KAAK,IAAI,CAAC;AAAA,CAAI;AAAA,IACvE;AAGA,eAAW,QAAQ,OAAO;AACxB,cAAQ,OAAO,MAAM,GAAG,IAAI;AAAA,CAAI;AAAA,IAClC;AAAA,EACF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AAA,EACN,SAAS;AACX,CAAC;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|