@athenaintel/react 0.59.0 → 0.60.0

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 (118) hide show
  1. package/README.md +52 -19
  2. package/dist/agent-runtime/src/composer-markdown.cjs +0 -16
  3. package/dist/agent-runtime/src/composer-markdown.cjs.map +1 -1
  4. package/dist/agent-runtime/src/composer-markdown.js +1 -17
  5. package/dist/agent-runtime/src/composer-markdown.js.map +1 -1
  6. package/dist/agent-runtime/src/named-agents.js +1 -1
  7. package/dist/agent-runtime/src/offline-status.cjs.map +1 -1
  8. package/dist/agent-runtime/src/offline-status.d.ts +27 -0
  9. package/dist/agent-runtime/src/offline-status.js.map +1 -1
  10. package/dist/agent-runtime/src/tool-metadata.cjs +7 -0
  11. package/dist/agent-runtime/src/tool-metadata.cjs.map +1 -1
  12. package/dist/agent-runtime/src/tool-metadata.js +7 -0
  13. package/dist/agent-runtime/src/tool-metadata.js.map +1 -1
  14. package/dist/chat/AthenaChat.cjs +15 -5
  15. package/dist/chat/AthenaChat.cjs.map +1 -1
  16. package/dist/chat/AthenaChat.js +16 -6
  17. package/dist/chat/AthenaChat.js.map +1 -1
  18. package/dist/chat-ui/index.cjs +2 -0
  19. package/dist/chat-ui/index.cjs.map +1 -1
  20. package/dist/chat-ui/index.d.ts +1 -0
  21. package/dist/chat-ui/index.js +2 -0
  22. package/dist/chat-ui/index.js.map +1 -1
  23. package/dist/chat-ui/mentions/mention-chip.cjs +9 -3
  24. package/dist/chat-ui/mentions/mention-chip.cjs.map +1 -1
  25. package/dist/chat-ui/mentions/mention-chip.js +9 -3
  26. package/dist/chat-ui/mentions/mention-chip.js.map +1 -1
  27. package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs +18 -2
  28. package/dist/chat-ui/mentions/suggestions/components/mention-icon.cjs.map +1 -1
  29. package/dist/chat-ui/mentions/suggestions/components/mention-icon.d.ts +10 -1
  30. package/dist/chat-ui/mentions/suggestions/components/mention-icon.js +19 -3
  31. package/dist/chat-ui/mentions/suggestions/components/mention-icon.js.map +1 -1
  32. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs +9 -0
  33. package/dist/chat-ui/mentions/suggestions/data/api-client.cjs.map +1 -1
  34. package/dist/chat-ui/mentions/suggestions/data/api-client.d.ts +6 -0
  35. package/dist/chat-ui/mentions/suggestions/data/api-client.js +9 -0
  36. package/dist/chat-ui/mentions/suggestions/data/api-client.js.map +1 -1
  37. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.cjs +89 -0
  38. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.cjs.map +1 -0
  39. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.d.ts +8 -0
  40. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.js +89 -0
  41. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icon-names.generated.js.map +1 -0
  42. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs +140 -116
  43. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.cjs.map +1 -1
  44. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.d.ts +46 -12
  45. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js +141 -117
  46. package/dist/chat-ui/mentions/suggestions/data/sources/asset-type-icons.js.map +1 -1
  47. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs +37 -6
  48. package/dist/chat-ui/mentions/suggestions/data/sources/index.cjs.map +1 -1
  49. package/dist/chat-ui/mentions/suggestions/data/sources/index.js +39 -8
  50. package/dist/chat-ui/mentions/suggestions/data/sources/index.js.map +1 -1
  51. package/dist/chat-ui/mentions/use-asset-icon-app-url.cjs +12 -0
  52. package/dist/chat-ui/mentions/use-asset-icon-app-url.cjs.map +1 -0
  53. package/dist/chat-ui/mentions/use-asset-icon-app-url.d.ts +8 -0
  54. package/dist/chat-ui/mentions/use-asset-icon-app-url.js +12 -0
  55. package/dist/chat-ui/mentions/use-asset-icon-app-url.js.map +1 -0
  56. package/dist/collab/client.cjs +24 -1
  57. package/dist/collab/client.cjs.map +1 -1
  58. package/dist/collab/client.d.ts +16 -0
  59. package/dist/collab/client.js +24 -1
  60. package/dist/collab/client.js.map +1 -1
  61. package/dist/composer/attached-references.js +1 -1
  62. package/dist/composer/staged-message-metadata.cjs +12 -0
  63. package/dist/composer/staged-message-metadata.cjs.map +1 -0
  64. package/dist/composer/staged-message-metadata.d.ts +15 -0
  65. package/dist/composer/staged-message-metadata.js +12 -0
  66. package/dist/composer/staged-message-metadata.js.map +1 -0
  67. package/dist/data/athena-request.cjs +2 -0
  68. package/dist/data/athena-request.cjs.map +1 -1
  69. package/dist/data/athena-request.js +2 -0
  70. package/dist/data/athena-request.js.map +1 -1
  71. package/dist/provider/AthenaProvider.cjs +4 -3
  72. package/dist/provider/AthenaProvider.cjs.map +1 -1
  73. package/dist/provider/AthenaProvider.js +4 -3
  74. package/dist/provider/AthenaProvider.js.map +1 -1
  75. package/dist/react/package.json.cjs +1 -1
  76. package/dist/react/package.json.js +1 -1
  77. package/dist/references/src/anchors/parse.cjs +11 -1
  78. package/dist/references/src/anchors/parse.cjs.map +1 -1
  79. package/dist/references/src/anchors/parse.js +11 -1
  80. package/dist/references/src/anchors/parse.js.map +1 -1
  81. package/dist/references/src/anchors/schemas.d.ts +1 -0
  82. package/dist/references/src/anchors/serialize.cjs +1 -0
  83. package/dist/references/src/anchors/serialize.cjs.map +1 -1
  84. package/dist/references/src/anchors/serialize.js +1 -0
  85. package/dist/references/src/anchors/serialize.js.map +1 -1
  86. package/dist/references/src/anchors/types.cjs.map +1 -1
  87. package/dist/references/src/anchors/types.d.ts +9 -0
  88. package/dist/references/src/anchors/types.js.map +1 -1
  89. package/dist/references/src/schemas.d.ts +2 -0
  90. package/dist/runtime/useAthenaStatewireRuntime.cjs +6 -8
  91. package/dist/runtime/useAthenaStatewireRuntime.cjs.map +1 -1
  92. package/dist/runtime/useAthenaStatewireRuntime.js +6 -8
  93. package/dist/runtime/useAthenaStatewireRuntime.js.map +1 -1
  94. package/dist/threads/statewire-thread-list.cjs +14 -2
  95. package/dist/threads/statewire-thread-list.cjs.map +1 -1
  96. package/dist/threads/statewire-thread-list.d.ts +11 -2
  97. package/dist/threads/statewire-thread-list.js +14 -2
  98. package/dist/threads/statewire-thread-list.js.map +1 -1
  99. package/dist/tools/drive-tool-uis.cjs +8 -4
  100. package/dist/tools/drive-tool-uis.cjs.map +1 -1
  101. package/dist/tools/drive-tool-uis.d.ts +5 -4
  102. package/dist/tools/drive-tool-uis.js +9 -5
  103. package/dist/tools/drive-tool-uis.js.map +1 -1
  104. package/dist/version.cjs +4 -0
  105. package/dist/version.cjs.map +1 -1
  106. package/dist/version.d.ts +9 -0
  107. package/dist/version.js +4 -0
  108. package/dist/version.js.map +1 -1
  109. package/dist/workbench/live-desktop-api.cjs +2 -1
  110. package/dist/workbench/live-desktop-api.cjs.map +1 -1
  111. package/dist/workbench/live-desktop-api.js +2 -1
  112. package/dist/workbench/live-desktop-api.js.map +1 -1
  113. package/dist/workbench/session-workspace-api.cjs +7 -2
  114. package/dist/workbench/session-workspace-api.cjs.map +1 -1
  115. package/dist/workbench/session-workspace-api.d.ts +10 -0
  116. package/dist/workbench/session-workspace-api.js +7 -2
  117. package/dist/workbench/session-workspace-api.js.map +1 -1
  118. package/package.json +1 -1
@@ -1,133 +1,157 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- let iconBasePath = null;
3
+ const assetTypeIconNames_generated = require("./asset-type-icon-names.generated.cjs");
4
+ let hostIconBasePath = null;
4
5
  function configureAssetIconBasePath({
5
6
  basePath
6
7
  }) {
7
- iconBasePath = basePath ? basePath.replace(/\/*$/, "/") : basePath;
8
+ hostIconBasePath = basePath ? basePath.replace(/\/*$/, "/") : null;
9
+ }
10
+ function athenaAppAssetIconBasePath({
11
+ appUrl
12
+ }) {
13
+ if (!(appUrl == null ? void 0 : appUrl.trim())) return null;
14
+ try {
15
+ const base = new URL("/assets/icons/files/", appUrl);
16
+ return base.protocol === "https:" || base.protocol === "http:" ? base.toString() : null;
17
+ } catch {
18
+ return null;
19
+ }
20
+ }
21
+ const FILES_DIR = "files/";
22
+ function iconUrl({
23
+ icon,
24
+ appUrl
25
+ }) {
26
+ const appBasePath = athenaAppAssetIconBasePath({ appUrl });
27
+ if (/^ic[-_]/.test(icon)) {
28
+ const basePath = hostIconBasePath ?? appBasePath;
29
+ return basePath ? `${basePath}${icon}.svg` : void 0;
30
+ }
31
+ const filesBasePath = appBasePath ?? hostIconBasePath;
32
+ if (!filesBasePath) return void 0;
33
+ return filesBasePath.endsWith(`/${FILES_DIR}`) ? `${filesBasePath.slice(0, -FILES_DIR.length)}apps/${icon}.svg` : `${filesBasePath}${icon}.svg`;
34
+ }
35
+ function assetTypeIconName(assetType) {
36
+ const key = assetType == null ? void 0 : assetType.toLowerCase();
37
+ return key && Object.hasOwn(assetTypeIconNames_generated.ASSET_TYPE_ICON_NAMES, key) ? assetTypeIconNames_generated.ASSET_TYPE_ICON_NAMES[key] ?? assetTypeIconNames_generated.DEFAULT_ASSET_TYPE_ICON : assetTypeIconNames_generated.DEFAULT_ASSET_TYPE_ICON;
38
+ }
39
+ function assetTypeToThumb(assetType, { appUrl } = {}) {
40
+ return iconUrl({ icon: assetTypeIconName(assetType), appUrl });
41
+ }
42
+ const EMAIL_ASSET_TYPES = /* @__PURE__ */ new Set([
43
+ "email",
44
+ "email_draft",
45
+ "email_message",
46
+ "live_email_thread"
47
+ ]);
48
+ function isEmailAssetType(assetType) {
49
+ return !!assetType && EMAIL_ASSET_TYPES.has(assetType.toLowerCase());
50
+ }
51
+ function recordOf(value) {
52
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
53
+ }
54
+ const LANE_PREFIX = /^paragon_/;
55
+ const LANE_SUFFIX = /_(direct(_v\d+)?|paragon|live)$/;
56
+ function mailboxLogo(metadata) {
57
+ var _a, _b, _c;
58
+ const record = recordOf(metadata);
59
+ if (!record) return null;
60
+ const provider = ((_a = recordOf(record.liveAsset)) == null ? void 0 : _a.provider) ?? ((_b = recordOf(record.email)) == null ? void 0 : _b.provider) ?? ((_c = recordOf(record.email_draft)) == null ? void 0 : _c.provider);
61
+ if (typeof provider !== "string") return null;
62
+ const name = provider.trim().toLowerCase().replace(LANE_PREFIX, "").replace(LANE_SUFFIX, "");
63
+ if (name === "gmail" || name === "google") return "gmail";
64
+ if (name === "outlook" || name === "microsoft_graph") return "outlook";
65
+ return null;
66
+ }
67
+ function emailProviderThumb({
68
+ assetType,
69
+ metadata,
70
+ appUrl
71
+ }) {
72
+ if (!isEmailAssetType(assetType)) return void 0;
73
+ const logo = mailboxLogo(metadata);
74
+ return logo ? iconUrl({ icon: logo, appUrl }) : void 0;
8
75
  }
9
- const ASSET_TYPE_ICON_FILE = {
10
- // Documents
11
- folder: "ic-folder",
12
- txt: "ic-txt",
13
- document: "ic-word",
14
- word_document: "ic-word",
15
- markdown: "ic-md",
16
- pdf: "ic-pdf",
17
- html: "ic-html",
18
- web_page: "ic-html",
19
- yaml: "ic-yaml",
20
- json: "ic-json",
21
- // Spreadsheets
22
- spreadsheet: "ic-excel",
23
- table: "ic-table",
24
- // Media
25
- image: "ic-img",
26
- audio: "ic-audio",
27
- video: "ic-video",
28
- voice_memo: "ic-voice_memo",
29
- // Presentations: the deck under its canonical `presentation` type, its
30
- // pre-2026-09-21 spelling (still on the wire and in persisted references)
31
- // and the pre-split label; plus the raw upload.
32
- powerpoint_deck: "ic-power_point",
33
- presentation: "ic-power_point",
34
- presentation_pptx_studio: "ic-power_point",
35
- pptx: "ic-power_point",
36
- // Email & Calendar
37
- email: "ic-mail",
38
- email_message: "ic-mail",
39
- live_email_thread: "ic-mail",
40
- live_calendar_event: "ic-mail",
41
- // Code
42
- python: "ic-py",
43
- javascript: "ic-js",
44
- typescript: "ic-code",
45
- jsx: "ic-code",
46
- tsx: "ic-code",
47
- css: "ic-code",
48
- java: "ic-code",
49
- c: "ic-code",
50
- cpp: "ic-code",
51
- csharp: "ic-code",
52
- ruby: "ic-code",
53
- go: "ic-code",
54
- swift: "ic-code",
55
- php: "ic-code",
56
- rust: "ic-code",
57
- vue: "ic-code",
58
- // Structured data
59
- database: "ic-snippet",
60
- schema: "ic-schema",
61
- catalog: "ic-db",
62
- drive: "ic-db",
63
- query_snippet: "ic-snippet",
64
- semantic_model: "ic-db",
65
- dataset: "ic-db",
66
- // Meetings & Calls
67
- meeting: "ic-meeting",
68
- video_session: "ic-meeting",
69
- phone_call: "ic-phonecall",
70
- // Sessions & Devices
71
- session: "ic-session",
72
- browse_session: "ic-html",
73
- computer: "ic-computer",
74
- desktop_session: "ic-desktop_session",
75
- mobile_session: "ic-mobile_session",
76
- // Projects & Profiles
77
- project: "ic-project",
78
- browse_profile: "ic-profile",
79
- // Workflows & Automation
80
- aop: "ic-flow",
81
- playbook: "ic-playbook",
82
- policy: "ic-policy",
83
- transform_project: "ic-transform_project",
84
- // Collections & Notebooks
85
- collection: "ic-collection",
86
- notebook: "ic-notebook",
87
- // UI & Apps
88
- user_interface: "ic-app",
89
- application: "ic-application",
90
- canvas: "ic-canvas",
91
- dashboard: "ic-dashboard",
92
- figure: "ic_figure",
93
- // People & Companies
94
- person: "ic-person",
95
- company: "ic-company",
96
- // Misc
97
- prompt: "ic-ai",
98
- skill: "ic-skill",
99
- spaces: "ic-spaces",
100
- secret: "ic-secret",
101
- photoshop: "ic-pts",
102
- illustrator: "ic-ai",
103
- // Google Drive / SharePoint / Salesforce
104
- gdrive_folder: "ic-folder",
105
- gdrive_file: "ic-file",
106
- salesforce_record: "ic-db",
107
- salesforce_file: "ic-db"
108
- };
109
76
  const ASSET_TYPE_LUCIDE_FALLBACK = {
110
- folder: "folder",
111
- spreadsheet: "sheet",
112
- image: "image",
113
- video: "video",
77
+ aop: "workflow",
78
+ application: "layout-grid",
114
79
  audio: "headphones",
115
- email: "mail",
80
+ automation: "zap",
81
+ browse_profile: "globe",
82
+ browse_session: "globe",
83
+ canvas: "palette",
84
+ catalog: "database",
85
+ collab_agent: "bot",
86
+ collab_source: "database",
87
+ collab_toolkit: "package",
88
+ collection: "library",
89
+ computer: "monitor",
90
+ dashboard: "layout-dashboard",
116
91
  database: "database",
117
- project: "folder-kanban",
92
+ design_system: "palette",
93
+ desktop_session: "monitor",
94
+ device: "smartphone",
95
+ document: "file-text",
96
+ drive: "hard-drive",
97
+ email: "mail",
98
+ email_draft: "mail",
99
+ email_message: "mail",
100
+ environment: "server",
101
+ figure: "chart-bar",
102
+ folder: "folder",
103
+ gdrive_folder: "folder",
104
+ generic_doc: "file-text",
105
+ image: "image",
106
+ json: "file-code",
107
+ lakehouse_namespace: "database",
108
+ lakehouse_sync: "workflow",
109
+ lakehouse_table: "table",
110
+ live_calendar_event: "calendar",
111
+ live_email_thread: "mail",
112
+ markdown: "file-text",
118
113
  meeting: "video",
119
- user_interface: "layout"
114
+ mobile_session: "smartphone",
115
+ notebook: "book-open",
116
+ olympus_drive: "hard-drive",
117
+ pdf: "file-text",
118
+ person: "user",
119
+ phone_call: "phone",
120
+ playbook: "book-open",
121
+ policy: "check-square",
122
+ powerpoint_deck: "presentation",
123
+ pptx: "presentation",
124
+ presentation: "presentation",
125
+ presentation_pptx_studio: "presentation",
126
+ project: "folder-kanban",
127
+ python: "file-code",
128
+ query_snippet: "database",
129
+ script: "file-code",
130
+ secret: "key",
131
+ semantic_model: "database",
132
+ session: "message-square",
133
+ skill: "sparkles",
134
+ spreadsheet: "sheet",
135
+ table: "table",
136
+ transform_project: "workflow",
137
+ txt: "file-text",
138
+ user_interface: "layout",
139
+ video: "video",
140
+ video_session: "video",
141
+ voice_memo: "mic",
142
+ web_page: "globe",
143
+ word_document: "file-text",
144
+ yaml: "file-code"
120
145
  };
121
- function assetTypeToThumb(assetType) {
122
- if (!iconBasePath) return void 0;
123
- const name = (assetType ? ASSET_TYPE_ICON_FILE[assetType.toLowerCase()] : void 0) ?? "ic-file";
124
- return `${iconBasePath}${name}.svg`;
125
- }
126
146
  function assetTypeToIcon(assetType) {
127
- if (!assetType) return "file";
128
- return ASSET_TYPE_LUCIDE_FALLBACK[assetType.toLowerCase()] ?? "file";
147
+ const key = assetType == null ? void 0 : assetType.toLowerCase();
148
+ if (!key || !Object.hasOwn(ASSET_TYPE_LUCIDE_FALLBACK, key)) return "file";
149
+ return ASSET_TYPE_LUCIDE_FALLBACK[key] ?? "file";
129
150
  }
130
151
  exports.assetTypeToIcon = assetTypeToIcon;
131
152
  exports.assetTypeToThumb = assetTypeToThumb;
153
+ exports.athenaAppAssetIconBasePath = athenaAppAssetIconBasePath;
132
154
  exports.configureAssetIconBasePath = configureAssetIconBasePath;
155
+ exports.emailProviderThumb = emailProviderThumb;
156
+ exports.isEmailAssetType = isEmailAssetType;
133
157
  //# sourceMappingURL=asset-type-icons.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-type-icons.cjs","sources":["../../../../../../src/chat-ui/mentions/suggestions/data/sources/asset-type-icons.ts"],"sourcesContent":["/**\n * Maps Athena asset types to SVG icon file names.\n *\n * The SVG files are bundled by the host app, which declares where they are\n * served from via `configureAssetIconBasePath`. Hosts that don't bundle them\n * fall back to the Lucide icons carried on every menu item.\n */\n\nlet iconBasePath: string | null = null;\n\n/**\n * Point the mention UI at the host's copy of the asset-type SVGs.\n * `basePath` is resolved against the host document; a trailing \"/\" is added\n * when the caller omits it.\n */\nexport function configureAssetIconBasePath({\n basePath,\n}: {\n basePath: string | null;\n}): void {\n iconBasePath = basePath ? basePath.replace(/\\/*$/, \"/\") : basePath;\n}\n\nconst ASSET_TYPE_ICON_FILE: Record<string, string> = {\n // Documents\n folder: \"ic-folder\",\n txt: \"ic-txt\",\n document: \"ic-word\",\n word_document: \"ic-word\",\n markdown: \"ic-md\",\n pdf: \"ic-pdf\",\n html: \"ic-html\",\n web_page: \"ic-html\",\n yaml: \"ic-yaml\",\n json: \"ic-json\",\n\n // Spreadsheets\n spreadsheet: \"ic-excel\",\n table: \"ic-table\",\n\n // Media\n image: \"ic-img\",\n audio: \"ic-audio\",\n video: \"ic-video\",\n voice_memo: \"ic-voice_memo\",\n\n // Presentations: the deck under its canonical `presentation` type, its\n // pre-2026-09-21 spelling (still on the wire and in persisted references)\n // and the pre-split label; plus the raw upload.\n powerpoint_deck: \"ic-power_point\",\n presentation: \"ic-power_point\",\n presentation_pptx_studio: \"ic-power_point\",\n pptx: \"ic-power_point\",\n\n // Email & Calendar\n email: \"ic-mail\",\n email_message: \"ic-mail\",\n live_email_thread: \"ic-mail\",\n live_calendar_event: \"ic-mail\",\n\n // Code\n python: \"ic-py\",\n javascript: \"ic-js\",\n typescript: \"ic-code\",\n jsx: \"ic-code\",\n tsx: \"ic-code\",\n css: \"ic-code\",\n java: \"ic-code\",\n c: \"ic-code\",\n cpp: \"ic-code\",\n csharp: \"ic-code\",\n ruby: \"ic-code\",\n go: \"ic-code\",\n swift: \"ic-code\",\n php: \"ic-code\",\n rust: \"ic-code\",\n vue: \"ic-code\",\n\n // Structured data\n database: \"ic-snippet\",\n schema: \"ic-schema\",\n catalog: \"ic-db\",\n drive: \"ic-db\",\n query_snippet: \"ic-snippet\",\n semantic_model: \"ic-db\",\n dataset: \"ic-db\",\n\n // Meetings & Calls\n meeting: \"ic-meeting\",\n video_session: \"ic-meeting\",\n phone_call: \"ic-phonecall\",\n\n // Sessions & Devices\n session: \"ic-session\",\n browse_session: \"ic-html\",\n computer: \"ic-computer\",\n desktop_session: \"ic-desktop_session\",\n mobile_session: \"ic-mobile_session\",\n\n // Projects & Profiles\n project: \"ic-project\",\n browse_profile: \"ic-profile\",\n\n // Workflows & Automation\n aop: \"ic-flow\",\n playbook: \"ic-playbook\",\n policy: \"ic-policy\",\n transform_project: \"ic-transform_project\",\n\n // Collections & Notebooks\n collection: \"ic-collection\",\n notebook: \"ic-notebook\",\n\n // UI & Apps\n user_interface: \"ic-app\",\n application: \"ic-application\",\n canvas: \"ic-canvas\",\n dashboard: \"ic-dashboard\",\n figure: \"ic_figure\",\n\n // People & Companies\n person: \"ic-person\",\n company: \"ic-company\",\n\n // Misc\n prompt: \"ic-ai\",\n skill: \"ic-skill\",\n spaces: \"ic-spaces\",\n secret: \"ic-secret\",\n photoshop: \"ic-pts\",\n illustrator: \"ic-ai\",\n\n // Google Drive / SharePoint / Salesforce\n gdrive_folder: \"ic-folder\",\n gdrive_file: \"ic-file\",\n salesforce_record: \"ic-db\",\n salesforce_file: \"ic-db\",\n};\n\nconst ASSET_TYPE_LUCIDE_FALLBACK: Record<string, string> = {\n folder: \"folder\",\n spreadsheet: \"sheet\",\n image: \"image\",\n video: \"video\",\n audio: \"headphones\",\n email: \"mail\",\n database: \"database\",\n project: \"folder-kanban\",\n meeting: \"video\",\n user_interface: \"layout\",\n};\n\n/**\n * Get the SVG thumbnail URL for an Athena asset type, or undefined when the\n * host app does not bundle the icon files.\n */\nexport function assetTypeToThumb(\n assetType: string | null | undefined,\n): string | undefined {\n if (!iconBasePath) return undefined;\n const name: string =\n (assetType ? ASSET_TYPE_ICON_FILE[assetType.toLowerCase()] : undefined) ??\n \"ic-file\";\n return `${iconBasePath}${name}.svg`;\n}\n\n/**\n * Get Lucide icon name fallback for an asset type.\n * Used when thumbnailUrl can't load.\n */\nexport function assetTypeToIcon(assetType: string | null | undefined): string {\n if (!assetType) return \"file\";\n return ASSET_TYPE_LUCIDE_FALLBACK[assetType.toLowerCase()] ?? \"file\";\n}\n"],"names":[],"mappings":";;AAQA,IAAI,eAA8B;AAO3B,SAAS,2BAA2B;AAAA,EACzC;AACF,GAES;AACP,iBAAe,WAAW,SAAS,QAAQ,QAAQ,GAAG,IAAI;AAC5D;AAEA,MAAM,uBAA+C;AAAA;AAAA,EAEnD,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,UAAU;AAAA,EACV,eAAe;AAAA,EACf,UAAU;AAAA,EACV,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,M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AAQ;AAAA,EACR,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,aAAa;AAAA;AAAA,EAGb,eAAe;AAAA,EACf,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,iBAAiB;AACnB;AAEA,MAAM,6BAAqD;AAAA,EACzD,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AAAA,EACT,gBAAgB;AAClB;AAMO,SAAS,iBACd,WACoB;AACpB,MAAI,CAAC,aAAc,QAAO;AAC1B,QAAM,QACH,YAAY,qBAAqB,UAAU,YAAA,CAAa,IAAI,WAC7D;AACF,SAAO,GAAG,YAAY,GAAG,IAAI;AAC/B;AAMO,SAAS,gBAAgB,WAA8C;AAC5E,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,2BAA2B,UAAU,YAAA,CAAa,KAAK;AAChE;;;;"}
1
+ {"version":3,"file":"asset-type-icons.cjs","sources":["../../../../../../src/chat-ui/mentions/suggestions/data/sources/asset-type-icons.ts"],"sourcesContent":["/**\n * Athena's asset-type icons: the SVG Olympus draws for each asset type.\n *\n * The type → icon table is Olympus's own: `ASSET_TYPE_ICON_NAMES`\n * (`asset-type-icon-names.generated.ts`), generated from its\n * `AthenaTypeToThumb` by Olympus's parity test, which writes the same table\n * into `@athenaintel/sheets` and fails when either drifts. So the `@` menu, the\n * mention chips and the drive cards draw the icon Olympus draws for every type.\n *\n * Where the SVGs load from:\n * - type glyphs (`ic-…`): a host's own copy when it names one with\n * `configureAssetIconBasePath` (the Chrome extension), else the Athena web\n * app the chat talks to (`appUrl`, the provider's: `useAssetIconAppUrl`),\n * which serves the public files Olympus draws at `<appUrl>/assets/icons/files/`;\n * - brand logos (Power BI, Slack, Gmail, Outlook) sit in `apps/` beside them:\n * from that app when the chat names one (a host's copy may carry only the\n * glyphs), else beside the host's copy.\n *\n * With neither there is no SVG, and callers draw the type's Lucide icon\n * (`assetTypeToIcon`). `MentionIcon`, the chips and the drive cards also fall\n * back to it when an SVG cannot load (a strict CSP, offline).\n */\n\nimport {\n ASSET_TYPE_ICON_NAMES,\n DEFAULT_ASSET_TYPE_ICON,\n} from \"./asset-type-icon-names.generated\";\n\nlet hostIconBasePath: string | null = null;\n\n/**\n * Point the asset-type icons at the host's own copy of Olympus's\n * `assets/icons/files/` SVGs. `basePath` is resolved against the host\n * document; a trailing \"/\" is added when the caller omits it. `null` drops the\n * host copy: the icons then load from the Athena web app the chat talks to.\n */\nexport function configureAssetIconBasePath({\n basePath,\n}: {\n basePath: string | null;\n}): void {\n hostIconBasePath = basePath ? basePath.replace(/\\/*$/, \"/\") : null;\n}\n\n/** Where the Athena web app at `appUrl` serves the asset-type SVGs; null for an unusable URL. */\nexport function athenaAppAssetIconBasePath({\n appUrl,\n}: {\n appUrl: string | null | undefined;\n}): string | null {\n if (!appUrl?.trim()) return null;\n try {\n const base = new URL(\"/assets/icons/files/\", appUrl);\n return base.protocol === \"https:\" || base.protocol === \"http:\"\n ? base.toString()\n : null;\n } catch {\n return null;\n }\n}\n\nconst FILES_DIR = \"files/\";\n\n/** An icon's URL, from the host's copy or the chat's Athena web app (see the module doc). */\nfunction iconUrl({\n icon,\n appUrl,\n}: {\n icon: string;\n appUrl: string | null | undefined;\n}): string | undefined {\n const appBasePath = athenaAppAssetIconBasePath({ appUrl });\n if (/^ic[-_]/.test(icon)) {\n const basePath = hostIconBasePath ?? appBasePath;\n return basePath ? `${basePath}${icon}.svg` : undefined;\n }\n const filesBasePath = appBasePath ?? hostIconBasePath;\n if (!filesBasePath) return undefined;\n return filesBasePath.endsWith(`/${FILES_DIR}`)\n ? `${filesBasePath.slice(0, -FILES_DIR.length)}apps/${icon}.svg`\n : `${filesBasePath}${icon}.svg`;\n}\n\nfunction assetTypeIconName(assetType: string | null | undefined): string {\n const key = assetType?.toLowerCase();\n return key && Object.hasOwn(ASSET_TYPE_ICON_NAMES, key)\n ? (ASSET_TYPE_ICON_NAMES[key] ?? DEFAULT_ASSET_TYPE_ICON)\n : DEFAULT_ASSET_TYPE_ICON;\n}\n\n/**\n * The SVG URL of an asset type's icon, the one Olympus draws. `appUrl` is the\n * Athena web app the chat talks to (`useAssetIconAppUrl`); undefined when\n * neither it nor a host copy (`configureAssetIconBasePath`) is available.\n */\nexport function assetTypeToThumb(\n assetType: string | null | undefined,\n { appUrl }: { appUrl?: string | null } = {},\n): string | undefined {\n return iconUrl({ icon: assetTypeIconName(assetType), appUrl });\n}\n\nconst EMAIL_ASSET_TYPES: ReadonlySet<string> = new Set([\n \"email\",\n \"email_draft\",\n \"email_message\",\n \"live_email_thread\",\n]);\n\n/** Whether rows of this type can draw their mailbox's logo (`emailProviderThumb`). */\nexport function isEmailAssetType(assetType: string | null | undefined): boolean {\n return !!assetType && EMAIL_ASSET_TYPES.has(assetType.toLowerCase());\n}\n\nfunction recordOf(value: unknown): Record<string, unknown> | null {\n return value && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : null;\n}\n\nconst LANE_PREFIX = /^paragon_/;\nconst LANE_SUFFIX = /_(direct(_v\\d+)?|paragon|live)$/;\n\n/** Gmail or Outlook, from the provider an email asset records; null for any other or none. */\nfunction mailboxLogo(metadata: unknown): \"gmail\" | \"outlook\" | null {\n const record = recordOf(metadata);\n if (!record) return null;\n const provider: unknown =\n recordOf(record.liveAsset)?.provider ??\n recordOf(record.email)?.provider ??\n recordOf(record.email_draft)?.provider;\n if (typeof provider !== \"string\") return null;\n const name = provider.trim().toLowerCase().replace(LANE_PREFIX, \"\").replace(LANE_SUFFIX, \"\");\n if (name === \"gmail\" || name === \"google\") return \"gmail\";\n if (name === \"outlook\" || name === \"microsoft_graph\") return \"outlook\";\n return null;\n}\n\n/**\n * The Gmail or Outlook logo for an email asset whose mailbox provider its\n * metadata records (`liveAsset.provider`, the `email` block agora writes\n * beside it, or a draft's `email_draft` block), as Olympus draws it;\n * undefined otherwise, for the type's mail icon.\n */\nexport function emailProviderThumb({\n assetType,\n metadata,\n appUrl,\n}: {\n assetType: string | null | undefined;\n metadata: unknown;\n /** The Athena web app the chat talks to (`useAssetIconAppUrl`). */\n appUrl?: string | null;\n}): string | undefined {\n if (!isEmailAssetType(assetType)) return undefined;\n const logo = mailboxLogo(metadata);\n return logo ? iconUrl({ icon: logo, appUrl }) : undefined;\n}\n\n/**\n * The Lucide icon (a `MentionIcon` name) drawn for an asset type when its SVG\n * is not available: no icon source, or the SVG failed to load.\n */\nconst ASSET_TYPE_LUCIDE_FALLBACK: Record<string, string> = {\n aop: \"workflow\",\n application: \"layout-grid\",\n audio: \"headphones\",\n automation: \"zap\",\n browse_profile: \"globe\",\n browse_session: \"globe\",\n canvas: \"palette\",\n catalog: \"database\",\n collab_agent: \"bot\",\n collab_source: \"database\",\n collab_toolkit: \"package\",\n collection: \"library\",\n computer: \"monitor\",\n dashboard: \"layout-dashboard\",\n database: \"database\",\n design_system: \"palette\",\n desktop_session: \"monitor\",\n device: \"smartphone\",\n document: \"file-text\",\n drive: \"hard-drive\",\n email: \"mail\",\n email_draft: \"mail\",\n email_message: \"mail\",\n environment: \"server\",\n figure: \"chart-bar\",\n folder: \"folder\",\n gdrive_folder: \"folder\",\n generic_doc: \"file-text\",\n image: \"image\",\n json: \"file-code\",\n lakehouse_namespace: \"database\",\n lakehouse_sync: \"workflow\",\n lakehouse_table: \"table\",\n live_calendar_event: \"calendar\",\n live_email_thread: \"mail\",\n markdown: \"file-text\",\n meeting: \"video\",\n mobile_session: \"smartphone\",\n notebook: \"book-open\",\n olympus_drive: \"hard-drive\",\n pdf: \"file-text\",\n person: \"user\",\n phone_call: \"phone\",\n playbook: \"book-open\",\n policy: \"check-square\",\n powerpoint_deck: \"presentation\",\n pptx: \"presentation\",\n presentation: \"presentation\",\n presentation_pptx_studio: \"presentation\",\n project: \"folder-kanban\",\n python: \"file-code\",\n query_snippet: \"database\",\n script: \"file-code\",\n secret: \"key\",\n semantic_model: \"database\",\n session: \"message-square\",\n skill: \"sparkles\",\n spreadsheet: \"sheet\",\n table: \"table\",\n transform_project: \"workflow\",\n txt: \"file-text\",\n user_interface: \"layout\",\n video: \"video\",\n video_session: \"video\",\n voice_memo: \"mic\",\n web_page: \"globe\",\n word_document: \"file-text\",\n yaml: \"file-code\",\n};\n\n/** The Lucide icon name for an asset type, drawn when its SVG is not available. */\nexport function assetTypeToIcon(assetType: string | null | undefined): string {\n const key = assetType?.toLowerCase();\n if (!key || !Object.hasOwn(ASSET_TYPE_LUCIDE_FALLBACK, key)) return \"file\";\n return ASSET_TYPE_LUCIDE_FALLBACK[key] ?? \"file\";\n}\n\n"],"names":["ASSET_TYPE_ICON_NAMES","DEFAULT_ASSET_TYPE_ICON"],"mappings":";;;AA4BA,IAAI,mBAAkC;AAQ/B,SAAS,2BAA2B;AAAA,EACzC;AACF,GAES;AACP,qBAAmB,WAAW,SAAS,QAAQ,QAAQ,GAAG,IAAI;AAChE;AAGO,SAAS,2BAA2B;AAAA,EACzC;AACF,GAEkB;AAChB,MAAI,EAAC,iCAAQ,QAAQ,QAAO;AAC5B,MAAI;AACF,UAAM,OAAO,IAAI,IAAI,wBAAwB,MAAM;AACnD,WAAO,KAAK,aAAa,YAAY,KAAK,aAAa,UACnD,KAAK,aACL;AAAA,EACN,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,MAAM,YAAY;AAGlB,SAAS,QAAQ;AAAA,EACf;AAAA,EACA;AACF,GAGuB;AACrB,QAAM,cAAc,2BAA2B,EAAE,QAAQ;AACzD,MAAI,UAAU,KAAK,IAAI,GAAG;AACxB,UAAM,WAAW,oBAAoB;AACrC,WAAO,WAAW,GAAG,QAAQ,GAAG,IAAI,SAAS;AAAA,EAC/C;AACA,QAAM,gBAAgB,eAAe;AACrC,MAAI,CAAC,cAAe,QAAO;AAC3B,SAAO,cAAc,SAAS,IAAI,SAAS,EAAE,IACzC,GAAG,cAAc,MAAM,GAAG,CAAC,UAAU,MAA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A,EAChB,OAAO;AAAA,EACP,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,eAAe;AAAA,EACf,MAAM;AACR;AAGO,SAAS,gBAAgB,WAA8C;AAC5E,QAAM,MAAM,uCAAW;AACvB,MAAI,CAAC,OAAO,CAAC,OAAO,OAAO,4BAA4B,GAAG,EAAG,QAAO;AACpE,SAAO,2BAA2B,GAAG,KAAK;AAC5C;;;;;;;"}
@@ -1,25 +1,59 @@
1
1
  /**
2
- * Maps Athena asset types to SVG icon file names.
2
+ * Athena's asset-type icons: the SVG Olympus draws for each asset type.
3
3
  *
4
- * The SVG files are bundled by the host app, which declares where they are
5
- * served from via `configureAssetIconBasePath`. Hosts that don't bundle them
6
- * fall back to the Lucide icons carried on every menu item.
4
+ * The type → icon table is Olympus's own: `ASSET_TYPE_ICON_NAMES`
5
+ * (`asset-type-icon-names.generated.ts`), generated from its
6
+ * `AthenaTypeToThumb` by Olympus's parity test, which writes the same table
7
+ * into `@athenaintel/sheets` and fails when either drifts. So the `@` menu, the
8
+ * mention chips and the drive cards draw the icon Olympus draws for every type.
9
+ *
10
+ * Where the SVGs load from:
11
+ * - type glyphs (`ic-…`): a host's own copy when it names one with
12
+ * `configureAssetIconBasePath` (the Chrome extension), else the Athena web
13
+ * app the chat talks to (`appUrl`, the provider's: `useAssetIconAppUrl`),
14
+ * which serves the public files Olympus draws at `<appUrl>/assets/icons/files/`;
15
+ * - brand logos (Power BI, Slack, Gmail, Outlook) sit in `apps/` beside them:
16
+ * from that app when the chat names one (a host's copy may carry only the
17
+ * glyphs), else beside the host's copy.
18
+ *
19
+ * With neither there is no SVG, and callers draw the type's Lucide icon
20
+ * (`assetTypeToIcon`). `MentionIcon`, the chips and the drive cards also fall
21
+ * back to it when an SVG cannot load (a strict CSP, offline).
7
22
  */
8
23
  /**
9
- * Point the mention UI at the host's copy of the asset-type SVGs.
10
- * `basePath` is resolved against the host document; a trailing "/" is added
11
- * when the caller omits it.
24
+ * Point the asset-type icons at the host's own copy of Olympus's
25
+ * `assets/icons/files/` SVGs. `basePath` is resolved against the host
26
+ * document; a trailing "/" is added when the caller omits it. `null` drops the
27
+ * host copy: the icons then load from the Athena web app the chat talks to.
12
28
  */
13
29
  export declare function configureAssetIconBasePath({ basePath, }: {
14
30
  basePath: string | null;
15
31
  }): void;
32
+ /** Where the Athena web app at `appUrl` serves the asset-type SVGs; null for an unusable URL. */
33
+ export declare function athenaAppAssetIconBasePath({ appUrl, }: {
34
+ appUrl: string | null | undefined;
35
+ }): string | null;
16
36
  /**
17
- * Get the SVG thumbnail URL for an Athena asset type, or undefined when the
18
- * host app does not bundle the icon files.
37
+ * The SVG URL of an asset type's icon, the one Olympus draws. `appUrl` is the
38
+ * Athena web app the chat talks to (`useAssetIconAppUrl`); undefined when
39
+ * neither it nor a host copy (`configureAssetIconBasePath`) is available.
19
40
  */
20
- export declare function assetTypeToThumb(assetType: string | null | undefined): string | undefined;
41
+ export declare function assetTypeToThumb(assetType: string | null | undefined, { appUrl }?: {
42
+ appUrl?: string | null;
43
+ }): string | undefined;
44
+ /** Whether rows of this type can draw their mailbox's logo (`emailProviderThumb`). */
45
+ export declare function isEmailAssetType(assetType: string | null | undefined): boolean;
21
46
  /**
22
- * Get Lucide icon name fallback for an asset type.
23
- * Used when thumbnailUrl can't load.
47
+ * The Gmail or Outlook logo for an email asset whose mailbox provider its
48
+ * metadata records (`liveAsset.provider`, the `email` block agora writes
49
+ * beside it, or a draft's `email_draft` block), as Olympus draws it;
50
+ * undefined otherwise, for the type's mail icon.
24
51
  */
52
+ export declare function emailProviderThumb({ assetType, metadata, appUrl, }: {
53
+ assetType: string | null | undefined;
54
+ metadata: unknown;
55
+ /** The Athena web app the chat talks to (`useAssetIconAppUrl`). */
56
+ appUrl?: string | null;
57
+ }): string | undefined;
58
+ /** The Lucide icon name for an asset type, drawn when its SVG is not available. */
25
59
  export declare function assetTypeToIcon(assetType: string | null | undefined): string;
@@ -1,133 +1,157 @@
1
- let iconBasePath = null;
1
+ import { ASSET_TYPE_ICON_NAMES, DEFAULT_ASSET_TYPE_ICON } from "./asset-type-icon-names.generated.js";
2
+ let hostIconBasePath = null;
2
3
  function configureAssetIconBasePath({
3
4
  basePath
4
5
  }) {
5
- iconBasePath = basePath ? basePath.replace(/\/*$/, "/") : basePath;
6
+ hostIconBasePath = basePath ? basePath.replace(/\/*$/, "/") : null;
7
+ }
8
+ function athenaAppAssetIconBasePath({
9
+ appUrl
10
+ }) {
11
+ if (!(appUrl == null ? void 0 : appUrl.trim())) return null;
12
+ try {
13
+ const base = new URL("/assets/icons/files/", appUrl);
14
+ return base.protocol === "https:" || base.protocol === "http:" ? base.toString() : null;
15
+ } catch {
16
+ return null;
17
+ }
18
+ }
19
+ const FILES_DIR = "files/";
20
+ function iconUrl({
21
+ icon,
22
+ appUrl
23
+ }) {
24
+ const appBasePath = athenaAppAssetIconBasePath({ appUrl });
25
+ if (/^ic[-_]/.test(icon)) {
26
+ const basePath = hostIconBasePath ?? appBasePath;
27
+ return basePath ? `${basePath}${icon}.svg` : void 0;
28
+ }
29
+ const filesBasePath = appBasePath ?? hostIconBasePath;
30
+ if (!filesBasePath) return void 0;
31
+ return filesBasePath.endsWith(`/${FILES_DIR}`) ? `${filesBasePath.slice(0, -FILES_DIR.length)}apps/${icon}.svg` : `${filesBasePath}${icon}.svg`;
32
+ }
33
+ function assetTypeIconName(assetType) {
34
+ const key = assetType == null ? void 0 : assetType.toLowerCase();
35
+ return key && Object.hasOwn(ASSET_TYPE_ICON_NAMES, key) ? ASSET_TYPE_ICON_NAMES[key] ?? DEFAULT_ASSET_TYPE_ICON : DEFAULT_ASSET_TYPE_ICON;
36
+ }
37
+ function assetTypeToThumb(assetType, { appUrl } = {}) {
38
+ return iconUrl({ icon: assetTypeIconName(assetType), appUrl });
39
+ }
40
+ const EMAIL_ASSET_TYPES = /* @__PURE__ */ new Set([
41
+ "email",
42
+ "email_draft",
43
+ "email_message",
44
+ "live_email_thread"
45
+ ]);
46
+ function isEmailAssetType(assetType) {
47
+ return !!assetType && EMAIL_ASSET_TYPES.has(assetType.toLowerCase());
48
+ }
49
+ function recordOf(value) {
50
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
51
+ }
52
+ const LANE_PREFIX = /^paragon_/;
53
+ const LANE_SUFFIX = /_(direct(_v\d+)?|paragon|live)$/;
54
+ function mailboxLogo(metadata) {
55
+ var _a, _b, _c;
56
+ const record = recordOf(metadata);
57
+ if (!record) return null;
58
+ const provider = ((_a = recordOf(record.liveAsset)) == null ? void 0 : _a.provider) ?? ((_b = recordOf(record.email)) == null ? void 0 : _b.provider) ?? ((_c = recordOf(record.email_draft)) == null ? void 0 : _c.provider);
59
+ if (typeof provider !== "string") return null;
60
+ const name = provider.trim().toLowerCase().replace(LANE_PREFIX, "").replace(LANE_SUFFIX, "");
61
+ if (name === "gmail" || name === "google") return "gmail";
62
+ if (name === "outlook" || name === "microsoft_graph") return "outlook";
63
+ return null;
64
+ }
65
+ function emailProviderThumb({
66
+ assetType,
67
+ metadata,
68
+ appUrl
69
+ }) {
70
+ if (!isEmailAssetType(assetType)) return void 0;
71
+ const logo = mailboxLogo(metadata);
72
+ return logo ? iconUrl({ icon: logo, appUrl }) : void 0;
6
73
  }
7
- const ASSET_TYPE_ICON_FILE = {
8
- // Documents
9
- folder: "ic-folder",
10
- txt: "ic-txt",
11
- document: "ic-word",
12
- word_document: "ic-word",
13
- markdown: "ic-md",
14
- pdf: "ic-pdf",
15
- html: "ic-html",
16
- web_page: "ic-html",
17
- yaml: "ic-yaml",
18
- json: "ic-json",
19
- // Spreadsheets
20
- spreadsheet: "ic-excel",
21
- table: "ic-table",
22
- // Media
23
- image: "ic-img",
24
- audio: "ic-audio",
25
- video: "ic-video",
26
- voice_memo: "ic-voice_memo",
27
- // Presentations: the deck under its canonical `presentation` type, its
28
- // pre-2026-09-21 spelling (still on the wire and in persisted references)
29
- // and the pre-split label; plus the raw upload.
30
- powerpoint_deck: "ic-power_point",
31
- presentation: "ic-power_point",
32
- presentation_pptx_studio: "ic-power_point",
33
- pptx: "ic-power_point",
34
- // Email & Calendar
35
- email: "ic-mail",
36
- email_message: "ic-mail",
37
- live_email_thread: "ic-mail",
38
- live_calendar_event: "ic-mail",
39
- // Code
40
- python: "ic-py",
41
- javascript: "ic-js",
42
- typescript: "ic-code",
43
- jsx: "ic-code",
44
- tsx: "ic-code",
45
- css: "ic-code",
46
- java: "ic-code",
47
- c: "ic-code",
48
- cpp: "ic-code",
49
- csharp: "ic-code",
50
- ruby: "ic-code",
51
- go: "ic-code",
52
- swift: "ic-code",
53
- php: "ic-code",
54
- rust: "ic-code",
55
- vue: "ic-code",
56
- // Structured data
57
- database: "ic-snippet",
58
- schema: "ic-schema",
59
- catalog: "ic-db",
60
- drive: "ic-db",
61
- query_snippet: "ic-snippet",
62
- semantic_model: "ic-db",
63
- dataset: "ic-db",
64
- // Meetings & Calls
65
- meeting: "ic-meeting",
66
- video_session: "ic-meeting",
67
- phone_call: "ic-phonecall",
68
- // Sessions & Devices
69
- session: "ic-session",
70
- browse_session: "ic-html",
71
- computer: "ic-computer",
72
- desktop_session: "ic-desktop_session",
73
- mobile_session: "ic-mobile_session",
74
- // Projects & Profiles
75
- project: "ic-project",
76
- browse_profile: "ic-profile",
77
- // Workflows & Automation
78
- aop: "ic-flow",
79
- playbook: "ic-playbook",
80
- policy: "ic-policy",
81
- transform_project: "ic-transform_project",
82
- // Collections & Notebooks
83
- collection: "ic-collection",
84
- notebook: "ic-notebook",
85
- // UI & Apps
86
- user_interface: "ic-app",
87
- application: "ic-application",
88
- canvas: "ic-canvas",
89
- dashboard: "ic-dashboard",
90
- figure: "ic_figure",
91
- // People & Companies
92
- person: "ic-person",
93
- company: "ic-company",
94
- // Misc
95
- prompt: "ic-ai",
96
- skill: "ic-skill",
97
- spaces: "ic-spaces",
98
- secret: "ic-secret",
99
- photoshop: "ic-pts",
100
- illustrator: "ic-ai",
101
- // Google Drive / SharePoint / Salesforce
102
- gdrive_folder: "ic-folder",
103
- gdrive_file: "ic-file",
104
- salesforce_record: "ic-db",
105
- salesforce_file: "ic-db"
106
- };
107
74
  const ASSET_TYPE_LUCIDE_FALLBACK = {
108
- folder: "folder",
109
- spreadsheet: "sheet",
110
- image: "image",
111
- video: "video",
75
+ aop: "workflow",
76
+ application: "layout-grid",
112
77
  audio: "headphones",
113
- email: "mail",
78
+ automation: "zap",
79
+ browse_profile: "globe",
80
+ browse_session: "globe",
81
+ canvas: "palette",
82
+ catalog: "database",
83
+ collab_agent: "bot",
84
+ collab_source: "database",
85
+ collab_toolkit: "package",
86
+ collection: "library",
87
+ computer: "monitor",
88
+ dashboard: "layout-dashboard",
114
89
  database: "database",
115
- project: "folder-kanban",
90
+ design_system: "palette",
91
+ desktop_session: "monitor",
92
+ device: "smartphone",
93
+ document: "file-text",
94
+ drive: "hard-drive",
95
+ email: "mail",
96
+ email_draft: "mail",
97
+ email_message: "mail",
98
+ environment: "server",
99
+ figure: "chart-bar",
100
+ folder: "folder",
101
+ gdrive_folder: "folder",
102
+ generic_doc: "file-text",
103
+ image: "image",
104
+ json: "file-code",
105
+ lakehouse_namespace: "database",
106
+ lakehouse_sync: "workflow",
107
+ lakehouse_table: "table",
108
+ live_calendar_event: "calendar",
109
+ live_email_thread: "mail",
110
+ markdown: "file-text",
116
111
  meeting: "video",
117
- user_interface: "layout"
112
+ mobile_session: "smartphone",
113
+ notebook: "book-open",
114
+ olympus_drive: "hard-drive",
115
+ pdf: "file-text",
116
+ person: "user",
117
+ phone_call: "phone",
118
+ playbook: "book-open",
119
+ policy: "check-square",
120
+ powerpoint_deck: "presentation",
121
+ pptx: "presentation",
122
+ presentation: "presentation",
123
+ presentation_pptx_studio: "presentation",
124
+ project: "folder-kanban",
125
+ python: "file-code",
126
+ query_snippet: "database",
127
+ script: "file-code",
128
+ secret: "key",
129
+ semantic_model: "database",
130
+ session: "message-square",
131
+ skill: "sparkles",
132
+ spreadsheet: "sheet",
133
+ table: "table",
134
+ transform_project: "workflow",
135
+ txt: "file-text",
136
+ user_interface: "layout",
137
+ video: "video",
138
+ video_session: "video",
139
+ voice_memo: "mic",
140
+ web_page: "globe",
141
+ word_document: "file-text",
142
+ yaml: "file-code"
118
143
  };
119
- function assetTypeToThumb(assetType) {
120
- if (!iconBasePath) return void 0;
121
- const name = (assetType ? ASSET_TYPE_ICON_FILE[assetType.toLowerCase()] : void 0) ?? "ic-file";
122
- return `${iconBasePath}${name}.svg`;
123
- }
124
144
  function assetTypeToIcon(assetType) {
125
- if (!assetType) return "file";
126
- return ASSET_TYPE_LUCIDE_FALLBACK[assetType.toLowerCase()] ?? "file";
145
+ const key = assetType == null ? void 0 : assetType.toLowerCase();
146
+ if (!key || !Object.hasOwn(ASSET_TYPE_LUCIDE_FALLBACK, key)) return "file";
147
+ return ASSET_TYPE_LUCIDE_FALLBACK[key] ?? "file";
127
148
  }
128
149
  export {
129
150
  assetTypeToIcon,
130
151
  assetTypeToThumb,
131
- configureAssetIconBasePath
152
+ athenaAppAssetIconBasePath,
153
+ configureAssetIconBasePath,
154
+ emailProviderThumb,
155
+ isEmailAssetType
132
156
  };
133
157
  //# sourceMappingURL=asset-type-icons.js.map