@koda-sl/baker-cli 0.852.0-dev.65f932cdf → 0.852.0-dev.d40dfecc3
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 +5 -1
- package/dist/{accounts-FGWJDM52.js → accounts-5ZMP7KU7.js} +1 -1
- package/dist/{analytics-KA3THH3F.js → analytics-RIZ4RJ6O.js} +4 -4
- package/dist/changes-6UGDHAZW.js +539 -0
- package/dist/changes-6UGDHAZW.js.map +1 -0
- package/dist/{chunk-YL7XIJ43.js → chunk-A6B45KSH.js} +2 -1
- package/dist/{chunk-YL7XIJ43.js.map → chunk-A6B45KSH.js.map} +1 -1
- package/dist/{chunk-EHDZONE6.js → chunk-QSZRATGC.js} +2 -2
- package/dist/{chunk-H3CYVM4E.js → chunk-TWSIY2FS.js} +3 -7
- package/dist/chunk-TWSIY2FS.js.map +1 -0
- package/dist/{chunk-ZWANN4QQ.js → chunk-WYBX53EI.js} +2 -1
- package/dist/cli.js +10 -10
- package/dist/{create-KGRQQ7WA.js → create-NR4WX6PS.js} +3 -3
- package/dist/{delete-XAVEVESN.js → delete-5P6K4EOJ.js} +3 -3
- package/dist/{draft-BO5QGZBG.js → draft-4DFLYVL6.js} +2 -2
- package/dist/{get-H5CUQP7G.js → get-I77O6MRD.js} +3 -3
- package/dist/{history-AGCS2TKY.js → history-DD3UWZZ4.js} +3 -3
- package/dist/{hubspot-NG2KTQDY.js → hubspot-W5LYFWTH.js} +2 -2
- package/dist/{list-DBZ3AGW2.js → list-VQNYW5R4.js} +3 -3
- package/dist/{media-sources-NI6U2YWV.js → media-sources-ZY7S74U2.js} +1 -1
- package/dist/{plan-LVTD6FZI.js → plan-YP5D6JXM.js} +2 -2
- package/dist/{posts-GX6MUVUG.js → posts-B5DGAKAC.js} +1 -1
- package/dist/{read-T7HYDHSS.js → read-OMNUPQ77.js} +2 -2
- package/dist/{run-HCYK5ZAX.js → run-TPAZDCY2.js} +3 -3
- package/dist/{scheduled-agents-YHZUPS2I.js → scheduled-agents-NODIHKKM.js} +11 -11
- package/dist/{schema-NIYT4JHM.js → schema-JCAV2D44.js} +2 -2
- package/dist/{sources-DVNWHBF5.js → sources-G7QWYL2J.js} +4 -10
- package/dist/sources-G7QWYL2J.js.map +1 -0
- package/dist/{tag-manager-SL6FDPER.js → tag-manager-YUUNKP7Q.js} +11 -9
- package/dist/tag-manager-YUUNKP7Q.js.map +1 -0
- package/dist/{targets-5A5SOQJM.js → targets-BVAFNU4K.js} +3 -3
- package/dist/{triggers-PH33IQLK.js → triggers-AALSXPLW.js} +3 -3
- package/dist/{unstage-52VGCJWF.js → unstage-BVNREABR.js} +3 -3
- package/dist/{update-RD27CPMN.js → update-HYZXKLZ7.js} +3 -3
- package/dist/{winning-ads-274QKPKB.js → winning-ads-QRBI3TLN.js} +1 -1
- package/dist/{write-commands-M2CV6P4R.js → write-commands-YECHEWMG.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-H3CYVM4E.js.map +0 -1
- package/dist/sources-DVNWHBF5.js.map +0 -1
- package/dist/tag-manager-SL6FDPER.js.map +0 -1
- /package/dist/{accounts-FGWJDM52.js.map → accounts-5ZMP7KU7.js.map} +0 -0
- /package/dist/{analytics-KA3THH3F.js.map → analytics-RIZ4RJ6O.js.map} +0 -0
- /package/dist/{chunk-EHDZONE6.js.map → chunk-QSZRATGC.js.map} +0 -0
- /package/dist/{chunk-ZWANN4QQ.js.map → chunk-WYBX53EI.js.map} +0 -0
- /package/dist/{create-KGRQQ7WA.js.map → create-NR4WX6PS.js.map} +0 -0
- /package/dist/{delete-XAVEVESN.js.map → delete-5P6K4EOJ.js.map} +0 -0
- /package/dist/{draft-BO5QGZBG.js.map → draft-4DFLYVL6.js.map} +0 -0
- /package/dist/{get-H5CUQP7G.js.map → get-I77O6MRD.js.map} +0 -0
- /package/dist/{history-AGCS2TKY.js.map → history-DD3UWZZ4.js.map} +0 -0
- /package/dist/{hubspot-NG2KTQDY.js.map → hubspot-W5LYFWTH.js.map} +0 -0
- /package/dist/{list-DBZ3AGW2.js.map → list-VQNYW5R4.js.map} +0 -0
- /package/dist/{media-sources-NI6U2YWV.js.map → media-sources-ZY7S74U2.js.map} +0 -0
- /package/dist/{plan-LVTD6FZI.js.map → plan-YP5D6JXM.js.map} +0 -0
- /package/dist/{posts-GX6MUVUG.js.map → posts-B5DGAKAC.js.map} +0 -0
- /package/dist/{read-T7HYDHSS.js.map → read-OMNUPQ77.js.map} +0 -0
- /package/dist/{run-HCYK5ZAX.js.map → run-TPAZDCY2.js.map} +0 -0
- /package/dist/{scheduled-agents-YHZUPS2I.js.map → scheduled-agents-NODIHKKM.js.map} +0 -0
- /package/dist/{schema-NIYT4JHM.js.map → schema-JCAV2D44.js.map} +0 -0
- /package/dist/{targets-5A5SOQJM.js.map → targets-BVAFNU4K.js.map} +0 -0
- /package/dist/{triggers-PH33IQLK.js.map → triggers-AALSXPLW.js.map} +0 -0
- /package/dist/{unstage-52VGCJWF.js.map → unstage-BVNREABR.js.map} +0 -0
- /package/dist/{update-RD27CPMN.js.map → update-HYZXKLZ7.js.map} +0 -0
- /package/dist/{winning-ads-274QKPKB.js.map → winning-ads-QRBI3TLN.js.map} +0 -0
- /package/dist/{write-commands-M2CV6P4R.js.map → write-commands-YECHEWMG.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../api/src/tag-manager/ops.ts","../../api/src/tag-manager/wire.ts","../src/commands/tag-manager/changes.ts"],"sourcesContent":["/**\n * Staged Google Tag Manager write ops — the shared CLI ⇄ backend contract.\n *\n * GTM addresses entities three different ways, and a staged `gtm_temp_*` ref\n * resolves differently depending on where it appears:\n * • `firingTriggerId` / `blockingTriggerId` → the created trigger's numeric id\n * • `parentFolderId` → the created folder's numeric id\n * • `{{gtm_temp_x}}` in a parameter value → the created variable's NAME\n * Ops therefore declare `dependsOn` explicitly; the executor orders on it.\n */\nimport { z } from \"zod\";\n\nexport const TAG_MANAGER_TEMP_REF_PREFIX = \"gtm_temp_\";\n\nexport const tagManagerEntitySchema = z.enum([\n \"tag\",\n \"trigger\",\n \"variable\",\n \"folder\",\n \"builtInVariable\",\n \"containerSettings\",\n]);\nexport type TagManagerEntity = z.infer<typeof tagManagerEntitySchema>;\n\nexport const tagManagerDraftOpKindSchema = z.enum([\n \"tagManager.tag.create\",\n \"tagManager.tag.update\",\n \"tagManager.tag.delete\",\n \"tagManager.trigger.create\",\n \"tagManager.trigger.update\",\n \"tagManager.trigger.delete\",\n \"tagManager.variable.create\",\n \"tagManager.variable.update\",\n \"tagManager.variable.delete\",\n \"tagManager.folder.create\",\n \"tagManager.folder.update\",\n \"tagManager.folder.delete\",\n \"tagManager.builtInVariable.enable\",\n \"tagManager.builtInVariable.disable\",\n \"tagManager.containerSettings.update\",\n]);\nexport type TagManagerDraftOpKind = z.infer<typeof tagManagerDraftOpKindSchema>;\n\n/** The entity each op kind acts on — single source of truth for both sides. */\nexport const TAG_MANAGER_OP_ENTITY: Record<TagManagerDraftOpKind, TagManagerEntity> = {\n \"tagManager.tag.create\": \"tag\",\n \"tagManager.tag.update\": \"tag\",\n \"tagManager.tag.delete\": \"tag\",\n \"tagManager.trigger.create\": \"trigger\",\n \"tagManager.trigger.update\": \"trigger\",\n \"tagManager.trigger.delete\": \"trigger\",\n \"tagManager.variable.create\": \"variable\",\n \"tagManager.variable.update\": \"variable\",\n \"tagManager.variable.delete\": \"variable\",\n \"tagManager.folder.create\": \"folder\",\n \"tagManager.folder.update\": \"folder\",\n \"tagManager.folder.delete\": \"folder\",\n \"tagManager.builtInVariable.enable\": \"builtInVariable\",\n \"tagManager.builtInVariable.disable\": \"builtInVariable\",\n \"tagManager.containerSettings.update\": \"containerSettings\",\n};\n\nexport function entityOfKind(kind: TagManagerDraftOpKind): TagManagerEntity {\n return TAG_MANAGER_OP_ENTITY[kind];\n}\n\nexport function operationOfKind(kind: TagManagerDraftOpKind): \"create\" | \"update\" | \"delete\" | \"enable\" | \"disable\" {\n const verb = kind.split(\".\")[2];\n if (verb === \"create\" || verb === \"delete\" || verb === \"enable\" || verb === \"disable\") {\n return verb;\n }\n return \"update\";\n}\n\n// ---------------------------------------------------------------------------\n// GTM Parameter — the typed value model shared by tags, triggers and variables\n// ---------------------------------------------------------------------------\n\nexport interface TagManagerParameter {\n key?: string;\n type: \"template\" | \"boolean\" | \"integer\" | \"list\" | \"map\" | \"triggerReference\" | \"tagReference\";\n value?: string;\n list?: TagManagerParameter[];\n map?: TagManagerParameter[];\n}\n\nexport const tagManagerParameterSchema: z.ZodType<TagManagerParameter> = z.lazy(() =>\n z.object({\n key: z.string().optional(),\n type: z.enum([\"template\", \"boolean\", \"integer\", \"list\", \"map\", \"triggerReference\", \"tagReference\"]),\n value: z.string().optional(),\n list: z.array(tagManagerParameterSchema).optional(),\n map: z.array(tagManagerParameterSchema).optional(),\n }),\n);\n\nconst conditionSchema = z.object({\n type: z.string(),\n parameter: z.array(tagManagerParameterSchema).optional(),\n});\n\n/**\n * Tag sequencing. GTM addresses the other tag by NAME here, not by id — the\n * third of its three reference mechanisms, and the one `refs.ts` and\n * `checkPayload.ts` both read.\n */\nconst tagSequencingSchema = z.object({\n tagName: z.string().min(1),\n tagId: z.string().optional(),\n stopOnSetupFailure: z.boolean().optional(),\n stopTeardownOnFailure: z.boolean().optional(),\n});\n\n// ---------------------------------------------------------------------------\n// Per-entity payloads\n//\n// Every entity payload is `.passthrough()`, and that is load-bearing rather than\n// lax. GTM's field surface is large, versioned on Google's schedule, and open at\n// the edges (`cvt_*` community templates carry fields no published list has).\n// A strict object does not reject what it does not know — it SILENTLY DROPS it,\n// so a scroll-depth trigger loses its threshold and a staged change reports\n// `applied` having done nothing. Passing unknown keys through hands validation\n// to GTM, which is the only authority on them and does reject rather than drop.\n// Fields the rest of the system reads are still declared explicitly below, so\n// they stay typed.\n// ---------------------------------------------------------------------------\n\nconst tagPayloadSchema = z\n .object({\n name: z.string().min(1),\n type: z.string().min(1),\n parameter: z.array(tagManagerParameterSchema).optional(),\n /** Staged trigger refs or live numeric trigger ids. */\n firingTriggerId: z.array(z.string()).optional(),\n blockingTriggerId: z.array(z.string()).optional(),\n parentFolderId: z.string().optional(),\n notes: z.string().optional(),\n paused: z.boolean().optional(),\n // Declared because the one value that reads naturally, \"oncePerPage\", is not one of them.\n tagFiringOption: z\n .enum([\"tagFiringOptionUnspecified\", \"unlimited\", \"oncePerEvent\", \"oncePerLoad\"], {\n error: \"tagFiringOption is one of unlimited, oncePerEvent or oncePerLoad (once per page).\",\n })\n .optional(),\n // GTM stores priority as a Parameter (`{type:\"integer\",key:\"priority\",value:\"5\"}`),\n // not a bare number. Typing it `z.number()` rejected the correct shape at stage\n // time and let the wrong one through to fail at publish.\n priority: tagManagerParameterSchema.optional(),\n monitoringMetadata: z.record(z.string(), z.unknown()).optional(),\n consentSettings: z.record(z.string(), z.unknown()).optional(),\n setupTag: z.array(tagSequencingSchema).optional(),\n teardownTag: z.array(tagSequencingSchema).optional(),\n scheduleStartMs: z.number().optional(),\n scheduleEndMs: z.number().optional(),\n firingRuleId: z.array(z.string()).optional(),\n blockingRuleId: z.array(z.string()).optional(),\n })\n .passthrough();\n\nconst triggerPayloadSchema = z\n .object({\n name: z.string().min(1),\n type: z.string().min(1),\n parameter: z.array(tagManagerParameterSchema).optional(),\n filter: z.array(conditionSchema).optional(),\n customEventFilter: z.array(conditionSchema).optional(),\n autoEventFilter: z.array(conditionSchema).optional(),\n waitForTags: tagManagerParameterSchema.optional(),\n checkValidation: tagManagerParameterSchema.optional(),\n waitForTagsTimeout: tagManagerParameterSchema.optional(),\n eventName: tagManagerParameterSchema.optional(),\n // A trigger's own configuration lives in top-level Parameter fields, not in\n // `parameter[]` — a scroll trigger without these is a trigger with no threshold.\n verticalScrollPercentageList: tagManagerParameterSchema.optional(),\n horizontalScrollPercentageList: tagManagerParameterSchema.optional(),\n visibilitySelector: tagManagerParameterSchema.optional(),\n visiblePercentageMin: tagManagerParameterSchema.optional(),\n visiblePercentageMax: tagManagerParameterSchema.optional(),\n continuousTimeMinMilliseconds: tagManagerParameterSchema.optional(),\n totalVisibleTimeMinMilliseconds: tagManagerParameterSchema.optional(),\n interval: tagManagerParameterSchema.optional(),\n intervalSeconds: tagManagerParameterSchema.optional(),\n limit: tagManagerParameterSchema.optional(),\n maxTimerLengthSeconds: tagManagerParameterSchema.optional(),\n selector: tagManagerParameterSchema.optional(),\n parentFolderId: z.string().optional(),\n notes: z.string().optional(),\n })\n .passthrough();\n\nconst variablePayloadSchema = z\n .object({\n name: z.string().min(1),\n type: z.string().min(1),\n parameter: z.array(tagManagerParameterSchema).optional(),\n parentFolderId: z.string().optional(),\n notes: z.string().optional(),\n formatValue: z.record(z.string(), z.unknown()).optional(),\n disablingTriggerId: z.array(z.string()).optional(),\n enablingTriggerId: z.array(z.string()).optional(),\n })\n .passthrough();\n\nconst folderPayloadSchema = z\n .object({\n name: z.string().min(1),\n notes: z.string().optional(),\n })\n .passthrough();\n\n/**\n * Built-in variables are addressed by type through a query parameter rather\n * than an entity body, so this payload carries the type list directly.\n */\nconst builtInVariablePayloadSchema = z.object({\n type: z.array(z.string().min(1)).min(1),\n});\n\nconst containerSettingsPayloadSchema = z\n .object({\n name: z.string().min(1).optional(),\n notes: z.string().optional(),\n domainName: z.array(z.string()).optional(),\n usageContext: z.array(z.string()).optional(),\n })\n .passthrough();\n\n// ---------------------------------------------------------------------------\n// Op input — the CLI's stage request body\n// ---------------------------------------------------------------------------\n\nconst baseOpFields = {\n /**\n * Numeric GTM container id. Optional only when the company connected exactly\n * one container; with several, omitting it is refused rather than guessed.\n */\n containerId: z.string().optional(),\n /** Stable ref for this op. Creates default to a generated `gtm_temp_*`. */\n ref: z.string().optional(),\n /** Staged refs this op consumes. Validated against the refs found in the payload. */\n dependsOn: z.array(z.string()).optional(),\n notes: z.string().optional(),\n};\n\nexport const tagManagerDraftOpInputSchema = z.discriminatedUnion(\"kind\", [\n z.object({ kind: z.literal(\"tagManager.tag.create\"), payload: tagPayloadSchema, ...baseOpFields }),\n z.object({\n kind: z.literal(\"tagManager.tag.update\"),\n target: z.string().min(1),\n payload: tagPayloadSchema.partial(),\n ...baseOpFields,\n }),\n z.object({ kind: z.literal(\"tagManager.tag.delete\"), target: z.string().min(1), ...baseOpFields }),\n\n z.object({ kind: z.literal(\"tagManager.trigger.create\"), payload: triggerPayloadSchema, ...baseOpFields }),\n z.object({\n kind: z.literal(\"tagManager.trigger.update\"),\n target: z.string().min(1),\n payload: triggerPayloadSchema.partial(),\n ...baseOpFields,\n }),\n z.object({ kind: z.literal(\"tagManager.trigger.delete\"), target: z.string().min(1), ...baseOpFields }),\n\n z.object({ kind: z.literal(\"tagManager.variable.create\"), payload: variablePayloadSchema, ...baseOpFields }),\n z.object({\n kind: z.literal(\"tagManager.variable.update\"),\n target: z.string().min(1),\n payload: variablePayloadSchema.partial(),\n ...baseOpFields,\n }),\n z.object({ kind: z.literal(\"tagManager.variable.delete\"), target: z.string().min(1), ...baseOpFields }),\n\n z.object({ kind: z.literal(\"tagManager.folder.create\"), payload: folderPayloadSchema, ...baseOpFields }),\n z.object({\n kind: z.literal(\"tagManager.folder.update\"),\n target: z.string().min(1),\n payload: folderPayloadSchema.partial(),\n ...baseOpFields,\n }),\n z.object({ kind: z.literal(\"tagManager.folder.delete\"), target: z.string().min(1), ...baseOpFields }),\n\n z.object({\n kind: z.literal(\"tagManager.builtInVariable.enable\"),\n payload: builtInVariablePayloadSchema,\n ...baseOpFields,\n }),\n z.object({\n kind: z.literal(\"tagManager.builtInVariable.disable\"),\n payload: builtInVariablePayloadSchema,\n ...baseOpFields,\n }),\n\n z.object({\n kind: z.literal(\"tagManager.containerSettings.update\"),\n payload: containerSettingsPayloadSchema,\n ...baseOpFields,\n }),\n]);\nexport type TagManagerDraftOpInput = z.infer<typeof tagManagerDraftOpInputSchema>;\n\n/** Ops that create a new entity, and so mint a `gtm_temp_*` ref other ops can depend on. */\nexport function isCreateKind(kind: TagManagerDraftOpKind): boolean {\n return operationOfKind(kind) === \"create\";\n}\n","/**\n * Wire contract for `/api/tag-manager/*` — reading a container and staging,\n * listing, amending and removing draft Tag Manager write ops.\n *\n * Ops stage per chat and apply only when the chat publishes: the executor writes\n * each op into the container's working workspace in dependency order, then cuts\n * a container version. Applying is unconditional (there is no simulated mode);\n * publishing that version to the live site is gated per company and off by\n * default, so `published` — not `versionId` — is what says a change is live.\n */\nimport { z } from \"zod\";\nimport { tagManagerDraftOpInputSchema, tagManagerDraftOpKindSchema, tagManagerEntitySchema } from \"./ops\";\n\nexport const tagManagerDraftOpResultSchema = z.object({\n status: z.enum([\"applied\", \"failed\", \"skipped\"]),\n path: z.string().optional(),\n entityId: z.string().optional(),\n name: z.string().optional(),\n fingerprint: z.string().optional(),\n error: z.string().optional(),\n skippedBecause: z.string().optional(),\n executedAt: z.number().optional(),\n});\nexport type TagManagerDraftOpResult = z.infer<typeof tagManagerDraftOpResultSchema>;\n\n// ---------------------------------------------------------------------------\n// Read: accounts + containers\n// ---------------------------------------------------------------------------\n\nexport const tagManagerContainerSchema = z.object({\n accountId: z.string(),\n containerId: z.string(),\n /** The `GTM-XXXXXX` id used by the on-page snippet. */\n publicId: z.string(),\n name: z.string(),\n path: z.string(),\n usageContext: z.array(z.string()).optional(),\n /** True when this container is one of those selected on the company's connection. */\n connected: z.boolean().optional(),\n});\nexport type TagManagerContainer = z.infer<typeof tagManagerContainerSchema>;\n\nexport const tagManagerContainersResponseSchema = z.object({\n containers: z.array(tagManagerContainerSchema),\n unavailableContainers: z\n .array(z.object({ containerId: z.string(), publicId: z.string(), name: z.string() }))\n .optional(),\n});\nexport type TagManagerContainersResponse = z.infer<typeof tagManagerContainersResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// Read: workspace contents\n// ---------------------------------------------------------------------------\n\nexport const tagManagerEntitySummarySchema = z.object({\n /** Present only with `--full`: in a compact read the collection already says what it is. */\n entity: tagManagerEntitySchema.optional(),\n entityId: z.string(),\n name: z.string(),\n type: z.string().optional(),\n /** Present only with `--full`, like `fingerprint`: where the entity lives, not what it does. */\n path: z.string().optional(),\n parentFolderId: z.string().optional(),\n /** Tags only, `--full` only: the numeric trigger ids that fire and block this tag. */\n firingTriggerId: z.array(z.string()).optional(),\n /**\n * Tags only: the names of the triggers that fire it, built-ins named (\"All Pages\").\n * Absent when the read did not include the container's triggers (`--full` without `trigger`).\n */\n firesOn: z.array(z.string()).optional(),\n blockingTriggerId: z.array(z.string()).optional(),\n blockedBy: z.array(z.string()).optional(),\n /** Custom HTML tags, in a read narrowed by `--search` or `--id`: the script URLs it loads (at most 3). */\n src: z.array(z.string()).optional(),\n paused: z.boolean().optional(),\n /** Triggers only: what the trigger fires on, one readable line per condition. */\n conditions: z.array(z.string()).optional(),\n notes: z.string().optional(),\n fingerprint: z.string().optional(),\n /** Present only with `--full`: the raw GTM entity. */\n raw: z.unknown().optional(),\n});\nexport type TagManagerEntitySummary = z.infer<typeof tagManagerEntitySummarySchema>;\n\nexport const tagManagerReadRequestSchema = z.object({\n containerId: z.string().optional(),\n workspaceId: z.string().optional(),\n entities: z.array(tagManagerEntitySchema).optional(),\n full: z.boolean().optional(),\n /** Only the entities with these ids. */\n ids: z.array(z.string().min(1)).min(1).optional(),\n /** Only the entities that mention this text: name, type, parameters (Custom HTML included), trigger conditions. */\n search: z.string().min(1).optional(),\n skipCache: z.boolean().optional(),\n});\nexport type TagManagerReadRequest = z.infer<typeof tagManagerReadRequestSchema>;\n\nexport const tagManagerReadResponseSchema = z.object({\n container: tagManagerContainerSchema,\n workspaceId: z.string(),\n workspaceName: z.string().optional(),\n tags: z.array(tagManagerEntitySummarySchema),\n triggers: z.array(tagManagerEntitySummarySchema),\n variables: z.array(tagManagerEntitySummarySchema),\n folders: z.array(tagManagerEntitySummarySchema),\n builtInVariables: z.array(tagManagerEntitySummarySchema),\n /**\n * Where the tags read send, and which tags send there: `{ \"meta:<pixel id>\": [\"30\"], \"googleAnalytics:G-…\": […] }`.\n * Constant variables resolved. Absent when no tag sends anywhere, or the variables were not read (`--full` without `variable`).\n */\n measures: z.record(z.string(), z.array(z.string())).optional(),\n /** Set when the connected container differs from the GTM tag installed on the site. */\n installedContainerMismatch: z.string().optional(),\n /** Full reads also check pending edits before preparing a publication. */\n publicationWarning: z.string().optional(),\n});\nexport type TagManagerReadResponse = z.infer<typeof tagManagerReadResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// Read: what changed since a date\n// ---------------------------------------------------------------------------\n\nexport const TAG_MANAGER_CHANGES_DEFAULT_DAYS = 7;\nexport const TAG_MANAGER_CHANGES_MAX_DAYS = 365;\n\nexport const tagManagerChangesRequestSchema = z.object({\n containerId: z.string().optional(),\n /** First day of the window, `YYYY-MM-DD`, read in UTC. Wins over `days`. */\n since: z.iso.date(\"since must be a real date like 2026-09-21\").optional(),\n days: z.number().int().min(1).max(TAG_MANAGER_CHANGES_MAX_DAYS).optional(),\n});\nexport type TagManagerChangesRequest = z.infer<typeof tagManagerChangesRequestSchema>;\n\nexport const tagManagerChangeSchema = z.object({\n entity: z.enum([\"tag\", \"trigger\", \"variable\", \"builtInVariable\", \"folder\", \"template\"]),\n /** A built-in variable's id is its type (`clickUrl`): it is switched on (`created`) or off (`deleted`), never edited. */\n entityId: z.string(),\n name: z.string(),\n type: z.string().optional(),\n change: z.enum([\"created\", \"modified\", \"deleted\"]),\n /** When the entity was last saved, from its Tag Manager fingerprint. Absent on a deletion, which Tag Manager does not date. */\n at: z.string().optional(),\n /** The container version that first carried the change. Absent on a pending change. */\n versionId: z.string().optional(),\n /** Saved in a workspace and not yet in any version: waiting to go live. */\n pending: z.literal(true).optional(),\n /** The workspace a pending change is saved in. */\n workspace: z.string().optional(),\n /** Carried by a version that may have been cut before `since` (see `versions[].mayPredateSince`). */\n mayPredateSince: z.literal(true).optional(),\n});\nexport type TagManagerChange = z.infer<typeof tagManagerChangeSchema>;\n\nexport const tagManagerChangesResponseSchema = z.object({\n container: tagManagerContainerSchema,\n /** The window's start, ISO. */\n since: z.string(),\n /**\n * Versions saved inside the window, newest first; `live` marks the one the site runs. Tag Manager dates a\n * version only by its last save, which moves when it is renamed or its notes are edited, so it was cut\n * between `cutAfter` (the newest save of anything in it, or of an earlier version) and `savedAt`.\n * `mayPredateSince` marks one that may have been cut before `since` and only edited since.\n * `archived` marks one deleted from the Versions list in Tag Manager.\n */\n versions: z.array(\n z.object({\n versionId: z.string(),\n name: z.string(),\n savedAt: z.string(),\n cutAfter: z.string().optional(),\n live: z.literal(true).optional(),\n archived: z.literal(true).optional(),\n mayPredateSince: z.literal(true).optional(),\n }),\n ),\n /** Newest first; pending workspace changes lead. */\n changes: z.array(tagManagerChangeSchema),\n /**\n * Set when more versions were cut in the window than one read compares: changes are complete back to\n * this time (ISO) only, and older ones in the window are not shown.\n */\n completeSince: z.string().optional(),\n /**\n * Archived versions in the window Tag Manager would not return: what was changed and undone across them\n * is not shown, so the changes are incomplete.\n */\n unreadVersions: z.array(z.string()).optional(),\n});\nexport type TagManagerChangesResponse = z.infer<typeof tagManagerChangesResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// POST /api/tag-manager/draft/stage\n// ---------------------------------------------------------------------------\n\nexport const tagManagerDraftStageRequestSchema = z.object({\n chatId: z.string(),\n op: tagManagerDraftOpInputSchema,\n});\nexport type TagManagerDraftStageRequest = z.infer<typeof tagManagerDraftStageRequestSchema>;\n\nexport const tagManagerDraftStageResponseSchema = z.object({\n staged: z.literal(true),\n ref: z.string(),\n kind: tagManagerDraftOpKindSchema,\n dependsOn: z.array(z.string()),\n summary: z.string(),\n warnings: z.array(z.string()),\n amended: z.boolean().optional(),\n /** Other chats whose staged or since-published changes touch the same entities. Advisory. */\n hints: z.array(z.string()).optional(),\n});\nexport type TagManagerDraftStageResponse = z.infer<typeof tagManagerDraftStageResponseSchema>;\n\n/** Batch ceiling — a container migration can stage many entities at once. */\nexport const TAG_MANAGER_DRAFT_BATCH_MAX = 200;\n\nexport const tagManagerDraftStageBatchRequestSchema = z.object({\n chatId: z.string(),\n ops: z.array(tagManagerDraftOpInputSchema).min(1).max(TAG_MANAGER_DRAFT_BATCH_MAX),\n});\nexport type TagManagerDraftStageBatchRequest = z.infer<typeof tagManagerDraftStageBatchRequestSchema>;\n\n/** All-or-nothing: every op stages, or the whole batch is rejected. */\nexport const tagManagerDraftStageBatchResponseSchema = z.object({\n staged: z.literal(true),\n count: z.number(),\n ops: z.array(\n z.object({\n ref: z.string(),\n kind: tagManagerDraftOpKindSchema,\n dependsOn: z.array(z.string()),\n summary: z.string(),\n warnings: z.array(z.string()),\n }),\n ),\n /** Other chats whose staged or since-published changes touch the same entities. Advisory. */\n hints: z.array(z.string()).optional(),\n});\nexport type TagManagerDraftStageBatchResponse = z.infer<typeof tagManagerDraftStageBatchResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// POST /api/tag-manager/draft (list) + /show + /amend + /remove + /clear\n// ---------------------------------------------------------------------------\n\nexport const tagManagerDraftOpViewSchema = z.object({\n ref: z.string(),\n kind: tagManagerDraftOpKindSchema,\n entity: tagManagerEntitySchema,\n containerId: z.string(),\n target: z.string().optional(),\n dependsOn: z.array(z.string()),\n summary: z.string(),\n warnings: z.array(z.string()).optional(),\n stagedAt: z.number(),\n result: tagManagerDraftOpResultSchema.optional(),\n});\nexport type TagManagerDraftOpView = z.infer<typeof tagManagerDraftOpViewSchema>;\n\n/** The staged op's full payload as its \"receipt\" — verify a change before publish. */\nexport const tagManagerDraftOpDetailSchema = tagManagerDraftOpViewSchema.extend({\n payload: z.unknown().optional(),\n annotations: z.unknown().optional(),\n});\n\nexport const tagManagerDraftListRequestSchema = z.object({\n chatId: z.string(),\n /** Every op as `draft show` prints it, payload included — one call instead of a show per op. */\n full: z.boolean().optional(),\n});\nexport type TagManagerDraftListRequest = z.infer<typeof tagManagerDraftListRequestSchema>;\n\nexport const tagManagerDraftListResponseSchema = z.object({\n status: z.enum([\"active\", \"publishing\", \"applied\", \"discarded\", \"none\"]),\n count: z.number(),\n /** Payload and annotations only when the request asked for `full`. */\n ops: z.array(tagManagerDraftOpDetailSchema),\n /** Set once a publish has run: the container version the ops were cut into. */\n versionId: z.string().optional(),\n /** Whether that version was published to the live container, or is waiting for a human. */\n published: z.boolean().optional(),\n compilerError: z.string().optional(),\n /** Other chats whose staged or since-published changes touch the same entities. Advisory. */\n hints: z.array(z.string()).optional(),\n});\nexport type TagManagerDraftListResponse = z.infer<typeof tagManagerDraftListResponseSchema>;\n\nexport const tagManagerDraftShowRequestSchema = z.object({ chatId: z.string(), ref: z.string() });\nexport type TagManagerDraftShowRequest = z.infer<typeof tagManagerDraftShowRequestSchema>;\n\n/** The staged op's full payload as its \"receipt\" — verify a change before publish. */\nexport const tagManagerDraftShowResponseSchema = z.object({\n hints: z.array(z.string()).optional(),\n op: tagManagerDraftOpDetailSchema,\n});\nexport type TagManagerDraftShowResponse = z.infer<typeof tagManagerDraftShowResponseSchema>;\n\nexport const tagManagerDraftAmendRequestSchema = z.object({\n chatId: z.string(),\n ref: z.string(),\n patch: z.record(z.string(), z.unknown()),\n});\nexport type TagManagerDraftAmendRequest = z.infer<typeof tagManagerDraftAmendRequestSchema>;\n\nexport const tagManagerDraftRemoveRequestSchema = z.object({ chatId: z.string(), ref: z.string() });\nexport type TagManagerDraftRemoveRequest = z.infer<typeof tagManagerDraftRemoveRequestSchema>;\n\nexport const tagManagerDraftRemoveResponseSchema = z.object({\n /** The requested ref plus any dependents removed by cascade. */\n removed: z.array(z.string()),\n});\nexport type TagManagerDraftRemoveResponse = z.infer<typeof tagManagerDraftRemoveResponseSchema>;\n\nexport const tagManagerDraftClearRequestSchema = z.object({ chatId: z.string() });\nexport type TagManagerDraftClearRequest = z.infer<typeof tagManagerDraftClearRequestSchema>;\n\nexport const tagManagerDraftClearResponseSchema = z.object({ cleared: z.number() });\nexport type TagManagerDraftClearResponse = z.infer<typeof tagManagerDraftClearResponseSchema>;\n","import {\n TAG_MANAGER_CHANGES_DEFAULT_DAYS,\n TAG_MANAGER_CHANGES_MAX_DAYS,\n type TagManagerChangesResponse,\n} from \"@baker/api/tag-manager\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { writeJsonEnvelope } from \"../ads/output.ts\";\nimport { failValidation, handleError, TAG_MANAGER_TIMEOUT_MS } from \"./shared.ts\";\n\nconst ARGS = {\n container: {\n type: \"string\",\n description: \"Numeric container id (optional only when one container is connected)\",\n required: false,\n },\n since: {\n type: \"string\",\n description: \"First day to include, YYYY-MM-DD (UTC), e.g. the date of the last review. Wins over --days.\",\n required: false,\n },\n days: {\n type: \"string\",\n description: `Look back this many days instead (default ${TAG_MANAGER_CHANGES_DEFAULT_DAYS}, max ${TAG_MANAGER_CHANGES_MAX_DAYS})`,\n required: false,\n },\n} as const;\n\nregisterSchema({\n command: \"tagManager.changes\",\n routes: [\"POST /api/tag-manager/changes\"],\n effect: \"read_live\",\n description:\n \"What changed in a Tag Manager container since a date: every tag, trigger, variable, folder and template created, modified or deleted and every built-in variable switched on or off, with when it was saved and the container version that carried it (live marks the version the site runs, archived one deleted from the Versions list), plus changes saved in any workspace and still waiting to go live (pending, with the workspace). Start here for 'what changed since last week' or 'someone changed GTM' — never diff two `read --full` dumps. Then `read --id <ids>` for what a changed entity holds now.\",\n args: ARGS,\n});\n\n/** The hints a changes read ends with: what to read next, and when the answer stops short of --since. */\nexport function changesHints(data: TagManagerChangesResponse): string[] {\n const hints: string[] = [];\n if (data.completeSince) {\n hints.push(\n `More versions were cut since ${data.since.slice(0, 10)} than one read compares (the newest ones): changes are ` +\n `complete back to ${data.completeSince} only, and older ones are NOT shown. Do not conclude nothing changed ` +\n \"before then; if they matter, say so and point the user to Versions in Tag Manager.\",\n );\n }\n if (data.unreadVersions?.length) {\n hints.push(\n `Archived version(s) ${data.unreadVersions.join(\", \")} could not be read: anything changed in them and undone ` +\n \"in a later version is NOT shown. Do not conclude nothing changed; point the user to Versions in Tag Manager.\",\n );\n }\n const uncertain = data.versions.filter((v) => v.mayPredateSince).map((v) => v.versionId);\n if (uncertain.length > 0) {\n hints.push(\n `Version(s) ${uncertain.join(\", \")} were saved since ${data.since.slice(0, 10)}, but nothing in them was: Tag ` +\n \"Manager re-dates a version when it is renamed or its notes are edited, so each may be an older version \" +\n \"edited since, not a new one. Their changes (mayPredateSince) may predate the window — say so rather than \" +\n \"reporting them as recent.\",\n );\n }\n const gone = new Set(data.changes.filter((c) => c.change === \"deleted\").map((c) => `${c.entity}:${c.entityId}`));\n const ids = [\n ...new Set(\n data.changes\n // `read` holds no templates, a built-in has no id, and a deleted entity holds nothing now.\n .filter(\n (c) => c.entity !== \"template\" && c.entity !== \"builtInVariable\" && !gone.has(`${c.entity}:${c.entityId}`),\n )\n .map((c) => c.entityId),\n ),\n ];\n if (ids.length > 0) {\n hints.push(\n `What a changed entity holds now: baker tag-manager read --container ${data.container.containerId} --id ${ids.slice(0, 10).join(\",\")}`,\n );\n } else if (data.changes.length === 0 && !data.completeSince && !data.unreadVersions?.length) {\n hints.push(\n data.versions.length > 0\n ? `Version(s) ${data.versions.map((v) => v.versionId).join(\", \")} were saved since ${data.since.slice(0, 10)} ` +\n \"but changed no tag, trigger, variable, built-in variable, folder or template — only their name, notes \" +\n \"or settings this read does not compare. Nothing is pending in any workspace.\"\n : `Nothing in this container changed since ${data.since.slice(0, 10)}, published or pending in any workspace.`,\n );\n }\n return hints;\n}\n\nexport const changesCommand = defineCommand({\n meta: {\n name: \"changes\",\n description: `What changed in the Tag Manager container since a date — created, modified and deleted tags, triggers, variables, folders and templates, and built-in variables switched on or off, each dated and tied to the version that carried it.\n\nStart here:\n baker tag-manager changes # the last ${TAG_MANAGER_CHANGES_DEFAULT_DAYS} days\n baker tag-manager changes --since 2026-09-21 # since the last review\n baker tag-manager changes --days 30 --container 89198951\n\nRows marked pending are saved in a workspace (named) but not yet in a version, so not live.\nA deletion carries no time of its own: it went live with its version, cut between that version's cutAfter and savedAt (in data.versions).`,\n },\n args: ARGS,\n run: async ({ args }) => {\n const days = typeof args.days === \"string\" && args.days.length > 0 ? Number(args.days) : undefined;\n if (days !== undefined && (!Number.isInteger(days) || days < 1 || days > TAG_MANAGER_CHANGES_MAX_DAYS)) {\n failValidation(`--days must be a whole number from 1 to ${TAG_MANAGER_CHANGES_MAX_DAYS}`);\n }\n const since = typeof args.since === \"string\" && args.since.length > 0 ? args.since : undefined;\n try {\n const data = await apiPost<TagManagerChangesResponse>(\n \"/api/tag-manager/changes\",\n { containerId: args.container, since, days },\n { timeoutMs: TAG_MANAGER_TIMEOUT_MS },\n );\n writeJsonEnvelope({ ok: true, data, hints: changesHints(data) });\n } catch (err) {\n handleError(err);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,SAAS;AAIX,IAAM,yBAAyB,EAAE,KAAK;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAGM,IAAM,8BAA8B,EAAE,KAAK;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AA8CM,IAAM,4BAA4D,EAAE;AAAA,EAAK,MAC9E,EAAE,OAAO;AAAA,IACP,KAAK,EAAE,OAAO,EAAE,SAAS;AAAA,IACzB,MAAM,EAAE,KAAK,CAAC,YAAY,WAAW,WAAW,QAAQ,OAAO,oBAAoB,cAAc,CAAC;AAAA,IAClG,OAAO,EAAE,OAAO,EAAE,SAAS;AAAA,IAC3B,MAAM,EAAE,MAAM,yBAAyB,EAAE,SAAS;AAAA,IAClD,KAAK,EAAE,MAAM,yBAAyB,EAAE,SAAS;AAAA,EACnD,CAAC;AACH;AAEA,IAAM,kBAAkB,EAAE,OAAO;AAAA,EAC/B,MAAM,EAAE,OAAO;AAAA,EACf,WAAW,EAAE,MAAM,yBAAyB,EAAE,SAAS;AACzD,CAAC;AAOD,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,SAAS,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC,qBAAqB,KAAK,MAAM,MAAM,GAAG,EAAE,CAAC,6LAG1G,2CAA2C,KAAK,MAAM,MAAM,GAAG,EAAE,CAAC;AAAA,IACxE;AAAA,EACF;AACA,SAAO;AACT;AAEO,IAAM,iBAAiB,cAAc;AAAA,EAC1C,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA,kEAGiD,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMhG;AAAA,EACA,MAAM;AAAA,EACN,KAAK,OAAO,EAAE,KAAK,MAAM;AACvB,UAAM,OAAO,OAAO,KAAK,SAAS,YAAY,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,IAAI;AACzF,QAAI,SAAS,WAAc,CAAC,OAAO,UAAU,IAAI,KAAK,OAAO,KAAK,OAAO,+BAA+B;AACtG,qBAAe,2CAA2C,4BAA4B,EAAE;AAAA,IAC1F;AACA,UAAM,QAAQ,OAAO,KAAK,UAAU,YAAY,KAAK,MAAM,SAAS,IAAI,KAAK,QAAQ;AACrF,QAAI;AACF,YAAM,OAAO,MAAM;AAAA,QACjB;AAAA,QACA,EAAE,aAAa,KAAK,WAAW,OAAO,KAAK;AAAA,QAC3C,EAAE,WAAW,uBAAuB;AAAA,MACtC;AACA,wBAAkB,EAAE,IAAI,MAAM,MAAM,OAAO,aAAa,IAAI,EAAE,CAAC;AAAA,IACjE,SAAS,KAAK;AACZ,kBAAY,GAAG;AAAA,IACjB;AAAA,EACF;AACF,CAAC;","names":["z","z"]}
|
|
@@ -511,6 +511,7 @@ var ORGANIZATION_COMMANDS = [
|
|
|
511
511
|
"tags draft",
|
|
512
512
|
"tag-manager containers",
|
|
513
513
|
"tag-manager read",
|
|
514
|
+
"tag-manager changes",
|
|
514
515
|
"tag-manager draft list",
|
|
515
516
|
"tag-manager draft show",
|
|
516
517
|
// CRM and accounts.
|
|
@@ -720,4 +721,4 @@ export {
|
|
|
720
721
|
offers,
|
|
721
722
|
applyAgentProfile
|
|
722
723
|
};
|
|
723
|
-
//# sourceMappingURL=chunk-
|
|
724
|
+
//# sourceMappingURL=chunk-A6B45KSH.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/command-loading.ts","../src/profile-help.ts","../src/agent-profile.ts"],"sourcesContent":["import type { Resolvable, SubCommandsDef } from \"citty\";\n\n/**\n * Which command families one `baker` invocation has to load.\n *\n * Loading every family is what made each `baker` process hold ~135 MB of heap\n * while it waited on one HTTP call: twenty parallel agents ran sixty of them and\n * filled an 8 GB Runtime. A command needs its own family and nothing else.\n */\nexport function familiesToLoad(argv: readonly string[], families: readonly string[]): string[] | \"all\" {\n const first = argv.find((token) => !token.startsWith(\"-\"));\n // `schema` reads the registry every family fills as it loads.\n if (first !== undefined && first !== \"schema\" && families.includes(first)) return [first];\n return \"all\";\n}\n\nexport type LoadableCommand = { meta?: Resolvable<unknown>; subCommands?: Resolvable<SubCommandsDef> };\n\nasync function resolved<T>(value: Resolvable<T>): Promise<T> {\n return typeof value === \"function\" ? await (value as () => T | Promise<T>)() : await value;\n}\n\n/** The command's subcommands, loaded in place if they were declared lazily. */\nasync function subCommandsOf(command: LoadableCommand): Promise<SubCommandsDef | undefined> {\n if (command.subCommands === undefined) return undefined;\n const subCommands = await resolved(command.subCommands);\n command.subCommands = subCommands;\n return subCommands;\n}\n\n/**\n * The subcommand of `command` that `token` names, by its name or an alias, as\n * citty finds it — loaded in place. An alias lives in the subcommand's own\n * meta, so a token that is no name loads the siblings to read theirs.\n */\nexport async function loadSubCommandNamed(\n command: LoadableCommand,\n token: string,\n): Promise<[string, LoadableCommand] | null> {\n const subCommands = await subCommandsOf(command);\n if (!subCommands) return null;\n const named = subCommands[token];\n if (named !== undefined) {\n const loaded = await resolved(named);\n subCommands[token] = loaded;\n return [token, loaded];\n }\n for (const [name, sub] of Object.entries(subCommands)) {\n const loaded = await resolved(sub);\n subCommands[name] = loaded;\n const meta = (await resolved(loaded.meta ?? {})) as { alias?: unknown };\n const aliases = Array.isArray(meta.alias) ? meta.alias : meta.alias === undefined ? [] : [meta.alias];\n if (aliases.includes(token)) return [name, loaded];\n }\n return null;\n}\n\n/** Loads, in place, every command at every depth. */\nexport async function loadAllCommands(command: LoadableCommand): Promise<void> {\n const subCommands = await subCommandsOf(command);\n if (!subCommands) return;\n for (const [name, sub] of Object.entries(subCommands)) {\n const loaded = await resolved(sub);\n subCommands[name] = loaded;\n await loadAllCommands(loaded);\n }\n}\n\n/**\n * Loads, in place, the command `argv` names and every parent on the way — and\n * nothing else, so the flag guards in `cli.ts` see the command they judge while\n * its siblings stay unloaded. Everything loads for `schema` and an unknown\n * name, which need the whole tree. It stops at the first flag: the organization\n * guard (`agent-profile.ts`) walks on past one itself, and loads the subtree a\n * `--help` lists.\n */\nexport async function loadCommands<T extends LoadableCommand>(root: T, argv: readonly string[]): Promise<T> {\n const families = Object.keys((await subCommandsOf(root)) ?? {});\n if (familiesToLoad(argv, families) === \"all\") {\n await loadAllCommands(root);\n return root;\n }\n let command: LoadableCommand = root;\n for (const token of argv) {\n if (token === \"--\" || token.startsWith(\"-\")) break;\n const subCommands = await subCommandsOf(command);\n const sub = subCommands?.[token];\n if (!subCommands || sub === undefined) break;\n const loaded = await resolved(sub);\n subCommands[token] = loaded;\n command = loaded;\n }\n return root;\n}\n","/**\n * What a command's help says, for the agent reading it.\n *\n * Descriptions are written for a company's agent, which may run every command:\n * they cite writes as examples (`baker ads meta campaigns create …`) and say a\n * family \"lists campaigns, or stages writes\". Read by the organization's agent,\n * which may only read, each is a call it would make and be refused. So a line\n * that names a command the reader may not run leaves its help, and where a\n * family holds commands the reader may not run, so does the talk of staging\n * them. A family the reader may change whole (the organization's own Scheduled\n * agents) keeps its staging, because it is how that family works.\n */\n\nimport type { AgentProfile } from \"./agent-profile.ts\";\n\ntype HelpNode = { meta?: unknown; subCommands?: unknown };\ntype Offers = (path: string) => boolean;\n\nfunction loadedSubCommands(node: HelpNode): Array<[string, HelpNode]> {\n const subCommands = node.subCommands;\n if (typeof subCommands !== \"object\" || subCommands === null) return [];\n return Object.entries(subCommands as Record<string, unknown>).flatMap(([name, sub]) =>\n typeof sub === \"object\" && sub !== null ? [[name, sub as HelpNode] as [string, HelpNode]] : [],\n );\n}\n\nfunction subCommandNames(node: HelpNode): string[] {\n const subCommands = node.subCommands;\n return typeof subCommands === \"object\" && subCommands !== null ? Object.keys(subCommands) : [];\n}\n\n/**\n * The command words name (`baker <words>`, or a family's command in backticks),\n * as far as the tree reaches; none when the first is no family. Where the tree\n * is not loaded this far (another family, a sibling this call never needed),\n * the words as written stand for the command: `offers` reads a command by its\n * leading words, so an argument after them changes nothing.\n */\nfunction commandOf(root: HelpNode, mention: string): string[] {\n const words = mention.trim().split(/\\s+/);\n let node: HelpNode = root;\n const path: string[] = [];\n for (const word of words) {\n const loaded = loadedSubCommands(node).find(([name]) => name === word)?.[1];\n if (!loaded) {\n // Not loaded is not \"not there\": a lazy entry of that name stands for the words written.\n return subCommandNames(node).includes(word) ? [words.join(\" \")] : path.length > 0 ? [path.join(\" \")] : [];\n }\n node = loaded;\n path.push(word);\n }\n return [path.join(\" \")];\n}\n\nfunction indentOf(line: string): number {\n return line.length - line.trimStart().length;\n}\n\n/**\n * The lines without those `drops` says go, each taken with what continues it:\n * the lines indented under it, the next line after a trailing `\\`, and the rest\n * of a sentence wrapped onto the lines below. `drops` returns the kept text of\n * a line, or null to drop it.\n */\nfunction dropping(lines: string[], drops: (line: string) => string | null): string[] {\n const kept: string[] = [];\n let carried: ((line: string) => boolean) | null = null;\n for (const line of lines) {\n if (carried?.(line)) continue;\n carried = null;\n const rest = drops(line);\n if (rest !== null) {\n kept.push(rest);\n continue;\n }\n const indent = indentOf(line);\n if (/\\\\\\s*$/.test(line)) {\n let open = true;\n carried = (next) => {\n const continues = open;\n open = /\\\\\\s*$/.test(next);\n return continues;\n };\n } else if (indent === 0 && !/[.:!?)]\\s*$/.test(line)) {\n let open = true;\n carried = (next) => {\n const continues = open && next.trim() !== \"\" && indentOf(next) === 0;\n open = continues && !/[.:!?)]\\s*$/.test(next);\n return continues;\n };\n } else if (indent > 0) {\n carried = (next) => next.trim() !== \"\" && indentOf(next) > indent;\n }\n }\n return kept;\n}\n\n/** A line that stands alone — an example, a table row, a \"Label: …\" entry — goes whole. */\nconst STANDALONE_LINE = /^(?:\\s|baker\\b|[A-Z][\\w ]{0,30}:\\s)/;\n\nfunction balanced(text: string): boolean {\n return (text.match(/\\(/g)?.length ?? 0) === (text.match(/\\)/g)?.length ?? 0);\n}\n\n/** Each command the text names, at where it names it: `baker <words>`, or a family's `<words>` in backticks. */\nfunction commandMentions(root: HelpNode, text: string): Array<{ at: number; words: string }> {\n const families = new Set(subCommandNames(root));\n const quoted = [...text.matchAll(/`([a-z][\\w-]*(?:[ \\t][a-z][\\w-]*)*)(?=[`\\s<])/g)].filter((match) =>\n families.has((match[1] ?? \"\").split(/\\s+/)[0] ?? \"\"),\n );\n return [...text.matchAll(/`?\\bbaker ((?:[a-z][\\w-]*[ \\t]?)+)/g), ...quoted].map((match) => ({\n at: match.index,\n words: match[1] ?? \"\",\n }));\n}\n\n/**\n * Where the text first mentions something the reader may not use — a command\n * it is not offered, or a flag it is refused (`--add-trigger`) — or -1.\n */\nfunction firstUnusable(root: HelpNode, text: string, offered: Offers, refusedFlags: readonly string[]): number {\n const commands = commandMentions(root, text)\n .filter(({ words }) => commandOf(root, words).some((path) => !offered(path)))\n .map(({ at }) => at);\n const flags = refusedFlags.flatMap((flag) => {\n const match = new RegExp(`--${flag}(?![\\\\w-])`).exec(text);\n return match ? [match.index] : [];\n });\n const at = [...commands, ...flags];\n return at.length > 0 ? Math.min(...at) : -1;\n}\n\n/**\n * The sentence without what it says about something the reader may not use:\n * cut back to the clause before the mention when one stands on its own, else\n * dropped.\n */\nfunction sentenceWithout(sentence: string, unusableAt: number): string {\n if (unusableAt === -1) return sentence;\n const before = sentence.slice(0, unusableAt).replace(/`$/, \"\");\n const cut = Math.max(before.lastIndexOf(\", \"), before.lastIndexOf(\" — \"), before.lastIndexOf(\"; \"));\n const clause = cut === -1 ? \"\" : before.slice(0, cut).trim();\n // \"To undo one, `baker …`\" only led to the command.\n const leadsIn = /^(?:to|use|run|call|for|with)\\b/i.test(clause);\n return clause.split(/\\s+/).length >= 3 && balanced(clause) && !leadsIn ? `${clause}.` : \"\";\n}\n\n/** A sentence that leans on the one before it (\"It never touches a live tag.\"). */\nconst LEANS_BACK = /^(?:it|they|this|that|these|those)\\b/i;\n\n/** The text without any mention of a command the reader may not run, or a flag it is refused. */\nexport function withoutUnoffered(\n root: HelpNode,\n text: string,\n offered: Offers,\n refusedFlags: readonly string[] = [],\n): string {\n const unusable = (part: string) => firstUnusable(root, part, offered, refusedFlags);\n return dropping(text.split(\"\\n\"), (line) => {\n if (unusable(line) === -1) return line;\n if (STANDALONE_LINE.test(line)) return null;\n const kept: string[] = [];\n let dropped = false;\n for (const sentence of line.split(/(?<=[.!?])\\s+/)) {\n const rest: string = dropped && LEANS_BACK.test(sentence) ? \"\" : sentenceWithout(sentence, unusable(sentence));\n dropped = rest === \"\";\n if (rest !== \"\") kept.push(rest);\n }\n return kept.length === 0 ? null : kept.join(\" \");\n }).join(\"\\n\");\n}\n\n/** Whether anything loaded under `path` is a command the reader may not run. */\nfunction holdsUnoffered(node: HelpNode, path: string[], offered: Offers): boolean {\n return loadedSubCommands(node).some(\n ([name, sub]) => !offered([...path, name].join(\" \")) || holdsUnoffered(sub, [...path, name], offered),\n );\n}\n\n/** A sentence or line that is about staging a change, from its first words. */\nconst WRITE_TALK =\n /^(?:stage\\b|staged\\b|staging\\b|write subcommands\\b|writes\\b|then stage\\b|drafts:|staged vs published\\b|lifecycle:|nothing staged\\b|on publish\\b|\\w+(?: \\/ \\w+)*\\s+—\\s+stage\\b)/i;\n\n/** The tail of a sentence offering a change: \"List campaigns, or stage writes (…)\". */\nconst WRITE_CLAUSE =\n /(?:\\s*(?:[,;]|\\s—|\\s-)\\s*(?:(?:or|plus|and)\\s+)?|\\s+(?:or|plus|and)\\s+)(?:stage[sd]?|staged)\\b[^.]*/gi;\n\n/** \"List, show, amend or clear …\": a sentence opening on a list of this command's own verbs. */\nconst VERB_LIST = /^((?:[A-Za-z]+, )*[A-Za-z]+,? (?:or|and) [a-z]+)\\b/;\n\n/** The sentence naming, of the verbs it opens on, only those the reader may run; \"\" when none. */\nfunction withOfferedVerbs(sentence: string, children: ReadonlySet<string>, unoffered: ReadonlySet<string>): string {\n const list = VERB_LIST.exec(sentence)?.[1];\n if (!list) return sentence;\n const verbs = list.split(/,\\s*(?:(?:or|and)\\s+)?|\\s+(?:or|and)\\s+/).map((verb) => verb.toLowerCase());\n if (!verbs.every((verb) => children.has(verb))) return sentence;\n const kept = verbs.filter((verb) => !unoffered.has(verb));\n if (kept.length === 0) return \"\";\n const named = kept.length === 1 ? (kept[0] ?? \"\") : `${kept.slice(0, -1).join(\", \")} or ${kept.at(-1)}`;\n return `${named.charAt(0).toUpperCase()}${named.slice(1)}${sentence.slice(list.length)}`;\n}\n\n/** Whether text opens on the name of a command here the reader may not run (\"Release if…\", \" associate-campaign / …\"). */\nfunction opensOnUnoffered(text: string, unoffered: ReadonlySet<string>): boolean {\n const first =\n text\n .trim()\n .split(/[\\s/]+/)[0]\n ?.toLowerCase() ?? \"\";\n return unoffered.has(first);\n}\n\n/** A line that is about a change: staging talk, a command it may not run, or \"Library writes (…):\" over reads. */\nfunction isWriteLine(line: string, unoffered: ReadonlySet<string>): boolean {\n if (WRITE_TALK.test(line.trim())) return true;\n if (indentOf(line) > 0) return opensOnUnoffered(line, unoffered);\n return /:\\s*$/.test(line) && /\\bwrites?\\b/i.test(line);\n}\n\nfunction withoutWriteTalk(paragraph: string, children: ReadonlySet<string>, unoffered: ReadonlySet<string>): string {\n const prose = (text: string) =>\n text\n .replace(WRITE_CLAUSE, \"\")\n .split(/(?<=[.!?])\\s+/)\n .map((sentence) => withOfferedVerbs(sentence, children, unoffered))\n .filter(\n (sentence) => sentence !== \"\" && !WRITE_TALK.test(sentence.trim()) && !opensOnUnoffered(sentence, unoffered),\n )\n .join(\" \");\n const lines = paragraph.split(\"\\n\");\n // Examples, tables and headings are kept line by line, and a line of prose among them sentence by sentence.\n if (lines.some((line) => /^\\s/.test(line) || STANDALONE_LINE.test(line) || /:\\s*$/.test(line))) {\n return dropping(lines, (line) => {\n if (isWriteLine(line, unoffered)) return null;\n if (indentOf(line) > 0 || STANDALONE_LINE.test(line) || !/[.!?]\\s*$/.test(line)) return line;\n const kept = prose(line);\n return kept === \"\" ? null : kept;\n }).join(\"\\n\");\n }\n return prose(lines.join(\" \"));\n}\n\n/** \"Subcommands: list (default), remove, clear.\" names only the ones the reader may run. */\nfunction withOfferedSubcommands(text: string, path: string[], offered: Offers): string {\n return text.replace(/Subcommands: ([^.]*)\\./g, (_whole, list: string) => {\n const kept = list.split(/,\\s*/).filter((item) => offered([...path, item.split(/\\s/)[0] ?? \"\"].join(\" \")));\n return kept.length > 0 ? `Subcommands: ${kept.join(\", \")}.` : \"\";\n });\n}\n\n/** Drops a heading whose block below it was emptied, and the blank lines left behind. */\nfunction tidy(text: string): string {\n const lines = text.split(\"\\n\");\n const kept = lines.filter((line, index) => {\n if (!/:\\s*$/.test(line)) return true;\n const next = lines.slice(index + 1).find((later) => later.trim() !== \"\");\n return next !== undefined && /^\\s/.test(next) && lines[index + 1]?.trim() !== \"\";\n });\n return kept\n .join(\"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\")\n .replace(/^(?:[ \\t]*\\n)+/, \"\")\n .trimEnd();\n}\n\nexport function describedFor(\n root: HelpNode,\n description: string,\n path: string[],\n node: HelpNode,\n profile: AgentProfile,\n offered: Offers,\n refusedFlags: readonly string[] = [],\n): string {\n const cited = withoutUnoffered(root, description, offered, refusedFlags);\n if (profile === \"company\" || !holdsUnoffered(node, path, offered)) return tidy(cited);\n const children = new Set(subCommandNames(node));\n const unoffered = new Set([...children].filter((name) => !offered([...path, name].join(\" \"))));\n const shaped = cited\n .split(/\\n\\s*\\n/)\n .map((paragraph) => withoutWriteTalk(withOfferedSubcommands(paragraph, path, offered), children, unoffered))\n .join(\"\\n\\n\");\n const text = tidy(shaped);\n if (text !== \"\") return text;\n const reads = loadedSubCommands(node).flatMap(([name]) => (offered([...path, name].join(\" \")) ? [name] : []));\n return reads.length > 0 ? `Read: ${reads.join(\", \")}.` : \"\";\n}\n","import { type LoadableCommand, loadAllCommands, loadSubCommandNamed } from \"./command-loading.ts\";\nimport { optionalWorkspaceKind } from \"./env.ts\";\nimport { describedFor, withoutUnoffered } from \"./profile-help.ts\";\n\n/**\n * Which commands this CLI offers the agent running it.\n *\n * One CLI serves two agents. A company's agent works inside its own workspace\n * and changes it; it is offered everything, except the organization family,\n * which is for reading other companies and means nothing to it. The\n * organization workspace's agent reads every company of its organization and\n * changes none of them: it is offered the reads alone, plus the research and\n * judgment it runs as itself, and its own Scheduled agents.\n *\n * This is what the agent is shown, not what it is allowed: the backend refuses\n * a write naming a company whatever the CLI does (`readNamedCompany`). Kept as\n * an explicit list so a new command is hidden from the organization until\n * someone decides it only reads.\n */\n\nexport type AgentProfile = \"company\" | \"organization\";\n\n/** Set on the organization workspace's Runtime (`runtimeSession/nodeActions.ts`). */\nexport function agentProfile(workspaceKind: string | undefined = optionalWorkspaceKind()): AgentProfile {\n return workspaceKind === \"organization\" ? \"organization\" : \"company\";\n}\n\n/** Families only the organization workspace runs: hidden from a company's agent. */\nconst ORGANIZATION_ONLY = [\"organization\"];\n\n/**\n * Every command the organization workspace's agent is offered, as typed. An\n * entry offers that command and everything under it.\n */\nexport const ORGANIZATION_COMMANDS: readonly string[] = [\n \"schema\",\n \"capabilities\",\n \"organization\",\n // A defect or gap in Baker itself, to the Baker team's tracker: it changes no\n // company, and the guard and the publish skill this workspace shares send it here.\n \"feedback\",\n // What a company did and has.\n \"chats\",\n \"history\",\n \"actions list\",\n \"actions log\",\n \"actions get\",\n \"actions status\",\n \"actions draft list\",\n \"actions tags list\",\n // The organization's own Scheduled agents, which live in this workspace:\n // staged like a company's, applied at Publish. Naming a company is still a\n // read only (`readNamedCompany`), so none of these reaches one.\n \"scheduled-agents\",\n \"experiment status\",\n \"experiment history\",\n \"flows list\",\n \"flows show\",\n \"flows schema\",\n \"testimonials get\",\n \"testimonials search\",\n \"testimonials list\",\n \"testimonials tags list\",\n \"testimonials sources list\",\n \"images get\",\n \"images search\",\n \"images library\",\n \"images tags list\",\n // A page's or a link's pictures and videos, to the workspace's own disk: a\n // client's logo, the photos on its site, the video it sent. Firecrawl reads\n // the page; nothing reaches any library (`--auto-ingest` is refused below).\n \"images download\",\n \"images extract\",\n \"videos get\",\n \"videos search\",\n \"videos tags list\",\n \"videos fetch\",\n \"studio get\",\n \"studio list\",\n \"avatars list\",\n \"avatars get\",\n \"creatives performance\",\n \"landings export status\",\n \"landings export list\",\n \"site show\",\n \"site domain list\",\n // A file on this machine as its words and pictures; reads, asks no backend.\n \"files read\",\n \"lead-routes list\",\n \"lead-routes fields\",\n \"credentials list\",\n \"setup-links list\",\n \"media-sources list\",\n \"posts list\",\n \"posts get\",\n \"posts search\",\n \"mcp connected\",\n \"mcp catalog\",\n \"mcp tools\",\n \"mcp execute\",\n \"mcp list\",\n // Ads, every platform: accounts, structure, results, staged drafts.\n \"ads google accounts\",\n \"ads google currency\",\n \"ads google url-options\",\n \"ads google changes\",\n \"ads google invoices\",\n \"ads google identity-verification\",\n \"ads google previews\",\n \"ads google brands\",\n \"ads google search-terms\",\n \"ads google query\",\n \"ads google keywords discover\",\n \"ads google keywords metrics\",\n \"ads google keywords forecast\",\n \"ads google keywords themes\",\n \"ads google keywords locations\",\n \"ads google keywords languages\",\n \"ads google keywords list\",\n \"ads google budgets list\",\n \"ads google campaigns list\",\n \"ads google ad-groups list\",\n \"ads google negative-keywords list\",\n \"ads google negative-keywords check\",\n \"ads google keyword-lists list\",\n \"ads google ads list\",\n \"ads google assets list\",\n \"ads google asset-groups list\",\n \"ads google audiences list\",\n \"ads google audiences targeting\",\n \"ads google conversions list\",\n \"ads google bidding-strategies list\",\n \"ads google labels list\",\n \"ads google campaign-criteria list\",\n \"ads google ad-group-criteria list\",\n \"ads google ad-group-bid-modifiers list\",\n \"ads google account-exclusions list\",\n \"ads google asset-group-signals list\",\n \"ads google merchant-center list\",\n \"ads google draft list\",\n \"ads google draft show\",\n \"ads meta accounts\",\n \"ads meta account\",\n \"ads meta businesses\",\n \"ads meta pages\",\n \"ads meta lead-forms list\",\n \"ads meta leads\",\n \"ads meta campaigns list\",\n \"ads meta adsets list\",\n \"ads meta ads list\",\n \"ads meta creatives list\",\n \"ads meta audiences list\",\n \"ads meta custom-conversions list\",\n \"ads meta pixels\",\n \"ads meta activities\",\n \"ads meta insights\",\n \"ads meta draft list\",\n \"ads meta draft show\",\n \"ads linkedin accounts\",\n \"ads linkedin account detail\",\n \"ads linkedin campaign-groups list\",\n \"ads linkedin campaigns list\",\n \"ads linkedin creatives list\",\n \"ads linkedin draft list\",\n \"ads linkedin draft show\",\n \"ads linkedin analytics\",\n \"ads linkedin demographics\",\n \"ads linkedin companies\",\n \"ads linkedin top-companies\",\n \"ads linkedin resolve\",\n \"ads linkedin facets list\",\n \"ads linkedin facets values\",\n \"ads linkedin audience-size\",\n \"ads linkedin bid-pricing\",\n \"ads linkedin forecast\",\n \"ads linkedin leads\",\n \"ads linkedin conversions list\",\n \"ads linkedin conversions health\",\n \"ads linkedin conversation\",\n \"ads linkedin audit\",\n \"ads linkedin url-params\",\n \"ads x accounts\",\n \"ads x funding\",\n \"ads x campaigns list\",\n \"ads x line-items list\",\n \"ads x promoted-tweets list\",\n \"ads x tweets\",\n \"ads x cards\",\n \"ads x draft list\",\n \"ads x draft show\",\n \"ads x media\",\n \"ads x audiences\",\n \"ads x targeting-criteria list\",\n \"ads x targeting-constants\",\n \"ads x active-entities\",\n \"ads x stats job-status\",\n \"ads chatgpt account show\",\n \"ads chatgpt campaigns list\",\n \"ads chatgpt ad-groups list\",\n \"ads chatgpt ads list\",\n \"ads chatgpt conversions list\",\n \"ads chatgpt conversions events\",\n \"ads chatgpt conversions report\",\n \"ads chatgpt audiences list\",\n \"ads chatgpt catalogs list\",\n \"ads chatgpt catalogs uploads\",\n \"ads chatgpt catalogs products\",\n \"ads chatgpt history\",\n \"ads chatgpt insights\",\n \"ads chatgpt locations\",\n \"ads chatgpt draft list\",\n \"ads chatgpt draft show\",\n // Baker's synced copy of every platform's results, which the live reads above\n // point at first. Reads only: each `show` beside its staged changes.\n \"ads performance overview\",\n \"ads performance trend\",\n // Who the ads brought: counts per ad and per persona answer, and the ladder\n // and persona map they are counted by (`adPerformance/peopleRoute.ts`).\n \"ads performance people\",\n \"ads performance personas\",\n \"ads performance ladder\",\n \"ads performance persona-fields\",\n \"ads performance accounts\",\n \"ads performance setup\",\n \"ads performance entities\",\n \"ads performance entity\",\n \"ads performance changes\",\n \"ads performance impact\",\n \"ads performance creatives\",\n \"ads performance families show\",\n \"ads performance families choices\",\n \"ads performance creative-health\",\n \"ads performance creative-assets\",\n \"ads performance health\",\n \"ads performance breakdown\",\n \"ads performance search-terms\",\n \"ads performance pacing\",\n \"ads performance funnel\",\n \"ads performance tracking\",\n \"ads performance landings\",\n \"ads performance live-in\",\n \"ads performance status\",\n \"ads performance goals show\",\n \"ads performance progress\",\n \"ads performance diagnose\",\n \"ads performance pulse\",\n \"ads performance anomalies\",\n \"ads performance recap\",\n \"ads performance targets show\",\n \"ads performance budget-recommendations\",\n \"ads performance attention show\",\n \"ads performance currency show\",\n \"ads performance brand-split\",\n \"ads performance impression-share\",\n \"ads performance keyword-quality\",\n \"ads performance google-report\",\n \"ads performance budgets show\",\n \"ads performance segments show\",\n // Pages and measurement.\n \"analytics overview\",\n \"analytics traffic\",\n \"analytics funnel\",\n \"analytics flow\",\n \"analytics page\",\n \"analytics triggers\",\n \"analytics releases\",\n \"analytics paid\",\n \"analytics delivery\",\n \"analytics submissions\",\n \"analytics geo\",\n \"analytics bots\",\n \"analytics landings\",\n \"analytics tags\",\n \"analytics events\",\n \"analytics feed\",\n \"analytics lookup\",\n \"analytics devices\",\n \"analytics ads\",\n \"analytics conversions\",\n \"analytics sends\",\n \"analytics tracking\",\n \"analytics arrivals\",\n \"analytics sending-events\",\n \"analytics sources\",\n \"analytics website-tag\",\n \"analytics sites\",\n \"analytics questionnaire\",\n \"analytics presets\",\n \"funnel\",\n \"ga4 properties\",\n \"ga4 config\",\n \"ga4 audit\",\n \"ga4 query\",\n \"ga4 draft list\",\n \"ga4 draft show\",\n \"gsc\",\n \"tags list\",\n \"tags draft\",\n \"tag-manager containers\",\n \"tag-manager read\",\n \"tag-manager draft list\",\n \"tag-manager draft show\",\n // CRM and accounts.\n \"hubspot\",\n \"pipedrive\",\n \"accounts influenced\",\n \"accounts engagement\",\n \"accounts warm\",\n \"accounts company\",\n \"accounts campaigns\",\n \"accounts crm status\",\n \"accounts crm check\",\n \"accounts crm contract\",\n // Research and judgment, run as the workspace itself (never with --company).\n // Not `research customers`, which writes into a company's Knowledge, nor\n // `winning-ads fit`, which judges an ad against a company's own COMPANY.md.\n \"research web\",\n \"research fetch\",\n \"research cite\",\n \"research linkedin-person\",\n \"research people\",\n \"research transcript\",\n \"research company\",\n \"research google-ads\",\n \"research reddit\",\n \"research advertisers\",\n \"research autocomplete\",\n \"research countries\",\n \"research intent\",\n \"research keyword-metrics\",\n \"research keywords-for-site\",\n \"research keyword-gap\",\n \"research languages\",\n \"research lighthouse\",\n \"research relevant-pages\",\n \"decide\",\n // The organization workspace's own vault, ranked like a company's.\n \"knowledge search\",\n \"winning-ads search\",\n \"winning-ads advertisers\",\n // Adds a brand to Baker's shared library with nobody following it, so a\n // client being set up can be read there: its channels, ads and landings.\n \"winning-ads add\",\n \"winning-ads discover\",\n \"winning-ads following\",\n \"winning-ads feed\",\n \"winning-ads winners\",\n \"winning-ads ads\",\n \"winning-ads profile\",\n \"winning-ads launches\",\n \"winning-ads landings\",\n \"winning-ads search-copy\",\n \"winning-ads content\",\n \"winning-ads hooks\",\n \"winning-ads mechanisms\",\n \"winning-ads formats\",\n];\n\nfunction covers(entry: string, path: string): boolean {\n return path === entry || path.startsWith(`${entry} `);\n}\n\n/**\n * Whether `path` (a command as typed, `\"ads meta campaigns list\"`) is offered\n * to `profile`. A group is offered when anything under it is, so the way to an\n * offered command stays open.\n */\nexport function offers(profile: AgentProfile, path: string): boolean {\n if (path === \"\") return true;\n if (profile === \"company\") {\n return !ORGANIZATION_ONLY.some((family) => covers(family, path));\n }\n return ORGANIZATION_COMMANDS.some((entry) => covers(entry, path) || covers(path, entry));\n}\n\n/**\n * The flags that change something, on commands the organization is offered to\n * read. `funnel` reads the funnel and `funnel --add-trigger` changes it, so the\n * command is offered and these are refused, and left out of its help.\n */\nexport const ORGANIZATION_WRITE_FLAGS: Readonly<Record<string, readonly string[]>> = {\n \"images extract\": [\"auto-ingest\", \"context\"],\n funnel: [\"steps\", \"step\", \"add-trigger\", \"remove-trigger\", \"event\", \"from-conversion\", \"remove-step\", \"preset\"],\n \"analytics conversions\": [\"event\", \"name\", \"rename\", \"to\", \"remove-name\", \"count-mode\", \"remove\"],\n \"analytics sends\": [\n \"set\",\n \"source-event\",\n \"from\",\n \"platform\",\n \"tag\",\n \"event\",\n \"account\",\n \"parameter\",\n \"id\",\n \"remove\",\n ],\n \"analytics sources\": [\n \"server\",\n \"create\",\n \"create-hubspot\",\n \"create-activecampaign\",\n \"events\",\n \"account\",\n \"set-trigger\",\n \"set-amount\",\n \"amount-property\",\n \"currency\",\n \"write\",\n \"name\",\n \"map\",\n \"field\",\n \"pause\",\n \"resume\",\n \"remove\",\n ],\n \"analytics sites\": [\"add\", \"remove\"],\n};\n\nfunction kebabCase(name: string): string {\n return name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\n/** The first flag in `argv` the organization is refused on the command at `path`, if any. */\nfunction refusedFlagIn(path: string, argv: readonly string[]): string | null {\n const refused = ORGANIZATION_WRITE_FLAGS[path];\n if (!refused) return null;\n const end = argv.indexOf(\"--\");\n for (const token of end === -1 ? argv : argv.slice(0, end)) {\n if (!token.startsWith(\"--\")) continue;\n const name = kebabCase(token.slice(2).split(\"=\")[0] ?? \"\").replace(/^no-/, \"\");\n if (refused.includes(name)) return name;\n }\n return null;\n}\n\ntype ProfiledCommand = { meta?: unknown; subCommands?: unknown };\n\n/** What the organization's agent is told when it reaches for a command it is not offered. */\nexport const ORGANIZATION_REFUSAL =\n \"The organization workspace only reads its companies, and this command changes something. A change to a company is made in that company's own chat; here, read it and show it in a Report.\";\n\nfunction hide(command: ProfiledCommand): void {\n if (typeof command.meta === \"object\" && command.meta !== null) {\n (command.meta as { hidden?: boolean }).hidden = true;\n }\n}\n\n/**\n * Rewrites, in place, what each loaded command `profile` is shown says\n * (`profile-help.ts`), and takes off it the flags `profile` is refused. Args are\n * replaced rather than edited: one definition can be shared between commands.\n */\nfunction describeOffered(root: ProfiledCommand, command: ProfiledCommand, profile: AgentProfile, path: string[]): void {\n const meta = command.meta as { hidden?: boolean; description?: unknown } | undefined;\n if (meta?.hidden === true) return;\n const offered = (cited: string) => offers(profile, cited);\n const refusedFlags = profile === \"organization\" ? (ORGANIZATION_WRITE_FLAGS[path.join(\" \")] ?? []) : [];\n if (typeof meta?.description === \"string\") {\n meta.description = describedFor(root, meta.description, path, command, profile, offered, refusedFlags);\n }\n const shaped = command as { args?: unknown };\n if (typeof shaped.args === \"object\" && shaped.args !== null) {\n shaped.args = Object.fromEntries(\n Object.entries(shaped.args as Record<string, unknown>).flatMap(([name, arg]) => {\n if (refusedFlags.includes(kebabCase(name))) return [];\n const description = (arg as { description?: unknown } | null)?.description;\n return [\n [\n name,\n typeof description === \"string\"\n ? { ...(arg as object), description: withoutUnoffered(root, description, offered, refusedFlags) }\n : arg,\n ],\n ];\n }),\n );\n }\n const subCommands = command.subCommands;\n if (typeof subCommands !== \"object\" || subCommands === null) return;\n for (const [name, sub] of Object.entries(subCommands as Record<string, unknown>)) {\n if (typeof sub === \"object\" && sub !== null)\n describeOffered(root, sub as ProfiledCommand, profile, [...path, name]);\n }\n}\n\n/** Marks, in place, every loaded command `profile` is not offered as hidden from help. */\nfunction hideUnoffered(command: ProfiledCommand, profile: AgentProfile, path: string[]): void {\n const subCommands = command.subCommands;\n if (typeof subCommands !== \"object\" || subCommands === null) return;\n for (const [name, sub] of Object.entries(subCommands as Record<string, unknown>)) {\n if (typeof sub !== \"object\" || sub === null) continue;\n const subPath = [...path, name];\n if (!offers(profile, subPath.join(\" \"))) hide(sub as ProfiledCommand);\n hideUnoffered(sub as ProfiledCommand, profile, subPath);\n }\n}\n\ntype ArgDefinition = { type?: unknown; alias?: unknown };\n\nfunction camelCase(name: string): string {\n return name.replace(/-([a-z0-9])/g, (_, letter: string) => letter.toUpperCase());\n}\n\nfunction aliases(of: unknown): unknown[] {\n return Array.isArray(of) ? of : of === undefined ? [] : [of];\n}\n\n/** Whether `flag` takes the token after it as its value on `command`, as citty reads it. */\nfunction takesValue(command: ProfiledCommand & { args?: unknown }, flag: string): boolean {\n if (flag.includes(\"=\") || typeof command.args !== \"object\" || command.args === null) return false;\n const name = flag.replace(/^-{1,2}/, \"\");\n return Object.entries(command.args as Record<string, ArgDefinition>).some(\n ([key, definition]) =>\n (definition.type === \"string\" || definition.type === \"enum\") &&\n (camelCase(key) === camelCase(name) || aliases(definition.alias).includes(name)),\n );\n}\n\n/**\n * The command `argv` addresses, found the way citty finds it: flags, and the\n * value after one that takes it, are skipped, so a flag before a command's name\n * cannot leave the path at its group. Each step is loaded on the way —\n * `loadCommands` stops at the first flag, and `--company` is taken off only\n * after it ran, so the guard cannot lean on what it loaded.\n */\nasync function addressedCommand(\n root: ProfiledCommand,\n argv: readonly string[],\n): Promise<{ path: string; command: ProfiledCommand }> {\n const path: string[] = [];\n let command: ProfiledCommand = root;\n for (let index = 0; index < argv.length; index++) {\n const token = argv[index] ?? \"\";\n if (token === \"--\") break;\n if (token.startsWith(\"-\")) {\n if (takesValue(command, token)) index++;\n continue;\n }\n const next = await loadSubCommandNamed(command as LoadableCommand, token);\n if (!next) break;\n path.push(next[0]);\n command = next[1] as ProfiledCommand;\n }\n return { path: path.join(\" \"), command };\n}\n\n/**\n * Shapes the loaded command tree for the agent running it: what it is not\n * offered leaves its help, and the organization's agent is refused a command it\n * is not offered (the returned message; `null` when it may run). A company's\n * agent is never refused: the organization's commands are only out of its help,\n * because a Report published from the organization workspace runs them on a\n * runner that has no profile of its own.\n */\nexport async function applyAgentProfile(\n root: ProfiledCommand,\n profile: AgentProfile,\n argv: readonly string[],\n): Promise<string | null> {\n const { path, command } = await addressedCommand(root, argv);\n // A walk that ends on a group prints its usage — `--help` anywhere, past `--`\n // too, or no command or an unknown one — listing its subcommands, which are\n // hidden only once loaded. A walk that reaches a command loads nothing more.\n await loadAllCommands(command as LoadableCommand);\n // Judged before the help is shaped, which takes the refused flags off the command.\n const refused = profile === \"organization\" && (!offers(profile, path) || refusedFlagIn(path, argv) !== null);\n hideUnoffered(root, profile, []);\n describeOffered(root, root, profile, []);\n return refused ? ORGANIZATION_REFUSAL : null;\n}\n"],"mappings":";;;;;AASO,SAAS,eAAe,MAAyB,UAA+C;AACrG,QAAM,QAAQ,KAAK,KAAK,CAAC,UAAU,CAAC,MAAM,WAAW,GAAG,CAAC;AAEzD,MAAI,UAAU,UAAa,UAAU,YAAY,SAAS,SAAS,KAAK,EAAG,QAAO,CAAC,KAAK;AACxF,SAAO;AACT;AAIA,eAAe,SAAY,OAAkC;AAC3D,SAAO,OAAO,UAAU,aAAa,MAAO,MAA+B,IAAI,MAAM;AACvF;AAGA,eAAe,cAAc,SAA+D;AAC1F,MAAI,QAAQ,gBAAgB,OAAW,QAAO;AAC9C,QAAM,cAAc,MAAM,SAAS,QAAQ,WAAW;AACtD,UAAQ,cAAc;AACtB,SAAO;AACT;AAOA,eAAsB,oBACpB,SACA,OAC2C;AAC3C,QAAM,cAAc,MAAM,cAAc,OAAO;AAC/C,MAAI,CAAC,YAAa,QAAO;AAC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AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAIA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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,KAAM,QAAO;AAC5F,QAAM,OAAO,KAAK,QAAQ,WAAW,EAAE;AACvC,SAAO,OAAO,QAAQ,QAAQ,IAAqC,EAAE;AAAA,IACnE,CAAC,CAAC,KAAK,UAAU,OACd,WAAW,SAAS,YAAY,WAAW,SAAS,YACpD,UAAU,GAAG,MAAM,UAAU,IAAI,KAAK,QAAQ,WAAW,KAAK,EAAE,SAAS,IAAI;AAAA,EAClF;AACF;AASA,eAAe,iBACb,MACA,MACqD;AACrD,QAAM,OAAiB,CAAC;AACxB,MAAI,UAA2B;AAC/B,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;AAChD,UAAM,QAAQ,KAAK,KAAK,KAAK;AAC7B,QAAI,UAAU,KAAM;AACpB,QAAI,MAAM,WAAW,GAAG,GAAG;AACzB,UAAI,WAAW,SAAS,KAAK,EAAG;AAChC;AAAA,IACF;AACA,UAAM,OAAO,MAAM,oBAAoB,SAA4B,KAAK;AACxE,QAAI,CAAC,KAAM;AACX,SAAK,KAAK,KAAK,CAAC,CAAC;AACjB,cAAU,KAAK,CAAC;AAAA,EAClB;AACA,SAAO,EAAE,MAAM,KAAK,KAAK,GAAG,GAAG,QAAQ;AACzC;AAUA,eAAsB,kBACpB,MACA,SACA,MACwB;AACxB,QAAM,EAAE,MAAM,QAAQ,IAAI,MAAM,iBAAiB,MAAM,IAAI;AAI3D,QAAM,gBAAgB,OAA0B;AAEhD,QAAM,UAAU,YAAY,mBAAmB,CAAC,OAAO,SAAS,IAAI,KAAK,cAAc,MAAM,IAAI,MAAM;AACvG,gBAAc,MAAM,SAAS,CAAC,CAAC;AAC/B,kBAAgB,MAAM,MAAM,SAAS,CAAC,CAAC;AACvC,SAAO,UAAU,uBAAuB;AAC1C;","names":["aliases","at"]}
|
|
1
|
+
{"version":3,"sources":["../src/command-loading.ts","../src/profile-help.ts","../src/agent-profile.ts"],"sourcesContent":["import type { Resolvable, SubCommandsDef } from \"citty\";\n\n/**\n * Which command families one `baker` invocation has to load.\n *\n * Loading every family is what made each `baker` process hold ~135 MB of heap\n * while it waited on one HTTP call: twenty parallel agents ran sixty of them and\n * filled an 8 GB Runtime. A command needs its own family and nothing else.\n */\nexport function familiesToLoad(argv: readonly string[], families: readonly string[]): string[] | \"all\" {\n const first = argv.find((token) => !token.startsWith(\"-\"));\n // `schema` reads the registry every family fills as it loads.\n if (first !== undefined && first !== \"schema\" && families.includes(first)) return [first];\n return \"all\";\n}\n\nexport type LoadableCommand = { meta?: Resolvable<unknown>; subCommands?: Resolvable<SubCommandsDef> };\n\nasync function resolved<T>(value: Resolvable<T>): Promise<T> {\n return typeof value === \"function\" ? await (value as () => T | Promise<T>)() : await value;\n}\n\n/** The command's subcommands, loaded in place if they were declared lazily. */\nasync function subCommandsOf(command: LoadableCommand): Promise<SubCommandsDef | undefined> {\n if (command.subCommands === undefined) return undefined;\n const subCommands = await resolved(command.subCommands);\n command.subCommands = subCommands;\n return subCommands;\n}\n\n/**\n * The subcommand of `command` that `token` names, by its name or an alias, as\n * citty finds it — loaded in place. An alias lives in the subcommand's own\n * meta, so a token that is no name loads the siblings to read theirs.\n */\nexport async function loadSubCommandNamed(\n command: LoadableCommand,\n token: string,\n): Promise<[string, LoadableCommand] | null> {\n const subCommands = await subCommandsOf(command);\n if (!subCommands) return null;\n const named = subCommands[token];\n if (named !== undefined) {\n const loaded = await resolved(named);\n subCommands[token] = loaded;\n return [token, loaded];\n }\n for (const [name, sub] of Object.entries(subCommands)) {\n const loaded = await resolved(sub);\n subCommands[name] = loaded;\n const meta = (await resolved(loaded.meta ?? {})) as { alias?: unknown };\n const aliases = Array.isArray(meta.alias) ? meta.alias : meta.alias === undefined ? [] : [meta.alias];\n if (aliases.includes(token)) return [name, loaded];\n }\n return null;\n}\n\n/** Loads, in place, every command at every depth. */\nexport async function loadAllCommands(command: LoadableCommand): Promise<void> {\n const subCommands = await subCommandsOf(command);\n if (!subCommands) return;\n for (const [name, sub] of Object.entries(subCommands)) {\n const loaded = await resolved(sub);\n subCommands[name] = loaded;\n await loadAllCommands(loaded);\n }\n}\n\n/**\n * Loads, in place, the command `argv` names and every parent on the way — and\n * nothing else, so the flag guards in `cli.ts` see the command they judge while\n * its siblings stay unloaded. Everything loads for `schema` and an unknown\n * name, which need the whole tree. It stops at the first flag: the organization\n * guard (`agent-profile.ts`) walks on past one itself, and loads the subtree a\n * `--help` lists.\n */\nexport async function loadCommands<T extends LoadableCommand>(root: T, argv: readonly string[]): Promise<T> {\n const families = Object.keys((await subCommandsOf(root)) ?? {});\n if (familiesToLoad(argv, families) === \"all\") {\n await loadAllCommands(root);\n return root;\n }\n let command: LoadableCommand = root;\n for (const token of argv) {\n if (token === \"--\" || token.startsWith(\"-\")) break;\n const subCommands = await subCommandsOf(command);\n const sub = subCommands?.[token];\n if (!subCommands || sub === undefined) break;\n const loaded = await resolved(sub);\n subCommands[token] = loaded;\n command = loaded;\n }\n return root;\n}\n","/**\n * What a command's help says, for the agent reading it.\n *\n * Descriptions are written for a company's agent, which may run every command:\n * they cite writes as examples (`baker ads meta campaigns create …`) and say a\n * family \"lists campaigns, or stages writes\". Read by the organization's agent,\n * which may only read, each is a call it would make and be refused. So a line\n * that names a command the reader may not run leaves its help, and where a\n * family holds commands the reader may not run, so does the talk of staging\n * them. A family the reader may change whole (the organization's own Scheduled\n * agents) keeps its staging, because it is how that family works.\n */\n\nimport type { AgentProfile } from \"./agent-profile.ts\";\n\ntype HelpNode = { meta?: unknown; subCommands?: unknown };\ntype Offers = (path: string) => boolean;\n\nfunction loadedSubCommands(node: HelpNode): Array<[string, HelpNode]> {\n const subCommands = node.subCommands;\n if (typeof subCommands !== \"object\" || subCommands === null) return [];\n return Object.entries(subCommands as Record<string, unknown>).flatMap(([name, sub]) =>\n typeof sub === \"object\" && sub !== null ? [[name, sub as HelpNode] as [string, HelpNode]] : [],\n );\n}\n\nfunction subCommandNames(node: HelpNode): string[] {\n const subCommands = node.subCommands;\n return typeof subCommands === \"object\" && subCommands !== null ? Object.keys(subCommands) : [];\n}\n\n/**\n * The command words name (`baker <words>`, or a family's command in backticks),\n * as far as the tree reaches; none when the first is no family. Where the tree\n * is not loaded this far (another family, a sibling this call never needed),\n * the words as written stand for the command: `offers` reads a command by its\n * leading words, so an argument after them changes nothing.\n */\nfunction commandOf(root: HelpNode, mention: string): string[] {\n const words = mention.trim().split(/\\s+/);\n let node: HelpNode = root;\n const path: string[] = [];\n for (const word of words) {\n const loaded = loadedSubCommands(node).find(([name]) => name === word)?.[1];\n if (!loaded) {\n // Not loaded is not \"not there\": a lazy entry of that name stands for the words written.\n return subCommandNames(node).includes(word) ? [words.join(\" \")] : path.length > 0 ? [path.join(\" \")] : [];\n }\n node = loaded;\n path.push(word);\n }\n return [path.join(\" \")];\n}\n\nfunction indentOf(line: string): number {\n return line.length - line.trimStart().length;\n}\n\n/**\n * The lines without those `drops` says go, each taken with what continues it:\n * the lines indented under it, the next line after a trailing `\\`, and the rest\n * of a sentence wrapped onto the lines below. `drops` returns the kept text of\n * a line, or null to drop it.\n */\nfunction dropping(lines: string[], drops: (line: string) => string | null): string[] {\n const kept: string[] = [];\n let carried: ((line: string) => boolean) | null = null;\n for (const line of lines) {\n if (carried?.(line)) continue;\n carried = null;\n const rest = drops(line);\n if (rest !== null) {\n kept.push(rest);\n continue;\n }\n const indent = indentOf(line);\n if (/\\\\\\s*$/.test(line)) {\n let open = true;\n carried = (next) => {\n const continues = open;\n open = /\\\\\\s*$/.test(next);\n return continues;\n };\n } else if (indent === 0 && !/[.:!?)]\\s*$/.test(line)) {\n let open = true;\n carried = (next) => {\n const continues = open && next.trim() !== \"\" && indentOf(next) === 0;\n open = continues && !/[.:!?)]\\s*$/.test(next);\n return continues;\n };\n } else if (indent > 0) {\n carried = (next) => next.trim() !== \"\" && indentOf(next) > indent;\n }\n }\n return kept;\n}\n\n/** A line that stands alone — an example, a table row, a \"Label: …\" entry — goes whole. */\nconst STANDALONE_LINE = /^(?:\\s|baker\\b|[A-Z][\\w ]{0,30}:\\s)/;\n\nfunction balanced(text: string): boolean {\n return (text.match(/\\(/g)?.length ?? 0) === (text.match(/\\)/g)?.length ?? 0);\n}\n\n/** Each command the text names, at where it names it: `baker <words>`, or a family's `<words>` in backticks. */\nfunction commandMentions(root: HelpNode, text: string): Array<{ at: number; words: string }> {\n const families = new Set(subCommandNames(root));\n const quoted = [...text.matchAll(/`([a-z][\\w-]*(?:[ \\t][a-z][\\w-]*)*)(?=[`\\s<])/g)].filter((match) =>\n families.has((match[1] ?? \"\").split(/\\s+/)[0] ?? \"\"),\n );\n return [...text.matchAll(/`?\\bbaker ((?:[a-z][\\w-]*[ \\t]?)+)/g), ...quoted].map((match) => ({\n at: match.index,\n words: match[1] ?? \"\",\n }));\n}\n\n/**\n * Where the text first mentions something the reader may not use — a command\n * it is not offered, or a flag it is refused (`--add-trigger`) — or -1.\n */\nfunction firstUnusable(root: HelpNode, text: string, offered: Offers, refusedFlags: readonly string[]): number {\n const commands = commandMentions(root, text)\n .filter(({ words }) => commandOf(root, words).some((path) => !offered(path)))\n .map(({ at }) => at);\n const flags = refusedFlags.flatMap((flag) => {\n const match = new RegExp(`--${flag}(?![\\\\w-])`).exec(text);\n return match ? [match.index] : [];\n });\n const at = [...commands, ...flags];\n return at.length > 0 ? Math.min(...at) : -1;\n}\n\n/**\n * The sentence without what it says about something the reader may not use:\n * cut back to the clause before the mention when one stands on its own, else\n * dropped.\n */\nfunction sentenceWithout(sentence: string, unusableAt: number): string {\n if (unusableAt === -1) return sentence;\n const before = sentence.slice(0, unusableAt).replace(/`$/, \"\");\n const cut = Math.max(before.lastIndexOf(\", \"), before.lastIndexOf(\" — \"), before.lastIndexOf(\"; \"));\n const clause = cut === -1 ? \"\" : before.slice(0, cut).trim();\n // \"To undo one, `baker …`\" only led to the command.\n const leadsIn = /^(?:to|use|run|call|for|with)\\b/i.test(clause);\n return clause.split(/\\s+/).length >= 3 && balanced(clause) && !leadsIn ? `${clause}.` : \"\";\n}\n\n/** A sentence that leans on the one before it (\"It never touches a live tag.\"). */\nconst LEANS_BACK = /^(?:it|they|this|that|these|those)\\b/i;\n\n/** The text without any mention of a command the reader may not run, or a flag it is refused. */\nexport function withoutUnoffered(\n root: HelpNode,\n text: string,\n offered: Offers,\n refusedFlags: readonly string[] = [],\n): string {\n const unusable = (part: string) => firstUnusable(root, part, offered, refusedFlags);\n return dropping(text.split(\"\\n\"), (line) => {\n if (unusable(line) === -1) return line;\n if (STANDALONE_LINE.test(line)) return null;\n const kept: string[] = [];\n let dropped = false;\n for (const sentence of line.split(/(?<=[.!?])\\s+/)) {\n const rest: string = dropped && LEANS_BACK.test(sentence) ? \"\" : sentenceWithout(sentence, unusable(sentence));\n dropped = rest === \"\";\n if (rest !== \"\") kept.push(rest);\n }\n return kept.length === 0 ? null : kept.join(\" \");\n }).join(\"\\n\");\n}\n\n/** Whether anything loaded under `path` is a command the reader may not run. */\nfunction holdsUnoffered(node: HelpNode, path: string[], offered: Offers): boolean {\n return loadedSubCommands(node).some(\n ([name, sub]) => !offered([...path, name].join(\" \")) || holdsUnoffered(sub, [...path, name], offered),\n );\n}\n\n/** A sentence or line that is about staging a change, from its first words. */\nconst WRITE_TALK =\n /^(?:stage\\b|staged\\b|staging\\b|write subcommands\\b|writes\\b|then stage\\b|drafts:|staged vs published\\b|lifecycle:|nothing staged\\b|on publish\\b|\\w+(?: \\/ \\w+)*\\s+—\\s+stage\\b)/i;\n\n/** The tail of a sentence offering a change: \"List campaigns, or stage writes (…)\". */\nconst WRITE_CLAUSE =\n /(?:\\s*(?:[,;]|\\s—|\\s-)\\s*(?:(?:or|plus|and)\\s+)?|\\s+(?:or|plus|and)\\s+)(?:stage[sd]?|staged)\\b[^.]*/gi;\n\n/** \"List, show, amend or clear …\": a sentence opening on a list of this command's own verbs. */\nconst VERB_LIST = /^((?:[A-Za-z]+, )*[A-Za-z]+,? (?:or|and) [a-z]+)\\b/;\n\n/** The sentence naming, of the verbs it opens on, only those the reader may run; \"\" when none. */\nfunction withOfferedVerbs(sentence: string, children: ReadonlySet<string>, unoffered: ReadonlySet<string>): string {\n const list = VERB_LIST.exec(sentence)?.[1];\n if (!list) return sentence;\n const verbs = list.split(/,\\s*(?:(?:or|and)\\s+)?|\\s+(?:or|and)\\s+/).map((verb) => verb.toLowerCase());\n if (!verbs.every((verb) => children.has(verb))) return sentence;\n const kept = verbs.filter((verb) => !unoffered.has(verb));\n if (kept.length === 0) return \"\";\n const named = kept.length === 1 ? (kept[0] ?? \"\") : `${kept.slice(0, -1).join(\", \")} or ${kept.at(-1)}`;\n return `${named.charAt(0).toUpperCase()}${named.slice(1)}${sentence.slice(list.length)}`;\n}\n\n/** Whether text opens on the name of a command here the reader may not run (\"Release if…\", \" associate-campaign / …\"). */\nfunction opensOnUnoffered(text: string, unoffered: ReadonlySet<string>): boolean {\n const first =\n text\n .trim()\n .split(/[\\s/]+/)[0]\n ?.toLowerCase() ?? \"\";\n return unoffered.has(first);\n}\n\n/** A line that is about a change: staging talk, a command it may not run, or \"Library writes (…):\" over reads. */\nfunction isWriteLine(line: string, unoffered: ReadonlySet<string>): boolean {\n if (WRITE_TALK.test(line.trim())) return true;\n if (indentOf(line) > 0) return opensOnUnoffered(line, unoffered);\n return /:\\s*$/.test(line) && /\\bwrites?\\b/i.test(line);\n}\n\nfunction withoutWriteTalk(paragraph: string, children: ReadonlySet<string>, unoffered: ReadonlySet<string>): string {\n const prose = (text: string) =>\n text\n .replace(WRITE_CLAUSE, \"\")\n .split(/(?<=[.!?])\\s+/)\n .map((sentence) => withOfferedVerbs(sentence, children, unoffered))\n .filter(\n (sentence) => sentence !== \"\" && !WRITE_TALK.test(sentence.trim()) && !opensOnUnoffered(sentence, unoffered),\n )\n .join(\" \");\n const lines = paragraph.split(\"\\n\");\n // Examples, tables and headings are kept line by line, and a line of prose among them sentence by sentence.\n if (lines.some((line) => /^\\s/.test(line) || STANDALONE_LINE.test(line) || /:\\s*$/.test(line))) {\n return dropping(lines, (line) => {\n if (isWriteLine(line, unoffered)) return null;\n if (indentOf(line) > 0 || STANDALONE_LINE.test(line) || !/[.!?]\\s*$/.test(line)) return line;\n const kept = prose(line);\n return kept === \"\" ? null : kept;\n }).join(\"\\n\");\n }\n return prose(lines.join(\" \"));\n}\n\n/** \"Subcommands: list (default), remove, clear.\" names only the ones the reader may run. */\nfunction withOfferedSubcommands(text: string, path: string[], offered: Offers): string {\n return text.replace(/Subcommands: ([^.]*)\\./g, (_whole, list: string) => {\n const kept = list.split(/,\\s*/).filter((item) => offered([...path, item.split(/\\s/)[0] ?? \"\"].join(\" \")));\n return kept.length > 0 ? `Subcommands: ${kept.join(\", \")}.` : \"\";\n });\n}\n\n/** Drops a heading whose block below it was emptied, and the blank lines left behind. */\nfunction tidy(text: string): string {\n const lines = text.split(\"\\n\");\n const kept = lines.filter((line, index) => {\n if (!/:\\s*$/.test(line)) return true;\n const next = lines.slice(index + 1).find((later) => later.trim() !== \"\");\n return next !== undefined && /^\\s/.test(next) && lines[index + 1]?.trim() !== \"\";\n });\n return kept\n .join(\"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\")\n .replace(/^(?:[ \\t]*\\n)+/, \"\")\n .trimEnd();\n}\n\nexport function describedFor(\n root: HelpNode,\n description: string,\n path: string[],\n node: HelpNode,\n profile: AgentProfile,\n offered: Offers,\n refusedFlags: readonly string[] = [],\n): string {\n const cited = withoutUnoffered(root, description, offered, refusedFlags);\n if (profile === \"company\" || !holdsUnoffered(node, path, offered)) return tidy(cited);\n const children = new Set(subCommandNames(node));\n const unoffered = new Set([...children].filter((name) => !offered([...path, name].join(\" \"))));\n const shaped = cited\n .split(/\\n\\s*\\n/)\n .map((paragraph) => withoutWriteTalk(withOfferedSubcommands(paragraph, path, offered), children, unoffered))\n .join(\"\\n\\n\");\n const text = tidy(shaped);\n if (text !== \"\") return text;\n const reads = loadedSubCommands(node).flatMap(([name]) => (offered([...path, name].join(\" \")) ? [name] : []));\n return reads.length > 0 ? `Read: ${reads.join(\", \")}.` : \"\";\n}\n","import { type LoadableCommand, loadAllCommands, loadSubCommandNamed } from \"./command-loading.ts\";\nimport { optionalWorkspaceKind } from \"./env.ts\";\nimport { describedFor, withoutUnoffered } from \"./profile-help.ts\";\n\n/**\n * Which commands this CLI offers the agent running it.\n *\n * One CLI serves two agents. A company's agent works inside its own workspace\n * and changes it; it is offered everything, except the organization family,\n * which is for reading other companies and means nothing to it. The\n * organization workspace's agent reads every company of its organization and\n * changes none of them: it is offered the reads alone, plus the research and\n * judgment it runs as itself, and its own Scheduled agents.\n *\n * This is what the agent is shown, not what it is allowed: the backend refuses\n * a write naming a company whatever the CLI does (`readNamedCompany`). Kept as\n * an explicit list so a new command is hidden from the organization until\n * someone decides it only reads.\n */\n\nexport type AgentProfile = \"company\" | \"organization\";\n\n/** Set on the organization workspace's Runtime (`runtimeSession/nodeActions.ts`). */\nexport function agentProfile(workspaceKind: string | undefined = optionalWorkspaceKind()): AgentProfile {\n return workspaceKind === \"organization\" ? \"organization\" : \"company\";\n}\n\n/** Families only the organization workspace runs: hidden from a company's agent. */\nconst ORGANIZATION_ONLY = [\"organization\"];\n\n/**\n * Every command the organization workspace's agent is offered, as typed. An\n * entry offers that command and everything under it.\n */\nexport const ORGANIZATION_COMMANDS: readonly string[] = [\n \"schema\",\n \"capabilities\",\n \"organization\",\n // A defect or gap in Baker itself, to the Baker team's tracker: it changes no\n // company, and the guard and the publish skill this workspace shares send it here.\n \"feedback\",\n // What a company did and has.\n \"chats\",\n \"history\",\n \"actions list\",\n \"actions log\",\n \"actions get\",\n \"actions status\",\n \"actions draft list\",\n \"actions tags list\",\n // The organization's own Scheduled agents, which live in this workspace:\n // staged like a company's, applied at Publish. Naming a company is still a\n // read only (`readNamedCompany`), so none of these reaches one.\n \"scheduled-agents\",\n \"experiment status\",\n \"experiment history\",\n \"flows list\",\n \"flows show\",\n \"flows schema\",\n \"testimonials get\",\n \"testimonials search\",\n \"testimonials list\",\n \"testimonials tags list\",\n \"testimonials sources list\",\n \"images get\",\n \"images search\",\n \"images library\",\n \"images tags list\",\n // A page's or a link's pictures and videos, to the workspace's own disk: a\n // client's logo, the photos on its site, the video it sent. Firecrawl reads\n // the page; nothing reaches any library (`--auto-ingest` is refused below).\n \"images download\",\n \"images extract\",\n \"videos get\",\n \"videos search\",\n \"videos tags list\",\n \"videos fetch\",\n \"studio get\",\n \"studio list\",\n \"avatars list\",\n \"avatars get\",\n \"creatives performance\",\n \"landings export status\",\n \"landings export list\",\n \"site show\",\n \"site domain list\",\n // A file on this machine as its words and pictures; reads, asks no backend.\n \"files read\",\n \"lead-routes list\",\n \"lead-routes fields\",\n \"credentials list\",\n \"setup-links list\",\n \"media-sources list\",\n \"posts list\",\n \"posts get\",\n \"posts search\",\n \"mcp connected\",\n \"mcp catalog\",\n \"mcp tools\",\n \"mcp execute\",\n \"mcp list\",\n // Ads, every platform: accounts, structure, results, staged drafts.\n \"ads google accounts\",\n \"ads google currency\",\n \"ads google url-options\",\n \"ads google changes\",\n \"ads google invoices\",\n \"ads google identity-verification\",\n \"ads google previews\",\n \"ads google brands\",\n \"ads google search-terms\",\n \"ads google query\",\n \"ads google keywords discover\",\n \"ads google keywords metrics\",\n \"ads google keywords forecast\",\n \"ads google keywords themes\",\n \"ads google keywords locations\",\n \"ads google keywords languages\",\n \"ads google keywords list\",\n \"ads google budgets list\",\n \"ads google campaigns list\",\n \"ads google ad-groups list\",\n \"ads google negative-keywords list\",\n \"ads google negative-keywords check\",\n \"ads google keyword-lists list\",\n \"ads google ads list\",\n \"ads google assets list\",\n \"ads google asset-groups list\",\n \"ads google audiences list\",\n \"ads google audiences targeting\",\n \"ads google conversions list\",\n \"ads google bidding-strategies list\",\n \"ads google labels list\",\n \"ads google campaign-criteria list\",\n \"ads google ad-group-criteria list\",\n \"ads google ad-group-bid-modifiers list\",\n \"ads google account-exclusions list\",\n \"ads google asset-group-signals list\",\n \"ads google merchant-center list\",\n \"ads google draft list\",\n \"ads google draft show\",\n \"ads meta accounts\",\n \"ads meta account\",\n \"ads meta businesses\",\n \"ads meta pages\",\n \"ads meta lead-forms list\",\n \"ads meta leads\",\n \"ads meta campaigns list\",\n \"ads meta adsets list\",\n \"ads meta ads list\",\n \"ads meta creatives list\",\n \"ads meta audiences list\",\n \"ads meta custom-conversions list\",\n \"ads meta pixels\",\n \"ads meta activities\",\n \"ads meta insights\",\n \"ads meta draft list\",\n \"ads meta draft show\",\n \"ads linkedin accounts\",\n \"ads linkedin account detail\",\n \"ads linkedin campaign-groups list\",\n \"ads linkedin campaigns list\",\n \"ads linkedin creatives list\",\n \"ads linkedin draft list\",\n \"ads linkedin draft show\",\n \"ads linkedin analytics\",\n \"ads linkedin demographics\",\n \"ads linkedin companies\",\n \"ads linkedin top-companies\",\n \"ads linkedin resolve\",\n \"ads linkedin facets list\",\n \"ads linkedin facets values\",\n \"ads linkedin audience-size\",\n \"ads linkedin bid-pricing\",\n \"ads linkedin forecast\",\n \"ads linkedin leads\",\n \"ads linkedin conversions list\",\n \"ads linkedin conversions health\",\n \"ads linkedin conversation\",\n \"ads linkedin audit\",\n \"ads linkedin url-params\",\n \"ads x accounts\",\n \"ads x funding\",\n \"ads x campaigns list\",\n \"ads x line-items list\",\n \"ads x promoted-tweets list\",\n \"ads x tweets\",\n \"ads x cards\",\n \"ads x draft list\",\n \"ads x draft show\",\n \"ads x media\",\n \"ads x audiences\",\n \"ads x targeting-criteria list\",\n \"ads x targeting-constants\",\n \"ads x active-entities\",\n \"ads x stats job-status\",\n \"ads chatgpt account show\",\n \"ads chatgpt campaigns list\",\n \"ads chatgpt ad-groups list\",\n \"ads chatgpt ads list\",\n \"ads chatgpt conversions list\",\n \"ads chatgpt conversions events\",\n \"ads chatgpt conversions report\",\n \"ads chatgpt audiences list\",\n \"ads chatgpt catalogs list\",\n \"ads chatgpt catalogs uploads\",\n \"ads chatgpt catalogs products\",\n \"ads chatgpt history\",\n \"ads chatgpt insights\",\n \"ads chatgpt locations\",\n \"ads chatgpt draft list\",\n \"ads chatgpt draft show\",\n // Baker's synced copy of every platform's results, which the live reads above\n // point at first. Reads only: each `show` beside its staged changes.\n \"ads performance overview\",\n \"ads performance trend\",\n // Who the ads brought: counts per ad and per persona answer, and the ladder\n // and persona map they are counted by (`adPerformance/peopleRoute.ts`).\n \"ads performance people\",\n \"ads performance personas\",\n \"ads performance ladder\",\n \"ads performance persona-fields\",\n \"ads performance accounts\",\n \"ads performance setup\",\n \"ads performance entities\",\n \"ads performance entity\",\n \"ads performance changes\",\n \"ads performance impact\",\n \"ads performance creatives\",\n \"ads performance families show\",\n \"ads performance families choices\",\n \"ads performance creative-health\",\n \"ads performance creative-assets\",\n \"ads performance health\",\n \"ads performance breakdown\",\n \"ads performance search-terms\",\n \"ads performance pacing\",\n \"ads performance funnel\",\n \"ads performance tracking\",\n \"ads performance landings\",\n \"ads performance live-in\",\n \"ads performance status\",\n \"ads performance goals show\",\n \"ads performance progress\",\n \"ads performance diagnose\",\n \"ads performance pulse\",\n \"ads performance anomalies\",\n \"ads performance recap\",\n \"ads performance targets show\",\n \"ads performance budget-recommendations\",\n \"ads performance attention show\",\n \"ads performance currency show\",\n \"ads performance brand-split\",\n \"ads performance impression-share\",\n \"ads performance keyword-quality\",\n \"ads performance google-report\",\n \"ads performance budgets show\",\n \"ads performance segments show\",\n // Pages and measurement.\n \"analytics overview\",\n \"analytics traffic\",\n \"analytics funnel\",\n \"analytics flow\",\n \"analytics page\",\n \"analytics triggers\",\n \"analytics releases\",\n \"analytics paid\",\n \"analytics delivery\",\n \"analytics submissions\",\n \"analytics geo\",\n \"analytics bots\",\n \"analytics landings\",\n \"analytics tags\",\n \"analytics events\",\n \"analytics feed\",\n \"analytics lookup\",\n \"analytics devices\",\n \"analytics ads\",\n \"analytics conversions\",\n \"analytics sends\",\n \"analytics tracking\",\n \"analytics arrivals\",\n \"analytics sending-events\",\n \"analytics sources\",\n \"analytics website-tag\",\n \"analytics sites\",\n \"analytics questionnaire\",\n \"analytics presets\",\n \"funnel\",\n \"ga4 properties\",\n \"ga4 config\",\n \"ga4 audit\",\n \"ga4 query\",\n \"ga4 draft list\",\n \"ga4 draft show\",\n \"gsc\",\n \"tags list\",\n \"tags draft\",\n \"tag-manager containers\",\n \"tag-manager read\",\n \"tag-manager changes\",\n \"tag-manager draft list\",\n \"tag-manager draft show\",\n // CRM and accounts.\n \"hubspot\",\n \"pipedrive\",\n \"accounts influenced\",\n \"accounts engagement\",\n \"accounts warm\",\n \"accounts company\",\n \"accounts campaigns\",\n \"accounts crm status\",\n \"accounts crm check\",\n \"accounts crm contract\",\n // Research and judgment, run as the workspace itself (never with --company).\n // Not `research customers`, which writes into a company's Knowledge, nor\n // `winning-ads fit`, which judges an ad against a company's own COMPANY.md.\n \"research web\",\n \"research fetch\",\n \"research cite\",\n \"research linkedin-person\",\n \"research people\",\n \"research transcript\",\n \"research company\",\n \"research google-ads\",\n \"research reddit\",\n \"research advertisers\",\n \"research autocomplete\",\n \"research countries\",\n \"research intent\",\n \"research keyword-metrics\",\n \"research keywords-for-site\",\n \"research keyword-gap\",\n \"research languages\",\n \"research lighthouse\",\n \"research relevant-pages\",\n \"decide\",\n // The organization workspace's own vault, ranked like a company's.\n \"knowledge search\",\n \"winning-ads search\",\n \"winning-ads advertisers\",\n // Adds a brand to Baker's shared library with nobody following it, so a\n // client being set up can be read there: its channels, ads and landings.\n \"winning-ads add\",\n \"winning-ads discover\",\n \"winning-ads following\",\n \"winning-ads feed\",\n \"winning-ads winners\",\n \"winning-ads ads\",\n \"winning-ads profile\",\n \"winning-ads launches\",\n \"winning-ads landings\",\n \"winning-ads search-copy\",\n \"winning-ads content\",\n \"winning-ads hooks\",\n \"winning-ads mechanisms\",\n \"winning-ads formats\",\n];\n\nfunction covers(entry: string, path: string): boolean {\n return path === entry || path.startsWith(`${entry} `);\n}\n\n/**\n * Whether `path` (a command as typed, `\"ads meta campaigns list\"`) is offered\n * to `profile`. A group is offered when anything under it is, so the way to an\n * offered command stays open.\n */\nexport function offers(profile: AgentProfile, path: string): boolean {\n if (path === \"\") return true;\n if (profile === \"company\") {\n return !ORGANIZATION_ONLY.some((family) => covers(family, path));\n }\n return ORGANIZATION_COMMANDS.some((entry) => covers(entry, path) || covers(path, entry));\n}\n\n/**\n * The flags that change something, on commands the organization is offered to\n * read. `funnel` reads the funnel and `funnel --add-trigger` changes it, so the\n * command is offered and these are refused, and left out of its help.\n */\nexport const ORGANIZATION_WRITE_FLAGS: Readonly<Record<string, readonly string[]>> = {\n \"images extract\": [\"auto-ingest\", \"context\"],\n funnel: [\"steps\", \"step\", \"add-trigger\", \"remove-trigger\", \"event\", \"from-conversion\", \"remove-step\", \"preset\"],\n \"analytics conversions\": [\"event\", \"name\", \"rename\", \"to\", \"remove-name\", \"count-mode\", \"remove\"],\n \"analytics sends\": [\n \"set\",\n \"source-event\",\n \"from\",\n \"platform\",\n \"tag\",\n \"event\",\n \"account\",\n \"parameter\",\n \"id\",\n \"remove\",\n ],\n \"analytics sources\": [\n \"server\",\n \"create\",\n \"create-hubspot\",\n \"create-activecampaign\",\n \"events\",\n \"account\",\n \"set-trigger\",\n \"set-amount\",\n \"amount-property\",\n \"currency\",\n \"write\",\n \"name\",\n \"map\",\n \"field\",\n \"pause\",\n \"resume\",\n \"remove\",\n ],\n \"analytics sites\": [\"add\", \"remove\"],\n};\n\nfunction kebabCase(name: string): string {\n return name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\n/** The first flag in `argv` the organization is refused on the command at `path`, if any. */\nfunction refusedFlagIn(path: string, argv: readonly string[]): string | null {\n const refused = ORGANIZATION_WRITE_FLAGS[path];\n if (!refused) return null;\n const end = argv.indexOf(\"--\");\n for (const token of end === -1 ? argv : argv.slice(0, end)) {\n if (!token.startsWith(\"--\")) continue;\n const name = kebabCase(token.slice(2).split(\"=\")[0] ?? \"\").replace(/^no-/, \"\");\n if (refused.includes(name)) return name;\n }\n return null;\n}\n\ntype ProfiledCommand = { meta?: unknown; subCommands?: unknown };\n\n/** What the organization's agent is told when it reaches for a command it is not offered. */\nexport const ORGANIZATION_REFUSAL =\n \"The organization workspace only reads its companies, and this command changes something. A change to a company is made in that company's own chat; here, read it and show it in a Report.\";\n\nfunction hide(command: ProfiledCommand): void {\n if (typeof command.meta === \"object\" && command.meta !== null) {\n (command.meta as { hidden?: boolean }).hidden = true;\n }\n}\n\n/**\n * Rewrites, in place, what each loaded command `profile` is shown says\n * (`profile-help.ts`), and takes off it the flags `profile` is refused. Args are\n * replaced rather than edited: one definition can be shared between commands.\n */\nfunction describeOffered(root: ProfiledCommand, command: ProfiledCommand, profile: AgentProfile, path: string[]): void {\n const meta = command.meta as { hidden?: boolean; description?: unknown } | undefined;\n if (meta?.hidden === true) return;\n const offered = (cited: string) => offers(profile, cited);\n const refusedFlags = profile === \"organization\" ? (ORGANIZATION_WRITE_FLAGS[path.join(\" \")] ?? []) : [];\n if (typeof meta?.description === \"string\") {\n meta.description = describedFor(root, meta.description, path, command, profile, offered, refusedFlags);\n }\n const shaped = command as { args?: unknown };\n if (typeof shaped.args === \"object\" && shaped.args !== null) {\n shaped.args = Object.fromEntries(\n Object.entries(shaped.args as Record<string, unknown>).flatMap(([name, arg]) => {\n if (refusedFlags.includes(kebabCase(name))) return [];\n const description = (arg as { description?: unknown } | null)?.description;\n return [\n [\n name,\n typeof description === \"string\"\n ? { ...(arg as object), description: withoutUnoffered(root, description, offered, refusedFlags) }\n : arg,\n ],\n ];\n }),\n );\n }\n const subCommands = command.subCommands;\n if (typeof subCommands !== \"object\" || subCommands === null) return;\n for (const [name, sub] of Object.entries(subCommands as Record<string, unknown>)) {\n if (typeof sub === \"object\" && sub !== null)\n describeOffered(root, sub as ProfiledCommand, profile, [...path, name]);\n }\n}\n\n/** Marks, in place, every loaded command `profile` is not offered as hidden from help. */\nfunction hideUnoffered(command: ProfiledCommand, profile: AgentProfile, path: string[]): void {\n const subCommands = command.subCommands;\n if (typeof subCommands !== \"object\" || subCommands === null) return;\n for (const [name, sub] of Object.entries(subCommands as Record<string, unknown>)) {\n if (typeof sub !== \"object\" || sub === null) continue;\n const subPath = [...path, name];\n if (!offers(profile, subPath.join(\" \"))) hide(sub as ProfiledCommand);\n hideUnoffered(sub as ProfiledCommand, profile, subPath);\n }\n}\n\ntype ArgDefinition = { type?: unknown; alias?: unknown };\n\nfunction camelCase(name: string): string {\n return name.replace(/-([a-z0-9])/g, (_, letter: string) => letter.toUpperCase());\n}\n\nfunction aliases(of: unknown): unknown[] {\n return Array.isArray(of) ? of : of === undefined ? [] : [of];\n}\n\n/** Whether `flag` takes the token after it as its value on `command`, as citty reads it. */\nfunction takesValue(command: ProfiledCommand & { args?: unknown }, flag: string): boolean {\n if (flag.includes(\"=\") || typeof command.args !== \"object\" || command.args === null) return false;\n const name = flag.replace(/^-{1,2}/, \"\");\n return Object.entries(command.args as Record<string, ArgDefinition>).some(\n ([key, definition]) =>\n (definition.type === \"string\" || definition.type === \"enum\") &&\n (camelCase(key) === camelCase(name) || aliases(definition.alias).includes(name)),\n );\n}\n\n/**\n * The command `argv` addresses, found the way citty finds it: flags, and the\n * value after one that takes it, are skipped, so a flag before a command's name\n * cannot leave the path at its group. Each step is loaded on the way —\n * `loadCommands` stops at the first flag, and `--company` is taken off only\n * after it ran, so the guard cannot lean on what it loaded.\n */\nasync function addressedCommand(\n root: ProfiledCommand,\n argv: readonly string[],\n): Promise<{ path: string; command: ProfiledCommand }> {\n const path: string[] = [];\n let command: ProfiledCommand = root;\n for (let index = 0; index < argv.length; index++) {\n const token = argv[index] ?? \"\";\n if (token === \"--\") break;\n if (token.startsWith(\"-\")) {\n if (takesValue(command, token)) index++;\n continue;\n }\n const next = await loadSubCommandNamed(command as LoadableCommand, token);\n if (!next) break;\n path.push(next[0]);\n command = next[1] as ProfiledCommand;\n }\n return { path: path.join(\" \"), command };\n}\n\n/**\n * Shapes the loaded command tree for the agent running it: what it is not\n * offered leaves its help, and the organization's agent is refused a command it\n * is not offered (the returned message; `null` when it may run). A company's\n * agent is never refused: the organization's commands are only out of its help,\n * because a Report published from the organization workspace runs them on a\n * runner that has no profile of its own.\n */\nexport async function applyAgentProfile(\n root: ProfiledCommand,\n profile: AgentProfile,\n argv: readonly string[],\n): Promise<string | null> {\n const { path, command } = await addressedCommand(root, argv);\n // A walk that ends on a group prints its usage — `--help` anywhere, past `--`\n // too, or no command or an unknown one — listing its subcommands, which are\n // hidden only once loaded. A walk that reaches a command loads nothing more.\n await loadAllCommands(command as LoadableCommand);\n // Judged before the help is shaped, which takes the refused flags off the command.\n const refused = profile === \"organization\" && (!offers(profile, path) || refusedFlagIn(path, argv) !== null);\n hideUnoffered(root, profile, []);\n describeOffered(root, root, profile, []);\n return refused ? ORGANIZATION_REFUSAL : null;\n}\n"],"mappings":";;;;;AASO,SAAS,eAAe,MAAyB,UAA+C;AACrG,QAAM,QAAQ,KAAK,KAAK,CAAC,UAAU,CAAC,MAAM,WAAW,GAAG,CAAC;AAEzD,MAAI,UAAU,UAAa,UAAU,YAAY,SAAS,SAAS,KAAK,EAAG,QAAO,CAAC,KAAK;AACxF,SAAO;AACT;AAIA,eAAe,SAAY,OAAkC;AAC3D,SAAO,OAAO,UAAU,aAAa,MAAO,MAA+B,IAAI,MAAM;AACvF;AAGA,eAAe,cAAc,SAA+D;AAC1F,MAAI,QAAQ,gBAAgB,OAAW,QAAO;AAC9C,QAAM,cAAc,MAAM,SAAS,QAAQ,WAAW;AACtD,UAAQ,cAAc;AACtB,SAAO;AACT;AAOA,eAAsB,oBACpB,SACA,OAC2C;AAC3C,QAAM,cAAc,MAAM,cAAc,OAAO;AAC/C,MAAI,CAAC,YAAa,QAAO;AACzB,QAAM,QAAQ,YAAY,KAAK;AAC/B,MAAI,UAAU,QAAW;AACvB,UAAM,SAAS,MAAM,SAAS,KAAK;AACnC,gBAAY,KAAK,IAAI;AACrB,WAAO,CAAC,OAAO,MAAM;AAAA,EACvB;AACA,aAAW,CAAC,MAAM,GAAG,KAAK,OAAO,QAAQ,WAAW,GAAG;AACrD,UAAM,SAAS,MAAM,SAAS,GAAG;AACjC,gBAAY,IAAI,IAAI;AACpB,UAAM,OAAQ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ACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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b,MACA,MACqD;AACrD,QAAM,OAAiB,CAAC;AACxB,MAAI,UAA2B;AAC/B,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;AAChD,UAAM,QAAQ,KAAK,KAAK,KAAK;AAC7B,QAAI,UAAU,KAAM;AACpB,QAAI,MAAM,WAAW,GAAG,GAAG;AACzB,UAAI,WAAW,SAAS,KAAK,EAAG;AAChC;AAAA,IACF;AACA,UAAM,OAAO,MAAM,oBAAoB,SAA4B,KAAK;AACxE,QAAI,CAAC,KAAM;AACX,SAAK,KAAK,KAAK,CAAC,CAAC;AACjB,cAAU,KAAK,CAAC;AAAA,EAClB;AACA,SAAO,EAAE,MAAM,KAAK,KAAK,GAAG,GAAG,QAAQ;AACzC;AAUA,eAAsB,kBACpB,MACA,SACA,MACwB;AACxB,QAAM,EAAE,MAAM,QAAQ,IAAI,MAAM,iBAAiB,MAAM,IAAI;AAI3D,QAAM,gBAAgB,OAA0B;AAEhD,QAAM,UAAU,YAAY,mBAAmB,CAAC,OAAO,SAAS,IAAI,KAAK,cAAc,MAAM,IAAI,MAAM;AACvG,gBAAc,MAAM,SAAS,CAAC,CAAC;AAC/B,kBAAgB,MAAM,MAAM,SAAS,CAAC,CAAC;AACvC,SAAO,UAAU,uBAAuB;AAC1C;","names":["aliases","at"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-NYUWPJ4K.js";
|
|
5
5
|
import {
|
|
6
6
|
agentProfile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-A6B45KSH.js";
|
|
8
8
|
import {
|
|
9
9
|
AUTO_PUBLISH_REFUSAL,
|
|
10
10
|
MAX_AI_CONDITION_CHARS,
|
|
@@ -743,4 +743,4 @@ export {
|
|
|
743
743
|
reactionBody,
|
|
744
744
|
chatBody
|
|
745
745
|
};
|
|
746
|
-
//# sourceMappingURL=chunk-
|
|
746
|
+
//# sourceMappingURL=chunk-QSZRATGC.js.map
|
|
@@ -179,9 +179,7 @@ var hubspotPreviewRequestSchema = z2.strictObject({
|
|
|
179
179
|
/** Property names to read off the sample; `id` is always there. On a deal or a lead, `contact.<name>` reads its first contact. */
|
|
180
180
|
properties: z2.array(z2.string().trim().min(1)).max(60).optional(),
|
|
181
181
|
/** The record to draw the preview from — an id, or text to search (an email or a name for a contact, a deal's or a lead's name). The one most recently at the trigger when unsaid. */
|
|
182
|
-
contact: z2.string().trim().min(1).max(200).optional()
|
|
183
|
-
/** A total for each value of the trigger's one dropdown `is` condition, beside the combined one — sizing a funnel in one call. */
|
|
184
|
-
breakdown: z2.boolean().optional()
|
|
182
|
+
contact: z2.string().trim().min(1).max(200).optional()
|
|
185
183
|
});
|
|
186
184
|
var hubspotPreviewSchema = z2.strictObject({
|
|
187
185
|
/** Records satisfying the trigger today — the ones that will NOT be counted. */
|
|
@@ -197,9 +195,7 @@ var hubspotPreviewSchema = z2.strictObject({
|
|
|
197
195
|
* people the event is about. Three parallel nullable fields, exactly one of
|
|
198
196
|
* them ever set, would say the same thing and let a caller read the wrong one.
|
|
199
197
|
*/
|
|
200
|
-
record: sampleRecordSchema.extend({ contacts: z2.array(sampleRecordSchema) }).nullable()
|
|
201
|
-
/** Only on a `breakdown`: each value of the condition with how many records are at it today, in the order asked. */
|
|
202
|
-
counts: z2.array(z2.strictObject({ value: z2.string(), total: z2.number() })).optional()
|
|
198
|
+
record: sampleRecordSchema.extend({ contacts: z2.array(sampleRecordSchema) }).nullable()
|
|
203
199
|
});
|
|
204
200
|
var sourcesRequestSchema = z2.strictObject({
|
|
205
201
|
/** The company's own server door: made once, `counting` from the start, the same address for ever after. */
|
|
@@ -393,4 +389,4 @@ export {
|
|
|
393
389
|
hubspotDefaultMapping,
|
|
394
390
|
hubspotTriggerInputSchema
|
|
395
391
|
};
|
|
396
|
-
//# sourceMappingURL=chunk-
|
|
392
|
+
//# sourceMappingURL=chunk-TWSIY2FS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../api/src/event-sources/hubspot.ts","../../api/src/event-sources/wire.ts","../../api/src/event-sources/activecampaign.ts"],"sourcesContent":["/**\n * What a HubSpot event reads by default, spelled as the same templates an\n * address's mapping uses — so the sheet shows one table for both, and a row\n * can be repointed at any property, or typed.\n *\n * ## Why defaults and not a fixed read\n *\n * The read used to be hard-wired: email from `email`, the Google click from\n * `hs_google_click_id`, and nothing anybody could change. Real accounts keep\n * the email under `work_email`, the deal value under a custom number\n * property, and a click id under whatever the tracking template wrote. The\n * defaults are HubSpot's standard names, which is where most accounts keep\n * them; every row is a template a person or the agent can change, and the\n * picker is the account's own property list, read live — never this table.\n *\n * An empty stored mapping means these — the same rule as an address, where\n * empty means \"the guess\".\n *\n * ## Three objects, one spelling\n *\n * A mention names a property of the object watched: `{{email}}` on a\n * contact source, `{{amount}}` on a deal source, `{{hs_pipeline_stage}}` on\n * a lead source, `{{id}}` the record's own id on any of them. A deal or a\n * lead source also reads the contact its record is about, through the\n * `contact.` namespace: `{{contact.email}}`, `{{contact.id}}`. The namespace\n * is what keeps the objects' properties apart in one table, and it is\n * spelled the way the Forms builder spells a nested field.\n */\n\nimport type { SourceField } from \"./fields\";\nimport type { HubspotObject } from \"./hubspotTrigger\";\nimport { mentionOf } from \"./template\";\n\n/** The variable that is the record's own id rather than a property: `{{id}}`. */\nexport const HUBSPOT_CONTACT_ID_VARIABLE = \"id\";\n\n/** On a deal source, the associated contact's properties are read as `{{contact.<property>}}`. */\nexport const HUBSPOT_CONTACT_PREFIX = \"contact.\";\n\n/** The path for a property of a deal's contact: `contact.email`. */\nexport function contactPath(property: string): string {\n return `${HUBSPOT_CONTACT_PREFIX}${property}`;\n}\n\n/** The contact property a `contact.<property>` path names, or null for a path of the record itself. */\nexport function contactPropertyOf(path: string): string | null {\n return path.startsWith(HUBSPOT_CONTACT_PREFIX) ? path.slice(HUBSPOT_CONTACT_PREFIX.length) : null;\n}\n\n/** HubSpot's standard contact property behind each field, where one exists. */\nexport const HUBSPOT_DEFAULT_PROPERTIES: Readonly<Partial<Record<SourceField, string>>> = {\n email: \"email\",\n phone: \"phone\",\n external_id: HUBSPOT_CONTACT_ID_VARIABLE,\n first_name: \"firstname\",\n last_name: \"lastname\",\n city: \"city\",\n postal_code: \"zip\",\n country: \"country\",\n gclid: \"hs_google_click_id\",\n fbclid: \"hs_facebook_click_id\",\n};\n\n/**\n * The person's rows read off the record's associated contact, for an object\n * that is about somebody rather than being them.\n */\nconst throughContact: Readonly<Partial<Record<SourceField, string>>> = Object.fromEntries(\n Object.entries(HUBSPOT_DEFAULT_PROPERTIES).map(([field, property]) => [field, contactPath(property)]),\n);\n\n/**\n * The same for a deal: the person is the deal's contact, the amount is the\n * deal's own — HubSpot keeps it as `amount` in `deal_currency_code`, on\n * every account, which is the one row a contact source could never fill by\n * default.\n */\nexport const HUBSPOT_DEAL_DEFAULT_PROPERTIES: Readonly<Partial<Record<SourceField, string>>> = {\n ...throughContact,\n value: \"amount\",\n currency: \"deal_currency_code\",\n};\n\n/**\n * The same for a lead. A lead is an interest in somebody, not an amount: it\n * has no `amount` and no currency of its own, so the value rows stay empty\n * and the funnel counts the step rather than money. Anyone who keeps a figure\n * on a custom lead property can still point `value` at it by hand.\n */\nexport const HUBSPOT_LEAD_DEFAULT_PROPERTIES: Readonly<Partial<Record<SourceField, string>>> = throughContact;\n\nconst DEFAULTS: Readonly<Record<HubspotObject, Readonly<Partial<Record<SourceField, string>>>>> = {\n contact: HUBSPOT_DEFAULT_PROPERTIES,\n deal: HUBSPOT_DEAL_DEFAULT_PROPERTIES,\n lead: HUBSPOT_LEAD_DEFAULT_PROPERTIES,\n};\n\n/** The mapping a HubSpot event starts with: its name as the event, the standard properties for the rest. */\nexport function hubspotDefaultMapping(\n sourceName: string,\n object: HubspotObject = \"contact\",\n): Partial<Record<SourceField, string>> {\n const mapping: Partial<Record<SourceField, string>> = { event_name: sourceName };\n for (const [field, property] of Object.entries(DEFAULTS[object])) {\n mapping[field as SourceField] = mentionOf(property);\n }\n return mapping;\n}\n\n/**\n * The mapping in force for a HubSpot event: what was saved, else the defaults.\n * Keyed by field, or by `properties.<key>` for an extra property of the event.\n */\nexport function hubspotMappingInForce(\n sourceName: string,\n stored: Readonly<Record<string, string>>,\n object: HubspotObject = \"contact\",\n): Record<string, string> {\n const explicit = Object.entries(stored).filter(([, template]) => template.trim() !== \"\");\n if (explicit.length > 0) return Object.fromEntries(explicit);\n return hubspotDefaultMapping(sourceName, object);\n}\n","/**\n * The contract between `baker analytics sources` and `POST /api/analytics/sources`,\n * and the address a source is given.\n *\n * One request shape with one optional operation in it, and every call answers\n * with the full list afterwards — the CLI never has to make a second request\n * to see what it just did, and the \"what arrived\" question is answered by the\n * same read that answers \"what exists\".\n */\nimport { z } from \"zod\";\nimport { REJECTION_MESSAGES, validateEventName } from \"../event-ingest/validation\";\nimport { ACTIVECAMPAIGN_WEBHOOK_STATES, activeCampaignEventsSchema } from \"./activecampaign\";\nimport { mappingRowProblem } from \"./fields\";\nimport {\n CONDITION_LOGICS,\n HUBSPOT_DEAL_CONTACTS,\n HUBSPOT_OBJECTS,\n HUBSPOT_PROPERTY_KINDS,\n type HubspotTriggerInput,\n onlyCondition,\n TRIGGER_CONDITIONS_MAX,\n triggerProblem,\n} from \"./hubspotTrigger\";\n\n/** Mirrors `EVENT_SOURCE_KINDS` / the status validator in the backend schema; this package must not depend on convex. */\nexport const SOURCE_KINDS = [\"webhook\", \"hubspot\", \"activecampaign\"] as const;\nexport type SourceKind = (typeof SOURCE_KINDS)[number];\nexport const SOURCE_STATUSES = [\"learning\", \"counting\", \"paused\"] as const;\nexport type SourceStatus = (typeof SOURCE_STATUSES)[number];\n\nexport const SOURCE_NAME_MAX = 80;\n\n/**\n * What a source may be called — which is the ingest door's own rule, because a\n * source's name IS the `event_name` every event it raises carries.\n *\n * Held here rather than at each door, and that is the whole point of it being\n * here. A name this refuses is not a bad label, it is a **source that can\n * never count anything**: every arrival is rejected `invalid_name`, the card\n * goes on reading \"Counting\", and the only trace is one red line per event on\n * a feed somebody has to think to open. That happened — a HubSpot source\n * called \"Matrícula Realizada\", refused for ever by a rule that was ASCII-only\n * — and the reason it could happen is that three doors took a name and none of\n * them knew the rule.\n *\n * `MAX_EVENT_NAME` is the same 80 as {@link SOURCE_NAME_MAX} and\n * `validateEventName` checks it, so the bound is stated once even though both\n * constants exist.\n */\nexport const sourceNameSchema = z\n .string()\n .trim()\n .min(1)\n .max(SOURCE_NAME_MAX)\n .refine((name) => validateEventName(name) === null, REJECTION_MESSAGES.invalid_name);\n\n/** Where a source's arrivals go: the token is the whole path after this. */\nexport const EVENT_SOURCE_PATH_PREFIX = \"/v1/sources/\";\n\n/**\n * The address to hand a tool, given the branded host published for this\n * environment — the same fallback rule as `eventIngestUrl`.\n */\nexport function eventSourceUrl(brandedUrl: string | undefined, convexSiteUrl: string, token: string): string {\n const base = (brandedUrl || convexSiteUrl).replace(/\\/$/, \"\");\n return `${base}${EVENT_SOURCE_PATH_PREFIX}${token}`;\n}\n\nconst sourceIdSchema = z.string().min(1);\n\n/**\n * Canonical field → template (`template.ts`): literal text with `{{path}}`\n * mentions, or a bare path. A `properties.<key>` row is an extra property of\n * the event (`fields.ts`). Anything else is refused so a typo cannot become a\n * silent no-op.\n */\nexport const sourceMappingSchema = z.record(z.string(), z.string().min(1)).superRefine((mapping, ctx) => {\n for (const row of Object.keys(mapping)) {\n const problem = mappingRowProblem(row);\n if (problem !== null) ctx.addIssue({ code: \"custom\", message: problem, path: [row] });\n }\n});\n\n/** ISO 4217, upper case: what `POST /v1/events` accepts as `currency`. */\nexport const currencyCodeSchema = z\n .string()\n .trim()\n .toUpperCase()\n .regex(/^[A-Z]{3}$/, \"A currency is a three-letter code, like EUR or USD.\");\n\n/** What a HubSpot source is a trigger on: a contact (the default), a deal or a lead. */\nexport const hubspotObjectSchema = z.enum(HUBSPOT_OBJECTS);\n/** For a deal: whose event it is — the deal's first contact, or every contact on it. */\nexport const hubspotDealContactsSchema = z.enum(HUBSPOT_DEAL_CONTACTS);\n\n/**\n * One condition of a HubSpot trigger — *when a contact's* (or *a deal's*)\n * [property] [operator] [values] (`hubspotTrigger.ts`).\n */\nexport const hubspotConditionInputSchema = z.strictObject({\n property: z.string().trim().min(1),\n /** One of the property's kind's operators (`baker hubspot contacts properties` lists them); `is` when unsaid. */\n operator: z.string().trim().min(1).default(\"is\"),\n /** As HubSpot spells them: an option's internal value, a number, a `YYYY-MM-DD`, `true`/`false`. None for an empty check, two for a between, several for a list. */\n values: z.array(z.string().trim().min(1)).max(50).default([]),\n});\n\nconst conditionLogicSchema = z.enum(CONDITION_LOGICS);\n\nconst conditionGroupInputSchema = z.strictObject({\n logic: conditionLogicSchema,\n conditions: z.array(hubspotConditionInputSchema).min(1).max(TRIGGER_CONDITIONS_MAX),\n});\n\nconst combinedInputSchema = z\n .strictObject({\n /** How the rows combine: `And` (every one) or `Or` (any one) — a Form's filter's \"Match AND / OR\". */\n logic: conditionLogicSchema.default(\"And\"),\n /** Conditions, and groups of conditions with their own logic, one level deep. */\n conditions: z\n .array(z.union([hubspotConditionInputSchema, conditionGroupInputSchema]))\n .min(1)\n .max(TRIGGER_CONDITIONS_MAX),\n })\n .superRefine((trigger, context) => {\n const problem = triggerProblem(trigger);\n if (problem !== null) context.addIssue({ code: \"custom\", message: problem });\n });\n\n/**\n * What a HubSpot source watches: one condition, or several combined — the\n * way a Form's filter combines them. A single condition is the short\n * spelling, and is read as a trigger of that one condition.\n */\nexport const hubspotTriggerInputSchema = z\n .union([combinedInputSchema, hubspotConditionInputSchema])\n .transform((input): HubspotTriggerInput => (\"conditions\" in input ? input : onlyCondition(input)));\n\nconst hubspotConditionSchema = hubspotConditionInputSchema.extend({\n propertyLabel: z.string(),\n kind: z.enum(HUBSPOT_PROPERTY_KINDS),\n /** A select that holds several values at once (`a;b`); decides what HubSpot may filter on. */\n multiple: z.boolean().optional(),\n valueLabels: z.array(z.string()),\n});\n\nconst hubspotTriggerFields = {\n logic: conditionLogicSchema,\n conditions: z.array(\n z.union([\n hubspotConditionSchema,\n z.strictObject({ logic: conditionLogicSchema, conditions: z.array(hubspotConditionSchema) }),\n ]),\n ),\n};\n\n/** The trigger as stored on a source: every condition resolved, and on its object. */\nexport const hubspotWatchSchema = z.strictObject({\n ...hubspotTriggerFields,\n object: hubspotObjectSchema,\n contacts: hubspotDealContactsSchema.optional(),\n});\nexport type HubspotWatchView = z.infer<typeof hubspotWatchSchema>;\n\n/** A sample record as the preview shows it: its id and the properties it holds, empty ones dropped. */\nconst sampleRecordSchema = z.strictObject({ id: z.string(), properties: z.record(z.string(), z.string()) });\n\n/** What a HubSpot event would count today, asked before it is made: the trigger and the properties to read off the sample. */\nexport const hubspotPreviewRequestSchema = z.strictObject({\n object: hubspotObjectSchema.default(\"contact\"),\n trigger: hubspotTriggerInputSchema,\n /** Property names to read off the sample; `id` is always there. On a deal or a lead, `contact.<name>` reads its first contact. */\n properties: z.array(z.string().trim().min(1)).max(60).optional(),\n /** The record to draw the preview from — an id, or text to search (an email or a name for a contact, a deal's or a lead's name). The one most recently at the trigger when unsaid. */\n contact: z.string().trim().min(1).max(200).optional(),\n});\nexport type HubspotPreviewRequest = z.infer<typeof hubspotPreviewRequestSchema>;\n\nexport const hubspotPreviewSchema = z.strictObject({\n /** Records satisfying the trigger today — the ones that will NOT be counted. */\n total: z.number(),\n /** False when the trigger has more combinations than HubSpot's search takes, so `total` is only near. */\n exact: z.boolean().optional(),\n /**\n * The sample record the trigger is on, with the properties asked for and\n * the contacts behind it, first first; none when nothing fits.\n *\n * One field rather than one per object: a contact source's record *is* the\n * person and its `contacts` is empty, while a deal's and a lead's carry the\n * people the event is about. Three parallel nullable fields, exactly one of\n * them ever set, would say the same thing and let a caller read the wrong one.\n */\n record: sampleRecordSchema.extend({ contacts: z.array(sampleRecordSchema) }).nullable(),\n});\nexport type HubspotPreview = z.infer<typeof hubspotPreviewSchema>;\n\nexport const sourcesRequestSchema = z.strictObject({\n /** The company's own server door: made once, `counting` from the start, the same address for ever after. */\n server: z.strictObject({}).optional(),\n create: z.strictObject({ name: sourceNameSchema }).optional(),\n /** A HubSpot event: read every five minutes, counting from now. The labels are looked up server-side. */\n createHubspot: z\n .strictObject({\n name: sourceNameSchema.optional(),\n /** A contact, a deal or a lead. A deal's and a lead's event is about its contact, read through `contact.<property>` rows. */\n object: hubspotObjectSchema.default(\"contact\"),\n trigger: hubspotTriggerInputSchema,\n /** On a deal: the deal's first contact (the default), or every contact on it, each its own event. */\n contacts: hubspotDealContactsSchema.optional(),\n /** Rows to read off the record, over the defaults; the same table `map` writes. */\n mapping: sourceMappingSchema.optional(),\n /** A number property on the record to read as the amount; needs `currency` beside it. Sugar over the mapping's `value` and `currency` rows. */\n amountProperty: z.string().trim().min(1).optional(),\n currency: currencyCodeSchema.optional(),\n })\n .optional(),\n /**\n * An ActiveCampaign source: ActiveCampaign's own webhook, made on the\n * account when this is applied, sending the events picked here. Each raises\n * `activecampaign.<type>` and counts from then on.\n */\n createActiveCampaign: z\n .strictObject({\n name: sourceNameSchema.optional(),\n /** ActiveCampaign's event names (`subscribe`, `deal_update`, …); the lead and deal moments when unsaid. */\n events: activeCampaignEventsSchema.optional(),\n /** Which connection, when the company has more than one. */\n account: z.string().trim().min(1).optional(),\n })\n .optional(),\n /** Change what a HubSpot event watches. It counts from now on under the new trigger; the rows stay. The object cannot change: the rows read it. */\n setTrigger: z\n .strictObject({\n sourceId: sourceIdSchema,\n trigger: hubspotTriggerInputSchema,\n contacts: hubspotDealContactsSchema.optional(),\n })\n .optional(),\n /** Ask HubSpot what a trigger would count today, and read one real record, without making anything. */\n preview: hubspotPreviewRequestSchema.optional(),\n /** Change where a HubSpot-read source takes its amount from; no `amountProperty` clears it. Sugar over `map`. */\n setAmount: z\n .strictObject({\n sourceId: sourceIdSchema,\n amountProperty: z.string().trim().min(1).optional(),\n currency: currencyCodeSchema.optional(),\n })\n .optional(),\n /**\n * Count a HubSpot event's history: every moment its trigger came to hold\n * since `since`, read out of HubSpot's own property history.\n *\n * Not the thing a source deliberately refuses to do. A source never\n * backfills the **present state** — somebody who already satisfies a\n * condition is not an event today — and this reports only moments HubSpot\n * has a timestamp for, so nothing is invented. Dry unless `write`.\n */\n backfill: z\n .strictObject({\n sourceId: sourceIdSchema,\n /** ISO instant, or Unix milliseconds. Bounded by the 400 days the store keeps. */\n since: z.union([z.string().trim().min(1), z.number()]),\n /**\n * Where a capped run carries on from: only records last changed at or\n * before this instant are read.\n *\n * The **read** is what it bounds, never the history. Records are chosen\n * most-recently-changed first, so a run that reaches its cap has covered\n * the newest of them and the rest are the ones nearest `since` — which\n * no shorter window can reach, because shortening one only drops\n * candidates from the old end and hands back the same newest records\n * again. `reachedBack` is the value to pass here, and the moments each\n * record is then judged on are still the whole of `since` to now.\n */\n before: z.union([z.string().trim().min(1), z.number()]).optional(),\n /** Without it, nothing is counted and the answer says what would be. */\n write: z.boolean().optional(),\n })\n .optional(),\n map: z.strictObject({ sourceId: sourceIdSchema, mapping: sourceMappingSchema }).optional(),\n pause: z.strictObject({ sourceId: sourceIdSchema }).optional(),\n resume: z.strictObject({ sourceId: sourceIdSchema }).optional(),\n remove: z.strictObject({ sourceId: sourceIdSchema }).optional(),\n});\nexport type SourcesRequest = z.infer<typeof sourcesRequestSchema>;\n/** The request as a caller writes it, before the schema fills its defaults — what the CLI builds. */\nexport type SourcesRequestInput = z.input<typeof sourcesRequestSchema>;\n\n/** A delivery that arrived and was refused — mirrors `sourceRefusalValidator` in the backend schema. */\nexport const sourceRefusalSchema = z.strictObject({\n at: z.number(),\n count: z.number(),\n code: z.string(),\n reason: z.string(),\n});\n\nexport const detectedFieldSchema = z.strictObject({\n path: z.string(),\n confidence: z.enum([\"key\", \"value\"]),\n});\n\n/** Whether HubSpot's journal is being told to keep the changes a source watches. */\nexport const HUBSPOT_LISTENING_STATES = [\"listening\", \"not_configured\", \"failed\"] as const;\nexport type HubspotListeningState = (typeof HUBSPOT_LISTENING_STATES)[number];\n\nexport const sourceViewSchema = z.strictObject({\n id: z.string(),\n kind: z.enum(SOURCE_KINDS),\n name: z.string(),\n status: z.enum(SOURCE_STATUSES),\n /** The address a tool posts to. A HubSpot source has none: Baker calls HubSpot. */\n url: z.string().optional(),\n /** What a HubSpot source watches, and on which object. */\n hubspot: hubspotWatchSchema.optional(),\n /**\n * What an ActiveCampaign source listens to, and whether ActiveCampaign has\n * the webhook that sends it: `listening` once it is made, `not_configured`\n * until then, `failed` when ActiveCampaign refused it — `detail` says why.\n */\n activecampaign: z\n .strictObject({\n events: z.array(z.string()),\n webhook: z.strictObject({ state: z.enum(ACTIVECAMPAIGN_WEBHOOK_STATES), detail: z.string().optional() }),\n })\n .optional(),\n /** A HubSpot source counts changes from here on; one HubSpot reports from before it is dropped. Moves when the trigger changes. */\n countingSince: z.number().optional(),\n /**\n * Whether HubSpot is keeping this source's changes for Baker, as last\n * checked: `listening` when the app's journal subscription on the account\n * names the property; `not_configured` when the app has not been told yet\n * (or cannot be, with no credentials); `failed` when HubSpot refused the\n * subscription. `detail` says what to do.\n */\n listening: z.strictObject({ state: z.enum(HUBSPOT_LISTENING_STATES), detail: z.string().optional() }).optional(),\n /** Why the last delivery could not be counted, in product words; absent when the last one was. */\n lastError: z.string().optional(),\n lastArrivalAt: z.number().optional(),\n /**\n * What its last delivery **refused, event by event** — which `lastError` is\n * not and `lastArrivalAt` cannot be. A source refusing everything it\n * receives has no arrival and no read failure, so without this it reads as\n * one nobody has sent anything to. `refusalWords` turns it into the\n * sentence a person is shown. Cleared by the next delivery that counts.\n */\n lastRefusal: sourceRefusalSchema.optional(),\n /** The first send, masked, while learning. Kept once confirmed. */\n sample: z.strictObject({ receivedAt: z.number(), body: z.string() }).optional(),\n /** Field → template; empty means the guess (an address) or the defaults (a HubSpot read). */\n mapping: z.record(z.string(), z.string()),\n /** The guess over the sample, for the sheet to prefill and the CLI to suggest. */\n detected: z.record(z.string(), detectedFieldSchema).optional(),\n /** Every path the sample's first item holds, with its masked value — what the picker offers. */\n paths: z.array(z.strictObject({ path: z.string(), value: z.string() })).optional(),\n /** `baker` when the sample already parses as the `POST /v1/events` contract and needs no mapping. */\n format: z.enum([\"baker\", \"foreign\"]).optional(),\n});\nexport type SourceView = z.infer<typeof sourceViewSchema>;\n\n/**\n * One change to the company's sources, staged inside a chat and applied when\n * it is published. `ref` is the source's id, or a `src_temp_*` for one the\n * chat makes.\n */\nexport const stagedSourceOpSchema = z.strictObject({\n kind: z.enum([\"create\", \"setTrigger\", \"map\", \"status\", \"remove\"]),\n ref: z.string(),\n name: z.string(),\n summary: z.string(),\n /** On a create: what the source will watch and read. */\n hubspot: hubspotWatchSchema.optional(),\n /** On an ActiveCampaign create: the events its webhook will send. */\n activecampaign: z.strictObject({ events: z.array(z.string()) }).optional(),\n mapping: z.record(z.string(), z.string()).optional(),\n status: z.enum([\"paused\", \"counting\"]).optional(),\n});\nexport type StagedSourceOp = z.infer<typeof stagedSourceOpSchema>;\n\n/** What a backfill found, and — on a `write` run — what became of it. */\nexport const backfillResultSchema = z.strictObject({\n sourceId: z.string(),\n name: z.string(),\n since: z.number(),\n /** Records whose history was read. */\n examined: z.number(),\n /** Moments the trigger came to hold, across them. */\n entries: z.number(),\n /** Of those, already counted — the journal got there first, or a previous run did. */\n alreadyCounted: z.number(),\n /** What a `write` run would hand over, or did. */\n pending: z.number(),\n /** Whether the read stopped at its cap; {@link BackfillResult.reachedBack} is where to carry on from. */\n capped: z.boolean(),\n /**\n * How far back the read got: the instant the oldest record it examined was\n * last changed. Only on a capped run, and it is the next run's `before`.\n */\n reachedBack: z.number().optional(),\n counted: z.number().optional(),\n refused: z.number().optional(),\n refusedReason: z.string().optional(),\n});\nexport type BackfillResult = z.infer<typeof backfillResultSchema>;\n\nexport const sourcesResponseSchema = z.strictObject({\n ok: z.literal(true),\n data: z.strictObject({\n sources: z.array(sourceViewSchema),\n /** Only when the request carried `preview`. */\n preview: hubspotPreviewSchema.optional(),\n /** Only when the request carried `backfill`. */\n backfill: backfillResultSchema.optional(),\n /** What this chat has staged, when one is attached: applied at Publish, dropped with a discard. */\n staged: z.array(stagedSourceOpSchema).optional(),\n }),\n hints: z.array(z.string()).optional(),\n});\nexport type SourcesResponse = z.infer<typeof sourcesResponseSchema>;\n","/**\n * What an ActiveCampaign source can listen to: ActiveCampaign's own webhook\n * events, and the event name each one raises in Baker.\n *\n * The list is ActiveCampaign's, read from `GET /api/3/webhook/events` — an\n * account answers with exactly these 27 — and the words are ours, for the\n * picker and the change list. Every event a source raises is called\n * `activecampaign.<type>`, whatever the source is called, so a scheduled agent\n * narrowed to `activecampaign.deal_update` runs for any connected account and\n * `properties.baker_source` says which source it came through.\n */\nimport { z } from \"zod\";\n\nexport const ACTIVECAMPAIGN_WEBHOOK_EVENTS = {\n subscribe: \"A contact subscribes to a list\",\n unsubscribe: \"A contact unsubscribes\",\n update: \"A contact's details change\",\n contact_tag_added: \"A tag is added to a contact\",\n contact_tag_removed: \"A tag is removed from a contact\",\n subscriber_note: \"A note is added to a contact\",\n contact_task_add: \"A task is added to a contact\",\n sent: \"A campaign starts sending\",\n open: \"A contact opens a campaign\",\n click: \"A contact clicks a link in a campaign\",\n reply: \"A contact replies to a campaign\",\n forward: \"A contact forwards a campaign\",\n share: \"A contact shares a campaign\",\n bounce: \"A campaign email bounces\",\n list_add: \"A list is created\",\n deal_add: \"A deal is created\",\n deal_update: \"A deal changes\",\n deal_note_add: \"A note is added to a deal\",\n deal_task_add: \"A task is added to a deal\",\n deal_task_complete: \"A deal task is completed\",\n deal_pipeline_add: \"A pipeline is created\",\n deal_stage_add: \"A deal stage is created\",\n deal_tasktype_add: \"A deal task type is created\",\n account_add: \"An account is created\",\n account_update: \"An account changes\",\n account_contact_add: \"A contact is added to an account\",\n account_contact_update: \"A contact on an account changes\",\n} as const;\n\nexport type ActiveCampaignWebhookEvent = keyof typeof ACTIVECAMPAIGN_WEBHOOK_EVENTS;\n\nexport const ACTIVECAMPAIGN_WEBHOOK_EVENT_TYPES = Object.keys(\n ACTIVECAMPAIGN_WEBHOOK_EVENTS,\n) as readonly ActiveCampaignWebhookEvent[];\n\n/** Who may have caused an event: a contact, a user, an automation, the API — all of them, so nothing is missed. */\nexport const ACTIVECAMPAIGN_WEBHOOK_SOURCES = [\"public\", \"admin\", \"api\", \"system\"] as const;\n\n/** What a new source listens to when nobody says: the lead and deal moments a marketer asks about first. */\nexport const ACTIVECAMPAIGN_DEFAULT_EVENTS: readonly ActiveCampaignWebhookEvent[] = [\n \"subscribe\",\n \"contact_tag_added\",\n \"deal_add\",\n \"deal_update\",\n];\n\n/** The source's name when nobody gives one. */\nexport const ACTIVECAMPAIGN_SOURCE_NAME = \"ActiveCampaign\";\n\nconst EVENT_PREFIX = \"activecampaign.\";\n\n/** The Baker event an ActiveCampaign webhook event raises: `subscribe` → `activecampaign.subscribe`. */\nexport function activeCampaignEventName(type: string): string {\n return `${EVENT_PREFIX}${type}`;\n}\n\n/** The ActiveCampaign event behind a Baker event name, or null when it is not one. */\nexport function activeCampaignEventOf(eventName: string): ActiveCampaignWebhookEvent | null {\n if (!eventName.startsWith(EVENT_PREFIX)) return null;\n const type = eventName.slice(EVENT_PREFIX.length);\n return type in ACTIVECAMPAIGN_WEBHOOK_EVENTS ? (type as ActiveCampaignWebhookEvent) : null;\n}\n\n/** The words for one event, falling back to ActiveCampaign's own name for one this list does not know. */\nexport function activeCampaignEventLabel(type: string): string {\n return type in ACTIVECAMPAIGN_WEBHOOK_EVENTS\n ? ACTIVECAMPAIGN_WEBHOOK_EVENTS[type as ActiveCampaignWebhookEvent]\n : type;\n}\n\n/**\n * The events a source listens to, as the CLI and the dashboard hand them in:\n * ActiveCampaign's names, or Baker's `activecampaign.<type>` spelling of them,\n * deduplicated, in the catalogue's order.\n */\nexport const activeCampaignEventsSchema = z\n .array(z.string().trim().min(1))\n .min(1, \"Pick at least one ActiveCampaign event to listen to.\")\n .max(ACTIVECAMPAIGN_WEBHOOK_EVENT_TYPES.length)\n .transform((raw, ctx) => {\n const picked = new Set<ActiveCampaignWebhookEvent>();\n for (const item of raw) {\n const type = activeCampaignEventOf(item) ?? (item in ACTIVECAMPAIGN_WEBHOOK_EVENTS ? item : null);\n if (type === null) {\n ctx.addIssue({\n code: \"custom\",\n message: `\"${item}\" is not an ActiveCampaign event. Pick from: ${ACTIVECAMPAIGN_WEBHOOK_EVENT_TYPES.join(\", \")}.`,\n });\n return z.NEVER;\n }\n picked.add(type as ActiveCampaignWebhookEvent);\n }\n return ACTIVECAMPAIGN_WEBHOOK_EVENT_TYPES.filter((type) => picked.has(type));\n });\n\n/** Whether ActiveCampaign has the webhook that sends a source its events, as last checked. */\nexport const ACTIVECAMPAIGN_WEBHOOK_STATES = [\"listening\", \"not_configured\", \"failed\"] as const;\nexport type ActiveCampaignWebhookState = (typeof ACTIVECAMPAIGN_WEBHOOK_STATES)[number];\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCO,IAAM,8BAA8B;AAGpC,IAAM,yBAAyB;AAG/B,SAAS,YAAY,UAA0B;AACpD,SAAO,GAAG,sBAAsB,GAAG,QAAQ;AAC7C;AAQO,IAAM,6BAA6E;AAAA,EACxF,OAAO;AAAA,EACP,OAAO;AAAA,EACP,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,MAAM;AAAA,EACN,aAAa;AAAA,EACb,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AACV;AAMA,IAAM,iBAAiE,OAAO;AAAA,EAC5E,OAAO,QAAQ,0BAA0B,EAAE,IAAI,CAAC,CAAC,OAAO,QAAQ,MAAM,CAAC,OAAO,YAAY,QAAQ,CAAC,CAAC;AACtG;AAQO,IAAM,kCAAkF;AAAA,EAC7F,GAAG;AAAA,EACH,OAAO;AAAA,EACP,UAAU;AACZ;AAQO,IAAM,kCAAkF;AAE/F,IAAM,WAA4F;AAAA,EAChG,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AACR;AAGO,SAAS,sBACd,YACA,SAAwB,WACc;AACtC,QAAM,UAAgD,EAAE,YAAY,WAAW;AAC/E,aAAW,CAAC,O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AAC,EAAE,CAAC,EAAE,SAAS;AAAA,EACzE,SAASA,GAAE,OAAOA,GAAE,OAAO,GAAGA,GAAE,OAAO,CAAC,EAAE,SAAS;AAAA,EACnD,QAAQA,GAAE,KAAK,CAAC,UAAU,UAAU,CAAC,EAAE,SAAS;AAClD,CAAC;AAIM,IAAM,uBAAuBA,GAAE,aAAa;AAAA,EACjD,UAAUA,GAAE,OAAO;AAAA,EACnB,MAAMA,GAAE,OAAO;AAAA,EACf,OAAOA,GAAE,OAAO;AAAA;AAAA,EAEhB,UAAUA,GAAE,OAAO;AAAA;AAAA,EAEnB,SAASA,GAAE,OAAO;AAAA;AAAA,EAElB,gBAAgBA,GAAE,OAAO;AAAA;AAAA,EAEzB,SAASA,GAAE,OAAO;AAAA;AAAA,EAElB,QAAQA,GAAE,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB,aAAaA,GAAE,OAAO,EAAE,SAAS;AAAA,EACjC,SAASA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,SAASA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,eAAeA,GAAE,OAAO,EAAE,SAAS;AACrC,CAAC;AAGM,IAAM,wBAAwBA,GAAE,aAAa;AAAA,EAClD,IAAIA,GAAE,QAAQ,IAAI;AAAA,EAClB,MAAMA,GAAE,aAAa;AAAA,IACnB,SAASA,GAAE,MAAM,gBAAgB;AAAA;AAAA,IAEjC,SAAS,qBAAqB,SAAS;AAAA;AAAA,IAEvC,UAAU,qBAAqB,SAAS;AAAA;AAAA,IAExC,QAAQA,GAAE,MAAM,oBAAoB,EAAE,SAAS;AAAA,EACjD,CAAC;AAAA,EACD,OAAOA,GAAE,MAAMA,GAAE,OAAO,CAAC,EAAE,SAAS;AACtC,CAAC;","names":["z","z","z"]}
|
|
@@ -152,6 +152,7 @@ async function draftList(json, chat, full = false, selector) {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
export {
|
|
155
|
+
failValidation,
|
|
155
156
|
requireTarget,
|
|
156
157
|
loadJsonArg,
|
|
157
158
|
handleError,
|
|
@@ -160,4 +161,4 @@ export {
|
|
|
160
161
|
draftAction,
|
|
161
162
|
draftList
|
|
162
163
|
};
|
|
163
|
-
//# sourceMappingURL=chunk-
|
|
164
|
+
//# sourceMappingURL=chunk-WYBX53EI.js.map
|