@bikdotai/bik-component-library 0.0.832-beta.0 → 0.0.832-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/dist/cjs/components/agent-builder/AgentBuilder.js +1 -1
  2. package/dist/cjs/components/agent-builder/AgentBuilder.js.map +1 -1
  3. package/dist/cjs/components/agent-builder/components/MentionField.js +1 -1
  4. package/dist/cjs/components/agent-builder/components/MentionField.js.map +1 -1
  5. package/dist/cjs/components/agent-builder/components/MentionPicker.js +11 -4
  6. package/dist/cjs/components/agent-builder/components/MentionPicker.js.map +1 -1
  7. package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
  8. package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
  9. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js +1 -1
  10. package/dist/cjs/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  11. package/dist/cjs/components/agent-builder/utils/toolActions.js +1 -1
  12. package/dist/cjs/components/agent-builder/utils/toolActions.js.map +1 -1
  13. package/dist/cjs/icons/Social/Channels/EmailMarketingV2.js +2 -0
  14. package/dist/cjs/icons/Social/Channels/EmailMarketingV2.js.map +1 -0
  15. package/dist/cjs/icons/Social/Channels/EmailV2.js +2 -0
  16. package/dist/cjs/icons/Social/Channels/EmailV2.js.map +1 -0
  17. package/dist/cjs/icons/Social/Channels/FacebookCommentV2.js +2 -0
  18. package/dist/cjs/icons/Social/Channels/FacebookCommentV2.js.map +1 -0
  19. package/dist/cjs/icons/Social/Channels/FacebookV2.js +2 -0
  20. package/dist/cjs/icons/Social/Channels/FacebookV2.js.map +1 -0
  21. package/dist/cjs/icons/Social/Channels/GmailV2.js +2 -0
  22. package/dist/cjs/icons/Social/Channels/GmailV2.js.map +1 -0
  23. package/dist/cjs/icons/Social/Channels/InstagramCommentV2.js +2 -0
  24. package/dist/cjs/icons/Social/Channels/InstagramCommentV2.js.map +1 -0
  25. package/dist/cjs/icons/Social/Channels/InstagramV2.js +2 -0
  26. package/dist/cjs/icons/Social/Channels/InstagramV2.js.map +1 -0
  27. package/dist/cjs/icons/Social/Channels/MessengerV2.js +2 -0
  28. package/dist/cjs/icons/Social/Channels/MessengerV2.js.map +1 -0
  29. package/dist/cjs/icons/Social/Channels/PhoneV2.js +2 -0
  30. package/dist/cjs/icons/Social/Channels/PhoneV2.js.map +1 -0
  31. package/dist/cjs/icons/Social/Channels/RcsV2.js +2 -0
  32. package/dist/cjs/icons/Social/Channels/RcsV2.js.map +1 -0
  33. package/dist/cjs/icons/Social/Channels/SmsV2.js +2 -0
  34. package/dist/cjs/icons/Social/Channels/SmsV2.js.map +1 -0
  35. package/dist/cjs/icons/Social/Channels/TaskV2.js +2 -0
  36. package/dist/cjs/icons/Social/Channels/TaskV2.js.map +1 -0
  37. package/dist/cjs/icons/Social/Channels/WebpushV2.js +2 -0
  38. package/dist/cjs/icons/Social/Channels/WebpushV2.js.map +1 -0
  39. package/dist/cjs/icons/Social/Channels/WhatsAppCallV2.js +2 -0
  40. package/dist/cjs/icons/Social/Channels/WhatsAppCallV2.js.map +1 -0
  41. package/dist/cjs/icons/Social/Channels/WhatsAppV2.js +2 -0
  42. package/dist/cjs/icons/Social/Channels/WhatsAppV2.js.map +1 -0
  43. package/dist/cjs/icons/index.js +1 -1
  44. package/dist/esm/components/agent-builder/AgentBuilder.js +91 -87
  45. package/dist/esm/components/agent-builder/AgentBuilder.js.map +1 -1
  46. package/dist/esm/components/agent-builder/AgentBuilder.model.d.ts +25 -1
  47. package/dist/esm/components/agent-builder/components/MentionField.js +56 -44
  48. package/dist/esm/components/agent-builder/components/MentionField.js.map +1 -1
  49. package/dist/esm/components/agent-builder/components/MentionPicker.js +135 -116
  50. package/dist/esm/components/agent-builder/components/MentionPicker.js.map +1 -1
  51. package/dist/esm/components/agent-builder/constants/tools.d.ts +25 -1
  52. package/dist/esm/components/agent-builder/constants/tools.js +20 -12
  53. package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
  54. package/dist/esm/components/agent-builder/context/AgentBuilderContext.d.ts +10 -0
  55. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js +129 -123
  56. package/dist/esm/components/agent-builder/context/AgentBuilderContext.js.map +1 -1
  57. package/dist/esm/components/agent-builder/utils/toolActions.d.ts +1 -1
  58. package/dist/esm/components/agent-builder/utils/toolActions.js +13 -9
  59. package/dist/esm/components/agent-builder/utils/toolActions.js.map +1 -1
  60. package/dist/esm/icons/Social/Channels/EmailMarketingV2.d.ts +6 -0
  61. package/dist/esm/icons/Social/Channels/EmailMarketingV2.js +41 -0
  62. package/dist/esm/icons/Social/Channels/EmailMarketingV2.js.map +1 -0
  63. package/dist/esm/icons/Social/Channels/EmailV2.d.ts +6 -0
  64. package/dist/esm/icons/Social/Channels/EmailV2.js +30 -0
  65. package/dist/esm/icons/Social/Channels/EmailV2.js.map +1 -0
  66. package/dist/esm/icons/Social/Channels/FacebookCommentV2.d.ts +6 -0
  67. package/dist/esm/icons/Social/Channels/FacebookCommentV2.js +53 -0
  68. package/dist/esm/icons/Social/Channels/FacebookCommentV2.js.map +1 -0
  69. package/dist/esm/icons/Social/Channels/FacebookV2.d.ts +6 -0
  70. package/dist/esm/icons/Social/Channels/FacebookV2.js +28 -0
  71. package/dist/esm/icons/Social/Channels/FacebookV2.js.map +1 -0
  72. package/dist/esm/icons/Social/Channels/GmailV2.d.ts +6 -0
  73. package/dist/esm/icons/Social/Channels/GmailV2.js +30 -0
  74. package/dist/esm/icons/Social/Channels/GmailV2.js.map +1 -0
  75. package/dist/esm/icons/Social/Channels/InstagramCommentV2.d.ts +6 -0
  76. package/dist/esm/icons/Social/Channels/InstagramCommentV2.js +53 -0
  77. package/dist/esm/icons/Social/Channels/InstagramCommentV2.js.map +1 -0
  78. package/dist/esm/icons/Social/Channels/InstagramV2.d.ts +6 -0
  79. package/dist/esm/icons/Social/Channels/InstagramV2.js +39 -0
  80. package/dist/esm/icons/Social/Channels/InstagramV2.js.map +1 -0
  81. package/dist/esm/icons/Social/Channels/MessengerV2.d.ts +6 -0
  82. package/dist/esm/icons/Social/Channels/MessengerV2.js +28 -0
  83. package/dist/esm/icons/Social/Channels/MessengerV2.js.map +1 -0
  84. package/dist/esm/icons/Social/Channels/PhoneV2.d.ts +6 -0
  85. package/dist/esm/icons/Social/Channels/PhoneV2.js +30 -0
  86. package/dist/esm/icons/Social/Channels/PhoneV2.js.map +1 -0
  87. package/dist/esm/icons/Social/Channels/RcsV2.d.ts +6 -0
  88. package/dist/esm/icons/Social/Channels/RcsV2.js +30 -0
  89. package/dist/esm/icons/Social/Channels/RcsV2.js.map +1 -0
  90. package/dist/esm/icons/Social/Channels/SmsV2.d.ts +6 -0
  91. package/dist/esm/icons/Social/Channels/SmsV2.js +30 -0
  92. package/dist/esm/icons/Social/Channels/SmsV2.js.map +1 -0
  93. package/dist/esm/icons/Social/Channels/TaskV2.d.ts +6 -0
  94. package/dist/esm/icons/Social/Channels/TaskV2.js +37 -0
  95. package/dist/esm/icons/Social/Channels/TaskV2.js.map +1 -0
  96. package/dist/esm/icons/Social/Channels/WebpushV2.d.ts +6 -0
  97. package/dist/esm/icons/Social/Channels/WebpushV2.js +39 -0
  98. package/dist/esm/icons/Social/Channels/WebpushV2.js.map +1 -0
  99. package/dist/esm/icons/Social/Channels/WhatsAppCallV2.d.ts +6 -0
  100. package/dist/esm/icons/Social/Channels/WhatsAppCallV2.js +46 -0
  101. package/dist/esm/icons/Social/Channels/WhatsAppCallV2.js.map +1 -0
  102. package/dist/esm/icons/Social/Channels/WhatsAppV2.d.ts +6 -0
  103. package/dist/esm/icons/Social/Channels/WhatsAppV2.js +30 -0
  104. package/dist/esm/icons/Social/Channels/WhatsAppV2.js.map +1 -0
  105. package/dist/esm/icons/Social/Channels/index.d.ts +15 -0
  106. package/dist/esm/icons/index.d.ts +25 -25
  107. package/dist/esm/icons/index.js +484 -454
  108. package/dist/esm/icons/index.js.map +1 -1
  109. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tools.js","sources":["../../../../../src/components/agent-builder/constants/tools.ts"],"sourcesContent":["import type { FunctionComponent, SVGAttributes } from 'react';\nimport type { ConfigToolKey } from '../AgentBuilder.model';\n\n/**\n * Static tool-related constants for the builder's Step 3 (tools & sub-agents):\n * the reference-picker category tabs and the per-source display labels. Kept here\n * (rather than inline in the picker / serialization utils) so the labels a user\n * sees are all in one obvious place.\n */\n\n/** A reference-picker category tab. */\nexport type Category = 'tool' | 'subagent';\n\n/** Category tabs shown at the root of the `@` reference picker. */\nexport const CATEGORIES: { key: Category; label: string }[] = [\n\t{ key: 'tool', label: 'Tools' },\n\t{ key: 'subagent', label: 'Sub-agent' },\n];\n\n/**\n * Every tool \"source\" the builder renders an icon / label / picker entry for.\n * Enum VALUES are the backend's canonical read-only `source` wire strings\n * (`app/agents/config/schema.py` → `ToolSource`, derived from `tool_key`): the\n * configurable tools are `email_handover` / `rest_api` / `slack`, every native\n * tool is `manifest`. `shopify` / `integration` are legacy bik-models sources\n * kept for back-compat (the backend now collapses natives to `manifest`).\n * Dynamic/unknown sources are looked up leniently — see `toolSourceLabel` and\n * `sourceIcon`.\n */\nexport enum ToolSource {\n\tManifest = 'manifest',\n\tShopify = 'shopify',\n\tIntegration = 'integration',\n\tRestApi = 'rest_api',\n\tEmailHandover = 'email_handover',\n\tSlack = 'slack',\n}\n\n/**\n * Display labels for the known tool sources — the CATEGORY/integration name, used\n * for the picker's source headers (drill-in groups), the empty-state source\n * buttons and the mention-chip prefix. A source is a category (\"Slack\") you drill\n * into; the specific addable action inside it (\"Send Slack message\") is\n * `TOOL_ACTION_LABELS`. Unknown sources fall back to the raw key (see\n * `toolSourceLabel`).\n */\nexport const TOOL_SOURCE_LABELS: Record<ToolSource, string> = {\n\t[ToolSource.Manifest]: 'Manifest',\n\t[ToolSource.Shopify]: 'Shopify',\n\t[ToolSource.Integration]: 'Integration',\n\t[ToolSource.RestApi]: 'Rest API',\n\t[ToolSource.EmailHandover]: 'Email',\n\t[ToolSource.Slack]: 'Slack',\n};\n\n/**\n * The addable action inside a configurable/rest source — shown as the \"add\" row\n * in the `@` picker (below any existing instances) and the empty-state button.\n * Distinct from `TOOL_SOURCE_LABELS`, which names the category the action lives in\n * (e.g. category \"Slack\" → action \"Send Slack message\").\n */\nexport const TOOL_ACTION_LABELS: Partial<Record<ToolSource, string>> = {\n\t[ToolSource.RestApi]: 'REST API',\n\t[ToolSource.EmailHandover]: 'Handover to email',\n\t[ToolSource.Slack]: 'Send Slack message',\n};\n\n/** A tool source's brand-glyph component. */\nexport type IconComp = FunctionComponent<SVGAttributes<SVGElement>>;\n\n/** Brand glyph for a tool source, with its own size so each keeps its aspect ratio. */\nexport interface SourceIcon {\n\tIcon: IconComp;\n\tw: number;\n\th: number;\n}\n\n/**\n * A built-in \"tool\" that opens a config drawer (Rest API / email handover /\n * Slack) rather than inserting a mention. Surfaced as an empty-state source\n * button in the Tools section and as a row in the `@`-picker Tools view; picking\n * it opens the drawer and never writes into the instructions text.\n */\nexport interface ToolAction {\n\tsource: ToolSource;\n\tlabel: string;\n\ticon?: SourceIcon;\n\t/** Open this tool's config drawer. */\n\tonSelect: () => void;\n}\n\n/** Sources of the built-in drawer tools, in display order. */\nexport const TOOL_ACTION_SOURCES: ToolSource[] = [\n\tToolSource.RestApi,\n\tToolSource.EmailHandover,\n\tToolSource.Slack,\n];\n\n/**\n * Drawer sources rendered by the shared dynamic panel (`ConfigToolPanel`), each\n * mapped to its backend `tool_key`. Rest API is absent — it has a bespoke panel.\n */\nexport const CONFIG_TOOL_SOURCES: Partial<Record<ToolSource, ConfigToolKey>> = {\n\t[ToolSource.EmailHandover]: 'send_email',\n\t[ToolSource.Slack]: 'send_slack_message',\n};\n"],"names":["CATEGORIES","ToolSource","TOOL_SOURCE_LABELS","TOOL_ACTION_LABELS","TOOL_ACTION_SOURCES","CONFIG_TOOL_SOURCES"],"mappings":"AAcO,MAAMA,IAAiD;AAAA,EAC7D,EAAE,KAAK,QAAQ,OAAO,QAAA;AAAA,EACtB,EAAE,KAAK,YAAY,OAAO,YAAA;AAC3B;AAYO,IAAKC,sBAAAA,OACXA,EAAA,WAAW,YACXA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,UAAU,YACVA,EAAA,gBAAgB,kBAChBA,EAAA,QAAQ,SANGA,IAAAA,KAAA,CAAA,CAAA;AAiBL,MAAMC,IAAiD;AAAA,EAC5D,UAAsB;AAAA,EACtB,SAAqB;AAAA,EACrB,aAAyB;AAAA,EACzB,UAAqB;AAAA,EACrB,gBAA2B;AAAA,EAC3B,OAAmB;AACrB,GAQaC,IAA0D;AAAA,EACrE,UAAqB;AAAA,EACrB,gBAA2B;AAAA,EAC3B,OAAmB;AACrB,GA2BaC,IAAoC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA;AACD,GAMaC,IAAkE;AAAA,EAC7E,gBAA2B;AAAA,EAC3B,OAAmB;AACrB;"}
1
+ {"version":3,"file":"tools.js","sources":["../../../../../src/components/agent-builder/constants/tools.ts"],"sourcesContent":["import type { FunctionComponent, SVGAttributes } from 'react';\n\n/**\n * Static tool-related constants for the builder's Step 3 (tools & sub-agents):\n * the reference-picker category tabs and the per-source display labels. Kept here\n * (rather than inline in the picker / serialization utils) so the labels a user\n * sees are all in one obvious place.\n */\n\n/** A reference-picker category tab. */\nexport type Category = 'tool' | 'subagent';\n\n/** Category tabs shown at the root of the `@` reference picker. */\nexport const CATEGORIES: { key: Category; label: string }[] = [\n\t{ key: 'tool', label: 'Tools' },\n\t{ key: 'subagent', label: 'Sub-agent' },\n];\n\n/**\n * Every tool \"source\" the builder renders an icon / label / picker entry for.\n * Enum VALUES are the backend's canonical read-only `source` wire strings\n * (`app/agents/config/schema.py` → `ToolSource`, derived from `tool_key`): the\n * configurable tools are `email_handover` / `rest_api` / `slack`, every native\n * tool is `manifest`. `shopify` / `integration` are legacy bik-models sources\n * kept for back-compat (the backend now collapses natives to `manifest`).\n * Dynamic/unknown sources are looked up leniently — see `toolSourceLabel` and\n * `sourceIcon`.\n */\nexport enum ToolSource {\n\tManifest = 'manifest',\n\tShopify = 'shopify',\n\tIntegration = 'integration',\n\tRestApi = 'rest_api',\n\tEmailHandover = 'email_handover',\n\tSlack = 'slack',\n}\n\n/**\n * Display labels for the known tool sources — the CATEGORY/integration name, used\n * for the picker's source headers (drill-in groups), the empty-state source\n * buttons and the mention-chip prefix. A source is a category (\"Slack\") you drill\n * into; the specific addable action inside it (\"Send Slack message\") is\n * `TOOL_ACTION_LABELS`. Unknown sources fall back to the raw key (see\n * `toolSourceLabel`).\n */\nexport const TOOL_SOURCE_LABELS: Record<ToolSource, string> = {\n\t[ToolSource.Manifest]: 'Manifest',\n\t[ToolSource.Shopify]: 'Shopify',\n\t[ToolSource.Integration]: 'Integration',\n\t[ToolSource.RestApi]: 'Rest API',\n\t[ToolSource.EmailHandover]: 'Email',\n\t[ToolSource.Slack]: 'Slack',\n};\n\n/**\n * The addable action inside a configurable/rest source — shown as the \"add\" row\n * in the `@` picker (below any existing instances) and the empty-state button.\n * Distinct from `TOOL_SOURCE_LABELS`, which names the category the action lives in\n * (e.g. category \"Slack\" → action \"Send Slack message\").\n */\nexport const TOOL_ACTION_LABELS: Partial<Record<ToolSource, string>> = {\n\t[ToolSource.RestApi]: 'REST API',\n\t[ToolSource.EmailHandover]: 'Handover to email',\n\t[ToolSource.Slack]: 'Send Slack message',\n};\n\n/** A tool source's brand-glyph component. */\nexport type IconComp = FunctionComponent<SVGAttributes<SVGElement>>;\n\n/** Brand glyph for a tool source, with its own size so each keeps its aspect ratio. */\nexport interface SourceIcon {\n\tIcon: IconComp;\n\tw: number;\n\th: number;\n}\n\n/**\n * A built-in \"tool\" that opens a config drawer (Rest API / email handover /\n * Slack) rather than inserting a mention. Surfaced as an empty-state source\n * button in the Tools section and as a row in the `@`-picker Tools view; picking\n * it opens the drawer and never writes into the instructions text.\n */\nexport interface ToolAction {\n\tsource: ToolSource;\n\tlabel: string;\n\ticon?: SourceIcon;\n\t/** Open this tool's config drawer. */\n\tonSelect: () => void;\n\t/**\n\t * Integration connection state for this source. `undefined` = no connection\n\t * gating (default). `false` = the store hasn't connected this integration →\n\t * the `@` picker shows a \"Connect\" row that calls {@link onConnect} instead of\n\t * drilling in / offering \"Create new\". `true` = connected (renders normally).\n\t * Set by the consumer via `config.integrationStatus` (today: Slack only).\n\t */\n\tconnected?: boolean;\n\t/** Open the parent's connect flow for this source (used when `connected === false`). */\n\tonConnect?: () => void;\n}\n\n/** Sources of the built-in drawer tools, in display order. */\nexport const TOOL_ACTION_SOURCES: ToolSource[] = [\n\tToolSource.RestApi,\n\tToolSource.EmailHandover,\n\tToolSource.Slack,\n];\n\n/**\n * Fixed display rank for the `@`-picker's tool-source groups (lower = higher). The\n * picker sorts its source rows by this so adding/updating a tool never reshuffles\n * them. Any source not listed here (dynamic/unknown, e.g. Integration) sorts AFTER\n * Slack, keeping its discovery order among the rest (Array.sort is stable).\n */\nexport const TOOL_SOURCE_RANK: Partial<Record<ToolSource, number>> = {\n\t[ToolSource.Manifest]: 0,\n\t[ToolSource.Shopify]: 1,\n\t[ToolSource.RestApi]: 2,\n\t[ToolSource.EmailHandover]: 3,\n\t[ToolSource.Slack]: 4,\n};\n\nconst UNRANKED_SOURCE_RANK = Object.keys(TOOL_SOURCE_RANK).length;\n\n/** Sort rank for a source string; unknown sources rank after all known ones. */\nexport const toolSourceRank = (source: string): number =>\n\tTOOL_SOURCE_RANK[source as ToolSource] ?? UNRANKED_SOURCE_RANK;\n\n/**\n * `tool_key` of a configurable shared-drawer tool (email / Slack). Lives here (not\n * in AgentBuilder.model) so this leaf constants file has no back-edge to the model\n * — the dependency stays one-way (model → constants), avoiding a circular import.\n */\nexport type ConfigToolKey = 'send_email' | 'send_slack_message';\n\n/**\n * Drawer sources rendered by the shared dynamic panel (`ConfigToolPanel`), each\n * mapped to its backend `tool_key`. Rest API is absent — it has a bespoke panel.\n */\nexport const CONFIG_TOOL_SOURCES: Partial<Record<ToolSource, ConfigToolKey>> = {\n\t[ToolSource.EmailHandover]: 'send_email',\n\t[ToolSource.Slack]: 'send_slack_message',\n};\n"],"names":["CATEGORIES","ToolSource","TOOL_SOURCE_LABELS","TOOL_ACTION_LABELS","TOOL_ACTION_SOURCES","TOOL_SOURCE_RANK","UNRANKED_SOURCE_RANK","toolSourceRank","source","CONFIG_TOOL_SOURCES"],"mappings":"AAaO,MAAMA,IAAiD;AAAA,EAC7D,EAAE,KAAK,QAAQ,OAAO,QAAA;AAAA,EACtB,EAAE,KAAK,YAAY,OAAO,YAAA;AAC3B;AAYO,IAAKC,sBAAAA,OACXA,EAAA,WAAW,YACXA,EAAA,UAAU,WACVA,EAAA,cAAc,eACdA,EAAA,UAAU,YACVA,EAAA,gBAAgB,kBAChBA,EAAA,QAAQ,SANGA,IAAAA,KAAA,CAAA,CAAA;AAiBL,MAAMC,IAAiD;AAAA,EAC5D,UAAsB;AAAA,EACtB,SAAqB;AAAA,EACrB,aAAyB;AAAA,EACzB,UAAqB;AAAA,EACrB,gBAA2B;AAAA,EAC3B,OAAmB;AACrB,GAQaC,IAA0D;AAAA,EACrE,UAAqB;AAAA,EACrB,gBAA2B;AAAA,EAC3B,OAAmB;AACrB,GAqCaC,IAAoC;AAAA,EAChD;AAAA,EACA;AAAA,EACA;AAAA;AACD,GAQaC,IAAwD;AAAA,EACnE,UAAsB;AAAA,EACtB,SAAqB;AAAA,EACrB,UAAqB;AAAA,EACrB,gBAA2B;AAAA,EAC3B,OAAmB;AACrB,GAEMC,IAAuB,OAAO,KAAKD,CAAgB,EAAE,QAG9CE,IAAiB,CAACC,MAC9BH,EAAiBG,CAAoB,KAAKF,GAa9BG,IAAkE;AAAA,EAC7E,gBAA2B;AAAA,EAC3B,OAAmB;AACrB;"}
@@ -69,6 +69,14 @@ export interface AgentBuilderContextShape {
69
69
  * `tool_key`. A present key drives its dynamic form + enables its tool action.
70
70
  */
71
71
  configToolTemplates?: Partial<Record<ConfigToolKey, ParamsBlob>>;
72
+ /**
73
+ * Per-source integration connection state (today: Slack). A source mapped to
74
+ * `false` renders a "Connect" row in the `@` picker instead of drilling in;
75
+ * `true`/absent renders normally. Fed by the consumer via `integrationStatus`.
76
+ */
77
+ integrationStatus?: Partial<Record<ToolSource, boolean>>;
78
+ /** Open the consumer's connect flow for an unconnected integration source. */
79
+ onConnectIntegration?: (source: ToolSource) => void;
72
80
  /** Host application context (e.g. MANIFEST) — drives tool-chip labelling. */
73
81
  applicationType?: ApplicationType;
74
82
  /** Resolved per-field character limits (consumer overrides merged over defaults). */
@@ -112,6 +120,8 @@ interface ProviderProps {
112
120
  availableIntents: IntentOption[];
113
121
  availableModels: ModelOption[];
114
122
  configToolTemplates?: Partial<Record<ConfigToolKey, ParamsBlob>>;
123
+ integrationStatus?: Partial<Record<ToolSource, boolean>>;
124
+ onConnectIntegration?: (source: ToolSource) => void;
115
125
  validation?: Partial<StepValidation>;
116
126
  applicationType?: ApplicationType;
117
127
  charLimits?: Partial<AgentCharLimits>;
@@ -1,15 +1,15 @@
1
- import { jsx as mt } from "react/jsx-runtime";
2
- import ft, { useState as h, useRef as u, useCallback as e, useMemo as B, useContext as pt } from "react";
3
- import { AGENT_CHAR_LIMITS as xt } from "../constants/charLimits.js";
4
- import { getStepIndex as Rt, STEP_KEYS as A } from "../constants/steps.js";
5
- const ct = ft.createContext(null), ht = () => {
6
- const t = pt(ct);
1
+ import { jsx as pt } from "react/jsx-runtime";
2
+ import xt, { useState as h, useRef as u, useCallback as e, useMemo as B, useContext as Rt } from "react";
3
+ import { AGENT_CHAR_LIMITS as Tt } from "../constants/charLimits.js";
4
+ import { getStepIndex as At, STEP_KEYS as A } from "../constants/steps.js";
5
+ const ut = xt.createContext(null), Ft = () => {
6
+ const t = Rt(ut);
7
7
  if (!t)
8
8
  throw new Error(
9
9
  "useAgentBuilderContext must be used within an AgentBuilderProvider"
10
10
  );
11
11
  return t;
12
- }, Tt = (t, r) => {
12
+ }, _t = (t, r) => {
13
13
  const m = t.trigger.mode === "custom_intent" ? (t.trigger.custom_intent ?? "").trim().length > 0 : t.trigger.intents.length > 0;
14
14
  return {
15
15
  about: t.name.trim().length > 0 && t.name.length <= r.name && t.description.length <= r.description,
@@ -19,7 +19,7 @@ const ct = ft.createContext(null), ht = () => {
19
19
  // Optional until specced further — never blocks go-live.
20
20
  handover: !0
21
21
  };
22
- }, Bt = ({
22
+ }, Pt = ({
23
23
  value: t,
24
24
  onChange: r,
25
25
  activeStep: m,
@@ -29,68 +29,70 @@ const ct = ft.createContext(null), ht = () => {
29
29
  availableIntents: P,
30
30
  availableModels: E,
31
31
  configToolTemplates: $,
32
- validation: a,
33
- applicationType: w,
34
- charLimits: H,
35
- disableStepNavigation: I = !0,
36
- onCreateSubAgent: L,
37
- onFetchSubAgent: V,
38
- onUpdateSubAgent: b,
39
- onImproveSubAgent: j,
40
- onImproveToolInstructions: q,
41
- children: it
32
+ integrationStatus: w,
33
+ onConnectIntegration: H,
34
+ validation: L,
35
+ applicationType: V,
36
+ charLimits: b,
37
+ disableStepNavigation: j = !0,
38
+ onCreateSubAgent: q,
39
+ onFetchSubAgent: y,
40
+ onUpdateSubAgent: I,
41
+ onImproveSubAgent: K,
42
+ onImproveToolInstructions: G,
43
+ children: lt
42
44
  }) => {
43
- const [ut, lt] = h("about"), x = m ?? ut, i = Rt(x), y = u(t);
44
- y.current = t;
45
- const [K, G] = h(0), _ = u({}), N = u("instructions"), U = e(
46
- (o, s) => {
47
- s ? _.current[o] = s : delete _.current[o];
45
+ const [dt, gt] = h("about"), x = m ?? dt, i = At(x), N = u(t);
46
+ N.current = t;
47
+ const [U, Y] = h(0), _ = u({}), a = u("instructions"), z = e(
48
+ (s, o) => {
49
+ o ? _.current[s] = o : delete _.current[s];
48
50
  },
49
51
  []
50
- ), Y = e((o) => {
51
- N.current = o;
52
- }, []), z = u(null), C = e((o) => {
53
- z.current = o;
54
- }, []), D = e(() => {
55
- z.current?.();
56
- }, []), J = u(
52
+ ), D = e((s) => {
53
+ a.current = s;
54
+ }, []), J = u(null), Q = e((s) => {
55
+ J.current = s;
56
+ }, []), W = e(() => {
57
+ J.current?.();
58
+ }, []), X = u(
57
59
  null
58
- ), Q = e(
59
- (o) => {
60
- J.current = o;
60
+ ), Z = e(
61
+ (s) => {
62
+ X.current = s;
61
63
  },
62
64
  []
63
- ), W = e((o) => {
64
- J.current?.(o);
65
- }, []), X = e((o, s, c) => {
66
- const g = _.current;
67
- (g[N.current] ?? g.instructions)?.(o, s, c);
68
- }, []), [Z, M] = h(null), R = u(null), k = u(0), l = e(
69
- (o) => {
70
- m === void 0 && lt(o), F?.(o);
65
+ ), k = e((s) => {
66
+ X.current?.(s);
67
+ }, []), C = e((s, o, c) => {
68
+ const d = _.current;
69
+ (d[a.current] ?? d.instructions)?.(s, o, c);
70
+ }, []), [O, M] = h(null), R = u(null), v = u(0), l = e(
71
+ (s) => {
72
+ m === void 0 && gt(s), F?.(s);
71
73
  },
72
74
  [m, F]
73
- ), O = e(() => {
74
- const o = A[Math.min(i + 1, A.length - 1)];
75
- l(o);
76
- }, [i, l]), v = e(() => {
77
- const o = A[Math.max(i - 1, 0)];
78
- l(o);
79
- }, [i, l]), tt = e(
80
- (o) => r(o),
75
+ ), tt = e(() => {
76
+ const s = A[Math.min(i + 1, A.length - 1)];
77
+ l(s);
78
+ }, [i, l]), st = e(() => {
79
+ const s = A[Math.max(i - 1, 0)];
80
+ l(s);
81
+ }, [i, l]), ot = e(
82
+ (s) => r(s),
81
83
  [r]
82
- ), ot = e(
83
- (o, s) => r({ [o]: s }),
84
+ ), nt = e(
85
+ (s, o) => r({ [s]: o }),
84
86
  [r]
85
- ), st = e(
86
- (o, s) => {
87
- const c = y.current;
88
- o === "tool" ? !((c.configTools ?? []).some((d) => d.id === s) || (c.restApiTools ?? []).some((d) => d.id === s)) && !c.tools.includes(s) && r({ tools: [...c.tools, s] }) : c.subagents.includes(s) || r({ subagents: [...c.subagents, s] });
87
+ ), et = e(
88
+ (s, o) => {
89
+ const c = N.current;
90
+ s === "tool" ? !((c.configTools ?? []).some((g) => g.id === o) || (c.restApiTools ?? []).some((g) => g.id === o)) && !c.tools.includes(o) && r({ tools: [...c.tools, o] }) : c.subagents.includes(o) || r({ subagents: [...c.subagents, o] });
89
91
  },
90
92
  [r]
91
- ), nt = e(
92
- (o, s) => {
93
- const c = o === "tool" ? `{{tool:${s}}}` : `{{subagent:${s}}}`, g = (n) => n.split(c).join("");
93
+ ), rt = e(
94
+ (s, o) => {
95
+ const c = s === "tool" ? `{{tool:${o}}}` : `{{subagent:${o}}}`, d = (n) => n.split(c).join("");
94
96
  R.current = {
95
97
  tools: t.tools,
96
98
  subagents: t.subagents,
@@ -99,54 +101,54 @@ const ct = ft.createContext(null), ht = () => {
99
101
  instructions: t.instructions,
100
102
  guardrail: t.guardrail
101
103
  };
102
- const d = {
103
- instructions: g(t.instructions),
104
- guardrail: g(t.guardrail ?? ""),
105
- ...o === "tool" ? {
104
+ const g = {
105
+ instructions: d(t.instructions),
106
+ guardrail: d(t.guardrail ?? ""),
107
+ ...s === "tool" ? {
106
108
  // A tool id may be a catalog tool OR an inline custom tool — drop
107
109
  // it from whichever list holds it (the others are no-op filters).
108
- tools: t.tools.filter((n) => n !== s),
109
- configTools: (t.configTools ?? []).filter((n) => n.id !== s),
110
+ tools: t.tools.filter((n) => n !== o),
111
+ configTools: (t.configTools ?? []).filter((n) => n.id !== o),
110
112
  restApiTools: (t.restApiTools ?? []).filter(
111
- (n) => n.id !== s
113
+ (n) => n.id !== o
112
114
  )
113
- } : { subagents: t.subagents.filter((n) => n !== s) }
115
+ } : { subagents: t.subagents.filter((n) => n !== o) }
114
116
  };
115
- r(d), G((n) => n + 1);
116
- const dt = o === "tool" ? f.find((n) => n.tool_id === s)?.display_name ?? (t.restApiTools ?? []).find((n) => n.id === s)?.name ?? "Tool" : p.find((n) => n.id === s)?.name ?? "Sub-agent";
117
- k.current += 1, M({
118
- id: k.current,
119
- message: `${o === "tool" ? "Tool" : "Sub-agent"} "${dt}" removed`
117
+ r(g), Y((n) => n + 1);
118
+ const ft = s === "tool" ? f.find((n) => n.tool_id === o)?.display_name ?? (t.restApiTools ?? []).find((n) => n.id === o)?.name ?? "Tool" : p.find((n) => n.id === o)?.name ?? "Sub-agent";
119
+ v.current += 1, M({
120
+ id: v.current,
121
+ message: `${s === "tool" ? "Tool" : "Sub-agent"} "${ft}" removed`
120
122
  });
121
123
  },
122
124
  [f, p, t, r]
123
- ), et = e(() => {
124
- R.current && (r(R.current), R.current = null, G((o) => o + 1)), M(null);
125
- }, [r]), rt = e(() => M(null), []), T = B(
126
- () => ({ ...xt, ...H }),
127
- [H]
125
+ ), ct = e(() => {
126
+ R.current && (r(R.current), R.current = null, Y((s) => s + 1)), M(null);
127
+ }, [r]), it = e(() => M(null), []), T = B(
128
+ () => ({ ...Tt, ...b }),
129
+ [b]
128
130
  ), S = B(
129
- () => ({ ...Tt(t, T), ...a }),
130
- [t, T, a]
131
- ), gt = B(
131
+ () => ({ ..._t(t, T), ...L }),
132
+ [t, T, L]
133
+ ), mt = B(
132
134
  () => ({
133
135
  value: t,
134
- patch: tt,
135
- updateField: ot,
136
- addReference: st,
137
- removeReference: nt,
138
- mentionResetKey: K,
139
- insertMention: X,
140
- registerMentionField: U,
141
- notifyMentionFocus: Y,
142
- undoToast: Z,
143
- undoRemoval: et,
144
- dismissUndo: rt,
136
+ patch: ot,
137
+ updateField: nt,
138
+ addReference: et,
139
+ removeReference: rt,
140
+ mentionResetKey: U,
141
+ insertMention: C,
142
+ registerMentionField: z,
143
+ notifyMentionFocus: D,
144
+ undoToast: O,
145
+ undoRemoval: ct,
146
+ dismissUndo: it,
145
147
  activeStep: x,
146
148
  activeIndex: i,
147
149
  goToStep: l,
148
- goNext: O,
149
- goPrev: v,
150
+ goNext: tt,
151
+ goPrev: st,
150
152
  isFirstStep: i === 0,
151
153
  isLastStep: i === A.length - 1,
152
154
  validation: S,
@@ -156,37 +158,39 @@ const ct = ft.createContext(null), ht = () => {
156
158
  availableIntents: P,
157
159
  availableModels: E,
158
160
  configToolTemplates: $,
159
- applicationType: w,
161
+ integrationStatus: w,
162
+ onConnectIntegration: H,
163
+ applicationType: V,
160
164
  charLimits: T,
161
- disableStepNavigation: I,
162
- onCreateSubAgent: L,
163
- registerSubAgentCreator: C,
164
- requestCreateSubAgent: D,
165
- registerToolActionHandler: Q,
166
- requestToolAction: W,
167
- onFetchSubAgent: V,
168
- onUpdateSubAgent: b,
169
- onImproveSubAgent: j,
170
- onImproveToolInstructions: q
165
+ disableStepNavigation: j,
166
+ onCreateSubAgent: q,
167
+ registerSubAgentCreator: Q,
168
+ requestCreateSubAgent: W,
169
+ registerToolActionHandler: Z,
170
+ requestToolAction: k,
171
+ onFetchSubAgent: y,
172
+ onUpdateSubAgent: I,
173
+ onImproveSubAgent: K,
174
+ onImproveToolInstructions: G
171
175
  }),
172
176
  [
173
177
  t,
174
- tt,
175
178
  ot,
176
- st,
177
179
  nt,
178
- K,
179
- X,
180
- U,
181
- Y,
182
- Z,
183
180
  et,
184
181
  rt,
182
+ U,
183
+ C,
184
+ z,
185
+ D,
186
+ O,
187
+ ct,
188
+ it,
185
189
  x,
186
190
  i,
187
191
  l,
188
- O,
189
- v,
192
+ tt,
193
+ st,
190
194
  S,
191
195
  f,
192
196
  p,
@@ -194,23 +198,25 @@ const ct = ft.createContext(null), ht = () => {
194
198
  E,
195
199
  $,
196
200
  w,
201
+ H,
202
+ V,
197
203
  T,
198
- I,
199
- L,
200
- C,
201
- D,
204
+ j,
205
+ q,
202
206
  Q,
203
207
  W,
204
- V,
205
- b,
206
- j,
207
- q
208
+ Z,
209
+ k,
210
+ y,
211
+ I,
212
+ K,
213
+ G
208
214
  ]
209
215
  );
210
- return /* @__PURE__ */ mt(ct.Provider, { value: gt, children: it });
216
+ return /* @__PURE__ */ pt(ut.Provider, { value: mt, children: lt });
211
217
  };
212
218
  export {
213
- Bt as AgentBuilderProvider,
214
- ht as useAgentBuilderContext
219
+ Pt as AgentBuilderProvider,
220
+ Ft as useAgentBuilderContext
215
221
  };
216
222
  //# sourceMappingURL=AgentBuilderContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgentBuilderContext.js","sources":["../../../../../src/components/agent-builder/context/AgentBuilderContext.tsx"],"sourcesContent":["import type { ApplicationType } from '@bikdotai/bik-models/growth';\nimport React, {\n\tuseCallback,\n\tuseContext,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tAgentTool,\n\tAgentValue,\n\tConfigToolKey,\n\tIntentOption,\n\tModelOption,\n\tParamsBlob,\n\tStepKey,\n\tStepValidation,\n\tSubAgentDraft,\n\tSubAgentRef,\n} from '../AgentBuilder.model';\nimport { AGENT_CHAR_LIMITS } from '../constants/charLimits';\nimport type { AgentCharLimits } from '../constants/charLimits';\nimport { getStepIndex, STEP_KEYS } from '../constants/steps';\nimport type { ToolSource } from '../constants/tools';\n\n/** Mention-capable text fields in Step 3 (both store firebase token text). */\nexport type MentionFieldKey = 'instructions' | 'guardrail';\ntype MentionInsertFn = (\n\tkind: 'tool' | 'subagent',\n\tid: string,\n\tlabel?: string,\n) => void;\n\n/** Toast shown after a tool / sub-agent is removed, offering an undo. */\nexport interface UndoToastState {\n\t/** Bumped per removal so the toast timer restarts. */\n\tid: number;\n\tmessage: string;\n}\n\nexport interface AgentBuilderContextShape {\n\t/** Controlled value relayed from props. */\n\tvalue: AgentValue;\n\t/** Patch one or more fields. */\n\tpatch: (partial: Partial<AgentValue>) => void;\n\t/** Patch a single field. */\n\tupdateField: <K extends keyof AgentValue>(key: K, val: AgentValue[K]) => void;\n\t/**\n\t * Remove a tool / sub-agent everywhere: drops it from the list AND strips ALL\n\t * its `{{tool:KEY}}` / `{{subagent:ID}}` tokens from BOTH the instructions and\n\t * the guardrails, remounts the editors, and raises an undo toast.\n\t */\n\tremoveReference: (kind: 'tool' | 'subagent', id: string) => void;\n\t/**\n\t * Append a tool / sub-agent id to its list (deduped), reading the LATEST value\n\t * via a ref. Use this instead of `patch({ tools: [...value.tools, id] })` from\n\t * any handler that may be captured with a stale `value` — notably the `@`\n\t * editor's mount-time `onSelect`, which would otherwise keep only the last pick.\n\t */\n\taddReference: (kind: 'tool' | 'subagent', id: string) => void;\n\t/** Remount signal for the mention editors after an external edit. */\n\tmentionResetKey: number;\n\t/**\n\t * Insert a tool / sub-agent mention chip at the last cursor position of\n\t * whichever mention field was focused most recently (Instructions or\n\t * Guardrails). `label` overrides the chip text (e.g. a just-created sub-agent\n\t * not yet in the available list).\n\t */\n\tinsertMention: (\n\t\tkind: 'tool' | 'subagent',\n\t\tid: string,\n\t\tlabel?: string,\n\t) => void;\n\t/** A mention field registers its editor-backed insert here (internal). */\n\tregisterMentionField: (\n\t\tfieldKey: MentionFieldKey,\n\t\tfn: MentionInsertFn | null,\n\t) => void;\n\t/** A mention field reports focus so inserts target it (internal). */\n\tnotifyMentionFocus: (fieldKey: MentionFieldKey) => void;\n\n\t// Undo (post-removal)\n\t/** Non-null while the undo toast should be visible. */\n\tundoToast: UndoToastState | null;\n\t/** Restore the last removed tool / sub-agent (list + stripped tokens). */\n\tundoRemoval: () => void;\n\t/** Dismiss the undo toast without restoring. */\n\tdismissUndo: () => void;\n\n\t// Navigation\n\tactiveStep: StepKey;\n\tactiveIndex: number;\n\tgoToStep: (step: StepKey) => void;\n\tgoNext: () => void;\n\tgoPrev: () => void;\n\tisFirstStep: boolean;\n\tisLastStep: boolean;\n\n\t// Validation\n\tvalidation: StepValidation;\n\tisActiveStepValid: boolean;\n\n\t// Reference data\n\tavailableTools: AgentTool[];\n\tavailableSubAgents: SubAgentRef[];\n\tavailableIntents: IntentOption[];\n\tavailableModels: ModelOption[];\n\t/**\n\t * Backend templates for the shared-drawer tools (email / Slack), keyed by\n\t * `tool_key`. A present key drives its dynamic form + enables its tool action.\n\t */\n\tconfigToolTemplates?: Partial<Record<ConfigToolKey, ParamsBlob>>;\n\t/** Host application context (e.g. MANIFEST) — drives tool-chip labelling. */\n\tapplicationType?: ApplicationType;\n\t/** Resolved per-field character limits (consumer overrides merged over defaults). */\n\tcharLimits: AgentCharLimits;\n\t/** When true, step-rail items are not clickable (Back / Next only). */\n\tdisableStepNavigation: boolean;\n\n\t// Sub-agent creation (Step 3 drawer)\n\t/** Persist a new sub-agent and resolve with its ref. Omit to hide the create flow. */\n\tonCreateSubAgent?: (draft: SubAgentDraft) => Promise<SubAgentRef>;\n\t/**\n\t * Step 3 registers its \"open create-sub-agent drawer\" action here so the `@`\n\t * picker's \"Create new\" row can trigger it. Pass `null` to unregister.\n\t */\n\tregisterSubAgentCreator: (fn: (() => void) | null) => void;\n\t/** Open the create-sub-agent drawer (no-op until Step 3 registers it). */\n\trequestCreateSubAgent: () => void;\n\t/**\n\t * Step 3 registers its \"open the drawer for this built-in tool action\"\n\t * (Rest API / email handover / Slack) handler here so the `@` reference picker\n\t * can trigger it. Pass `null` to unregister.\n\t */\n\tregisterToolActionHandler: (\n\t\tfn: ((source: ToolSource) => void) | null,\n\t) => void;\n\t/** Open a built-in tool action's drawer (no-op until Step 3 registers it). */\n\trequestToolAction: (source: ToolSource) => void;\n\t/** Fetch a sub-agent's editable data (Configure). Omit to hide Configure. */\n\tonFetchSubAgent?: (id: string) => Promise<SubAgentDraft>;\n\t/** Persist edits to an existing sub-agent. */\n\tonUpdateSubAgent?: (id: string, draft: SubAgentDraft) => Promise<SubAgentRef>;\n\t/** Optional \"Improve with AI\" for the drawer's instructions / guardrails. */\n\tonImproveSubAgent?: (\n\t\tkind: 'instructions' | 'guardrail',\n\t\ttext: string,\n\t) => Promise<string>;\n\t/** Optional \"Improve with AI\" for the Rest API / email-handover tool drawers. */\n\tonImproveToolInstructions?: (text: string) => Promise<string>;\n}\n\nconst AgentBuilderContext =\n\tReact.createContext<AgentBuilderContextShape | null>(null);\n\nexport const useAgentBuilderContext = (): AgentBuilderContextShape => {\n\tconst ctx = useContext(AgentBuilderContext);\n\tif (!ctx) {\n\t\tthrow new Error(\n\t\t\t'useAgentBuilderContext must be used within an AgentBuilderProvider',\n\t\t);\n\t}\n\treturn ctx;\n};\n\n/** Validity derived purely from the current value (no effects). */\nconst deriveValidation = (\n\tvalue: AgentValue,\n\tlimits: AgentCharLimits,\n): StepValidation => {\n\tconst triggerValid =\n\t\tvalue.trigger.mode === 'custom_intent'\n\t\t\t? (value.trigger.custom_intent ?? '').trim().length > 0\n\t\t\t: value.trigger.intents.length > 0;\n\n\treturn {\n\t\tabout:\n\t\t\tvalue.name.trim().length > 0 &&\n\t\t\tvalue.name.length <= limits.name &&\n\t\t\tvalue.description.length <= limits.description,\n\t\ttrigger: triggerValid,\n\t\t// At least one of Instructions / Guardrails must be filled.\n\t\tresponse:\n\t\t\tvalue.instructions.trim().length > 0 ||\n\t\t\t(value.guardrail ?? '').trim().length > 0,\n\t\t// Optional until specced further — never blocks go-live.\n\t\thandover: true,\n\t};\n};\n\ninterface ProviderProps {\n\tvalue: AgentValue;\n\tonChange: (patch: Partial<AgentValue>) => void;\n\tactiveStep?: StepKey;\n\tonStepChange?: (step: StepKey) => void;\n\tavailableTools: AgentTool[];\n\tavailableSubAgents: SubAgentRef[];\n\tavailableIntents: IntentOption[];\n\tavailableModels: ModelOption[];\n\tconfigToolTemplates?: Partial<Record<ConfigToolKey, ParamsBlob>>;\n\tvalidation?: Partial<StepValidation>;\n\tapplicationType?: ApplicationType;\n\tcharLimits?: Partial<AgentCharLimits>;\n\tdisableStepNavigation?: boolean;\n\tonCreateSubAgent?: (draft: SubAgentDraft) => Promise<SubAgentRef>;\n\tonFetchSubAgent?: (id: string) => Promise<SubAgentDraft>;\n\tonUpdateSubAgent?: (id: string, draft: SubAgentDraft) => Promise<SubAgentRef>;\n\tonImproveSubAgent?: (\n\t\tkind: 'instructions' | 'guardrail',\n\t\ttext: string,\n\t) => Promise<string>;\n\tonImproveToolInstructions?: (text: string) => Promise<string>;\n\tchildren: React.ReactNode;\n}\n\nexport const AgentBuilderProvider: React.FC<ProviderProps> = ({\n\tvalue,\n\tonChange,\n\tactiveStep: controlledStep,\n\tonStepChange,\n\tavailableTools,\n\tavailableSubAgents,\n\tavailableIntents,\n\tavailableModels,\n\tconfigToolTemplates,\n\tvalidation: validationOverride,\n\tapplicationType,\n\tcharLimits: charLimitsOverride,\n\tdisableStepNavigation = true,\n\tonCreateSubAgent,\n\tonFetchSubAgent,\n\tonUpdateSubAgent,\n\tonImproveSubAgent,\n\tonImproveToolInstructions,\n\tchildren,\n}) => {\n\tconst [internalStep, setInternalStep] = useState<StepKey>('about');\n\tconst activeStep = controlledStep ?? internalStep;\n\tconst activeIndex = getStepIndex(activeStep);\n\n\t// Latest value, so closure-captured handlers (e.g. the `@` editor's mount-time\n\t// mention onSelect) append against the current lists, not a stale snapshot.\n\tconst valueRef = useRef(value);\n\tvalueRef.current = value;\n\n\t// Bumped when a mention field is edited from OUTSIDE its editor (removing a\n\t// tool from the side list, undo), forcing the mention editors to remount.\n\tconst [mentionResetKey, setMentionResetKey] = useState(0);\n\n\t// Each mention field registers an editor-backed insert fn + reports focus, so\n\t// side-panel adds drop a chip into the last-focused field at its cursor.\n\tconst mentionInsertersRef = useRef<\n\t\tPartial<Record<MentionFieldKey, MentionInsertFn>>\n\t>({});\n\tconst lastFocusedFieldRef = useRef<MentionFieldKey>('instructions');\n\tconst registerMentionField = useCallback(\n\t\t(fieldKey: MentionFieldKey, fn: MentionInsertFn | null) => {\n\t\t\tif (fn) {\n\t\t\t\tmentionInsertersRef.current[fieldKey] = fn;\n\t\t\t} else {\n\t\t\t\tdelete mentionInsertersRef.current[fieldKey];\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\tconst notifyMentionFocus = useCallback((fieldKey: MentionFieldKey) => {\n\t\tlastFocusedFieldRef.current = fieldKey;\n\t}, []);\n\n\t// Step 3 registers its drawer opener here; the `@` picker's \"Create new\" calls it.\n\tconst subAgentCreatorRef = useRef<(() => void) | null>(null);\n\tconst registerSubAgentCreator = useCallback((fn: (() => void) | null) => {\n\t\tsubAgentCreatorRef.current = fn;\n\t}, []);\n\tconst requestCreateSubAgent = useCallback(() => {\n\t\tsubAgentCreatorRef.current?.();\n\t}, []);\n\n\t// Step 3 registers a dispatcher that opens a built-in tool action's drawer.\n\tconst toolActionHandlerRef = useRef<((source: ToolSource) => void) | null>(\n\t\tnull,\n\t);\n\tconst registerToolActionHandler = useCallback(\n\t\t(fn: ((source: ToolSource) => void) | null) => {\n\t\t\ttoolActionHandlerRef.current = fn;\n\t\t},\n\t\t[],\n\t);\n\tconst requestToolAction = useCallback((source: ToolSource) => {\n\t\ttoolActionHandlerRef.current?.(source);\n\t}, []);\n\tconst insertMention = useCallback<MentionInsertFn>((kind, id, label) => {\n\t\tconst inserters = mentionInsertersRef.current;\n\t\tconst target =\n\t\t\tinserters[lastFocusedFieldRef.current] ?? inserters.instructions;\n\t\ttarget?.(kind, id, label);\n\t}, []);\n\n\t// Undo state for the most recent removal.\n\tconst [undoToast, setUndoToast] = useState<UndoToastState | null>(null);\n\tconst undoSnapshotRef = useRef<Partial<AgentValue> | null>(null);\n\tconst undoIdRef = useRef(0);\n\n\tconst goToStep = useCallback(\n\t\t(step: StepKey) => {\n\t\t\tif (controlledStep === undefined) {\n\t\t\t\tsetInternalStep(step);\n\t\t\t}\n\t\t\tonStepChange?.(step);\n\t\t},\n\t\t[controlledStep, onStepChange],\n\t);\n\n\tconst goNext = useCallback(() => {\n\t\tconst next = STEP_KEYS[Math.min(activeIndex + 1, STEP_KEYS.length - 1)];\n\t\tgoToStep(next);\n\t}, [activeIndex, goToStep]);\n\n\tconst goPrev = useCallback(() => {\n\t\tconst prev = STEP_KEYS[Math.max(activeIndex - 1, 0)];\n\t\tgoToStep(prev);\n\t}, [activeIndex, goToStep]);\n\n\tconst patch = useCallback(\n\t\t(partial: Partial<AgentValue>) => onChange(partial),\n\t\t[onChange],\n\t);\n\n\tconst updateField = useCallback(\n\t\t<K extends keyof AgentValue>(key: K, val: AgentValue[K]) =>\n\t\t\tonChange({ [key]: val } as Partial<AgentValue>),\n\t\t[onChange],\n\t);\n\n\tconst addReference = useCallback(\n\t\t(kind: 'tool' | 'subagent', id: string) => {\n\t\t\tconst v = valueRef.current;\n\t\t\tif (kind === 'tool') {\n\t\t\t\t// Custom tools (Rest API / email / Slack) track themselves on their own\n\t\t\t\t// lists; only catalog/native ids belong in `tools`. Picking an EXISTING\n\t\t\t\t// custom tool from the `@` picker must not leak its id in here — on save\n\t\t\t\t// it becomes a bogus native ref and create-agent validation rejects it.\n\t\t\t\tconst isCustom =\n\t\t\t\t\t(v.configTools ?? []).some((t) => t.id === id) ||\n\t\t\t\t\t(v.restApiTools ?? []).some((t) => t.id === id);\n\t\t\t\tif (!isCustom && !v.tools.includes(id)) {\n\t\t\t\t\tonChange({ tools: [...v.tools, id] });\n\t\t\t\t}\n\t\t\t} else if (!v.subagents.includes(id)) {\n\t\t\t\tonChange({ subagents: [...v.subagents, id] });\n\t\t\t}\n\t\t},\n\t\t[onChange],\n\t);\n\n\tconst removeReference = useCallback(\n\t\t(kind: 'tool' | 'subagent', id: string) => {\n\t\t\t// Tokens store the id for both kinds (a tool's id is its tool_id).\n\t\t\tconst token = kind === 'tool' ? `{{tool:${id}}}` : `{{subagent:${id}}}`;\n\t\t\tconst strip = (text: string) => text.split(token).join('');\n\n\t\t\t// Snapshot every field a removal touches, for undo. Custom tools (Rest\n\t\t\t// API / email / Slack) live on their own lists, so include them too.\n\t\t\tundoSnapshotRef.current = {\n\t\t\t\ttools: value.tools,\n\t\t\t\tsubagents: value.subagents,\n\t\t\t\tconfigTools: value.configTools,\n\t\t\t\trestApiTools: value.restApiTools,\n\t\t\t\tinstructions: value.instructions,\n\t\t\t\tguardrail: value.guardrail,\n\t\t\t};\n\n\t\t\tconst next: Partial<AgentValue> = {\n\t\t\t\tinstructions: strip(value.instructions),\n\t\t\t\tguardrail: strip(value.guardrail ?? ''),\n\t\t\t\t...(kind === 'tool'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t// A tool id may be a catalog tool OR an inline custom tool — drop\n\t\t\t\t\t\t\t// it from whichever list holds it (the others are no-op filters).\n\t\t\t\t\t\t\ttools: value.tools.filter((t) => t !== id),\n\t\t\t\t\t\t\tconfigTools: (value.configTools ?? []).filter((t) => t.id !== id),\n\t\t\t\t\t\t\trestApiTools: (value.restApiTools ?? []).filter(\n\t\t\t\t\t\t\t\t(t) => t.id !== id,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t }\n\t\t\t\t\t: { subagents: value.subagents.filter((s) => s !== id) }),\n\t\t\t};\n\t\t\tonChange(next);\n\t\t\tsetMentionResetKey((k) => k + 1);\n\n\t\t\tconst label =\n\t\t\t\tkind === 'tool'\n\t\t\t\t\t? availableTools.find((t) => t.tool_id === id)?.display_name ??\n\t\t\t\t\t (value.restApiTools ?? []).find((t) => t.id === id)?.name ??\n\t\t\t\t\t 'Tool'\n\t\t\t\t\t: availableSubAgents.find((s) => s.id === id)?.name ?? 'Sub-agent';\n\t\t\tundoIdRef.current += 1;\n\t\t\tsetUndoToast({\n\t\t\t\tid: undoIdRef.current,\n\t\t\t\tmessage: `${kind === 'tool' ? 'Tool' : 'Sub-agent'} \"${label}\" removed`,\n\t\t\t});\n\t\t},\n\t\t[availableTools, availableSubAgents, value, onChange],\n\t);\n\n\tconst undoRemoval = useCallback(() => {\n\t\tif (undoSnapshotRef.current) {\n\t\t\tonChange(undoSnapshotRef.current);\n\t\t\tundoSnapshotRef.current = null;\n\t\t\tsetMentionResetKey((k) => k + 1);\n\t\t}\n\t\tsetUndoToast(null);\n\t}, [onChange]);\n\n\tconst dismissUndo = useCallback(() => setUndoToast(null), []);\n\n\t// Consumer overrides merged over the built-in defaults (name 60, rest 1000).\n\tconst charLimits = useMemo<AgentCharLimits>(\n\t\t() => ({ ...AGENT_CHAR_LIMITS, ...charLimitsOverride }),\n\t\t[charLimitsOverride],\n\t);\n\n\tconst validation: StepValidation = useMemo(\n\t\t() => ({ ...deriveValidation(value, charLimits), ...validationOverride }),\n\t\t[value, charLimits, validationOverride],\n\t);\n\n\tconst ctx = useMemo<AgentBuilderContextShape>(\n\t\t() => ({\n\t\t\tvalue,\n\t\t\tpatch,\n\t\t\tupdateField,\n\t\t\taddReference,\n\t\t\tremoveReference,\n\t\t\tmentionResetKey,\n\t\t\tinsertMention,\n\t\t\tregisterMentionField,\n\t\t\tnotifyMentionFocus,\n\t\t\tundoToast,\n\t\t\tundoRemoval,\n\t\t\tdismissUndo,\n\t\t\tactiveStep,\n\t\t\tactiveIndex,\n\t\t\tgoToStep,\n\t\t\tgoNext,\n\t\t\tgoPrev,\n\t\t\tisFirstStep: activeIndex === 0,\n\t\t\tisLastStep: activeIndex === STEP_KEYS.length - 1,\n\t\t\tvalidation,\n\t\t\tisActiveStepValid: validation[activeStep],\n\t\t\tavailableTools,\n\t\t\tavailableSubAgents,\n\t\t\tavailableIntents,\n\t\t\tavailableModels,\n\t\t\tconfigToolTemplates,\n\t\t\tapplicationType,\n\t\t\tcharLimits,\n\t\t\tdisableStepNavigation,\n\t\t\tonCreateSubAgent,\n\t\t\tregisterSubAgentCreator,\n\t\t\trequestCreateSubAgent,\n\t\t\tregisterToolActionHandler,\n\t\t\trequestToolAction,\n\t\t\tonFetchSubAgent,\n\t\t\tonUpdateSubAgent,\n\t\t\tonImproveSubAgent,\n\t\t\tonImproveToolInstructions,\n\t\t}),\n\t\t[\n\t\t\tvalue,\n\t\t\tpatch,\n\t\t\tupdateField,\n\t\t\taddReference,\n\t\t\tremoveReference,\n\t\t\tmentionResetKey,\n\t\t\tinsertMention,\n\t\t\tregisterMentionField,\n\t\t\tnotifyMentionFocus,\n\t\t\tundoToast,\n\t\t\tundoRemoval,\n\t\t\tdismissUndo,\n\t\t\tactiveStep,\n\t\t\tactiveIndex,\n\t\t\tgoToStep,\n\t\t\tgoNext,\n\t\t\tgoPrev,\n\t\t\tvalidation,\n\t\t\tavailableTools,\n\t\t\tavailableSubAgents,\n\t\t\tavailableIntents,\n\t\t\tavailableModels,\n\t\t\tconfigToolTemplates,\n\t\t\tapplicationType,\n\t\t\tcharLimits,\n\t\t\tdisableStepNavigation,\n\t\t\tonCreateSubAgent,\n\t\t\tregisterSubAgentCreator,\n\t\t\trequestCreateSubAgent,\n\t\t\tregisterToolActionHandler,\n\t\t\trequestToolAction,\n\t\t\tonFetchSubAgent,\n\t\t\tonUpdateSubAgent,\n\t\t\tonImproveSubAgent,\n\t\t\tonImproveToolInstructions,\n\t\t],\n\t);\n\n\treturn (\n\t\t<AgentBuilderContext.Provider value={ctx}>\n\t\t\t{children}\n\t\t</AgentBuilderContext.Provider>\n\t);\n};\n"],"names":["AgentBuilderContext","React","useAgentBuilderContext","ctx","useContext","deriveValidation","value","limits","triggerValid","AgentBuilderProvider","onChange","controlledStep","onStepChange","availableTools","availableSubAgents","availableIntents","availableModels","configToolTemplates","validationOverride","applicationType","charLimitsOverride","disableStepNavigation","onCreateSubAgent","onFetchSubAgent","onUpdateSubAgent","onImproveSubAgent","onImproveToolInstructions","children","internalStep","setInternalStep","useState","activeStep","activeIndex","getStepIndex","valueRef","useRef","mentionResetKey","setMentionResetKey","mentionInsertersRef","lastFocusedFieldRef","registerMentionField","useCallback","fieldKey","fn","notifyMentionFocus","subAgentCreatorRef","registerSubAgentCreator","requestCreateSubAgent","toolActionHandlerRef","registerToolActionHandler","requestToolAction","source","insertMention","kind","id","label","inserters","undoToast","setUndoToast","undoSnapshotRef","undoIdRef","goToStep","step","goNext","next","STEP_KEYS","goPrev","prev","patch","partial","updateField","key","val","addReference","v","t","removeReference","token","strip","text","s","k","undoRemoval","dismissUndo","charLimits","useMemo","AGENT_CHAR_LIMITS","validation"],"mappings":";;;;AAwJA,MAAMA,KACLC,GAAM,cAA+C,IAAI,GAE7CC,KAAyB,MAAgC;AACrE,QAAMC,IAAMC,GAAWJ,EAAmB;AAC1C,MAAI,CAACG;AACJ,UAAM,IAAI;AAAA,MACT;AAAA,IAAA;AAGF,SAAOA;AACR,GAGME,KAAmB,CACxBC,GACAC,MACoB;AACpB,QAAMC,IACLF,EAAM,QAAQ,SAAS,mBACnBA,EAAM,QAAQ,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,MACAZ;AAAA,MACAI;AAAA,MACAa;AAAA,MACAyB;AAAA,MACAC;AAAA,MACApD;AAAA,MACAC;AAAA,MACA6B;AAAA,MACAE;AAAA,MACAG;AAAA,MACAqB;AAAA,MACA1E;AAAA,MACAC;AAAA,MACAC;AAAA,MACAC;AAAA,MACAC;AAAA,MACAE;AAAA,MACAiE;AAAA,MACA/D;AAAA,MACAC;AAAA,MACAwB;AAAA,MACAC;AAAA,MACAE;AAAA,MACAC;AAAA,MACA3B;AAAA,MACAC;AAAA,MACAC;AAAA,MACAC;AAAA,IAAA;AAAA,EACD;AAGD,4BACE1B,GAAoB,UAApB,EAA6B,OAAOG,IACnC,UAAAwB,IACF;AAEF;"}
1
+ {"version":3,"file":"AgentBuilderContext.js","sources":["../../../../../src/components/agent-builder/context/AgentBuilderContext.tsx"],"sourcesContent":["import type { ApplicationType } from '@bikdotai/bik-models/growth';\nimport React, {\n\tuseCallback,\n\tuseContext,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\nimport {\n\tAgentTool,\n\tAgentValue,\n\tConfigToolKey,\n\tIntentOption,\n\tModelOption,\n\tParamsBlob,\n\tStepKey,\n\tStepValidation,\n\tSubAgentDraft,\n\tSubAgentRef,\n} from '../AgentBuilder.model';\nimport { AGENT_CHAR_LIMITS } from '../constants/charLimits';\nimport type { AgentCharLimits } from '../constants/charLimits';\nimport { getStepIndex, STEP_KEYS } from '../constants/steps';\nimport type { ToolSource } from '../constants/tools';\n\n/** Mention-capable text fields in Step 3 (both store firebase token text). */\nexport type MentionFieldKey = 'instructions' | 'guardrail';\ntype MentionInsertFn = (\n\tkind: 'tool' | 'subagent',\n\tid: string,\n\tlabel?: string,\n) => void;\n\n/** Toast shown after a tool / sub-agent is removed, offering an undo. */\nexport interface UndoToastState {\n\t/** Bumped per removal so the toast timer restarts. */\n\tid: number;\n\tmessage: string;\n}\n\nexport interface AgentBuilderContextShape {\n\t/** Controlled value relayed from props. */\n\tvalue: AgentValue;\n\t/** Patch one or more fields. */\n\tpatch: (partial: Partial<AgentValue>) => void;\n\t/** Patch a single field. */\n\tupdateField: <K extends keyof AgentValue>(key: K, val: AgentValue[K]) => void;\n\t/**\n\t * Remove a tool / sub-agent everywhere: drops it from the list AND strips ALL\n\t * its `{{tool:KEY}}` / `{{subagent:ID}}` tokens from BOTH the instructions and\n\t * the guardrails, remounts the editors, and raises an undo toast.\n\t */\n\tremoveReference: (kind: 'tool' | 'subagent', id: string) => void;\n\t/**\n\t * Append a tool / sub-agent id to its list (deduped), reading the LATEST value\n\t * via a ref. Use this instead of `patch({ tools: [...value.tools, id] })` from\n\t * any handler that may be captured with a stale `value` — notably the `@`\n\t * editor's mount-time `onSelect`, which would otherwise keep only the last pick.\n\t */\n\taddReference: (kind: 'tool' | 'subagent', id: string) => void;\n\t/** Remount signal for the mention editors after an external edit. */\n\tmentionResetKey: number;\n\t/**\n\t * Insert a tool / sub-agent mention chip at the last cursor position of\n\t * whichever mention field was focused most recently (Instructions or\n\t * Guardrails). `label` overrides the chip text (e.g. a just-created sub-agent\n\t * not yet in the available list).\n\t */\n\tinsertMention: (\n\t\tkind: 'tool' | 'subagent',\n\t\tid: string,\n\t\tlabel?: string,\n\t) => void;\n\t/** A mention field registers its editor-backed insert here (internal). */\n\tregisterMentionField: (\n\t\tfieldKey: MentionFieldKey,\n\t\tfn: MentionInsertFn | null,\n\t) => void;\n\t/** A mention field reports focus so inserts target it (internal). */\n\tnotifyMentionFocus: (fieldKey: MentionFieldKey) => void;\n\n\t// Undo (post-removal)\n\t/** Non-null while the undo toast should be visible. */\n\tundoToast: UndoToastState | null;\n\t/** Restore the last removed tool / sub-agent (list + stripped tokens). */\n\tundoRemoval: () => void;\n\t/** Dismiss the undo toast without restoring. */\n\tdismissUndo: () => void;\n\n\t// Navigation\n\tactiveStep: StepKey;\n\tactiveIndex: number;\n\tgoToStep: (step: StepKey) => void;\n\tgoNext: () => void;\n\tgoPrev: () => void;\n\tisFirstStep: boolean;\n\tisLastStep: boolean;\n\n\t// Validation\n\tvalidation: StepValidation;\n\tisActiveStepValid: boolean;\n\n\t// Reference data\n\tavailableTools: AgentTool[];\n\tavailableSubAgents: SubAgentRef[];\n\tavailableIntents: IntentOption[];\n\tavailableModels: ModelOption[];\n\t/**\n\t * Backend templates for the shared-drawer tools (email / Slack), keyed by\n\t * `tool_key`. A present key drives its dynamic form + enables its tool action.\n\t */\n\tconfigToolTemplates?: Partial<Record<ConfigToolKey, ParamsBlob>>;\n\t/**\n\t * Per-source integration connection state (today: Slack). A source mapped to\n\t * `false` renders a \"Connect\" row in the `@` picker instead of drilling in;\n\t * `true`/absent renders normally. Fed by the consumer via `integrationStatus`.\n\t */\n\tintegrationStatus?: Partial<Record<ToolSource, boolean>>;\n\t/** Open the consumer's connect flow for an unconnected integration source. */\n\tonConnectIntegration?: (source: ToolSource) => void;\n\t/** Host application context (e.g. MANIFEST) — drives tool-chip labelling. */\n\tapplicationType?: ApplicationType;\n\t/** Resolved per-field character limits (consumer overrides merged over defaults). */\n\tcharLimits: AgentCharLimits;\n\t/** When true, step-rail items are not clickable (Back / Next only). */\n\tdisableStepNavigation: boolean;\n\n\t// Sub-agent creation (Step 3 drawer)\n\t/** Persist a new sub-agent and resolve with its ref. Omit to hide the create flow. */\n\tonCreateSubAgent?: (draft: SubAgentDraft) => Promise<SubAgentRef>;\n\t/**\n\t * Step 3 registers its \"open create-sub-agent drawer\" action here so the `@`\n\t * picker's \"Create new\" row can trigger it. Pass `null` to unregister.\n\t */\n\tregisterSubAgentCreator: (fn: (() => void) | null) => void;\n\t/** Open the create-sub-agent drawer (no-op until Step 3 registers it). */\n\trequestCreateSubAgent: () => void;\n\t/**\n\t * Step 3 registers its \"open the drawer for this built-in tool action\"\n\t * (Rest API / email handover / Slack) handler here so the `@` reference picker\n\t * can trigger it. Pass `null` to unregister.\n\t */\n\tregisterToolActionHandler: (\n\t\tfn: ((source: ToolSource) => void) | null,\n\t) => void;\n\t/** Open a built-in tool action's drawer (no-op until Step 3 registers it). */\n\trequestToolAction: (source: ToolSource) => void;\n\t/** Fetch a sub-agent's editable data (Configure). Omit to hide Configure. */\n\tonFetchSubAgent?: (id: string) => Promise<SubAgentDraft>;\n\t/** Persist edits to an existing sub-agent. */\n\tonUpdateSubAgent?: (id: string, draft: SubAgentDraft) => Promise<SubAgentRef>;\n\t/** Optional \"Improve with AI\" for the drawer's instructions / guardrails. */\n\tonImproveSubAgent?: (\n\t\tkind: 'instructions' | 'guardrail',\n\t\ttext: string,\n\t) => Promise<string>;\n\t/** Optional \"Improve with AI\" for the Rest API / email-handover tool drawers. */\n\tonImproveToolInstructions?: (text: string) => Promise<string>;\n}\n\nconst AgentBuilderContext =\n\tReact.createContext<AgentBuilderContextShape | null>(null);\n\nexport const useAgentBuilderContext = (): AgentBuilderContextShape => {\n\tconst ctx = useContext(AgentBuilderContext);\n\tif (!ctx) {\n\t\tthrow new Error(\n\t\t\t'useAgentBuilderContext must be used within an AgentBuilderProvider',\n\t\t);\n\t}\n\treturn ctx;\n};\n\n/** Validity derived purely from the current value (no effects). */\nconst deriveValidation = (\n\tvalue: AgentValue,\n\tlimits: AgentCharLimits,\n): StepValidation => {\n\tconst triggerValid =\n\t\tvalue.trigger.mode === 'custom_intent'\n\t\t\t? (value.trigger.custom_intent ?? '').trim().length > 0\n\t\t\t: value.trigger.intents.length > 0;\n\n\treturn {\n\t\tabout:\n\t\t\tvalue.name.trim().length > 0 &&\n\t\t\tvalue.name.length <= limits.name &&\n\t\t\tvalue.description.length <= limits.description,\n\t\ttrigger: triggerValid,\n\t\t// At least one of Instructions / Guardrails must be filled.\n\t\tresponse:\n\t\t\tvalue.instructions.trim().length > 0 ||\n\t\t\t(value.guardrail ?? '').trim().length > 0,\n\t\t// Optional until specced further — never blocks go-live.\n\t\thandover: true,\n\t};\n};\n\ninterface ProviderProps {\n\tvalue: AgentValue;\n\tonChange: (patch: Partial<AgentValue>) => void;\n\tactiveStep?: StepKey;\n\tonStepChange?: (step: StepKey) => void;\n\tavailableTools: AgentTool[];\n\tavailableSubAgents: SubAgentRef[];\n\tavailableIntents: IntentOption[];\n\tavailableModels: ModelOption[];\n\tconfigToolTemplates?: Partial<Record<ConfigToolKey, ParamsBlob>>;\n\tintegrationStatus?: Partial<Record<ToolSource, boolean>>;\n\tonConnectIntegration?: (source: ToolSource) => void;\n\tvalidation?: Partial<StepValidation>;\n\tapplicationType?: ApplicationType;\n\tcharLimits?: Partial<AgentCharLimits>;\n\tdisableStepNavigation?: boolean;\n\tonCreateSubAgent?: (draft: SubAgentDraft) => Promise<SubAgentRef>;\n\tonFetchSubAgent?: (id: string) => Promise<SubAgentDraft>;\n\tonUpdateSubAgent?: (id: string, draft: SubAgentDraft) => Promise<SubAgentRef>;\n\tonImproveSubAgent?: (\n\t\tkind: 'instructions' | 'guardrail',\n\t\ttext: string,\n\t) => Promise<string>;\n\tonImproveToolInstructions?: (text: string) => Promise<string>;\n\tchildren: React.ReactNode;\n}\n\nexport const AgentBuilderProvider: React.FC<ProviderProps> = ({\n\tvalue,\n\tonChange,\n\tactiveStep: controlledStep,\n\tonStepChange,\n\tavailableTools,\n\tavailableSubAgents,\n\tavailableIntents,\n\tavailableModels,\n\tconfigToolTemplates,\n\tintegrationStatus,\n\tonConnectIntegration,\n\tvalidation: validationOverride,\n\tapplicationType,\n\tcharLimits: charLimitsOverride,\n\tdisableStepNavigation = true,\n\tonCreateSubAgent,\n\tonFetchSubAgent,\n\tonUpdateSubAgent,\n\tonImproveSubAgent,\n\tonImproveToolInstructions,\n\tchildren,\n}) => {\n\tconst [internalStep, setInternalStep] = useState<StepKey>('about');\n\tconst activeStep = controlledStep ?? internalStep;\n\tconst activeIndex = getStepIndex(activeStep);\n\n\t// Latest value, so closure-captured handlers (e.g. the `@` editor's mount-time\n\t// mention onSelect) append against the current lists, not a stale snapshot.\n\tconst valueRef = useRef(value);\n\tvalueRef.current = value;\n\n\t// Bumped when a mention field is edited from OUTSIDE its editor (removing a\n\t// tool from the side list, undo), forcing the mention editors to remount.\n\tconst [mentionResetKey, setMentionResetKey] = useState(0);\n\n\t// Each mention field registers an editor-backed insert fn + reports focus, so\n\t// side-panel adds drop a chip into the last-focused field at its cursor.\n\tconst mentionInsertersRef = useRef<\n\t\tPartial<Record<MentionFieldKey, MentionInsertFn>>\n\t>({});\n\tconst lastFocusedFieldRef = useRef<MentionFieldKey>('instructions');\n\tconst registerMentionField = useCallback(\n\t\t(fieldKey: MentionFieldKey, fn: MentionInsertFn | null) => {\n\t\t\tif (fn) {\n\t\t\t\tmentionInsertersRef.current[fieldKey] = fn;\n\t\t\t} else {\n\t\t\t\tdelete mentionInsertersRef.current[fieldKey];\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\tconst notifyMentionFocus = useCallback((fieldKey: MentionFieldKey) => {\n\t\tlastFocusedFieldRef.current = fieldKey;\n\t}, []);\n\n\t// Step 3 registers its drawer opener here; the `@` picker's \"Create new\" calls it.\n\tconst subAgentCreatorRef = useRef<(() => void) | null>(null);\n\tconst registerSubAgentCreator = useCallback((fn: (() => void) | null) => {\n\t\tsubAgentCreatorRef.current = fn;\n\t}, []);\n\tconst requestCreateSubAgent = useCallback(() => {\n\t\tsubAgentCreatorRef.current?.();\n\t}, []);\n\n\t// Step 3 registers a dispatcher that opens a built-in tool action's drawer.\n\tconst toolActionHandlerRef = useRef<((source: ToolSource) => void) | null>(\n\t\tnull,\n\t);\n\tconst registerToolActionHandler = useCallback(\n\t\t(fn: ((source: ToolSource) => void) | null) => {\n\t\t\ttoolActionHandlerRef.current = fn;\n\t\t},\n\t\t[],\n\t);\n\tconst requestToolAction = useCallback((source: ToolSource) => {\n\t\ttoolActionHandlerRef.current?.(source);\n\t}, []);\n\tconst insertMention = useCallback<MentionInsertFn>((kind, id, label) => {\n\t\tconst inserters = mentionInsertersRef.current;\n\t\tconst target =\n\t\t\tinserters[lastFocusedFieldRef.current] ?? inserters.instructions;\n\t\ttarget?.(kind, id, label);\n\t}, []);\n\n\t// Undo state for the most recent removal.\n\tconst [undoToast, setUndoToast] = useState<UndoToastState | null>(null);\n\tconst undoSnapshotRef = useRef<Partial<AgentValue> | null>(null);\n\tconst undoIdRef = useRef(0);\n\n\tconst goToStep = useCallback(\n\t\t(step: StepKey) => {\n\t\t\tif (controlledStep === undefined) {\n\t\t\t\tsetInternalStep(step);\n\t\t\t}\n\t\t\tonStepChange?.(step);\n\t\t},\n\t\t[controlledStep, onStepChange],\n\t);\n\n\tconst goNext = useCallback(() => {\n\t\tconst next = STEP_KEYS[Math.min(activeIndex + 1, STEP_KEYS.length - 1)];\n\t\tgoToStep(next);\n\t}, [activeIndex, goToStep]);\n\n\tconst goPrev = useCallback(() => {\n\t\tconst prev = STEP_KEYS[Math.max(activeIndex - 1, 0)];\n\t\tgoToStep(prev);\n\t}, [activeIndex, goToStep]);\n\n\tconst patch = useCallback(\n\t\t(partial: Partial<AgentValue>) => onChange(partial),\n\t\t[onChange],\n\t);\n\n\tconst updateField = useCallback(\n\t\t<K extends keyof AgentValue>(key: K, val: AgentValue[K]) =>\n\t\t\tonChange({ [key]: val } as Partial<AgentValue>),\n\t\t[onChange],\n\t);\n\n\tconst addReference = useCallback(\n\t\t(kind: 'tool' | 'subagent', id: string) => {\n\t\t\tconst v = valueRef.current;\n\t\t\tif (kind === 'tool') {\n\t\t\t\t// Custom tools (Rest API / email / Slack) track themselves on their own\n\t\t\t\t// lists; only catalog/native ids belong in `tools`. Picking an EXISTING\n\t\t\t\t// custom tool from the `@` picker must not leak its id in here — on save\n\t\t\t\t// it becomes a bogus native ref and create-agent validation rejects it.\n\t\t\t\tconst isCustom =\n\t\t\t\t\t(v.configTools ?? []).some((t) => t.id === id) ||\n\t\t\t\t\t(v.restApiTools ?? []).some((t) => t.id === id);\n\t\t\t\tif (!isCustom && !v.tools.includes(id)) {\n\t\t\t\t\tonChange({ tools: [...v.tools, id] });\n\t\t\t\t}\n\t\t\t} else if (!v.subagents.includes(id)) {\n\t\t\t\tonChange({ subagents: [...v.subagents, id] });\n\t\t\t}\n\t\t},\n\t\t[onChange],\n\t);\n\n\tconst removeReference = useCallback(\n\t\t(kind: 'tool' | 'subagent', id: string) => {\n\t\t\t// Tokens store the id for both kinds (a tool's id is its tool_id).\n\t\t\tconst token = kind === 'tool' ? `{{tool:${id}}}` : `{{subagent:${id}}}`;\n\t\t\tconst strip = (text: string) => text.split(token).join('');\n\n\t\t\t// Snapshot every field a removal touches, for undo. Custom tools (Rest\n\t\t\t// API / email / Slack) live on their own lists, so include them too.\n\t\t\tundoSnapshotRef.current = {\n\t\t\t\ttools: value.tools,\n\t\t\t\tsubagents: value.subagents,\n\t\t\t\tconfigTools: value.configTools,\n\t\t\t\trestApiTools: value.restApiTools,\n\t\t\t\tinstructions: value.instructions,\n\t\t\t\tguardrail: value.guardrail,\n\t\t\t};\n\n\t\t\tconst next: Partial<AgentValue> = {\n\t\t\t\tinstructions: strip(value.instructions),\n\t\t\t\tguardrail: strip(value.guardrail ?? ''),\n\t\t\t\t...(kind === 'tool'\n\t\t\t\t\t? {\n\t\t\t\t\t\t\t// A tool id may be a catalog tool OR an inline custom tool — drop\n\t\t\t\t\t\t\t// it from whichever list holds it (the others are no-op filters).\n\t\t\t\t\t\t\ttools: value.tools.filter((t) => t !== id),\n\t\t\t\t\t\t\tconfigTools: (value.configTools ?? []).filter((t) => t.id !== id),\n\t\t\t\t\t\t\trestApiTools: (value.restApiTools ?? []).filter(\n\t\t\t\t\t\t\t\t(t) => t.id !== id,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t }\n\t\t\t\t\t: { subagents: value.subagents.filter((s) => s !== id) }),\n\t\t\t};\n\t\t\tonChange(next);\n\t\t\tsetMentionResetKey((k) => k + 1);\n\n\t\t\tconst label =\n\t\t\t\tkind === 'tool'\n\t\t\t\t\t? availableTools.find((t) => t.tool_id === id)?.display_name ??\n\t\t\t\t\t (value.restApiTools ?? []).find((t) => t.id === id)?.name ??\n\t\t\t\t\t 'Tool'\n\t\t\t\t\t: availableSubAgents.find((s) => s.id === id)?.name ?? 'Sub-agent';\n\t\t\tundoIdRef.current += 1;\n\t\t\tsetUndoToast({\n\t\t\t\tid: undoIdRef.current,\n\t\t\t\tmessage: `${kind === 'tool' ? 'Tool' : 'Sub-agent'} \"${label}\" removed`,\n\t\t\t});\n\t\t},\n\t\t[availableTools, availableSubAgents, value, onChange],\n\t);\n\n\tconst undoRemoval = useCallback(() => {\n\t\tif (undoSnapshotRef.current) {\n\t\t\tonChange(undoSnapshotRef.current);\n\t\t\tundoSnapshotRef.current = null;\n\t\t\tsetMentionResetKey((k) => k + 1);\n\t\t}\n\t\tsetUndoToast(null);\n\t}, [onChange]);\n\n\tconst dismissUndo = useCallback(() => setUndoToast(null), []);\n\n\t// Consumer overrides merged over the built-in defaults (name 60, rest 1000).\n\tconst charLimits = useMemo<AgentCharLimits>(\n\t\t() => ({ ...AGENT_CHAR_LIMITS, ...charLimitsOverride }),\n\t\t[charLimitsOverride],\n\t);\n\n\tconst validation: StepValidation = useMemo(\n\t\t() => ({ ...deriveValidation(value, charLimits), ...validationOverride }),\n\t\t[value, charLimits, validationOverride],\n\t);\n\n\tconst ctx = useMemo<AgentBuilderContextShape>(\n\t\t() => ({\n\t\t\tvalue,\n\t\t\tpatch,\n\t\t\tupdateField,\n\t\t\taddReference,\n\t\t\tremoveReference,\n\t\t\tmentionResetKey,\n\t\t\tinsertMention,\n\t\t\tregisterMentionField,\n\t\t\tnotifyMentionFocus,\n\t\t\tundoToast,\n\t\t\tundoRemoval,\n\t\t\tdismissUndo,\n\t\t\tactiveStep,\n\t\t\tactiveIndex,\n\t\t\tgoToStep,\n\t\t\tgoNext,\n\t\t\tgoPrev,\n\t\t\tisFirstStep: activeIndex === 0,\n\t\t\tisLastStep: activeIndex === STEP_KEYS.length - 1,\n\t\t\tvalidation,\n\t\t\tisActiveStepValid: validation[activeStep],\n\t\t\tavailableTools,\n\t\t\tavailableSubAgents,\n\t\t\tavailableIntents,\n\t\t\tavailableModels,\n\t\t\tconfigToolTemplates,\n\t\t\tintegrationStatus,\n\t\t\tonConnectIntegration,\n\t\t\tapplicationType,\n\t\t\tcharLimits,\n\t\t\tdisableStepNavigation,\n\t\t\tonCreateSubAgent,\n\t\t\tregisterSubAgentCreator,\n\t\t\trequestCreateSubAgent,\n\t\t\tregisterToolActionHandler,\n\t\t\trequestToolAction,\n\t\t\tonFetchSubAgent,\n\t\t\tonUpdateSubAgent,\n\t\t\tonImproveSubAgent,\n\t\t\tonImproveToolInstructions,\n\t\t}),\n\t\t[\n\t\t\tvalue,\n\t\t\tpatch,\n\t\t\tupdateField,\n\t\t\taddReference,\n\t\t\tremoveReference,\n\t\t\tmentionResetKey,\n\t\t\tinsertMention,\n\t\t\tregisterMentionField,\n\t\t\tnotifyMentionFocus,\n\t\t\tundoToast,\n\t\t\tundoRemoval,\n\t\t\tdismissUndo,\n\t\t\tactiveStep,\n\t\t\tactiveIndex,\n\t\t\tgoToStep,\n\t\t\tgoNext,\n\t\t\tgoPrev,\n\t\t\tvalidation,\n\t\t\tavailableTools,\n\t\t\tavailableSubAgents,\n\t\t\tavailableIntents,\n\t\t\tavailableModels,\n\t\t\tconfigToolTemplates,\n\t\t\tintegrationStatus,\n\t\t\tonConnectIntegration,\n\t\t\tapplicationType,\n\t\t\tcharLimits,\n\t\t\tdisableStepNavigation,\n\t\t\tonCreateSubAgent,\n\t\t\tregisterSubAgentCreator,\n\t\t\trequestCreateSubAgent,\n\t\t\tregisterToolActionHandler,\n\t\t\trequestToolAction,\n\t\t\tonFetchSubAgent,\n\t\t\tonUpdateSubAgent,\n\t\t\tonImproveSubAgent,\n\t\t\tonImproveToolInstructions,\n\t\t],\n\t);\n\n\treturn (\n\t\t<AgentBuilderContext.Provider value={ctx}>\n\t\t\t{children}\n\t\t</AgentBuilderContext.Provider>\n\t);\n};\n"],"names":["AgentBuilderContext","React","useAgentBuilderContext","ctx","useContext","deriveValidation","value","limits","triggerValid","AgentBuilderProvider","onChange","controlledStep","onStepChange","availableTools","availableSubAgents","availableIntents","availableModels","configToolTemplates","integrationStatus","onConnectIntegration","validationOverride","applicationType","charLimitsOverride","disableStepNavigation","onCreateSubAgent","onFetchSubAgent","onUpdateSubAgent","onImproveSubAgent","onImproveToolInstructions","children","internalStep","setInternalStep","useState","activeStep","activeIndex","getStepIndex","valueRef","useRef","mentionResetKey","setMentionResetKey","mentionInsertersRef","lastFocusedFieldRef","registerMentionField","useCallback","fieldKey","fn","notifyMentionFocus","subAgentCreatorRef","registerSubAgentCreator","requestCreateSubAgent","toolActionHandlerRef","registerToolActionHandler","requestToolAction","source","insertMention","kind","id","label","inserters","undoToast","setUndoToast","undoSnapshotRef","undoIdRef","goToStep","step","goNext","next","STEP_KEYS","goPrev","prev","patch","partial","updateField","key","val","addReference","v","t","removeReference","token","strip","text","s","k","undoRemoval","dismissUndo","charLimits","useMemo","AGENT_CHAR_LIMITS","validation"],"mappings":";;;;AAgKA,MAAMA,KACLC,GAAM,cAA+C,IAAI,GAE7CC,KAAyB,MAAgC;AACrE,QAAMC,IAAMC,GAAWJ,EAAmB;AAC1C,MAAI,CAACG;AACJ,UAAM,IAAI;AAAA,MACT;AAAA,IAAA;AAGF,SAAOA;AACR,GAGME,KAAmB,CACxBC,GACAC,MACoB;AACpB,QAAMC,IACLF,EAAM,QAAQ,SAAS,mBACnBA,EAAM,QAAQ,iBAAiB,IAAI,KAAA,EAAO,SAAS,IACpDA,EAAM,QAAQ,QAAQ,SAAS;AAEnC,SAAO;AAAA,IACN,OACCA,EAAM,KAAK,KAAA,EAAO,SAAS,KAC3BA,EAAM,KAAK,UAAUC,EAAO,QAC5BD,EAAM,YAAY,UAAUC,EAAO;AAAA,IACpC,SAASC;AAAA;AAAA,IAET,UACCF,EAAM,aAAa,KAAA,EAAO,SAAS,MAClCA,EAAM,aAAa,IAAI,KAAA,EAAO,SAAS;AAAA;AAAA,IAEzC,UAAU;AAAA,EAAA;AAEZ,GA6BaG,KAAgD,CAAC;AAAA,EAC7D,OAAAH;AAAA,EACA,UAAAI;AAAA,EACA,YAAYC;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A,MACAC;AAAA,IAAA;AAAA,EACD;AAGD,4BACE5B,GAAoB,UAApB,EAA6B,OAAOG,IACnC,UAAA0B,IACF;AAEF;"}
@@ -8,4 +8,4 @@ import { ToolAction, ToolSource } from '../constants/tools';
8
8
  * `TOOL_ACTION_LABELS`. Consumers pass only how to open the drawer (`onSelect`) so
9
9
  * every surface renders identical actions/labels.
10
10
  */
11
- export declare const buildToolActions: (configToolTemplates: Partial<Record<ConfigToolKey, ParamsBlob>> | undefined, onSelect: (source: ToolSource) => void) => ToolAction[];
11
+ export declare const buildToolActions: (configToolTemplates: Partial<Record<ConfigToolKey, ParamsBlob>> | undefined, onSelect: (source: ToolSource) => void, integrationStatus?: Partial<Record<ToolSource, boolean>>, onConnect?: ((source: ToolSource) => void) | undefined) => ToolAction[];
@@ -1,15 +1,19 @@
1
- import { TOOL_ACTION_SOURCES as _, TOOL_ACTION_LABELS as l, TOOL_SOURCE_LABELS as C, CONFIG_TOOL_SOURCES as L } from "../constants/tools.js";
2
- import { SOURCE_ICONS as n } from "./sourceIcons.js";
3
- const E = (t, S) => _.filter((O) => {
4
- const o = L[O];
5
- return !o || !!t?.[o];
1
+ import { TOOL_ACTION_SOURCES as _, TOOL_ACTION_LABELS as l, TOOL_SOURCE_LABELS as L, CONFIG_TOOL_SOURCES as T } from "../constants/tools.js";
2
+ import { SOURCE_ICONS as i } from "./sourceIcons.js";
3
+ const m = (n, t, S, C) => _.filter((O) => {
4
+ const o = T[O];
5
+ return !o || !!n?.[o];
6
6
  }).map((O) => ({
7
7
  source: O,
8
- label: l[O] ?? C[O],
9
- icon: n[O],
10
- onSelect: () => S(O)
8
+ label: l[O] ?? L[O],
9
+ icon: i[O],
10
+ onSelect: () => t(O),
11
+ // `undefined` unless the consumer reports this source's connection state,
12
+ // in which case `false` makes the picker render a "Connect" row.
13
+ connected: S?.[O],
14
+ onConnect: () => C?.(O)
11
15
  }));
12
16
  export {
13
- E as buildToolActions
17
+ m as buildToolActions
14
18
  };
15
19
  //# sourceMappingURL=toolActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toolActions.js","sources":["../../../../../src/components/agent-builder/utils/toolActions.ts"],"sourcesContent":["import { ConfigToolKey, ParamsBlob } from '../AgentBuilder.model';\nimport {\n\tCONFIG_TOOL_SOURCES,\n\tTOOL_ACTION_LABELS,\n\tTOOL_ACTION_SOURCES,\n\tTOOL_SOURCE_LABELS,\n\tToolAction,\n\tToolSource,\n} from '../constants/tools';\nimport { SOURCE_ICONS } from './sourceIcons';\n\n/**\n * Single source of truth for the built-in tool \"action\" list (Rest API / email /\n * Slack) shown in the `@` picker AND the Step-3 / sub-agent Tools panel. A config\n * tool (email / Slack) is offered only when its backend template was provided.\n * The category name comes from `TOOL_SOURCE_LABELS`; the addable-action name from\n * `TOOL_ACTION_LABELS`. Consumers pass only how to open the drawer (`onSelect`) so\n * every surface renders identical actions/labels.\n */\nexport const buildToolActions = (\n\tconfigToolTemplates: Partial<Record<ConfigToolKey, ParamsBlob>> | undefined,\n\tonSelect: (source: ToolSource) => void,\n): ToolAction[] =>\n\tTOOL_ACTION_SOURCES.filter((source) => {\n\t\tconst toolKey = CONFIG_TOOL_SOURCES[source];\n\t\treturn !toolKey || Boolean(configToolTemplates?.[toolKey]);\n\t}).map((source) => ({\n\t\tsource,\n\t\tlabel: TOOL_ACTION_LABELS[source] ?? TOOL_SOURCE_LABELS[source],\n\t\ticon: SOURCE_ICONS[source],\n\t\tonSelect: () => onSelect(source),\n\t}));\n"],"names":["buildToolActions","configToolTemplates","onSelect","TOOL_ACTION_SOURCES","source","toolKey","CONFIG_TOOL_SOURCES","TOOL_ACTION_LABELS","TOOL_SOURCE_LABELS","SOURCE_ICONS"],"mappings":";;AAmBO,MAAMA,IAAmB,CAC/BC,GACAC,MAEAC,EAAoB,OAAO,CAACC,MAAW;AACtC,QAAMC,IAAUC,EAAoBF,CAAM;AAC1C,SAAO,CAACC,KAAW,EAAQJ,IAAsBI,CAAO;AACzD,CAAC,EAAE,IAAI,CAACD,OAAY;AAAA,EACnB,QAAAA;AAAA,EACA,OAAOG,EAAmBH,CAAM,KAAKI,EAAmBJ,CAAM;AAAA,EAC9D,MAAMK,EAAaL,CAAM;AAAA,EACzB,UAAU,MAAMF,EAASE,CAAM;AAChC,EAAE;"}
1
+ {"version":3,"file":"toolActions.js","sources":["../../../../../src/components/agent-builder/utils/toolActions.ts"],"sourcesContent":["import { ConfigToolKey, ParamsBlob } from '../AgentBuilder.model';\nimport {\n\tCONFIG_TOOL_SOURCES,\n\tTOOL_ACTION_LABELS,\n\tTOOL_ACTION_SOURCES,\n\tTOOL_SOURCE_LABELS,\n\tToolAction,\n\tToolSource,\n} from '../constants/tools';\nimport { SOURCE_ICONS } from './sourceIcons';\n\n/**\n * Single source of truth for the built-in tool \"action\" list (Rest API / email /\n * Slack) shown in the `@` picker AND the Step-3 / sub-agent Tools panel. A config\n * tool (email / Slack) is offered only when its backend template was provided.\n * The category name comes from `TOOL_SOURCE_LABELS`; the addable-action name from\n * `TOOL_ACTION_LABELS`. Consumers pass only how to open the drawer (`onSelect`) so\n * every surface renders identical actions/labels.\n */\nexport const buildToolActions = (\n\tconfigToolTemplates: Partial<Record<ConfigToolKey, ParamsBlob>> | undefined,\n\tonSelect: (source: ToolSource) => void,\n\tintegrationStatus?: Partial<Record<ToolSource, boolean>>,\n\tonConnect?: (source: ToolSource) => void,\n): ToolAction[] =>\n\tTOOL_ACTION_SOURCES.filter((source) => {\n\t\tconst toolKey = CONFIG_TOOL_SOURCES[source];\n\t\treturn !toolKey || Boolean(configToolTemplates?.[toolKey]);\n\t}).map((source) => ({\n\t\tsource,\n\t\tlabel: TOOL_ACTION_LABELS[source] ?? TOOL_SOURCE_LABELS[source],\n\t\ticon: SOURCE_ICONS[source],\n\t\tonSelect: () => onSelect(source),\n\t\t// `undefined` unless the consumer reports this source's connection state,\n\t\t// in which case `false` makes the picker render a \"Connect\" row.\n\t\tconnected: integrationStatus?.[source],\n\t\tonConnect: () => onConnect?.(source),\n\t}));\n"],"names":["buildToolActions","configToolTemplates","onSelect","integrationStatus","onConnect","TOOL_ACTION_SOURCES","source","toolKey","CONFIG_TOOL_SOURCES","TOOL_ACTION_LABELS","TOOL_SOURCE_LABELS","SOURCE_ICONS"],"mappings":";;AAmBO,MAAMA,IAAmB,CAC/BC,GACAC,GACAC,GACAC,MAEAC,EAAoB,OAAO,CAACC,MAAW;AACtC,QAAMC,IAAUC,EAAoBF,CAAM;AAC1C,SAAO,CAACC,KAAW,EAAQN,IAAsBM,CAAO;AACzD,CAAC,EAAE,IAAI,CAACD,OAAY;AAAA,EACnB,QAAAA;AAAA,EACA,OAAOG,EAAmBH,CAAM,KAAKI,EAAmBJ,CAAM;AAAA,EAC9D,MAAMK,EAAaL,CAAM;AAAA,EACzB,UAAU,MAAMJ,EAASI,CAAM;AAAA;AAAA;AAAA,EAG/B,WAAWH,IAAoBG,CAAM;AAAA,EACrC,WAAW,MAAMF,IAAYE,CAAM;AACpC,EAAE;"}
@@ -0,0 +1,6 @@
1
+ import { SVGProps } from 'react';
2
+ interface Props extends SVGProps<SVGSVGElement> {
3
+ size?: number | string;
4
+ }
5
+ declare const SvgEmailMarketingV2: ({ size, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default SvgEmailMarketingV2;
@@ -0,0 +1,41 @@
1
+ import { jsxs as d, jsx as L } from "react/jsx-runtime";
2
+ const o = ({ size: C = 24, ...l }) => {
3
+ const e = {
4
+ width: C,
5
+ height: C,
6
+ ...l
7
+ };
8
+ return /* @__PURE__ */ d(
9
+ "svg",
10
+ {
11
+ viewBox: "0 0 24 24",
12
+ fill: "none",
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ ...e,
15
+ children: [
16
+ /* @__PURE__ */ L(
17
+ "path",
18
+ {
19
+ fillRule: "evenodd",
20
+ clipRule: "evenodd",
21
+ d: "M19.5938 11.2041C19.74 11.2232 19.8781 11.2833 19.9912 11.3779C20.1043 11.4725 20.1878 11.5978 20.2324 11.7383L22.5693 19.1309C22.6138 19.2716 22.6172 19.4228 22.5791 19.5654C22.5409 19.7079 22.4632 19.8368 22.3545 19.9365C22.2457 20.0363 22.1102 20.1022 21.9648 20.1279C21.8197 20.1535 21.6704 20.1374 21.5342 20.0811C19.3264 19.169 17.3805 19.3225 16.5713 19.4492L17.0352 20.915C17.0738 21.0368 17.081 21.1665 17.0576 21.292C17.0342 21.4175 16.9803 21.5352 16.9004 21.6348L16.499 22.1338C16.4215 22.2304 16.3222 22.3072 16.209 22.3574C16.0958 22.4077 15.9723 22.4302 15.8486 22.4229C15.725 22.4155 15.6045 22.3787 15.498 22.3154C15.3917 22.2522 15.3018 22.1645 15.2363 22.0596L14.0449 20.1816C13.461 20.2903 12.8575 20.1716 12.3584 19.8496C11.8593 19.5275 11.502 19.0261 11.3604 18.4492C11.2188 17.8724 11.3035 17.2627 11.5967 16.7461C11.8899 16.2297 12.3698 15.845 12.9375 15.6709L14.7764 15.0898C14.9083 15.0395 17.1993 14.1339 18.8389 11.5576C18.918 11.4331 19.0314 11.333 19.165 11.2705C19.2987 11.208 19.4475 11.185 19.5938 11.2041ZM14.8203 19.9551L15.8926 21.6426L15.8945 21.6484L16.2959 21.1484L15.8184 19.6396L14.8203 19.9551ZM13.1719 16.4102C12.7797 16.5341 12.4523 16.8089 12.2627 17.1738C12.0731 17.5387 12.0362 17.9643 12.1602 18.3564C12.2841 18.7485 12.559 19.0751 12.9238 19.2646C13.2888 19.4543 13.7143 19.4911 14.1064 19.3672L15.585 18.9004L14.6504 15.9434L13.1719 16.4102Z",
22
+ fill: "#EB4132"
23
+ }
24
+ ),
25
+ /* @__PURE__ */ L(
26
+ "path",
27
+ {
28
+ fillRule: "evenodd",
29
+ clipRule: "evenodd",
30
+ d: "M20.5 2C21.3284 2 22 2.67157 22 3.5V10.7803C21.829 10.421 21.5818 10.1009 21.2744 9.84375L21.1182 9.72363C20.7453 9.45429 20.3107 9.28049 19.8525 9.2207L19.6553 9.20312C19.1961 9.17632 18.7359 9.26419 18.3174 9.45996C17.8395 9.68364 17.4345 10.0382 17.1514 10.4834L16.9004 10.8535C15.7385 12.4621 14.3067 13.1161 14.0898 13.209L12.335 13.7637C11.2858 14.0899 10.4 14.8039 9.85742 15.7598C9.4675 16.4468 9.277 17.2218 9.2959 18H3.5C2.67157 18 2 17.3284 2 16.5V3.5C2 2.67157 2.67157 2 3.5 2H20.5ZM20.7529 3.3418C20.3894 2.92629 19.7574 2.88376 19.3418 3.24707L12 9.6709L4.6582 3.24707C4.24258 2.88373 3.61066 2.92632 3.24707 3.3418C2.88371 3.75744 2.92628 4.38935 3.3418 4.75293L10.6826 11.1768C11.4367 11.8365 12.5633 11.8365 13.3174 11.1768L20.6582 4.75293C21.0737 4.38935 21.1162 3.75742 20.7529 3.3418Z",
31
+ fill: "#EB4132"
32
+ }
33
+ )
34
+ ]
35
+ }
36
+ );
37
+ };
38
+ export {
39
+ o as default
40
+ };
41
+ //# sourceMappingURL=EmailMarketingV2.js.map