@admin-layout/ai-chat-ext-browser 12.2.5-alpha.2 → 12.2.5-alpha.21

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 (86) hide show
  1. package/lib/components/MessageWidgets/MessageFlights.d.ts +27 -4
  2. package/lib/components/MessageWidgets/MessageFlights.d.ts.map +1 -1
  3. package/lib/components/MessageWidgets/MessageFlights.js +200 -65
  4. package/lib/components/MessageWidgets/MessageFlights.js.map +1 -1
  5. package/lib/components/MessageWidgets/MessageMedia.d.ts.map +1 -1
  6. package/lib/components/MessageWidgets/MessageMedia.js +4 -4
  7. package/lib/components/MessageWidgets/MessageMedia.js.map +1 -1
  8. package/lib/components/MessageWidgets/MessageResults.d.ts +54 -0
  9. package/lib/components/MessageWidgets/MessageResults.d.ts.map +1 -0
  10. package/lib/components/MessageWidgets/MessageResults.js +163 -0
  11. package/lib/components/MessageWidgets/MessageResults.js.map +1 -0
  12. package/lib/components/MessageWidgets/MessageTravel.d.ts +2 -0
  13. package/lib/components/MessageWidgets/MessageTravel.d.ts.map +1 -1
  14. package/lib/components/MessageWidgets/MessageTravel.js +15 -3
  15. package/lib/components/MessageWidgets/MessageTravel.js.map +1 -1
  16. package/lib/components/MessageWidgets/ResultCards.d.ts +19 -0
  17. package/lib/components/MessageWidgets/ResultCards.d.ts.map +1 -0
  18. package/lib/components/MessageWidgets/ResultCards.js +543 -0
  19. package/lib/components/MessageWidgets/ResultCards.js.map +1 -0
  20. package/lib/components/MessageWidgets/ResultRow.d.ts +57 -0
  21. package/lib/components/MessageWidgets/ResultRow.d.ts.map +1 -0
  22. package/lib/components/MessageWidgets/ResultRow.js +216 -0
  23. package/lib/components/MessageWidgets/ResultRow.js.map +1 -0
  24. package/lib/components/MessageWidgets/index.d.ts +6 -2
  25. package/lib/components/MessageWidgets/index.d.ts.map +1 -1
  26. package/lib/components/MessageWidgets/mediaUtils.d.ts.map +1 -1
  27. package/lib/components/MessageWidgets/mediaUtils.js +3 -10
  28. package/lib/components/MessageWidgets/mediaUtils.js.map +1 -1
  29. package/lib/components/index.d.ts +1 -1
  30. package/lib/components/index.d.ts.map +1 -1
  31. package/lib/index.d.ts +6 -2
  32. package/lib/index.d.ts.map +1 -1
  33. package/lib/index.js +1 -1
  34. package/lib/module.d.ts.map +1 -1
  35. package/lib/module.js +13 -1
  36. package/lib/module.js.map +1 -1
  37. package/lib/slot-fill/chat-settings-fill.js +1 -1
  38. package/lib/slot-fill/chat-settings-fill.js.map +1 -1
  39. package/lib/slot-fill/index.d.ts +4 -0
  40. package/lib/slot-fill/index.d.ts.map +1 -1
  41. package/lib/slot-fill/message-ai-assistant-fill.js +1 -1
  42. package/lib/slot-fill/message-ai-assistant-fill.js.map +1 -1
  43. package/lib/slot-fill/message-codeblock-fill.js +1 -1
  44. package/lib/slot-fill/message-codeblock-fill.js.map +1 -1
  45. package/lib/slot-fill/message-connector-fill.js +1 -1
  46. package/lib/slot-fill/message-connector-fill.js.map +1 -1
  47. package/lib/slot-fill/message-generic-fill.js +1 -1
  48. package/lib/slot-fill/message-generic-fill.js.map +1 -1
  49. package/lib/slot-fill/message-jobs-fill.d.ts +4 -0
  50. package/lib/slot-fill/message-jobs-fill.d.ts.map +1 -0
  51. package/lib/slot-fill/message-jobs-fill.js +6 -0
  52. package/lib/slot-fill/message-jobs-fill.js.map +1 -0
  53. package/lib/slot-fill/message-media-fill.js +1 -1
  54. package/lib/slot-fill/message-media-fill.js.map +1 -1
  55. package/lib/slot-fill/message-movies-fill.d.ts +4 -0
  56. package/lib/slot-fill/message-movies-fill.d.ts.map +1 -0
  57. package/lib/slot-fill/message-movies-fill.js +6 -0
  58. package/lib/slot-fill/message-movies-fill.js.map +1 -0
  59. package/lib/slot-fill/message-resume-fill.d.ts +4 -0
  60. package/lib/slot-fill/message-resume-fill.d.ts.map +1 -0
  61. package/lib/slot-fill/message-resume-fill.js +6 -0
  62. package/lib/slot-fill/message-resume-fill.js.map +1 -0
  63. package/lib/slot-fill/message-service-fill.js +1 -1
  64. package/lib/slot-fill/message-service-fill.js.map +1 -1
  65. package/lib/slot-fill/message-shopping-fill.d.ts +4 -0
  66. package/lib/slot-fill/message-shopping-fill.d.ts.map +1 -0
  67. package/lib/slot-fill/message-shopping-fill.js +6 -0
  68. package/lib/slot-fill/message-shopping-fill.js.map +1 -0
  69. package/lib/slot-fill/message-thinking-fill.js +1 -1
  70. package/lib/slot-fill/message-thinking-fill.js.map +1 -1
  71. package/lib/slot-fill/message-tooluse-fill.js +1 -1
  72. package/lib/slot-fill/message-tooluse-fill.js.map +1 -1
  73. package/lib/slot-fill/message-travel-fill.js +1 -1
  74. package/lib/slot-fill/message-travel-fill.js.map +1 -1
  75. package/lib/slot-fill/message-workflow-fill.js +1 -1
  76. package/lib/slot-fill/message-workflow-fill.js.map +1 -1
  77. package/lib/utils/mediaAttachment.d.ts +46 -0
  78. package/lib/utils/mediaAttachment.d.ts.map +1 -0
  79. package/lib/utils/mediaAttachment.js +135 -0
  80. package/lib/utils/mediaAttachment.js.map +1 -0
  81. package/lib/utils/parseWidgetPost.d.ts.map +1 -1
  82. package/lib/utils/parseWidgetPost.js +20 -10
  83. package/lib/utils/parseWidgetPost.js.map +1 -1
  84. package/package.json +3 -3
  85. package/lib/utils/parseWidgetPost.spec.d.ts +0 -2
  86. package/lib/utils/parseWidgetPost.spec.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-movies-fill.js","sources":["../../src/slot-fill/message-movies-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"oJAIA;AACO,MAAM,iBAAiB,GAAG,MAAM,KACnC,CAAA,aAAA,CAAA,IAAC;;;;"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ /** Fill name: "resume" — a built resume as one document card. */
3
+ export declare const MessageResumeFill: () => React.JSX.Element;
4
+ //# sourceMappingURL=message-resume-fill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-resume-fill.d.ts","sourceRoot":"","sources":["../../src/slot-fill/message-resume-fill.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,yBAI7B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from'react';import {Fill}from'@common-stack/components-pro';import {MessageResume}from'../components/MessageWidgets/MessageResults.js';/** Fill name: "resume" — a built resume as one document card. */
2
+ const MessageResumeFill = () => React.createElement(Fill, {
3
+ name: "resume"
4
+ }, props => props.active ? React.createElement(MessageResume, {
5
+ ...props
6
+ }) : null);export{MessageResumeFill};//# sourceMappingURL=message-resume-fill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-resume-fill.js","sources":["../../src/slot-fill/message-resume-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"oJAIA;AACO,MAAM,iBAAiB,GAAG,MAAM,KACnC,CAAA,aAAA,CAAA,IAAC;;;;"}
@@ -1,4 +1,4 @@
1
- import React from'react';import {Fill}from'@common-stack/components-pro';import {PostTypeEnum}from'common';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import'@react-icons/all-files/fi/FiTool.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiLoader.js';import {MessageService}from'../components/MessageWidgets/MessageService.js';import'../components/MessageWidgets/MessageMedia.js';import'@react-icons/all-files/fi/FiMapPin.js';import'@react-icons/all-files/fi/FiStar.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@admin-layout/client';import'@react-icons/all-files/fi/FiGitBranch.js';import'@react-icons/all-files/fi/FiArrowRight.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';const MessageServiceFill = () => {
1
+ import React from'react';import {Fill}from'@common-stack/components-pro';import {PostTypeEnum}from'common';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import'@react-icons/all-files/fi/FiTool.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiLoader.js';import {MessageService}from'../components/MessageWidgets/MessageService.js';import'../components/MessageWidgets/MessageMedia.js';import'@react-icons/all-files/fi/FiMapPin.js';import'@react-icons/all-files/fi/FiStar.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@admin-layout/client';import'@react-icons/all-files/fa/FaBed.js';import'@react-icons/all-files/fa/FaBus.js';import'@react-icons/all-files/fa/FaCar.js';import'@react-icons/all-files/fa/FaTrain.js';import'@react-icons/all-files/fi/FiBriefcase.js';import'@react-icons/all-files/fi/FiFilm.js';import'@react-icons/all-files/fi/FiShoppingBag.js';import'@react-icons/all-files/fa/FaStar.js';import'@react-icons/all-files/fi/FiArrowUpRight.js';import'@react-icons/all-files/fi/FiClock.js';import'@react-icons/all-files/fi/FiDownload.js';import'@react-icons/all-files/fi/FiFileText.js';import'@react-icons/all-files/fi/FiGitBranch.js';import'@react-icons/all-files/fi/FiArrowRight.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';const MessageServiceFill = () => {
2
2
  return React.createElement(Fill, {
3
3
  name: PostTypeEnum.Service.toLowerCase()
4
4
  }, props => {
@@ -1 +1 @@
1
- {"version":3,"file":"message-service-fill.js","sources":["../../src/slot-fill/message-service-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"q9CAMO,MAAM,kBAAkB,GAAG,MAAK;AACnC,EAAA,OAAA,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA,YAAU,CAAA,OAAS,CAAA,WAAA;AACf,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,cAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
1
+ {"version":3,"file":"message-service-fill.js","sources":["../../src/slot-fill/message-service-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"ggEAMO,MAAM,kBAAkB,GAAG,MAAK;AACnC,EAAA,OAAA,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA,YAAU,CAAA,OAAS,CAAA,WAAA;AACf,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,cAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ /** Fill name: "shopping" — product results as a row of product cards. */
3
+ export declare const MessageShoppingFill: () => React.JSX.Element;
4
+ //# sourceMappingURL=message-shopping-fill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-shopping-fill.d.ts","sourceRoot":"","sources":["../../src/slot-fill/message-shopping-fill.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,yEAAyE;AACzE,eAAO,MAAM,mBAAmB,yBAI/B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import React from'react';import {Fill}from'@common-stack/components-pro';import {MessageShopping}from'../components/MessageWidgets/MessageResults.js';/** Fill name: "shopping" — product results as a row of product cards. */
2
+ const MessageShoppingFill = () => React.createElement(Fill, {
3
+ name: "shopping"
4
+ }, props => props.active ? React.createElement(MessageShopping, {
5
+ ...props
6
+ }) : null);export{MessageShoppingFill};//# sourceMappingURL=message-shopping-fill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-shopping-fill.js","sources":["../../src/slot-fill/message-shopping-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"sJAIA;AACO,MAAM,mBAAmB,GAAG,MAAM,KACrC,CAAA,aAAA,CAAA,IAAC;;;;"}
@@ -1,4 +1,4 @@
1
- import React from'react';import {Fill}from'@common-stack/components-pro';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import {MessageThinking}from'../components/MessageWidgets/MessageThinking.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import'@react-icons/all-files/fi/FiTool.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiLoader.js';import'@react-icons/all-files/fi/FiInfo.js';import'@react-icons/all-files/fi/FiAlertTriangle.js';import'@react-icons/all-files/fi/FiCheckCircle.js';import'html-react-parser';import'../components/MessageWidgets/MessageMedia.js';import'@react-icons/all-files/fi/FiMapPin.js';import'@react-icons/all-files/fi/FiStar.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@admin-layout/client';import'@react-icons/all-files/fi/FiGitBranch.js';import'@react-icons/all-files/fi/FiArrowRight.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';/**
1
+ import React from'react';import {Fill}from'@common-stack/components-pro';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import {MessageThinking}from'../components/MessageWidgets/MessageThinking.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import'@react-icons/all-files/fi/FiTool.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiLoader.js';import'@react-icons/all-files/fi/FiInfo.js';import'@react-icons/all-files/fi/FiAlertTriangle.js';import'@react-icons/all-files/fi/FiCheckCircle.js';import'html-react-parser';import'../components/MessageWidgets/MessageMedia.js';import'@react-icons/all-files/fi/FiMapPin.js';import'@react-icons/all-files/fi/FiStar.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@admin-layout/client';import'@react-icons/all-files/fa/FaBed.js';import'@react-icons/all-files/fa/FaBus.js';import'@react-icons/all-files/fa/FaCar.js';import'@react-icons/all-files/fa/FaTrain.js';import'@react-icons/all-files/fi/FiBriefcase.js';import'@react-icons/all-files/fi/FiFilm.js';import'@react-icons/all-files/fi/FiShoppingBag.js';import'@react-icons/all-files/fa/FaStar.js';import'@react-icons/all-files/fi/FiArrowUpRight.js';import'@react-icons/all-files/fi/FiClock.js';import'@react-icons/all-files/fi/FiDownload.js';import'@react-icons/all-files/fi/FiFileText.js';import'@react-icons/all-files/fi/FiGitBranch.js';import'@react-icons/all-files/fi/FiArrowRight.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';/**
2
2
  * Fill name: "thinking"
3
3
  * Note: PostTypeEnum doesn't have "Thinking" yet — we use a custom string.
4
4
  * When added to the enum, switch to PostTypeEnum.Thinking.toLowerCase().
@@ -1 +1 @@
1
- {"version":3,"file":"message-thinking-fill.js","sources":["../../src/slot-fill/message-thinking-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"mmDAKA;;;;AAIG;AACH,MAAM,kBAAkB,GAAG,UAAU;AAE9B,MAAM,mBAAmB,GAAG,MAAK;SACpC,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA;AACI,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,eAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
1
+ {"version":3,"file":"message-thinking-fill.js","sources":["../../src/slot-fill/message-thinking-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"8oEAKA;;;;AAIG;AACH,MAAM,kBAAkB,GAAG,UAAU;AAE9B,MAAM,mBAAmB,GAAG,MAAK;SACpC,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA;AACI,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,eAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import React from'react';import {Fill}from'@common-stack/components-pro';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import {MessageToolUse}from'../components/MessageWidgets/MessageToolUse.js';import'@react-icons/all-files/fi/FiInfo.js';import'@react-icons/all-files/fi/FiAlertTriangle.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiCheckCircle.js';import'html-react-parser';import'../components/MessageWidgets/MessageMedia.js';import'@react-icons/all-files/fi/FiMapPin.js';import'@react-icons/all-files/fi/FiStar.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@admin-layout/client';import'@react-icons/all-files/fi/FiGitBranch.js';import'@react-icons/all-files/fi/FiArrowRight.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';/**
1
+ import React from'react';import {Fill}from'@common-stack/components-pro';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import {MessageToolUse}from'../components/MessageWidgets/MessageToolUse.js';import'@react-icons/all-files/fi/FiInfo.js';import'@react-icons/all-files/fi/FiAlertTriangle.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiCheckCircle.js';import'html-react-parser';import'../components/MessageWidgets/MessageMedia.js';import'@react-icons/all-files/fi/FiMapPin.js';import'@react-icons/all-files/fi/FiStar.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@admin-layout/client';import'@react-icons/all-files/fa/FaBed.js';import'@react-icons/all-files/fa/FaBus.js';import'@react-icons/all-files/fa/FaCar.js';import'@react-icons/all-files/fa/FaTrain.js';import'@react-icons/all-files/fi/FiBriefcase.js';import'@react-icons/all-files/fi/FiFilm.js';import'@react-icons/all-files/fi/FiShoppingBag.js';import'@react-icons/all-files/fa/FaStar.js';import'@react-icons/all-files/fi/FiArrowUpRight.js';import'@react-icons/all-files/fi/FiClock.js';import'@react-icons/all-files/fi/FiDownload.js';import'@react-icons/all-files/fi/FiFileText.js';import'@react-icons/all-files/fi/FiGitBranch.js';import'@react-icons/all-files/fi/FiArrowRight.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';/**
2
2
  * Fill name: "tooluse"
3
3
  * Note: PostTypeEnum doesn't have "ToolUse" yet — we use a custom string.
4
4
  * When added to the enum, switch to PostTypeEnum.Tooluse.toLowerCase().
@@ -1 +1 @@
1
- {"version":3,"file":"message-tooluse-fill.js","sources":["../../src/slot-fill/message-tooluse-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"ugDAKA;;;;AAIG;AACH,MAAM,iBAAiB,GAAG,SAAS;AAE5B,MAAM,kBAAkB,GAAG,MAAK;SACnC,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA;AACI,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,cAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
1
+ {"version":3,"file":"message-tooluse-fill.js","sources":["../../src/slot-fill/message-tooluse-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"kjEAKA;;;;AAIG;AACH,MAAM,iBAAiB,GAAG,SAAS;AAE5B,MAAM,kBAAkB,GAAG,MAAK;SACnC,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA;AACI,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,cAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import React from'react';import {Fill}from'@common-stack/components-pro';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import'@react-icons/all-files/fi/FiTool.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiLoader.js';import'@react-icons/all-files/fi/FiInfo.js';import'@react-icons/all-files/fi/FiAlertTriangle.js';import'@react-icons/all-files/fi/FiCheckCircle.js';import'html-react-parser';import'../components/MessageWidgets/MessageMedia.js';import {MessageTravel}from'../components/MessageWidgets/MessageTravel.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@admin-layout/client';import'@react-icons/all-files/fi/FiGitBranch.js';import'@react-icons/all-files/fi/FiArrowRight.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';/**
1
+ import React from'react';import {Fill}from'@common-stack/components-pro';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import'@react-icons/all-files/fi/FiTool.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiLoader.js';import'@react-icons/all-files/fi/FiInfo.js';import'@react-icons/all-files/fi/FiAlertTriangle.js';import'@react-icons/all-files/fi/FiCheckCircle.js';import'html-react-parser';import'../components/MessageWidgets/MessageMedia.js';import {MessageTravel}from'../components/MessageWidgets/MessageTravel.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@admin-layout/client';import'@react-icons/all-files/fi/FiGitBranch.js';import'@react-icons/all-files/fi/FiArrowRight.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fa/FaBed.js';import'@react-icons/all-files/fa/FaBus.js';import'@react-icons/all-files/fa/FaCar.js';import'@react-icons/all-files/fa/FaTrain.js';import'@react-icons/all-files/fi/FiBriefcase.js';import'@react-icons/all-files/fi/FiFilm.js';import'@react-icons/all-files/fi/FiShoppingBag.js';import'@react-icons/all-files/fa/FaStar.js';import'@react-icons/all-files/fi/FiArrowUpRight.js';import'@react-icons/all-files/fi/FiClock.js';import'@react-icons/all-files/fi/FiDownload.js';import'@react-icons/all-files/fi/FiFileText.js';import'@react-icons/all-files/fi/FiMapPin.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';/**
2
2
  * Fill name: "travel"
3
3
  * Note: PostTypeEnum doesn't have "Travel" yet — we use a custom string.
4
4
  * When added to the enum, switch to PostTypeEnum.Travel.toLowerCase().
@@ -1 +1 @@
1
- {"version":3,"file":"message-travel-fill.js","sources":["../../src/slot-fill/message-travel-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"qgDAKA;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,QAAQ;AAE1B,MAAM,iBAAiB,GAAG,MAAK;SAClC,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA;AACI,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,aAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
1
+ {"version":3,"file":"message-travel-fill.js","sources":["../../src/slot-fill/message-travel-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"8lEAKA;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,QAAQ;AAE1B,MAAM,iBAAiB,GAAG,MAAK;SAClC,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA;AACI,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,aAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- import React from'react';import {Fill}from'@common-stack/components-pro';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import'@react-icons/all-files/fi/FiTool.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiLoader.js';import'@react-icons/all-files/fi/FiInfo.js';import'@react-icons/all-files/fi/FiAlertTriangle.js';import'@react-icons/all-files/fi/FiCheckCircle.js';import'html-react-parser';import'../components/MessageWidgets/MessageMedia.js';import'@react-icons/all-files/fi/FiMapPin.js';import'@react-icons/all-files/fi/FiStar.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@admin-layout/client';import {MessageWorkflow}from'../components/MessageWidgets/MessageWorkflow.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';/**
1
+ import React from'react';import {Fill}from'@common-stack/components-pro';import'@react-icons/all-files/fi/FiCpu.js';import'@react-icons/all-files/fi/FiChevronDown.js';import'@react-icons/all-files/fi/FiCopy.js';import'@react-icons/all-files/fi/FiCheck.js';import'@react-icons/all-files/fi/FiExternalLink.js';import'@react-icons/all-files/fi/FiCode.js';import'@react-icons/all-files/fi/FiFile.js';import'@react-icons/all-files/fi/FiTool.js';import'@react-icons/all-files/fi/FiAlertCircle.js';import'@react-icons/all-files/fi/FiLoader.js';import'@react-icons/all-files/fi/FiInfo.js';import'@react-icons/all-files/fi/FiAlertTriangle.js';import'@react-icons/all-files/fi/FiCheckCircle.js';import'html-react-parser';import'../components/MessageWidgets/MessageMedia.js';import'@react-icons/all-files/fi/FiMapPin.js';import'@react-icons/all-files/fi/FiStar.js';import'@react-icons/all-files/fi/FiChevronRight.js';import'@react-icons/all-files/fa/FaPlane.js';import'@react-icons/all-files/fi/FiChevronLeft.js';import'@admin-layout/client';import'@react-icons/all-files/fa/FaBed.js';import'@react-icons/all-files/fa/FaBus.js';import'@react-icons/all-files/fa/FaCar.js';import'@react-icons/all-files/fa/FaTrain.js';import'@react-icons/all-files/fi/FiBriefcase.js';import'@react-icons/all-files/fi/FiFilm.js';import'@react-icons/all-files/fi/FiShoppingBag.js';import'@react-icons/all-files/fa/FaStar.js';import'@react-icons/all-files/fi/FiArrowUpRight.js';import'@react-icons/all-files/fi/FiClock.js';import'@react-icons/all-files/fi/FiDownload.js';import'@react-icons/all-files/fi/FiFileText.js';import {MessageWorkflow}from'../components/MessageWidgets/MessageWorkflow.js';import'@react-icons/all-files/fi/FiBox.js';import'@react-icons/all-files/fi/FiZap.js';import'@react-icons/all-files/fi/FiSearch.js';import'@react-icons/all-files/fi/FiX.js';import'@react-icons/all-files/fi/FiRefreshCw.js';import'@react-icons/all-files/fi/FiEdit2.js';import'@react-icons/all-files/fi/FiPlus.js';import'@react-icons/all-files/fi/FiTrash2.js';import'../components/ChatSettingsPanel/ConnectedChatSettingsPanel.js';/**
2
2
  * Fill name: "workflow"
3
3
  * PostTypeEnum has no "Workflow" yet — we use a custom string. ModernMessageBubble
4
4
  * maps a post of type "workflow" → <Slot name="workflow"> (see tailwind-ui-inbox
@@ -1 +1 @@
1
- {"version":3,"file":"message-workflow-fill.js","sources":["../../src/slot-fill/message-workflow-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"ggDAKA;;;;;AAKG;AACH,MAAM,kBAAkB,GAAG,UAAU;AAE9B,MAAM,mBAAmB,GAAG,MAAK;SACpC,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA;AACI,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,eAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
1
+ {"version":3,"file":"message-workflow-fill.js","sources":["../../src/slot-fill/message-workflow-fill.tsx"],"sourcesContent":[null],"names":[],"mappings":"2iEAKA;;;;;AAKG;AACH,MAAM,kBAAkB,GAAG,UAAU;AAE9B,MAAM,mBAAmB,GAAG,MAAK;SACpC,KACI,CAAA,aAAA,CAAA,IAAC,EAAA;AAEO,IAAA,IAAA,EAAA;AACI,GAAA,EAAA,KAAA,IAAA;QACJ,KAAC,CAAA,MAAA,EAAA;AACD,MAAA,OAAA,MAAW,aAAC,CAAA,eAAA,EAAA;QAGtB,GAAA;AACN,OAAE,CAAA;;;;"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The one reader of a `media` widget's payload, whatever shape the agent wrote it in.
3
+ *
4
+ * `MessageMedia` reads `propsConfiguration.contents.attachment.{kind,url,title}`. The model
5
+ * drifts from that: it puts the result straight in `contents` (or on `propsConfiguration`, or
6
+ * the envelope itself), and names the kind `mediaType` or `type`. Read strictly, the post had no
7
+ * attachment and the card drew nothing. These helpers take each shape to the canonical one, and
8
+ * still refuse a payload with no http(s) `url`, so a stray object never becomes a card.
9
+ */
10
+ export type MediaKind = 'image' | 'video' | 'audio';
11
+ type Json = Record<string, unknown>;
12
+ export declare function isRecord(value: unknown): value is Json;
13
+ /** An absolute http(s) address. */
14
+ export declare function isHttpUrl(value: unknown): value is string;
15
+ /** `image` / `video` / `audio`, or a mime type of one (`image/jpeg`); anything else is no kind. */
16
+ export declare function mediaKindOf(value: unknown): MediaKind | undefined;
17
+ /** The kind an address's file ending names (query and fragment ignored; relative paths too). */
18
+ export declare function mediaKindFromPath(url: unknown): MediaKind | undefined;
19
+ /**
20
+ * A media result's `kind` and `title`, read from any of the names the agent uses for them:
21
+ * `kind`, `mediaType`, `type` or `mimeType`, else the address's file ending; `title`,
22
+ * `caption` or `alt`.
23
+ */
24
+ export declare function mediaFields(source: Json): {
25
+ kind?: MediaKind;
26
+ title?: string;
27
+ };
28
+ /**
29
+ * A media attachment as the card reads it: a top-level `url` (lifted from `items[0]` when only
30
+ * that has one), and `kind` / `title` filled in from whatever names the agent used.
31
+ */
32
+ export declare function normalizeMediaAttachment(attachment: Json): Json;
33
+ /**
34
+ * A media envelope's attachment: the canonical `propsConfiguration.contents.attachment` (or a
35
+ * bare `attachment`), else the first of `contents`, `propsConfiguration` or the envelope itself
36
+ * that holds an http(s) `url`. Normalized; null when there is none.
37
+ */
38
+ export declare function mediaEnvelopeAttachment(envelope: Json): Json | null;
39
+ /**
40
+ * A media post's attachment from its `propsConfiguration.contents`: `contents.attachment`, or
41
+ * `contents` itself when the result was stored there flat with an http(s) `url`. Normalized;
42
+ * null when there is none.
43
+ */
44
+ export declare function mediaContentsAttachment(contents: unknown): Json | null;
45
+ export {};
46
+ //# sourceMappingURL=mediaAttachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mediaAttachment.d.ts","sourceRoot":"","sources":["../../src/utils/mediaAttachment.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpD,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAmCpC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAEtD;AAED,mCAAmC;AACnC,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAQzD;AAED,mGAAmG;AACnG,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAIjE;AAED,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAIrE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,IAAI,GAAG;IAAE,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAQ9E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,IAAI,GAAG,IAAI,CAc/D;AASD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAQnE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAItE"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * The one reader of a `media` widget's payload, whatever shape the agent wrote it in.
3
+ *
4
+ * `MessageMedia` reads `propsConfiguration.contents.attachment.{kind,url,title}`. The model
5
+ * drifts from that: it puts the result straight in `contents` (or on `propsConfiguration`, or
6
+ * the envelope itself), and names the kind `mediaType` or `type`. Read strictly, the post had no
7
+ * attachment and the card drew nothing. These helpers take each shape to the canonical one, and
8
+ * still refuse a payload with no http(s) `url`, so a stray object never becomes a card.
9
+ */
10
+ const MEDIA_KINDS = new Set(['image', 'video', 'audio']);
11
+ /** File endings that name a kind when the payload names none. */
12
+ const KIND_BY_EXTENSION = {
13
+ png: 'image',
14
+ jpg: 'image',
15
+ jpeg: 'image',
16
+ gif: 'image',
17
+ webp: 'image',
18
+ avif: 'image',
19
+ bmp: 'image',
20
+ svg: 'image',
21
+ heic: 'image',
22
+ heif: 'image',
23
+ mp4: 'video',
24
+ webm: 'video',
25
+ mov: 'video',
26
+ m4v: 'video',
27
+ mkv: 'video',
28
+ ogv: 'video',
29
+ mp3: 'audio',
30
+ wav: 'audio',
31
+ ogg: 'audio',
32
+ oga: 'audio',
33
+ m4a: 'audio',
34
+ aac: 'audio',
35
+ flac: 'audio',
36
+ opus: 'audio'
37
+ };
38
+ /** Keys of an envelope (or its configuration) that are wrapping, not the result. */
39
+ const WRAPPER_KEYS = new Set(['propsComponent', 'propsConfiguration', 'contents', 'attachment']);
40
+ function isRecord(value) {
41
+ return !!value && typeof value === 'object' && !Array.isArray(value);
42
+ }
43
+ /** An absolute http(s) address. */
44
+ function isHttpUrl(value) {
45
+ if (typeof value !== 'string') return false;
46
+ try {
47
+ const {
48
+ protocol
49
+ } = new URL(value.trim());
50
+ return protocol === 'https:' || protocol === 'http:';
51
+ } catch {
52
+ return false;
53
+ }
54
+ }
55
+ /** `image` / `video` / `audio`, or a mime type of one (`image/jpeg`); anything else is no kind. */
56
+ function mediaKindOf(value) {
57
+ if (typeof value !== 'string') return undefined;
58
+ const [kind] = value.trim().toLowerCase().split('/');
59
+ return MEDIA_KINDS.has(kind) ? kind : undefined;
60
+ }
61
+ /** The kind an address's file ending names (query and fragment ignored; relative paths too). */
62
+ function mediaKindFromPath(url) {
63
+ if (typeof url !== 'string') return undefined;
64
+ const ext = /\.([a-z0-9]+)$/i.exec(url.trim().split(/[?#]/)[0])?.[1]?.toLowerCase();
65
+ return ext ? KIND_BY_EXTENSION[ext] : undefined;
66
+ }
67
+ /**
68
+ * A media result's `kind` and `title`, read from any of the names the agent uses for them:
69
+ * `kind`, `mediaType`, `type` or `mimeType`, else the address's file ending; `title`,
70
+ * `caption` or `alt`.
71
+ */
72
+ function mediaFields(source) {
73
+ const kind = [source.kind, source.mediaType, source.type, source.mimeType].map(mediaKindOf).find(Boolean) ?? mediaKindFromPath(source.url);
74
+ const title = [source.title, source.caption, source.alt].find(v => typeof v === 'string' && !!v.trim());
75
+ return {
76
+ ...(kind ? {
77
+ kind
78
+ } : {}),
79
+ ...(title ? {
80
+ title
81
+ } : {})
82
+ };
83
+ }
84
+ /**
85
+ * A media attachment as the card reads it: a top-level `url` (lifted from `items[0]` when only
86
+ * that has one), and `kind` / `title` filled in from whatever names the agent used.
87
+ */
88
+ function normalizeMediaAttachment(attachment) {
89
+ const first = !attachment.url && Array.isArray(attachment.items) ? attachment.items[0] : undefined;
90
+ const lifted = isRecord(first) && first.url ? {
91
+ ...attachment,
92
+ url: first.url,
93
+ ...(attachment.kind ?? first.kind ? {
94
+ kind: attachment.kind ?? first.kind
95
+ } : {}),
96
+ ...(attachment.mimeType ?? first.mimeType ? {
97
+ mimeType: attachment.mimeType ?? first.mimeType
98
+ } : {})
99
+ } : attachment;
100
+ return {
101
+ ...lifted,
102
+ ...mediaFields(lifted)
103
+ };
104
+ }
105
+ /** `candidate` without its wrapping keys, when it holds an http(s) `url`; else null. */
106
+ function flatResult(candidate) {
107
+ if (!isRecord(candidate) || !isHttpUrl(candidate.url)) return null;
108
+ const result = Object.fromEntries(Object.entries(candidate).filter(([key]) => !WRAPPER_KEYS.has(key)));
109
+ return {
110
+ ...result,
111
+ url: candidate.url.trim()
112
+ };
113
+ }
114
+ /**
115
+ * A media envelope's attachment: the canonical `propsConfiguration.contents.attachment` (or a
116
+ * bare `attachment`), else the first of `contents`, `propsConfiguration` or the envelope itself
117
+ * that holds an http(s) `url`. Normalized; null when there is none.
118
+ */
119
+ function mediaEnvelopeAttachment(envelope) {
120
+ const config = isRecord(envelope.propsConfiguration) ? envelope.propsConfiguration : undefined;
121
+ const contents = config && isRecord(config.contents) ? config.contents : undefined;
122
+ const canonical = contents?.attachment ?? envelope.attachment;
123
+ const found = isRecord(canonical) ? canonical : flatResult(contents) ?? flatResult(config) ?? flatResult(envelope);
124
+ return found ? normalizeMediaAttachment(found) : null;
125
+ }
126
+ /**
127
+ * A media post's attachment from its `propsConfiguration.contents`: `contents.attachment`, or
128
+ * `contents` itself when the result was stored there flat with an http(s) `url`. Normalized;
129
+ * null when there is none.
130
+ */
131
+ function mediaContentsAttachment(contents) {
132
+ if (!isRecord(contents)) return null;
133
+ const found = isRecord(contents.attachment) ? contents.attachment : flatResult(contents);
134
+ return found ? normalizeMediaAttachment(found) : null;
135
+ }export{isHttpUrl,isRecord,mediaContentsAttachment,mediaEnvelopeAttachment,mediaFields,mediaKindFromPath,mediaKindOf,normalizeMediaAttachment};//# sourceMappingURL=mediaAttachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mediaAttachment.js","sources":["../../src/utils/mediaAttachment.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;AAQG;AAMH,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAE7E;AACA,MAAM,iBAAiB,GAA8B;AACjD,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,IAAA,EAAI,OAAE;AACN,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,IAAA,EAAI,OAAE;AACN,EAAA,IAAA,EAAI,OAAE;AACN,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,IAAA,EAAI,OAAE;AACN,EAAA,IAAA,EAAI,OAAE;AACN,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,IAAA,EAAI,OAAE;AACN,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,GAAA,EAAG,OAAE;AACL,EAAA,IAAA,EAAI,OAAE;AACN,EAAA,IAAA,EAAI;CACP;AAED;AACA,MAAM,YAAY,GAAw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Y,CAAG,GAAA,CAAA,IAAQ;;;AAGvB;AACI;AACA;AACJ;AACJ;AAEA,SAAA,uBAAA,CAAA,QAAA,EAAA;;;;AAIG,EAAA,MAAA,KAAA,GAAA,QAAA,CAAA,SAAA,CAAA,GAAA,SAAA,GAAA,UAAA,CAAA,QAAA,CAAA,IAAA,UAAA,CAAA,MAAA,CAAA,IAAA,UAAA,CAAA,QAAA,CAAA;AACH,EAAA,OAAM,KAAA,GAAU,wBAAwB,CAAA,KAAA,CAAiB,GAAA,IAAA;AACrD;AAAyB;;AAEzB;AACJ;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"parseWidgetPost.d.ts","sourceRoot":"","sources":["../../src/utils/parseWidgetPost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AA8C/B;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAgClD"}
1
+ {"version":3,"file":"parseWidgetPost.d.ts","sourceRoot":"","sources":["../../src/utils/parseWidgetPost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAuD/B;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAoClD"}
@@ -1,10 +1,13 @@
1
- /**
1
+ import {mediaEnvelopeAttachment}from'./mediaAttachment.js';/**
2
2
  * Fill names ai-chat-ext registers (see module.ts). A widget block's `propsComponent`
3
3
  * must match one of these for the post to be promoted into a typed widget.
4
4
  */
5
- const KNOWN_FILL_NAMES = new Set(['media', 'travel', 'workflow', 'aiassistant', 'thinking', 'codeblock', 'tooluse', 'service', 'connector']);
6
- /** Matches a fenced code block, capturing its inner body. Language tag (```json) optional. */
7
- const FENCED_BLOCK = /```(?:[a-zA-Z]+)?\s*([\s\S]*?)```/g;
5
+ const KNOWN_FILL_NAMES = new Set(['media', 'travel', 'workflow', 'aiassistant', 'thinking', 'codeblock', 'tooluse', 'service', 'connector', 'shopping', 'movies', 'jobs', 'resume']);
6
+ /**
7
+ * Matches a fenced code block, capturing its inner body. Language tag optional: ```json, or
8
+ * ```yantra:widget (the agent's own label, which a letters-only tag split at the colon).
9
+ */
10
+ const FENCED_BLOCK = /```(?:[a-zA-Z][\w:-]*)?\s*([\s\S]*?)```/g;
8
11
  /**
9
12
  * Find the first fenced block whose JSON has a string `propsComponent`. Returns the parsed
10
13
  * envelope and the exact matched block text (so the caller can strip it from the message).
@@ -49,16 +52,23 @@ function parseWidgetPost(post) {
49
52
  block
50
53
  } = found;
51
54
  if (!KNOWN_FILL_NAMES.has(envelope.propsComponent.toLowerCase())) return post;
52
- const contents = envelope.propsConfiguration?.contents;
53
- // Defensive: MessageMedia returns null without a top-level url — backfill from the first item.
54
- const attachment = contents?.attachment;
55
- if (attachment && !attachment.url && attachment.items?.[0]?.url) {
56
- attachment.url = attachment.items[0].url;
55
+ const type = envelope.propsComponent.toLowerCase();
56
+ let contents = envelope.propsConfiguration?.contents;
57
+ if (type === 'media') {
58
+ // MessageMedia reads `contents.attachment.{kind,url,title}`; the agent also writes the
59
+ // result straight in `contents` (or higher) and names the kind `mediaType`. No http(s)
60
+ // url anywhere: not a widget.
61
+ const attachment = mediaEnvelopeAttachment(envelope);
62
+ if (!attachment) return post;
63
+ contents = {
64
+ ...(contents && 'attachment' in contents ? contents : {}),
65
+ attachment
66
+ };
57
67
  }
58
68
  const strippedMessage = message.replace(block, '').replace(/\n{3,}/g, '\n\n').trim();
59
69
  return {
60
70
  ...post,
61
- type: envelope.propsComponent.toLowerCase(),
71
+ type: type,
62
72
  propsConfiguration: {
63
73
  ...(post.propsConfiguration ?? {}),
64
74
  contents
@@ -1 +1 @@
1
- {"version":3,"file":"parseWidgetPost.js","sources":["../../src/utils/parseWidgetPost.ts"],"sourcesContent":[null],"names":[],"mappings":"AAEA;;;AAGG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,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;;;AAEsC;AAE1D,IAAA,MAAM,UAAQ,GAAA,uBAAyB,CAAA,QAAA,CAAA;AACvC,IAAA,IAAI,CAAC,UAAK,EAAA,OAAA,IAAA;AAAE,IAAA,QAAA,GAAO;AAEnB,MAAA,IAAM,QAAE,IAAU,gBAAgB,QAAA,GAAA,QAAA,GAAA,EAAA,CAAA;MAClC;AAAkE,KAAA;;AAGlE,EAAA,MAAI,eAAW,GAAA,OAAS,CAAA,OAAA,CAAA,KAAkB,aAAW,CAAA,SAAA,EAAA,MAAA,CAAA,CAAA,IAAA,EAAA;AACrD,EAAA,OAAI;WACA;QACA,EAAA,IAAA;sBACA,EAAA;AACA,MAAA,IAAA,IAAM,mBAAa,IAAA,EAAA,CAAA;AACnB,MAAA;AAAiB,KAAA;WACjB,EAAA;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/ai-chat-ext-browser",
3
- "version": "12.2.5-alpha.2",
3
+ "version": "12.2.5-alpha.21",
4
4
  "description": "AI Chat extension for Messenger - supports AI assistant, thinking, code blocks, tool use, and service messages",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -21,7 +21,7 @@
21
21
  "watch": "npm run build:lib:watch"
22
22
  },
23
23
  "dependencies": {
24
- "@admin-layout/client": "12.2.5-alpha.2",
24
+ "@admin-layout/client": "12.2.5-alpha.15",
25
25
  "@admin-layout/connector-widgets-browser": "12.2.5-alpha.2",
26
26
  "@react-icons/all-files": "^4.1.0",
27
27
  "html-react-parser": "^3.0.1"
@@ -41,5 +41,5 @@
41
41
  "typescript": {
42
42
  "definition": "lib/index.d.ts"
43
43
  },
44
- "gitHead": "5ccfbf6ff024031ed38926197c3aef7b3f4dc8ee"
44
+ "gitHead": "0eeb1dbedbfc7c900051bc32d37800fdc12ab17b"
45
45
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=parseWidgetPost.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parseWidgetPost.spec.d.ts","sourceRoot":"","sources":["../../src/utils/parseWidgetPost.spec.ts"],"names":[],"mappings":""}