@base44/superagent-native 0.0.2 → 0.0.3

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 (306) hide show
  1. package/lib/commonjs/AgentSettingsPanel.js +123 -47
  2. package/lib/commonjs/AgentSettingsPanel.js.map +1 -1
  3. package/lib/commonjs/AgentSphereIcon.js +14 -118
  4. package/lib/commonjs/AgentSphereIcon.js.map +1 -1
  5. package/lib/commonjs/AttachmentPickerStatusModal.js +3 -2
  6. package/lib/commonjs/AttachmentPickerStatusModal.js.map +1 -1
  7. package/lib/commonjs/ChannelsPanel.js +66 -44
  8. package/lib/commonjs/ChannelsPanel.js.map +1 -1
  9. package/lib/commonjs/ConversationChat.js +11 -2
  10. package/lib/commonjs/ConversationChat.js.map +1 -1
  11. package/lib/commonjs/ConversationComposer.js +8 -7
  12. package/lib/commonjs/ConversationComposer.js.map +1 -1
  13. package/lib/commonjs/ConversationScreen.js +2 -0
  14. package/lib/commonjs/ConversationScreen.js.map +1 -1
  15. package/lib/commonjs/EditorDrawer.js +54 -24
  16. package/lib/commonjs/EditorDrawer.js.map +1 -1
  17. package/lib/commonjs/FilesPanel.js +56 -20
  18. package/lib/commonjs/FilesPanel.js.map +1 -1
  19. package/lib/commonjs/RenameAgentModal.js +2 -1
  20. package/lib/commonjs/RenameAgentModal.js.map +1 -1
  21. package/lib/commonjs/ShareAgentModal.js +11 -10
  22. package/lib/commonjs/ShareAgentModal.js.map +1 -1
  23. package/lib/commonjs/ShareAgentModal.styles.js +2 -2
  24. package/lib/commonjs/ShareAgentModal.styles.js.map +1 -1
  25. package/lib/commonjs/SuperagentHomeScreen.js +27 -9
  26. package/lib/commonjs/SuperagentHomeScreen.js.map +1 -1
  27. package/lib/commonjs/ToolApprovalCard.js +72 -14
  28. package/lib/commonjs/ToolApprovalCard.js.map +1 -1
  29. package/lib/commonjs/ToolCallSummary.js +14 -9
  30. package/lib/commonjs/ToolCallSummary.js.map +1 -1
  31. package/lib/commonjs/agentSphereAssets.js +327 -0
  32. package/lib/commonjs/agentSphereAssets.js.map +1 -0
  33. package/lib/commonjs/agentSphereStyles.js +3 -3
  34. package/lib/commonjs/agentSphereStyles.js.map +1 -1
  35. package/lib/commonjs/apiClient.js +7 -0
  36. package/lib/commonjs/apiClient.js.map +1 -1
  37. package/lib/commonjs/composerStyles.js +2 -2
  38. package/lib/commonjs/composerStyles.js.map +1 -1
  39. package/lib/commonjs/connectorBrandIcons.generated.js +625 -0
  40. package/lib/commonjs/connectorBrandIcons.generated.js.map +1 -0
  41. package/lib/commonjs/connectorBrandIcons.js +3 -55
  42. package/lib/commonjs/connectorBrandIcons.js.map +1 -1
  43. package/lib/commonjs/connectorCatalog.js +19 -1
  44. package/lib/commonjs/connectorCatalog.js.map +1 -1
  45. package/lib/commonjs/conversationParts.js +5 -4
  46. package/lib/commonjs/conversationParts.js.map +1 -1
  47. package/lib/commonjs/conversationRuntime.js +120 -12
  48. package/lib/commonjs/conversationRuntime.js.map +1 -1
  49. package/lib/commonjs/conversationStyles.js +2 -1
  50. package/lib/commonjs/conversationStyles.js.map +1 -1
  51. package/lib/commonjs/editorShellStyles.js +6 -2
  52. package/lib/commonjs/editorShellStyles.js.map +1 -1
  53. package/lib/commonjs/index.js +7 -0
  54. package/lib/commonjs/index.js.map +1 -1
  55. package/lib/commonjs/markdownStyles.js +2 -2
  56. package/lib/commonjs/markdownStyles.js.map +1 -1
  57. package/lib/commonjs/messageActionStyles.js +2 -2
  58. package/lib/commonjs/messageActionStyles.js.map +1 -1
  59. package/lib/commonjs/realtimeClient.js +4 -1
  60. package/lib/commonjs/realtimeClient.js.map +1 -1
  61. package/lib/commonjs/renameAgentModalStyles.js +2 -2
  62. package/lib/commonjs/renameAgentModalStyles.js.map +1 -1
  63. package/lib/commonjs/screenParts.js +24 -41
  64. package/lib/commonjs/screenParts.js.map +1 -1
  65. package/lib/commonjs/styles.js +71 -60
  66. package/lib/commonjs/styles.js.map +1 -1
  67. package/lib/commonjs/superagentApiClient.js +63 -18
  68. package/lib/commonjs/superagentApiClient.js.map +1 -1
  69. package/lib/commonjs/theme.js +249 -0
  70. package/lib/commonjs/theme.js.map +1 -0
  71. package/lib/commonjs/useSuperagentConversation.js +133 -20
  72. package/lib/commonjs/useSuperagentConversation.js.map +1 -1
  73. package/lib/commonjs/useSuperagentRuntime.js +167 -82
  74. package/lib/commonjs/useSuperagentRuntime.js.map +1 -1
  75. package/lib/module/AgentSettingsPanel.js +125 -49
  76. package/lib/module/AgentSettingsPanel.js.map +1 -1
  77. package/lib/module/AgentSphereIcon.js +15 -118
  78. package/lib/module/AgentSphereIcon.js.map +1 -1
  79. package/lib/module/AttachmentPickerStatusModal.js +4 -3
  80. package/lib/module/AttachmentPickerStatusModal.js.map +1 -1
  81. package/lib/module/ChannelsPanel.js +67 -45
  82. package/lib/module/ChannelsPanel.js.map +1 -1
  83. package/lib/module/ConversationChat.js +11 -2
  84. package/lib/module/ConversationChat.js.map +1 -1
  85. package/lib/module/ConversationComposer.js +8 -7
  86. package/lib/module/ConversationComposer.js.map +1 -1
  87. package/lib/module/ConversationScreen.js +2 -0
  88. package/lib/module/ConversationScreen.js.map +1 -1
  89. package/lib/module/EditorDrawer.js +55 -25
  90. package/lib/module/EditorDrawer.js.map +1 -1
  91. package/lib/module/FilesPanel.js +56 -20
  92. package/lib/module/FilesPanel.js.map +1 -1
  93. package/lib/module/RenameAgentModal.js +2 -1
  94. package/lib/module/RenameAgentModal.js.map +1 -1
  95. package/lib/module/ShareAgentModal.js +11 -10
  96. package/lib/module/ShareAgentModal.js.map +1 -1
  97. package/lib/module/ShareAgentModal.styles.js +2 -2
  98. package/lib/module/ShareAgentModal.styles.js.map +1 -1
  99. package/lib/module/SuperagentHomeScreen.js +27 -9
  100. package/lib/module/SuperagentHomeScreen.js.map +1 -1
  101. package/lib/module/ToolApprovalCard.js +72 -14
  102. package/lib/module/ToolApprovalCard.js.map +1 -1
  103. package/lib/module/ToolCallSummary.js +14 -9
  104. package/lib/module/ToolCallSummary.js.map +1 -1
  105. package/lib/module/agentSphereAssets.js +323 -0
  106. package/lib/module/agentSphereAssets.js.map +1 -0
  107. package/lib/module/agentSphereStyles.js +3 -3
  108. package/lib/module/agentSphereStyles.js.map +1 -1
  109. package/lib/module/apiClient.js +7 -0
  110. package/lib/module/apiClient.js.map +1 -1
  111. package/lib/module/composerStyles.js +2 -2
  112. package/lib/module/composerStyles.js.map +1 -1
  113. package/lib/module/connectorBrandIcons.generated.js +621 -0
  114. package/lib/module/connectorBrandIcons.generated.js.map +1 -0
  115. package/lib/module/connectorBrandIcons.js +1 -53
  116. package/lib/module/connectorBrandIcons.js.map +1 -1
  117. package/lib/module/connectorCatalog.js +17 -0
  118. package/lib/module/connectorCatalog.js.map +1 -1
  119. package/lib/module/conversationParts.js +5 -4
  120. package/lib/module/conversationParts.js.map +1 -1
  121. package/lib/module/conversationRuntime.js +118 -12
  122. package/lib/module/conversationRuntime.js.map +1 -1
  123. package/lib/module/conversationStyles.js +3 -2
  124. package/lib/module/conversationStyles.js.map +1 -1
  125. package/lib/module/editorShellStyles.js +6 -2
  126. package/lib/module/editorShellStyles.js.map +1 -1
  127. package/lib/module/index.js +1 -0
  128. package/lib/module/index.js.map +1 -1
  129. package/lib/module/markdownStyles.js +2 -2
  130. package/lib/module/markdownStyles.js.map +1 -1
  131. package/lib/module/messageActionStyles.js +2 -2
  132. package/lib/module/messageActionStyles.js.map +1 -1
  133. package/lib/module/realtimeClient.js +4 -1
  134. package/lib/module/realtimeClient.js.map +1 -1
  135. package/lib/module/renameAgentModalStyles.js +2 -2
  136. package/lib/module/renameAgentModalStyles.js.map +1 -1
  137. package/lib/module/screenParts.js +25 -42
  138. package/lib/module/screenParts.js.map +1 -1
  139. package/lib/module/styles.js +71 -60
  140. package/lib/module/styles.js.map +1 -1
  141. package/lib/module/superagentApiClient.js +63 -18
  142. package/lib/module/superagentApiClient.js.map +1 -1
  143. package/lib/module/theme.js +239 -0
  144. package/lib/module/theme.js.map +1 -0
  145. package/lib/module/useSuperagentConversation.js +135 -22
  146. package/lib/module/useSuperagentConversation.js.map +1 -1
  147. package/lib/module/useSuperagentRuntime.js +167 -82
  148. package/lib/module/useSuperagentRuntime.js.map +1 -1
  149. package/lib/typescript/commonjs/AgentSettingsPanel.d.ts.map +1 -1
  150. package/lib/typescript/commonjs/AgentSphereIcon.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/AttachmentPickerStatusModal.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/ChannelsPanel.d.ts.map +1 -1
  153. package/lib/typescript/commonjs/ConversationChat.d.ts +1 -1
  154. package/lib/typescript/commonjs/ConversationChat.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/ConversationComposer.d.ts.map +1 -1
  156. package/lib/typescript/commonjs/ConversationMessageList.d.ts +1 -1
  157. package/lib/typescript/commonjs/ConversationMessageList.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/ConversationScreen.d.ts +2 -1
  159. package/lib/typescript/commonjs/ConversationScreen.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/EditorDrawer.d.ts +1 -1
  161. package/lib/typescript/commonjs/EditorDrawer.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/FilesPanel.d.ts.map +1 -1
  163. package/lib/typescript/commonjs/RenameAgentModal.d.ts.map +1 -1
  164. package/lib/typescript/commonjs/ShareAgentModal.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/ShareAgentModal.styles.d.ts.map +1 -1
  166. package/lib/typescript/commonjs/SuperagentHomeScreen.d.ts.map +1 -1
  167. package/lib/typescript/commonjs/ToolApprovalCard.d.ts +3 -3
  168. package/lib/typescript/commonjs/ToolApprovalCard.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/ToolCallSummary.d.ts +1 -1
  170. package/lib/typescript/commonjs/ToolCallSummary.d.ts.map +1 -1
  171. package/lib/typescript/commonjs/agentSphereAssets.d.ts +2 -0
  172. package/lib/typescript/commonjs/agentSphereAssets.d.ts.map +1 -0
  173. package/lib/typescript/commonjs/agentSphereStyles.d.ts.map +1 -1
  174. package/lib/typescript/commonjs/apiClient.d.ts.map +1 -1
  175. package/lib/typescript/commonjs/composerStyles.d.ts.map +1 -1
  176. package/lib/typescript/commonjs/connectorBrandIcons.d.ts.map +1 -1
  177. package/lib/typescript/commonjs/connectorBrandIcons.generated.d.ts +2 -0
  178. package/lib/typescript/commonjs/connectorBrandIcons.generated.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/connectorCatalog.d.ts +2 -0
  180. package/lib/typescript/commonjs/connectorCatalog.d.ts.map +1 -1
  181. package/lib/typescript/commonjs/conversationParts.d.ts +1 -1
  182. package/lib/typescript/commonjs/conversationParts.d.ts.map +1 -1
  183. package/lib/typescript/commonjs/conversationRuntime.d.ts +6 -1
  184. package/lib/typescript/commonjs/conversationRuntime.d.ts.map +1 -1
  185. package/lib/typescript/commonjs/conversationStyles.d.ts.map +1 -1
  186. package/lib/typescript/commonjs/editorShellStyles.d.ts +4 -0
  187. package/lib/typescript/commonjs/editorShellStyles.d.ts.map +1 -1
  188. package/lib/typescript/commonjs/index.d.ts +2 -0
  189. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  190. package/lib/typescript/commonjs/markdownStyles.d.ts.map +1 -1
  191. package/lib/typescript/commonjs/messageActionStyles.d.ts.map +1 -1
  192. package/lib/typescript/commonjs/realtimeClient.d.ts.map +1 -1
  193. package/lib/typescript/commonjs/renameAgentModalStyles.d.ts.map +1 -1
  194. package/lib/typescript/commonjs/screenParts.d.ts +1 -1
  195. package/lib/typescript/commonjs/screenParts.d.ts.map +1 -1
  196. package/lib/typescript/commonjs/styles.d.ts +20 -11
  197. package/lib/typescript/commonjs/styles.d.ts.map +1 -1
  198. package/lib/typescript/commonjs/superagentApiClient.d.ts +2 -1
  199. package/lib/typescript/commonjs/superagentApiClient.d.ts.map +1 -1
  200. package/lib/typescript/commonjs/theme.d.ts +36 -0
  201. package/lib/typescript/commonjs/theme.d.ts.map +1 -0
  202. package/lib/typescript/commonjs/types.d.ts +16 -2
  203. package/lib/typescript/commonjs/types.d.ts.map +1 -1
  204. package/lib/typescript/commonjs/useSuperagentConversation.d.ts +3 -2
  205. package/lib/typescript/commonjs/useSuperagentConversation.d.ts.map +1 -1
  206. package/lib/typescript/commonjs/useSuperagentRuntime.d.ts +2 -1
  207. package/lib/typescript/commonjs/useSuperagentRuntime.d.ts.map +1 -1
  208. package/lib/typescript/module/AgentSettingsPanel.d.ts.map +1 -1
  209. package/lib/typescript/module/AgentSphereIcon.d.ts.map +1 -1
  210. package/lib/typescript/module/AttachmentPickerStatusModal.d.ts.map +1 -1
  211. package/lib/typescript/module/ChannelsPanel.d.ts.map +1 -1
  212. package/lib/typescript/module/ConversationChat.d.ts +1 -1
  213. package/lib/typescript/module/ConversationChat.d.ts.map +1 -1
  214. package/lib/typescript/module/ConversationComposer.d.ts.map +1 -1
  215. package/lib/typescript/module/ConversationMessageList.d.ts +1 -1
  216. package/lib/typescript/module/ConversationMessageList.d.ts.map +1 -1
  217. package/lib/typescript/module/ConversationScreen.d.ts +2 -1
  218. package/lib/typescript/module/ConversationScreen.d.ts.map +1 -1
  219. package/lib/typescript/module/EditorDrawer.d.ts +1 -1
  220. package/lib/typescript/module/EditorDrawer.d.ts.map +1 -1
  221. package/lib/typescript/module/FilesPanel.d.ts.map +1 -1
  222. package/lib/typescript/module/RenameAgentModal.d.ts.map +1 -1
  223. package/lib/typescript/module/ShareAgentModal.d.ts.map +1 -1
  224. package/lib/typescript/module/ShareAgentModal.styles.d.ts.map +1 -1
  225. package/lib/typescript/module/SuperagentHomeScreen.d.ts.map +1 -1
  226. package/lib/typescript/module/ToolApprovalCard.d.ts +3 -3
  227. package/lib/typescript/module/ToolApprovalCard.d.ts.map +1 -1
  228. package/lib/typescript/module/ToolCallSummary.d.ts +1 -1
  229. package/lib/typescript/module/ToolCallSummary.d.ts.map +1 -1
  230. package/lib/typescript/module/agentSphereAssets.d.ts +2 -0
  231. package/lib/typescript/module/agentSphereAssets.d.ts.map +1 -0
  232. package/lib/typescript/module/agentSphereStyles.d.ts.map +1 -1
  233. package/lib/typescript/module/apiClient.d.ts.map +1 -1
  234. package/lib/typescript/module/composerStyles.d.ts.map +1 -1
  235. package/lib/typescript/module/connectorBrandIcons.d.ts.map +1 -1
  236. package/lib/typescript/module/connectorBrandIcons.generated.d.ts +2 -0
  237. package/lib/typescript/module/connectorBrandIcons.generated.d.ts.map +1 -0
  238. package/lib/typescript/module/connectorCatalog.d.ts +2 -0
  239. package/lib/typescript/module/connectorCatalog.d.ts.map +1 -1
  240. package/lib/typescript/module/conversationParts.d.ts +1 -1
  241. package/lib/typescript/module/conversationParts.d.ts.map +1 -1
  242. package/lib/typescript/module/conversationRuntime.d.ts +6 -1
  243. package/lib/typescript/module/conversationRuntime.d.ts.map +1 -1
  244. package/lib/typescript/module/conversationStyles.d.ts.map +1 -1
  245. package/lib/typescript/module/editorShellStyles.d.ts +4 -0
  246. package/lib/typescript/module/editorShellStyles.d.ts.map +1 -1
  247. package/lib/typescript/module/index.d.ts +2 -0
  248. package/lib/typescript/module/index.d.ts.map +1 -1
  249. package/lib/typescript/module/markdownStyles.d.ts.map +1 -1
  250. package/lib/typescript/module/messageActionStyles.d.ts.map +1 -1
  251. package/lib/typescript/module/realtimeClient.d.ts.map +1 -1
  252. package/lib/typescript/module/renameAgentModalStyles.d.ts.map +1 -1
  253. package/lib/typescript/module/screenParts.d.ts +1 -1
  254. package/lib/typescript/module/screenParts.d.ts.map +1 -1
  255. package/lib/typescript/module/styles.d.ts +20 -11
  256. package/lib/typescript/module/styles.d.ts.map +1 -1
  257. package/lib/typescript/module/superagentApiClient.d.ts +2 -1
  258. package/lib/typescript/module/superagentApiClient.d.ts.map +1 -1
  259. package/lib/typescript/module/theme.d.ts +36 -0
  260. package/lib/typescript/module/theme.d.ts.map +1 -0
  261. package/lib/typescript/module/types.d.ts +16 -2
  262. package/lib/typescript/module/types.d.ts.map +1 -1
  263. package/lib/typescript/module/useSuperagentConversation.d.ts +3 -2
  264. package/lib/typescript/module/useSuperagentConversation.d.ts.map +1 -1
  265. package/lib/typescript/module/useSuperagentRuntime.d.ts +2 -1
  266. package/lib/typescript/module/useSuperagentRuntime.d.ts.map +1 -1
  267. package/package.json +1 -1
  268. package/src/AgentSettingsPanel.tsx +118 -49
  269. package/src/AgentSphereIcon.tsx +11 -62
  270. package/src/AttachmentPickerStatusModal.tsx +4 -3
  271. package/src/ChannelsPanel.tsx +59 -39
  272. package/src/ConversationChat.tsx +12 -3
  273. package/src/ConversationComposer.tsx +7 -6
  274. package/src/ConversationMessageList.tsx +1 -1
  275. package/src/ConversationScreen.tsx +3 -0
  276. package/src/EditorDrawer.tsx +66 -41
  277. package/src/FilesPanel.tsx +48 -20
  278. package/src/RenameAgentModal.tsx +2 -1
  279. package/src/ShareAgentModal.styles.ts +2 -1
  280. package/src/ShareAgentModal.tsx +9 -8
  281. package/src/SuperagentHomeScreen.tsx +27 -7
  282. package/src/ToolApprovalCard.tsx +82 -14
  283. package/src/ToolCallSummary.tsx +18 -12
  284. package/src/agentSphereAssets.ts +325 -0
  285. package/src/agentSphereStyles.ts +3 -2
  286. package/src/apiClient.ts +7 -0
  287. package/src/composerStyles.ts +2 -1
  288. package/src/connectorBrandIcons.generated.ts +618 -0
  289. package/src/connectorBrandIcons.tsx +1 -53
  290. package/src/connectorCatalog.ts +24 -0
  291. package/src/conversationParts.tsx +6 -5
  292. package/src/conversationRuntime.ts +123 -12
  293. package/src/conversationStyles.ts +2 -1
  294. package/src/editorShellStyles.ts +6 -1
  295. package/src/index.ts +2 -0
  296. package/src/markdownStyles.ts +2 -1
  297. package/src/messageActionStyles.ts +2 -1
  298. package/src/realtimeClient.ts +7 -1
  299. package/src/renameAgentModalStyles.ts +2 -1
  300. package/src/screenParts.tsx +17 -29
  301. package/src/styles.ts +63 -54
  302. package/src/superagentApiClient.ts +68 -18
  303. package/src/theme.ts +254 -0
  304. package/src/types.ts +21 -2
  305. package/src/useSuperagentConversation.ts +141 -24
  306. package/src/useSuperagentRuntime.ts +165 -84
package/src/styles.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import { StyleSheet } from 'react-native';
2
+ import { createThemedStyles } from './theme';
2
3
 
3
- export const styles = StyleSheet.create({
4
- safeArea: { flex: 1, backgroundColor: '#F7F7F8' },
4
+ export const styles = createThemedStyles({
5
+ safeArea: { flex: 1, backgroundColor: '#000000' },
5
6
  container: { paddingBottom: 34, paddingHorizontal: 14, paddingTop: 10 },
6
7
  homeTopBar: {
7
8
  alignItems: 'center',
8
- borderBottomColor: '#E4E4E7',
9
+ borderBottomColor: '#101012',
9
10
  borderBottomWidth: 1,
10
11
  flexDirection: 'row',
11
12
  minHeight: 62,
@@ -24,8 +25,15 @@ export const styles = StyleSheet.create({
24
25
  justifyContent: 'center',
25
26
  minWidth: 0,
26
27
  },
27
- topBarTitle: { color: '#18181B', fontSize: 17, fontWeight: '900', letterSpacing: 0, lineHeight: 21 },
28
- homeIntro: { marginBottom: 14, paddingTop: 2 },
28
+ topBarTitle: { color: '#F7F7F7', fontSize: 17, fontWeight: '900', letterSpacing: 0, lineHeight: 21 },
29
+ homeTitle: {
30
+ color: '#FAFAFA',
31
+ fontSize: 24,
32
+ fontWeight: '900',
33
+ marginBottom: 30,
34
+ marginTop: 60,
35
+ textAlign: 'center',
36
+ },
29
37
  header: {
30
38
  alignItems: 'center',
31
39
  flexDirection: 'row',
@@ -35,13 +43,13 @@ export const styles = StyleSheet.create({
35
43
  paddingTop: 4,
36
44
  },
37
45
  headerAccessory: { flexShrink: 0, marginLeft: 12 },
38
- eyebrow: { color: '#71717A', fontSize: 12, fontWeight: '800', marginTop: 2 },
39
- title: { color: '#18181B', fontSize: 24, fontWeight: '900', letterSpacing: 0, lineHeight: 29 },
40
- subtitle: { color: '#52525B', fontSize: 14, fontWeight: '600', lineHeight: 20, marginTop: 5 },
46
+ eyebrow: { color: '#8E8E93', fontSize: 12, fontWeight: '800', marginTop: 2 },
47
+ title: { color: '#F7F7F7', fontSize: 24, fontWeight: '900', letterSpacing: 0, lineHeight: 29 },
48
+ subtitle: { color: '#A1A1AA', fontSize: 14, fontWeight: '600', lineHeight: 20, marginTop: 5 },
41
49
  headerAvatar: {
42
50
  alignItems: 'center',
43
- backgroundColor: '#FFFFFF',
44
- borderColor: '#E4E4E7',
51
+ backgroundColor: '#151515',
52
+ borderColor: '#2A2A2A',
45
53
  borderRadius: 22,
46
54
  borderWidth: 1,
47
55
  height: 44,
@@ -50,16 +58,16 @@ export const styles = StyleSheet.create({
50
58
  },
51
59
  loadingPanel: {
52
60
  alignItems: 'center',
53
- backgroundColor: '#FFFFFF',
54
- borderColor: '#E4E4E7',
55
- borderRadius: 18,
61
+ backgroundColor: '#0B0B0C',
62
+ borderColor: '#242427',
63
+ borderRadius: 16,
56
64
  borderWidth: 1,
57
65
  padding: 32,
58
66
  },
59
67
  heroPanel: {
60
- backgroundColor: '#FFFFFF',
61
- borderColor: '#E4E4E7',
62
- borderRadius: 22,
68
+ backgroundColor: '#0B0B0C',
69
+ borderColor: '#242427',
70
+ borderRadius: 16,
63
71
  borderWidth: 1,
64
72
  overflow: 'hidden',
65
73
  padding: 14,
@@ -70,31 +78,26 @@ export const styles = StyleSheet.create({
70
78
  justifyContent: 'space-between',
71
79
  marginBottom: 16,
72
80
  },
73
- heroLabel: { color: '#71717A', fontSize: 11, fontWeight: '900', textTransform: 'uppercase' },
81
+ heroLabel: { color: '#8E8E93', fontSize: 11, fontWeight: '900', textTransform: 'uppercase' },
74
82
  agentCard: {
75
83
  alignItems: 'flex-start',
76
84
  flexDirection: 'row',
77
- minHeight: 100,
78
85
  },
79
86
  avatar: {
80
87
  alignItems: 'center',
81
- backgroundColor: '#F4F4F5',
82
- borderColor: '#E4E4E7',
83
- borderRadius: 24,
84
- borderWidth: 1,
85
88
  height: 52,
86
89
  justifyContent: 'center',
87
90
  width: 52,
88
91
  },
89
- avatarText: { color: '#18181B', fontSize: 18, fontWeight: '900' },
92
+ avatarText: { color: '#F7F7F7', fontSize: 18, fontWeight: '900' },
90
93
  agentCardBody: { flex: 1, marginLeft: 13, minWidth: 0 },
91
- agentName: { color: '#18181B', fontSize: 21, fontWeight: '900', lineHeight: 25 },
92
- agentDescription: { color: '#52525B', fontSize: 14, fontWeight: '600', lineHeight: 20, marginTop: 7 },
93
- chevron: { color: '#A1A1AA', fontSize: 20, fontWeight: '900' },
94
+ agentName: { color: '#F7F7F7', fontSize: 16, fontWeight: '900', lineHeight: 20 },
95
+ agentDescription: { color: '#BDBDC2', fontSize: 14, fontWeight: '600', lineHeight: 20, marginTop: 7 },
96
+ chevron: { color: '#8E8E93', fontSize: 20, fontWeight: '900' },
94
97
  agentMetaRow: { flexDirection: 'row', flexWrap: 'wrap', marginLeft: 65, marginTop: 14 },
95
98
  agentMetaPill: {
96
- backgroundColor: '#F4F4F5',
97
- borderColor: '#E4E4E7',
99
+ backgroundColor: '#151515',
100
+ borderColor: '#2A2A2A',
98
101
  borderRadius: 13,
99
102
  borderWidth: 1,
100
103
  marginRight: 7,
@@ -102,20 +105,20 @@ export const styles = StyleSheet.create({
102
105
  paddingHorizontal: 10,
103
106
  paddingVertical: 6,
104
107
  },
105
- agentMetaText: { color: '#3F3F46', fontSize: 12, fontWeight: '800' },
108
+ agentMetaText: { color: '#D4D4D8', fontSize: 12, fontWeight: '800' },
106
109
  emptyPanel: {
107
- backgroundColor: '#FFFFFF',
108
- borderColor: '#E4E4E7',
109
- borderRadius: 22,
110
+ backgroundColor: '#0B0B0C',
111
+ borderColor: '#242427',
112
+ borderRadius: 16,
110
113
  borderWidth: 1,
111
114
  padding: 16,
112
115
  },
113
- emptyTitle: { color: '#18181B', fontSize: 23, fontWeight: '900', lineHeight: 28, marginTop: 15 },
114
- emptyBody: { color: '#52525B', fontSize: 14, fontWeight: '600', lineHeight: 21, marginTop: 8 },
116
+ emptyTitle: { color: '#F7F7F7', fontSize: 23, fontWeight: '900', lineHeight: 28, marginTop: 15 },
117
+ emptyBody: { color: '#BDBDC2', fontSize: 14, fontWeight: '600', lineHeight: 21, marginTop: 8 },
115
118
  emptyChipRow: { flexDirection: 'row', flexWrap: 'wrap', marginTop: 14 },
116
119
  emptyChip: {
117
- backgroundColor: '#F4F4F5',
118
- borderColor: '#E4E4E7',
120
+ backgroundColor: '#151515',
121
+ borderColor: '#2A2A2A',
119
122
  borderRadius: 15,
120
123
  borderWidth: 1,
121
124
  marginRight: 7,
@@ -123,21 +126,24 @@ export const styles = StyleSheet.create({
123
126
  paddingHorizontal: 11,
124
127
  paddingVertical: 7,
125
128
  },
126
- emptyChipText: { color: '#3F3F46', fontSize: 12, fontWeight: '800' },
129
+ emptyChipText: { color: '#D4D4D8', fontSize: 12, fontWeight: '800' },
127
130
  primaryButton: {
128
131
  alignItems: 'center',
129
- backgroundColor: '#18181B',
132
+ backgroundColor: '#F4F4F5',
130
133
  borderRadius: 17,
131
134
  justifyContent: 'center',
132
135
  marginTop: 20,
133
136
  minHeight: 50,
134
137
  paddingHorizontal: 18,
135
138
  },
136
- primaryButtonText: { color: '#FFFFFF', fontSize: 16, fontWeight: '900' },
139
+ primaryButtonText: { color: '#111111', fontSize: 16, fontWeight: '900' },
140
+ // Overrides primaryButton's marginTop so the card's continue button sits 12px
141
+ // below the agent description (no meta pills between them anymore).
142
+ heroContinueButton: { marginTop: 12 },
137
143
  secondaryButton: {
138
144
  alignItems: 'center',
139
- backgroundColor: '#FFFFFF',
140
- borderColor: '#E4E4E7',
145
+ backgroundColor: '#151515',
146
+ borderColor: '#2A2A2A',
141
147
  borderRadius: 16,
142
148
  borderWidth: 1,
143
149
  flexDirection: 'row',
@@ -146,7 +152,14 @@ export const styles = StyleSheet.create({
146
152
  minHeight: 46,
147
153
  paddingHorizontal: 16,
148
154
  },
149
- secondaryButtonText: { color: '#18181B', fontSize: 14, fontWeight: '900', marginLeft: 7 },
155
+ secondaryButtonText: { color: '#F4F4F5', fontSize: 14, fontWeight: '900', marginLeft: 7 },
156
+ linkButton: {
157
+ alignItems: 'center',
158
+ justifyContent: 'center',
159
+ marginTop: 14,
160
+ paddingVertical: 12,
161
+ },
162
+ linkButtonText: { color: '#FF5A1F', fontSize: 14, fontWeight: '900' },
150
163
  recentSection: { marginTop: 22 },
151
164
  sectionHeader: {
152
165
  alignItems: 'center',
@@ -154,13 +167,13 @@ export const styles = StyleSheet.create({
154
167
  justifyContent: 'space-between',
155
168
  marginBottom: 10,
156
169
  },
157
- sectionTitle: { color: '#18181B', fontSize: 17, fontWeight: '900' },
158
- sectionCount: { color: '#A1A1AA', fontSize: 12, fontWeight: '900' },
170
+ sectionTitle: { color: '#F4F4F5', fontSize: 17, fontWeight: '900' },
171
+ sectionCount: { color: '#73737A', fontSize: 12, fontWeight: '900' },
159
172
  agentRow: {
160
173
  alignItems: 'center',
161
- backgroundColor: '#FFFFFF',
162
- borderColor: '#E4E4E7',
163
- borderRadius: 17,
174
+ backgroundColor: '#0B0B0C',
175
+ borderColor: '#242427',
176
+ borderRadius: 16,
164
177
  borderWidth: 1,
165
178
  flexDirection: 'row',
166
179
  justifyContent: 'space-between',
@@ -170,14 +183,10 @@ export const styles = StyleSheet.create({
170
183
  paddingVertical: 10,
171
184
  },
172
185
  agentRowBody: { flex: 1, marginLeft: 11, minWidth: 0 },
173
- agentRowName: { color: '#18181B', fontSize: 15, fontWeight: '900' },
174
- agentRowDescription: { color: '#71717A', fontSize: 12, fontWeight: '600', lineHeight: 17, marginTop: 3 },
186
+ agentRowName: { color: '#F4F4F5', fontSize: 15, fontWeight: '900' },
187
+ agentRowDescription: { color: '#8E8E93', fontSize: 12, fontWeight: '600', lineHeight: 17, marginTop: 3 },
175
188
  compactAvatar: {
176
189
  alignItems: 'center',
177
- backgroundColor: '#F4F4F5',
178
- borderColor: '#E4E4E7',
179
- borderRadius: 15,
180
- borderWidth: 1,
181
190
  height: 38,
182
191
  justifyContent: 'center',
183
192
  width: 38,
@@ -185,6 +194,6 @@ export const styles = StyleSheet.create({
185
194
  placeholder: { flex: 1, padding: 20 },
186
195
  backButton: { alignSelf: 'flex-start', marginBottom: 24, paddingVertical: 8 },
187
196
  backButtonText: { color: '#FF5A1F', fontSize: 16, fontWeight: '700' },
188
- helperText: { color: '#A1A1AA', fontSize: 12, fontWeight: '700', lineHeight: 18, marginTop: 12 },
197
+ helperText: { color: '#73737A', fontSize: 12, fontWeight: '700', lineHeight: 18, marginTop: 12 },
189
198
  pressed: { opacity: 0.72 },
190
199
  });
@@ -16,6 +16,7 @@ import type {
16
16
  SuperagentSecret,
17
17
  SuperagentTelegramChannelStatus,
18
18
  SuperagentToolPermissionConfig,
19
+ SuperagentWhatsAppChannelStatus,
19
20
  } from './types';
20
21
  import { SUPERAGENT_CONNECTOR_CATALOG } from './connectorCatalog';
21
22
  import { DEFAULT_SANDBOX_FILE_PATHS, normalizeFilePaths } from './fileTreeUtils';
@@ -80,6 +81,7 @@ type UserAgentApp = {
80
81
  type AppIntegration = {
81
82
  integration_type: string;
82
83
  integration_account_identifier?: string | null;
84
+ requires_connection_config?: boolean;
83
85
  scopes?: string[];
84
86
  status?: string;
85
87
  };
@@ -127,13 +129,22 @@ type IMessageStatusResponse = {
127
129
  phone_number?: string | null;
128
130
  };
129
131
 
132
+ type WhatsAppStatusResponse = {
133
+ connected: boolean;
134
+ user_handle?: string | null;
135
+ };
136
+
130
137
  type IMessageActivationResponse = {
131
138
  code?: string;
132
139
  phone_number?: string;
133
140
  };
134
141
 
135
- type SandboxFileListResponse = {
136
- files?: string[];
142
+ // /sandbox/files/list-entries returns rich entries (path + size/modified_at), and
143
+ // honors include_all (binaries). Legacy sandbox drivers may still emit bare path
144
+ // strings, so accept either.
145
+ type SandboxFileEntry = { path: string };
146
+ type SandboxFileEntriesResponse = {
147
+ files?: Array<SandboxFileEntry | string>;
137
148
  };
138
149
 
139
150
  export type SuperagentConnectorsResult = {
@@ -160,15 +171,16 @@ export function createSuperagentApiClient(config: SuperagentApiClientConfig) {
160
171
 
161
172
  return {
162
173
  async listAgents(): Promise<SuperagentAgent[]> {
163
- const query = {
164
- app_type: 'user_agent',
165
- ...(config.currentUserId ? {owner_id: config.currentUserId} : {}),
166
- };
174
+ // Match the web Superagent home/sidebar query: filter only by app_type and let
175
+ // the backend default (all_apps_workspace) scope to apps the user can access —
176
+ // owned AND those shared with them as an editor collaborator. Adding owner_id /
177
+ // filter_mode=owned_by_me intersects with ownership and hides shared agents
178
+ // (owned_by_me is also an admin-only mode on the backend). The backend already
179
+ // enforces access, so this only widens the list to what web already shows.
167
180
  const endpoint = buildUrl(appsEndpoint, {
168
181
  fields: AGENT_FIELDS,
169
- filter_mode: 'owned_by_me',
170
182
  limit: '9',
171
- q: JSON.stringify(query),
183
+ q: JSON.stringify({app_type: 'user_agent'}),
172
184
  skip: '0',
173
185
  sort: '-updated_date',
174
186
  });
@@ -240,7 +252,10 @@ export function createSuperagentApiClient(config: SuperagentApiClientConfig) {
240
252
  async saveSecret(agentId: string, name: string, value: string): Promise<void> {
241
253
  const response = await httpClient.post(
242
254
  `${appsEndpoint}/${encodeURIComponent(agentId)}/secrets`,
243
- {[name.trim().toUpperCase()]: value.trim()},
255
+ // Normalize only the key name — preserve the secret value byte-for-byte.
256
+ // Credentials (PEM/private keys, tokens with a trailing newline, passwords)
257
+ // can require exact leading/trailing whitespace; trimming would corrupt them.
258
+ {[name.trim().toUpperCase()]: value},
244
259
  true,
245
260
  );
246
261
  assertSuccess(response, 'Failed to save Superagent secret');
@@ -365,6 +380,12 @@ export function createSuperagentApiClient(config: SuperagentApiClientConfig) {
365
380
  return response.data.token;
366
381
  },
367
382
 
383
+ // The token rides in the query string here (unlike runtimeRequest's
384
+ // Authorization header) on purpose: this URL is opened as a *browser
385
+ // navigation* via nativeAdapters.openUrl (not an XHR), so headers can't be
386
+ // attached — the backend must authenticate it from the `token` query param.
387
+ // Hardening to a dedicated short-lived/single-use connect token is a backend
388
+ // follow-up; until that exists this is the only auth channel for a nav URL.
368
389
  getWhatsAppConnectUrl(agentId: string, runtimeAuthToken: string): string {
369
390
  return buildUrl(`${appsEndpoint}/${encodeURIComponent(agentId)}/agents/${USER_AGENT_AGENT_NAME}/whatsapp`, {
370
391
  token: runtimeAuthToken,
@@ -372,19 +393,24 @@ export function createSuperagentApiClient(config: SuperagentApiClientConfig) {
372
393
  },
373
394
 
374
395
  async getChannelStatus(agentId: string, runtimeAuthToken: string): Promise<SuperagentChannelStatus> {
375
- const [telegram, imessage] = await Promise.all([
396
+ const [telegram, imessage, whatsapp] = await Promise.all([
376
397
  this.getTelegramStatus(agentId, runtimeAuthToken).catch(() => ({connected: false})),
377
398
  this.getIMessageStatus(agentId, runtimeAuthToken).catch(() => ({connected: false})),
399
+ // null signals the editor-gated status call failed (e.g. 403 for viewers).
400
+ this.getWhatsAppStatus(agentId, runtimeAuthToken).catch(() => null),
378
401
  ]);
379
402
 
380
403
  return {
381
404
  imessage,
382
405
  line: {connected: false},
383
406
  telegram,
384
- whatsapp: {
385
- connected: false,
386
- connectUrl: this.getWhatsAppConnectUrl(agentId, runtimeAuthToken),
387
- },
407
+ // Only expose connectUrl (which carries the runtime token) when the
408
+ // editor-gated /whatsapp/status call succeeded. Viewers get a 403 there, so
409
+ // omit it — otherwise they'd hold a working WhatsApp connect URL even though
410
+ // the backend redirect doesn't re-check editor access.
411
+ whatsapp: whatsapp
412
+ ? {...whatsapp, connectUrl: this.getWhatsAppConnectUrl(agentId, runtimeAuthToken)}
413
+ : {connected: false},
388
414
  };
389
415
  },
390
416
 
@@ -404,6 +430,14 @@ export function createSuperagentApiClient(config: SuperagentApiClientConfig) {
404
430
  return normalizeIMessageStatus(response.data);
405
431
  },
406
432
 
433
+ async getWhatsAppStatus(agentId: string, runtimeAuthToken: string): Promise<SuperagentWhatsAppChannelStatus> {
434
+ const response = await runtimeRequest<WhatsAppStatusResponse>(httpClient, appsEndpoint, agentId, runtimeAuthToken, '/whatsapp/status', {
435
+ method: 'GET',
436
+ });
437
+ assertSuccess(response, 'Failed to load WhatsApp status');
438
+ return normalizeWhatsAppStatus(response.data);
439
+ },
440
+
407
441
  async generateIMessageCode(agentId: string, runtimeAuthToken: string): Promise<SuperagentIMessageActivation> {
408
442
  const response = await runtimeRequest<IMessageActivationResponse>(httpClient, appsEndpoint, agentId, runtimeAuthToken, '/imessage/generate-code', {
409
443
  method: 'POST',
@@ -664,13 +698,18 @@ async function listSandboxFilesAt(
664
698
  agentId: string,
665
699
  path: string,
666
700
  ): Promise<string[]> {
667
- const endpoint = buildUrl(`${appsEndpoint}/${encodeURIComponent(agentId)}/sandbox/files/list`, {
701
+ // Use list-entries, not list: /sandbox/files/list ignores include_all and
702
+ // filters out binary assets (PNG/PDF/...), so they never reach the native tree.
703
+ // recursive=true so nested files under each listed directory appear — the native
704
+ // tree is built from this one listing and has no per-folder lazy fetch.
705
+ const endpoint = buildUrl(`${appsEndpoint}/${encodeURIComponent(agentId)}/sandbox/files/list-entries`, {
668
706
  include_all: 'true',
669
707
  path,
708
+ recursive: 'true',
670
709
  });
671
- const response = await httpClient.get<SandboxFileListResponse>(endpoint, true);
710
+ const response = await httpClient.get<SandboxFileEntriesResponse>(endpoint, true);
672
711
  assertSuccess(response, 'Failed to load Superagent files');
673
- return response.data?.files ?? [];
712
+ return (response.data?.files ?? []).map((entry) => (typeof entry === 'string' ? entry : entry.path));
674
713
  }
675
714
 
676
715
  async function listUserAgentSandboxFilePaths(
@@ -747,6 +786,9 @@ function toConnector(integration: AppIntegration): SuperagentConnector {
747
786
  iconUrl: meta?.iconUrl,
748
787
  id: integration.integration_type,
749
788
  name: meta?.name ?? formatConnectorName(integration.integration_type),
789
+ // Trust the live backend flag from /external-auth/list as well as the static
790
+ // catalog metadata — either signalling config-required must surface in the UI.
791
+ requiresConnectionConfig: meta?.requiresConnectionConfig || integration.requires_connection_config,
750
792
  scopes: integration.scopes,
751
793
  status: normalizeConnectorStatus(integration.status),
752
794
  subtitle: meta?.subtitle,
@@ -812,7 +854,8 @@ function getAutomationType(automation: SuperagentAutomation) {
812
854
  if (
813
855
  automation.automation_type === 'scheduled' ||
814
856
  automation.automation_type === 'entity' ||
815
- automation.automation_type === 'connector'
857
+ automation.automation_type === 'connector' ||
858
+ automation.automation_type === 'in_app_agent'
816
859
  ) {
817
860
  return automation.automation_type;
818
861
  }
@@ -850,6 +893,13 @@ function normalizeIMessageStatus(status: IMessageStatusResponse | undefined): Su
850
893
  };
851
894
  }
852
895
 
896
+ function normalizeWhatsAppStatus(status: WhatsAppStatusResponse | undefined): SuperagentWhatsAppChannelStatus {
897
+ return {
898
+ connected: !!status?.connected,
899
+ userHandle: status?.user_handle ?? null,
900
+ };
901
+ }
902
+
853
903
  async function runtimeRequest<T = unknown>(
854
904
  httpClient: SuperagentHttpClient,
855
905
  appsEndpoint: string,
package/src/theme.ts ADDED
@@ -0,0 +1,254 @@
1
+ import { createContext, useContext } from 'react';
2
+ import { StyleSheet } from 'react-native';
3
+
4
+ /**
5
+ * Theming for the Superagent native package.
6
+ *
7
+ * All stylesheets in this package are authored in the original dark palette;
8
+ * light mode (the default) is derived by remapping those colors through the
9
+ * tables below. `createThemedStyles` builds both StyleSheets up front and
10
+ * returns a proxy that resolves against the active scheme on every property
11
+ * read, so existing `styles.foo` call sites keep working unchanged. The
12
+ * scheme lives in module state synced from the provider in
13
+ * SuperagentHomeScreen during render; nothing in the tree is memoized, so a
14
+ * scheme change at the root re-renders (and re-reads) everything.
15
+ */
16
+
17
+ export type SuperagentColorScheme = 'light' | 'dark';
18
+
19
+ let currentScheme: SuperagentColorScheme = 'light';
20
+
21
+ export function getSuperagentColorScheme(): SuperagentColorScheme {
22
+ return currentScheme;
23
+ }
24
+
25
+ export function syncSuperagentColorScheme(scheme: SuperagentColorScheme) {
26
+ currentScheme = scheme;
27
+ }
28
+
29
+ export const SuperagentThemeContext = createContext<{
30
+ scheme: SuperagentColorScheme;
31
+ setScheme: (scheme: SuperagentColorScheme) => void;
32
+ }>({ scheme: 'light', setScheme: () => {} });
33
+
34
+ export function useSuperagentTheme() {
35
+ return useContext(SuperagentThemeContext);
36
+ }
37
+
38
+ // Dark background -> light background.
39
+ const BG_MAP: Record<string, string> = {
40
+ '#000000': '#F3F3F3',
41
+ '#050505': '#FFFFFF',
42
+ '#070707': '#FFFFFF',
43
+ '#080808': '#FFFFFF',
44
+ '#0A0A0A': '#FFFFFF',
45
+ '#0B0B0C': '#FFFFFF',
46
+ '#0F0F10': '#FFFFFF',
47
+ '#101010': '#FFFFFF',
48
+ '#101012': '#FFFFFF',
49
+ '#111111': '#FFFFFF',
50
+ '#111113': '#FFFFFF',
51
+ '#141414': '#FFFFFF',
52
+ '#151515': '#F4F4F5',
53
+ '#171717': '#F4F4F5',
54
+ '#181818': '#F4F4F5',
55
+ '#1B1B1B': '#F4F4F5',
56
+ '#1F1F22': '#F4F4F5',
57
+ '#1F1F23': '#F4F4F5',
58
+ '#242424': '#F4F4F5',
59
+ '#242427': '#F4F4F5',
60
+ '#252528': '#F4F4F5',
61
+ '#262626': '#F4F4F5',
62
+ '#2A2A2A': '#E4E4E7',
63
+ '#2C2C2E': '#E4E4E7',
64
+ '#3A3A3E': '#E4E4E7',
65
+ '#BDBDC2': '#A1A1AA',
66
+ '#F4F4F5': '#18181B',
67
+ // Cream CTAs become the dark CTA treatment on light surfaces.
68
+ '#F7F3E7': '#18181B',
69
+ '#F4F0E6': '#18181B',
70
+ // Status / accent tints.
71
+ '#11251A': '#DCFCE7',
72
+ '#13231D': '#DCFCE7',
73
+ '#21110A': '#FFEDD5',
74
+ '#1D120D': '#FFEDD5',
75
+ '#1C0F10': '#FEE2E2',
76
+ '#241111': '#FEE2E2',
77
+ '#351516': '#FEE2E2',
78
+ '#102036': '#DBEAFE',
79
+ '#1E1B4B': '#E0E7FF',
80
+ '#312E81': '#E0E7FF',
81
+ };
82
+
83
+ // Dark border -> light border.
84
+ const BORDER_MAP: Record<string, string> = {
85
+ '#101012': '#E4E4E7',
86
+ '#1F1F23': '#E4E4E7',
87
+ '#242427': '#E4E4E7',
88
+ '#242429': '#E4E4E7',
89
+ '#252529': '#E4E4E7',
90
+ '#27272A': '#E4E4E7',
91
+ '#29292E': '#E4E4E7',
92
+ '#2A2A2A': '#E4E4E7',
93
+ '#2A2A2D': '#E4E4E7',
94
+ '#2A2A2E': '#E4E4E7',
95
+ '#303035': '#E4E4E7',
96
+ '#333333': '#E4E4E7',
97
+ '#333338': '#E4E4E7',
98
+ '#34343A': '#E4E4E7',
99
+ '#353535': '#E4E4E7',
100
+ '#353539': '#E4E4E7',
101
+ '#38383D': '#E4E4E7',
102
+ '#3A3A3C': '#E4E4E7',
103
+ '#3F3F46': '#D4D4D8',
104
+ '#F4F4F5': '#18181B',
105
+ // Status borders.
106
+ '#3B2222': '#FECACA',
107
+ '#552022': '#FECACA',
108
+ '#5F2424': '#FECACA',
109
+ '#3A2317': '#FED7AA',
110
+ '#4A2413': '#FED7AA',
111
+ };
112
+
113
+ // Dark foreground (text / icons) -> light foreground.
114
+ const TEXT_MAP: Record<string, string> = {
115
+ '#FFFFFF': '#18181B',
116
+ // Home title: near-white in dark mode, #0F0F0F in light (per design spec).
117
+ '#FAFAFA': '#0F0F0F',
118
+ // Dark-on-light-accent foregrounds invert with their CTA surfaces.
119
+ '#111111': '#FFFFFF',
120
+ '#F7F7F7': '#18181B',
121
+ '#F4F4F5': '#18181B',
122
+ '#E4E4E7': '#3F3F46',
123
+ '#DADADA': '#3F3F46',
124
+ '#D4D4D8': '#3F3F46',
125
+ '#C7C7CC': '#52525B',
126
+ '#BDBDC2': '#52525B',
127
+ '#A1A1AA': '#52525B',
128
+ '#8E8E93': '#71717A',
129
+ '#73737A': '#A1A1AA',
130
+ // Status / accent foregrounds tuned for light surfaces.
131
+ '#FCA5A5': '#DC2626',
132
+ '#FECACA': '#B91C1C',
133
+ '#FF6B6B': '#DC2626',
134
+ '#86EFAC': '#15803D',
135
+ '#34D399': '#059669',
136
+ '#FDE68A': '#A16207',
137
+ '#F8D77B': '#A16207',
138
+ '#FDE047': '#A16207',
139
+ '#FBBF24': '#B45309',
140
+ '#C9CAF8': '#4F46E5',
141
+ '#A5B4FC': '#4F46E5',
142
+ '#E0E7FF': '#3730A3',
143
+ '#93C5FD': '#1D4ED8',
144
+ '#8AB4F8': '#1D4ED8',
145
+ };
146
+
147
+ /** Light-mode color for a dark-authored foreground (text / icon) color. */
148
+ export function themedColor(darkColor: string): string {
149
+ if (currentScheme === 'dark') {
150
+ return darkColor;
151
+ }
152
+ return TEXT_MAP[darkColor.toUpperCase()] ?? darkColor;
153
+ }
154
+
155
+ /** Light-mode color for a dark-authored surface (background) color. */
156
+ export function themedSurface(darkColor: string): string {
157
+ if (currentScheme === 'dark') {
158
+ return darkColor;
159
+ }
160
+ return BG_MAP[darkColor.toUpperCase()] ?? darkColor;
161
+ }
162
+
163
+ /** Light-mode color for a dark-authored border color. */
164
+ export function themedBorder(darkColor: string): string {
165
+ if (currentScheme === 'dark') {
166
+ return darkColor;
167
+ }
168
+ return BORDER_MAP[darkColor.toUpperCase()] ?? darkColor;
169
+ }
170
+
171
+ // Brand typography: Wix Madefor, with the original heavy weights stepped
172
+ // down to match the web app's lighter look. Native consumers must bundle the
173
+ // "Wix Madefor Text" font family; the web demo loads it from Google Fonts.
174
+ const SUPERAGENT_FONT_FAMILY = 'Wix Madefor Text';
175
+
176
+ const FONT_WEIGHT_MAP: Record<string, string> = {
177
+ '900': '600',
178
+ '800': '500',
179
+ '700': '500',
180
+ '600': '400',
181
+ bold: '600',
182
+ };
183
+
184
+ function applyTypography(style: Record<string, unknown>) {
185
+ const isText = 'fontSize' in style || 'fontWeight' in style || 'lineHeight' in style;
186
+ if (!isText) {
187
+ return style;
188
+ }
189
+ const next = { ...style };
190
+ if (!next.fontFamily) {
191
+ next.fontFamily = SUPERAGENT_FONT_FAMILY;
192
+ }
193
+ const weight = next.fontWeight;
194
+ if (typeof weight === 'string' && FONT_WEIGHT_MAP[weight]) {
195
+ next.fontWeight = FONT_WEIGHT_MAP[weight];
196
+ }
197
+ return next;
198
+ }
199
+
200
+ const BG_KEYS = new Set(['backgroundColor']);
201
+ const BORDER_KEYS = new Set([
202
+ 'borderColor',
203
+ 'borderTopColor',
204
+ 'borderBottomColor',
205
+ 'borderLeftColor',
206
+ 'borderRightColor',
207
+ ]);
208
+ const TEXT_KEYS = new Set(['color', 'textDecorationColor', 'tintColor']);
209
+ // shadowColor stays dark in both schemes.
210
+
211
+ function toLightStyle(style: Record<string, unknown>) {
212
+ const light: Record<string, unknown> = {};
213
+ for (const [key, value] of Object.entries(style)) {
214
+ if (typeof value === 'string' && value.startsWith('#')) {
215
+ const upper = value.toUpperCase();
216
+ if (BG_KEYS.has(key)) {
217
+ light[key] = BG_MAP[upper] ?? value;
218
+ continue;
219
+ }
220
+ if (BORDER_KEYS.has(key)) {
221
+ light[key] = BORDER_MAP[upper] ?? value;
222
+ continue;
223
+ }
224
+ if (TEXT_KEYS.has(key)) {
225
+ light[key] = TEXT_MAP[upper] ?? value;
226
+ continue;
227
+ }
228
+ }
229
+ light[key] = value;
230
+ }
231
+ return light;
232
+ }
233
+
234
+ /**
235
+ * Drop-in replacement for StyleSheet.create: takes dark-authored styles and
236
+ * returns a proxy resolving each style against the active color scheme.
237
+ */
238
+ export function createThemedStyles<T extends StyleSheet.NamedStyles<T>>(base: T): T {
239
+ const typographyBase = Object.fromEntries(
240
+ Object.entries(base).map(([name, style]) => [name, applyTypography(style as Record<string, unknown>)]),
241
+ );
242
+ const dark = StyleSheet.create(typographyBase as unknown as T);
243
+ const lightBase = Object.fromEntries(
244
+ Object.entries(typographyBase).map(([name, style]) => [name, toLightStyle(style as Record<string, unknown>)]),
245
+ );
246
+ const light = StyleSheet.create(lightBase as unknown as T);
247
+
248
+ return new Proxy(dark, {
249
+ get(_, property) {
250
+ const sheets = currentScheme === 'dark' ? dark : light;
251
+ return sheets[property as keyof T];
252
+ },
253
+ });
254
+ }