@koda-sl/baker-cli 0.471.0-dev.cc57cf0bc → 0.472.0-dev.607524e67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -139,7 +139,7 @@ baker organization pull # what each company made, as published, into ~/
139
139
 
140
140
  `baker organization pull [--company <id>] [--dir <path>] [--force]` downloads each company's knowledge, landing pages, Forms, brand, documents, custom agents and checks and Reports, as published, one read-only folder per company, and writes `INDEX.md`. A second run only fetches companies that published since.
141
141
 
142
- On the organization workspace's Runtime (`BAKER_WORKSPACE_KIND=organization`) the CLI offers only reads, plus research and judgment run as the workspace itself; any other command is left out of `--help` and `baker schema` and refused before it is sent. Everywhere else the `organization` family is left out of help.
142
+ On the organization workspace's Runtime (`BAKER_WORKSPACE_KIND=organization`) the CLI offers only reads, plus research and judgment run as the workspace itself (not `research customers` or `winning-ads fit`, which work on one company's own workspace); any other command is left out of `--help` and `baker schema` and refused before it is sent. Everywhere else the `organization` family is left out of help.
143
143
 
144
144
  ### Fresh reads: `--no-cache`
145
145
 
@@ -44,19 +44,12 @@ var ORGANIZATION_COMMANDS = [
44
44
  "videos tags list",
45
45
  "studio get",
46
46
  "studio list",
47
- "studio models",
48
47
  "avatars list",
49
48
  "avatars get",
50
49
  "creatives performance",
51
50
  "creatives feedback read",
52
51
  "landing export status",
53
52
  "landing export list",
54
- "landing inspiration search",
55
- "landing inspiration view",
56
- "landing inspiration code",
57
- "landing inspiration page",
58
- "landing inspiration sequences",
59
- "landing inspiration favorites",
60
53
  "site show",
61
54
  "site domain list",
62
55
  "credentials list",
@@ -230,7 +223,22 @@ var ORGANIZATION_COMMANDS = [
230
223
  "accounts crm check",
231
224
  "accounts crm contract",
232
225
  // Research and judgment, run as the workspace itself (never with --company).
233
- "research",
226
+ // Not `research customers`, which writes into a company's Knowledge, nor
227
+ // `winning-ads fit`, which judges an ad against a company's own COMPANY.md.
228
+ "research web",
229
+ "research fetch",
230
+ "research google-ads",
231
+ "research reddit",
232
+ "research advertisers",
233
+ "research autocomplete",
234
+ "research countries",
235
+ "research intent",
236
+ "research keyword-metrics",
237
+ "research keywords-for-site",
238
+ "research keyword-gap",
239
+ "research languages",
240
+ "research lighthouse",
241
+ "research relevant-pages",
234
242
  "decide",
235
243
  "winning-ads search",
236
244
  "winning-ads advertisers",
@@ -243,7 +251,6 @@ var ORGANIZATION_COMMANDS = [
243
251
  "winning-ads landings",
244
252
  "winning-ads search-copy",
245
253
  "winning-ads content",
246
- "winning-ads fit",
247
254
  "winning-ads hooks",
248
255
  "winning-ads mechanisms",
249
256
  "winning-ads formats"
@@ -297,4 +304,4 @@ export {
297
304
  offers,
298
305
  applyAgentProfile
299
306
  };
300
- //# sourceMappingURL=chunk-UJU4BOSW.js.map
307
+ //# sourceMappingURL=chunk-T3UFGG6U.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/agent-profile.ts"],"sourcesContent":["import { optionalWorkspaceKind } from \"./env.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.\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 // 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 \"scheduled-agents list\",\n \"scheduled-agents get\",\n \"scheduled-agents triggers\",\n \"scheduled-agents targets\",\n \"scheduled-agents templates\",\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 \"videos get\",\n \"videos search\",\n \"videos tags list\",\n \"studio get\",\n \"studio list\",\n \"avatars list\",\n \"avatars get\",\n \"creatives performance\",\n \"creatives feedback read\",\n \"landing export status\",\n \"landing export list\",\n \"site show\",\n \"site domain list\",\n \"credentials list\",\n \"setup-links list\",\n \"media-sources list\",\n \"mcp connected\",\n \"mcp catalog\",\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 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 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 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 account url-params\",\n \"ads linkedin campaign-groups list\",\n \"ads linkedin campaigns list\",\n \"ads linkedin campaigns url-params\",\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 // 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 \"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 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 \"winning-ads search\",\n \"winning-ads advertisers\",\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\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/** 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\n/** The command `argv` addresses, as typed, through the loaded tree. */\nfunction addressedPath(root: ProfiledCommand, argv: readonly string[]): string {\n const path: string[] = [];\n let command: ProfiledCommand = root;\n for (const token of argv) {\n if (token === \"--\" || token.startsWith(\"-\")) break;\n const next = (command.subCommands as Record<string, unknown> | undefined)?.[token];\n if (typeof next !== \"object\" || next === null) break;\n path.push(token);\n command = next as ProfiledCommand;\n }\n return path.join(\" \");\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 function applyAgentProfile(\n root: ProfiledCommand,\n profile: AgentProfile,\n argv: readonly string[],\n): string | null {\n hideUnoffered(root, profile, []);\n if (profile === \"company\") return null;\n return offers(profile, addressedPath(root, argv)) ? null : ORGANIZATION_REFUSAL;\n}\n"],"mappings":";;;;;AAqBO,SAAS,aAAa,gBAAoC,sBAAsB,GAAiB;AACtG,SAAO,kBAAkB,iBAAiB,iBAAiB;AAC7D;AAGA,IAAM,oBAAoB,CAAC,cAAc;AAMlC,IAAM,wBAA2C;AAAA,EACtD;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,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,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,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;AAA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A,EAClD;AACF;AAGA,SAAS,cAAc,SAA0B,SAAuB,MAAsB;AAC5F,QAAM,cAAc,QAAQ;AAC5B,MAAI,OAAO,gBAAgB,YAAY,gBAAgB,KAAM;AAC7D,aAAW,CAAC,MAAM,GAAG,KAAK,OAAO,QAAQ,WAAsC,GAAG;AAChF,QAAI,OAAO,QAAQ,YAAY,QAAQ,KAAM;AAC7C,UAAM,UAAU,CAAC,GAAG,MAAM,IAAI;AAC9B,QAAI,CAAC,OAAO,SAAS,QAAQ,KAAK,GAAG,CAAC,EAAG,MAAK,GAAsB;AACpE,kBAAc,KAAwB,SAAS,OAAO;AAAA,EACxD;AACF;AAGA,SAAS,cAAc,MAAuB,MAAiC;AAC7E,QAAM,OAAiB,CAAC;AACxB,MAAI,UAA2B;AAC/B,aAAW,SAAS,MAAM;AACxB,QAAI,UAAU,QAAQ,MAAM,WAAW,GAAG,EAAG;AAC7C,UAAM,OAAQ,QAAQ,cAAsD,KAAK;AACjF,QAAI,OAAO,SAAS,YAAY,SAAS,KAAM;AAC/C,SAAK,KAAK,KAAK;AACf,cAAU;AAAA,EACZ;AACA,SAAO,KAAK,KAAK,GAAG;AACtB;AAUO,SAAS,kBACd,MACA,SACA,MACe;AACf,gBAAc,MAAM,SAAS,CAAC,CAAC;AAC/B,MAAI,YAAY,UAAW,QAAO;AAClC,SAAO,OAAO,SAAS,cAAc,MAAM,IAAI,CAAC,IAAI,OAAO;AAC7D;","names":[]}
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  agentProfile,
4
4
  applyAgentProfile
5
- } from "./chunk-UJU4BOSW.js";
5
+ } from "./chunk-T3UFGG6U.js";
6
6
  import {
7
7
  cacheFlagForCommand,
8
8
  cacheFlagForParser,
@@ -188,7 +188,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
188
188
  mcp: () => import("./mcp-DNTENLF4.js").then((m) => m.mcpCommand),
189
189
  "setup-links": () => import("./setup-links-YZP2ZG3K.js").then((m) => m.setupLinksCommand),
190
190
  organization: () => import("./organization-NTPLZDUS.js").then((m) => m.organizationCommand),
191
- schema: () => import("./schema-NF27GOUI.js").then((m) => m.schemaCommand)
191
+ schema: () => import("./schema-WTIC6QEV.js").then((m) => m.schemaCommand)
192
192
  }
193
193
  });
194
194
 
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  agentProfile,
3
3
  offers
4
- } from "./chunk-UJU4BOSW.js";
4
+ } from "./chunk-T3UFGG6U.js";
5
5
  import "./chunk-PBI5PQEZ.js";
6
6
  import {
7
7
  findSchema,
@@ -66,4 +66,4 @@ export {
66
66
  narrowToFamily,
67
67
  schemaCommand
68
68
  };
69
- //# sourceMappingURL=schema-NF27GOUI.js.map
69
+ //# sourceMappingURL=schema-WTIC6QEV.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koda-sl/baker-cli",
3
- "version": "0.471.0-dev.cc57cf0bc",
3
+ "version": "0.472.0-dev.607524e67",
4
4
  "description": "AI-agent-first CLI for interacting with Baker, including the Baker creative canvas.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/agent-profile.ts"],"sourcesContent":["import { optionalWorkspaceKind } from \"./env.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.\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 // 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 \"scheduled-agents list\",\n \"scheduled-agents get\",\n \"scheduled-agents triggers\",\n \"scheduled-agents targets\",\n \"scheduled-agents templates\",\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 \"videos get\",\n \"videos search\",\n \"videos tags list\",\n \"studio get\",\n \"studio list\",\n \"studio models\",\n \"avatars list\",\n \"avatars get\",\n \"creatives performance\",\n \"creatives feedback read\",\n \"landing export status\",\n \"landing export list\",\n \"landing inspiration search\",\n \"landing inspiration view\",\n \"landing inspiration code\",\n \"landing inspiration page\",\n \"landing inspiration sequences\",\n \"landing inspiration favorites\",\n \"site show\",\n \"site domain list\",\n \"credentials list\",\n \"setup-links list\",\n \"media-sources list\",\n \"mcp connected\",\n \"mcp catalog\",\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 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 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 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 account url-params\",\n \"ads linkedin campaign-groups list\",\n \"ads linkedin campaigns list\",\n \"ads linkedin campaigns url-params\",\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 // 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 \"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 \"research\",\n \"decide\",\n \"winning-ads search\",\n \"winning-ads advertisers\",\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 fit\",\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\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/** 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\n/** The command `argv` addresses, as typed, through the loaded tree. */\nfunction addressedPath(root: ProfiledCommand, argv: readonly string[]): string {\n const path: string[] = [];\n let command: ProfiledCommand = root;\n for (const token of argv) {\n if (token === \"--\" || token.startsWith(\"-\")) break;\n const next = (command.subCommands as Record<string, unknown> | undefined)?.[token];\n if (typeof next !== \"object\" || next === null) break;\n path.push(token);\n command = next as ProfiledCommand;\n }\n return path.join(\" \");\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 function applyAgentProfile(\n root: ProfiledCommand,\n profile: AgentProfile,\n argv: readonly string[],\n): string | null {\n hideUnoffered(root, profile, []);\n if (profile === \"company\") return null;\n return offers(profile, addressedPath(root, argv)) ? null : ORGANIZATION_REFUSAL;\n}\n"],"mappings":";;;;;AAqBO,SAAS,aAAa,gBAAoC,sBAAsB,GAAiB;AACtG,SAAO,kBAAkB,iBAAiB,iBAAiB;AAC7D;AAGA,IAAM,oBAAoB,CAAC,cAAc;AAMlC,IAAM,wBAA2C;AAAA,EACtD;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,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,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,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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